// File: /workspace/github_c_makefile_star2_O1/radforddc[P]icpc_siggen/icpc_fieldgen_opt.c
// Function: ev_relax_undep
int ev_relax_undep(MJD_Siggen_Setup *setup) {
  int    old = 1, new = 0, iter, r, z, bvn;
  float  grid = setup->xtal_grid;
  int    L  = lrint(setup->xtal_length/grid)+2;
  int    R  = lrint(setup->xtal_radius/grid)+2;
  double eps_sum, v_sum, save_dif, min;
  double dif, sum_dif=0, max_dif, bubble_volts=0;
  double ***v = setup->v, **eps_dr = setup->eps_dr, **eps_dz = setup->eps_dz;
  double ***dr = setup->dr, ***dz = setup->dz;
  double *s1 = setup->s1, *s2 = setup->s2;
  char   **undep = setup->undepleted;
  double e_over_E = 11.310; // e/epsilon; for 1 mm2, charge units 1e10 e/cm3, espilon = 16*epsilon0


  // save impurity value along passivated surface
  for (r = 1; r < R; r++)
    setup->impurity[0][r] = setup->impurity[1][r];

  /* initialise the undepleted array for use with bubble depletion */
  for (z = 1; z < L; z++) {
    for (r = 1; r < R; r++) {
      if (setup->point_type[z][r] >= INSIDE) undep[r][z] = 0;
    }
  }

  for (iter = 0; iter < setup->max_iterations; iter++) {

    double OR_fact = ((0.997 - 300.0/(L*R)) * (1.0 - 0.9/(double)(1+iter/6)));
    if (300.0/(L*R) > 0.5) OR_fact = (0.5 * (1.0 - 0.9/(double)(1+iter/6)));
    if (iter < 2) OR_fact = 0.0;

    old = new;
    new = 1 - new;
    sum_dif = 0;
    max_dif = 0;
    bubble_volts = 0;
    bvn = 0;

    if (setup->vacuum_gap > 0) {   // modify impurity value along passivated surface
      for (r = 1; r < R; r++)      //   due to surface charge induced by capacitance
        setup->impurity[1][r] = setup->impurity[0][r] -
          v[old][1][r] * 5.52e-4 * e_over_E * grid / setup->vacuum_gap;
    }

    /* start from z=1 and r=1 so that (z,r)=0 can be
       used for reflection symmetry around r=0 or z=0 */
    for (z = 1; z < L; z++) {
      /* manage r=0 reflection symmetry */
      setup->v[old][z][0] = setup->v[old][z][2];

      for (r = 1; r < R; r++) {
        if (setup->point_type[z][r] < INSIDE) continue;   // HV or point contact
        save_dif = v[old][z][r] - v[new][z][r];      // step difference from previous iteration

        if (setup->point_type[z][r] < DITCH) {       // normal bulk or passivated surface, no complications
          v_sum = (v[old][z+1][r] + v[old][z][r+1]*s1[r] +
                   v[old][z-1][r] + v[old][z][r-1]*s2[r]);
          if (r > 1) eps_sum = 4;
          else       eps_sum = 2 + s1[r] + s2[r];
        } else if (setup->point_type[z][r] == CONTACT_EDGE) {  // adjacent to the contact
          v_sum = (v[old][z+1][r]*dz[1][z][r] + v[old][z][r+1]*dr[1][z][r] +
                   v[old][z-1][r]*dz[0][z][r] + v[old][z][r-1]*dr[0][z][r]);
          eps_sum = dz[1][z][r] + dr[1][z][r] + dz[0][z][r] + dr[0][z][r];
        } else if (setup->point_type[z][r] >= DITCH) {  // in or adjacent to the ditch
          v_sum = (v[old][z+1][r]*eps_dz[z  ][r] + v[old][z][r+1]*eps_dr[z][r  ]*s1[r] +
                   v[old][z-1][r]*eps_dz[z-1][r] + v[old][z][r-1]*eps_dr[z][r-1]*s2[r]);
          eps_sum = (eps_dz[z][r]   + eps_dr[z][r]  *s1[r] +
                     eps_dz[z-1][r] + eps_dr[z][r-1]*s2[r]);
        }

        // calculate the interpolated mean potential and the effect of the space charge
        min = fminf(fminf(v[old][z+1][r], v[old][z][r+1]),
                    fminf(v[old][z-1][r], v[old][z][r-1]));
        v[new][z][r] = v_sum / eps_sum + setup->impurity[z][r];

        undep[r][z] /= 2;
        if (v[new][z][r] <= 0) {
          v[new][z][r] = 0;
          undep[r][z] = 4;  // do not do over-relaxation for 3 iterations
        } else if (v[new][z][r] <= min) {
          if (bubble_volts == 0) bubble_volts = min + 0.2*grid*grid; // finer grids require smaller increment here
          v[new][z][r] = bubble_volts;
          bvn++;
          undep[r][z] = 8;  // do not do over-relaxation for 4 iterations
        }

        // calculate difference from last iteration, for convergence check
        dif = v[old][z][r] - v[new][z][r];
        if (dif < 0) dif = -dif;
        sum_dif += dif;
        if (max_dif < dif) max_dif = dif;
        // do over-relaxation
        if (!undep[r][z])  v[new][z][r] += OR_fact*save_dif;
      }
    }

    // report results for some iterations
    if (iter < 10 || (iter < 600 && iter%100 == 0) || iter%1000 == 0) {
      if (0) {
        printf("%5d %d %d %.10f %.10f\n", iter, old, new, max_dif, sum_dif/(L-2)/(R-2));
      } else {
        printf("%5d %d %d %.10f %.10f ; %.10f %.10f bubble %.2f %d\n",
               iter, old, new, max_dif, sum_dif/(L-2)/(R-2),
               v[new][L/2][R/2], v[new][L/3][R/3], bubble_volts, bvn);
      }
    }
    // check for convergence
    if (max_dif < 0.00000008) break;
 
  }
  printf(">> %d %.16f\n\n", iter, sum_dif);

  setup->bubble_volts = bubble_volts;
  setup->fully_depleted = 1;
  for (r=1; r<R; r++) {
    for (z=1; z<L; z++) {
      if (setup->point_type[z][r] < INSIDE) {
        undep[r][z] = ' ';
      } else if (undep[r][z] == 0) {
        undep[r][z] = '.';
      } else {
        if (undep[r][z] > 4) undep[r][z] = 'B';  // identifies pinch-off
        else undep[r][z] = '*';
        setup->fully_depleted = 0;
      }
    }
  }

  if (setup->vacuum_gap > 0) {   // restore impurity value along passivated surface
    for (r = 1; r < R; r++)
      setup->impurity[1][r] = setup->impurity[0][r];
  }

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rdi, %rbx
movss 0x4(%rdi), %xmm0
movss 0x54(%rdi), %xmm1
movss %xmm1, 0x30(%rsp)
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x1100
movq %rax, 0x28(%rsp)
leal 0x2(%rax), %r12d
movss 0x8(%rbx), %xmm0
divss 0x30(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x1100
leal 0x2(%rax), %edi
movq 0x3f8(%rbx), %rcx
movq %rcx, 0xa8(%rsp)
movq 0x400(%rbx), %rcx
movq %rcx, 0xa0(%rsp)
movq 0x418(%rbx), %rcx
movq %rcx, 0x18(%rsp)
movq 0x420(%rbx), %rcx
movq %rcx, 0x58(%rsp)
movq 0x438(%rbx), %r14
movl %edi, %r8d
movq %rax, 0x10(%rsp)
cmpl $0x7ffffffd, %eax       # imm = 0x7FFFFFFD
ja 0x5b5c
movq 0x408(%rbx), %rdx
movq (%rdx), %rcx
movq 0x8(%rdx), %rdx
movl $0x1, %esi
movsd (%rdx,%rsi,8), %xmm0
movsd %xmm0, (%rcx,%rsi,8)
incq %rsi
cmpq %rsi, %r8
jne 0x5b4a
movl %r12d, %eax
cmpl $0x7ffffffd, 0x28(%rsp) # imm = 0x7FFFFFFD
ja 0x5ba6
movl $0x1, %ecx
cmpl $0x7ffffffd, 0x10(%rsp) # imm = 0x7FFFFFFD
ja 0x5b9e
movl $0x1, %edx
movq 0x430(%rbx), %rsi
movq (%rsi,%rcx,8), %rsi
cmpb $0x2, (%rsi,%rdx)
jl 0x5b96
movq (%r14,%rdx,8), %rsi
movb $0x0, (%rsi,%rcx)
incq %rdx
cmpq %rdx, %r8
jne 0x5b7d
incq %rcx
cmpq %rax, %rcx
jne 0x5b6e
cmpl $0x0, 0x78(%rbx)
movq %r8, 0x48(%rsp)
movq %rax, 0x50(%rsp)
jle 0x633b
movl %edi, %ecx
imull %r12d, %ecx
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
movsd 0x34d9(%rip), %xmm1     # 0x90a8
divsd %xmm0, %xmm1
movsd 0x34d5(%rip), %xmm0     # 0x90b0
subsd %xmm1, %xmm0
movsd 0x3451(%rip), %xmm2     # 0x9038
movapd %xmm2, %xmm3
cmpltsd %xmm1, %xmm3
movapd %xmm3, %xmm1
andnpd %xmm0, %xmm1
andpd %xmm2, %xmm3
orpd %xmm1, %xmm3
movapd %xmm3, 0xb0(%rsp)
xorps %xmm1, %xmm1
cvtss2sd 0x30(%rsp), %xmm1
movsd 0x345d(%rip), %xmm11    # 0x9078
mulsd %xmm1, %xmm11
xorps %xmm0, %xmm0
cvtsi2sdl 0x28(%rsp), %xmm0
movsd %xmm0, 0x88(%rsp)
xorps %xmm0, %xmm0
cvtsi2sdl 0x10(%rsp), %xmm0
movsd %xmm0, 0x80(%rsp)
movl %r12d, %ecx
shrl $0x1f, %ecx
addl %r12d, %ecx
sarl %ecx
movslq %ecx, %rax
movq %rax, 0x78(%rsp)
movl %edi, %ecx
shrl $0x1f, %ecx
addl %edi, %ecx
sarl %ecx
movslq %ecx, %rax
movq %rax, 0x70(%rsp)
movslq %r12d, %rcx
imulq $0x55555556, %rcx, %rcx # imm = 0x55555556
movq %rcx, %rdx
shrq $0x3f, %rdx
shrq $0x20, %rcx
addl %edx, %ecx
movslq %ecx, %rax
movq %rax, 0x68(%rsp)
movslq %edi, %rax
imulq $0x55555556, %rax, %rax # imm = 0x55555556
movq %rax, %rcx
shrq $0x3f, %rcx
shrq $0x20, %rax
addl %ecx, %eax
cltq
movq %rax, 0x60(%rsp)
leaq -0x1(%r8), %r12
xorl %edx, %edx
movsd 0x3414(%rip), %xmm12    # 0x90c8
movsd 0x3413(%rip), %xmm13    # 0x90d0
xorpd %xmm14, %xmm14
movsd %xmm1, 0x98(%rsp)
mulsd %xmm1, %xmm11
movapd 0x3467(%rip), %xmm15    # 0x9140
movsd 0x33de(%rip), %xmm8     # 0x90c0
movsd 0x33ad(%rip), %xmm9     # 0x9098
xorl %esi, %esi
movsd %xmm11, 0x90(%rsp)
movl %esi, %eax
movl $0xaaaaaaab, %ecx       # imm = 0xAAAAAAAB
imulq %rcx, %rax
shrq $0x22, %rax
incl %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd 0x33a1(%rip), %xmm1     # 0x90b8
divsd %xmm0, %xmm1
addsd 0x3335(%rip), %xmm1     # 0x9058
xorpd %xmm0, %xmm0
movl %esi, 0xc(%rsp)
cmpl $0x2, %esi
jb 0x5d3d
mulsd 0xb0(%rsp), %xmm1
movapd %xmm1, %xmm0
movss 0x50(%rbx), %xmm1
ucomiss 0x33d7(%rip), %xmm1     # 0x9120
jbe 0x5da8
cmpl $0x7ffffffd, 0x10(%rsp) # imm = 0x7FFFFFFD
ja 0x5da8
movq 0x408(%rbx), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
movl %edx, %esi
movq 0x3e0(%rbx,%rsi,8), %rsi
movq 0x8(%rsi), %rsi
cvtss2sd %xmm1, %xmm1
movl $0x1, %edi
movsd (%rsi,%rdi,8), %xmm2
mulsd %xmm8, %xmm2
mulsd %xmm9, %xmm2
mulsd 0x98(%rsp), %xmm2
divsd %xmm1, %xmm2
addsd (%rax,%rdi,8), %xmm2
movsd %xmm2, (%rcx,%rdi,8)
incq %rdi
cmpq %rdi, %r8
jne 0x5d7a
movl $0x1, %eax
subl %edx, %eax
movl %eax, 0x24(%rsp)
movl %eax, %eax
cmpl $0x7ffffffd, 0x28(%rsp) # imm = 0x7FFFFFFD
ja 0x61e9
movl %edx, %ecx
xorps %xmm1, %xmm1
movaps %xmm1, 0x30(%rsp)
xorl %r8d, %r8d
movl $0x1, %esi
xorpd %xmm10, %xmm10
movq 0x3e0(%rbx,%rcx,8), %rdi
movq (%rdi,%rsi,8), %rdi
movsd 0x10(%rdi), %xmm2
movsd %xmm2, (%rdi)
cmpl $0x7ffffffd, 0x10(%rsp) # imm = 0x7FFFFFFD
ja 0x61d2
xorl %edi, %edi
movq %rdi, %r9
incq %rdi
movq 0x430(%rbx), %r10
movq (%r10,%rsi,8), %r10
movb 0x1(%r10,%r9), %r15b
cmpb $0x2, %r15b
jge 0x5e24
movapd %xmm1, %xmm5
jmp 0x61c3
movq 0x3e0(%rbx,%rcx,8), %r11
movq (%r11,%rsi,8), %r10
cmpb $0x4, %r15b
jg 0x5e93
movq 0x8(%r11,%rsi,8), %r15
movq 0x18(%rsp), %r13
movsd 0x8(%r13,%r9,8), %xmm3
movsd 0x10(%r10,%r9,8), %xmm5
mulsd %xmm3, %xmm5
addsd 0x8(%r15,%r9,8), %xmm5
movq -0x8(%r11,%rsi,8), %r15
addsd 0x8(%r15,%r9,8), %xmm5
movq 0x58(%rsp), %r15
movsd 0x8(%r15,%r9,8), %xmm2
movsd (%r10,%r9,8), %xmm4
mulsd %xmm2, %xmm4
addsd %xmm5, %xmm4
cmpq $0x1, %rdi
jbe 0x5f32
movapd %xmm12, %xmm3
jmp 0x5ffa
movq 0x8(%r11,%rsi,8), %rbp
movsd 0x8(%rbp,%r9,8), %xmm2
cmpb $0x7, %r15b
jne 0x5f40
movq 0x1468(%rbx), %r15
movq (%r15,%rsi,8), %r15
movsd 0x8(%r15,%r9,8), %xmm3
movq 0x1450(%rbx), %r15
movq 0x1458(%rbx), %rbp
movq (%rbp,%rsi,8), %rbp
movsd 0x8(%rbp,%r9,8), %xmm5
movsd 0x10(%r10,%r9,8), %xmm4
mulsd %xmm5, %xmm4
mulsd %xmm3, %xmm2
addsd %xmm4, %xmm2
movq -0x8(%r11,%rsi,8), %rbp
movq 0x1460(%rbx), %r13
movq (%r13,%rsi,8), %r13
movsd 0x8(%r13,%r9,8), %xmm6
movsd 0x8(%rbp,%r9,8), %xmm7
mulsd %xmm6, %xmm7
addsd %xmm2, %xmm7
movq (%r15,%rsi,8), %r15
movsd 0x8(%r15,%r9,8), %xmm2
movsd (%r10,%r9,8), %xmm4
mulsd %xmm2, %xmm4
addsd %xmm7, %xmm4
addsd %xmm5, %xmm3
addsd %xmm6, %xmm3
jmp 0x5f37
addsd %xmm13, %xmm3
addsd %xmm2, %xmm3
jmp 0x5ffa
movq 0xa0(%rsp), %r13
movq -0x8(%r13,%rsi,8), %r15
movq (%r13,%rsi,8), %r13
movsd 0x8(%r13,%r9,8), %xmm6
movq 0xa8(%rsp), %r13
movq (%r13,%rsi,8), %r13
movsd (%r13,%r9,8), %xmm3
movsd 0x8(%r13,%r9,8), %xmm5
movsd 0x10(%r10,%r9,8), %xmm4
mulsd %xmm5, %xmm4
movq 0x18(%rsp), %r13
movsd 0x8(%r13,%r9,8), %xmm7
mulsd %xmm7, %xmm4
mulsd %xmm6, %xmm2
addsd %xmm4, %xmm2
movq -0x8(%r11,%rsi,8), %r13
movsd 0x8(%r15,%r9,8), %xmm8
movsd 0x8(%r13,%r9,8), %xmm9
mulsd %xmm8, %xmm9
addsd %xmm2, %xmm9
movsd (%r10,%r9,8), %xmm4
mulsd %xmm3, %xmm4
movq 0x58(%rsp), %r15
movsd 0x8(%r15,%r9,8), %xmm2
mulsd %xmm2, %xmm4
addsd %xmm9, %xmm4
movsd 0x30bc(%rip), %xmm9     # 0x9098
mulsd %xmm7, %xmm5
addsd %xmm6, %xmm5
addsd %xmm8, %xmm5
movsd 0x30ce(%rip), %xmm8     # 0x90c0
mulsd %xmm2, %xmm3
addsd %xmm5, %xmm3
movsd 0x8(%r10,%r9,8), %xmm2
movq 0x3e0(%rbx,%rax,8), %r15
movq (%r15,%rsi,8), %r15
subsd 0x8(%r15,%r9,8), %xmm2
movq 0x8(%r11,%rsi,8), %r13
xorps %xmm6, %xmm6
cvtsd2ss 0x8(%r13,%r9,8), %xmm6
divsd %xmm3, %xmm4
xorps %xmm7, %xmm7
cvtsd2ss 0x10(%r10,%r9,8), %xmm7
movq -0x8(%r11,%rsi,8), %r11
xorps %xmm5, %xmm5
cvtsd2ss 0x8(%r11,%r9,8), %xmm5
xorps %xmm3, %xmm3
cvtsd2ss (%r10,%r9,8), %xmm3
movq 0x408(%rbx), %r10
movq (%r10,%rsi,8), %r10
addsd 0x8(%r10,%r9,8), %xmm4
movsd %xmm4, 0x8(%r15,%r9,8)
movq 0x8(%r14,%r9,8), %r10
movb (%r10,%rsi), %r11b
movl %r11d, %ebp
shrb $0x7, %bpl
addb %r11b, %bpl
sarb %bpl
movb %bpl, (%r10,%rsi)
movq 0x3e0(%rbx,%rax,8), %r10
movq (%r10,%rsi,8), %r10
movsd 0x8(%r10,%r9,8), %xmm4
ucomisd %xmm4, %xmm14
jae 0x610b
movaps %xmm6, %xmm8
cmpunordss %xmm6, %xmm8
movaps %xmm8, %xmm9
andps %xmm7, %xmm9
minss %xmm6, %xmm7
andnps %xmm7, %xmm8
orps %xmm9, %xmm8
movaps %xmm5, %xmm6
cmpunordss %xmm5, %xmm6
movaps %xmm6, %xmm7
andps %xmm3, %xmm7
minss %xmm5, %xmm3
andnps %xmm3, %xmm6
orps %xmm7, %xmm6
movaps %xmm6, %xmm3
minss %xmm8, %xmm3
cmpunordss %xmm8, %xmm8
movaps %xmm8, %xmm5
andps %xmm6, %xmm5
andnps %xmm3, %xmm8
orps %xmm5, %xmm8
xorps %xmm3, %xmm3
cvtss2sd %xmm8, %xmm3
ucomisd %xmm4, %xmm3
jae 0x6119
movsd 0x2fc0(%rip), %xmm8     # 0x90c0
movsd 0x2f8f(%rip), %xmm9     # 0x9098
jmp 0x6168
movq $0x0, 0x8(%r10,%r9,8)
movb $0x4, %r10b
jmp 0x615f
addsd %xmm11, %xmm3
movapd 0x30(%rsp), %xmm5
movapd %xmm5, %xmm4
cmpeqsd %xmm14, %xmm4
andpd %xmm4, %xmm3
andnpd %xmm5, %xmm4
orpd %xmm3, %xmm4
movlpd %xmm4, 0x8(%r10,%r9,8)
incl %r8d
movb $0x8, %r10b
movapd %xmm4, 0x30(%rsp)
movsd 0x2f6a(%rip), %xmm8     # 0x90c0
movsd 0x2f39(%rip), %xmm9     # 0x9098
movq 0x8(%r14,%r9,8), %r11
movb %r10b, (%r11,%rsi)
movq 0x3e0(%rbx,%rcx,8), %r10
movq (%r10,%rsi,8), %r10
movsd 0x8(%r10,%r9,8), %xmm4
movq 0x3e0(%rbx,%rax,8), %r10
movq (%r10,%rsi,8), %r10
movsd 0x8(%r10,%r9,8), %xmm3
subsd %xmm3, %xmm4
movapd %xmm4, %xmm5
xorpd %xmm15, %xmm5
maxsd %xmm4, %xmm5
addsd %xmm5, %xmm10
maxsd %xmm1, %xmm5
movq 0x8(%r14,%r9,8), %r11
cmpb $0x0, (%r11,%rsi)
jne 0x61c3
mulsd %xmm0, %xmm2
addsd %xmm3, %xmm2
movsd %xmm2, 0x8(%r10,%r9,8)
movapd %xmm5, %xmm1
cmpq %rdi, %r12
jne 0x5dff
jmp 0x61d5
movaps %xmm1, %xmm5
incq %rsi
movapd %xmm5, %xmm1
cmpq 0x50(%rsp), %rsi
jne 0x5dda
jmp 0x61ff
xorl %r8d, %r8d
xorpd %xmm10, %xmm10
xorpd %xmm5, %xmm5
xorpd %xmm0, %xmm0
movapd %xmm0, 0x30(%rsp)
cmpl $0xa, 0xc(%rsp)
jae 0x62a9
movapd %xmm10, %xmm1
divsd 0x88(%rsp), %xmm1
divsd 0x80(%rsp), %xmm1
movq 0x3e0(%rbx,%rax,8), %rax
movq 0x78(%rsp), %rcx
movq (%rax,%rcx,8), %rcx
movq 0x70(%rsp), %rsi
movsd (%rcx,%rsi,8), %xmm2
movq 0x68(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x60(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm3
leaq 0x3a47(%rip), %rdi      # 0x9c9d
movl 0xc(%rsp), %esi
movl 0x24(%rsp), %ecx
movapd %xmm5, %xmm0
movapd %xmm10, 0xd0(%rsp)
movapd 0x30(%rsp), %xmm4
movb $0x5, %al
movapd %xmm5, 0xc0(%rsp)
callq 0x10f0
movapd 0xc0(%rsp), %xmm5
movapd 0xd0(%rsp), %xmm10
movsd 0x2dfa(%rip), %xmm9     # 0x9098
movsd 0x2e19(%rip), %xmm8     # 0x90c0
jmp 0x62e7
movl 0xc(%rsp), %edi
cmpl $0x258, %edi            # imm = 0x258
setb %cl
imull $0xc28f5c29, %edi, %esi # imm = 0xC28F5C29
rorl $0x2, %esi
cmpl $0x28f5c29, %esi        # imm = 0x28F5C29
setb %sil
imull $0x26e978d5, %edi, %edi # imm = 0x26E978D5
rorl $0x3, %edi
cmpl $0x418938, %edi         # imm = 0x418938
jb 0x620a
andb %sil, %cl
jne 0x620a
movsd 0x2df1(%rip), %xmm0     # 0x90e0
ucomisd %xmm5, %xmm0
ja 0x634d
movl 0xc(%rsp), %esi
incl %esi
movl 0x24(%rsp), %eax
movl %eax, %edx
cmpl 0x78(%rbx), %esi
movq 0x48(%rsp), %r8
movsd 0x90(%rsp), %xmm11
movsd 0x2dac(%rip), %xmm12    # 0x90c8
movsd 0x2dab(%rip), %xmm13    # 0x90d0
xorpd %xmm14, %xmm14
movapd 0x2e0d(%rip), %xmm15    # 0x9140
jl 0x5cf7
jmp 0x6351
xorps %xmm0, %xmm0
movss %xmm0, 0x18(%rsp)
xorpd %xmm10, %xmm10
xorl %esi, %esi
jmp 0x6360
movl 0xc(%rsp), %esi
xorps %xmm0, %xmm0
cvtsd2ss 0x30(%rsp), %xmm0
movss %xmm0, 0x18(%rsp)
leaq 0x396a(%rip), %rdi      # 0x9cd1
movapd %xmm10, %xmm0
movb $0x1, %al
callq 0x10f0
movss 0x18(%rsp), %xmm0
movss %xmm0, 0x444(%rbx)
movl $0x1, 0x440(%rbx)
cmpl $0x7ffffffd, 0x10(%rsp) # imm = 0x7FFFFFFD
movq 0x48(%rsp), %r8
movq 0x28(%rsp), %r9
movq 0x50(%rsp), %r10
ja 0x6414
movl $0x1, %eax
movl $0x42, %ecx
cmpl $0x7ffffffd, %r9d       # imm = 0x7FFFFFFD
ja 0x640c
movl $0x1, %edx
movq 0x430(%rbx), %rsi
movq (%rsi,%rdx,8), %rsi
cmpb $0x1, (%rsi,%rax)
jg 0x63d7
movq (%r14,%rax,8), %rsi
movb $0x20, (%rsi,%rdx)
jmp 0x6404
movq (%r14,%rax,8), %rsi
movb (%rsi,%rdx), %dil
testb %dil, %dil
je 0x6400
cmpb $0x5, %dil
movl $0x2a, %edi
cmovgel %ecx, %edi
movb %dil, (%rsi,%rdx)
movl $0x0, 0x440(%rbx)
jmp 0x6404
movb $0x2e, (%rsi,%rdx)
incq %rdx
cmpq %rdx, %r10
jne 0x63bc
incq %rax
cmpq %r8, %rax
jne 0x63ae
movss 0x50(%rbx), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x6450
cmpl $0x7ffffffd, 0x10(%rsp) # imm = 0x7FFFFFFD
ja 0x6450
movq 0x408(%rbx), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
movl $0x1, %edx
movsd (%rax,%rdx,8), %xmm0
movsd %xmm0, (%rcx,%rdx,8)
incq %rdx
cmpq %rdx, %r8
jne 0x643e
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq