// File: /workspace/github_cpp_makefile_star2_O3/myudelson[P]hmm-scalable/utils.cpp
// Function: projectsimplex(double*, signed char)
void projectsimplex(NUMBER* ar, NPAR size) {
    NPAR i, num_at_hi, num_at_lo; // number of elements at lower,upper boundary
    NPAR *at_hi = Calloc(NPAR, (size_t)size);
    NPAR *at_lo = Calloc(NPAR, (size_t)size);
    NUMBER err, lambda;
    NUMBER* ar_copy = Calloc(NUMBER, (size_t)size);
    memcpy(ar_copy, ar, sizeof(NUMBER)*(size_t)size);
    int iter = 0;
    while( !issimplex(ar, size) ) {
        lambda = 0;
        num_at_hi = 0;
        num_at_lo = 0;
        err = -1;
        // threshold
        for(i=0; i<size; i++) {
            at_lo[i] = (ar[i]<=/*lb[i]*/0)?1:0;
            ar[i] = (at_lo[i]==1)?/*lb[i]*/0:ar[i];
            num_at_lo = (NPAR)( num_at_lo + at_lo[i] );
            
            at_hi[i] = (ar[i]>=/*ub[i]*/1)?1:0;
            ar[i] = (at_hi[i]==1)?/*ub[i]*/1:ar[i];
            num_at_hi = (NPAR)( num_at_hi + at_hi[i] );
            
            err += ar[i];
        }
        //		if (size > (num_at_hi + num_at_lo) )
        //			lambda = err / (size - (num_at_hi + num_at_lo));
        if ( err > 0 && size > num_at_lo )
            lambda = err / (size - num_at_lo);
        else if ( err < 0 && size > num_at_hi )
            lambda = err / (size - num_at_hi);
        
        int will_suffer_from_lambda = 0; // those values that, if lessened by lambda, will be below 0 or over 1
        NUMBER err2 = 0.0, lambda2 = 0.0;
        for(i=0; i<size; i++) {
            if( (at_lo[i]==0 && at_hi[i]==0) ) {
                if( ar[i] < lambda ) {
                    will_suffer_from_lambda++;
                    err2 += ar[i];
                }
            }
        }
        
        if( will_suffer_from_lambda == 0 ) {
            for(i=0; i<size; i++) {
                ar[i] -= (at_lo[i]==0 && err>0)?lambda:0;
                ar[i] -= (at_hi[i]==0 && err<0)?lambda:0;
            }
        } else {
            lambda2 = (err-err2) / ( size - (num_at_hi + num_at_lo) - will_suffer_from_lambda );
            for(i=0; i<size; i++) {
                if( at_lo[i]==0 && at_hi[i]==0 ) {
                    ar[i] = (ar[i]<lambda)?0:(ar[i]-lambda2);
                }
            }
        }
        iter++;
        if(iter==100) {
            string ar_was = "";
            for(int i=0; i<size; i++) ar_was = ar_was + std::to_string(ar_copy[i]).substr(0,5) + std::to_string((i<(size-1))?',':' ');
            string ar_is = "";
            for(int i=0; i<size; i++) ar_is = ar_is + std::to_string(ar[i]).substr(0,5) + std::to_string((i<(size-1))?',':' ');
            fprintf(stderr,"WARNING! Stuck in projectsimplex()! ar was %s and now is %s.\n",ar_was.c_str(),ar_is.c_str());
            break;//exit(1);
        }
    } // until satisfied
    // force last to be 1 - sum of all but last -- this code, actually breaks things
    //    err = 0;
    //    for(i=0; i<(size); i++) {
    //        err += ar[i];
    //    }
    //    err = 1;
    //    for(i=0; i<(size-1); i++) {
    //        err -= ar[i];
    //    }
    //    ar[size-1] = err;
    //    err = 1;
    //    for(i=1; i<(size-0); i++) {
    //        err -= ar[i];
    //    }
    //    ar[0] = err;
    
    NUMBER sum = 0.0;
    for(i=0; i<size; i++) {
        sum += ar[i];
        if(ar[i]<0 || ar[i] >1) {
            string ar_was = "";
            for(int i=0; i<size; i++) ar_was = ar_was + std::to_string(ar_copy[i]).substr(0,5) + std::to_string((i<(size-1))?',':' ');
            string ar_is = "";
            for(int i=0; i<size; i++) ar_is = ar_is + std::to_string(ar[i]).substr(0,5) + std::to_string((i<(size-1))?',':' ');
            fprintf(stderr, "ERROR! projected value is not within [0, 1] range! ar was %s and now is %s.\n",ar_was.c_str(),ar_is.c_str());
        }
    }
//    if( fabs(sum-1)>SAFETY)
//        fprintf(stderr, "ERROR! projected simplex does not sum to 1!\n");
	
    free(at_hi);
    free(at_lo);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x168, %rsp            # imm = 0x168
movl %esi, %r13d
movq %rdi, %rbx
movslq %esi, %r12
movl $0x1, %esi
movq %r12, %rdi
callq 0x4130
movq %rax, %r14
movl $0x1, %esi
movq %r12, %rdi
callq 0x4130
movq %rax, %r15
movl $0x8, %esi
movq %r12, %rdi
callq 0x4130
shlq $0x3, %r12
movq %rax, 0x108(%rsp)
movq %rax, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x41c0
movzbl %r13b, %r9d
xorl %eax, %eax
movsd 0x2d04b(%rip), %xmm0    # 0x338f0
movapd 0x2d083(%rip), %xmm1    # 0x33930
movsd 0x2d043(%rip), %xmm2    # 0x338f8
movsd 0x2d02b(%rip), %xmm3    # 0x338e8
xorpd %xmm4, %xmm4
movq %r9, 0xf8(%rsp)
movq %r14, 0x158(%rsp)
movq %r15, 0x150(%rsp)
testb %r13b, %r13b
jle 0x6924
movsd (%rbx), %xmm6
ucomisd %xmm6, %xmm4
ja 0x6945
ucomisd %xmm0, %xmm6
ja 0x6945
movapd %xmm0, %xmm5
subsd %xmm6, %xmm5
movl $0x1, %edx
movq %rdx, %rcx
cmpq %rdx, %r9
je 0x691c
movsd (%rbx,%rcx,8), %xmm6
subsd %xmm6, %xmm5
ucomisd %xmm6, %xmm4
ja 0x691c
leaq 0x1(%rcx), %rdx
ucomisd %xmm0, %xmm6
jbe 0x68fb
cmpq %r9, %rcx
setae %cl
jmp 0x692a
movb $0x1, %cl
movapd %xmm0, %xmm5
testb %cl, %cl
je 0x693c
andpd %xmm1, %xmm5
ucomisd %xmm5, %xmm2
ja 0x70cd
testb %r13b, %r13b
jle 0x69cb
xorl %esi, %esi
movapd %xmm3, %xmm5
xorl %ecx, %ecx
xorl %edx, %edx
movsd (%rbx,%rsi,8), %xmm6
ucomisd %xmm6, %xmm4
setae %dil
setae (%r15,%rsi)
jb 0x6979
movq $0x0, (%rbx,%rsi,8)
movb $0x0, (%r14,%rsi)
xorpd %xmm7, %xmm7
xorl %r8d, %r8d
jmp 0x6997
ucomisd %xmm0, %xmm6
movsd %xmm6, (%rbx,%rsi,8)
setae (%r14,%rsi)
movb $0x1, %r8b
movapd %xmm0, %xmm7
jae 0x6997
xorl %r8d, %r8d
movapd %xmm6, %xmm7
addb %r8b, %cl
addb %dil, %dl
movsd %xmm7, (%rbx,%rsi,8)
addsd %xmm7, %xmm5
incq %rsi
cmpq %rsi, %r9
jne 0x694f
ucomisd %xmm4, %xmm5
seta %sil
cmpb %r13b, %dl
setl %dil
andb %sil, %dil
cmpb $0x1, %dil
jne 0x69d5
movsbl %dl, %edi
jmp 0x69f4
xorl %esi, %esi
movapd %xmm3, %xmm5
xorl %ecx, %ecx
xorl %edx, %edx
xorpd %xmm6, %xmm6
ucomisd %xmm5, %xmm6
seta %dil
cmpb %r13b, %cl
setl %r8b
andb %dil, %r8b
cmpb $0x1, %r8b
jne 0x6a0a
movsbl %cl, %edi
movl %r13d, %r8d
subl %edi, %r8d
xorps %xmm7, %xmm7
cvtsi2sd %r8d, %xmm7
movapd %xmm5, %xmm6
divsd %xmm7, %xmm6
testb %r13b, %r13b
jle 0x6b09
xorl %r8d, %r8d
xorpd %xmm7, %xmm7
xorl %edi, %edi
cmpb $0x0, (%r15,%r8)
jne 0x6a3e
cmpb $0x0, (%r14,%r8)
jne 0x6a3e
movsd (%rbx,%r8,8), %xmm8
ucomisd %xmm8, %xmm6
jbe 0x6a3e
incl %edi
addsd %xmm8, %xmm7
incq %r8
cmpq %r8, %r9
jne 0x6a1c
testl %edi, %edi
je 0x6aa9
testb %r13b, %r13b
jle 0x6b09
movsbl %cl, %ecx
movsbl %dl, %edx
addl %ecx, %edx
addl %edi, %edx
movl %r13d, %ecx
subl %edx, %ecx
subsd %xmm7, %xmm5
xorps %xmm7, %xmm7
cvtsi2sd %ecx, %xmm7
divsd %xmm7, %xmm5
xorl %ecx, %ecx
cmpb $0x0, (%r15,%rcx)
jne 0x6a9f
cmpb $0x0, (%r14,%rcx)
jne 0x6a9f
movsd (%rbx,%rcx,8), %xmm7
movapd %xmm7, %xmm8
subsd %xmm5, %xmm8
cmpltsd %xmm6, %xmm7
andnpd %xmm8, %xmm7
movlpd %xmm7, (%rbx,%rcx,8)
incq %rcx
cmpq %rcx, %r9
jne 0x6a73
jmp 0x6b09
testb %r13b, %r13b
jle 0x6b09
xorl %ecx, %ecx
cmpb $0x0, (%r15,%rcx)
xorpd %xmm7, %xmm7
movapd %xmm6, %xmm8
je 0x6ac5
xorpd %xmm8, %xmm8
testb %sil, %sil
jne 0x6acf
xorpd %xmm8, %xmm8
cmpb $0x0, (%r14,%rcx)
jne 0x6aeb
movapd %xmm5, %xmm9
cmpltsd %xmm7, %xmm9
andpd %xmm6, %xmm9
movapd %xmm9, %xmm7
movsd (%rbx,%rcx,8), %xmm9
subsd %xmm8, %xmm9
subsd %xmm7, %xmm9
movsd %xmm9, (%rbx,%rcx,8)
incq %rcx
cmpq %rcx, %r9
jne 0x6ab0
incl %eax
cmpl $0x64, %eax
jne 0x68d9
leaq 0x140(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x2e160(%rip), %rdx     # 0x34c87
leaq 0x130(%rsp), %rdi
movq %rdx, %rsi
callq 0xa7c0
leaq 0xd8(%rsp), %rax
testb %r13b, %r13b
jle 0x6df7
leal -0x1(%r13), %eax
cltq
movq %rax, 0xf0(%rsp)
movl %r13d, %eax
movq %rax, 0xe8(%rsp)
xorl %r12d, %r12d
leaq 0x48(%rsp), %rbp
leaq 0x8(%rsp), %r14
movq 0x108(%rsp), %rax
movsd (%rax,%r12,8), %xmm0
movl $0x148, %edx            # imm = 0x148
movq %rbp, %rdi
movq 0x38435(%rip), %rsi     # 0x3efc0
leaq 0x2d030(%rip), %rcx     # 0x33bc2
movb $0x1, %al
callq 0xa60d
movl $0x5, %ecx
movq %r14, %rdi
movq %rbp, %r15
movq %rbp, %rsi
xorl %edx, %edx
callq 0x4230
movq 0x130(%rsp), %rcx
movq 0x138(%rsp), %r8
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4260
leaq 0x38(%rsp), %rsi
movq %rsi, 0x28(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x6bf2
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x6bfa
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x30(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x78(%rsp), %rax
movq %rax, 0x68(%rsp)
movl $0x2, %esi
leaq 0x68(%rsp), %rdi
movl $0x2d, %edx
callq 0x4280
cmpq 0xf0(%rsp), %r12
movl $0x20, %edx
movl $0x2c, %eax
cmovll %eax, %edx
movq 0x68(%rsp), %rdi
movl $0x2, %esi
callq 0xa753
movq 0x28(%rsp), %rcx
movl $0xf, %edi
leaq 0x38(%rsp), %rax
cmpq %rax, %rcx
je 0x6c6d
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %r8
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rdi, %rax
jbe 0x6c9e
movl $0xf, %edi
leaq 0x78(%rsp), %r9
cmpq %r9, %rsi
je 0x6c99
movq 0x78(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x6caa
leaq 0x28(%rsp), %rdi
callq 0x40d0
jmp 0x6cb8
leaq 0x68(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4260
leaq 0xd8(%rsp), %rsi
movq %rsi, 0xc8(%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x6ce9
movq %rdx, 0xc8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xd8(%rsp)
jmp 0x6cf1
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0xd0(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x130(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0x42c0
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x6d53
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x4220
leaq 0xd8(%rsp), %rax
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rcx
cmpq %rcx, %rdi
je 0x6d77
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x4220
leaq 0xd8(%rsp), %rax
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rcx
cmpq %rcx, %rdi
je 0x6d9b
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4220
leaq 0xd8(%rsp), %rax
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rcx
cmpq %rcx, %rdi
je 0x6dbf
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4220
leaq 0xd8(%rsp), %rax
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rcx
cmpq %rcx, %rdi
je 0x6de3
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x4220
leaq 0xd8(%rsp), %rax
incq %r12
cmpq %r12, 0xe8(%rsp)
movq %r15, %rbp
jne 0x6b6e
leaq 0xc8(%rsp), %rdi
movq %rax, (%rdi)
leaq 0x2de7e(%rip), %rdx     # 0x34c87
movq %rdx, %rsi
callq 0xa7c0
testb %r13b, %r13b
jle 0x70a0
leal -0x1(%r13), %eax
cltq
movq %rax, 0xf0(%rsp)
movl %r13d, %eax
movq %rax, 0xe8(%rsp)
xorl %ebp, %ebp
leaq 0x68(%rsp), %r12
leaq 0x48(%rsp), %r14
movsd (%rbx,%rbp,8), %xmm0
movl $0x148, %edx            # imm = 0x148
movq %r12, %rdi
movq 0x3816d(%rip), %rsi     # 0x3efc0
leaq 0x2cd68(%rip), %rcx     # 0x33bc2
movb $0x1, %al
callq 0xa60d
movl $0x5, %ecx
movq %r14, %rdi
movq %r12, %r15
movq %r12, %rsi
xorl %edx, %edx
callq 0x4230
movq 0xc8(%rsp), %rcx
movq 0xd0(%rsp), %r8
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4260
leaq 0x18(%rsp), %rsi
movq %rsi, 0x8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x6eba
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x6ec2
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xb8(%rsp), %rax
movq %rax, 0xa8(%rsp)
movl $0x2, %esi
leaq 0xa8(%rsp), %rdi
movl $0x2d, %edx
callq 0x4280
cmpq 0xf0(%rsp), %rbp
movl $0x20, %edx
movl $0x2c, %eax
cmovll %eax, %edx
movq 0xa8(%rsp), %rdi
movl $0x2, %esi
callq 0xa753
movq 0x8(%rsp), %rcx
movl $0xf, %edi
leaq 0x18(%rsp), %rax
cmpq %rax, %rcx
je 0x6f41
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %r8
movq 0xa8(%rsp), %rsi
movq 0xb0(%rsp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rdi, %rax
jbe 0x6f7e
movl $0xf, %edi
leaq 0xb8(%rsp), %r9
cmpq %r9, %rsi
je 0x6f79
movq 0xb8(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x6f8a
leaq 0x8(%rsp), %rdi
callq 0x40d0
jmp 0x6f9b
leaq 0xa8(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4260
leaq 0x38(%rsp), %rsi
movq %rsi, 0x28(%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x6fc0
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x6fc8
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x30(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0xc8(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x42c0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x7013
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4220
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x7038
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x4220
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x7054
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4220
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x7070
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x4220
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x708c
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x4220
incq %rbp
cmpq %rbp, 0xe8(%rsp)
movq %r15, %r12
jne 0x6e3f
leaq 0x130(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
leaq 0xd8(%rsp), %rdx
leaq 0x140(%rsp), %rcx
callq 0x461b
movq 0xf8(%rsp), %r9
movq %rbx, 0x100(%rsp)
testb %r13b, %r13b
jle 0x7685
leaq 0x58(%rsp), %r12
leal -0x1(%r13), %eax
leaq 0x18(%rsp), %rbx
cltq
movq %rax, 0xf0(%rsp)
movl %r13d, %eax
movq %rax, 0xe8(%rsp)
xorl %eax, %eax
xorpd %xmm1, %xmm1
movsd 0x2c7e1(%rip), %xmm2    # 0x338f0
leaq 0x68(%rsp), %r14
movq 0x100(%rsp), %rcx
movsd (%rcx,%rax,8), %xmm0
ucomisd %xmm0, %xmm1
ja 0x713a
ucomisd %xmm2, %xmm0
ja 0x713a
incq %rax
cmpq %r9, %rax
jne 0x7114
jmp 0x7685
movq %rax, 0x160(%rsp)
leaq 0x38(%rsp), %rax
movq %rax, 0x28(%rsp)
leaq 0x28(%rsp), %rdi
leaq 0x2db2f(%rip), %rdx     # 0x34c87
movq %rdx, %rsi
callq 0xa7c0
xorl %ebp, %ebp
movq %r14, %r15
movq 0x108(%rsp), %rax
movsd (%rax,%rbp,8), %xmm0
movl $0x148, %edx            # imm = 0x148
leaq 0xa8(%rsp), %r13
movq %r13, %rdi
movq 0x37e37(%rip), %rsi     # 0x3efc0
leaq 0x2ca32(%rip), %rcx     # 0x33bc2
movb $0x1, %al
callq 0xa60d
movl $0x5, %ecx
movq %r15, %r14
movq %r15, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x4230
movq 0x28(%rsp), %rcx
movq 0x30(%rsp), %r8
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4260
movq %r12, 0x48(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x71e5
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
jmp 0x71ef
movupd (%rcx), %xmm0
movupd %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rdx, 0x50(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x98(%rsp), %rax
movq %rax, 0x88(%rsp)
movl $0x2, %esi
leaq 0x88(%rsp), %rdi
movl $0x2d, %edx
callq 0x4280
cmpq 0xf0(%rsp), %rbp
movl $0x20, %edx
movl $0x2c, %eax
cmovll %eax, %edx
movq 0x88(%rsp), %rdi
movl $0x2, %esi
callq 0xa753
movq 0x48(%rsp), %rcx
movl $0xf, %edi
cmpq %r12, %rcx
je 0x7269
movq 0x58(%rsp), %rdi
movq 0x50(%rsp), %r8
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rdi, %rax
jbe 0x72a6
movl $0xf, %edi
leaq 0x98(%rsp), %r9
cmpq %r9, %rsi
je 0x72a1
movq 0x98(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x72b2
leaq 0x48(%rsp), %rdi
callq 0x40d0
jmp 0x72c3
leaq 0x88(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4260
movq %rbx, 0x8(%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x72e3
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x72eb
movupd (%rcx), %xmm0
movupd %xmm0, (%rbx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x42c0
movq 0x8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x732e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4220
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x7353
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x4220
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x736a
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x4220
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x7386
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x4220
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x73ab
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x4220
incq %rbp
cmpq %rbp, 0xe8(%rsp)
jne 0x7162
leaq 0x120(%rsp), %rax
movq %rax, 0x110(%rsp)
leaq 0x110(%rsp), %rdi
leaq 0x2d8ac(%rip), %rdx     # 0x34c87
movq %rdx, %rsi
callq 0xa7c0
xorl %ebp, %ebp
movq 0x100(%rsp), %rax
movsd (%rax,%rbp,8), %xmm0
movl $0x148, %edx            # imm = 0x148
leaq 0xa8(%rsp), %r13
movq %r13, %rdi
movq 0x37bb7(%rip), %rsi     # 0x3efc0
leaq 0x2c7b2(%rip), %rcx     # 0x33bc2
movb $0x1, %al
callq 0xa60d
movl $0x5, %ecx
movq %r15, %r14
movq %r15, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x4230
movq 0x110(%rsp), %rcx
movq 0x118(%rsp), %r8
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4260
movq %r12, 0x48(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x746b
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
jmp 0x7475
movupd (%rcx), %xmm0
movupd %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rdx, 0x50(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x98(%rsp), %rax
movq %rax, 0x88(%rsp)
movl $0x2, %esi
leaq 0x88(%rsp), %rdi
movl $0x2d, %edx
callq 0x4280
cmpq 0xf0(%rsp), %rbp
movl $0x20, %edx
movl $0x2c, %eax
cmovll %eax, %edx
movq 0x88(%rsp), %rdi
movl $0x2, %esi
callq 0xa753
movq 0x48(%rsp), %rcx
movl $0xf, %edi
cmpq %r12, %rcx
je 0x74ef
movq 0x58(%rsp), %rdi
movq 0x50(%rsp), %r8
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rdi, %rax
jbe 0x752c
movl $0xf, %edi
leaq 0x98(%rsp), %r9
cmpq %r9, %rsi
je 0x7527
movq 0x98(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x7538
leaq 0x48(%rsp), %rdi
callq 0x40d0
jmp 0x7549
leaq 0x88(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4260
movq %rbx, 0x8(%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x7569
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x7571
movupd (%rcx), %xmm0
movupd %xmm0, (%rbx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x110(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x42c0
movq 0x8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x75b7
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4220
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x75dc
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x4220
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x75f3
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x4220
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x760f
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x4220
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x7634
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x4220
incq %rbp
cmpq %rbp, 0xe8(%rsp)
jne 0x73e5
leaq 0x28(%rsp), %rdi
leaq 0x110(%rsp), %rsi
leaq 0x120(%rsp), %rdx
leaq 0x38(%rsp), %rcx
callq 0x4680
movq 0xf8(%rsp), %r9
movq 0x160(%rsp), %rax
xorpd %xmm1, %xmm1
movsd 0x2c270(%rip), %xmm2    # 0x338f0
jmp 0x712d
movq 0x158(%rsp), %rdi
callq 0x42a0
movq 0x150(%rsp), %rdi
callq 0x42a0
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x77db
jmp 0x76bd
jmp 0x7946
movq %rax, %rbx
jmp 0x798f
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x76f2
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x4220
jmp 0x76f2
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x7713
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4220
jmp 0x7713
movq %rax, %rbx
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x7739
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x4220
jmp 0x7739
movq %rax, %rbx
jmp 0x7755
movq %rax, %rbx
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x7755
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x4220
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x77ff
movq 0xd8(%rsp), %rsi
jmp 0x77f7
movq %rax, %rbx
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x779c
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x4220
jmp 0x779c
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x77bd
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4220
jmp 0x77bd
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x77e3
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4220
jmp 0x77e3
movq %rax, %rbx
jmp 0x77ff
movq %rax, %rbx
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x77ff
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x4220
movq 0x130(%rsp), %rdi
leaq 0x140(%rsp), %rax
cmpq %rax, %rdi
je 0x798f
movq 0x140(%rsp), %rsi
jmp 0x7987
movq %rax, %rbx
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x7852
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x4220
jmp 0x7852
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x786e
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x4220
jmp 0x786e
movq %rax, %rbx
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x7894
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x4220
jmp 0x7894
movq %rax, %rbx
jmp 0x78b9
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x78b9
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x4220
movq 0x110(%rsp), %rdi
leaq 0x120(%rsp), %rax
cmpq %rax, %rdi
je 0x7973
movq 0x120(%rsp), %rsi
jmp 0x796b
movq %rax, %rbx
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x7911
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x4220
jmp 0x7911
movq %rax, %rbx
jmp 0x7928
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x7928
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x4220
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x794e
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x4220
jmp 0x794e
movq %rax, %rbx
jmp 0x7973
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x7973
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x4220
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x798f
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4220
movq %rbx, %rdi
callq 0x4430