// File: 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
movq %rsp, %rbp
subq $0x440, %rsp            # imm = 0x440
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq 0x124b0(%rip), %rdi     # 0x14fd0
movq %rdi, -0x2e8(%rbp)
leaq 0xa4da(%rip), %rsi      # 0xd008
callq 0x2220
movq %rax, %rdi
movq 0x1247b(%rip), %rsi     # 0x14fb8
movq %rsi, -0x2e0(%rbp)
callq 0x2260
movq -0x2e8(%rbp), %rdi
leaq 0xa4d6(%rip), %rsi      # 0xd02d
callq 0x2220
movq -0x2e0(%rbp), %rsi
movq %rax, %rdi
callq 0x2260
movq -0x2e8(%rbp), %rdi
leaq 0xa511(%rip), %rsi      # 0xd08a
callq 0x2220
movq -0x2e0(%rbp), %rsi
movq %rax, %rdi
callq 0x2260
movq -0x2e8(%rbp), %rdi
leaq 0xa56d(%rip), %rsi      # 0xd108
callq 0x2220
movq -0x2e0(%rbp), %rsi
movq %rax, %rdi
callq 0x2260
movq -0x2e8(%rbp), %rdi
leaq 0xa590(%rip), %rsi      # 0xd14d
callq 0x2220
movq -0x2e0(%rbp), %rsi
movq %rax, %rdi
callq 0x2260
movl $0x7d0, %edi            # imm = 0x7D0
callq 0x2650
leaq 0x1264e(%rip), %rdi     # 0x15230
movq %rdi, -0x2d0(%rbp)
callq 0x3f80
movl %eax, %esi
leaq -0x20(%rbp), %rdi
movq %rdi, -0x2d8(%rbp)
movss 0xa401(%rip), %xmm0     # 0xd004
callq 0x9420
movq -0x2d8(%rbp), %rdi
movups -0x20(%rbp), %xmm0
movups %xmm0, 0x12606(%rip)    # 0x15220
callq 0xb030
leaq -0x38(%rbp), %rdi
callq 0x4160
movq -0x2d0(%rbp), %rdi
callq 0x3f80
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, -0x2c8(%rbp)
testq %rax, %rax
movss %xmm0, -0x2c4(%rbp)
js 0x2c75
movss -0x2c8(%rbp), %xmm0
movss %xmm0, -0x2c4(%rbp)
movss -0x2c4(%rbp), %xmm0
movss %xmm0, -0x2f4(%rbp)
movq 0x12564(%rip), %rax     # 0x151f0
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, -0x2f0(%rbp)
testq %rax, %rax
movss %xmm0, -0x2ec(%rbp)
js 0x2ccd
movss -0x2f0(%rbp), %xmm0
movss %xmm0, -0x2ec(%rbp)
movss -0x2f4(%rbp), %xmm0
movss -0x2ec(%rbp), %xmm1
divss %xmm1, %xmm0
callq 0x4180
movss %xmm0, -0x2f8(%rbp)
jmp 0x2cf0
movss -0x2f8(%rbp), %xmm0
cvttss2si %xmm0, %eax
movl %eax, -0x3c(%rbp)
movq $0x0, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x300(%rbp)
leaq 0x12517(%rip), %rdi     # 0x15230
callq 0x3f80
movq %rax, %rcx
movq -0x300(%rbp), %rax
cmpq %rcx, %rax
jae 0x2ebd
movq -0x58(%rbp), %rax
movslq -0x3c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x68(%rbp)
leaq -0x567(%rip), %rsi      # 0x27e0
leaq -0x60(%rbp), %rdi
leaq -0x58(%rbp), %rdx
leaq -0x68(%rbp), %rcx
callq 0x41d0
jmp 0x2d5a
leaq -0x38(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x41a0
jmp 0x2d69
leaq -0x60(%rbp), %rdi
callq 0x42a0
movq -0x58(%rbp), %rax
movslq -0x3c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
jmp 0x2d07
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x2da6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x42a0
movl -0x4c(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x3df3
movq -0x48(%rbp), %rdi
callq 0x20b0
movq %rax, -0x90(%rbp)
movq 0x12203(%rip), %rdi     # 0x14fd0
leaq 0xa3d8(%rip), %rsi      # 0xd1ac
callq 0x2220
movq %rax, -0x308(%rbp)
jmp 0x2de2
movq -0x308(%rbp), %rdi
movq 0x121c8(%rip), %rsi     # 0x14fb8
callq 0x2260
jmp 0x2df7
callq 0x2340
jmp 0x2dfe
jmp 0x2e00
leaq 0x12429(%rip), %rdi     # 0x15230
xorl %eax, %eax
movl %eax, %esi
callq 0x3fa0
movl (%rax), %edx
leaq 0x12407(%rip), %rsi     # 0x15220
leaq -0xb0(%rbp), %rdi
callq 0x9f70
jmp 0x2e27
leaq 0x12402(%rip), %rdi     # 0x15230
xorl %eax, %eax
movl %eax, %esi
callq 0x3fa0
movl (%rax), %esi
leaq -0xd0(%rbp), %rdi
callq 0x4020
jmp 0x2e47
leaq -0xb0(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x43e0
movb %al, -0x309(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x2150
leaq -0xb0(%rbp), %rdi
callq 0x2150
movb -0x309(%rbp), %al
testb $0x1, %al
jne 0x2e87
jmp 0x2fa2
movq 0x12142(%rip), %rdi     # 0x14fd0
leaq 0xa331(%rip), %rsi      # 0xd1c6
callq 0x2220
movq %rax, -0x318(%rbp)
jmp 0x2ea3
movq -0x318(%rbp), %rdi
movq 0x12107(%rip), %rsi     # 0x14fb8
callq 0x2260
jmp 0x2eb8
jmp 0x2fd5
leaq -0x38(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rdi
callq 0x42d0
movq %rax, -0x78(%rbp)
movq -0x70(%rbp), %rdi
callq 0x4300
movq %rax, -0x80(%rbp)
leaq -0x78(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x4330
testb $0x1, %al
jne 0x2ef2
jmp 0x2f1d
leaq -0x78(%rbp), %rdi
callq 0x4370
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rdi
callq 0x2350
jmp 0x2f10
jmp 0x2f12
leaq -0x78(%rbp), %rdi
callq 0x4390
jmp 0x2edf
leaq -0x38(%rbp), %rdi
callq 0x43b0
movq 0x120a3(%rip), %rdi     # 0x14fd0
leaq 0xa25e(%rip), %rsi      # 0xd192
callq 0x2220
movq %rax, -0x320(%rbp)
jmp 0x2f42
movq -0x320(%rbp), %rdi
movq 0x12068(%rip), %rsi     # 0x14fb8
callq 0x2260
jmp 0x2f57
jmp 0x2e00
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
callq 0x2340
jmp 0x2f80
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x3df3
jmp 0x3df3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x2150
jmp 0x3df3
movq 0x12027(%rip), %rdi     # 0x14fd0
leaq 0xa230(%rip), %rsi      # 0xd1e0
callq 0x2220
movq %rax, -0x328(%rbp)
jmp 0x2fbe
movq -0x328(%rbp), %rdi
movq 0x11fec(%rip), %rsi     # 0x14fb8
callq 0x2260
jmp 0x2fd3
jmp 0x2fd5
leaq 0x12254(%rip), %rdi     # 0x15230
movl $0x1, %esi
callq 0x3fa0
movl (%rax), %edx
leaq 0x12231(%rip), %rsi     # 0x15220
leaq -0xf0(%rbp), %rdi
callq 0x9f70
jmp 0x2ffd
leaq 0x1222c(%rip), %rdi     # 0x15230
movl $0x1, %esi
callq 0x3fa0
movl (%rax), %esi
leaq -0x110(%rbp), %rdi
callq 0x4020
jmp 0x301e
leaq -0xf0(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x43e0
movb %al, -0x329(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x2150
leaq -0xf0(%rbp), %rdi
callq 0x2150
movb -0x329(%rbp), %al
testb $0x1, %al
jne 0x305b
jmp 0x30ab
movq 0x11f6e(%rip), %rdi     # 0x14fd0
leaq 0xa191(%rip), %rsi      # 0xd1fa
callq 0x2220
movq %rax, -0x338(%rbp)
jmp 0x3077
movq -0x338(%rbp), %rdi
movq 0x11f33(%rip), %rsi     # 0x14fb8
callq 0x2260
jmp 0x308c
jmp 0x30de
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x2150
jmp 0x3df3
movq 0x11f1e(%rip), %rdi     # 0x14fd0
leaq 0xa15b(%rip), %rsi      # 0xd214
callq 0x2220
movq %rax, -0x340(%rbp)
jmp 0x30c7
movq -0x340(%rbp), %rdi
movq 0x11ee3(%rip), %rsi     # 0x14fb8
callq 0x2260
jmp 0x30dc
jmp 0x30de
leaq 0x12163(%rip), %rdi     # 0x15248
callq 0x3f80
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, -0x348(%rbp)
testq %rax, %rax
movss %xmm0, -0x344(%rbp)
js 0x312b
movss -0x348(%rbp), %xmm0
movss %xmm0, -0x344(%rbp)
movss -0x344(%rbp), %xmm0
movss %xmm0, -0x354(%rbp)
movq 0x120ae(%rip), %rax     # 0x151f0
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, -0x350(%rbp)
testq %rax, %rax
movss %xmm0, -0x34c(%rbp)
js 0x3183
movss -0x350(%rbp), %xmm0
movss %xmm0, -0x34c(%rbp)
movss -0x354(%rbp), %xmm0
movss -0x34c(%rbp), %xmm1
divss %xmm1, %xmm0
callq 0x4180
movss %xmm0, -0x358(%rbp)
jmp 0x31a6
movss -0x358(%rbp), %xmm0
cvttss2si %xmm0, %eax
movl %eax, -0x3c(%rbp)
movq $0x0, -0x118(%rbp)
movq -0x118(%rbp), %rax
movq %rax, -0x360(%rbp)
leaq 0x12073(%rip), %rdi     # 0x15248
callq 0x3f80
movq %rax, %rcx
movq -0x360(%rbp), %rax
cmpq %rcx, %rax
jae 0x3370
movq -0x118(%rbp), %rax
movslq -0x3c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x128(%rbp)
leaq -0x8a9(%rip), %rsi      # 0x2960
leaq -0x120(%rbp), %rdi
leaq -0x118(%rbp), %rdx
leaq -0x128(%rbp), %rcx
callq 0x41d0
jmp 0x3225
leaq -0x38(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x41a0
jmp 0x3237
leaq -0x120(%rbp), %rdi
callq 0x42a0
movq -0x118(%rbp), %rax
movslq -0x3c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x118(%rbp)
jmp 0x31c0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x3283
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x42a0
movl -0x4c(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x3df3
movq -0x48(%rbp), %rdi
callq 0x20b0
movq %rax, -0x150(%rbp)
movq 0x11d26(%rip), %rdi     # 0x14fd0
leaq 0x9f97(%rip), %rsi      # 0xd248
callq 0x2220
movq %rax, -0x368(%rbp)
jmp 0x32bf
movq -0x368(%rbp), %rdi
movq 0x11ceb(%rip), %rsi     # 0x14fb8
callq 0x2260
jmp 0x32d4
callq 0x2340
jmp 0x32db
jmp 0x32dd
leaq 0x11f64(%rip), %rdi     # 0x15248
xorl %eax, %eax
movl %eax, %esi
callq 0x3fa0
movl (%rax), %edx
leaq 0x11f2a(%rip), %rsi     # 0x15220
leaq -0x170(%rbp), %rdi
callq 0x9f70
jmp 0x3304
leaq 0xa2bc(%rip), %rsi      # 0xd5c7
leaq -0x170(%rbp), %rdi
callq 0x4470
movb %al, -0x369(%rbp)
jmp 0x331f
leaq -0x170(%rbp), %rdi
callq 0x2150
movb -0x369(%rbp), %al
testb $0x1, %al
jne 0x333a
jmp 0x345f
movq 0x11c8f(%rip), %rdi     # 0x14fd0
leaq 0x9f1a(%rip), %rsi      # 0xd262
callq 0x2220
movq %rax, -0x378(%rbp)
jmp 0x3356
movq -0x378(%rbp), %rdi
movq 0x11c54(%rip), %rsi     # 0x14fb8
callq 0x2260
jmp 0x336b
jmp 0x3492
leaq -0x38(%rbp), %rax
movq %rax, -0x130(%rbp)
movq -0x130(%rbp), %rdi
callq 0x42d0
movq %rax, -0x138(%rbp)
movq -0x130(%rbp), %rdi
callq 0x4300
movq %rax, -0x140(%rbp)
leaq -0x138(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x4330
testb $0x1, %al
jne 0x33ba
jmp 0x33eb
leaq -0x138(%rbp), %rdi
callq 0x4370
movq %rax, -0x148(%rbp)
movq -0x148(%rbp), %rdi
callq 0x2350
jmp 0x33db
jmp 0x33dd
leaq -0x138(%rbp), %rdi
callq 0x4390
jmp 0x33a1
leaq -0x38(%rbp), %rdi
callq 0x43b0
movq 0x11bd5(%rip), %rdi     # 0x14fd0
leaq 0x9e2c(%rip), %rsi      # 0xd22e
callq 0x2220
movq %rax, -0x380(%rbp)
jmp 0x3410
movq -0x380(%rbp), %rdi
movq 0x11b9a(%rip), %rsi     # 0x14fb8
callq 0x2260
jmp 0x3425
jmp 0x32dd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
callq 0x2340
jmp 0x343d
jmp 0x3df3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x170(%rbp), %rdi
callq 0x2150
jmp 0x3df3
movq 0x11b6a(%rip), %rdi     # 0x14fd0
leaq 0x9e0f(%rip), %rsi      # 0xd27c
callq 0x2220
movq %rax, -0x388(%rbp)
jmp 0x347b
movq -0x388(%rbp), %rdi
movq 0x11b2f(%rip), %rsi     # 0x14fb8
callq 0x2260
jmp 0x3490
jmp 0x3492
leaq 0x11daf(%rip), %rdi     # 0x15248
movl $0x1, %esi
callq 0x3fa0
movl (%rax), %edx
leaq 0x11d74(%rip), %rsi     # 0x15220
leaq -0x190(%rbp), %rdi
callq 0x9f70
jmp 0x34ba
leaq 0xa106(%rip), %rsi      # 0xd5c7
leaq -0x190(%rbp), %rdi
callq 0x4470
movb %al, -0x389(%rbp)
jmp 0x34d5
leaq -0x190(%rbp), %rdi
callq 0x2150
movb -0x389(%rbp), %al
testb $0x1, %al
jne 0x34ed
jmp 0x353d
movq 0x11adc(%rip), %rdi     # 0x14fd0
leaq 0x9d9b(%rip), %rsi      # 0xd296
callq 0x2220
movq %rax, -0x398(%rbp)
jmp 0x3509
movq -0x398(%rbp), %rdi
movq 0x11aa1(%rip), %rsi     # 0x14fb8
callq 0x2260
jmp 0x351e
jmp 0x3570
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x2150
jmp 0x3df3
movq 0x11a8c(%rip), %rdi     # 0x14fd0
leaq 0x9d65(%rip), %rsi      # 0xd2b0
callq 0x2220
movq %rax, -0x3a0(%rbp)
jmp 0x3559
movq -0x3a0(%rbp), %rdi
movq 0x11a51(%rip), %rsi     # 0x14fb8
callq 0x2260
jmp 0x356e
jmp 0x3570
leaq 0x11ce9(%rip), %rdi     # 0x15260
callq 0x3f80
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, -0x3a8(%rbp)
testq %rax, %rax
movss %xmm0, -0x3a4(%rbp)
js 0x35bd
movss -0x3a8(%rbp), %xmm0
movss %xmm0, -0x3a4(%rbp)
movss -0x3a4(%rbp), %xmm0
movss %xmm0, -0x3b4(%rbp)
movq 0x11c1c(%rip), %rax     # 0x151f0
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, -0x3b0(%rbp)
testq %rax, %rax
movss %xmm0, -0x3ac(%rbp)
js 0x3615
movss -0x3b0(%rbp), %xmm0
movss %xmm0, -0x3ac(%rbp)
movss -0x3b4(%rbp), %xmm0
movss -0x3ac(%rbp), %xmm1
divss %xmm1, %xmm0
callq 0x4180
movss %xmm0, -0x3b8(%rbp)
jmp 0x3638
movss -0x3b8(%rbp), %xmm0
cvttss2si %xmm0, %eax
movl %eax, -0x3c(%rbp)
movq $0x0, -0x198(%rbp)
movq -0x198(%rbp), %rax
movq %rax, -0x3c0(%rbp)
leaq 0x11bf9(%rip), %rdi     # 0x15260
callq 0x3f80
movq %rax, %rcx
movq -0x3c0(%rbp), %rax
cmpq %rcx, %rax
jae 0x38b6
movq -0x198(%rbp), %rax
movslq -0x3c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x1a8(%rbp)
leaq -0xc8b(%rip), %rsi      # 0x2a10
leaq -0x1a0(%rbp), %rdi
leaq -0x198(%rbp), %rdx
leaq -0x1a8(%rbp), %rcx
callq 0x41d0
jmp 0x36b7
leaq -0x38(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
callq 0x41a0
jmp 0x36c9
leaq -0x1a0(%rbp), %rdi
callq 0x42a0
movq -0x198(%rbp), %rax
movslq -0x3c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x198(%rbp)
jmp 0x3652
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x3715
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x42a0
movl -0x4c(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x3df3
movq -0x48(%rbp), %rdi
callq 0x20b0
movq %rax, -0x1d0(%rbp)
movq 0x11894(%rip), %rdi     # 0x14fd0
leaq 0x9ba1(%rip), %rsi      # 0xd2e4
callq 0x2220
movq %rax, -0x3c8(%rbp)
jmp 0x3751
movq -0x3c8(%rbp), %rdi
movq 0x11859(%rip), %rsi     # 0x14fb8
callq 0x2260
jmp 0x3766
callq 0x2340
jmp 0x376d
jmp 0x376f
leaq 0x11aea(%rip), %rdi     # 0x15260
xorl %eax, %eax
movl %eax, %esi
callq 0x3fa0
movl (%rax), %edx
movb $0x0, -0x231(%rbp)
leaq 0x11a91(%rip), %rsi     # 0x15220
leaq -0x1f0(%rbp), %rdi
callq 0x9f70
jmp 0x379d
leaq 0x11abc(%rip), %rdi     # 0x15260
xorl %eax, %eax
movl %eax, %esi
callq 0x3fa0
movl (%rax), %esi
leaq -0x210(%rbp), %rdi
callq 0x4020
jmp 0x37bd
leaq -0x1f0(%rbp), %rdi
leaq -0x210(%rbp), %rsi
callq 0x43e0
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x3c9(%rbp)
jne 0x3836
leaq 0x11a7a(%rip), %rdi     # 0x15260
xorl %eax, %eax
movl %eax, %esi
callq 0x3fa0
movl (%rax), %edx
leaq 0x11a28(%rip), %rsi     # 0x15220
leaq -0x230(%rbp), %rdi
callq 0x9f70
jmp 0x3806
movb $0x1, -0x231(%rbp)
leaq 0x9db3(%rip), %rsi      # 0xd5c7
leaq -0x230(%rbp), %rdi
callq 0x4470
movb %al, -0x3ca(%rbp)
jmp 0x3828
movb -0x3ca(%rbp), %al
movb %al, -0x3c9(%rbp)
jmp 0x3836
movb -0x3c9(%rbp), %al
movb %al, -0x3cb(%rbp)
testb $0x1, -0x231(%rbp)
jne 0x384d
jmp 0x3859
leaq -0x230(%rbp), %rdi
callq 0x2150
leaq -0x210(%rbp), %rdi
callq 0x2150
leaq -0x1f0(%rbp), %rdi
callq 0x2150
movb -0x3cb(%rbp), %al
testb $0x1, %al
jne 0x3880
jmp 0x39e6
movq 0x11749(%rip), %rdi     # 0x14fd0
leaq 0x9a70(%rip), %rsi      # 0xd2fe
callq 0x2220
movq %rax, -0x3d8(%rbp)
jmp 0x389c
movq -0x3d8(%rbp), %rdi
movq 0x1170e(%rip), %rsi     # 0x14fb8
callq 0x2260
jmp 0x38b1
jmp 0x3a19
leaq -0x38(%rbp), %rax
movq %rax, -0x1b0(%rbp)
movq -0x1b0(%rbp), %rdi
callq 0x42d0
movq %rax, -0x1b8(%rbp)
movq -0x1b0(%rbp), %rdi
callq 0x4300
movq %rax, -0x1c0(%rbp)
leaq -0x1b8(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
callq 0x4330
testb $0x1, %al
jne 0x3900
jmp 0x3931
leaq -0x1b8(%rbp), %rdi
callq 0x4370
movq %rax, -0x1c8(%rbp)
movq -0x1c8(%rbp), %rdi
callq 0x2350
jmp 0x3921
jmp 0x3923
leaq -0x1b8(%rbp), %rdi
callq 0x4390
jmp 0x38e7
leaq -0x38(%rbp), %rdi
callq 0x43b0
movq 0x1168f(%rip), %rdi     # 0x14fd0
leaq 0x9982(%rip), %rsi      # 0xd2ca
callq 0x2220
movq %rax, -0x3e0(%rbp)
jmp 0x3956
movq -0x3e0(%rbp), %rdi
movq 0x11654(%rip), %rsi     # 0x14fb8
callq 0x2260
jmp 0x396b
jmp 0x376f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
callq 0x2340
jmp 0x3983
jmp 0x3df3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x39d5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x39c9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
testb $0x1, -0x231(%rbp)
jne 0x39bb
jmp 0x39c7
leaq -0x230(%rbp), %rdi
callq 0x2150
jmp 0x39c9
leaq -0x210(%rbp), %rdi
callq 0x2150
leaq -0x1f0(%rbp), %rdi
callq 0x2150
jmp 0x3df3
movq 0x115e3(%rip), %rdi     # 0x14fd0
leaq 0x9924(%rip), %rsi      # 0xd318
callq 0x2220
movq %rax, -0x3e8(%rbp)
jmp 0x3a02
movq -0x3e8(%rbp), %rdi
movq 0x115a8(%rip), %rsi     # 0x14fb8
callq 0x2260
jmp 0x3a17
jmp 0x3a19
leaq 0x11828(%rip), %rdi     # 0x15248
xorl %eax, %eax
movl %eax, %esi
callq 0x3fa0
movl (%rax), %edx
leaq 0x117ee(%rip), %rsi     # 0x15220
leaq -0x258(%rbp), %rdi
callq 0x9f70
jmp 0x3a40
leaq 0x9b80(%rip), %rsi      # 0xd5c7
leaq -0x258(%rbp), %rdi
callq 0x4470
movb %al, -0x3e9(%rbp)
jmp 0x3a5b
leaq -0x258(%rbp), %rdi
callq 0x2150
movb -0x3e9(%rbp), %al
testb $0x1, %al
jne 0x3a73
jmp 0x3ac3
movq 0x11556(%rip), %rdi     # 0x14fd0
leaq 0x98b1(%rip), %rsi      # 0xd332
callq 0x2220
movq %rax, -0x3f8(%rbp)
jmp 0x3a8f
movq -0x3f8(%rbp), %rdi
movq 0x1151b(%rip), %rsi     # 0x14fb8
callq 0x2260
jmp 0x3aa4
jmp 0x3af6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x258(%rbp), %rdi
callq 0x2150
jmp 0x3df3
movq 0x11506(%rip), %rdi     # 0x14fd0
leaq 0x987b(%rip), %rsi      # 0xd34c
callq 0x2220
movq %rax, -0x400(%rbp)
jmp 0x3adf
movq -0x400(%rbp), %rdi
movq 0x114cb(%rip), %rsi     # 0x14fb8
callq 0x2260
jmp 0x3af4
jmp 0x3af6
movq $0x0, -0x260(%rbp)
movq -0x260(%rbp), %rax
cmpq 0x116e1(%rip), %rax     # 0x151f0
jae 0x3caf
movq -0x260(%rbp), %rsi
leaq 0x11755(%rip), %rdi     # 0x15278
movq %rdi, -0x410(%rbp)
callq 0x44a0
movq -0x410(%rbp), %rdi
movq %rax, -0x408(%rbp)
movq -0x260(%rbp), %rsi
callq 0x44a0
movq -0x408(%rbp), %rdx
movq %rax, %rcx
addq $0x4, %rcx
leaq -0x109e(%rip), %rsi     # 0x2ac0
leaq -0x268(%rbp), %rdi
callq 0x44c0
jmp 0x3b6c
leaq -0x38(%rbp), %rdi
leaq -0x268(%rbp), %rsi
callq 0x41a0
jmp 0x3b7e
leaq -0x268(%rbp), %rdi
callq 0x42a0
movq -0x260(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x260(%rbp)
jmp 0x3b01
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x3bc7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x268(%rbp), %rdi
callq 0x42a0
movl -0x4c(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x3df3
movq -0x48(%rbp), %rdi
callq 0x20b0
movq %rax, -0x290(%rbp)
movq 0x113e2(%rip), %rdi     # 0x14fd0
leaq 0x978b(%rip), %rsi      # 0xd380
callq 0x2220
movq %rax, -0x418(%rbp)
jmp 0x3c03
movq -0x418(%rbp), %rdi
movq 0x113a7(%rip), %rsi     # 0x14fb8
callq 0x2260
jmp 0x3c18
callq 0x2340
jmp 0x3c1f
jmp 0x3c21
leaq 0x115f8(%rip), %rsi     # 0x15220
leaq -0x2c0(%rbp), %rdi
movl $0x1, %edx
movl $0x7d0, %ecx            # imm = 0x7D0
callq 0xab00
jmp 0x3c40
leaq 0x11601(%rip), %rdi     # 0x15248
xorl %eax, %eax
movl %eax, %esi
callq 0x3fa0
movq %rax, %rsi
leaq -0x2c0(%rbp), %rdi
callq 0x4590
movq %rax, -0x420(%rbp)
jmp 0x3c68
movq -0x420(%rbp), %rax
cmpq $0x0, %rax
jne 0x3d98
movq 0x11350(%rip), %rdi     # 0x14fd0
leaq 0x9713(%rip), %rsi      # 0xd39a
callq 0x2220
movq %rax, -0x428(%rbp)
jmp 0x3c95
movq -0x428(%rbp), %rdi
movq 0x11315(%rip), %rsi     # 0x14fb8
callq 0x2260
jmp 0x3caa
jmp 0x3dcb
leaq -0x38(%rbp), %rax
movq %rax, -0x270(%rbp)
movq -0x270(%rbp), %rdi
callq 0x42d0
movq %rax, -0x278(%rbp)
movq -0x270(%rbp), %rdi
callq 0x4300
movq %rax, -0x280(%rbp)
leaq -0x278(%rbp), %rdi
leaq -0x280(%rbp), %rsi
callq 0x4330
testb $0x1, %al
jne 0x3cf9
jmp 0x3d2a
leaq -0x278(%rbp), %rdi
callq 0x4370
movq %rax, -0x288(%rbp)
movq -0x288(%rbp), %rdi
callq 0x2350
jmp 0x3d1a
jmp 0x3d1c
leaq -0x278(%rbp), %rdi
callq 0x4390
jmp 0x3ce0
leaq -0x38(%rbp), %rdi
callq 0x43b0
movq 0x11296(%rip), %rdi     # 0x14fd0
leaq 0x9625(%rip), %rsi      # 0xd366
callq 0x2220
movq %rax, -0x430(%rbp)
jmp 0x3d4f
movq -0x430(%rbp), %rdi
movq 0x1125b(%rip), %rsi     # 0x14fb8
callq 0x2260
jmp 0x3d64
jmp 0x3c21
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
callq 0x2340
jmp 0x3d7c
jmp 0x3df3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x2c0(%rbp), %rdi
callq 0x4140
jmp 0x3df3
movq 0x11231(%rip), %rdi     # 0x14fd0
leaq 0x960e(%rip), %rsi      # 0xd3b4
callq 0x2220
movq %rax, -0x438(%rbp)
jmp 0x3db4
movq -0x438(%rbp), %rdi
movq 0x111f6(%rip), %rsi     # 0x14fb8
callq 0x2260
jmp 0x3dc9
jmp 0x3dcb
movl $0x0, -0x4(%rbp)
leaq -0x2c0(%rbp), %rdi
callq 0x4140
leaq -0x38(%rbp), %rdi
callq 0x45f0
movl -0x4(%rbp), %eax
addq $0x440, %rsp            # imm = 0x440
popq %rbp
retq
leaq -0x38(%rbp), %rdi
callq 0x45f0
movq -0x48(%rbp), %rdi
callq 0x2360
movq %rax, %rdi
callq 0x43d0
nopl (%rax)