// File: /workspace/github_cpp_makefile_star2_O3/chahk0129[P]hash_bench/./bench/benchmark.hpp
// Function: benchmark_t<unsigned long>::ycsb_exec(int, int, Pair<unsigned long>*, int, Pair<unsigned long>*, int, int, int*, bool)
inline void benchmark_t<Key_t>::ycsb_exec(int workload_type, int index_type, Pair<Key_t>* init_kv, int init_num, Pair<Key_t>* run_kv, int run_num, int num_threads, int* ops, bool pcm_enabled){
    /*
    if(memory_bandwidth){
	if(geteuid() != 0){
	    fprintf(stderr, "Must be root user to measure memory bandwidth\n");
	    exit(0);
	}
	PCM_memory::InitMemoryMonitor();
    }

    if(numa){
	if(geteuid() != 0){
	    fprintf(stderr, "Must be root user to measure NUMA operations\n");
	    exit(0);
	}
	PCM_NUMA::InitNumaMonitor();
    }*/

    Hash<Key_t>* hashtable = getInstance<Key_t>(index_type);
    //init_num = 100;
    //run_num = 100;

    auto load_func = [&hashtable, &init_kv, init_num, num_threads](uint64_t thread_id, bool){
	size_t total_num = init_num;
	size_t chunk_size = total_num / num_threads;
	size_t from = chunk_size * thread_id;
	size_t to = chunk_size * (thread_id+1);

	for(size_t i=from; i<to; i++){
	    hashtable->Insert(init_kv[i].key, init_kv[i].value);
	}
	return;
    };

    /*
    if(memory_bandwidth)
	PCM_memory::StartMemoryMonitor();

    if(numa)
	PCM_NUMA::StartNUMAMonitor();
	*/
    std::unique_ptr<SystemCounterState> before;
    if(pcm_enabled){
	before = std::make_unique<SystemCounterState>();
	*before = getSystemCounterState();
    }
    clear_cache();
    double start_time = get_now();
    start_threads(hashtable, num_threads, load_func, false);
    double end_time = get_now();

    std::unique_ptr<SystemCounterState> after;
    if(pcm_enabled){
	after = std::make_unique<SystemCounterState>();
	*after = getSystemCounterState();
    }
    /*
    if(memory_bandwidth)
	PCM_memory::EndMemoryMonitor();

    if(numa)
	PCM_NUMA::EndNUMAMonitor();
	*/
    double throughput = init_num / (end_time - start_time) / 1000000; // MOps/sec
    std::cout << "\033[1;32m";
    std::cout << "Insert " << throughput << "\033[0m" << std::endl;

    if(pcm_enabled){
	std::cout << "PCM Metrics:\n"
	    	  << "\tL3 misses: " << getL3CacheMisses(*before, *after) << "\n"
		  << "\tReads(bytes): " << getBytesReadFromMC(*before, *after) << "\n"
		  << "\tWrites(byes): " << getBytesWrittenToMC(*before, *after) << std::endl;
    }

    auto exec_func = [&hashtable, &run_kv, run_num, &ops, num_threads](uint64_t thread_id, bool){
	size_t total_num = run_num;
	size_t chunk_size = total_num / num_threads;
	size_t from = chunk_size * thread_id;
	size_t to = chunk_size * (thread_id+1);

	for(size_t i=from; i<to; i++){
	    if(ops[i] == OP_INSERT){
		hashtable->Insert(run_kv[i].key, run_kv[i].value);
	    }
	    else if(ops[i] == OP_READ){
		auto ret = hashtable->Get(run_kv[i].key);
		if((uint64_t)ret == 0)
		    std::cout << "not found" << std::endl;
	    }
	    else if(ops[i] == OP_UPDATE){
		auto ret = hashtable->Update(run_kv[i].key, run_kv[i].value);
	    }
	}
	return;
    };

    /*
    if(memory_bandwidth)
	PCM_memory::StartMemoryMonitor();

    if(numa)
	PCM_NUMA::StartNUMAMonitor();
    */
    if(pcm_enabled){
	*before = getSystemCounterState();
    }

    clear_cache();
    start_time = get_now();
    start_threads(hashtable, num_threads, exec_func, false);
    end_time = get_now();

    if(pcm_enabled){
	*after = getSystemCounterState();
    }

    /*
    if(memory_bandwidth)
	PCM_memory::EndMemoryMonitor();

    if(numa)
	PCM_NUMA::EndNUMAMonitor();
    */
    throughput = run_num / (end_time - start_time) / 1000000; // MOps/sec
    std::cout << "\033[1;31m";
    if(workload_type == WORKLOAD_A)
	std::cout << "Read/Update " << throughput << "\033[0m" << std::endl;
    else if(workload_type == WORKLOAD_B)
	std::cout << "Read/Update " << throughput << "\033[0m" << std::endl;
    else if(workload_type == WORKLOAD_C)
	std::cout << "Read " << throughput << "\033[0m" << std::endl;
    else if(workload_type == WORKLOAD_D)
	std::cout << "Read/Update " << throughput << "\033[0m" << std::endl;

    if(pcm_enabled){
	std::cout << "PCM Metrics:\n"
	    	  << "\tL3 misses: " << getL3CacheMisses(*before, *after) << "\n"
		  << "\tReads(bytes): " << getBytesReadFromMC(*before, *after) << "\n"
		  << "\tWrites(byes): " << getBytesWrittenToMC(*before, *after) << std::endl;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x278, %rsp            # imm = 0x278
movl %r8d, %r15d
movl %edx, %edi
movl %esi, %r14d
movb 0x2c8(%rsp), %bpl
movl 0x2b8(%rsp), %r12d
leaq 0xc0(%rsp), %rbx
movq %rcx, (%rbx)
movq %r9, 0x78(%rsp)
callq 0xd147
leaq 0x18(%rsp), %rcx
movq %rax, (%rcx)
movq %rcx, 0xa8(%rsp)
movq %rbx, 0xb0(%rsp)
movl %r15d, 0xb8(%rsp)
movl %r12d, 0xbc(%rsp)
testb %bpl, %bpl
movl %r14d, 0x3c(%rsp)
movl %r15d, 0x10(%rsp)
je 0xc191
movl $0x1b0, %edi            # imm = 0x1B0
callq 0x5400
movq %rax, %rbx
movq %rax, %rdi
callq 0x10950
leaq 0xc8(%rsp), %r15
movq %r15, %rdi
callq 0x23280
leaq 0x8(%rbx), %rdi
leaq 0xd0(%rsp), %rsi
movl $0xc0, %edx
callq 0x5330
movl $0xd0, %eax
movq %rbx, %rdi
addq %rax, %rdi
addq %rax, %r15
movl $0x90, %edx
movq %r15, %rsi
callq 0x5330
leaq 0x228(%rsp), %r15
movq 0x170(%rbx), %rax
movups (%r15), %xmm0
movq 0x10(%r15), %rcx
movq %rcx, 0x170(%rbx)
movups 0x160(%rbx), %xmm1
movups %xmm0, 0x160(%rbx)
leaq 0x40(%rsp), %rbp
movaps %xmm1, (%rbp)
movq %rax, 0x10(%rbp)
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
xorl %r12d, %r12d
movq %r12, 0x10(%r15)
movq %rbp, %rdi
callq 0x10d56
leaq 0x240(%rsp), %r13
movq 0x188(%rbx), %rax
movups (%r13), %xmm0
movq 0x10(%r13), %rcx
movq %rcx, 0x188(%rbx)
movups 0x178(%rbx), %xmm1
movups %xmm0, 0x178(%rbx)
movaps %xmm1, (%rbp)
movq %rax, 0x10(%rbp)
xorps %xmm0, %xmm0
movups %xmm0, (%r13)
movq %r12, 0x10(%r13)
leaq 0x40(%rsp), %rbp
movq %rbp, %rdi
callq 0x10d56
leaq 0x258(%rsp), %r14
movq 0x1a0(%rbx), %rax
movups (%r14), %xmm0
movq 0x10(%r14), %rcx
movq %rcx, 0x1a0(%rbx)
movupd 0x190(%rbx), %xmm1
movups %xmm0, 0x190(%rbx)
movapd %xmm1, (%rbp)
movq %rax, 0x10(%rbp)
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movq %r12, 0x10(%r14)
leaq 0x40(%rsp), %rdi
callq 0x10d56
movq 0x18(%r14), %rax
movq %rax, 0x1a8(%rbx)
leaq 0x2f8d3(%rip), %rax     # 0x3ba20
leaq 0xd0(%rsp), %rcx
movq %rax, -0x8(%rcx)
leaq 0x2f8e0(%rip), %rax     # 0x3ba40
movq %rax, -0xc8(%r14)
movq %r14, %rdi
callq 0x10d56
movq %r13, %rdi
callq 0x10d56
movq %r15, %rdi
callq 0x10d56
movb 0x2c8(%rsp), %bpl
movl 0x2b8(%rsp), %r12d
jmp 0xc193
xorl %ebx, %ebx
leaq 0xc8(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x5690
xorps %xmm0, %xmm0
cvtsi2sdq (%r14), %xmm0
movsd %xmm0, 0x28(%rsp)
xorps %xmm0, %xmm0
cvtsi2sdq 0x8(%r14), %xmm0
movsd %xmm0, 0x30(%rsp)
movq 0x18(%rsp), %rdi
movslq %r12d, %r13
movb $0x0, (%r14)
leaq 0xa8(%rsp), %rdx
leaq 0xc8(%rsp), %rcx
movq %r13, %rsi
movq %rbx, 0x8(%rsp)
callq 0xd244
xorl %r14d, %r14d
leaq 0xc8(%rsp), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x5690
xorps %xmm0, %xmm0
cvtsi2sdq (%r15), %xmm0
movsd %xmm0, 0xa0(%rsp)
xorps %xmm0, %xmm0
cvtsi2sdq 0x8(%r15), %xmm0
movsd %xmm0, 0x20(%rsp)
testb %bpl, %bpl
movq %r13, 0x70(%rsp)
je 0xc3da
movl $0x1b0, %edi            # imm = 0x1B0
callq 0x5400
movq %rax, %r14
movq %rax, %rdi
callq 0x10950
leaq 0xc8(%rsp), %r15
movq %r15, %rdi
callq 0x23280
leaq 0x8(%r14), %rdi
leaq 0xd0(%rsp), %rsi
movl $0xc0, %edx
callq 0x5330
movl $0xd0, %eax
movq %r14, %rdi
addq %rax, %rdi
addq %rax, %r15
movl $0x90, %edx
movq %r15, %rsi
callq 0x5330
leaq 0x228(%rsp), %rbp
movq 0x170(%r14), %rax
movups (%rbp), %xmm0
movq 0x10(%rbp), %rcx
movq %rcx, 0x170(%r14)
movups 0x160(%r14), %xmm1
movups %xmm0, 0x160(%r14)
leaq 0x40(%rsp), %r13
movaps %xmm1, (%r13)
movq %rax, 0x10(%r13)
xorps %xmm0, %xmm0
movups %xmm0, (%rbp)
xorl %ebx, %ebx
movq %rbx, 0x10(%rbp)
movq %r13, %rdi
callq 0x10d56
leaq 0x240(%rsp), %r15
movq 0x188(%r14), %rax
movups (%r15), %xmm0
movq 0x10(%r15), %rcx
movq %rcx, 0x188(%r14)
movups 0x178(%r14), %xmm1
movups %xmm0, 0x178(%r14)
movaps %xmm1, (%r13)
movq %rax, 0x10(%r13)
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
movq %rbx, 0x10(%r15)
leaq 0x40(%rsp), %r13
movq %r13, %rdi
callq 0x10d56
leaq 0x258(%rsp), %r12
movq 0x1a0(%r14), %rax
movupd (%r12), %xmm0
movq 0x10(%r12), %rcx
movq %rcx, 0x1a0(%r14)
movupd 0x190(%r14), %xmm1
movupd %xmm0, 0x190(%r14)
movapd %xmm1, (%r13)
movq %rax, 0x10(%r13)
xorpd %xmm0, %xmm0
movupd %xmm0, (%r12)
movq %rbx, 0x10(%r12)
leaq 0x40(%rsp), %rdi
callq 0x10d56
movq 0x18(%r12), %rax
movq %rax, 0x1a8(%r14)
leaq 0x2f693(%rip), %rax     # 0x3ba20
leaq 0xd0(%rsp), %rcx
movq %rax, -0x8(%rcx)
leaq 0x2f6a0(%rip), %rax     # 0x3ba40
movq %rax, -0xc8(%r12)
movq %r12, %rdi
callq 0x10d56
movq %r15, %rdi
callq 0x10d56
movq %rbp, %rdi
callq 0x10d56
movq 0x8(%rsp), %rbx
movb 0x2c8(%rsp), %bpl
movl 0x2b8(%rsp), %r12d
movq 0x70(%rsp), %r13
movq 0x2fbd7(%rip), %rdi     # 0x3bfb8
leaq 0x213d2(%rip), %rsi     # 0x2d7ba
movl $0x7, %edx
callq 0x5470
movq 0x2fbbf(%rip), %rdi     # 0x3bfb8
leaq 0x213c2(%rip), %rsi     # 0x2d7c2
movl $0x7, %edx
callq 0x5470
movsd 0x30(%rsp), %xmm1
divsd 0x20e58(%rip), %xmm1    # 0x2d270
movsd 0x20(%rsp), %xmm2
divsd 0x20e4a(%rip), %xmm2    # 0x2d270
addsd 0x28(%rsp), %xmm1
addsd 0xa0(%rsp), %xmm2
xorps %xmm0, %xmm0
cvtsi2sdl 0x10(%rsp), %xmm0
subsd %xmm1, %xmm2
divsd %xmm2, %xmm0
divsd 0x20e22(%rip), %xmm0    # 0x2d270
movq 0x2fb63(%rip), %rdi     # 0x3bfb8
callq 0x5680
movq %rax, %r15
leaq 0x21366(%rip), %rsi     # 0x2d7ca
movl $0x4, %edx
movq %rax, %rdi
callq 0x5470
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x53d0
movsbl %al, %esi
movq %r15, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x52b0
movl 0x2b0(%rsp), %r15d
testb %bpl, %bpl
je 0xc7a0
movq 0x2fb08(%rip), %rdi     # 0x3bfb8
leaq 0x21318(%rip), %rsi     # 0x2d7cf
movl $0xd, %edx
callq 0x5470
movl %r15d, %ebp
movq 0x2faed(%rip), %rdi     # 0x3bfb8
leaq 0x2130b(%rip), %rsi     # 0x2d7dd
movl $0xc, %edx
callq 0x5470
callq 0x1b5e0
movl 0x4(%rax), %eax
xorl %esi, %esi
cmpl $0x1c, %eax
je 0xc4f8
cmpl $0x57, %eax
je 0xc4f8
movq 0x20(%r14), %rsi
subq 0x20(%rbx), %rsi
movq 0x2fab9(%rip), %rdi     # 0x3bfb8
callq 0x5290
movq %rax, %r15
leaq 0x212cd(%rip), %rsi     # 0x2d7db
movl $0x1, %edx
movq %rax, %rdi
callq 0x5470
leaq 0x212c8(%rip), %rsi     # 0x2d7ea
movl $0xf, %edx
movq %r15, %rdi
callq 0x5470
movq 0xd8(%r14), %rsi
subq 0xd8(%rbx), %rsi
shlq $0x6, %rsi
movq %r15, %rdi
callq 0x5290
movq %rax, %r15
leaq 0x21288(%rip), %rsi     # 0x2d7db
movl $0x1, %edx
movq %rax, %rdi
callq 0x5470
leaq 0x21293(%rip), %rsi     # 0x2d7fa
movl $0xf, %edx
movq %r15, %rdi
callq 0x5470
movq 0xd0(%r14), %rsi
subq 0xd0(%rbx), %rsi
shlq $0x6, %rsi
movq %r15, %rdi
callq 0x5290
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x53d0
movsbl %al, %esi
movq %r15, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x52b0
leaq 0x18(%rsp), %rax
movq %rax, 0x40(%rsp)
leaq 0x78(%rsp), %rax
movq %rax, 0x48(%rsp)
movl %ebp, 0x50(%rsp)
leaq 0x2c0(%rsp), %rax
movq %rax, 0x58(%rsp)
movl %r12d, 0x60(%rsp)
leaq 0xc8(%rsp), %rdi
callq 0x23280
leaq 0xd0(%rbx), %r15
leaq 0x8(%rbx), %rdi
leaq 0xd0(%rsp), %rsi
movl $0xc0, %edx
callq 0x5330
leaq 0x198(%rsp), %rsi
movl $0x90, %edx
movq %r15, %rdi
callq 0x5330
leaq 0x228(%rsp), %r13
movq 0x170(%rbx), %rax
movups (%r13), %xmm0
movq 0x10(%r13), %rcx
movq %rcx, 0x170(%rbx)
movups 0x160(%rbx), %xmm1
movups %xmm0, 0x160(%rbx)
leaq 0x80(%rsp), %r12
movaps %xmm1, (%r12)
movq %rax, 0x10(%r12)
xorps %xmm0, %xmm0
movups %xmm0, (%r13)
xorl %ebx, %ebx
movq %rbx, 0x10(%r13)
movq %r12, %rdi
callq 0x10d56
leaq 0x240(%rsp), %r15
movq 0x8(%rsp), %rax
movq 0x188(%rax), %rax
movups (%r15), %xmm0
movq 0x10(%r15), %rcx
movq 0x8(%rsp), %rdx
movq %rcx, 0x188(%rdx)
movq 0x8(%rsp), %rcx
movups 0x178(%rcx), %xmm1
movq 0x8(%rsp), %rcx
movups %xmm0, 0x178(%rcx)
movaps %xmm1, (%r12)
movq %rax, 0x10(%r12)
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
movq %rbx, 0x10(%r15)
leaq 0x80(%rsp), %r12
movq %r12, %rdi
callq 0x10d56
leaq 0x258(%rsp), %rbp
movq 0x8(%rsp), %rax
movq 0x1a0(%rax), %rax
movupd (%rbp), %xmm0
movq 0x10(%rbp), %rcx
movq 0x8(%rsp), %rdx
movq %rcx, 0x1a0(%rdx)
movq 0x8(%rsp), %rcx
movupd 0x190(%rcx), %xmm1
movq 0x8(%rsp), %rcx
movupd %xmm0, 0x190(%rcx)
movapd %xmm1, (%r12)
movq %rax, 0x10(%r12)
xorpd %xmm0, %xmm0
movupd %xmm0, (%rbp)
movq %rbx, 0x10(%rbp)
movq 0x8(%rsp), %rbx
leaq 0x80(%rsp), %rdi
callq 0x10d56
movq 0x18(%rbp), %rax
movq %rax, 0x1a8(%rbx)
leaq 0x2f2c6(%rip), %rax     # 0x3ba20
leaq 0xd0(%rsp), %rcx
movq %rax, -0x8(%rcx)
leaq 0x2f2d3(%rip), %rax     # 0x3ba40
leaq 0x198(%rsp), %rcx
movq %rax, -0x8(%rcx)
movq %rbp, %rdi
callq 0x10d56
movq %r15, %rdi
callq 0x10d56
movq %r13, %rdi
callq 0x10d56
movb 0x2c8(%rsp), %bpl
movq 0x70(%rsp), %r13
jmp 0xc7cb
leaq 0x18(%rsp), %rax
movq %rax, 0x40(%rsp)
leaq 0x78(%rsp), %rax
movq %rax, 0x48(%rsp)
movl %r15d, 0x50(%rsp)
leaq 0x2c0(%rsp), %rax
movq %rax, 0x58(%rsp)
movl %r12d, 0x60(%rsp)
leaq 0xc8(%rsp), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x5690
xorps %xmm0, %xmm0
cvtsi2sdq (%r15), %xmm0
movsd %xmm0, 0x30(%rsp)
xorps %xmm0, %xmm0
cvtsi2sdq 0x8(%r15), %xmm0
movsd %xmm0, 0x10(%rsp)
movq 0x18(%rsp), %rdi
movb $0x0, (%r15)
leaq 0x40(%rsp), %rdx
leaq 0xc8(%rsp), %rcx
movq %r13, %rsi
callq 0xd31f
leaq 0xc8(%rsp), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x5690
xorps %xmm0, %xmm0
cvtsi2sdq (%r15), %xmm0
movsd %xmm0, 0x20(%rsp)
xorps %xmm0, %xmm0
cvtsi2sdq 0x8(%r15), %xmm0
movsd %xmm0, 0x28(%rsp)
testb %bpl, %bpl
je 0xc9de
leaq 0xc8(%rsp), %r12
movq %r12, %rdi
callq 0x23280
leaq 0x8(%r14), %rdi
leaq 0xd0(%rsp), %rsi
movl $0xc0, %edx
callq 0x5330
movl $0xd0, %eax
leaq (%r14,%rax), %rdi
addq %rax, %r12
movl $0x90, %edx
movq %r12, %rsi
callq 0x5330
leaq 0x228(%rsp), %r12
movq 0x170(%r14), %rax
movups (%r12), %xmm0
movq 0x10(%r12), %rcx
movq %rcx, 0x170(%r14)
movups 0x160(%r14), %xmm1
movups %xmm0, 0x160(%r14)
leaq 0x80(%rsp), %rbp
movaps %xmm1, (%rbp)
movq %rax, 0x10(%rbp)
xorps %xmm0, %xmm0
movups %xmm0, (%r12)
xorl %ebx, %ebx
movq %rbx, 0x10(%r12)
movq %rbp, %rdi
callq 0x10d56
leaq 0x240(%rsp), %r13
movq 0x188(%r14), %rax
movups (%r13), %xmm0
movq 0x10(%r13), %rcx
movq %rcx, 0x188(%r14)
movups 0x178(%r14), %xmm1
movups %xmm0, 0x178(%r14)
movaps %xmm1, (%rbp)
movq %rax, 0x10(%rbp)
xorps %xmm0, %xmm0
movups %xmm0, (%r13)
movq %rbx, 0x10(%r13)
leaq 0x80(%rsp), %rbp
movq %rbp, %rdi
callq 0x10d56
leaq 0x258(%rsp), %r15
movq 0x1a0(%r14), %rax
movupd (%r15), %xmm0
movq 0x10(%r15), %rcx
movq %rcx, 0x1a0(%r14)
movupd 0x190(%r14), %xmm1
movupd %xmm0, 0x190(%r14)
movapd %xmm1, (%rbp)
movq %rax, 0x10(%rbp)
xorpd %xmm0, %xmm0
movupd %xmm0, (%r15)
movq %rbx, 0x10(%r15)
leaq 0x80(%rsp), %rdi
callq 0x10d56
movq 0x18(%r15), %rax
movq %rax, 0x1a8(%r14)
leaq 0x2f081(%rip), %rax     # 0x3ba20
leaq 0xd0(%rsp), %rcx
movq %rax, -0x8(%rcx)
leaq 0x2f08e(%rip), %rax     # 0x3ba40
movq %rax, -0xc8(%r15)
movq %r15, %rdi
callq 0x10d56
movq %r13, %rdi
callq 0x10d56
movq %r12, %rdi
callq 0x10d56
movq 0x8(%rsp), %rbx
movb 0x2c8(%rsp), %bpl
movq 0x2f5d3(%rip), %rdi     # 0x3bfb8
leaq 0x20e1e(%rip), %rsi     # 0x2d80a
movl $0x7, %edx
callq 0x5470
movl 0x3c(%rsp), %eax
cmpl $0x3, %eax
ja 0xcbcf
movsd 0x10(%rsp), %xmm0
divsd 0x2085f(%rip), %xmm0    # 0x2d270
movsd 0x28(%rsp), %xmm1
divsd 0x20851(%rip), %xmm1    # 0x2d270
addsd 0x30(%rsp), %xmm0
addsd 0x20(%rsp), %xmm1
cvtsi2sdl 0x2b0(%rsp), %xmm2
subsd %xmm0, %xmm1
divsd %xmm1, %xmm2
divsd 0x2082c(%rip), %xmm2    # 0x2d270
movsd %xmm2, 0x10(%rsp)
movl %eax, %eax
leaq 0x20845(%rip), %rcx     # 0x2d298
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x2f555(%rip), %rdi     # 0x3bfb8
leaq 0x20da8(%rip), %rsi     # 0x2d812
movl $0xc, %edx
callq 0x5470
movq 0x2f53d(%rip), %rdi     # 0x3bfb8
movsd 0x10(%rsp), %xmm0
callq 0x5680
movq %rax, %r15
leaq 0x20d3a(%rip), %rsi     # 0x2d7ca
movl $0x4, %edx
movq %rax, %rdi
callq 0x5470
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x53d0
jmp 0xcbbc
movq 0x2f4fb(%rip), %rdi     # 0x3bfb8
leaq 0x20d5b(%rip), %rsi     # 0x2d81f
movl $0x5, %edx
callq 0x5470
movq 0x2f4e3(%rip), %rdi     # 0x3bfb8
movsd 0x10(%rsp), %xmm0
callq 0x5680
movq %rax, %r15
leaq 0x20ce0(%rip), %rsi     # 0x2d7ca
movl $0x4, %edx
movq %rax, %rdi
callq 0x5470
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x53d0
jmp 0xcbbc
movq 0x2f4a1(%rip), %rdi     # 0x3bfb8
leaq 0x20cf4(%rip), %rsi     # 0x2d812
movl $0xc, %edx
callq 0x5470
movq 0x2f489(%rip), %rdi     # 0x3bfb8
movsd 0x10(%rsp), %xmm0
callq 0x5680
movq %rax, %r15
leaq 0x20c86(%rip), %rsi     # 0x2d7ca
movl $0x4, %edx
movq %rax, %rdi
callq 0x5470
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x53d0
jmp 0xcbbc
movq 0x2f44a(%rip), %rdi     # 0x3bfb8
leaq 0x20c9d(%rip), %rsi     # 0x2d812
movl $0xc, %edx
callq 0x5470
movq 0x2f432(%rip), %rdi     # 0x3bfb8
movsd 0x10(%rsp), %xmm0
callq 0x5680
movq %rax, %r15
leaq 0x20c2f(%rip), %rsi     # 0x2d7ca
movl $0x4, %edx
movq %rax, %rdi
callq 0x5470
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x53d0
movsbl %al, %esi
movq %r15, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x52b0
testb %bpl, %bpl
je 0xcce6
movq 0x2f3d9(%rip), %rdi     # 0x3bfb8
leaq 0x20be9(%rip), %rsi     # 0x2d7cf
movl $0xd, %edx
callq 0x5470
movq 0x2f3c1(%rip), %rdi     # 0x3bfb8
leaq 0x20bdf(%rip), %rsi     # 0x2d7dd
movl $0xc, %edx
callq 0x5470
callq 0x1b5e0
movl 0x4(%rax), %eax
xorl %esi, %esi
cmpl $0x1c, %eax
je 0xcc24
cmpl $0x57, %eax
je 0xcc24
movq 0x20(%r14), %rsi
subq 0x20(%rbx), %rsi
movq 0x2f38d(%rip), %rdi     # 0x3bfb8
callq 0x5290
movq %rax, %r15
leaq 0x20ba1(%rip), %rsi     # 0x2d7db
movl $0x1, %edx
movq %rax, %rdi
callq 0x5470
leaq 0x20b9c(%rip), %rsi     # 0x2d7ea
movl $0xf, %edx
movq %r15, %rdi
callq 0x5470
movq 0xd8(%r14), %rsi
subq 0xd8(%rbx), %rsi
shlq $0x6, %rsi
movq %r15, %rdi
callq 0x5290
movq %rax, %r15
leaq 0x20b5c(%rip), %rsi     # 0x2d7db
movl $0x1, %edx
movq %rax, %rdi
callq 0x5470
leaq 0x20b67(%rip), %rsi     # 0x2d7fa
movl $0xf, %edx
movq %r15, %rdi
callq 0x5470
movq 0xd0(%r14), %rsi
subq 0xd0(%rbx), %rsi
shlq $0x6, %rsi
movq %r15, %rdi
callq 0x5290
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x53d0
movsbl %al, %esi
movq %r15, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x52b0
jmp 0xcceb
testq %r14, %r14
je 0xccf4
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
testq %rbx, %rbx
je 0xcd02
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
addq $0x278, %rsp            # imm = 0x278
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xcd56
jmp 0xcd56
movq %rax, %r15
jmp 0xcd5e
movq %rax, %r15
movl $0x1b0, %esi            # imm = 0x1B0
movq %r14, %rdi
callq 0x5410
jmp 0xcd67
jmp 0xcd4f
movq %rbx, 0x8(%rsp)
movq %rax, %r15
jmp 0xcd6f
movq %rax, %r15
movl $0x1b0, %esi            # imm = 0x1B0
movq %rbx, %rdi
callq 0x5410
jmp 0xcd7a
jmp 0xcd56
movq %rax, %r15
jmp 0xcd67
jmp 0xcd56
movq %rax, %r15
testq %r14, %r14
je 0xcd67
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
cmpq $0x0, 0x8(%rsp)
je 0xcd7a
movq 0x8(%rsp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movq %r15, %rdi
callq 0x5740