// File: sundale[P]gcode/rs274ngc/interp_convert.cc
// Function: Interp::convert_setup_tool(block_struct*, setup_struct*)
int Interp::convert_setup_tool(block_pointer block, setup_pointer settings) {
    int pocket = -1, toolno;
    int q;

    is_near_int(&toolno, block->p_number);

    CHP((find_tool_pocket(settings, toolno, &pocket)));

    settings->tool_table[pocket].toolno = toolno;

    if(block->x_flag) {
        double x = block->x_number;
        if (block->l_number == 10) x = settings->current_x + settings->tool_offset.tran.x - x;
        settings->tool_table[pocket].offset.tran.x = PROGRAM_TO_USER_LEN(x);
    }
    if(block->y_flag) {
        double y = block->y_number;
        if (block->l_number == 10) y = settings->current_y + settings->tool_offset.tran.y - y;
        settings->tool_table[pocket].offset.tran.y = PROGRAM_TO_USER_LEN(y);
    }
    if(block->z_flag) {
        double z = block->z_number;
        if (block->l_number == 10) z = settings->current_z + settings->tool_offset.tran.z - z;
        settings->tool_table[pocket].offset.tran.z = PROGRAM_TO_USER_LEN(z);
    }
    if(block->a_flag) {
        double a = block->a_number;
        if (block->l_number == 10) a = settings->AA_current + settings->tool_offset.a - a;
        settings->tool_table[pocket].offset.a = PROGRAM_TO_USER_ANG(a);
    }
    if(block->b_flag) {
        double b = block->b_number;
        if (block->l_number == 10) b = settings->BB_current + settings->tool_offset.b - b;
        settings->tool_table[pocket].offset.b = PROGRAM_TO_USER_ANG(b);
    }
    if(block->c_flag) {
        double c = block->c_number;
        if (block->l_number == 10) c = settings->CC_current + settings->tool_offset.c - c;
        settings->tool_table[pocket].offset.c = PROGRAM_TO_USER_ANG(c);
    }
    if(block->u_flag) {
        double u = block->u_number;
        if (block->l_number == 10) u = settings->u_current + settings->tool_offset.u - u;
        settings->tool_table[pocket].offset.u = PROGRAM_TO_USER_LEN(u);
    }
    if(block->v_flag) {
        double v = block->v_number;
        if (block->l_number == 10) v = settings->v_current + settings->tool_offset.v - v;
        settings->tool_table[pocket].offset.v = PROGRAM_TO_USER_LEN(v);
    }
    if(block->w_flag) {
        double w = block->w_number;
        if (block->l_number == 10) w = settings->w_current + settings->tool_offset.w - w;
        settings->tool_table[pocket].offset.w = PROGRAM_TO_USER_LEN(w);
    }

    if(block->r_flag) settings->tool_table[pocket].diameter = PROGRAM_TO_USER_LEN(block->r_number) * 2.;
    if(block->i_flag) settings->tool_table[pocket].frontangle = block->i_number;
    if(block->j_flag) settings->tool_table[pocket].backangle = block->j_number;
    if(block->q_number != -1.0) {
        CHKS((!is_near_int(&q, block->q_number)), "Q number in G10 is not an integer");
        CHKS((q > 9), "Invalid tool orientation");
        settings->tool_table[pocket].orientation = q;
    }

    SET_TOOL_TABLE_ENTRY(pocket,
                             settings->tool_table[pocket].toolno,
                             settings->tool_table[pocket].offset,
                             settings->tool_table[pocket].diameter,
                             settings->tool_table[pocket].frontangle,
                             settings->tool_table[pocket].backangle,
                             settings->tool_table[pocket].orientation);

    if(settings->current_pocket == pocket) {
       settings->tool_table[0] = settings->tool_table[pocket];
    }

    if (settings->tool_table[0].toolno < 0) {
      settings->parameters[5400] = 0; // -1 ==> notool
    } else {
      settings->parameters[5400] = settings->tool_table[0].toolno;
    }
    settings->parameters[5401] = settings->tool_table[0].offset.tran.x;
    settings->parameters[5402] = settings->tool_table[0].offset.tran.y;
    settings->parameters[5403] = settings->tool_table[0].offset.tran.z;
    settings->parameters[5404] = settings->tool_table[0].offset.a;
    settings->parameters[5405] = settings->tool_table[0].offset.b;
    settings->parameters[5406] = settings->tool_table[0].offset.c;
    settings->parameters[5407] = settings->tool_table[0].offset.u;
    settings->parameters[5408] = settings->tool_table[0].offset.v;
    settings->parameters[5409] = settings->tool_table[0].offset.w;
    settings->parameters[5410] = settings->tool_table[0].diameter;
    settings->parameters[5411] = settings->tool_table[0].frontangle;
    settings->parameters[5412] = settings->tool_table[0].backangle;
    settings->parameters[5413] = settings->tool_table[0].orientation;

    //persuade axis-gui to update parameters widget for current tool:
    if (   !_setup.random_toolchanger
        && toolno == settings->current_pocket) {
        SET_TOOL_TABLE_ENTRY(0,
                             settings->tool_table[pocket].toolno,
                             settings->tool_table[pocket].offset,
                             settings->tool_table[pocket].diameter,
                             settings->tool_table[pocket].frontangle,
                             settings->tool_table[pocket].backangle,
                             settings->tool_table[pocket].orientation);
    }

    return INTERP_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2a0, %rsp            # imm = 0x2A0
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x110(%rbp)
movl $0xffffffff, -0x24(%rbp) # imm = 0xFFFFFFFF
movq -0x18(%rbp), %rax
movsd 0x210(%rax), %xmm0
leaq -0x28(%rbp), %rdi
callq 0x21020
movq -0x110(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl -0x28(%rbp), %edx
leaq -0x24(%rbp), %rcx
callq 0x10f70
movl %eax, -0x30(%rbp)
cmpl $0x0, -0x30(%rbp)
je 0x2a47f
jmp 0x2a3c4
movq 0x5cb95(%rip), %rax     # 0x86f60
cmpl $0x31, 0xd670(%rax)
jge 0x2a474
movq 0x5cb81(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rax
movq 0x5cb73(%rip), %rdi     # 0x86f60
addq $0xc6d0, %rdi           # imm = 0xC6D0
imulq $0x50, %rax, %rax
addq %rax, %rdi
leaq 0x5087e(%rip), %rsi     # 0x7ac80
movl $0x50, %edx
callq 0x10840
movq 0x5cb4d(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x5cb3f(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x4f(%rax)
movq 0x5cb27(%rip), %rax     # 0x86f60
movl 0xd670(%rax), %ecx
addl $0x1, %ecx
movq 0x5cb17(%rip), %rax     # 0x86f60
movl %ecx, 0xd670(%rax)
movq 0x5cb0a(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x5cafc(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, (%rax)
movl -0x30(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x2b3e4
jmp 0x2a481
movl -0x28(%rbp), %ecx
movq -0x20(%rbp), %rax
addq $0xd6c8, %rax           # imm = 0xD6C8
movslq -0x24(%rbp), %rdx
imulq $0x70, %rdx, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
testb $0x1, 0x270(%rax)
je 0x2a5b7
movq -0x18(%rbp), %rax
movsd 0x278(%rax), %xmm0
movsd %xmm0, -0x38(%rbp)
movq -0x18(%rbp), %rax
cmpl $0xa, 0x1c8(%rax)
jne 0x2a4ec
movq -0x20(%rbp), %rax
movsd 0x600(%rax), %xmm0
movq -0x20(%rbp), %rax
addsd 0xd678(%rax), %xmm0
subsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x118(%rbp)
movq 0x5ca60(%rip), %rax     # 0x86f60
cmpl $0x1, 0x1690(%rax)
jne 0x2a51b
movsd 0x4e937(%rip), %xmm0    # 0x78e48
movsd %xmm0, -0x120(%rbp)
jmp 0x2a56d
movq 0x5ca3e(%rip), %rax     # 0x86f60
movl 0x1690(%rax), %eax
movsd 0x4e910(%rip), %xmm0    # 0x78e40
movsd 0x4e8d8(%rip), %xmm1    # 0x78e10
movsd %xmm1, -0x130(%rbp)
cmpl $0x3, %eax
movsd %xmm0, -0x128(%rbp)
je 0x2a55d
movsd -0x130(%rbp), %xmm0
movsd %xmm0, -0x128(%rbp)
movsd -0x128(%rbp), %xmm0
movsd %xmm0, -0x120(%rbp)
movsd -0x118(%rbp), %xmm0
movsd -0x120(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x138(%rbp)
callq 0x11030
movaps %xmm0, %xmm1
movsd -0x138(%rbp), %xmm0
mulsd %xmm1, %xmm0
movq -0x20(%rbp), %rax
addq $0xd6c8, %rax           # imm = 0xD6C8
movslq -0x24(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x8(%rax)
movq -0x18(%rbp), %rax
testb $0x1, 0x280(%rax)
je 0x2a6d3
movq -0x18(%rbp), %rax
movsd 0x288(%rax), %xmm0
movsd %xmm0, -0x40(%rbp)
movq -0x18(%rbp), %rax
cmpl $0xa, 0x1c8(%rax)
jne 0x2a608
movq -0x20(%rbp), %rax
movsd 0x608(%rax), %xmm0
movq -0x20(%rbp), %rax
addsd 0xd680(%rax), %xmm0
subsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x140(%rbp)
movq 0x5c944(%rip), %rax     # 0x86f60
cmpl $0x1, 0x1690(%rax)
jne 0x2a637
movsd 0x4e81b(%rip), %xmm0    # 0x78e48
movsd %xmm0, -0x148(%rbp)
jmp 0x2a689
movq 0x5c922(%rip), %rax     # 0x86f60
movl 0x1690(%rax), %eax
movsd 0x4e7f4(%rip), %xmm0    # 0x78e40
movsd 0x4e7bc(%rip), %xmm1    # 0x78e10
movsd %xmm1, -0x158(%rbp)
cmpl $0x3, %eax
movsd %xmm0, -0x150(%rbp)
je 0x2a679
movsd -0x158(%rbp), %xmm0
movsd %xmm0, -0x150(%rbp)
movsd -0x150(%rbp), %xmm0
movsd %xmm0, -0x148(%rbp)
movsd -0x140(%rbp), %xmm0
movsd -0x148(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x160(%rbp)
callq 0x11030
movaps %xmm0, %xmm1
movsd -0x160(%rbp), %xmm0
mulsd %xmm1, %xmm0
movq -0x20(%rbp), %rax
addq $0xd6c8, %rax           # imm = 0xD6C8
movslq -0x24(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x10(%rax)
movq -0x18(%rbp), %rax
testb $0x1, 0x290(%rax)
je 0x2a7ef
movq -0x18(%rbp), %rax
movsd 0x298(%rax), %xmm0
movsd %xmm0, -0x48(%rbp)
movq -0x18(%rbp), %rax
cmpl $0xa, 0x1c8(%rax)
jne 0x2a724
movq -0x20(%rbp), %rax
movsd 0x610(%rax), %xmm0
movq -0x20(%rbp), %rax
addsd 0xd688(%rax), %xmm0
subsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x168(%rbp)
movq 0x5c828(%rip), %rax     # 0x86f60
cmpl $0x1, 0x1690(%rax)
jne 0x2a753
movsd 0x4e6ff(%rip), %xmm0    # 0x78e48
movsd %xmm0, -0x170(%rbp)
jmp 0x2a7a5
movq 0x5c806(%rip), %rax     # 0x86f60
movl 0x1690(%rax), %eax
movsd 0x4e6d8(%rip), %xmm0    # 0x78e40
movsd 0x4e6a0(%rip), %xmm1    # 0x78e10
movsd %xmm1, -0x180(%rbp)
cmpl $0x3, %eax
movsd %xmm0, -0x178(%rbp)
je 0x2a795
movsd -0x180(%rbp), %xmm0
movsd %xmm0, -0x178(%rbp)
movsd -0x178(%rbp), %xmm0
movsd %xmm0, -0x170(%rbp)
movsd -0x168(%rbp), %xmm0
movsd -0x170(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x188(%rbp)
callq 0x11030
movaps %xmm0, %xmm1
movsd -0x188(%rbp), %xmm0
mulsd %xmm1, %xmm0
movq -0x20(%rbp), %rax
addq $0xd6c8, %rax           # imm = 0xD6C8
movslq -0x24(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x18(%rax)
movq -0x18(%rbp), %rax
testb $0x1, (%rax)
je 0x2a86d
movq -0x18(%rbp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x50(%rbp)
movq -0x18(%rbp), %rax
cmpl $0xa, 0x1c8(%rax)
jne 0x2a832
movq -0x20(%rbp), %rax
movsd 0x8(%rax), %xmm0
movq -0x20(%rbp), %rax
addsd 0xd690(%rax), %xmm0
subsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x190(%rbp)
callq 0x11920
movaps %xmm0, %xmm1
movsd -0x190(%rbp), %xmm0
mulsd %xmm1, %xmm0
movq -0x20(%rbp), %rax
addq $0xd6c8, %rax           # imm = 0xD6C8
movslq -0x24(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x20(%rax)
movq -0x18(%rbp), %rax
testb $0x1, 0x10(%rax)
je 0x2a8ec
movq -0x18(%rbp), %rax
movsd 0x18(%rax), %xmm0
movsd %xmm0, -0x58(%rbp)
movq -0x18(%rbp), %rax
cmpl $0xa, 0x1c8(%rax)
jne 0x2a8b1
movq -0x20(%rbp), %rax
movsd 0x20(%rax), %xmm0
movq -0x20(%rbp), %rax
addsd 0xd698(%rax), %xmm0
subsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
movsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x198(%rbp)
callq 0x11920
movaps %xmm0, %xmm1
movsd -0x198(%rbp), %xmm0
mulsd %xmm1, %xmm0
movq -0x20(%rbp), %rax
addq $0xd6c8, %rax           # imm = 0xD6C8
movslq -0x24(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x28(%rax)
movq -0x18(%rbp), %rax
testb $0x1, 0x20(%rax)
je 0x2a96b
movq -0x18(%rbp), %rax
movsd 0x28(%rax), %xmm0
movsd %xmm0, -0x60(%rbp)
movq -0x18(%rbp), %rax
cmpl $0xa, 0x1c8(%rax)
jne 0x2a930
movq -0x20(%rbp), %rax
movsd 0x38(%rax), %xmm0
movq -0x20(%rbp), %rax
addsd 0xd6a0(%rax), %xmm0
subsd -0x60(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
movsd -0x60(%rbp), %xmm0
movsd %xmm0, -0x1a0(%rbp)
callq 0x11920
movaps %xmm0, %xmm1
movsd -0x1a0(%rbp), %xmm0
mulsd %xmm1, %xmm0
movq -0x20(%rbp), %rax
addq $0xd6c8, %rax           # imm = 0xD6C8
movslq -0x24(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x30(%rax)
movq -0x18(%rbp), %rax
testb $0x1, 0x244(%rax)
je 0x2aa84
movq -0x18(%rbp), %rax
movsd 0x248(%rax), %xmm0
movsd %xmm0, -0x68(%rbp)
movq -0x18(%rbp), %rax
cmpl $0xa, 0x1c8(%rax)
jne 0x2a9b9
movq -0x20(%rbp), %rax
movsd 0x50(%rax), %xmm0
movq -0x20(%rbp), %rax
addsd 0xd6a8(%rax), %xmm0
subsd -0x68(%rbp), %xmm0
movsd %xmm0, -0x68(%rbp)
movsd -0x68(%rbp), %xmm0
movsd %xmm0, -0x1a8(%rbp)
movq 0x5c593(%rip), %rax     # 0x86f60
cmpl $0x1, 0x1690(%rax)
jne 0x2a9e8
movsd 0x4e46a(%rip), %xmm0    # 0x78e48
movsd %xmm0, -0x1b0(%rbp)
jmp 0x2aa3a
movq 0x5c571(%rip), %rax     # 0x86f60
movl 0x1690(%rax), %eax
movsd 0x4e443(%rip), %xmm0    # 0x78e40
movsd 0x4e40b(%rip), %xmm1    # 0x78e10
movsd %xmm1, -0x1c0(%rbp)
cmpl $0x3, %eax
movsd %xmm0, -0x1b8(%rbp)
je 0x2aa2a
movsd -0x1c0(%rbp), %xmm0
movsd %xmm0, -0x1b8(%rbp)
movsd -0x1b8(%rbp), %xmm0
movsd %xmm0, -0x1b0(%rbp)
movsd -0x1a8(%rbp), %xmm0
movsd -0x1b0(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x1c8(%rbp)
callq 0x11030
movaps %xmm0, %xmm1
movsd -0x1c8(%rbp), %xmm0
mulsd %xmm1, %xmm0
movq -0x20(%rbp), %rax
addq $0xd6c8, %rax           # imm = 0xD6C8
movslq -0x24(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x38(%rax)
movq -0x18(%rbp), %rax
testb $0x1, 0x250(%rax)
je 0x2ab9d
movq -0x18(%rbp), %rax
movsd 0x258(%rax), %xmm0
movsd %xmm0, -0x70(%rbp)
movq -0x18(%rbp), %rax
cmpl $0xa, 0x1c8(%rax)
jne 0x2aad2
movq -0x20(%rbp), %rax
movsd 0x68(%rax), %xmm0
movq -0x20(%rbp), %rax
addsd 0xd6b0(%rax), %xmm0
subsd -0x70(%rbp), %xmm0
movsd %xmm0, -0x70(%rbp)
movsd -0x70(%rbp), %xmm0
movsd %xmm0, -0x1d0(%rbp)
movq 0x5c47a(%rip), %rax     # 0x86f60
cmpl $0x1, 0x1690(%rax)
jne 0x2ab01
movsd 0x4e351(%rip), %xmm0    # 0x78e48
movsd %xmm0, -0x1d8(%rbp)
jmp 0x2ab53
movq 0x5c458(%rip), %rax     # 0x86f60
movl 0x1690(%rax), %eax
movsd 0x4e32a(%rip), %xmm0    # 0x78e40
movsd 0x4e2f2(%rip), %xmm1    # 0x78e10
movsd %xmm1, -0x1e8(%rbp)
cmpl $0x3, %eax
movsd %xmm0, -0x1e0(%rbp)
je 0x2ab43
movsd -0x1e8(%rbp), %xmm0
movsd %xmm0, -0x1e0(%rbp)
movsd -0x1e0(%rbp), %xmm0
movsd %xmm0, -0x1d8(%rbp)
movsd -0x1d0(%rbp), %xmm0
movsd -0x1d8(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x1f0(%rbp)
callq 0x11030
movaps %xmm0, %xmm1
movsd -0x1f0(%rbp), %xmm0
mulsd %xmm1, %xmm0
movq -0x20(%rbp), %rax
addq $0xd6c8, %rax           # imm = 0xD6C8
movslq -0x24(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x40(%rax)
movq -0x18(%rbp), %rax
testb $0x1, 0x260(%rax)
je 0x2acb9
movq -0x18(%rbp), %rax
movsd 0x268(%rax), %xmm0
movsd %xmm0, -0x78(%rbp)
movq -0x18(%rbp), %rax
cmpl $0xa, 0x1c8(%rax)
jne 0x2abee
movq -0x20(%rbp), %rax
movsd 0x80(%rax), %xmm0
movq -0x20(%rbp), %rax
addsd 0xd6b8(%rax), %xmm0
subsd -0x78(%rbp), %xmm0
movsd %xmm0, -0x78(%rbp)
movsd -0x78(%rbp), %xmm0
movsd %xmm0, -0x1f8(%rbp)
movq 0x5c35e(%rip), %rax     # 0x86f60
cmpl $0x1, 0x1690(%rax)
jne 0x2ac1d
movsd 0x4e235(%rip), %xmm0    # 0x78e48
movsd %xmm0, -0x200(%rbp)
jmp 0x2ac6f
movq 0x5c33c(%rip), %rax     # 0x86f60
movl 0x1690(%rax), %eax
movsd 0x4e20e(%rip), %xmm0    # 0x78e40
movsd 0x4e1d6(%rip), %xmm1    # 0x78e10
movsd %xmm1, -0x210(%rbp)
cmpl $0x3, %eax
movsd %xmm0, -0x208(%rbp)
je 0x2ac5f
movsd -0x210(%rbp), %xmm0
movsd %xmm0, -0x208(%rbp)
movsd -0x208(%rbp), %xmm0
movsd %xmm0, -0x200(%rbp)
movsd -0x1f8(%rbp), %xmm0
movsd -0x200(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x218(%rbp)
callq 0x11030
movaps %xmm0, %xmm1
movsd -0x218(%rbp), %xmm0
mulsd %xmm1, %xmm0
movq -0x20(%rbp), %rax
addq $0xd6c8, %rax           # imm = 0xD6C8
movslq -0x24(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x48(%rax)
movq -0x18(%rbp), %rax
testb $0x1, 0x229(%rax)
je 0x2ada8
movq -0x18(%rbp), %rax
movsd 0x230(%rax), %xmm0
movsd %xmm0, -0x220(%rbp)
movq 0x5c27b(%rip), %rax     # 0x86f60
cmpl $0x1, 0x1690(%rax)
jne 0x2ad00
movsd 0x4e152(%rip), %xmm0    # 0x78e48
movsd %xmm0, -0x228(%rbp)
jmp 0x2ad52
movq 0x5c259(%rip), %rax     # 0x86f60
movl 0x1690(%rax), %eax
movsd 0x4e12b(%rip), %xmm0    # 0x78e40
movsd 0x4e0f3(%rip), %xmm1    # 0x78e10
movsd %xmm1, -0x238(%rbp)
cmpl $0x3, %eax
movsd %xmm0, -0x230(%rbp)
je 0x2ad42
movsd -0x238(%rbp), %xmm0
movsd %xmm0, -0x230(%rbp)
movsd -0x230(%rbp), %xmm0
movsd %xmm0, -0x228(%rbp)
movsd -0x220(%rbp), %xmm0
movsd -0x228(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x240(%rbp)
callq 0x11030
movaps %xmm0, %xmm1
movsd -0x240(%rbp), %xmm0
mulsd %xmm1, %xmm0
movsd 0x4c27e(%rip), %xmm1    # 0x77008
mulsd %xmm1, %xmm0
movq -0x20(%rbp), %rax
addq $0xd6c8, %rax           # imm = 0xD6C8
movslq -0x24(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x50(%rax)
movq -0x18(%rbp), %rax
testb $0x1, 0x198(%rax)
je 0x2addb
movq -0x18(%rbp), %rax
movsd 0x1a0(%rax), %xmm0
movq -0x20(%rbp), %rax
addq $0xd6c8, %rax           # imm = 0xD6C8
movslq -0x24(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x58(%rax)
movq -0x18(%rbp), %rax
testb $0x1, 0x1a8(%rax)
je 0x2ae0e
movq -0x18(%rbp), %rax
movsd 0x1b0(%rax), %xmm0
movq -0x20(%rbp), %rax
addq $0xd6c8, %rax           # imm = 0xD6C8
movslq -0x24(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x60(%rax)
movq -0x18(%rbp), %rax
movsd 0x220(%rax), %xmm0
movsd 0x4da3e(%rip), %xmm1    # 0x78860
ucomisd %xmm1, %xmm0
jne 0x2ae2f
jp 0x2ae2f
jmp 0x2b01a
jmp 0x2ae31
movq -0x18(%rbp), %rax
movsd 0x220(%rax), %xmm0
leaq -0x2c(%rbp), %rdi
callq 0x21020
cmpl $0x0, %eax
jne 0x2af1f
jmp 0x2ae51
movq -0x110(%rbp), %rdi
leaq 0x4fe5e(%rip), %rsi     # 0x7acbd
movb $0x0, %al
callq 0x10df0
movq 0x5c0f3(%rip), %rax     # 0x86f60
movl $0x0, 0xd670(%rax)
movq 0x5c0e2(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rax
movq 0x5c0d4(%rip), %rdi     # 0x86f60
addq $0xc6d0, %rdi           # imm = 0xC6D0
imulq $0x50, %rax, %rax
addq %rax, %rdi
leaq 0x4fddf(%rip), %rsi     # 0x7ac80
movl $0x50, %edx
callq 0x10840
movq 0x5c0ae(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x5c0a0(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x4f(%rax)
movq 0x5c088(%rip), %rax     # 0x86f60
movl 0xd670(%rax), %ecx
addl $0x1, %ecx
movq 0x5c078(%rip), %rax     # 0x86f60
movl %ecx, 0xd670(%rax)
movq 0x5c06b(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x5c05d(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, (%rax)
movl $0x5, -0x4(%rbp)
jmp 0x2b3e4
jmp 0x2af21
jmp 0x2af23
cmpl $0x9, -0x2c(%rbp)
jle 0x2affd
jmp 0x2af2f
movq -0x110(%rbp), %rdi
leaq 0x4fda2(%rip), %rsi     # 0x7acdf
movb $0x0, %al
callq 0x10df0
movq 0x5c015(%rip), %rax     # 0x86f60
movl $0x0, 0xd670(%rax)
movq 0x5c004(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rax
movq 0x5bff6(%rip), %rdi     # 0x86f60
addq $0xc6d0, %rdi           # imm = 0xC6D0
imulq $0x50, %rax, %rax
addq %rax, %rdi
leaq 0x4fd01(%rip), %rsi     # 0x7ac80
movl $0x50, %edx
callq 0x10840
movq 0x5bfd0(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x5bfc2(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x4f(%rax)
movq 0x5bfaa(%rip), %rax     # 0x86f60
movl 0xd670(%rax), %ecx
addl $0x1, %ecx
movq 0x5bf9a(%rip), %rax     # 0x86f60
movl %ecx, 0xd670(%rax)
movq 0x5bf8d(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x5bf7f(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, (%rax)
movl $0x5, -0x4(%rbp)
jmp 0x2b3e4
jmp 0x2afff
movl -0x2c(%rbp), %ecx
movq -0x20(%rbp), %rax
addq $0xd6c8, %rax           # imm = 0xD6C8
movslq -0x24(%rbp), %rdx
imulq $0x70, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x68(%rax)
movl -0x24(%rbp), %eax
movl %eax, -0x248(%rbp)
movq -0x20(%rbp), %rax
addq $0xd6c8, %rax           # imm = 0xD6C8
movslq -0x24(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0x244(%rbp)
movq -0x20(%rbp), %rsi
addq $0xd6c8, %rsi           # imm = 0xD6C8
movslq -0x24(%rbp), %rax
imulq $0x70, %rax, %rax
addq %rax, %rsi
addq $0x8, %rsi
leaq -0xc0(%rbp), %rdi
movl $0x48, %edx
callq 0x10e60
movl -0x248(%rbp), %edi
movl -0x244(%rbp), %esi
movq -0x20(%rbp), %rax
addq $0xd6c8, %rax           # imm = 0xD6C8
movslq -0x24(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movsd 0x50(%rax), %xmm0
movq -0x20(%rbp), %rax
addq $0xd6c8, %rax           # imm = 0xD6C8
movslq -0x24(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movsd 0x58(%rax), %xmm1
movq -0x20(%rbp), %rax
addq $0xd6c8, %rax           # imm = 0xD6C8
movslq -0x24(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movsd 0x60(%rax), %xmm2
movq -0x20(%rbp), %rax
addq $0xd6c8, %rax           # imm = 0xD6C8
movslq -0x24(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movl 0x68(%rax), %edx
movq -0x80(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x40(%rax)
movups -0xc0(%rbp), %xmm3
movups -0xb0(%rbp), %xmm4
movups -0xa0(%rbp), %xmm5
movups -0x90(%rbp), %xmm6
movups %xmm6, 0x30(%rax)
movups %xmm5, 0x20(%rax)
movups %xmm4, 0x10(%rax)
movups %xmm3, (%rax)
callq 0x12190
movq -0x20(%rbp), %rax
movl 0x5fc(%rax), %eax
cmpl -0x24(%rbp), %eax
jne 0x2b152
movq -0x20(%rbp), %rsi
addq $0xd6c8, %rsi           # imm = 0xD6C8
movslq -0x24(%rbp), %rax
imulq $0x70, %rax, %rax
addq %rax, %rsi
movq -0x20(%rbp), %rdi
addq $0xd6c8, %rdi           # imm = 0xD6C8
movl $0x70, %edx
callq 0x10e60
movq -0x20(%rbp), %rax
cmpl $0x0, 0xd6c8(%rax)
jge 0x2b170
movq -0x20(%rbp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0xc080(%rax)
jmp 0x2b188
movq -0x20(%rbp), %rax
cvtsi2sdl 0xd6c8(%rax), %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, 0xc080(%rax)
movq -0x20(%rbp), %rax
movsd 0xd6d0(%rax), %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, 0xc088(%rax)
movq -0x20(%rbp), %rax
movsd 0xd6d8(%rax), %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, 0xc090(%rax)
movq -0x20(%rbp), %rax
movsd 0xd6e0(%rax), %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, 0xc098(%rax)
movq -0x20(%rbp), %rax
movsd 0xd6e8(%rax), %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, 0xc0a0(%rax)
movq -0x20(%rbp), %rax
movsd 0xd6f0(%rax), %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, 0xc0a8(%rax)
movq -0x20(%rbp), %rax
movsd 0xd6f8(%rax), %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, 0xc0b0(%rax)
movq -0x20(%rbp), %rax
movsd 0xd700(%rax), %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, 0xc0b8(%rax)
movq -0x20(%rbp), %rax
movsd 0xd708(%rax), %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, 0xc0c0(%rax)
movq -0x20(%rbp), %rax
movsd 0xd710(%rax), %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, 0xc0c8(%rax)
movq -0x20(%rbp), %rax
movsd 0xd718(%rax), %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, 0xc0d0(%rax)
movq -0x20(%rbp), %rax
movsd 0xd720(%rax), %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, 0xc0d8(%rax)
movq -0x20(%rbp), %rax
movsd 0xd728(%rax), %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, 0xc0e0(%rax)
movq -0x20(%rbp), %rax
cvtsi2sdl 0xd730(%rax), %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, 0xc0e8(%rax)
movq 0x5bc99(%rip), %rax     # 0x86f60
cmpl $0x0, 0xc6ac(%rax)
jne 0x2b3dd
movl -0x28(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x5fc(%rcx), %eax
jne 0x2b3dd
movq -0x20(%rbp), %rax
addq $0xd6c8, %rax           # imm = 0xD6C8
movslq -0x24(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0x24c(%rbp)
movq -0x20(%rbp), %rsi
addq $0xd6c8, %rsi           # imm = 0xD6C8
movslq -0x24(%rbp), %rax
imulq $0x70, %rax, %rax
addq %rax, %rsi
addq $0x8, %rsi
leaq -0x108(%rbp), %rdi
movl $0x48, %edx
callq 0x10e60
movl -0x24c(%rbp), %esi
movq -0x20(%rbp), %rax
addq $0xd6c8, %rax           # imm = 0xD6C8
movslq -0x24(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movsd 0x50(%rax), %xmm0
movq -0x20(%rbp), %rax
addq $0xd6c8, %rax           # imm = 0xD6C8
movslq -0x24(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movsd 0x58(%rax), %xmm1
movq -0x20(%rbp), %rax
addq $0xd6c8, %rax           # imm = 0xD6C8
movslq -0x24(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movsd 0x60(%rax), %xmm2
movq -0x20(%rbp), %rax
addq $0xd6c8, %rax           # imm = 0xD6C8
movslq -0x24(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movl 0x68(%rax), %edx
xorl %eax, %eax
movq -0xc8(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x40(%rax)
movups -0x108(%rbp), %xmm3
movups -0xf8(%rbp), %xmm4
movups -0xe8(%rbp), %xmm5
movups -0xd8(%rbp), %xmm6
movups %xmm6, 0x30(%rax)
movups %xmm5, 0x20(%rax)
movups %xmm4, 0x10(%rax)
movups %xmm3, (%rax)
xorl %edi, %edi
callq 0x12190
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x2a0, %rsp            # imm = 0x2A0
popq %rbp
retq