user: What is the c source code of the assembly code below:

```asm
<convolved_fit>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x118,%rsp
  mov    0x150(%rsp),%eax
  mov    %rsi,(%rsp)
  mov    %edx,0x8(%rsp)
  mov    %r9d,0xcc(%rsp)
  mov    %eax,0xf8(%rsp)
  movsd  %xmm0,0x78(%rsp)
  movsd  %xmm1,0x18(%rsp)
  test   %eax,%eax
  je     L341
  pxor   %xmm4,%xmm4
  sete   %dl
  ucomisd %xmm4,%xmm0
  setnp  %al
  cmovne %edx,%eax
  test   %al,%al
  jne    L341
  mov    %rdi,%rbx
  mov    %rcx,%r14
  mov    %r8,%r13
  xor    %r12d,%r12d
  lea    0x0(,%r9,8),%ebp
  mov    %ebp,%edi
  call   <malloc@plt>
  mov    %ebp,%edi
  mov    %rax,0x58(%rsp)
  call   <malloc@plt>
  mov    $0x8008,%edi
  mov    %rax,0x60(%rsp)
  call   <malloc@plt>
  mov    %rax,%r15
  mov    %rax,%rbp
  nopl   0x0(%rax)
L124:
  pxor   %xmm0,%xmm0
  movsd  D7(%rip),%xmm1
  add    $0x8,%rbp
  cvtsi2sd %r12d,%xmm0
  mulsd  D1(%rip),%xmm0
  add    $0x1,%r12d
  subsd  D0(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  mulsd  %xmm1,%xmm0
  call   <exp@plt>
  divsd  D27(%rip),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  cmp    $0x1001,%r12d
  jne    L124
  mov    0xf8(%rsp),%edx
  test   %edx,%edx
  jle    L166
  movl   $0x0,0xc8(%rsp)
  movslq 0x8(%rsp),%rax
  mov    %rax,%rsi
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  lea    -0x10(%rbx,%rax,1),%rdi
  add    %rbx,%rax
  lea    (%rbx,%rdx,1),%rcx
  mov    %rdi,0xe0(%rsp)
  lea    -0x1(%rsi),%edi
  mov    %rcx,0xa8(%rsp)
  mov    (%rsp),%rcx
  mov    %rax,0x100(%rsp)
  movslq %edi,%rax
  shl    $0x3,%rax
  add    %rcx,%rdx
  mov    %edi,0xfc(%rsp)
  mov    %rdx,0xd8(%rsp)
  lea    -0x8(%rax),%rdx
  lea    (%rcx,%rdx,1),%rdi
  mov    %rdi,0xe8(%rsp)
  lea    (%rbx,%rdx,1),%rdi
  lea    -0x10(%rcx,%rax,1),%rdx
  lea    -0x2(%rsi),%eax
  mov    %rdi,0xf0(%rsp)
  shl    $0x3,%rax
  sub    %rax,%rdx
  mov    $0x8,%eax
  sub    %r14,%rax
  mov    %rdx,0xc0(%rsp)
  mov    %rax,0x108(%rsp)
  mov    0x60(%rsp),%rax
  add    $0x8,%rax
  mov    %rax,0xd0(%rsp)
L203:
  mov    0xa8(%rsp),%rbx
  mov    0xd8(%rsp),%rax
  mov    $0xa,%edi
  movsd  D47(%rip),%xmm5
  addsd  (%rbx),%xmm5
  movsd  (%rax),%xmm0
  movsd  %xmm5,0x10(%rsp)
  call   <pow@plt>
  mov    0xe0(%rsp),%rax
  mov    0x58(%rsp),%rsi
  movapd %xmm0,%xmm1
  movsd  (%rbx),%xmm0
  mov    0xcc(%rsp),%edi
  subsd  (%rax),%xmm0
  movq   $0x0,(%rsi)
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,0x38(%rsp)
  cmp    $0x1,%edi
  jle    L30
  mov    %r14,%rax
  mov    %edi,%r10d
  xor    %r9d,%r9d
  mov    $0x1,%edx
  mov    0x108(%rsp),%r8
  jmp    L280
L426:
  pxor   %xmm3,%xmm3
  ucomisd (%rax),%xmm3
  jp     L112
  cmove  %edx,%r9d
L112:
  add    $0x1,%edx
  add    $0x8,%rax
  cmp    %edx,%edi
  je     L77
L280:
  lea    (%rsi,%rax,1),%rcx
  pxor   %xmm5,%xmm5
  movq   $0x0,(%rcx,%r8,1)
  ucomisd 0x8(%rax),%xmm5
  jp     L426
  jne    L426
  ucomisd (%rax),%xmm5
  jp     L400
  je     L112
L400:
  mov    %edx,%r10d
  add    $0x1,%edx
  add    $0x8,%rax
  cmp    %edx,%edi
  jne    L280
L77:
  movsd  0x38(%rsp),%xmm5
  pxor   %xmm7,%xmm7
  mov    %r9d,0x44(%rsp)
  mov    %r10d,0x90(%rsp)
  comisd %xmm7,%xmm5
  jbe    L153
L93:
  mov    0x90(%rsp),%ebx
  movslq 0x44(%rsp),%rcx
  movq   $0x0,0x28(%rsp)
  mov    0x58(%rsp),%r8
  mov    0x60(%rsp),%r10
  lea    -0x1(%rbx),%eax
  mov    %rcx,%rdi
  lea    0x0(,%rcx,8),%rdx
  sub    %ecx,%eax
  mov    %rdx,%r11
  lea    (%rdx,%r10,1),%rsi
  add    %rcx,%rax
  mov    0xd0(%rsp),%rcx
  add    %r8,%r11
  mov    %rsi,0x48(%rsp)
  mov    %r11,0x50(%rsp)
  lea    (%rcx,%rax,8),%rax
  mov    %rax,0x70(%rsp)
  mov    %ebx,%eax
  sub    %edi,%ebx
  mov    %ebx,%ecx
  cmp    %eax,%edi
  mov    %eax,%ebx
  setl   %dl
  cmp    $0x1,%ecx
  setne  %al
  and    %eax,%edx
  lea    0x8(%rsi),%rax
  mov    $0x8,%esi
  cmp    %rax,%r11
  setne  %al
  and    %eax,%edx
  mov    %ecx,%eax
  shl    $0x3,%rax
  cmp    %ebx,%edi
  cmovge %rsi,%rax
  add    %r11,%rax
  cmp    %rax,0xa8(%rsp)
  setae  %al
  cmp    %r11,0x100(%rsp)
  setbe  %sil
  or     %esi,%eax
  and    %eax,%edx
  cmp    %ebx,%edi
  mov    $0x1,%eax
  cmovl  %ecx,%eax
  mov    %dl,0x68(%rsp)
  mov    %eax,%esi
  mov    %eax,0x88(%rsp)
  shr    %eax
  sub    $0x1,%eax
  and    $0xfffffffe,%esi
  shl    $0x4,%rax
  mov    %esi,0x94(%rsp)
  add    %edi,%esi
  lea    0x10(%r11,%rax,1),%rax
  mov    %rax,0x80(%rsp)
  movslq %esi,%rax
  shl    $0x3,%rax
  lea    (%r8,%rax,1),%rbp
  add    %r10,%rax
  neg    %r10
  mov    %rax,0x20(%rsp)
  mov    %r10,%rbx
  nopw   0x0(%rax,%rax,1)
L147:
  mov    0x48(%rsp),%r12
  mov    0x90(%rsp),%esi
  pxor   %xmm2,%xmm2
  cmp    %esi,0x44(%rsp)
  jge    L434
  mov    %rbp,0x30(%rsp)
  movsd  0x78(%rsp),%xmm1
  mov    %rbx,%rbp
  mov    0x70(%rsp),%rbx
  nopl   (%rax)
L379:
  lea    (%r14,%rbp,1),%rdx
  movsd  0x10(%rsp),%xmm0
  mov    %r15,%rdi
  movsd  %xmm2,0x8(%rsp)
  subsd  (%rdx,%r12,1),%xmm0
  movsd  %xmm1,(%rsp)
  call   <gaussian_cache@plt>
  lea    0x0(%r13,%rbp,1),%rdx
  movsd  0x8(%rsp),%xmm2
  movsd  (%rsp),%xmm1
  movsd  %xmm0,(%r12)
  mulsd  (%rdx,%r12,1),%xmm0
  add    $0x8,%r12
  cmp    %rbx,%r12
  addsd  %xmm0,%xmm2
  jne    L379
  mulsd  0x18(%rsp),%xmm2
  mov    %rbp,%rbx
  mov    0x30(%rsp),%rbp
  addsd  0x28(%rsp),%xmm2
  movapd %xmm2,%xmm0
  movsd  %xmm2,0x28(%rsp)
  call   <isfinite@plt>
  test   %eax,%eax
  jne    L202
  movq   $0x0,0x28(%rsp)
L202:
  cmpb   $0x0,0x68(%rsp)
  je     L385
  mov    0xa8(%rsp),%rax
  movsd  0x18(%rsp),%xmm2
  mov    0x80(%rsp),%rcx
  mov    0x60(%rsp),%rdx
  movsd  (%rax),%xmm1
  mov    0x50(%rsp),%rax
  unpcklpd %xmm2,%xmm2
  sub    0x58(%rsp),%rdx
  unpcklpd %xmm1,%xmm1
L276:
  movupd (%rdx,%rax,1),%xmm0
  movupd (%rax),%xmm6
  add    $0x10,%rax
  mulpd  %xmm2,%xmm0
  mulpd  %xmm1,%xmm0
  addpd  %xmm6,%xmm0
  movups %xmm0,-0x10(%rax)
  cmp    %rax,%rcx
  jne    L276
  mov    0x94(%rsp),%esi
  cmp    %esi,0x88(%rsp)
  je     L215
  mov    0x20(%rsp),%rax
  movsd  0x18(%rsp),%xmm0
  mulsd  (%rax),%xmm0
  mov    0xa8(%rsp),%rax
  mulsd  (%rax),%xmm0
  addsd  0x0(%rbp),%xmm0
  movsd  %xmm0,0x0(%rbp)
L215:
  movsd  0x10(%rsp),%xmm4
  movsd  0x38(%rsp),%xmm7
  subsd  0x18(%rsp),%xmm4
  comisd 0x28(%rsp),%xmm7
  movsd  %xmm4,0x10(%rsp)
  ja     L147
L451:
  movsd  0x38(%rsp),%xmm0
  call   <log10@plt>
  mov    0xfc(%rsp),%eax
  movsd  %xmm0,0x50(%rsp)
  test   %eax,%eax
  jle    L178
  mov    0x90(%rsp),%esi
  movslq 0x44(%rsp),%rcx
  mov    0x60(%rsp),%rbx
  mov    0x58(%rsp),%r10
  lea    -0x1(%rsi),%eax
  lea    0x0(,%rcx,8),%rdx
  mov    %rcx,%rdi
  sub    %ecx,%eax
  lea    (%rdx,%rbx,1),%r11
  mov    %rdx,%r9
  sub    %edi,%esi
  add    %rcx,%rax
  add    %r10,%r9
  lea    0x8(%r11),%rdx
  mov    %r11,0x68(%rsp)
  mov    0xd0(%rsp),%rcx
  shl    $0x3,%rax
  mov    %esi,0xa0(%rsp)
  mov    %r9,0x88(%rsp)
  add    %rax,%rcx
  cmp    %r9,%rdx
  lea    0x8(%r10,%rax,1),%rax
  mov    %rcx,0x80(%rsp)
  setne  %cl
  cmp    $0x1,%esi
  setne  %dl
  mov    %rax,0xb8(%rsp)
  mov    0xf0(%rsp),%rax
  and    %edx,%ecx
  mov    %esi,%edx
  and    $0xfffffffe,%esi
  shr    %edx
  add    %esi,%edi
  mov    %cl,0x94(%rsp)
  sub    $0x1,%edx
  mov    %rax,0x48(%rsp)
  mov    0xe8(%rsp),%rax
  shl    $0x4,%rdx
  mov    %esi,0xa4(%rsp)
  lea    0x10(%r9,%rdx,1),%rcx
  movslq %edi,%rdx
  mov    %rax,0xb0(%rsp)
  shl    $0x3,%rdx
  mov    %rcx,0x98(%rsp)
  lea    (%r10,%rdx,1),%rbp
  add    %rbx,%rdx
  neg    %rbx
  mov    %rdx,0x20(%rsp)
  nopl   0x0(%rax,%rax,1)
L456:
  mov    0xb0(%rsp),%r12
  mov    $0xa,%edi
  movsd  (%r12),%xmm0
  call   <pow@plt>
  mov    $0xa,%edi
  movsd  %xmm0,(%rsp)
  movsd  0x8(%r12),%xmm0
  call   <pow@plt>
  mov    0x48(%rsp),%rax
  movsd  (%rsp),%xmm1
  mov    $0xa,%edi
  movapd %xmm0,%xmm2
  subsd  %xmm2,%xmm1
  movsd  0x8(%rax),%xmm0
  subsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  %xmm1,(%rsp)
  call   <log@plt>
  movsd  (%r12),%xmm2
  movsd  (%rsp),%xmm1
  subsd  0x8(%r12),%xmm2
  movsd  0x38(%rsp),%xmm6
  movsd  0x50(%rsp),%xmm4
  mulsd  %xmm0,%xmm2
  movsd  %xmm4,0x70(%rsp)
  divsd  %xmm2,%xmm1
  addsd  %xmm1,%xmm6
  movapd %xmm6,%xmm0
  movsd  %xmm6,0x38(%rsp)
  call   <log10@plt>
  movsd  0x38(%rsp),%xmm6
  comisd 0x28(%rsp),%xmm6
  movsd  %xmm0,0x50(%rsp)
  jbe    L171
  nopl   0x0(%rax,%rax,1)
L487:
  movsd  0x10(%rsp),%xmm6
  pxor   %xmm3,%xmm3
  comisd %xmm3,%xmm6
  jb     L171
  mov    0x68(%rsp),%r12
  mov    0x90(%rsp),%esi
  pxor   %xmm2,%xmm2
  cmp    %esi,0x44(%rsp)
  jge    L122
  mov    %rbp,0x30(%rsp)
  movsd  0x78(%rsp),%xmm1
  mov    %rbx,%rbp
  mov    0x80(%rsp),%rbx
  nopl   0x0(%rax)
L264:
  lea    (%r14,%rbp,1),%rdx
  movsd  0x10(%rsp),%xmm0
  mov    %r15,%rdi
  movsd  %xmm2,0x8(%rsp)
  subsd  (%rdx,%r12,1),%xmm0
  movsd  %xmm1,(%rsp)
  call   <gaussian_cache@plt>
  lea    0x0(%r13,%rbp,1),%rdx
  movsd  0x8(%rsp),%xmm2
  movsd  (%rsp),%xmm1
  movsd  %xmm0,(%r12)
  mulsd  (%rdx,%r12,1),%xmm0
  add    $0x8,%r12
  cmp    %r12,%rbx
  addsd  %xmm0,%xmm2
  jne    L264
  mulsd  0x18(%rsp),%xmm2
  mov    0x48(%rsp),%r12
  mov    %rbp,%rbx
  addsd  0x28(%rsp),%xmm2
  mov    0x30(%rsp),%rbp
  movapd %xmm2,%xmm0
  movsd  %xmm2,0x28(%rsp)
  movsd  (%r12),%xmm2
  movsd  %xmm2,(%rsp)
  call   <log10@plt>
  movsd  0x50(%rsp),%xmm7
  movsd  0x70(%rsp),%xmm1
  movsd  (%rsp),%xmm2
  cmpb   $0x0,0x94(%rsp)
  subsd  %xmm7,%xmm1
  subsd  %xmm7,%xmm0
  divsd  %xmm1,%xmm0
  movsd  0x8(%r12),%xmm1
  subsd  %xmm2,%xmm1
  mulsd  %xmm1,%xmm0
  addsd  %xmm2,%xmm0
  je     L130
  movsd  0x18(%rsp),%xmm2
  movapd %xmm0,%xmm3
  mov    0x88(%rsp),%rax
  mov    0x98(%rsp),%rcx
  mov    0x60(%rsp),%rdx
  unpcklpd %xmm3,%xmm3
  unpcklpd %xmm2,%xmm2
  sub    0x58(%rsp),%rdx
  nopl   0x0(%rax)
L89:
  movupd (%rdx,%rax,1),%xmm1
  movupd (%rax),%xmm5
  add    $0x10,%rax
  mulpd  %xmm3,%xmm1
  mulpd  %xmm2,%xmm1
  addpd  %xmm5,%xmm1
  movups %xmm1,-0x10(%rax)
  cmp    %rax,%rcx
  jne    L89
  mov    0xa4(%rsp),%esi
  cmp    %esi,0xa0(%rsp)
  je     L275
  mov    0x20(%rsp),%rax
  mulsd  (%rax),%xmm0
  mulsd  0x18(%rsp),%xmm0
  addsd  0x0(%rbp),%xmm0
  movsd  %xmm0,0x0(%rbp)
L275:
  movsd  0x10(%rsp),%xmm7
  movsd  0x38(%rsp),%xmm6
  subsd  0x18(%rsp),%xmm7
  comisd 0x28(%rsp),%xmm6
  movsd  %xmm7,0x10(%rsp)
  ja     L487
L171:
  subq   $0x8,0xb0(%rsp)
  mov    0xb0(%rsp),%rax
  subq   $0x8,0x48(%rsp)
  cmp    %rax,0xc0(%rsp)
  jne    L456
L178:
  mov    0x90(%rsp),%esi
  cmp    %esi,0x44(%rsp)
  jge    L151
  movslq 0x44(%rsp),%r8
  mov    %esi,%edi
  mov    0x58(%rsp),%rsi
  lea    0x0(,%r8,8),%rax
  sub    %r8d,%edi
  lea    (%rsi,%rax,1),%rdx
  lea    (%r14,%rax,1),%rcx
  lea    0x8(%rdx),%rsi
  cmp    %rsi,%rcx
  je     L479
  lea    -0x1(%rdi),%eax
  cmp    $0x2,%eax
  jbe    L479
  mov    %edi,%eax
  sub    %rdx,%rcx
  shr    %eax
  sub    $0x1,%eax
  shl    $0x4,%rax
  lea    0x10(%rdx,%rax,1),%rsi
  mov    %rdx,%rax
  mov    %rcx,%rdx
L113:
  movupd (%rax),%xmm5
  movups %xmm5,(%rdx,%rax,1)
  add    $0x10,%rax
  cmp    %rsi,%rax
  jne    L113
  mov    0x44(%rsp),%eax
  mov    %edi,%edx
  and    $0xfffffffe,%edx
  add    %edx,%eax
  cmp    %edi,%edx
  je     L151
  mov    0x58(%rsp),%rsi
  cltq
  movsd  (%rsi,%rax,8),%xmm0
  movsd  %xmm0,(%r14,%rax,8)
L151:
  addl   $0x1,0xc8(%rsp)
  mov    0xc8(%rsp),%eax
  cmp    %eax,0xf8(%rsp)
  jne    L203
L166:
  mov    0x58(%rsp),%rdi
  call   <free@plt>
  mov    0x60(%rsp),%rdi
  call   <free@plt>
  add    $0x118,%rsp
  mov    %r15,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10c0 <free@plt>
L341:
  add    $0x118,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L130:
  mov    0x88(%rsp),%rax
  mov    0xb8(%rsp),%rcx
  mov    0x60(%rsp),%rdx
  sub    0x58(%rsp),%rdx
  nopw   0x0(%rax,%rax,1)
L101:
  movsd  (%rdx,%rax,1),%xmm1
  add    $0x8,%rax
  mulsd  %xmm0,%xmm1
  mulsd  0x18(%rsp),%xmm1
  addsd  -0x8(%rax),%xmm1
  movsd  %xmm1,-0x8(%rax)
  cmp    %rax,%rcx
  jne    L101
  jmp    L275
  nop
L122:
  movsd  0x18(%rsp),%xmm0
  mulsd  %xmm3,%xmm0
  addsd  0x28(%rsp),%xmm0
  movsd  %xmm0,0x28(%rsp)
  call   <log10@plt>
  jmp    L275
L385:
  mov    0x50(%rsp),%rax
  mov    0x44(%rsp),%edx
  mov    0xa8(%rsp),%rsi
  mov    0x90(%rsp),%edi
  mov    0x60(%rsp),%rcx
  sub    0x58(%rsp),%rcx
  nopw   0x0(%rax,%rax,1)
L429:
  movsd  0x18(%rsp),%xmm0
  mulsd  (%rcx,%rax,1),%xmm0
  add    $0x1,%edx
  add    $0x8,%rax
  mulsd  (%rsi),%xmm0
  addsd  -0x8(%rax),%xmm0
  movsd  %xmm0,-0x8(%rax)
  cmp    %edx,%edi
  jg     L429
  jmp    L215
L434:
  pxor   %xmm0,%xmm0
  mulsd  0x18(%rsp),%xmm0
  addsd  0x28(%rsp),%xmm0
  movsd  %xmm0,0x28(%rsp)
  call   <isfinite@plt>
  test   %eax,%eax
  jne    L215
  movq   $0x0,0x28(%rsp)
  movsd  0x10(%rsp),%xmm4
  subsd  0x18(%rsp),%xmm4
  movsd  %xmm4,0x10(%rsp)
  jmp    L147
L479:
  mov    0x90(%rsp),%eax
  mov    0x58(%rsp),%rdi
  sub    $0x1,%eax
  sub    0x44(%rsp),%eax
  add    %r8,%rax
  lea    0x8(%rdi,%rax,8),%rcx
  mov    %r14,%rax
  sub    %rdi,%rax
  jmp    L438
L397:
  add    $0x8,%rsi
L438:
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax,%rdx,1)
  mov    %rsi,%rdx
  cmp    %rcx,%rsi
  jne    L397
  jmp    L151
L30:
  movsd  0x38(%rsp),%xmm5
  pxor   %xmm7,%xmm7
  mov    %edi,0x90(%rsp)
  movl   $0x0,0x44(%rsp)
  comisd %xmm7,%xmm5
  ja     L93
L153:
  movq   $0x0,0x28(%rsp)
  jmp    L451
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D7
type_infered: byte[8]
name: extract_symbolic_data
arguments: data_label: D1
type_infered: byte[8]
name: extract_symbolic_data
arguments: data_label: D0
type_infered: byte[8]
name: extract_symbolic_data
arguments: data_label: D27
type_infered: byte[8]
name: extract_symbolic_data
arguments: data_label: D47
type_infered: byte[8]

tool: {"D7": [0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xbf]}

tool: {"D1": [0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x3f]}

tool: {"D0": [0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x40]}

tool: {"D27": [0xed,0xeb,0xf4,0x1f,0x93,0x0d,0x04,0x40]}

tool: {"D47": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x3f]}

assistant: ```c
void convolved_fit(double *af_key, double *af_val, int num_af_points, double *smm, double *mf, int MASS_BINS, double scatter, int repeat, double sm_step) {
  if (!repeat || !scatter)
    return;
  int i, j, k, jstart, jend;
  double sm, fid_sm;
  double nh, new_nh, lnh, lnnh, mnh, sum;
  double *new_smm = (double *)malloc(MASS_BINS * sizeof(double));
  double *smm_conv = (double *)malloc(MASS_BINS * sizeof(double));
  double *g_cache = (double *)malloc(4097 * sizeof(double));
  for (i = 0; i < 4097; i++) {
    sm = ((double)i) / 256 - 8;
    g_cache[i] = exp(-0.5 * sm * sm) / sqrt(2.0 * 3.1415926535);
  }
  for (k = 0; k < repeat; ++k) {
    jstart = 0;
    jend = MASS_BINS;
    fid_sm = af_key[num_af_points - 1] + 1;
    nh = pow(10, af_val[num_af_points - 1]) * (af_key[num_af_points - 1] - af_key[num_af_points - 2]);
    new_smm[0] = 0;
    for (i = 1; i < MASS_BINS; i++) {
      new_smm[i] = 0;
      if (smm[i] && !smm[i - 1])
        jstart = i;
      if (!smm[i] && smm[i - 1])
        jend = i;
    }
    mnh = 0;
    while (mnh < nh) {
      sum = 0;
      for (j = jstart; j < jend; j++) {
        smm_conv[j] = gaussian_cache(fid_sm - smm[j], scatter, g_cache);
        sum += smm_conv[j] * mf[j];
      }
      mnh += sum * sm_step;
      if (!isfinite(mnh))
        mnh = 0;
      for (j = jstart; j < jend; j++) {
        new_smm[j] += smm_conv[j] * sm_step * af_key[num_af_points - 1];
      }
      fid_sm -= sm_step;
    }
    lnh = log10(nh);
    for (i = num_af_points - 1; i > 0; i--) {
      new_nh = nh + (pow(10, af_val[i - 1]) - pow(10, af_val[i])) * (af_key[i] - af_key[i - 1]) / (log(10) * (af_val[i - 1] - af_val[i]));
      lnnh = log10(new_nh);
      while (mnh < new_nh && fid_sm >= 0) {
        sum = 0;
        for (j = jstart; j < jend; j++) {
          smm_conv[j] = gaussian_cache(fid_sm - smm[j], scatter, g_cache);
          sum += smm_conv[j] * mf[j];
        }
        mnh += sum * sm_step;
        sm = af_key[i - 1] + (log10(mnh) - lnnh) / (lnh - lnnh) * (af_key[i] - af_key[i - 1]);
        for (j = jstart; j < jend; j++)
          new_smm[j] += smm_conv[j] * sm * sm_step;
        fid_sm -= sm_step;
      }
      nh = new_nh;
      lnh = lnnh;
    }
    for (j = jstart; j < jend; j++)
      smm[j] = new_smm[j];
  }
  free(new_smm);
  free(smm_conv);
  free(g_cache);
}
```