// File: /workspace/github_cpp_makefile_star2_O3/shreyas-gopalakrishna[P]Concurrent-Skip-list/unit_test_2.cpp
// Function: main
int main(int argc, char *argv[]){

    cout << "\n---------- Unit Test - 2 ----------" << endl;

    cout << "\nThis Unit test uses 8 Threads. Numbers (1-2000) are inserted into the skip list parallelly." << endl;
    cout << "Then a few numbers at random are removed from the skip list parallelly. And next a few numbers are searched in the skip list." << endl;
    cout << "Finally, few Range operations are done in the skip list parallelly. " << endl;
    cout << "This is an automated test, and only the test results are displayed. " << endl;
    

	generate_input(2000);

    skiplist = SkipList(numbers_insert.size(), 0.5);

    vector<thread> threads;
    int chunk_size;

    // insert
    try{
        chunk_size = ceil(float(numbers_insert.size()) / num_threads);
        for(size_t i = 0; i < numbers_insert.size(); i = i + chunk_size){
            threads.push_back(thread(skiplist_add, i, i+chunk_size));
        }
        for (auto &th : threads) {
            th.join();
        }
        threads.clear();
        cout << "Unit Test 1: Insert: PASS" << endl;
    }catch(const std::exception& e){
        cout << "Unit Test 1: Insert: FAIL" << endl;
    }

    // checking if insert is done
    if(skiplist.search(numbers_insert[0]) == to_string(numbers_insert[0])){
        cout << "Unit Test 2: Insert: PASS" << endl;
    }else{
        cout << "Unit Test 2: Insert: FAIL" << endl;
    }

    // checking if insert is done
    if(skiplist.search(numbers_insert[1]) == to_string(numbers_insert[1])){
        cout << "Unit Test 3: Insert: PASS" << endl;
    }else{
        cout << "Unit Test 3: Insert: FAIL" << endl;
    }

    // delete
    try{
        chunk_size = ceil(float(numbers_delete.size()) / num_threads);
        for(size_t i = 0; i < numbers_delete.size(); i = i + chunk_size){
            threads.push_back(thread(skiplist_remove, i, i+chunk_size));
        }
        for (auto &th : threads) {
            th.join();
        }
        threads.clear();
        cout << "Unit Test 4: Delete: PASS" << endl;
    }catch(const std::exception& e){
        cout << "Unit Test 4: Delete: FAIL" << endl;
    }

    // checking if delete is done
    if(skiplist.search(numbers_delete[0]) == ""){
        cout << "Unit Test 5: Delete: PASS" << endl;
    }else{
        cout << "Unit Test 5: Delete: FAIL" << endl;
    }

    // checking if delete is done
    if(skiplist.search(numbers_delete[1]) == ""){
        cout << "Unit Test 6: Delete: PASS" << endl;
    }else{
        cout << "Unit Test 6: Delete: FAIL" << endl;
    }

    // search
    try{
        chunk_size = ceil(float(numbers_get.size()) / num_threads);
        for(size_t i = 0; i < numbers_get.size(); i = i + chunk_size){
            threads.push_back(thread(skiplist_search, i, i+chunk_size));
        }
        for (auto &th : threads) {
            th.join();
        }
        threads.clear();
        cout << "Unit Test 7: Search: PASS" << endl;
    }catch(const std::exception& e){
        cout << "Unit Test 7: Search: FAIL" << endl;
    }

    // checking if search is done
    if(skiplist.search(numbers_get[0]) == to_string(numbers_get[0]) || skiplist.search(numbers_get[0]) == ""){
        cout << "Unit Test 8: Search: PASS" << endl;
    }else{
        cout << "Unit Test 8: Insert: FAIL" << endl;
    }

    // checking if Search is done
    if(skiplist.search(numbers_delete[0]) == ""){
        cout << "Unit Test 9: Search: PASS" << endl;
    }else{
        cout << "Unit Test 9: Search: FAIL" << endl;
    }
    
    // ranges
    try{
        for(size_t i = 0; i < num_threads; i++){
            threads.push_back(thread(skiplist_range, numbers_range[i].first, numbers_range[i].second));
        }
        for (auto &th : threads) {
            th.join();
        }
        threads.clear();
        cout << "Unit Test 10: Range: PASS" << endl;
    }catch(const std::exception& e){
        cout << "Unit Test 10: Range: FAIL" << endl;
    }

    map<int, string> range_output = skiplist.range(1, 2000);

    // checking range
    if(range_output.count(numbers_delete[0]) == 0){
        cout << "Unit Test 11: Range: PASS" << endl;
    }else{
        cout << "Unit Test 11: Range: FAIL" << endl;
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq 0x6523(%rip), %rbx      # 0x8fd0
leaq 0x356c(%rip), %rsi      # 0x6020
movl $0x24, %edx
movq %rbx, %rdi
callq 0x2220
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2130
leaq 0x3556(%rip), %rsi      # 0x6045
movl $0x5c, %edx
movq %rbx, %rdi
callq 0x2220
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2130
leaq 0x3578(%rip), %rsi      # 0x60a2
movl $0x7d, %edx
movq %rbx, %rdi
callq 0x2220
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2130
leaq 0x35bb(%rip), %rsi      # 0x6120
movl $0x44, %edx
movq %rbx, %rdi
callq 0x2220
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2130
leaq 0x35c5(%rip), %rsi      # 0x6165
movl $0x44, %edx
movq %rbx, %rdi
callq 0x2220
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2130
movl $0x7d0, %edi            # imm = 0x7D0
callq 0x254c
movq 0x65e3(%rip), %rsi      # 0x91c8
subq 0x65d4(%rip), %rsi      # 0x91c0
shrq $0x2, %rsi
leaq 0x18(%rsp), %rbx
movss 0x3407(%rip), %xmm0     # 0x6004
movq %rbx, %rdi
callq 0x4878
movups (%rbx), %xmm0
movups %xmm0, 0x65a1(%rip)     # 0x91b0
movq %rbx, %rdi
callq 0x5832
xorl %edx, %edx
movq %rdx, 0x10(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq 0x659c(%rip), %rcx      # 0x91c8
movq 0x658d(%rip), %rsi      # 0x91c0
movq 0x6546(%rip), %rax      # 0x9180
movq %rdx, (%rbx)
subq %rsi, %rcx
je 0x2d56
sarq $0x2, %rcx
js 0x2c56
xorps %xmm0, %xmm0
cvtsi2ss %rcx, %xmm0
jmp 0x2c6e
movq %rcx, %rdx
shrq %rdx
andl $0x1, %ecx
orq %rdx, %rcx
xorps %xmm0, %xmm0
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
testq %rax, %rax
js 0x2c7a
cvtsi2ss %rax, %xmm1
jmp 0x2c8f
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
cvtsi2ss %rax, %xmm1
addss %xmm1, %xmm1
divss %xmm1, %xmm0
callq 0x2110
cvttss2si %xmm0, %eax
movslq %eax, %rbp
xorl %eax, %eax
leaq -0x573(%rip), %rbx      # 0x2735
leaq 0x48(%rsp), %r14
leaq 0x18(%rsp), %r15
leaq 0x68(%rsp), %r12
movq %rsp, %r13
addq %rbp, %rax
movq %rax, 0x68(%rsp)
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x3af4
movq %r13, %rdi
movq %r14, %rsi
callq 0x4052
cmpq $0x0, 0x48(%rsp)
jne 0x3a98
movq 0x18(%rsp), %rax
addq %rbp, %rax
movq %rax, 0x18(%rsp)
movq 0x64ca(%rip), %rcx      # 0x91c8
subq 0x64bb(%rip), %rcx      # 0x91c0
sarq $0x2, %rcx
cmpq %rcx, %rax
jb 0x2cba
movq (%rsp), %rbx
movq 0x8(%rsp), %r14
cmpq %r14, %rbx
je 0x2d36
movq %rbx, %rdi
callq 0x22a0
addq $0x8, %rbx
cmpq %r14, %rbx
jne 0x2d1c
movq (%rsp), %rbx
movq 0x8(%rsp), %r14
cmpq %rbx, %r14
je 0x2d56
movq %rbx, %rax
cmpq $0x0, (%rax)
jne 0x3a98
addq $0x8, %rax
cmpq %r14, %rax
jne 0x2d3e
movq %rbx, 0x8(%rsp)
movq 0x6273(%rip), %rbx      # 0x8fd0
leaq 0x3446(%rip), %rsi      # 0x61aa
movl $0x19, %edx
movq %rbx, %rdi
callq 0x2220
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq 0x6241(%rip), %rdi      # 0x8fd0
callq 0x2030
movq %rax, %rdi
callq 0x2130
movq 0x641d(%rip), %rax      # 0x91c0
movl (%rax), %edx
leaq 0x6404(%rip), %rsi      # 0x91b0
leaq 0x18(%rsp), %rdi
callq 0x4ed8
movq 0x6403(%rip), %rax      # 0x91c0
movl (%rax), %ebx
movl %ebx, %ebp
negl %ebp
cmovsl %ebx, %ebp
movl $0x1, %r14d
cmpl $0xa, %ebp
jb 0x2e1a
movl $0x4, %r14d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x2e11
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x2e17
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x2e1a
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r14d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x2dde
addl $-0x3, %r14d
jmp 0x2e1a
addl $-0x2, %r14d
jmp 0x2e1a
decl %r14d
shrl $0x1f, %ebx
leal (%r14,%rbx), %esi
leaq 0x58(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x48(%rsp), %rdi
movl $0x2d, %edx
callq 0x2230
addq 0x48(%rsp), %rbx
movq %rbx, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x3c8d
movq 0x20(%rsp), %rdx
cmpq 0x50(%rsp), %rdx
jne 0x2e85
movq 0x48(%rsp), %r14
testq %rdx, %rdx
je 0x2e93
movq 0x18(%rsp), %rdi
movq %r14, %rsi
callq 0x2200
testl %eax, %eax
leaq 0x3366(%rip), %rax      # 0x61de
leaq 0x3379(%rip), %rbx      # 0x61f8
cmoveq %rax, %rbx
jmp 0x2e9a
leaq 0x336c(%rip), %rbx      # 0x61f8
movq 0x48(%rsp), %r14
jmp 0x2e9a
leaq 0x3344(%rip), %rbx      # 0x61de
cmpq %r12, %r14
je 0x2eaf
movq 0x58(%rsp), %rsi
incq %rsi
movq %r14, %rdi
callq 0x21f0
leaq 0x28(%rsp), %r15
movq -0x10(%r15), %rdi
cmpq %r15, %rdi
je 0x2eca
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x60ff(%rip), %r14      # 0x8fd0
movl $0x19, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2220
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq 0x60d1(%rip), %rdi      # 0x8fd0
callq 0x2030
movq %rax, %rdi
callq 0x2130
movq 0x62ad(%rip), %rax      # 0x91c0
movl 0x4(%rax), %edx
leaq 0x6293(%rip), %rsi      # 0x91b0
leaq 0x18(%rsp), %rdi
callq 0x4ed8
movq 0x6292(%rip), %rax      # 0x91c0
movl 0x4(%rax), %ebx
movl %ebx, %ebp
negl %ebp
cmovsl %ebx, %ebp
movl $0x1, %r14d
cmpl $0xa, %ebp
jb 0x2f8c
movl $0x4, %r14d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x2f83
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x2f89
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x2f8c
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r14d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x2f50
addl $-0x3, %r14d
jmp 0x2f8c
addl $-0x2, %r14d
jmp 0x2f8c
decl %r14d
shrl $0x1f, %ebx
leal (%r14,%rbx), %esi
leaq 0x48(%rsp), %rdi
movq %r12, (%rdi)
movl $0x2d, %edx
callq 0x2230
addq 0x48(%rsp), %rbx
movq %rbx, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x3c8d
movq 0x20(%rsp), %rdx
cmpq 0x50(%rsp), %rdx
jne 0x2ff0
movq 0x48(%rsp), %r14
testq %rdx, %rdx
je 0x2ffe
movq 0x18(%rsp), %rdi
movq %r14, %rsi
callq 0x2200
testl %eax, %eax
leaq 0x322f(%rip), %rax      # 0x6212
leaq 0x3242(%rip), %rbx      # 0x622c
cmoveq %rax, %rbx
jmp 0x3005
leaq 0x3235(%rip), %rbx      # 0x622c
movq 0x48(%rsp), %r14
jmp 0x3005
leaq 0x320d(%rip), %rbx      # 0x6212
cmpq %r12, %r14
je 0x301a
movq 0x58(%rsp), %rsi
incq %rsi
movq %r14, %rdi
callq 0x21f0
movq 0x18(%rsp), %rdi
cmpq %r15, %rdi
je 0x3031
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x5f98(%rip), %r14      # 0x8fd0
movl $0x19, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2220
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq 0x5f6a(%rip), %rdi      # 0x8fd0
callq 0x2030
movq %rax, %rdi
callq 0x2130
movq 0x6166(%rip), %rcx      # 0x91e0
movq 0x6157(%rip), %rdx      # 0x91d8
movq 0x60f8(%rip), %rax      # 0x9180
movq $0x0, 0x18(%rsp)
subq %rdx, %rcx
je 0x315c
sarq $0x2, %rcx
js 0x30a7
cvtsi2ss %rcx, %xmm0
jmp 0x30bc
movq %rcx, %rdx
shrq %rdx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
testq %rax, %rax
js 0x30c8
cvtsi2ss %rax, %xmm1
jmp 0x30dd
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
cvtsi2ss %rax, %xmm1
addss %xmm1, %xmm1
divss %xmm1, %xmm0
callq 0x2110
cvttss2si %xmm0, %eax
movslq %eax, %rbp
xorl %eax, %eax
leaq -0x779(%rip), %rbx      # 0x297d
leaq 0x48(%rsp), %r14
leaq 0x18(%rsp), %r15
leaq 0x68(%rsp), %r12
movq %rsp, %r13
addq %rbp, %rax
movq %rax, 0x68(%rsp)
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x3af4
movq %r13, %rdi
movq %r14, %rsi
callq 0x4052
cmpq $0x0, 0x48(%rsp)
jne 0x3a98
movq 0x18(%rsp), %rax
addq %rbp, %rax
movq %rax, 0x18(%rsp)
movq 0x6094(%rip), %rcx      # 0x91e0
subq 0x6085(%rip), %rcx      # 0x91d8
sarq $0x2, %rcx
cmpq %rcx, %rax
jb 0x3108
movq (%rsp), %rbx
movq 0x8(%rsp), %r14
cmpq %r14, %rbx
leaq 0x28(%rsp), %r15
je 0x31a9
movq %rbx, %rdi
callq 0x22a0
addq $0x8, %rbx
cmpq %r14, %rbx
jne 0x316f
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
cmpq %rax, %rcx
je 0x31a9
movq %rax, %rdx
cmpq $0x0, (%rdx)
jne 0x3a98
addq $0x8, %rdx
cmpq %rcx, %rdx
jne 0x3191
movq %rax, 0x8(%rsp)
movq 0x5e20(%rip), %rbx      # 0x8fd0
leaq 0x308f(%rip), %rsi      # 0x6246
movl $0x19, %edx
movq %rbx, %rdi
callq 0x2220
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq 0x5dee(%rip), %rdi      # 0x8fd0
callq 0x2030
movq %rax, %rdi
callq 0x2130
movq 0x5fe2(%rip), %rax      # 0x91d8
movl (%rax), %edx
leaq 0x5fb1(%rip), %rsi      # 0x91b0
leaq 0x18(%rsp), %rdi
callq 0x4ed8
leaq 0x33eb(%rip), %rsi      # 0x65fb
leaq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0x2080
movl %eax, %ebx
movq (%r14), %rdi
cmpq %r15, %rdi
je 0x3234
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x21f0
testl %ebx, %ebx
leaq 0x303d(%rip), %rax      # 0x627a
leaq 0x3050(%rip), %rsi      # 0x6294
cmoveq %rax, %rsi
movq 0x5d81(%rip), %rbx      # 0x8fd0
movl $0x19, %edx
movq %rbx, %rdi
callq 0x2220
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq 0x5d56(%rip), %rdi      # 0x8fd0
callq 0x2030
movq %rax, %rdi
callq 0x2130
movq 0x5f4a(%rip), %rax      # 0x91d8
movl 0x4(%rax), %edx
leaq 0x5f18(%rip), %rsi      # 0x91b0
leaq 0x18(%rsp), %rdi
callq 0x4ed8
leaq 0x3352(%rip), %rsi      # 0x65fb
leaq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0x2080
movl %eax, %ebx
movq (%r14), %rdi
cmpq %r15, %rdi
je 0x32cd
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x21f0
testl %ebx, %ebx
leaq 0x2fd8(%rip), %rax      # 0x62ae
leaq 0x2feb(%rip), %rsi      # 0x62c8
cmoveq %rax, %rsi
movq 0x5ce8(%rip), %rbx      # 0x8fd0
movl $0x19, %edx
movq %rbx, %rdi
callq 0x2220
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq 0x5cbd(%rip), %rdi      # 0x8fd0
callq 0x2030
movq %rax, %rdi
callq 0x2130
movq 0x5ed1(%rip), %rcx      # 0x91f8
movq 0x5ec2(%rip), %rdx      # 0x91f0
movq 0x5e4b(%rip), %rax      # 0x9180
movq $0x0, 0x18(%rsp)
subq %rdx, %rcx
je 0x3409
sarq $0x2, %rcx
js 0x3354
cvtsi2ss %rcx, %xmm0
jmp 0x3369
movq %rcx, %rdx
shrq %rdx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
testq %rax, %rax
js 0x3375
cvtsi2ss %rax, %xmm1
jmp 0x338a
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
cvtsi2ss %rax, %xmm1
addss %xmm1, %xmm1
divss %xmm1, %xmm0
callq 0x2110
cvttss2si %xmm0, %eax
movslq %eax, %rbp
xorl %eax, %eax
leaq -0x9c2(%rip), %rbx      # 0x29e1
leaq 0x48(%rsp), %r14
leaq 0x18(%rsp), %r15
leaq 0x68(%rsp), %r12
movq %rsp, %r13
addq %rbp, %rax
movq %rax, 0x68(%rsp)
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x3af4
movq %r13, %rdi
movq %r14, %rsi
callq 0x4052
cmpq $0x0, 0x48(%rsp)
jne 0x3a98
movq 0x18(%rsp), %rax
addq %rbp, %rax
movq %rax, 0x18(%rsp)
movq 0x5dff(%rip), %rcx      # 0x91f8
subq 0x5df0(%rip), %rcx      # 0x91f0
sarq $0x2, %rcx
cmpq %rcx, %rax
jb 0x33b5
movq (%rsp), %rbx
movq 0x8(%rsp), %r14
cmpq %r14, %rbx
leaq 0x58(%rsp), %r12
je 0x3456
movq %rbx, %rdi
callq 0x22a0
addq $0x8, %rbx
cmpq %r14, %rbx
jne 0x341c
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
cmpq %rax, %rcx
je 0x3456
movq %rax, %rdx
cmpq $0x0, (%rdx)
jne 0x3a98
addq $0x8, %rdx
cmpq %rcx, %rdx
jne 0x343e
movq %rax, 0x8(%rsp)
movq 0x5b73(%rip), %rbx      # 0x8fd0
leaq 0x2e7e(%rip), %rsi      # 0x62e2
movl $0x19, %edx
movq %rbx, %rdi
callq 0x2220
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq 0x5b41(%rip), %rdi      # 0x8fd0
callq 0x2030
movq %rax, %rdi
callq 0x2130
movq 0x5d4d(%rip), %rax      # 0x91f0
movl (%rax), %edx
leaq 0x5d04(%rip), %rsi      # 0x91b0
leaq 0x18(%rsp), %rdi
callq 0x4ed8
movq 0x5d33(%rip), %rax      # 0x91f0
movl (%rax), %ebx
movl %ebx, %ebp
negl %ebp
cmovsl %ebx, %ebp
movl $0x1, %r14d
cmpl $0xa, %ebp
leaq 0x28(%rsp), %r15
jb 0x351f
movl $0x4, %r14d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x3516
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x351c
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x351f
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r14d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x34e3
addl $-0x3, %r14d
jmp 0x351f
addl $-0x2, %r14d
jmp 0x351f
decl %r14d
shrl $0x1f, %ebx
leal (%r14,%rbx), %esi
leaq 0x48(%rsp), %rdi
movq %r12, (%rdi)
movl $0x2d, %edx
callq 0x2230
addq 0x48(%rsp), %rbx
movq %rbx, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x3c8d
movq 0x20(%rsp), %rdx
leaq 0x2dc0(%rip), %rbx      # 0x6316
cmpq 0x50(%rsp), %rdx
jne 0x3578
movq 0x48(%rsp), %r14
testq %rdx, %rdx
je 0x35d4
movq 0x18(%rsp), %rdi
movq %r14, %rsi
callq 0x2200
testl %eax, %eax
je 0x35d4
movq 0x5c71(%rip), %rax      # 0x91f0
movl (%rax), %edx
leaq 0x5c28(%rip), %rsi      # 0x91b0
leaq 0x68(%rsp), %rdi
callq 0x4ed8
leaq 0x3062(%rip), %rsi      # 0x65fb
leaq 0x68(%rsp), %r14
movq %r14, %rdi
callq 0x2080
movl %eax, %ebp
movq (%r14), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x35c2
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x21f0
testl %ebp, %ebp
movq 0x48(%rsp), %r14
leaq 0x2d60(%rip), %rax      # 0x6330
cmovneq %rax, %rbx
cmpq %r12, %r14
je 0x35e9
movq 0x58(%rsp), %rsi
incq %rsi
movq %r14, %rdi
callq 0x21f0
movq 0x18(%rsp), %rdi
cmpq %r15, %rdi
je 0x3600
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x59c9(%rip), %r14      # 0x8fd0
movl $0x19, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2220
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq 0x599b(%rip), %rdi      # 0x8fd0
callq 0x2030
movq %rax, %rdi
callq 0x2130
movq 0x5b8f(%rip), %rax      # 0x91d8
movl (%rax), %edx
leaq 0x5b5e(%rip), %rsi      # 0x91b0
leaq 0x18(%rsp), %rdi
callq 0x4ed8
leaq 0x2f98(%rip), %rsi      # 0x65fb
leaq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0x2080
movl %eax, %ebx
movq (%r14), %rdi
cmpq %r15, %rdi
je 0x3687
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x21f0
testl %ebx, %ebx
leaq 0x2cba(%rip), %rax      # 0x634a
leaq 0x2ccd(%rip), %rsi      # 0x6364
cmoveq %rax, %rsi
movq 0x592e(%rip), %rbx      # 0x8fd0
movl $0x19, %edx
movq %rbx, %rdi
callq 0x2220
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq 0x5903(%rip), %rdi      # 0x8fd0
callq 0x2030
movq %rax, %rdi
callq 0x2130
cmpq $0x0, 0x5a9e(%rip)      # 0x9180
je 0x3740
movl $0x4, %r12d
xorl %r13d, %r13d
leaq -0xc88(%rip), %rbx      # 0x2a6c
leaq 0x18(%rsp), %r14
movq %rsp, %r15
movq 0x5b05(%rip), %rcx      # 0x9208
leaq (%rcx,%r12), %rdx
addq $-0x4, %rdx
addq %r12, %rcx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3b86
movq %r15, %rdi
movq %r14, %rsi
callq 0x4052
cmpq $0x0, 0x18(%rsp)
jne 0x3a98
incq %r13
addq $0x8, %r12
cmpq 0x5a42(%rip), %r13      # 0x9180
jb 0x36fc
movq (%rsp), %rbx
movq 0x8(%rsp), %r14
cmpq %r14, %rbx
je 0x3788
movq %rbx, %rdi
callq 0x22a0
addq $0x8, %rbx
cmpq %r14, %rbx
jne 0x374e
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
cmpq %rax, %rcx
je 0x3788
movq %rax, %rdx
cmpq $0x0, (%rdx)
jne 0x3a98
addq $0x8, %rdx
cmpq %rcx, %rdx
jne 0x3770
movq %rax, 0x8(%rsp)
movq 0x5841(%rip), %rbx      # 0x8fd0
leaq 0x2be8(%rip), %rsi      # 0x637e
movl $0x19, %edx
movq %rbx, %rdi
callq 0x2220
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq 0x580f(%rip), %rdi      # 0x8fd0
callq 0x2030
movq %rax, %rdi
callq 0x2130
leaq 0x59db(%rip), %rsi      # 0x91b0
leaq 0x18(%rsp), %rdi
movl $0x1, %edx
movl $0x7d0, %ecx            # imm = 0x7D0
callq 0x5468
movq 0x59e8(%rip), %rsi      # 0x91d8
leaq 0x18(%rsp), %rdi
callq 0x3c0a
testq %rax, %rax
leaq 0x2bae(%rip), %rax      # 0x63b2
leaq 0x2bc1(%rip), %rsi      # 0x63cc
cmoveq %rax, %rsi
movq 0x57ba(%rip), %rbx      # 0x8fd0
movl $0x19, %edx
movq %rbx, %rdi
callq 0x2220
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq 0x578f(%rip), %rdi      # 0x8fd0
callq 0x2030
movq %rax, %rdi
callq 0x2130
leaq 0x18(%rsp), %rdi
callq 0x3cfa
movq %rsp, %rdi
callq 0x3c52
xorl %eax, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x389d
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x21f0
jmp 0x389d
jmp 0x3ab1
jmp 0x3ab1
movq %rax, %rbx
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
jmp 0x38db
jmp 0x3ab1
jmp 0x3ab1
jmp 0x3ab1
movq %rax, %rbx
movq 0x18(%rsp), %rdi
cmpq %r15, %rdi
jne 0x38e4
jmp 0x3ab4
jmp 0x3ab1
movq %rax, %rbx
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3ab4
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x21f0
jmp 0x3ab4
jmp 0x3ab1
jmp 0x3932
jmp 0x3995
jmp 0x39fd
jmp 0x3a5a
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x3cfa
jmp 0x3ab4
jmp 0x3a5a
jmp 0x3932
cmpq $0x0, 0x18(%rsp)
je 0x3932
jmp 0x3a98
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x3ab4
movq %rbx, %rdi
callq 0x20a0
movq 0x5683(%rip), %rdi      # 0x8fd0
leaq 0x2a44(%rip), %rsi      # 0x6398
movl $0x19, %edx
callq 0x2220
movq 0x566b(%rip), %rdi      # 0x8fd0
callq 0x20d0
callq 0x2290
jmp 0x37ce
jmp 0x3ab1
movq %rax, %rbx
callq 0x2290
jmp 0x3ab4
jmp 0x3995
cmpq $0x0, 0x48(%rsp)
je 0x3995
jmp 0x3a98
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x3ab4
movq %rbx, %rdi
callq 0x20a0
movq 0x5620(%rip), %rdi      # 0x8fd0
leaq 0x2945(%rip), %rsi      # 0x62fc
movl $0x19, %edx
callq 0x2220
movq 0x5608(%rip), %rdi      # 0x8fd0
callq 0x20d0
callq 0x2290
leaq 0x58(%rsp), %r12
jmp 0x349c
jmp 0x3ab1
movq %rax, %rbx
callq 0x2290
jmp 0x3ab4
jmp 0x39fd
cmpq $0x0, 0x48(%rsp)
je 0x39fd
jmp 0x3a98
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x3ab4
movq %rbx, %rdi
callq 0x20a0
movq 0x55b8(%rip), %rdi      # 0x8fd0
leaq 0x2841(%rip), %rsi      # 0x6260
movl $0x19, %edx
callq 0x2220
movq 0x55a0(%rip), %rdi      # 0x8fd0
callq 0x20d0
callq 0x2290
leaq 0x28(%rsp), %r15
jmp 0x31ef
jmp 0x3ab1
movq %rax, %rbx
callq 0x2290
jmp 0x3ab4
jmp 0x3a5a
cmpq $0x0, 0x48(%rsp)
jne 0x3a98
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x3ab4
movq %rbx, %rdi
callq 0x20a0
movq 0x555f(%rip), %rdi      # 0x8fd0
leaq 0x274c(%rip), %rsi      # 0x61c4
movl $0x19, %edx
callq 0x2220
movq 0x5547(%rip), %rdi      # 0x8fd0
callq 0x20d0
callq 0x2290
jmp 0x2d9c
callq 0x2070
jmp 0x3ab1
movq %rax, %rbx
callq 0x2290
jmp 0x3ab4
movq %rax, %rdi
callq 0x3b7a
movq %rax, %rbx
movq %rsp, %rdi
callq 0x3c52
movq %rbx, %rdi
callq 0x22b0