// File: /workspace/github_cpp_makefile_star2_O1/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 0x6533(%rip), %rbx      # 0x8fd0
leaq 0x357c(%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 0x3566(%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 0x3588(%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 0x35cb(%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 0x35d5(%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 0x65f3(%rip), %rsi      # 0x91c8
subq 0x65e4(%rip), %rsi      # 0x91c0
shrq $0x2, %rsi
leaq 0x18(%rsp), %rbx
movss 0x3417(%rip), %xmm0     # 0x6004
movq %rbx, %rdi
callq 0x4868
movups (%rbx), %xmm0
movups %xmm0, 0x65b1(%rip)     # 0x91b0
movq %rbx, %rdi
callq 0x5856
xorl %edx, %edx
movq %rdx, 0x10(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq 0x65ac(%rip), %rcx      # 0x91c8
movq 0x659d(%rip), %rsi      # 0x91c0
movq 0x6556(%rip), %rax      # 0x9180
movq %rdx, (%rbx)
subq %rsi, %rcx
je 0x2cfe
sarq $0x2, %rcx
js 0x2c46
xorps %xmm0, %xmm0
cvtsi2ss %rcx, %xmm0
jmp 0x2c5e
movq %rcx, %rdx
shrq %rdx
andl $0x1, %ecx
orq %rdx, %rcx
xorps %xmm0, %xmm0
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
testq %rax, %rax
js 0x2c6a
cvtsi2ss %rax, %xmm1
jmp 0x2c7f
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      # 0x2725
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 0x3ade
movq %r13, %rdi
movq %r14, %rsi
callq 0x4056
cmpq $0x0, 0x48(%rsp)
jne 0x3a43
movq 0x18(%rsp), %rax
addq %rbp, %rax
movq %rax, 0x18(%rsp)
movq 0x64da(%rip), %rcx      # 0x91c8
subq 0x64cb(%rip), %rcx      # 0x91c0
sarq $0x2, %rcx
cmpq %rcx, %rax
jb 0x2caa
movq (%rsp), %rbx
movq 0x8(%rsp), %r14
cmpq %r14, %rbx
je 0x2d1a
movq %rbx, %rdi
callq 0x22a0
addq $0x8, %rbx
jmp 0x2d07
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
cmpq %rax, %rcx
je 0x2d43
movq %rax, %rdx
cmpq $0x0, (%rdx)
jne 0x3a43
addq $0x8, %rdx
cmpq %rcx, %rdx
jne 0x2d2b
movq %rax, 0x8(%rsp)
movq 0x6286(%rip), %rbx      # 0x8fd0
leaq 0x3459(%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 0x6254(%rip), %rdi      # 0x8fd0
callq 0x2030
movq %rax, %rdi
callq 0x2130
movq 0x6430(%rip), %rax      # 0x91c0
movl (%rax), %edx
leaq 0x6417(%rip), %rsi      # 0x91b0
leaq 0x18(%rsp), %rdi
callq 0x4eea
movq 0x6416(%rip), %rax      # 0x91c0
movl (%rax), %ebx
movl %ebx, %ebp
negl %ebp
cmovsl %ebx, %ebp
movl $0x1, %r14d
cmpl $0xa, %ebp
jb 0x2e07
movl $0x4, %r14d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x2dfe
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x2e04
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x2e07
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r14d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x2dcb
addl $-0x3, %r14d
jmp 0x2e07
addl $-0x2, %r14d
jmp 0x2e07
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 0x3c99
movq 0x20(%rsp), %rdx
cmpq 0x50(%rsp), %rdx
jne 0x2e6f
testq %rdx, %rdx
je 0x2e78
movq 0x48(%rsp), %rsi
movq 0x18(%rsp), %rdi
callq 0x2200
testl %eax, %eax
leaq 0x337c(%rip), %rax      # 0x61de
leaq 0x338f(%rip), %rbx      # 0x61f8
cmoveq %rax, %rbx
jmp 0x2e7f
leaq 0x3382(%rip), %rbx      # 0x61f8
jmp 0x2e7f
leaq 0x335f(%rip), %rbx      # 0x61de
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x2e96
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x28(%rsp), %r15
movq -0x10(%r15), %rdi
cmpq %r15, %rdi
je 0x2eb1
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x6118(%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 0x60ea(%rip), %rdi      # 0x8fd0
callq 0x2030
movq %rax, %rdi
callq 0x2130
movq 0x62c6(%rip), %rax      # 0x91c0
movl 0x4(%rax), %edx
leaq 0x62ac(%rip), %rsi      # 0x91b0
leaq 0x18(%rsp), %rdi
callq 0x4eea
movq 0x62ab(%rip), %rax      # 0x91c0
movl 0x4(%rax), %ebx
movl %ebx, %ebp
negl %ebp
cmovsl %ebx, %ebp
movl $0x1, %r14d
cmpl $0xa, %ebp
jb 0x2f73
movl $0x4, %r14d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x2f6a
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x2f70
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x2f73
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r14d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x2f37
addl $-0x3, %r14d
jmp 0x2f73
addl $-0x2, %r14d
jmp 0x2f73
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 0x3c99
movq 0x20(%rsp), %rdx
cmpq 0x50(%rsp), %rdx
jne 0x2fd4
testq %rdx, %rdx
je 0x2fdd
movq 0x48(%rsp), %rsi
movq 0x18(%rsp), %rdi
callq 0x2200
testl %eax, %eax
leaq 0x324b(%rip), %rax      # 0x6212
leaq 0x325e(%rip), %rbx      # 0x622c
cmoveq %rax, %rbx
jmp 0x2fe4
leaq 0x3251(%rip), %rbx      # 0x622c
jmp 0x2fe4
leaq 0x322e(%rip), %rbx      # 0x6212
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x2ffb
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x18(%rsp), %rdi
cmpq %r15, %rdi
je 0x3012
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x5fb7(%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 0x5f89(%rip), %rdi      # 0x8fd0
callq 0x2030
movq %rax, %rdi
callq 0x2130
movq 0x6185(%rip), %rcx      # 0x91e0
movq 0x6176(%rip), %rdx      # 0x91d8
movq 0x6117(%rip), %rax      # 0x9180
movq $0x0, 0x18(%rsp)
subq %rdx, %rcx
je 0x313d
sarq $0x2, %rcx
js 0x3088
cvtsi2ss %rcx, %xmm0
jmp 0x309d
movq %rcx, %rdx
shrq %rdx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
testq %rax, %rax
js 0x30a9
cvtsi2ss %rax, %xmm1
jmp 0x30be
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 -0x76a(%rip), %rbx      # 0x296d
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 0x3ade
movq %r13, %rdi
movq %r14, %rsi
callq 0x4056
cmpq $0x0, 0x48(%rsp)
jne 0x3a43
movq 0x18(%rsp), %rax
addq %rbp, %rax
movq %rax, 0x18(%rsp)
movq 0x60b3(%rip), %rcx      # 0x91e0
subq 0x60a4(%rip), %rcx      # 0x91d8
sarq $0x2, %rcx
cmpq %rcx, %rax
jb 0x30e9
movq (%rsp), %rbx
movq 0x8(%rsp), %r14
cmpq %r14, %rbx
je 0x3159
movq %rbx, %rdi
callq 0x22a0
addq $0x8, %rbx
jmp 0x3146
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
cmpq %rax, %rcx
leaq 0x28(%rsp), %r15
je 0x3187
movq %rax, %rdx
cmpq $0x0, (%rdx)
jne 0x3a43
addq $0x8, %rdx
cmpq %rcx, %rdx
jne 0x316f
movq %rax, 0x8(%rsp)
movq 0x5e42(%rip), %rbx      # 0x8fd0
leaq 0x30b1(%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 0x5e10(%rip), %rdi      # 0x8fd0
callq 0x2030
movq %rax, %rdi
callq 0x2130
movq 0x6004(%rip), %rax      # 0x91d8
movl (%rax), %edx
leaq 0x5fd3(%rip), %rsi      # 0x91b0
leaq 0x18(%rsp), %rdi
callq 0x4eea
leaq 0x340d(%rip), %rsi      # 0x65fb
leaq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0x2080
movl %eax, %ebx
movq (%r14), %rdi
cmpq %r15, %rdi
je 0x3212
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x21f0
testl %ebx, %ebx
leaq 0x305f(%rip), %rax      # 0x627a
leaq 0x3072(%rip), %rsi      # 0x6294
cmoveq %rax, %rsi
movq 0x5da3(%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 0x5d78(%rip), %rdi      # 0x8fd0
callq 0x2030
movq %rax, %rdi
callq 0x2130
movq 0x5f6c(%rip), %rax      # 0x91d8
movl 0x4(%rax), %edx
leaq 0x5f3a(%rip), %rsi      # 0x91b0
leaq 0x18(%rsp), %rdi
callq 0x4eea
leaq 0x3374(%rip), %rsi      # 0x65fb
leaq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0x2080
movl %eax, %ebx
movq (%r14), %rdi
cmpq %r15, %rdi
je 0x32ab
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x21f0
testl %ebx, %ebx
leaq 0x2ffa(%rip), %rax      # 0x62ae
leaq 0x300d(%rip), %rsi      # 0x62c8
cmoveq %rax, %rsi
movq 0x5d0a(%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 0x5cdf(%rip), %rdi      # 0x8fd0
callq 0x2030
movq %rax, %rdi
callq 0x2130
movq 0x5ef3(%rip), %rcx      # 0x91f8
movq 0x5ee4(%rip), %rdx      # 0x91f0
movq 0x5e6d(%rip), %rax      # 0x9180
movq $0x0, 0x18(%rsp)
subq %rdx, %rcx
je 0x33e7
sarq $0x2, %rcx
js 0x3332
cvtsi2ss %rcx, %xmm0
jmp 0x3347
movq %rcx, %rdx
shrq %rdx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
testq %rax, %rax
js 0x3353
cvtsi2ss %rax, %xmm1
jmp 0x3368
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 -0x9b0(%rip), %rbx      # 0x29d1
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 0x3ade
movq %r13, %rdi
movq %r14, %rsi
callq 0x4056
cmpq $0x0, 0x48(%rsp)
jne 0x3a43
movq 0x18(%rsp), %rax
addq %rbp, %rax
movq %rax, 0x18(%rsp)
movq 0x5e21(%rip), %rcx      # 0x91f8
subq 0x5e12(%rip), %rcx      # 0x91f0
sarq $0x2, %rcx
cmpq %rcx, %rax
jb 0x3393
movq (%rsp), %rbx
movq 0x8(%rsp), %r14
cmpq %r14, %rbx
je 0x3403
movq %rbx, %rdi
callq 0x22a0
addq $0x8, %rbx
jmp 0x33f0
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
cmpq %rax, %rcx
leaq 0x58(%rsp), %r12
je 0x3431
movq %rax, %rdx
cmpq $0x0, (%rdx)
jne 0x3a43
addq $0x8, %rdx
cmpq %rcx, %rdx
jne 0x3419
movq %rax, 0x8(%rsp)
movq 0x5b98(%rip), %rbx      # 0x8fd0
leaq 0x2ea3(%rip), %rsi      # 0x62e2
movl $0x19, %edx
movq %rbx, %rdi
leaq 0x28(%rsp), %r15
callq 0x2220
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq 0x5b61(%rip), %rdi      # 0x8fd0
callq 0x2030
movq %rax, %rdi
callq 0x2130
movq 0x5d6d(%rip), %rax      # 0x91f0
movl (%rax), %edx
leaq 0x5d24(%rip), %rsi      # 0x91b0
leaq 0x18(%rsp), %rdi
callq 0x4eea
movq 0x5d53(%rip), %rax      # 0x91f0
movl (%rax), %ebx
movl %ebx, %ebp
negl %ebp
cmovsl %ebx, %ebp
movl $0x1, %r14d
cmpl $0xa, %ebp
jb 0x34fa
movl $0x4, %r14d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x34f1
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x34f7
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x34fa
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r14d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x34be
addl $-0x3, %r14d
jmp 0x34fa
addl $-0x2, %r14d
jmp 0x34fa
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 0x3c99
movq 0x20(%rsp), %rdx
cmpq 0x50(%rsp), %rdx
jne 0x354d
testq %rdx, %rdx
je 0x3551
movq 0x48(%rsp), %rsi
movq 0x18(%rsp), %rdi
callq 0x2200
testl %eax, %eax
sete %bpl
jmp 0x3554
xorl %ebp, %ebp
jmp 0x3554
movb $0x1, %bpl
testb %bpl, %bpl
je 0x3562
leaq 0x2db6(%rip), %rbx      # 0x6316
jmp 0x35a1
movq 0x5c87(%rip), %rax      # 0x91f0
movl (%rax), %edx
leaq 0x5c3e(%rip), %rsi      # 0x91b0
leaq 0x68(%rsp), %rdi
callq 0x4eea
leaq 0x3078(%rip), %rsi      # 0x65fb
leaq 0x68(%rsp), %rdi
callq 0x2080
testl %eax, %eax
leaq 0x2d80(%rip), %rax      # 0x6316
leaq 0x2d93(%rip), %rbx      # 0x6330
cmoveq %rax, %rbx
testb %bpl, %bpl
jne 0x35c1
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x35c1
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x35d8
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x18(%rsp), %rdi
cmpq %r15, %rdi
je 0x35ef
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x59da(%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 0x59ac(%rip), %rdi      # 0x8fd0
callq 0x2030
movq %rax, %rdi
callq 0x2130
movq 0x5ba0(%rip), %rax      # 0x91d8
movl (%rax), %edx
leaq 0x5b6f(%rip), %rsi      # 0x91b0
leaq 0x18(%rsp), %rdi
callq 0x4eea
leaq 0x2fa9(%rip), %rsi      # 0x65fb
leaq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0x2080
movl %eax, %ebx
movq (%r14), %rdi
cmpq %r15, %rdi
je 0x3676
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x21f0
testl %ebx, %ebx
leaq 0x2ccb(%rip), %rax      # 0x634a
leaq 0x2cde(%rip), %rsi      # 0x6364
cmoveq %rax, %rsi
movq 0x593f(%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 0x5914(%rip), %rdi      # 0x8fd0
callq 0x2030
movq %rax, %rdi
callq 0x2130
cmpq $0x0, 0x5aaf(%rip)      # 0x9180
je 0x372f
movl $0x4, %r12d
xorl %r13d, %r13d
leaq -0xc87(%rip), %rbx      # 0x2a5c
leaq 0x18(%rsp), %r14
movq %rsp, %r15
movq 0x5b16(%rip), %rcx      # 0x9208
leaq (%rcx,%r12), %rdx
addq $-0x4, %rdx
addq %r12, %rcx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3b80
movq %r15, %rdi
movq %r14, %rsi
callq 0x4056
cmpq $0x0, 0x18(%rsp)
jne 0x3a43
incq %r13
addq $0x8, %r12
cmpq 0x5a53(%rip), %r13      # 0x9180
jb 0x36eb
movq (%rsp), %rbx
movq 0x8(%rsp), %r14
cmpq %r14, %rbx
je 0x374b
movq %rbx, %rdi
callq 0x22a0
addq $0x8, %rbx
jmp 0x3738
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
cmpq %rax, %rcx
je 0x3774
movq %rax, %rdx
cmpq $0x0, (%rdx)
jne 0x3a43
addq $0x8, %rdx
cmpq %rcx, %rdx
jne 0x375c
movq %rax, 0x8(%rsp)
movq 0x5855(%rip), %rbx      # 0x8fd0
leaq 0x2bfc(%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 0x5823(%rip), %rdi      # 0x8fd0
callq 0x2030
movq %rax, %rdi
callq 0x2130
leaq 0x59ef(%rip), %rsi      # 0x91b0
leaq 0x18(%rsp), %rdi
movl $0x1, %edx
movl $0x7d0, %ecx            # imm = 0x7D0
callq 0x548e
movq 0x59fc(%rip), %rsi      # 0x91d8
leaq 0x18(%rsp), %rdi
callq 0x3c14
testq %rax, %rax
leaq 0x2bc2(%rip), %rax      # 0x63b2
leaq 0x2bd5(%rip), %rsi      # 0x63cc
cmoveq %rax, %rsi
movq 0x57ce(%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 0x57a3(%rip), %rdi      # 0x8fd0
callq 0x2030
movq %rax, %rdi
callq 0x2130
leaq 0x18(%rsp), %rdi
callq 0x3d06
movq %rsp, %rdi
callq 0x3c5e
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 0x3889
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x21f0
jmp 0x3889
jmp 0x3a9a
jmp 0x3a9a
movq %rax, %rbx
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
jmp 0x38c7
jmp 0x3a9a
jmp 0x3a9a
jmp 0x3a9a
movq %rax, %rbx
movq 0x18(%rsp), %rdi
cmpq %r15, %rdi
jne 0x38d0
jmp 0x3a9d
jmp 0x3a9a
movq %rax, %rbx
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3a9d
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x21f0
jmp 0x3a9d
jmp 0x3a9a
jmp 0x3919
jmp 0x397c
jmp 0x39e6
jmp 0x3a48
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x3d06
jmp 0x3a9d
jmp 0x3919
cmpq $0x0, 0x18(%rsp)
je 0x3919
jmp 0x3a43
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x3a9d
movq %rbx, %rdi
callq 0x20a0
movq 0x569c(%rip), %rdi      # 0x8fd0
leaq 0x2a5d(%rip), %rsi      # 0x6398
movl $0x19, %edx
callq 0x2220
movq 0x5684(%rip), %rdi      # 0x8fd0
callq 0x20d0
callq 0x2290
jmp 0x37ba
jmp 0x3a9a
movq %rax, %rbx
callq 0x2290
jmp 0x3a9d
jmp 0x397c
cmpq $0x0, 0x48(%rsp)
je 0x397c
jmp 0x3a43
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x3a9d
movq %rbx, %rdi
callq 0x20a0
movq 0x5639(%rip), %rdi      # 0x8fd0
leaq 0x295e(%rip), %rsi      # 0x62fc
movl $0x19, %edx
callq 0x2220
movq 0x5621(%rip), %rdi      # 0x8fd0
callq 0x20d0
callq 0x2290
leaq 0x28(%rsp), %r15
leaq 0x58(%rsp), %r12
jmp 0x347c
jmp 0x3a9a
movq %rax, %rbx
callq 0x2290
jmp 0x3a9d
jmp 0x39e6
cmpq $0x0, 0x48(%rsp)
je 0x39e6
jmp 0x3a43
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x3a9d
movq %rbx, %rdi
callq 0x20a0
movq 0x55cf(%rip), %rdi      # 0x8fd0
leaq 0x2858(%rip), %rsi      # 0x6260
movl $0x19, %edx
callq 0x2220
movq 0x55b7(%rip), %rdi      # 0x8fd0
callq 0x20d0
callq 0x2290
leaq 0x28(%rsp), %r15
jmp 0x31cd
jmp 0x3a9a
movq %rax, %rbx
callq 0x2290
jmp 0x3a9d
jmp 0x3a48
cmpq $0x0, 0x48(%rsp)
je 0x3a48
callq 0x2070
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x3a9d
movq %rbx, %rdi
callq 0x20a0
movq 0x5571(%rip), %rdi      # 0x8fd0
leaq 0x275e(%rip), %rsi      # 0x61c4
movl $0x19, %edx
callq 0x2220
movq 0x5559(%rip), %rdi      # 0x8fd0
callq 0x20d0
callq 0x2290
jmp 0x2d89
jmp 0x3a9a
movq %rax, %rbx
callq 0x2290
jmp 0x3a9d
movq %rax, %rdi
callq 0x3b74
movq %rax, %rbx
movq %rsp, %rdi
callq 0x3c5e
movq %rbx, %rdi
callq 0x22b0
nop