// File: /workspace/github_cpp_makefile_star2_O3/sundale[P]gcode/rs274ngc/interp_find.cc
// Function: Interp::find_ends(block_struct*, setup_struct*, double*, double*, double*, double*, double*, double*, double*, double*, double*)
int Interp::find_ends(block_pointer block,       //!< pointer to a block of RS274/NGC instructions
                      setup_pointer s,    //!< pointer to machine settings                 
                      double *px,        //!< pointer to end_x                            
                      double *py,        //!< pointer to end_y                            
                      double *pz,        //!< pointer to end_z                            
                      double *AA_p,      //!< pointer to end_a                      
                      double *BB_p,      //!< pointer to end_b                      
                      double *CC_p,      //!< pointer to end_c                      
                      double *u_p, double *v_p, double *w_p)
{
    int middle;
    int comp;

    middle = s->cutter_comp_firstmove == OFF;
    comp = (s->cutter_comp_side != OFF);

    if (block->g_modes[0] == G_53) {      /* distance mode is absolute in this case */
#ifdef DEBUG_EMC
        COMMENT("interpreter: offsets temporarily suspended");
#endif
        CHKS((block->radius_flag || block->theta_flag), _("Cannot use polar coordinates with G53"));

        double cx = s->current_x;
        double cy = s->current_y;
        rotate(&cx, &cy, s->rotation_xy);

        if(block->x_flag == ON) {
            *px = block->x_number - s->origin_offset_x - s->axis_offset_x - s->tool_offset.tran.x;
        } else {
            *px = cx;
        }

        if(block->y_flag == ON) {
            *py = block->y_number - s->origin_offset_y - s->axis_offset_y - s->tool_offset.tran.y;
        } else {
            *py = cy;
        }

        rotate(px, py, -s->rotation_xy);

        if(block->z_flag == ON) {
            *pz = block->z_number - s->origin_offset_z - s->axis_offset_z - s->tool_offset.tran.z;
        } else {
            *pz = s->current_z;
        }

        if(block->a_flag == ON) {
            if(s->a_axis_wrapped) {
                CHP(unwrap_rotary(AA_p, block->a_number, 
                                  block->a_number - s->AA_origin_offset - s->AA_axis_offset - s->tool_offset.a,
                                  s->AA_current, 'A'));
            } else {
                *AA_p = block->a_number - s->AA_origin_offset - s->AA_axis_offset;
            }
        } else {
            *AA_p = s->AA_current;
        }

        if(block->b_flag == ON) {
            if(s->b_axis_wrapped) {
                CHP(unwrap_rotary(BB_p, block->b_number, 
                                  block->b_number - s->BB_origin_offset - s->BB_axis_offset - s->tool_offset.b,
                                  s->BB_current, 'B'));
            } else {
                *BB_p = block->b_number - s->BB_origin_offset - s->BB_axis_offset;
            }
        } else {
            *BB_p = s->BB_current;
        }

        if(block->c_flag == ON) {
            if(s->c_axis_wrapped) {
                CHP(unwrap_rotary(CC_p, block->c_number, 
                                  block->c_number - s->CC_origin_offset - s->CC_axis_offset - s->tool_offset.c,
                                  s->CC_current, 'C'));
            } else {
                *CC_p = block->c_number - s->CC_origin_offset - s->CC_axis_offset;
            }
        } else {
            *CC_p = s->CC_current;
        }

        if(block->u_flag == ON) {
            *u_p = block->u_number - s->u_origin_offset - s->u_axis_offset - s->tool_offset.u;
        } else {
            *u_p = s->u_current;
        }

        if(block->v_flag == ON) {
            *v_p = block->v_number - s->v_origin_offset - s->v_axis_offset - s->tool_offset.v;
        } else {
            *v_p = s->v_current;
        }

        if(block->w_flag == ON) {
            *w_p = block->w_number - s->w_origin_offset - s->w_axis_offset - s->tool_offset.w;
        } else {
            *w_p = s->w_current;
        }
    } else if (s->distance_mode == MODE_ABSOLUTE) {

        if(block->x_flag == ON) {
            *px = block->x_number;
        } else {
            // both cutter comp planes affect X ...
            *px = (comp && middle) ? s->program_x : s->current_x;
        }

        if(block->y_flag == ON) {
            *py = block->y_number;
        } else {
            // but only XY affects Y ...
            *py = (comp && middle && s->plane == CANON_PLANE_XY) ? s->program_y : s->current_y;
        }

        if(block->radius_flag == ON && block->theta_flag == ON) {
            CHKS((block->x_flag == ON || block->y_flag == ON), _("Cannot specify X or Y words with polar coordinate"));
            *px = block->radius * cos(D2R(block->theta));
            *py = block->radius * sin(D2R(block->theta));
        } else if(block->radius_flag == ON) {
            double theta;
            CHKS((block->x_flag == ON || block->y_flag == ON), _("Cannot specify X or Y words with polar coordinate"));
            CHKS((*py == 0 && *px == 0), _("Must specify angle in polar coordinate if at the origin"));
            theta = atan2(*py, *px);
            *px = block->radius * cos(theta);
            *py = block->radius * sin(theta);
        } else  if(block->theta_flag == ON) {
            double radius;
            CHKS((block->x_flag == ON || block->y_flag == ON), _("Cannot specify X or Y words with polar coordinate"));
            radius = hypot(*py, *px);
            *px = radius * cos(D2R(block->theta));
            *py = radius * sin(D2R(block->theta));
        }

        if(block->z_flag == ON) {
            *pz = block->z_number;
        } else {
            // and only XZ affects Z.
            *pz = (comp && middle && s->plane == CANON_PLANE_XZ) ? s->program_z : s->current_z;
        }

        if(block->a_flag == ON) {
            if(s->a_axis_wrapped) {
                CHP(unwrap_rotary(AA_p, block->a_number, block->a_number, s->AA_current, 'A'));
            } else {
                *AA_p = block->a_number;
            }
        } else {
            *AA_p = s->AA_current;
        }

        if(block->b_flag == ON) {
            if(s->b_axis_wrapped) {
                CHP(unwrap_rotary(BB_p, block->b_number, block->b_number, s->BB_current, 'B'));
            } else {
                *BB_p = block->b_number;
            }
        } else {
            *BB_p = s->BB_current;
        }

        if(block->c_flag == ON) {
            if(s->c_axis_wrapped) {
                CHP(unwrap_rotary(CC_p, block->c_number, block->c_number, s->CC_current, 'C'));
            } else {
                *CC_p = block->c_number;
            }
        } else {
            *CC_p = s->CC_current;
        }

        *u_p = (block->u_flag == ON) ? block->u_number : s->u_current;
        *v_p = (block->v_flag == ON) ? block->v_number : s->v_current;
        *w_p = (block->w_flag == ON) ? block->w_number : s->w_current;

    } else {                      /* mode is MODE_INCREMENTAL */

        // both cutter comp planes affect X ...
        *px = (comp && middle) ? s->program_x: s->current_x;
        if(block->x_flag == ON) *px += block->x_number;

        // but only XY affects Y ...
        *py = (comp && middle && s->plane == CANON_PLANE_XY) ? s->program_y: s->current_y;
        if(block->y_flag == ON) *py += block->y_number;

        if(block->radius_flag == ON) {
            double radius, theta;
            CHKS((block->x_flag == ON || block->y_flag == ON), _("Cannot specify X or Y words with polar coordinate"));
            CHKS((*py == 0 && *px == 0), _("Incremental motion with polar coordinates is indeterminate when at the origin"));
            theta = atan2(*py, *px);
            radius = hypot(*py, *px) + block->radius;
            *px = radius * cos(theta);
            *py = radius * sin(theta);
        }

        if(block->theta_flag == ON) {
            double radius, theta;
            CHKS((block->x_flag == ON || block->y_flag == ON), _("Cannot specify X or Y words with polar coordinate"));
            CHKS((*py == 0 && *px == 0), _("G91 motion with polar coordinates is indeterminate when at the origin"));
            theta = atan2(*py, *px) + D2R(block->theta);
            radius = hypot(*py, *px);
            *px = radius * cos(theta);
            *py = radius * sin(theta);
        }

        // and only XZ affects Z.
        *pz = (comp && middle && s->plane == CANON_PLANE_XZ) ? s->program_z: s->current_z;
        if(block->z_flag == ON) *pz += block->z_number;

        *AA_p = s->AA_current;
        if(block->a_flag == ON) *AA_p += block->a_number;

        *BB_p = s->BB_current;
        if(block->b_flag == ON) *BB_p += block->b_number;

        *CC_p = s->CC_current;
        if(block->c_flag == ON) *CC_p += block->c_number;

        *u_p = s->u_current;
        if(block->u_flag == ON) *u_p += block->u_number;

        *v_p = s->v_current;
        if(block->v_flag == ON) *v_p += block->v_number;

        *w_p = s->w_current;
        if(block->w_flag == ON) *w_p += block->w_number;
    }
    return INTERP_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r8, %r15
movq %rcx, %r13
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r12
movq 0x38(%rbp), %rsi
movq 0x30(%rbp), %rdi
movq 0x28(%rbp), %r8
movq 0x20(%rbp), %rdx
movq 0x18(%rbp), %r10
movq 0x10(%rbp), %r11
cmpl $0x212, 0x150(%r14) # imm = 0x212
jne 0x244d9
cmpl $0x0, 0x2a0(%r14)
jne 0x244c5
cmpl $0x0, 0x2b0(%r14)
je 0x2463e
leaq 0x1336c(%rip), %rdi     # 0x37838
callq 0xa1f0
movq %r12, %rdi
jmp 0x24a05
movq %r9, -0x48(%rbp)
movq %r12, -0x30(%rbp)
movb 0xc689(%rbx), %al
movl 0x624(%rbx), %ecx
cmpl $0x0, 0x668(%rbx)
je 0x245cb
testl %ecx, %ecx
setne %cl
testb %al, %al
sete %r12b
andb %cl, %r12b
leaq 0x600(%rbx), %rax
leaq 0xc690(%rbx), %rcx
testb %r12b, %r12b
cmovneq %rcx, %rax
movsd (%rax), %xmm0
movsd %xmm0, (%r13)
movb 0x270(%r14), %al
cmpb $0x1, %al
jne 0x24541
addsd 0x278(%r14), %xmm0
movsd %xmm0, (%r13)
testb %r12b, %r12b
je 0x24554
movl $0xc698, %ecx           # imm = 0xC698
cmpl $0x1, 0xc67c(%rbx)
je 0x24559
movl $0x608, %ecx            # imm = 0x608
movsd (%rbx,%rcx), %xmm0
movsd %xmm0, (%r15)
movb 0x280(%r14), %cl
cmpb $0x1, %cl
jne 0x2457d
addsd 0x288(%r14), %xmm0
movsd %xmm0, (%r15)
cmpl $0x1, 0x2a0(%r14)
jne 0x249cf
orb %cl, %al
cmpb $0x1, %al
je 0x249f5
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm0
movsd (%r13), %xmm1
jne 0x24966
jp 0x24966
ucomisd %xmm2, %xmm1
jne 0x24966
jp 0x24966
leaq 0x12b37(%rip), %rdi     # 0x370fd
jmp 0x249fc
movq %rdx, %r9
testl %ecx, %ecx
setne %cl
testb %al, %al
sete %r12b
movb 0x270(%r14), %al
andb %cl, %r12b
leaq 0x600(%rbx), %rcx
leaq 0xc690(%rbx), %rdx
testb %r12b, %r12b
cmovneq %rdx, %rcx
leaq 0x278(%r14), %rdx
testb %al, %al
cmoveq %rcx, %rdx
movsd (%rdx), %xmm0
movsd %xmm0, (%r13)
movb 0x280(%r14), %cl
cmpb $0x1, %cl
jne 0x24627
leaq 0x288(%r14), %rdx
jmp 0x246ad
testb %r12b, %r12b
je 0x246a6
cmpl $0x1, 0xc67c(%rbx)
jne 0x246a6
leaq 0xc698(%rbx), %rdx
jmp 0x246ad
movq %r9, -0x48(%rbp)
movq %r12, %rdi
movsd 0x600(%rbx), %xmm0
leaq -0x58(%rbp), %rsi
movsd %xmm0, (%rsi)
movsd 0x608(%rbx), %xmm0
leaq -0x50(%rbp), %rdx
movsd %xmm0, (%rdx)
movsd 0x17b8(%rbx), %xmm0
callq 0xb1a0
cmpb $0x1, 0x270(%r14)
jne 0x24a59
movsd 0x278(%r14), %xmm0
subsd 0x17a0(%rbx), %xmm0
subsd 0x118(%rbx), %xmm0
subsd 0xd678(%rbx), %xmm0
jmp 0x24a5e
leaq 0x608(%rbx), %rdx
movsd (%rdx), %xmm0
movsd %xmm0, (%r15)
movl 0x2b0(%r14), %edx
cmpl $0x1, 0x2a0(%r14)
jne 0x24729
orb %cl, %al
cmpl $0x1, %edx
jne 0x247df
testb %al, %al
jne 0x249f5
movsd 0x2a8(%r14), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd 0x2b8(%r14), %xmm0
mulsd 0xf7df(%rip), %xmm0     # 0x33ed8
divsd 0xf7df(%rip), %xmm0     # 0x33ee0
callq 0xb550
mulsd -0x38(%rbp), %xmm0
movsd %xmm0, (%r13)
movsd 0xf7bf(%rip), %xmm0     # 0x33ed8
movsd 0x2a8(%r14), %xmm1
movsd %xmm1, -0x38(%rbp)
jmp 0x2477d
cmpl $0x1, %edx
jne 0x247b5
orb %cl, %al
cmpb $0x1, %al
je 0x249f5
movsd (%r13), %xmm1
callq 0xa290
movsd %xmm0, -0x38(%rbp)
movsd 0x2b8(%r14), %xmm0
mulsd 0xf77b(%rip), %xmm0     # 0x33ed8
divsd 0xf77b(%rip), %xmm0     # 0x33ee0
callq 0xb550
mulsd -0x38(%rbp), %xmm0
movsd %xmm0, (%r13)
movsd 0xf75b(%rip), %xmm0     # 0x33ed8
mulsd 0x2b8(%r14), %xmm0
divsd 0xf752(%rip), %xmm0     # 0x33ee0
callq 0xa1d0
mulsd -0x38(%rbp), %xmm0
movsd %xmm0, (%r15)
movq 0x38(%rbp), %rsi
movq 0x30(%rbp), %rdi
movq 0x28(%rbp), %r8
movq 0x20(%rbp), %r9
movq 0x18(%rbp), %r10
movq 0x10(%rbp), %r11
cmpb $0x1, 0x290(%r14)
jne 0x247c8
leaq 0x298(%r14), %rax
jmp 0x24824
testb %r12b, %r12b
je 0x2481d
cmpl $0x3, 0xc67c(%rbx)
jne 0x2481d
leaq 0xc6a0(%rbx), %rax
jmp 0x24824
testb %al, %al
jne 0x249f5
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm0
movsd (%r13), %xmm1
jne 0x24f72
jp 0x24f72
ucomisd %xmm2, %xmm1
jne 0x24f72
jp 0x24f72
leaq 0x13106(%rip), %rdi     # 0x3791e
jmp 0x249fc
leaq 0x610(%rbx), %rax
movq -0x30(%rbp), %rcx
movsd (%rax), %xmm0
movq -0x48(%rbp), %rax
movsd %xmm0, (%rax)
cmpb $0x1, (%r14)
jne 0x2488a
cmpl $0x0, 0x1e6cc(%rbx)
movsd 0x8(%r14), %xmm0
je 0x2488f
movsd 0x8(%rbx), %xmm2
movq %rcx, %rdi
movq %r11, %rsi
movapd %xmm0, %xmm1
movq %r9, %r12
movl $0x41, %edx
movq %r8, %r13
movq %r10, %r15
callq 0xac90
movq %r15, %r10
movq %r12, %r9
movq -0x30(%rbp), %rcx
movq %r13, %r8
movq 0x30(%rbp), %rdi
movq 0x38(%rbp), %rsi
testl %eax, %eax
jne 0x2493e
jmp 0x24894
movsd 0x8(%rbx), %xmm0
movsd %xmm0, (%r11)
cmpb $0x1, 0x10(%r14)
jne 0x248e3
cmpl $0x0, 0x1e6d0(%rbx)
movsd 0x18(%r14), %xmm0
je 0x248e8
movsd 0x20(%rbx), %xmm2
movq %rcx, %rdi
movq %rsi, %r15
movq %r10, %rsi
movapd %xmm0, %xmm1
movq %r9, %r12
movl $0x42, %edx
movq %r8, %r13
callq 0xac90
movq %r12, %r9
movq -0x30(%rbp), %rcx
movq %r13, %r8
movq 0x30(%rbp), %rdi
movq %r15, %rsi
testl %eax, %eax
jne 0x2493e
jmp 0x248ed
movsd 0x20(%rbx), %xmm0
movsd %xmm0, (%r10)
cmpb $0x1, 0x20(%r14)
jne 0x24bd7
cmpl $0x0, 0x1e6d4(%rbx)
movsd 0x28(%r14), %xmm0
je 0x24bdc
movsd 0x38(%rbx), %xmm2
movq %rdi, %r12
movq %rcx, %rdi
movq %rsi, %r15
movq %r9, %rsi
movapd %xmm0, %xmm1
movl $0x43, %edx
movq %r8, %r13
callq 0xac90
movq %r13, %r8
movq %r12, %rdi
movq %r15, %rsi
testl %eax, %eax
je 0x24be1
movl %eax, %r15d
movq 0x1c618(%rip), %rbx     # 0x40f60
movslq 0xd670(%rbx), %rax
cmpq $0x30, %rax
jg 0x24a47
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
jmp 0x24cd2
callq 0xa100
movsd %xmm0, -0x38(%rbp)
movsd (%r15), %xmm0
movsd (%r13), %xmm1
callq 0xa290
addsd 0x2a8(%r14), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x38(%rbp), %xmm0
callq 0xb550
mulsd -0x40(%rbp), %xmm0
movsd %xmm0, (%r13)
movsd -0x38(%rbp), %xmm0
callq 0xa1d0
movq 0x10(%rbp), %r11
movq 0x18(%rbp), %r10
movq 0x20(%rbp), %rdx
movq 0x28(%rbp), %r8
movq 0x30(%rbp), %rdi
movq 0x38(%rbp), %rsi
mulsd -0x40(%rbp), %xmm0
movsd %xmm0, (%r15)
cmpl $0x1, 0x2b0(%r14)
jne 0x24e74
cmpb $0x0, 0x270(%r14)
jne 0x249f5
cmpb $0x1, 0x280(%r14)
jne 0x24d1a
leaq 0x12ef0(%rip), %rdi     # 0x378ec
callq 0xa1f0
movq -0x30(%rbp), %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0xa850
movq 0x1c54a(%rip), %rbx     # 0x40f60
leaq 0xc6d0(%rbx), %rdi
leaq 0x12e3a(%rip), %rsi     # 0x3785e
movl $0x50, %edx
callq 0xa8a0
movw $0x0, 0xc71f(%rbx)
movl $0x1, 0xd670(%rbx)
movl $0x5, %r15d
movl %r15d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movsd -0x58(%rbp), %xmm0
movsd %xmm0, (%r13)
cmpb $0x1, 0x280(%r14)
jne 0x24a91
movsd 0x288(%r14), %xmm0
subsd 0x17a8(%rbx), %xmm0
subsd 0x120(%rbx), %xmm0
subsd 0xd680(%rbx), %xmm0
jmp 0x24a96
movsd -0x50(%rbp), %xmm0
movsd %xmm0, (%r15)
movsd 0x17b8(%rbx), %xmm0
xorps 0xf466(%rip), %xmm0     # 0x33f10
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0xb1a0
cmpb $0x1, 0x290(%r14)
jne 0x24ae5
movsd 0x298(%r14), %xmm0
subsd 0x17b0(%rbx), %xmm0
subsd 0x128(%rbx), %xmm0
subsd 0xd688(%rbx), %xmm0
jmp 0x24aed
movsd 0x610(%rbx), %xmm0
movq 0x38(%rbp), %rcx
movq 0x30(%rbp), %rdx
movq 0x28(%rbp), %rdi
movq 0x20(%rbp), %rsi
movq 0x18(%rbp), %r8
movq 0x10(%rbp), %rax
movq -0x48(%rbp), %r9
movsd %xmm0, (%r9)
cmpb $0x1, (%r14)
jne 0x24b6b
cmpl $0x0, 0x1e6cc(%rbx)
movsd 0x8(%r14), %xmm0
movapd %xmm0, %xmm1
subsd 0x10(%rbx), %xmm1
subsd (%rbx), %xmm1
je 0x24b70
subsd 0xd690(%rbx), %xmm1
movsd 0x8(%rbx), %xmm2
movq %r12, %rdi
movq %rax, %rsi
movl $0x41, %edx
callq 0xac90
movq 0x18(%rbp), %r8
movq 0x20(%rbp), %rsi
movq 0x28(%rbp), %rdi
movq 0x30(%rbp), %rdx
movq 0x38(%rbp), %rcx
testl %eax, %eax
jne 0x24ca8
jmp 0x24b74
movsd 0x8(%rbx), %xmm1
movsd %xmm1, (%rax)
cmpb $0x1, 0x10(%r14)
jne 0x24c44
cmpl $0x0, 0x1e6d0(%rbx)
movsd 0x18(%r14), %xmm0
movapd %xmm0, %xmm1
subsd 0x28(%rbx), %xmm1
subsd 0x18(%rbx), %xmm1
je 0x24c49
subsd 0xd698(%rbx), %xmm1
movsd 0x20(%rbx), %xmm2
movq %r12, %rdi
movq %r8, %rsi
movl $0x42, %edx
callq 0xac90
movq 0x20(%rbp), %rsi
movq 0x28(%rbp), %rdi
movq 0x30(%rbp), %rdx
movq 0x38(%rbp), %rcx
testl %eax, %eax
jne 0x24ca8
jmp 0x24c4e
movsd 0x38(%rbx), %xmm0
movsd %xmm0, (%r9)
leaq 0x248(%r14), %rax
leaq 0x50(%rbx), %rcx
cmpb $0x0, 0x244(%r14)
cmovneq %rax, %rcx
movsd (%rcx), %xmm0
movsd %xmm0, (%r8)
leaq 0x258(%r14), %rax
leaq 0x68(%rbx), %rcx
cmpb $0x0, 0x250(%r14)
cmovneq %rax, %rcx
movsd (%rcx), %xmm0
movsd %xmm0, (%rdi)
leaq 0x268(%r14), %rax
subq $-0x80, %rbx
cmpb $0x0, 0x260(%r14)
cmovneq %rax, %rbx
movsd (%rbx), %xmm0
movsd %xmm0, (%rsi)
jmp 0x24def
movsd 0x20(%rbx), %xmm1
movsd %xmm1, (%r8)
cmpb $0x1, 0x20(%r14)
jne 0x24d50
cmpl $0x0, 0x1e6d4(%rbx)
movsd 0x28(%r14), %xmm0
movapd %xmm0, %xmm1
subsd 0x40(%rbx), %xmm1
subsd 0x30(%rbx), %xmm1
je 0x24d55
subsd 0xd6a0(%rbx), %xmm1
movsd 0x38(%rbx), %xmm2
movq %r12, %rdi
movl $0x43, %edx
callq 0xac90
movq 0x28(%rbp), %rdi
movq 0x30(%rbp), %rdx
movq 0x38(%rbp), %rcx
testl %eax, %eax
je 0x24d59
movl %eax, %r15d
movq 0x1c2ae(%rip), %rax     # 0x40f60
movl 0xd670(%rax), %eax
cmpl $0x31, %eax
jge 0x24a47
cltq
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
movq 0x1c28e(%rip), %rbx     # 0x40f60
leaq (%rbx,%rax), %rdi
addq $0xc6d0, %rdi           # imm = 0xC6D0
leaq 0x12b7a(%rip), %rsi     # 0x3785e
movl $0x50, %edx
callq 0xa8a0
movslq 0xd670(%rbx), %rax
leaq (%rax,%rax,4), %rcx
shlq $0x4, %rcx
xorl %edx, %edx
movb %dl, 0xc71f(%rbx,%rcx)
incl %eax
movl %eax, 0xd670(%rbx)
movb %dl, 0xc720(%rbx,%rcx)
jmp 0x24a47
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm0
movsd (%r13), %xmm1
jne 0x24df7
jp 0x24df7
ucomisd %xmm2, %xmm1
jne 0x24df7
jp 0x24df7
leaq 0x12c0b(%rip), %rdi     # 0x37956
jmp 0x249fc
movsd 0x38(%rbx), %xmm1
movsd %xmm1, (%rsi)
cmpb $0x1, 0x244(%r14)
jne 0x24d80
movsd 0x248(%r14), %xmm0
subsd 0x58(%rbx), %xmm0
subsd 0x48(%rbx), %xmm0
subsd 0xd6a8(%rbx), %xmm0
jmp 0x24d85
movsd 0x50(%rbx), %xmm0
movsd %xmm0, (%rdi)
cmpb $0x1, 0x250(%r14)
jne 0x24db0
movsd 0x258(%r14), %xmm0
subsd 0x70(%rbx), %xmm0
subsd 0x60(%rbx), %xmm0
subsd 0xd6b0(%rbx), %xmm0
jmp 0x24db5
movsd 0x68(%rbx), %xmm0
movsd %xmm0, (%rdx)
cmpb $0x1, 0x260(%r14)
jne 0x24de3
movsd 0x268(%r14), %xmm0
subsd 0x88(%rbx), %xmm0
subsd 0x78(%rbx), %xmm0
subsd 0xd6b8(%rbx), %xmm0
jmp 0x24deb
movsd 0x80(%rbx), %xmm0
movsd %xmm0, (%rcx)
xorl %r15d, %r15d
jmp 0x24a47
callq 0xa100
movsd 0x2b8(%r14), %xmm1
mulsd 0xf0cb(%rip), %xmm1     # 0x33ed8
divsd 0xf0cb(%rip), %xmm1     # 0x33ee0
addsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
movsd (%r15), %xmm0
movsd (%r13), %xmm1
callq 0xa290
movsd %xmm0, -0x38(%rbp)
movsd -0x30(%rbp), %xmm0
callq 0xb550
mulsd -0x38(%rbp), %xmm0
movsd %xmm0, (%r13)
movsd -0x30(%rbp), %xmm0
callq 0xa1d0
movq 0x10(%rbp), %r11
movq 0x18(%rbp), %r10
movq 0x20(%rbp), %rdx
movq 0x28(%rbp), %r8
movq 0x30(%rbp), %rdi
movq 0x38(%rbp), %rsi
mulsd -0x38(%rbp), %xmm0
movsd %xmm0, (%r15)
testb %r12b, %r12b
je 0x24e87
movl $0xc6a0, %eax           # imm = 0xC6A0
cmpl $0x3, 0xc67c(%rbx)
je 0x24e8c
movl $0x610, %eax            # imm = 0x610
movsd (%rbx,%rax), %xmm0
movq -0x48(%rbp), %rax
movsd %xmm0, (%rax)
cmpb $0x1, 0x290(%r14)
jne 0x24eb0
addsd 0x298(%r14), %xmm0
movsd %xmm0, (%rax)
movsd 0x8(%rbx), %xmm0
movsd %xmm0, (%r11)
cmpb $0x1, (%r14)
jne 0x24ecb
addsd 0x8(%r14), %xmm0
movsd %xmm0, (%r11)
movsd 0x20(%rbx), %xmm0
movsd %xmm0, (%r10)
cmpb $0x1, 0x10(%r14)
jne 0x24ee7
addsd 0x18(%r14), %xmm0
movsd %xmm0, (%r10)
movsd 0x38(%rbx), %xmm0
movsd %xmm0, (%rdx)
cmpb $0x1, 0x20(%r14)
jne 0x24f01
addsd 0x28(%r14), %xmm0
movsd %xmm0, (%rdx)
movsd 0x50(%rbx), %xmm0
movsd %xmm0, (%r8)
cmpb $0x1, 0x244(%r14)
jne 0x24f23
addsd 0x248(%r14), %xmm0
movsd %xmm0, (%r8)
movsd 0x68(%rbx), %xmm0
movsd %xmm0, (%rdi)
cmpb $0x1, 0x250(%r14)
jne 0x24f43
addsd 0x258(%r14), %xmm0
movsd %xmm0, (%rdi)
movsd 0x80(%rbx), %xmm0
movsd %xmm0, (%rsi)
xorl %r15d, %r15d
cmpb $0x1, 0x260(%r14)
jne 0x24a47
addsd 0x268(%r14), %xmm0
movsd %xmm0, (%rsi)
jmp 0x24a47
callq 0xa100
movsd %xmm0, -0x40(%rbp)
movsd 0x2a8(%r14), %xmm1
movsd %xmm1, -0x38(%rbp)
callq 0xb550
mulsd -0x38(%rbp), %xmm0
movsd %xmm0, (%r13)
movsd -0x40(%rbp), %xmm0
movsd 0x2a8(%r14), %xmm1
movsd %xmm1, -0x38(%rbp)
jmp 0x2478e