// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
xorl %ecx, %ecx
leaq 0x5155(%rip), %r12      # 0xb7e0
movss 0x21e8(%rip), %xmm11    # 0x887c
xorps %xmm12, %xmm12
leaq 0x6b51(%rip), %rbp      # 0xd1f0
leaq (,%rcx,4), %rax
leaq (%rax,%rax,8), %rax
movq %rax, 0x30(%rsp)
movq %rcx, 0x20(%rsp)
imulq $0x57, %rcx, %rax
movq %rax, 0x28(%rsp)
xorl %r15d, %r15d
imull $0xc80, 0x4(%rbx), %eax # imm = 0xC80
movq 0x30(%rsp), %rcx
addl %r15d, %ecx
imull $0x7d00, %ecx, %ecx     # imm = 0x7D00
addl (%rbx), %ecx
leal (%rax,%rcx), %r14d
addl $0x36b00, %r14d         # imm = 0x36B00
xorl %r13d, %r13d
movl (%r13,%r12), %eax
leal (%rax,%rax,4), %eax
addl %r14d, %eax
movaps %xmm11, %xmm0
cmpl $0x2dc07f, %eax         # imm = 0x2DC07F
ja 0x6729
movq 0x6add(%rip), %rcx      # 0xd1e0
movl %eax, %eax
movss (%rcx,%rax,4), %xmm1
ucomiss %xmm12, %xmm1
movaps %xmm11, %xmm0
jbe 0x6729
movaps %xmm1, %xmm0
callq 0x10d0
xorps %xmm12, %xmm12
movss 0x2153(%rip), %xmm11    # 0x887c
movss %xmm0, (%rsp,%r13)
addq $0x4, %r13
cmpq $0x20, %r13
jne 0x66e6
leaq (%r15,%r15,2), %rax
addq 0x28(%rsp), %rax
movss 0x10(%rsp), %xmm0
movss 0x14(%rsp), %xmm1
movss 0x18(%rsp), %xmm4
movss 0x1c(%rsp), %xmm2
movaps %xmm0, %xmm3
maxss %xmm1, %xmm3
maxss %xmm4, %xmm0
maxss %xmm2, %xmm4
movss (%rsp), %xmm5
movss 0x4(%rsp), %xmm6
movaps %xmm5, %xmm7
maxss %xmm6, %xmm7
movaps %xmm7, %xmm8
maxss %xmm3, %xmm7
maxss %xmm4, %xmm3
movss 0x8(%rsp), %xmm9
movss 0xc(%rsp), %xmm10
maxss %xmm9, %xmm5
maxss %xmm10, %xmm9
maxss %xmm9, %xmm8
subss %xmm8, %xmm3
movss %xmm3, (%rbp,%rax,4)
maxss %xmm4, %xmm9
subss %xmm7, %xmm9
movss %xmm9, 0x4(%rbp,%rax,4)
maxss %xmm10, %xmm6
maxss %xmm2, %xmm1
maxss %xmm1, %xmm6
maxss %xmm0, %xmm5
subss %xmm5, %xmm6
movss %xmm6, 0x8(%rbp,%rax,4)
incq %r15
cmpq $0x1d, %r15
jne 0x66c1
movq 0x20(%rsp), %rcx
leaq 0x1(%rcx), %rax
testq %rcx, %rcx
movq %rax, %rcx
je 0x669f
xorps %xmm1, %xmm1
xorl %eax, %eax
addss (%rax,%rbp), %xmm1
addq $0x4, %rax
cmpq $0x2b8, %rax            # imm = 0x2B8
jne 0x6802
divss 0x2065(%rip), %xmm1     # 0x8880
xorps %xmm0, %xmm0
xorl %eax, %eax
movss (%rax,%rbp), %xmm2
subss %xmm1, %xmm2
mulss %xmm2, %xmm2
addss %xmm2, %xmm0
addq $0x4, %rax
cmpq $0x2b8, %rax            # imm = 0x2B8
jne 0x6820
divss 0x203f(%rip), %xmm0     # 0x8884
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jb 0x6853
sqrtss %xmm0, %xmm0
jmp 0x6858
callq 0x10e0
mulss 0x2028(%rip), %xmm0     # 0x8888
xorl %eax, %eax
movss (%rax,%rbp), %xmm1
divss %xmm0, %xmm1
movss %xmm1, (%rax,%rbp)
addq $0x4, %rax
cmpq $0x2b8, %rax            # imm = 0x2B8
jne 0x6862
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq