// File: /workspace/github_c_makefile_star2_O3/sheneman[P]clearcut/clearcut.c
// Function: NJ_relaxed_nj
NJ_TREE *
NJ_relaxed_nj(NJ_ARGS *nj_args,
	      DMAT *dmat) {

  
  NJ_TREE *tree;
  NJ_VERTEX *vertex;
  long int a, b, t, bh, bv, i;
  float hmin, vmin, hvmin;
  float p, q, x;
  int join_flag;
  int additivity_mode;
  long int hmincount, vmincount;
  long int *permutation = NULL;



  /* initialize the r and r2 vectors */
  NJ_init_r(dmat);

  additivity_mode = 1;

  /* allocate the permutation vector, if we are in randomize mode */
  if(!nj_args->norandom) {
    permutation = (long int *)calloc(dmat->size, sizeof(long int));
    if(!permutation) {
      fprintf(stderr, "Clearcut:  Memory allocation error in NJ_relaxed_nj()\n");
      return(NULL);
    }
  }

  /* allocate and initialize our vertex vector used for tree construction */
  vertex = NJ_init_vertex(dmat);
  
  /* loop until there are only 2 nodes left to join */
  while(vertex->nactive > 2) {

    switch(nj_args->norandom) {

      /* RANDOMIZED JOINS */
    case 0:

      join_flag = 0;

      NJ_permute(permutation, dmat->size-1);
      for(i=0;i<dmat->size-1 && (vertex->nactive>2) ;i++) {

	a = permutation[i];

	/* find min trans dist along horiz. of row a */
	hmin = NJ_find_hmin(dmat, a, &bh, &hmincount);   
	if(a) {
	  /* find min trans dist along vert. of row a */
	  vmin = NJ_find_vmin(dmat, a, &bv, &vmincount); 
	} else {
	  vmin = hmin;
	  bv = bh;
	  vmincount = 0;
	}
	
	if(NJ_FLT_EQ(hmin, vmin)) {

	  /* 
	   * The minima along the vertical and horizontal are 
	   * the same.  Compute the proportion of minima along
	   * the horizonal (p) and the proportion of minima 
	   * along the vertical (q).
	   * 
	   * If the same minima exist along the horizonal and
	   * vertical, we break the tie in a way which is
	   * non-biased.  That is, we break the tie based on the
	   * proportion of horiz. minima versus vertical minima.
	   * 
	   */
	  p = (float)hmincount / ((float)hmincount + (float)vmincount);
	  q = 1.0 - p;
	  x = genrand_real2();
	  
	  if(x < p) {
	    hvmin = hmin;
	    b     = bh;
	  } else {
	    hvmin = vmin;
	    b     = bv;
	  }
	} else if(NJ_FLT_LT(hmin, vmin) ) {
	  hvmin   = hmin;
	  b       = bh;
	} else {
	  hvmin   = vmin;
	  b       = bv;
	}
	
	if(NJ_check(nj_args, dmat, a, b, hvmin, additivity_mode)) {

	  /* swap a and b, if necessary, to make sure a < b */
	  if(b < a) {
	    t = a;
	    a = b;
	    b = t;
	  }

	  join_flag = 1;
	
	  /* join taxa from rows a and b */
	  NJ_decompose(dmat, vertex, a, b, 0);

	  /* collapse matrix */
	  NJ_compute_r(dmat, a, b);
	  NJ_collapse(dmat, vertex, a, b);
	  
	  NJ_permute(permutation, dmat->size-1);
	}
      }
      
      /* turn off additivity if go through an entire cycle without joining */
      if(!join_flag) {
	additivity_mode = 0;
      }
      
      break;



      /* DETERMINISTIC JOINS */
    case 1:
      
      join_flag = 0;

      for(a=0;a<dmat->size-1 && (vertex->nactive > 2) ;) {
      
	/* find the min along the horizontal of row a */
	hmin = NJ_find_hmin(dmat, a, &b, &hmincount);
      
	if(NJ_check(nj_args, dmat, a, b, hmin, additivity_mode)) {
	
	  join_flag = 1;
	
	  /* join taxa from rows a and b */
	  NJ_decompose(dmat, vertex, a, b, 0);

	  /* collapse matrix */
	  NJ_compute_r(dmat, a, b);
	  NJ_collapse(dmat, vertex, a, b);

	  if(a) { 
	    a--; 
	  }
	
	} else {
	  a++;
	}
      }
    
      /* turn off additivity if go through an entire cycle without joining */
      if(!join_flag) {
	additivity_mode = 0;
      }

      break;
    }
 
  }  /* WHILE */

  /* Join the last two nodes on the vertex list */
  tree = NJ_decompose(dmat, vertex, 0, 1, NJ_LAST);
  
  if(nj_args->verbose_flag) {
    if(additivity_mode) {
      printf("Tree is additive\n");
    } else {
      printf("Tree is not additive\n");
    }
  }
  
  if(vertex) {
    NJ_free_vertex(vertex);
  }
  
  if(!nj_args->norandom && permutation) {
    free(permutation);
  }
  
  return(tree);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r14
movq %rdi, %r15
movq %rsi, %rdi
callq 0x3eaf
cmpl $0x0, 0x38(%r15)
je 0x337f
xorl %r12d, %r12d
jmp 0x3399
movq 0x8(%r14), %rdi
movl $0x8, %esi
callq 0x2160
movq %rax, %r12
testq %rax, %rax
je 0x3d50
movq %r14, %rdi
callq 0x3f26
movq %rax, 0x20(%rsp)
cmpq $0x3, 0x10(%rax)
movq %r15, 0x40(%rsp)
jl 0x3cc0
movl $0x1, %ebp
movq %r12, 0x48(%rsp)
movq %r14, 0x30(%rsp)
movl %ebp, 0x14(%rsp)
movl 0x38(%r15), %eax
testl %eax, %eax
je 0x368b
cmpl $0x1, %eax
jne 0x3c96
movq 0x8(%r14), %rax
xorl %ebp, %ebp
cmpq $0x2, %rax
jl 0x3c9a
movq $0x0, 0x18(%rsp)
xorl %edx, %edx
movq 0x20(%rsp), %rcx
cmpq $0x3, 0x10(%rcx)
jl 0x3681
leaq 0x1(%rdx), %r13
movslq %eax, %rsi
cmpq %rsi, %r13
jge 0x3522
movq 0x30(%r14), %r8
shlq $0x20, %rax
sarq $0x1f, %rax
movq %rdx, %rcx
notq %rcx
addq %rax, %rcx
imulq %rdx, %rcx
movq %rcx, %rbp
shrq $0x3f, %rbp
addq %rcx, %rbp
addq %rbp, %rbp
andq $-0x4, %rbp
addq 0x18(%r14), %rbp
xorl %eax, %eax
movq %r13, %r12
movl $0x0, 0x8(%rsp)
movss 0x4c14(%rip), %xmm0     # 0x8070
movq %r8, 0x28(%rsp)
movss (%rbp,%r12,4), %xmm3
movss (%r8,%rdx,4), %xmm1
addss (%r8,%r12,4), %xmm1
subss %xmm1, %xmm3
movaps %xmm3, %xmm1
subss %xmm0, %xmm1
andps 0x4bba(%rip), %xmm1     # 0x8040
movss 0x4be6(%rip), %xmm2     # 0x8074
ucomiss %xmm1, %xmm2
ja 0x34a7
ucomiss %xmm3, %xmm0
jbe 0x3500
movl $0x1, %eax
movaps %xmm3, %xmm0
movl %r12d, 0x8(%rsp)
jmp 0x3500
movss %xmm0, 0xc(%rsp)
movq %rsi, %r14
movq %rdx, %rbx
incq %rax
movq %rax, %r15
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
movss 0x4baf(%rip), %xmm1     # 0x8078
divss %xmm0, %xmm1
movss %xmm1, 0x10(%rsp)
callq 0x72a9
cvtsd2ss %xmm0, %xmm0
movss 0x10(%rsp), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x34ec
movl %r12d, 0x8(%rsp)
movq %rbx, %rdx
movq %r14, %rsi
movq 0x28(%rsp), %r8
movss 0xc(%rsp), %xmm0
movq %r15, %rax
incq %r12
cmpq %r12, %rsi
jne 0x3461
movslq 0x8(%rsp), %rbx
movq 0x40(%rsp), %r15
movq 0x48(%rsp), %r12
movq 0x30(%rsp), %r14
jmp 0x352c
movss 0x4b46(%rip), %xmm0     # 0x8070
xorl %ebx, %ebx
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rcx
movl 0x14(%rsp), %r8d
movq %rdx, %rbp
callq 0x43c1
testl %eax, %eax
je 0x366d
movq %r14, %rdi
movq 0x20(%rsp), %rsi
movq %rbp, %rdx
movq %rbx, %rcx
xorl %r8d, %r8d
callq 0x4028
movq 0x8(%r14), %rax
movq 0x18(%r14), %rdx
movq 0x28(%r14), %rcx
cmpq %rax, %r13
jge 0x35e7
movq %rbx, %rdi
notq %rdi
leaq (%rdi,%rax,2), %r8
imulq %rbx, %r8
movq %r8, %rdi
shrq $0x3f, %rdi
addq %r8, %rdi
andq $-0x2, %rdi
leaq (%rdx,%rdi,2), %rdi
leaq (%rdi,%rbx,4), %r9
addq $0x4, %r9
movq %rbp, %rdi
notq %rdi
leaq (%rdi,%rax,2), %rdi
imulq %rbp, %rdi
movq %rdi, %r8
shrq $0x3f, %r8
addq %rdi, %r8
andq $-0x2, %r8
leaq (%rdx,%r8,2), %rdi
movss (%rcx,%r13,4), %xmm0
subss (%rdi,%r13,4), %xmm0
movss %xmm0, (%rcx,%r13,4)
cmpq %rbx, %r13
jle 0x35df
subss (%r9), %xmm0
addq $0x4, %r9
movss %xmm0, (%rcx,%r13,4)
incq %r13
cmpq %r13, %rax
jne 0x35b9
testq %rbx, %rbx
jle 0x3647
leaq (%rdx,%rbx,4), %r11
leaq (%rdx,%rbp,4), %rdx
leaq -0x1(%rax), %rdi
leaq -0x4(,%rax,4), %r8
xorl %r9d, %r9d
movss (%rcx,%r9,4), %xmm0
cmpq %rbp, %r9
jge 0x3620
subss (%rdx), %xmm0
movss %xmm0, (%rcx,%r9,4)
addq %r8, %rdx
movq %rdi, %r10
jmp 0x3629
movq %r9, %r10
notq %r10
addq %rax, %r10
subss (%r11), %xmm0
movss %xmm0, (%rcx,%r9,4)
leaq (%r11,%r10,4), %r11
incq %r9
decq %rdi
addq $-0x4, %r8
cmpq %r9, %rbx
jne 0x3603
movq %r14, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x4122
subq $0x1, %rbp
movl $0x0, %r13d
cmovaeq %rbp, %r13
movl $0x1, %eax
movq %rax, 0x18(%rsp)
movq 0x8(%r14), %rax
leaq -0x1(%rax), %rcx
movq %r13, %rdx
cmpq %rcx, %r13
jl 0x33f9
movq 0x18(%rsp), %rax
jmp 0x3c8b
testq %r12, %r12
je 0x3d59
movq 0x8(%r14), %rcx
xorl %ebp, %ebp
cmpq $0x2, %rcx
jl 0x3c9a
leaq -0x1(%rcx), %rbx
movq %rcx, %rax
movabsq $0x7ffffffffffffffe, %rdx # imm = 0x7FFFFFFFFFFFFFFE
andq %rdx, %rax
addq $-0x2, %rcx
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
pxor 0x4952(%rip), %xmm0     # 0x8020
xorl %ecx, %ecx
movdqa 0x4938(%rip), %xmm1     # 0x8010
movdqa %xmm1, %xmm2
pxor 0x493c(%rip), %xmm2     # 0x8020
movdqa %xmm2, %xmm3
pcmpgtd %xmm0, %xmm3
pcmpeqd %xmm0, %xmm2
pshufd $0xf5, %xmm2, %xmm4     # xmm4 = xmm2[1,1,3,3]
pand %xmm3, %xmm4
pshufd $0xf5, %xmm3, %xmm2     # xmm2 = xmm3[1,1,3,3]
por %xmm4, %xmm2
movd %xmm2, %edx
notl %edx
testb $0x1, %dl
je 0x3711
movq %rcx, (%r12,%rcx,8)
pxor 0x4937(%rip), %xmm2     # 0x8050
pextrw $0x4, %xmm2, %edx
testb $0x1, %dl
je 0x372c
leaq 0x1(%rcx), %rdx
movq %rdx, 0x8(%r12,%rcx,8)
addq $0x2, %rcx
paddq 0x48f8(%rip), %xmm1     # 0x8030
cmpq %rcx, %rax
jne 0x36d8
movq %r12, %r14
movq %rbx, %rdi
callq 0x7349
testq %rax, %rax
je 0x375b
movq (%r14,%rax,8), %rcx
movq (%r14), %rdx
movq %rdx, (%r14,%rax,8)
movq %rcx, (%r14)
addq $0x8, %r14
decq %rbx
jne 0x3740
movq 0x30(%rsp), %r14
movq 0x8(%r14), %rax
cmpq $0x2, %rax
jl 0x3c9a
movq $0x0, 0x50(%rsp)
xorl %edx, %edx
movq 0x20(%rsp), %rcx
cmpq $0x3, 0x10(%rcx)
jl 0x3c86
movq %rdx, 0x60(%rsp)
movq (%r12,%rdx,8), %rbp
leaq 0x1(%rbp), %rbx
movslq %eax, %r12
pxor %xmm0, %xmm0
movd %xmm0, 0x3c(%rsp)
cmpq %r12, %rbx
jge 0x38aa
shlq $0x20, %rax
sarq $0x1f, %rax
movq %rbp, %rcx
notq %rcx
addq %rax, %rcx
imulq %rbp, %rcx
movq %r14, %rax
movq %rcx, %r14
shrq $0x3f, %r14
addq %rcx, %r14
addq %r14, %r14
andq $-0x4, %r14
addq 0x18(%rax), %r14
movq 0x30(%rax), %r15
xorl %r13d, %r13d
movl $0x0, 0x8(%rsp)
movss 0x4877(%rip), %xmm3     # 0x8070
movss (%r14,%rbx,4), %xmm0
movss (%r15,%rbp,4), %xmm1
addss (%r15,%rbx,4), %xmm1
subss %xmm1, %xmm0
movaps %xmm0, %xmm1
subss %xmm3, %xmm1
andps 0x4823(%rip), %xmm1     # 0x8040
movss 0x484f(%rip), %xmm2     # 0x8074
ucomiss %xmm1, %xmm2
ja 0x383e
ucomiss %xmm0, %xmm3
jbe 0x387f
movl $0x1, %r13d
movaps %xmm0, %xmm3
movl %ebx, 0x8(%rsp)
jmp 0x387f
movss %xmm3, 0xc(%rsp)
incq %r13
xorps %xmm0, %xmm0
cvtsi2ss %r13, %xmm0
movss 0x4821(%rip), %xmm1     # 0x8078
divss %xmm0, %xmm1
movss %xmm1, 0x10(%rsp)
callq 0x72a9
cvtsd2ss %xmm0, %xmm0
movss 0x10(%rsp), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x3879
movl %ebx, 0x8(%rsp)
movss 0xc(%rsp), %xmm3
incq %rbx
cmpq %rbx, %r12
jne 0x37f9
movslq 0x8(%rsp), %rbx
xorps %xmm0, %xmm0
cvtsi2ss %r13, %xmm0
movss %xmm0, 0x18(%rsp)
movq 0x40(%rsp), %r15
movq 0x30(%rsp), %r14
jmp 0x38ba
movss 0x47be(%rip), %xmm3     # 0x8070
xorl %ebx, %ebx
movd %xmm0, 0x18(%rsp)
testq %rbp, %rbp
movq 0x48(%rsp), %r12
movss %xmm3, 0xc(%rsp)
je 0x39d2
jle 0x39da
movq %rbx, 0x58(%rsp)
movq 0x8(%r14), %r13
movq %r14, %rax
movq 0x30(%r14), %r14
leaq (,%rbp,4), %r15
addq 0x18(%rax), %r15
decq %r13
xorl %r12d, %r12d
xorl %ebx, %ebx
movq $0x0, 0x28(%rsp)
movss 0x4767(%rip), %xmm4     # 0x8070
movss (%r15), %xmm0
movss (%r14,%rbx,4), %xmm1
addss (%r14,%rbp,4), %xmm1
subss %xmm1, %xmm0
movaps %xmm0, %xmm1
subss %xmm4, %xmm1
andps 0x4714(%rip), %xmm1     # 0x8040
movss 0x4740(%rip), %xmm2     # 0x8074
ucomiss %xmm1, %xmm2
ja 0x394e
ucomiss %xmm0, %xmm4
jbe 0x3996
movl $0x1, %r12d
movaps %xmm0, %xmm4
movq %rbx, 0x28(%rsp)
jmp 0x3996
movss %xmm4, 0x10(%rsp)
incq %r12
xorps %xmm0, %xmm0
cvtsi2ss %r12, %xmm0
movss 0x4711(%rip), %xmm1     # 0x8078
divss %xmm0, %xmm1
movss %xmm1, 0x8(%rsp)
callq 0x72a9
cvtsd2ss %xmm0, %xmm0
movss 0x8(%rsp), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x398a
movq %rbx, 0x28(%rsp)
movss 0xc(%rsp), %xmm3
movss 0x10(%rsp), %xmm4
leaq (%r15,%r13,4), %r15
incq %rbx
decq %r13
cmpq %rbx, %rbp
jne 0x3909
xorps %xmm0, %xmm0
cvtsi2ss %r12, %xmm0
movss %xmm0, 0x3c(%rsp)
movq 0x40(%rsp), %r15
movq 0x48(%rsp), %r12
movq 0x30(%rsp), %r14
movq 0x58(%rsp), %rbx
movq 0x28(%rsp), %r13
jmp 0x39e5
movq %rbx, %r13
movaps %xmm3, %xmm4
jmp 0x39e5
xorl %r13d, %r13d
movss 0x468b(%rip), %xmm4     # 0x8070
movaps %xmm3, %xmm0
subss %xmm4, %xmm0
andps 0x464d(%rip), %xmm0     # 0x8040
movss 0x4679(%rip), %xmm1     # 0x8074
ucomiss %xmm0, %xmm1
ja 0x3a0d
ucomiss %xmm3, %xmm4
ja 0x3a53
movq %r13, %rbx
movaps %xmm4, %xmm3
jmp 0x3a53
movss 0x3c(%rsp), %xmm0
movss 0x18(%rsp), %xmm1
addss %xmm1, %xmm0
divss %xmm0, %xmm1
movss %xmm1, 0x18(%rsp)
movss %xmm4, 0x10(%rsp)
callq 0x72a9
movss 0x10(%rsp), %xmm1
movss 0xc(%rsp), %xmm3
cvtsd2ss %xmm0, %xmm0
movss 0x18(%rsp), %xmm2
ucomiss %xmm0, %xmm2
ja 0x3a53
movq %r13, %rbx
movaps %xmm1, %xmm3
movq %r15, %rdi
movq %r14, %rsi
movq %rbp, %rdx
movq %rbx, %rcx
movaps %xmm3, %xmm0
movl 0x14(%rsp), %r8d
callq 0x43c1
testl %eax, %eax
je 0x3c6d
cmpq %rbp, %rbx
movq %rbp, %r13
cmovgq %rbx, %r13
cmovlq %rbx, %rbp
movq %r14, %rdi
movq 0x20(%rsp), %rsi
movq %rbp, %rdx
movq %r13, %rcx
xorl %r8d, %r8d
callq 0x4028
movq 0x8(%r14), %rax
movq 0x18(%r14), %rdx
movq 0x28(%r14), %rcx
leaq 0x1(%rbp), %rsi
cmpq %rax, %rsi
jge 0x3b1f
movq %r13, %rdi
notq %rdi
leaq (%rdi,%rax,2), %rdi
imulq %r13, %rdi
movq %rdi, %r8
shrq $0x3f, %r8
addq %rdi, %r8
andq $-0x2, %r8
leaq (%rdx,%r8,2), %rdi
leaq (%rdi,%r13,4), %rdi
addq $0x4, %rdi
movq %rbp, %r8
notq %r8
leaq (%r8,%rax,2), %r8
imulq %rbp, %r8
movq %r8, %r9
shrq $0x3f, %r9
addq %r8, %r9
andq $-0x2, %r9
leaq (%rdx,%r9,2), %r8
movss (%rcx,%rsi,4), %xmm0
subss (%r8,%rsi,4), %xmm0
movss %xmm0, (%rcx,%rsi,4)
cmpq %r13, %rsi
jle 0x3b17
subss (%rdi), %xmm0
addq $0x4, %rdi
movss %xmm0, (%rcx,%rsi,4)
incq %rsi
cmpq %rsi, %rax
jne 0x3af5
testq %r13, %r13
jle 0x3b7e
leaq (%rdx,%r13,4), %rsi
leaq (%rdx,%rbp,4), %rdx
leaq -0x1(%rax), %rdi
leaq -0x4(,%rax,4), %r8
xorl %r9d, %r9d
movss (%rcx,%r9,4), %xmm0
cmpq %rbp, %r9
jge 0x3b58
subss (%rdx), %xmm0
movss %xmm0, (%rcx,%r9,4)
addq %r8, %rdx
movq %rdi, %r10
jmp 0x3b61
movq %r9, %r10
notq %r10
addq %rax, %r10
subss (%rsi), %xmm0
movss %xmm0, (%rcx,%r9,4)
leaq (%rsi,%r10,4), %rsi
incq %r9
decq %rdi
addq $-0x4, %r8
cmpq %r9, %r13
jne 0x3b3b
movq %r14, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x4122
movq 0x8(%r14), %rcx
movl $0x1, %eax
movq %rax, 0x50(%rsp)
cmpq $0x2, %rcx
jl 0x3c6d
leaq -0x1(%rcx), %rbx
movq %rcx, %rax
movabsq $0x7ffffffffffffffe, %rdx # imm = 0x7FFFFFFFFFFFFFFE
andq %rdx, %rax
addq $-0x2, %rcx
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
xorl %ecx, %ecx
movdqa 0x4440(%rip), %xmm1     # 0x8010
movdqa %xmm0, %xmm2
movdqa 0x4444(%rip), %xmm4     # 0x8020
pxor %xmm4, %xmm2
movdqa %xmm1, %xmm3
pxor %xmm4, %xmm3
movdqa %xmm3, %xmm4
pcmpgtd %xmm2, %xmm4
pcmpeqd %xmm2, %xmm3
pshufd $0xf5, %xmm3, %xmm3     # xmm3 = xmm3[1,1,3,3]
pand %xmm4, %xmm3
pshufd $0xf5, %xmm4, %xmm2     # xmm2 = xmm4[1,1,3,3]
por %xmm3, %xmm2
movd %xmm2, %edx
notl %edx
testb $0x1, %dl
je 0x3c15
movq %rcx, (%r12,%rcx,8)
pxor 0x4433(%rip), %xmm2     # 0x8050
pextrw $0x4, %xmm2, %edx
testb $0x1, %dl
je 0x3c30
leaq 0x1(%rcx), %rdx
movq %rdx, 0x8(%r12,%rcx,8)
addq $0x2, %rcx
paddq 0x43f4(%rip), %xmm1     # 0x8030
cmpq %rcx, %rax
jne 0x3bd0
movq %r12, %r14
movq %rbx, %rdi
callq 0x7349
testq %rax, %rax
je 0x3c5f
movq (%r14,%rax,8), %rcx
movq (%r14), %rdx
movq %rdx, (%r14,%rax,8)
movq %rcx, (%r14)
addq $0x8, %r14
decq %rbx
jne 0x3c44
movq 0x30(%rsp), %r14
movq 0x60(%rsp), %rdx
incq %rdx
movq 0x8(%r14), %rax
leaq -0x1(%rax), %rcx
cmpq %rcx, %rdx
jl 0x3782
movq 0x50(%rsp), %rax
testl %eax, %eax
movl 0x14(%rsp), %ebp
cmovel %eax, %ebp
jmp 0x3c9a
movl 0x14(%rsp), %ebp
movq 0x20(%rsp), %rax
cmpq $0x2, 0x10(%rax)
jg 0x33c5
testl %ebp, %ebp
leaq 0x4715(%rip), %rax      # 0x83c8
leaq 0x4723(%rip), %r13      # 0x83dd
cmoveq %rax, %r13
jmp 0x3cc7
leaq 0x4716(%rip), %r13      # 0x83dd
movq 0x18(%r14), %rax
movss 0x4(%rax), %xmm0
movq 0x20(%rsp), %rax
movq (%rax), %rax
movq (%rax), %r14
movss %xmm0, 0x10(%r14)
movq 0x8(%rax), %r15
movss %xmm0, 0x10(%r15)
movl $0x1, %edi
movl $0x20, %esi
callq 0x2160
movq %rax, %rbx
movq %r14, (%rax)
movq %r15, 0x8(%rax)
movq $-0x1, 0x18(%rax)
movq 0x40(%rsp), %r14
cmpl $0x0, 0x20(%r14)
je 0x3d20
movq %r13, %rdi
callq 0x20b0
movq 0x20(%rsp), %rdi
callq 0x461f
testq %r12, %r12
je 0x3d3e
cmpl $0x0, 0x38(%r14)
jne 0x3d3e
movq %r12, %rdi
callq 0x2040
movq %rbx, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x22ef
xorl %ebx, %ebx
jmp 0x3d3e
callq 0x22ca