aboutsummaryrefslogtreecommitdiffstats
path: root/test/libyul/yulOptimizerTests/fullSuite/abi_example1.yul
blob: cc6044d3b289df340f35c748781b903b66a22866 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
{
    let x := abi_encode_t_array$_t_array$_t_contract$_C_$55_$3_memory_$dyn_memory_ptr_to_t_array$_t_array$_t_address_$3_memory_$dyn_memory_ptr(mload(0), 0x20)
    let a, b, c, d := abi_decode_tuple_t_uint256t_uint256t_array$_t_uint256_$dyn_memory_ptrt_array$_t_array$_t_uint256_$2_memory_$dyn_memory_ptr(mload(0x20), mload(0x40))
    sstore(a, b)
    sstore(c, d)
    sstore(0, x)

    function abi_decode_t_address(offset, end) -> value
    {
        value := cleanup_revert_t_address(calldataload(offset))
    }
    function abi_decode_t_array$_t_address_$dyn_memory(offset, end) -> array
    {
        if iszero(slt(add(offset, 0x1f), end))
        {
            revert(0, 0)
        }
        let length := calldataload(offset)
        array := allocateMemory(array_allocation_size_t_array$_t_address_$dyn_memory(length))
        let dst := array
        mstore(array, length)
        offset := add(offset, 0x20)
        dst := add(dst, 0x20)
        let src := offset
        if gt(add(src, mul(length, 0x20)), end)
        {
            revert(0, 0)
        }
        for {
            let i := 0
        }
        lt(i, length)
        {
            i := add(i, 1)
        }
        {
            let elementPos := src
            mstore(dst, abi_decode_t_address(elementPos, end))
            dst := add(dst, 0x20)
            src := add(src, 0x20)
        }
    }
    function abi_decode_t_array$_t_array$_t_uint256_$2_memory_$dyn_memory_ptr(offset, end) -> array
    {
        if iszero(slt(add(offset, 0x1f), end))
        {
            revert(0, 0)
        }
        let length := calldataload(offset)
        array := allocateMemory(array_allocation_size_t_array$_t_array$_t_uint256_$2_memory_$dyn_memory_ptr(length))
        let dst := array
        mstore(array, length)
        offset := add(offset, 0x20)
        dst := add(dst, 0x20)
        let src := offset
        if gt(add(src, mul(length, 0x40)), end)
        {
            revert(0, 0)
        }
        for {
            let i := 0
        }
        lt(i, length)
        {
            i := add(i, 1)
        }
        {
            let elementPos := src
            mstore(dst, abi_decode_t_array$_t_uint256_$2_memory(elementPos, end))
            dst := add(dst, 0x20)
            src := add(src, 0x40)
        }
    }
    function abi_decode_t_array$_t_uint256_$2_memory(offset, end) -> array
    {
        if iszero(slt(add(offset, 0x1f), end))
        {
            revert(0, 0)
        }
        let length := 0x2
        array := allocateMemory(array_allocation_size_t_array$_t_uint256_$2_memory(length))
        let dst := array
        let src := offset
        if gt(add(src, mul(length, 0x20)), end)
        {
            revert(0, 0)
        }
        for {
            let i := 0
        }
        lt(i, length)
        {
            i := add(i, 1)
        }
        {
            let elementPos := src
            mstore(dst, abi_decode_t_uint256(elementPos, end))
            dst := add(dst, 0x20)
            src := add(src, 0x20)
        }
    }
    function abi_decode_t_array$_t_uint256_$dyn_memory(offset, end) -> array
    {
        if iszero(slt(add(offset, 0x1f), end))
        {
            revert(0, 0)
        }
        let length := calldataload(offset)
        array := allocateMemory(array_allocation_size_t_array$_t_uint256_$dyn_memory(length))
        let dst := array
        mstore(array, length)
        offset := add(offset, 0x20)
        dst := add(dst, 0x20)
        let src := offset
        if gt(add(src, mul(length, 0x20)), end)
        {
            revert(0, 0)
        }
        for {
            let i := 0
        }
        lt(i, length)
        {
            i := add(i, 1)
        }
        {
            let elementPos := src
            mstore(dst, abi_decode_t_uint256(elementPos, end))
            dst := add(dst, 0x20)
            src := add(src, 0x20)
        }
    }
    function abi_decode_t_array$_t_uint256_$dyn_memory_ptr(offset, end) -> array
    {
        if iszero(slt(add(offset, 0x1f), end))
        {
            revert(0, 0)
        }
        let length := calldataload(offset)
        array := allocateMemory(array_allocation_size_t_array$_t_uint256_$dyn_memory_ptr(length))
        let dst := array
        mstore(array, length)
        offset := add(offset, 0x20)
        dst := add(dst, 0x20)
        let src := offset
        if gt(add(src, mul(length, 0x20)), end)
        {
            revert(0, 0)
        }
        for {
            let i := 0
        }
        lt(i, length)
        {
            i := add(i, 1)
        }
        {
            let elementPos := src
            mstore(dst, abi_decode_t_uint256(elementPos, end))
            dst := add(dst, 0x20)
            src := add(src, 0x20)
        }
    }
    function abi_decode_t_contract$_C_$55(offset, end) -> value
    {
        value := cleanup_revert_t_contract$_C_$55(calldataload(offset))
    }
    function abi_decode_t_struct$_S_$11_memory_ptr(headStart, end) -> value
    {
        if slt(sub(end, headStart), 0x60)
        {
            revert(0, 0)
        }
        value := allocateMemory(0x60)
        {
            let offset := 0
            mstore(add(value, 0x0), abi_decode_t_uint256(add(headStart, offset), end))
        }
        {
            let offset := calldataload(add(headStart, 32))
            if gt(offset, 0xffffffffffffffff)
            {
                revert(0, 0)
            }
            mstore(add(value, 0x20), abi_decode_t_array$_t_uint256_$dyn_memory(add(headStart, offset), end))
        }
        {
            let offset := calldataload(add(headStart, 64))
            if gt(offset, 0xffffffffffffffff)
            {
                revert(0, 0)
            }
            mstore(add(value, 0x40), abi_decode_t_array$_t_address_$dyn_memory(add(headStart, offset), end))
        }
    }
    function abi_decode_t_uint256(offset, end) -> value
    {
        value := cleanup_revert_t_uint256(calldataload(offset))
    }
    function abi_decode_t_uint8(offset, end) -> value
    {
        value := cleanup_revert_t_uint8(calldataload(offset))
    }
    function abi_decode_tuple_t_contract$_C_$55t_uint8(headStart, dataEnd) -> value0, value1
    {
        if slt(sub(dataEnd, headStart), 64)
        {
            revert(0, 0)
        }
        {
            let offset := 0
            value0 := abi_decode_t_contract$_C_$55(add(headStart, offset), dataEnd)
        }
        {
            let offset := 32
            value1 := abi_decode_t_uint8(add(headStart, offset), dataEnd)
        }
    }
    function abi_decode_tuple_t_struct$_S_$11_memory_ptrt_uint256(headStart, dataEnd) -> value0, value1
    {
        if slt(sub(dataEnd, headStart), 64)
        {
            revert(0, 0)
        }
        {
            let offset := calldataload(add(headStart, 0))
            if gt(offset, 0xffffffffffffffff)
            {
                revert(0, 0)
            }
            value0 := abi_decode_t_struct$_S_$11_memory_ptr(add(headStart, offset), dataEnd)
        }
        {
            let offset := 32
            value1 := abi_decode_t_uint256(add(headStart, offset), dataEnd)
        }
    }
    function abi_decode_tuple_t_uint256t_uint256t_array$_t_uint256_$dyn_memory_ptrt_array$_t_array$_t_uint256_$2_memory_$dyn_memory_ptr(headStart, dataEnd) -> value0, value1, value2, value3
    {
        if slt(sub(dataEnd, headStart), 128)
        {
            revert(0, 0)
        }
        {
            let offset := 0
            value0 := abi_decode_t_uint256(add(headStart, offset), dataEnd)
        }
        {
            let offset := 32
            value1 := abi_decode_t_uint256(add(headStart, offset), dataEnd)
        }
        {
            let offset := calldataload(add(headStart, 64))
            if gt(offset, 0xffffffffffffffff)
            {
                revert(0, 0)
            }
            value2 := abi_decode_t_array$_t_uint256_$dyn_memory_ptr(add(headStart, offset), dataEnd)
        }
        {
            let offset := calldataload(add(headStart, 96))
            if gt(offset, 0xffffffffffffffff)
            {
                revert(0, 0)
            }
            value3 := abi_decode_t_array$_t_array$_t_uint256_$2_memory_$dyn_memory_ptr(add(headStart, offset), dataEnd)
        }
    }
    function abi_encode_t_array$_t_array$_t_contract$_C_$55_$3_memory_$dyn_memory_ptr_to_t_array$_t_array$_t_address_$3_memory_$dyn_memory_ptr(value, pos) -> end
    {
        let length := array_length_t_array$_t_array$_t_contract$_C_$55_$3_memory_$dyn_memory_ptr(value)
        mstore(pos, length)
        pos := add(pos, 0x20)
        let srcPtr := array_dataslot_t_array$_t_array$_t_contract$_C_$55_$3_memory_$dyn_memory_ptr(value)
        for {
            let i := 0
        }
        lt(i, length)
        {
            i := add(i, 1)
        }
        {
            abi_encode_t_array$_t_contract$_C_$55_$3_memory_to_t_array$_t_address_$3_memory_ptr(mload(srcPtr), pos)
            srcPtr := array_nextElement_t_array$_t_array$_t_contract$_C_$55_$3_memory_$dyn_memory_ptr(srcPtr)
            pos := add(pos, 0x60)
        }
        end := pos
    }
    function abi_encode_t_array$_t_contract$_C_$55_$3_memory_to_t_array$_t_address_$3_memory_ptr(value, pos)
    {
        let length := array_length_t_array$_t_contract$_C_$55_$3_memory(value)
        let srcPtr := array_dataslot_t_array$_t_contract$_C_$55_$3_memory(value)
        for {
            let i := 0
        }
        lt(i, length)
        {
            i := add(i, 1)
        }
        {
            abi_encode_t_contract$_C_$55_to_t_address(mload(srcPtr), pos)
            srcPtr := array_nextElement_t_array$_t_contract$_C_$55_$3_memory(srcPtr)
            pos := add(pos, 0x20)
        }
    }
    function abi_encode_t_bool_to_t_bool(value, pos)
    {
        mstore(pos, cleanup_assert_t_bool(value))
    }
    function abi_encode_t_contract$_C_$55_to_t_address(value, pos)
    {
        mstore(pos, convert_t_contract$_C_$55_to_t_address(value))
    }
    function abi_encode_t_uint16_to_t_uint16(value, pos)
    {
        mstore(pos, cleanup_assert_t_uint16(value))
    }
    function abi_encode_t_uint24_to_t_uint24(value, pos)
    {
        mstore(pos, cleanup_assert_t_uint24(value))
    }
    function abi_encode_tuple_t_bool__to_t_bool_(headStart, value0) -> tail
    {
        tail := add(headStart, 32)
        abi_encode_t_bool_to_t_bool(value0, add(headStart, 0))
    }
    function abi_encode_tuple_t_uint16_t_uint24_t_array$_t_array$_t_contract$_C_$55_$3_memory_$dyn_memory_ptr__to_t_uint16_t_uint24_t_array$_t_array$_t_address_$3_memory_$dyn_memory_ptr_(headStart, value2, value1, value0) -> tail
    {
        tail := add(headStart, 96)
        abi_encode_t_uint16_to_t_uint16(value0, add(headStart, 0))
        abi_encode_t_uint24_to_t_uint24(value1, add(headStart, 32))
        mstore(add(headStart, 64), sub(tail, headStart))
        tail := abi_encode_t_array$_t_array$_t_contract$_C_$55_$3_memory_$dyn_memory_ptr_to_t_array$_t_array$_t_address_$3_memory_$dyn_memory_ptr(value2, tail)
    }
    function allocateMemory(size) -> memPtr
    {
        memPtr := mload(64)
        let newFreePtr := add(memPtr, size)
        if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr))
        {
            revert(0, 0)
        }
        mstore(64, newFreePtr)
    }
    function array_allocation_size_t_array$_t_address_$dyn_memory(length) -> size
    {
        if gt(length, 0xffffffffffffffff)
        {
            revert(0, 0)
        }
        size := mul(length, 0x20)
        size := add(size, 0x20)
    }
    function array_allocation_size_t_array$_t_array$_t_uint256_$2_memory_$dyn_memory_ptr(length) -> size
    {
        if gt(length, 0xffffffffffffffff)
        {
            revert(0, 0)
        }
        size := mul(length, 0x20)
        size := add(size, 0x20)
    }
    function array_allocation_size_t_array$_t_uint256_$2_memory(length) -> size
    {
        if gt(length, 0xffffffffffffffff)
        {
            revert(0, 0)
        }
        size := mul(length, 0x20)
    }
    function array_allocation_size_t_array$_t_uint256_$dyn_memory(length) -> size
    {
        if gt(length, 0xffffffffffffffff)
        {
            revert(0, 0)
        }
        size := mul(length, 0x20)
        size := add(size, 0x20)
    }
    function array_allocation_size_t_array$_t_uint256_$dyn_memory_ptr(length) -> size
    {
        if gt(length, 0xffffffffffffffff)
        {
            revert(0, 0)
        }
        size := mul(length, 0x20)
        size := add(size, 0x20)
    }
    function array_dataslot_t_array$_t_array$_t_contract$_C_$55_$3_memory_$dyn_memory_ptr(memPtr) -> dataPtr
    {
        dataPtr := add(memPtr, 0x20)
    }
    function array_dataslot_t_array$_t_contract$_C_$55_$3_memory(memPtr) -> dataPtr
    {
        dataPtr := memPtr
    }
    function array_length_t_array$_t_array$_t_contract$_C_$55_$3_memory_$dyn_memory_ptr(value) -> length
    {
        length := mload(value)
    }
    function array_length_t_array$_t_contract$_C_$55_$3_memory(value) -> length
    {
        length := 0x3
    }
    function array_nextElement_t_array$_t_array$_t_contract$_C_$55_$3_memory_$dyn_memory_ptr(memPtr) -> nextPtr
    {
        nextPtr := add(memPtr, 0x20)
    }
    function array_nextElement_t_array$_t_contract$_C_$55_$3_memory(memPtr) -> nextPtr
    {
        nextPtr := add(memPtr, 0x20)
    }
    function cleanup_assert_t_address(value) -> cleaned
    {
        cleaned := cleanup_assert_t_uint160(value)
    }
    function cleanup_assert_t_bool(value) -> cleaned
    {
        cleaned := iszero(iszero(value))
    }
    function cleanup_assert_t_uint16(value) -> cleaned
    {
        cleaned := and(value, 0xFFFF)
    }
    function cleanup_assert_t_uint160(value) -> cleaned
    {
        cleaned := and(value, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)
    }
    function cleanup_assert_t_uint24(value) -> cleaned
    {
        cleaned := and(value, 0xFFFFFF)
    }
    function cleanup_revert_t_address(value) -> cleaned
    {
        cleaned := cleanup_assert_t_uint160(value)
    }
    function cleanup_revert_t_contract$_C_$55(value) -> cleaned
    {
        cleaned := cleanup_assert_t_address(value)
    }
    function cleanup_revert_t_uint256(value) -> cleaned
    {
        cleaned := value
    }
    function cleanup_revert_t_uint8(value) -> cleaned
    {
        cleaned := and(value, 0xFF)
    }
    function convert_t_contract$_C_$55_to_t_address(value) -> converted
    {
        converted := convert_t_contract$_C_$55_to_t_uint160(value)
    }
    function convert_t_contract$_C_$55_to_t_uint160(value) -> converted
    {
        converted := cleanup_assert_t_uint160(value)
    }
}
// ----
// fullSuite
// {
//     {
//         let _1 := 0x20
//         let _2 := 0
//         let _485 := mload(_2)
//         let abi_encode_pos := _1
//         let abi_encode_length_68 := mload(_485)
//         mstore(_1, abi_encode_length_68)
//         let abi_encode_pos_590 := 64
//         abi_encode_pos := abi_encode_pos_590
//         let abi_encode_srcPtr := add(_485, _1)
//         for {
//             let abi_encode_i_69 := _2
//         }
//         lt(abi_encode_i_69, abi_encode_length_68)
//         {
//             abi_encode_i_69 := add(abi_encode_i_69, 1)
//         }
//         {
//             let _922 := mload(abi_encode_srcPtr)
//             let abi_encode_pos_71_1029 := abi_encode_pos
//             let abi_encode_length_72_1030 := 0x3
//             let abi_encode_srcPtr_73_1031 := _922
//             for {
//                 let abi_encode_i_74_1032 := _2
//             }
//             lt(abi_encode_i_74_1032, abi_encode_length_72_1030)
//             {
//                 abi_encode_i_74_1032 := add(abi_encode_i_74_1032, 1)
//             }
//             {
//                 mstore(abi_encode_pos_71_1029, and(mload(abi_encode_srcPtr_73_1031), 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))
//                 abi_encode_srcPtr_73_1031 := add(abi_encode_srcPtr_73_1031, _1)
//                 abi_encode_pos_71_1029 := add(abi_encode_pos_71_1029, _1)
//             }
//             abi_encode_srcPtr := add(abi_encode_srcPtr, _1)
//             abi_encode_pos := add(abi_encode_pos, 0x60)
//         }
//         let _924 := 0x40
//         let _487 := mload(_924)
//         let _488 := mload(_1)
//         let abi_decode_value0_60_618
//         let abi_decode_value0_60 := abi_decode_value0_60_618
//         let abi_decode_value1_61_619
//         let abi_decode_value1_61 := abi_decode_value1_61_619
//         let abi_decode_value2_620
//         let abi_decode_value2 := abi_decode_value2_620
//         let abi_decode_value3_621
//         let abi_decode_value3 := abi_decode_value3_621
//         if slt(sub(_487, _488), 128)
//         {
//             revert(_2, _2)
//         }
//         {
//             abi_decode_value0_60 := calldataload(_488)
//         }
//         {
//             abi_decode_value1_61 := calldataload(add(_488, 32))
//         }
//         {
//             let abi_decode_offset_64 := calldataload(add(_488, abi_encode_pos_590))
//             let _931 := 0xffffffffffffffff
//             if gt(abi_decode_offset_64, _931)
//             {
//                 revert(_2, _2)
//             }
//             let _933 := add(_488, abi_decode_offset_64)
//             if iszero(slt(add(_933, 0x1f), _487))
//             {
//                 revert(_2, _2)
//             }
//             let abi_decode_length_30_1038 := calldataload(_933)
//             if gt(abi_decode_length_30_1038, _931)
//             {
//                 revert(_2, _2)
//             }
//             let abi_decode_array_allo__561 := mul(abi_decode_length_30_1038, _1)
//             let abi_decode_array_29_279_1039 := allocateMemory(add(abi_decode_array_allo__561, _1))
//             let abi_decode_dst_31_1040 := abi_decode_array_29_279_1039
//             mstore(abi_decode_array_29_279_1039, abi_decode_length_30_1038)
//             let abi_decode_offset_27_281_1041 := add(_933, _1)
//             abi_decode_dst_31_1040 := add(abi_decode_array_29_279_1039, _1)
//             let abi_decode_src_32_1042 := abi_decode_offset_27_281_1041
//             if gt(add(add(_933, abi_decode_array_allo__561), _1), _487)
//             {
//                 revert(_2, _2)
//             }
//             for {
//                 let abi_decode_i_33_1044 := _2
//             }
//             lt(abi_decode_i_33_1044, abi_decode_length_30_1038)
//             {
//                 abi_decode_i_33_1044 := add(abi_decode_i_33_1044, 1)
//             }
//             {
//                 mstore(abi_decode_dst_31_1040, calldataload(abi_decode_src_32_1042))
//                 abi_decode_dst_31_1040 := add(abi_decode_dst_31_1040, _1)
//                 abi_decode_src_32_1042 := add(abi_decode_src_32_1042, _1)
//             }
//             abi_decode_value2 := abi_decode_array_29_279_1039
//         }
//         {
//             let abi_decode_offset_65 := calldataload(add(_488, 96))
//             let _936 := 0xffffffffffffffff
//             if gt(abi_decode_offset_65, _936)
//             {
//                 revert(_2, _2)
//             }
//             let _938 := add(_488, abi_decode_offset_65)
//             let abi_decode__489_1048 := 0x1f
//             if iszero(slt(add(_938, abi_decode__489_1048), _487))
//             {
//                 revert(_2, _2)
//             }
//             let abi_decode_length_6_1050 := calldataload(_938)
//             if gt(abi_decode_length_6_1050, _936)
//             {
//                 revert(_2, _2)
//             }
//             let abi_decode_array_5_254_1051 := allocateMemory(add(mul(abi_decode_length_6_1050, _1), _1))
//             let abi_decode_dst_7_1052 := abi_decode_array_5_254_1051
//             mstore(abi_decode_array_5_254_1051, abi_decode_length_6_1050)
//             let abi_decode_offset_3_256_1053 := add(_938, _1)
//             abi_decode_dst_7_1052 := add(abi_decode_array_5_254_1051, _1)
//             let abi_decode_src_8_1054 := abi_decode_offset_3_256_1053
//             if gt(add(add(_938, mul(abi_decode_length_6_1050, _924)), _1), _487)
//             {
//                 revert(_2, _2)
//             }
//             for {
//                 let abi_decode_i_9_1058 := _2
//             }
//             lt(abi_decode_i_9_1058, abi_decode_length_6_1050)
//             {
//                 abi_decode_i_9_1058 := add(abi_decode_i_9_1058, 1)
//             }
//             {
//                 if iszero(slt(add(abi_decode_src_8_1054, abi_decode__489_1048), _487))
//                 {
//                     revert(_2, _2)
//                 }
//                 let abi_decode_abi_decode_length_14 := 0x2
//                 if _2
//                 {
//                     revert(_2, _2)
//                 }
//                 let allocateMe_memPtr_315 := mload(abi_encode_pos_590)
//                 let allocateMe_newFreePtr := add(allocateMe_memPtr_315, abi_encode_pos_590)
//                 if or(gt(allocateMe_newFreePtr, _936), lt(allocateMe_newFreePtr, allocateMe_memPtr_315))
//                 {
//                     revert(_2, _2)
//                 }
//                 mstore(abi_encode_pos_590, allocateMe_newFreePtr)
//                 let abi_decode_abi_decode_dst_15 := allocateMe_memPtr_315
//                 let abi_decode_abi_decode_src_16 := abi_decode_src_8_1054
//                 if gt(add(abi_decode_src_8_1054, abi_encode_pos_590), _487)
//                 {
//                     revert(_2, _2)
//                 }
//                 for {
//                     let abi_decode_abi_decode_i_17 := _2
//                 }
//                 lt(abi_decode_abi_decode_i_17, abi_decode_abi_decode_length_14)
//                 {
//                     abi_decode_abi_decode_i_17 := add(abi_decode_abi_decode_i_17, 1)
//                 }
//                 {
//                     mstore(abi_decode_abi_decode_dst_15, calldataload(abi_decode_abi_decode_src_16))
//                     abi_decode_abi_decode_dst_15 := add(abi_decode_abi_decode_dst_15, _1)
//                     abi_decode_abi_decode_src_16 := add(abi_decode_abi_decode_src_16, _1)
//                 }
//                 mstore(abi_decode_dst_7_1052, allocateMe_memPtr_315)
//                 abi_decode_dst_7_1052 := add(abi_decode_dst_7_1052, _1)
//                 abi_decode_src_8_1054 := add(abi_decode_src_8_1054, _924)
//             }
//             abi_decode_value3 := abi_decode_array_5_254_1051
//         }
//         sstore(abi_decode_value0_60, abi_decode_value1_61)
//         sstore(abi_decode_value2, abi_decode_value3)
//         sstore(_2, abi_encode_pos)
//     }
//     function allocateMemory(size) -> memPtr
//     {
//         let _199 := 64
//         let memPtr_315 := mload(_199)
//         memPtr := memPtr_315
//         let newFreePtr := add(memPtr_315, size)
//         if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr_315))
//         {
//             let _204 := 0
//             revert(_204, _204)
//         }
//         mstore(_199, newFreePtr)
//     }
// }