// File: /workspace/github_c_makefile_star2_O0/pavel-demin[P]ft8d-c/ft8d.c
// Function: process
void process(sync_t *cand)
{
  int i, j, k, l, m;
  real_t s[8], d, sum, avg, sig;

  for(i = 0; i < 2; ++i)
  {
    for(j = 0; j < 29; ++j)
    {
      k = cand->j * NFFT + cand->i + (i * 36 + j + 7) * NSSY * NFFT;

      for(l = 0; l < 8; ++l)
      {
        m = k + graymap[l] * NFOS;
        s[l] = (m >= 0 && m < NSYM * NFFT) ? map[m] > 0 ? log10f(map[m]) : -10 : -10;
      }

      k = i * 87 + j * 3;

      llr[k + 0] = max(s[4], s[5], s[6], s[7]) - max(s[0], s[1], s[2], s[3]);
      llr[k + 1] = max(s[2], s[3], s[6], s[7]) - max(s[0], s[1], s[4], s[5]);
      llr[k + 2] = max(s[1], s[3], s[5], s[7]) - max(s[0], s[2], s[4], s[6]);
    }
  }

  sum = 0;
  for(i = 0; i < N; ++i)
  {
    sum += llr[i];
  }
  avg = sum / N;

  sum = 0;
  for(i = 0; i < N; ++i)
  {
    d = llr[i] - avg;
    sum += d * d;
  }
  sig = sqrtf(sum / (N - 1)) / 4;

  for(i = 0; i < N; ++i)
  {
    llr[i] /= sig;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
cmpl $0x2, -0xc(%rbp)
jge 0x168ec
movl $0x0, -0x10(%rbp)
cmpl $0x1d, -0x10(%rbp)
jge 0x168dc
movq -0x8(%rbp), %rax
imull $0xc80, 0x4(%rax), %eax # imm = 0xC80
movq -0x8(%rbp), %rcx
addl (%rcx), %eax
imull $0x24, -0xc(%rbp), %ecx
addl -0x10(%rbp), %ecx
addl $0x7, %ecx
imull $0xa, %ecx, %ecx
imull $0xc80, %ecx, %ecx      # imm = 0xC80
addl %ecx, %eax
movl %eax, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
cmpl $0x8, -0x18(%rbp)
jge 0x167b9
movl -0x14(%rbp), %eax
movslq -0x18(%rbp), %rdx
leaq 0x50ca(%rip), %rcx      # 0x1b7f0
imull $0x5, (%rcx,%rdx,4), %ecx
addl %ecx, %eax
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jl 0x1678d
cmpl $0x2dc080, -0x1c(%rbp)  # imm = 0x2DC080
jge 0x1678d
movq 0x6aab(%rip), %rax      # 0x1d1f0
movslq -0x1c(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x16772
movq 0x6a93(%rip), %rax      # 0x1d1f0
movslq -0x1c(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
callq 0x10d0
movss %xmm0, -0x54(%rbp)
jmp 0x16781
movss 0x244e(%rip), %xmm0     # 0x18bc8
movss %xmm0, -0x54(%rbp)
jmp 0x16781
movss -0x54(%rbp), %xmm0
movss %xmm0, -0x58(%rbp)
jmp 0x1679c
movss 0x2433(%rip), %xmm0     # 0x18bc8
movss %xmm0, -0x58(%rbp)
jmp 0x1679c
movss -0x58(%rbp), %xmm0
movslq -0x18(%rbp), %rax
movss %xmm0, -0x40(%rbp,%rax,4)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x1670e
imull $0x57, -0xc(%rbp), %eax
imull $0x3, -0x10(%rbp), %ecx
addl %ecx, %eax
movl %eax, -0x14(%rbp)
movss -0x30(%rbp), %xmm0
movss -0x2c(%rbp), %xmm1
movss -0x28(%rbp), %xmm2
movss -0x24(%rbp), %xmm3
callq 0x16610
movss %xmm0, -0x64(%rbp)
movss -0x40(%rbp), %xmm0
movss -0x3c(%rbp), %xmm1
movss -0x38(%rbp), %xmm2
movss -0x34(%rbp), %xmm3
callq 0x16610
movaps %xmm0, %xmm1
movss -0x64(%rbp), %xmm0
subss %xmm1, %xmm0
movl -0x14(%rbp), %eax
addl $0x0, %eax
movslq %eax, %rcx
leaq 0x69e7(%rip), %rax      # 0x1d200
movss %xmm0, (%rax,%rcx,4)
movss -0x38(%rbp), %xmm0
movss -0x34(%rbp), %xmm1
movss -0x28(%rbp), %xmm2
movss -0x24(%rbp), %xmm3
callq 0x16610
movss %xmm0, -0x60(%rbp)
movss -0x40(%rbp), %xmm0
movss -0x3c(%rbp), %xmm1
movss -0x30(%rbp), %xmm2
movss -0x2c(%rbp), %xmm3
callq 0x16610
movaps %xmm0, %xmm1
movss -0x60(%rbp), %xmm0
subss %xmm1, %xmm0
movl -0x14(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rcx
leaq 0x698f(%rip), %rax      # 0x1d200
movss %xmm0, (%rax,%rcx,4)
movss -0x3c(%rbp), %xmm0
movss -0x34(%rbp), %xmm1
movss -0x2c(%rbp), %xmm2
movss -0x24(%rbp), %xmm3
callq 0x16610
movss %xmm0, -0x5c(%rbp)
movss -0x40(%rbp), %xmm0
movss -0x38(%rbp), %xmm1
movss -0x30(%rbp), %xmm2
movss -0x28(%rbp), %xmm3
callq 0x16610
movaps %xmm0, %xmm1
movss -0x5c(%rbp), %xmm0
subss %xmm1, %xmm0
movl -0x14(%rbp), %eax
addl $0x2, %eax
movslq %eax, %rcx
leaq 0x6937(%rip), %rax      # 0x1d200
movss %xmm0, (%rax,%rcx,4)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x166d4
jmp 0x168de
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x166c3
xorps %xmm0, %xmm0
movss %xmm0, -0x48(%rbp)
movl $0x0, -0xc(%rbp)
cmpl $0xae, -0xc(%rbp)
jge 0x16929
movslq -0xc(%rbp), %rcx
leaq 0x68f1(%rip), %rax      # 0x1d200
movss (%rax,%rcx,4), %xmm0
addss -0x48(%rbp), %xmm0
movss %xmm0, -0x48(%rbp)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x168fb
movss -0x48(%rbp), %xmm0
movss 0x228a(%rip), %xmm1     # 0x18bc0
divss %xmm1, %xmm0
movss %xmm0, -0x4c(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x48(%rbp)
movl $0x0, -0xc(%rbp)
cmpl $0xae, -0xc(%rbp)
jge 0x16998
movslq -0xc(%rbp), %rcx
leaq 0x689e(%rip), %rax      # 0x1d200
movss (%rax,%rcx,4), %xmm0
subss -0x4c(%rbp), %xmm0
movss %xmm0, -0x44(%rbp)
movss -0x44(%rbp), %xmm0
movss -0x44(%rbp), %xmm2
movss -0x48(%rbp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x48(%rbp)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x1694e
movss -0x48(%rbp), %xmm0
movss 0x221f(%rip), %xmm1     # 0x18bc4
divss %xmm1, %xmm0
callq 0x10f0
movss 0x167a(%rip), %xmm1     # 0x18030
divss %xmm1, %xmm0
movss %xmm0, -0x50(%rbp)
movl $0x0, -0xc(%rbp)
cmpl $0xae, -0xc(%rbp)
jge 0x169ff
movss -0x50(%rbp), %xmm1
movslq -0xc(%rbp), %rcx
leaq 0x6821(%rip), %rax      # 0x1d200
movss (%rax,%rcx,4), %xmm0
divss %xmm1, %xmm0
leaq 0x6811(%rip), %rax      # 0x1d200
movss %xmm0, (%rax,%rcx,4)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x169c6
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)