// File: PrzemekWirkus[P]functional-workshop/src/examples.cpp
// Function: main
int main(int argc, char *argv[]) {
    // ######### Example 1 - sorting with binary predicate #########
    {
        cout << "Example 1:" << endl;

        int Table[] = {55, -7, 3, -9, 2, -9198, -937, 1, 473};
        const int TableSize = sizeof(Table) / sizeof(int);

        // Print C-style table:
        // for_each(Table, Table + TableSize, [] (int i) { cout << i << " "; }); cout << endl;
        TABLE_PRINT();

        // ### Variation 1.1, std::less predicate
        std::less<int> normalCompare;
        bool b = normalCompare(4, 6); // 4 < 6
        bubble_sort(Table, TableSize, normalCompare);     // Sort big -> small
        TABLE_PRINT();
        // or
        bubble_sort(Table, TableSize, std::less<int>());  // Like above
        TABLE_PRINT();

        // ### Variation 1.2, reverse sorting order
        bubble_sort(Table, TableSize, std::greater<int>()); // Sort small -> big, reverse order
        TABLE_PRINT();
        // or
        bubble_sort(Table, TableSize, std::not2(std::less<int>())); // Sort small -> big, reverse order
        TABLE_PRINT();

        // ### variation 1.3, sort as if values in array are absolute
        bubble_sort(Table, TableSize, absoluteLess());
        TABLE_PRINT();
        // or in reverse order
        bubble_sort(Table, TableSize, std::not2(absoluteLess()));
        TABLE_PRINT();
    }

    // ######### Example 2 #########
    {
        cout << "Example 2:" << endl;

        vector<int> vec = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1};
        VECTOR_PRINT();

        // ### variation 2.1
        // finds the first number in the int vector v which is less than 3
        vector<int>::reverse_iterator f = vec.rend();
        f = find_if(vec.rbegin(), vec.rend(), bind2nd(less<int>(), 3)); // bind 2nd!
        F_PRINT();

        // ### variation 2.2
        // finds the first number in the int vector v which is not less than 5
        f = std::find_if(vec.rbegin(), vec.rend(), std::bind1st(std::less<int>(), 5)); // bind 1nd!
        F_PRINT();

        // ### variation 2.3
        // finds the first number in the int vector v which is greater than 7
        f = std::find_if(vec.rbegin(), vec.rend(), std::bind2nd(std::greater<int>(), 7)); // bind 2nd!
        F_PRINT();

        // ### variation 2.4
        // finds the first number in the int vector v which is equal to 4
        f = std::find_if(vec.rbegin(), vec.rend(), std::bind1st(std::equal_to<int>(), 4)); // bind 1nd!
        F_PRINT();
    }

    // ######### Example 3 #########
    {
        // ### variation 3.1

    	vector<string> Gals = {
            string("Annabella"),
            string("Scheherazade"),
            string("Xaviera")};
        vector<string> Guys = {
            string("Bogey"),
            string("Amadeus"),
            string("Wladimir")};
        vector<string> Couples(3);

        // ### variation 3.2 transform with unary predicate
        // target == source
        std::transform(Guys.begin(),
                       Guys.end(),
                       Guys.begin(),
                        [] (string &s) {
                            for_each(begin(s), end(s),
                                [] (string::value_type &c) {
                                    if (c >= 'a' && c <= 'z') {
                                        c -= 'a' - 'A';
                                    }
                                }
                            );
                            return s;
                        });

        // Print
        for_each(Guys.begin(), Guys.end(), [] (const string &s) { cout << s << " "; }); cout << endl;

        // ### variation 3.3, transform and grab in lambda global variable as reference
        string connector = " and ";

        std::transform(Gals.begin(),
                       Gals.end(),
                       Guys.begin(),
                       Couples.begin(),
                       [&connector] (const std::string& a, const std::string& b) {
                            return a + connector + b;
                       });

        // Print
        for_each(Couples.begin(), Couples.end(), [] (const string &s) { cout << s << endl; });

    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x5c0, %rsp            # imm = 0x5C0
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq 0x8b98(%rip), %rdi      # 0xafd8
movq %rdi, -0x3e0(%rbp)
leaq 0x4c24(%rip), %rsi      # 0x7072
callq 0x2100
movq %rax, %rdi
movq 0x8b6b(%rip), %rsi      # 0xafc8
movq %rsi, -0x3d8(%rbp)
callq 0x2120
movaps 0x4ca0(%rip), %xmm0     # 0x7110
movaps %xmm0, -0x30(%rbp)
movaps 0x4c85(%rip), %xmm0     # 0x7100
movaps %xmm0, -0x40(%rbp)
movl $0x1d9, -0x20(%rbp)     # imm = 0x1D9
movl $0x9, -0x44(%rbp)
leaq -0x1c(%rbp), %rsi
movq %rsi, -0x3e8(%rbp)
leaq -0x40(%rbp), %rdi
movq %rdi, -0x3f0(%rbp)
callq 0x33f0
movq -0x3e0(%rbp), %rdi
movq -0x3d8(%rbp), %rsi
callq 0x2120
movl $0x4, -0x4c(%rbp)
movl $0x6, -0x50(%rbp)
leaq -0x47(%rbp), %rdi
movq %rdi, -0x400(%rbp)
leaq -0x4c(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x3bd0
movq -0x400(%rbp), %rdx
movq -0x3f0(%rbp), %rdi
movb %al, -0x48(%rbp)
movl $0x9, %esi
movl %esi, -0x3f4(%rbp)
callq 0x3c00
movq -0x3f0(%rbp), %rdi
movq -0x3e8(%rbp), %rsi
callq 0x3430
movq -0x3e0(%rbp), %rdi
movq -0x3d8(%rbp), %rsi
callq 0x2120
movl -0x3f4(%rbp), %esi
movq -0x3f0(%rbp), %rdi
leaq -0x53(%rbp), %rdx
callq 0x3c00
movq -0x3f0(%rbp), %rdi
movq -0x3e8(%rbp), %rsi
callq 0x3470
movq -0x3e0(%rbp), %rdi
movq -0x3d8(%rbp), %rsi
callq 0x2120
movl -0x3f4(%rbp), %esi
movq -0x3f0(%rbp), %rdi
leaq -0x56(%rbp), %rdx
callq 0x3cc0
movq -0x3f0(%rbp), %rdi
movq -0x3e8(%rbp), %rsi
callq 0x34b0
movq -0x3e0(%rbp), %rdi
movq -0x3d8(%rbp), %rsi
callq 0x2120
leaq -0x5b(%rbp), %rdi
callq 0x3e40
movl -0x3f4(%rbp), %esi
movq -0x3f0(%rbp), %rdi
leaq -0x5a(%rbp), %rdx
callq 0x3d80
movq -0x3f0(%rbp), %rdi
movq -0x3e8(%rbp), %rsi
callq 0x34f0
movq -0x3e0(%rbp), %rdi
movq -0x3d8(%rbp), %rsi
callq 0x2120
movl -0x3f4(%rbp), %esi
movq -0x3f0(%rbp), %rdi
leaq -0x60(%rbp), %rdx
callq 0x3e60
movq -0x3f0(%rbp), %rdi
movq -0x3e8(%rbp), %rsi
callq 0x3530
movq -0x3e0(%rbp), %rdi
movq -0x3d8(%rbp), %rsi
callq 0x2120
leaq -0x65(%rbp), %rdi
callq 0x3fe0
movl -0x3f4(%rbp), %esi
movq -0x3f0(%rbp), %rdi
leaq -0x64(%rbp), %rdx
callq 0x3f20
movq -0x3f0(%rbp), %rdi
movq -0x3e8(%rbp), %rsi
callq 0x3570
movq -0x3e0(%rbp), %rdi
movq -0x3d8(%rbp), %rsi
callq 0x2120
movq -0x3e0(%rbp), %rdi
leaq 0x4a09(%rip), %rsi      # 0x707d
callq 0x2100
movq -0x3d8(%rbp), %rsi
movq %rax, %rdi
callq 0x2120
movups 0x4ad1(%rip), %xmm0     # 0x7160
movups %xmm0, -0xb4(%rbp)
movups 0x4ab7(%rip), %xmm0     # 0x7154
movaps %xmm0, -0xc0(%rbp)
movups 0x4a99(%rip), %xmm0     # 0x7144
movaps %xmm0, -0xd0(%rbp)
movups 0x4a7b(%rip), %xmm0     # 0x7134
movaps %xmm0, -0xe0(%rbp)
movups 0x4a5d(%rip), %xmm0     # 0x7124
movaps %xmm0, -0xf0(%rbp)
leaq -0xf0(%rbp), %rax
movq %rax, -0x98(%rbp)
movq $0x13, -0x90(%rbp)
leaq -0xf1(%rbp), %rdi
movq %rdi, -0x3d0(%rbp)
callq 0x4000
movq -0x3d0(%rbp), %rcx
movq -0x98(%rbp), %rsi
movq -0x90(%rbp), %rdx
leaq -0x88(%rbp), %rdi
callq 0x4020
jmp 0x271d
leaq -0xf1(%rbp), %rdi
callq 0x40a0
leaq -0x88(%rbp), %rdi
movq %rdi, -0x408(%rbp)
callq 0x40c0
movq -0x408(%rbp), %rdi
movq %rax, -0x110(%rbp)
callq 0x40f0
movq %rax, -0x118(%rbp)
movq -0x110(%rbp), %rdi
movq -0x118(%rbp), %rsi
callq 0x35b0
jmp 0x276b
movq 0x8866(%rip), %rdi      # 0xafd8
movq 0x884f(%rip), %rsi      # 0xafc8
callq 0x2120
jmp 0x2780
leaq -0x128(%rbp), %rdi
leaq -0x88(%rbp), %rsi
movq %rsi, -0x418(%rbp)
callq 0x4120
movq -0x418(%rbp), %rsi
leaq -0x138(%rbp), %rdi
callq 0x41f0
movq -0x418(%rbp), %rsi
leaq -0x140(%rbp), %rdi
callq 0x4120
movl $0x3, -0x150(%rbp)
leaq -0x149(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0x4240
movq %rax, -0x410(%rbp)
jmp 0x27e6
movq -0x410(%rbp), %rax
movq %rax, -0x148(%rbp)
movq -0x148(%rbp), %rcx
leaq -0x130(%rbp), %rdi
leaq -0x138(%rbp), %rsi
leaq -0x140(%rbp), %rdx
callq 0x4170
jmp 0x2817
movq -0x130(%rbp), %rax
movq %rax, -0x128(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x4280
movq %rax, -0x420(%rbp)
jmp 0x283a
movq -0x420(%rbp), %rax
movl (%rax), %esi
movq 0x878e(%rip), %rdi      # 0xafd8
callq 0x21b0
movq %rax, -0x428(%rbp)
jmp 0x2858
movq -0x428(%rbp), %rdi
movq 0x8762(%rip), %rsi      # 0xafc8
callq 0x2120
jmp 0x286d
leaq -0x160(%rbp), %rdi
leaq -0x88(%rbp), %rsi
movq %rsi, -0x438(%rbp)
callq 0x41f0
movq -0x438(%rbp), %rsi
leaq -0x168(%rbp), %rdi
callq 0x4120
movl $0x5, -0x178(%rbp)
leaq -0x171(%rbp), %rdi
leaq -0x178(%rbp), %rsi
callq 0x4330
movq %rax, -0x430(%rbp)
jmp 0x28c0
movq -0x430(%rbp), %rax
movq %rax, -0x170(%rbp)
movq -0x170(%rbp), %rcx
leaq -0x158(%rbp), %rdi
leaq -0x160(%rbp), %rsi
leaq -0x168(%rbp), %rdx
callq 0x42b0
jmp 0x28f1
movq -0x158(%rbp), %rax
movq %rax, -0x128(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x4280
movq %rax, -0x440(%rbp)
jmp 0x2914
movq -0x440(%rbp), %rax
movl (%rax), %esi
movq 0x86b4(%rip), %rdi      # 0xafd8
callq 0x21b0
movq %rax, -0x448(%rbp)
jmp 0x2932
movq -0x448(%rbp), %rdi
movq 0x8688(%rip), %rsi      # 0xafc8
callq 0x2120
jmp 0x2947
leaq -0x188(%rbp), %rdi
leaq -0x88(%rbp), %rsi
movq %rsi, -0x458(%rbp)
callq 0x41f0
movq -0x458(%rbp), %rsi
leaq -0x190(%rbp), %rdi
callq 0x4120
movl $0x7, -0x1a0(%rbp)
leaq -0x199(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
callq 0x43f0
movq %rax, -0x450(%rbp)
jmp 0x299a
movq -0x450(%rbp), %rax
movq %rax, -0x198(%rbp)
movq -0x198(%rbp), %rcx
leaq -0x180(%rbp), %rdi
leaq -0x188(%rbp), %rsi
leaq -0x190(%rbp), %rdx
callq 0x4370
jmp 0x29cb
movq -0x180(%rbp), %rax
movq %rax, -0x128(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x4280
movq %rax, -0x460(%rbp)
jmp 0x29ee
movq -0x460(%rbp), %rax
movl (%rax), %esi
movq 0x85da(%rip), %rdi      # 0xafd8
callq 0x21b0
movq %rax, -0x468(%rbp)
jmp 0x2a0c
movq -0x468(%rbp), %rdi
movq 0x85ae(%rip), %rsi      # 0xafc8
callq 0x2120
jmp 0x2a21
leaq -0x1b0(%rbp), %rdi
leaq -0x88(%rbp), %rsi
movq %rsi, -0x478(%rbp)
callq 0x41f0
movq -0x478(%rbp), %rsi
leaq -0x1b8(%rbp), %rdi
callq 0x4120
movl $0x4, -0x1c8(%rbp)
leaq -0x1c1(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
callq 0x44b0
movq %rax, -0x470(%rbp)
jmp 0x2a74
movq -0x470(%rbp), %rax
movq %rax, -0x1c0(%rbp)
movq -0x1c0(%rbp), %rcx
leaq -0x1a8(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
leaq -0x1b8(%rbp), %rdx
callq 0x4430
jmp 0x2aa5
movq -0x1a8(%rbp), %rax
movq %rax, -0x128(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x4280
movq %rax, -0x480(%rbp)
jmp 0x2ac8
movq -0x480(%rbp), %rax
movl (%rax), %esi
movq 0x8500(%rip), %rdi      # 0xafd8
callq 0x21b0
movq %rax, -0x488(%rbp)
jmp 0x2ae6
movq -0x488(%rbp), %rdi
movq 0x84d4(%rip), %rsi      # 0xafc8
callq 0x2120
jmp 0x2afb
leaq -0x88(%rbp), %rdi
callq 0x44f0
movb $0x1, -0x25c(%rbp)
leaq -0x250(%rbp), %rax
movq %rax, -0x498(%rbp)
movq %rax, -0x258(%rbp)
leaq -0x259(%rbp), %rdi
movq %rdi, -0x490(%rbp)
callq 0x21d0
movq -0x498(%rbp), %rdi
movq -0x490(%rbp), %rdx
leaq 0x453d(%rip), %rsi      # 0x7088
callq 0x2150
jmp 0x2b52
leaq -0x230(%rbp), %rax
movq %rax, -0x4a8(%rbp)
movq %rax, -0x258(%rbp)
leaq -0x25a(%rbp), %rdi
movq %rdi, -0x4a0(%rbp)
callq 0x21d0
movq -0x4a8(%rbp), %rdi
movq -0x4a0(%rbp), %rdx
leaq 0x4503(%rip), %rsi      # 0x7092
callq 0x2150
jmp 0x2b96
leaq -0x210(%rbp), %rax
movq %rax, -0x4b8(%rbp)
movq %rax, -0x258(%rbp)
leaq -0x25b(%rbp), %rdi
movq %rdi, -0x4b0(%rbp)
callq 0x21d0
movq -0x4b8(%rbp), %rdi
movq -0x4b0(%rbp), %rdx
leaq 0x44cc(%rip), %rsi      # 0x709f
callq 0x2150
jmp 0x2bda
movb $0x0, -0x25c(%rbp)
leaq -0x250(%rbp), %rax
movq %rax, -0x1f0(%rbp)
movq $0x3, -0x1e8(%rbp)
leaq -0x25d(%rbp), %rdi
movq %rdi, -0x4c0(%rbp)
callq 0x4550
movq -0x4c0(%rbp), %rcx
movq -0x1f0(%rbp), %rsi
movq -0x1e8(%rbp), %rdx
leaq -0x1e0(%rbp), %rdi
callq 0x4570
jmp 0x2c30
leaq -0x25d(%rbp), %rdi
callq 0x45f0
leaq -0x250(%rbp), %rax
movq %rax, -0x4d0(%rbp)
addq $0x60, %rax
movq %rax, -0x4c8(%rbp)
movq -0x4c8(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x4d8(%rbp)
callq 0x20a0
movq -0x4d0(%rbp), %rcx
movq -0x4d8(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x4c8(%rbp)
jne 0x2c55
leaq -0x25b(%rbp), %rdi
callq 0x2130
leaq -0x25a(%rbp), %rdi
callq 0x2130
leaq -0x259(%rbp), %rdi
callq 0x2130
movb $0x1, -0x2f4(%rbp)
leaq -0x2e8(%rbp), %rax
movq %rax, -0x4e8(%rbp)
movq %rax, -0x2f0(%rbp)
leaq -0x2f1(%rbp), %rdi
movq %rdi, -0x4e0(%rbp)
callq 0x21d0
movq -0x4e8(%rbp), %rdi
movq -0x4e0(%rbp), %rdx
leaq 0x43b9(%rip), %rsi      # 0x70a7
callq 0x2150
jmp 0x2cf5
leaq -0x2c8(%rbp), %rax
movq %rax, -0x4f8(%rbp)
movq %rax, -0x2f0(%rbp)
leaq -0x2f2(%rbp), %rdi
movq %rdi, -0x4f0(%rbp)
callq 0x21d0
movq -0x4f8(%rbp), %rdi
movq -0x4f0(%rbp), %rdx
leaq 0x437b(%rip), %rsi      # 0x70ad
callq 0x2150
jmp 0x2d39
leaq -0x2a8(%rbp), %rax
movq %rax, -0x508(%rbp)
movq %rax, -0x2f0(%rbp)
leaq -0x2f3(%rbp), %rdi
movq %rdi, -0x500(%rbp)
callq 0x21d0
movq -0x508(%rbp), %rdi
movq -0x500(%rbp), %rdx
leaq 0x433f(%rip), %rsi      # 0x70b5
callq 0x2150
jmp 0x2d7d
movb $0x0, -0x2f4(%rbp)
leaq -0x2e8(%rbp), %rax
movq %rax, -0x288(%rbp)
movq $0x3, -0x280(%rbp)
leaq -0x2f5(%rbp), %rdi
movq %rdi, -0x510(%rbp)
callq 0x4550
movq -0x510(%rbp), %rcx
movq -0x288(%rbp), %rsi
movq -0x280(%rbp), %rdx
leaq -0x278(%rbp), %rdi
callq 0x4570
jmp 0x2dd3
leaq -0x2f5(%rbp), %rdi
callq 0x45f0
leaq -0x2e8(%rbp), %rax
movq %rax, -0x520(%rbp)
addq $0x60, %rax
movq %rax, -0x518(%rbp)
movq -0x518(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x528(%rbp)
callq 0x20a0
movq -0x520(%rbp), %rcx
movq -0x528(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x518(%rbp)
jne 0x2df8
leaq -0x2f3(%rbp), %rdi
callq 0x2130
leaq -0x2f2(%rbp), %rdi
callq 0x2130
leaq -0x2f1(%rbp), %rdi
callq 0x2130
leaq -0x311(%rbp), %rdi
movq %rdi, -0x530(%rbp)
callq 0x4550
movq -0x530(%rbp), %rdx
leaq -0x310(%rbp), %rdi
movl $0x3, %esi
callq 0x4610
jmp 0x2e7a
leaq -0x311(%rbp), %rdi
callq 0x45f0
leaq -0x278(%rbp), %rdi
movq %rdi, -0x540(%rbp)
callq 0x4680
movq -0x540(%rbp), %rdi
movq %rax, -0x320(%rbp)
callq 0x46b0
movq -0x540(%rbp), %rdi
movq %rax, -0x328(%rbp)
callq 0x4680
movq %rax, -0x330(%rbp)
movq -0x320(%rbp), %rdi
movq -0x328(%rbp), %rsi
movq -0x330(%rbp), %rdx
callq 0x3600
movq %rax, -0x538(%rbp)
jmp 0x2ee9
movq -0x538(%rbp), %rax
movq %rax, -0x340(%rbp)
leaq -0x278(%rbp), %rdi
movq %rdi, -0x548(%rbp)
callq 0x4680
movq -0x548(%rbp), %rdi
movq %rax, -0x348(%rbp)
callq 0x46b0
movq %rax, -0x350(%rbp)
movq -0x348(%rbp), %rdi
movq -0x350(%rbp), %rsi
callq 0x3690
jmp 0x2f39
movq 0x8098(%rip), %rdi      # 0xafd8
movq 0x8081(%rip), %rsi      # 0xafc8
callq 0x2120
jmp 0x2f4e
leaq -0x379(%rbp), %rdi
movq %rdi, -0x550(%rbp)
callq 0x21d0
movq -0x550(%rbp), %rdx
leaq 0x414f(%rip), %rsi      # 0x70be
leaq -0x378(%rbp), %rdi
callq 0x2150
jmp 0x2f7d
leaq -0x379(%rbp), %rdi
callq 0x2130
leaq -0x1e0(%rbp), %rdi
movq %rdi, -0x560(%rbp)
callq 0x4680
movq -0x560(%rbp), %rdi
movq %rax, -0x388(%rbp)
callq 0x46b0
movq %rax, -0x390(%rbp)
leaq -0x278(%rbp), %rdi
callq 0x4680
movq %rax, -0x398(%rbp)
leaq -0x310(%rbp), %rdi
callq 0x4680
movq %rax, -0x3a0(%rbp)
leaq -0x378(%rbp), %rax
movq %rax, -0x3a8(%rbp)
movq -0x388(%rbp), %rdi
movq -0x390(%rbp), %rsi
movq -0x398(%rbp), %rdx
movq -0x3a0(%rbp), %rcx
movq -0x3a8(%rbp), %r8
callq 0x36e0
movq %rax, -0x558(%rbp)
jmp 0x301b
movq -0x558(%rbp), %rax
movq %rax, -0x3b0(%rbp)
leaq -0x310(%rbp), %rdi
movq %rdi, -0x568(%rbp)
callq 0x4680
movq -0x568(%rbp), %rdi
movq %rax, -0x3b8(%rbp)
callq 0x46b0
movq %rax, -0x3c0(%rbp)
movq -0x3b8(%rbp), %rdi
movq -0x3c0(%rbp), %rsi
callq 0x3790
jmp 0x306b
leaq -0x378(%rbp), %rdi
callq 0x20a0
leaq -0x310(%rbp), %rdi
callq 0x46e0
leaq -0x278(%rbp), %rdi
callq 0x46e0
leaq -0x1e0(%rbp), %rdi
callq 0x46e0
xorl %eax, %eax
addq $0x5c0, %rsp            # imm = 0x5C0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0xf1(%rbp), %rdi
callq 0x40a0
jmp 0x33dc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x44f0
jmp 0x33dc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x31b0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x31a4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x3198
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0x25d(%rbp), %rdi
callq 0x45f0
leaq -0x250(%rbp), %rax
movq %rax, -0x578(%rbp)
addq $0x60, %rax
movq %rax, -0x570(%rbp)
movq -0x570(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x580(%rbp)
callq 0x20a0
movq -0x578(%rbp), %rcx
movq -0x580(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x570(%rbp)
jne 0x3165
jmp 0x3198
leaq -0x25b(%rbp), %rdi
callq 0x2130
leaq -0x25a(%rbp), %rdi
callq 0x2130
leaq -0x259(%rbp), %rdi
callq 0x2130
testb $0x1, -0x25c(%rbp)
jne 0x31c7
jmp 0x3214
movq -0x258(%rbp), %rax
leaq -0x250(%rbp), %rcx
cmpq %rax, %rcx
movq %rax, -0x588(%rbp)
je 0x3212
movq -0x588(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x590(%rbp)
callq 0x20a0
movq -0x590(%rbp), %rax
leaq -0x250(%rbp), %rcx
cmpq %rcx, %rax
movq %rax, -0x588(%rbp)
jne 0x31e1
jmp 0x3214
jmp 0x33dc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x32dd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x32d1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x32c5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0x2f5(%rbp), %rdi
callq 0x45f0
leaq -0x2e8(%rbp), %rax
movq %rax, -0x5a0(%rbp)
addq $0x60, %rax
movq %rax, -0x598(%rbp)
movq -0x598(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x5a8(%rbp)
callq 0x20a0
movq -0x5a0(%rbp), %rcx
movq -0x5a8(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x598(%rbp)
jne 0x3292
jmp 0x32c5
leaq -0x2f3(%rbp), %rdi
callq 0x2130
leaq -0x2f2(%rbp), %rdi
callq 0x2130
leaq -0x2f1(%rbp), %rdi
callq 0x2130
testb $0x1, -0x2f4(%rbp)
jne 0x32f4
jmp 0x3341
movq -0x2f0(%rbp), %rax
leaq -0x2e8(%rbp), %rcx
cmpq %rax, %rcx
movq %rax, -0x5b0(%rbp)
je 0x333f
movq -0x5b0(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x5b8(%rbp)
callq 0x20a0
movq -0x5b8(%rbp), %rax
leaq -0x2e8(%rbp), %rcx
cmpq %rcx, %rax
movq %rax, -0x5b0(%rbp)
jne 0x330e
jmp 0x3341
jmp 0x33d0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0x311(%rbp), %rdi
callq 0x45f0
jmp 0x33c4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x33b8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0x379(%rbp), %rdi
callq 0x2130
jmp 0x33b8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0x378(%rbp), %rdi
callq 0x20a0
leaq -0x310(%rbp), %rdi
callq 0x46e0
leaq -0x278(%rbp), %rdi
callq 0x46e0
leaq -0x1e0(%rbp), %rdi
callq 0x46e0
movq -0x100(%rbp), %rdi
callq 0x21c0
nopl (%rax,%rax)