user: Converte this assembly snippet into its equivalent C code:

```asm
<fgamma_set>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x10,%rsp
  mov    %edi,%ebp
  movaps %xmm0,%xmm5
  movss  %xmm0,0xc(%rsp)
  mov    %rsi,%rbx
  pxor   %xmm4,%xmm4
  cvtss2sd %xmm0,%xmm4
  movsd  D29(%rip),%xmm0
  comisd %xmm4,%xmm0
  jbe    L56
  test   %edi,%edi
  js     L45
  mulss  %xmm5,%xmm5
  cvtss2sd %xmm5,%xmm5
  lea    0x1(%rdi),%ecx
  mov    $0x0,%eax
  movsd  D2(%rip),%xmm2
  movsd  D68(%rip),%xmm7
  movsd  D51(%rip),%xmm6
L52:
  lea    (%rax,%rax,1),%edx
  pxor   %xmm1,%xmm1
  cvtsi2sd %edx,%xmm1
  movapd %xmm1,%xmm3
  addsd  %xmm2,%xmm3
  movapd %xmm2,%xmm0
  divsd  %xmm3,%xmm0
  addsd  %xmm7,%xmm1
  movapd %xmm4,%xmm3
  divsd  %xmm1,%xmm3
  subsd  %xmm3,%xmm0
  lea    0x0(,%rax,4),%edx
  pxor   %xmm1,%xmm1
  cvtsi2sd %edx,%xmm1
  addsd  %xmm6,%xmm1
  movapd %xmm5,%xmm3
  divsd  %xmm1,%xmm3
  addsd  %xmm3,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rbx,%rax,4)
  add    $0x1,%rax
  cmp    %rax,%rcx
  jne    L52
L45:
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L56:
  movss  0xc(%rsp),%xmm0
  call   <fgamma_0@plt>
  movss  %xmm0,(%rbx)
  test   %ebp,%ebp
  jle    L45
  movss  0xc(%rsp),%xmm4
  movaps %xmm4,%xmm0
  addss  %xmm4,%xmm0
  movss  D9(%rip),%xmm7
  divss  %xmm0,%xmm7
  movss  %xmm7,0x4(%rsp)
  xorps  D77(%rip),%xmm4
  movaps %xmm4,%xmm0
  call   <exp@plt>
  movss  0x4(%rsp),%xmm7
  mulss  %xmm7,%xmm0
  movss  %xmm0,0x8(%rsp)
  comiss D9(%rip),%xmm7
  ja     L17
  movaps %xmm7,%xmm0
  mov    $0x3,%edx
  mov    $0x2,%eax
  movss  D9(%rip),%xmm1
L67:
  mulss  -0x8(%rbx,%rax,4),%xmm0
  subss  0x8(%rsp),%xmm0
  movss  %xmm0,-0x4(%rbx,%rax,4)
  mov    %eax,%r12d
  cmp    %eax,%ebp
  jl     L45
  pxor   %xmm0,%xmm0
  cvtsi2ss %edx,%xmm0
  mulss  0x4(%rsp),%xmm0
  add    $0x1,%rax
  add    $0x2,%edx
  comiss %xmm1,%xmm0
  jbe    L67
L62:
  movslq %ebp,%r13
  shl    $0x2,%r13
  lea    (%rbx,%r13,1),%r14
  movss  0xc(%rsp),%xmm0
  mov    %ebp,%edi
  call   <fgamma@plt>
  movss  %xmm0,(%r14)
  movss  D9(%rip),%xmm3
  divss  0x4(%rsp),%xmm3
  movss  0x8(%rsp),%xmm1
  mulss  %xmm3,%xmm1
  sub    $0x1,%ebp
  cmp    %ebp,%r12d
  jg     L45
  lea    -0x4(%rbx,%r13,1),%rdx
  lea    0x1(%rbp,%rbp,1),%eax
  lea    -0x1(%r12,%r12,1),%ecx
L63:
  movaps %xmm3,%xmm0
  mulss  0x4(%rdx),%xmm0
  addss  %xmm1,%xmm0
  pxor   %xmm2,%xmm2
  cvtsi2ss %eax,%xmm2
  divss  %xmm2,%xmm0
  movss  %xmm0,(%rdx)
  sub    $0x4,%rdx
  sub    $0x2,%eax
  cmp    %ecx,%eax
  jne    L63
  jmp    L45
L17:
  mov    $0x1,%r12d
  jmp    L62
```

tool_calls: name: unpack_data
arguments: data_label: D29
datatype: f64
name: unpack_data
arguments: data_label: D2
datatype: f64
name: unpack_data
arguments: data_label: D68
datatype: f64
name: unpack_data
arguments: data_label: D51
datatype: f64
name: unpack_data
arguments: data_label: D9
datatype: byte[4]
name: unpack_data
arguments: data_label: D77
datatype: byte[16]

tool: D29: 0.0005

tool: D2: 1

tool: D68: 3

tool: D51: 10

tool: {"D9": [0x00,0x00,0x80,0x3f]}

tool: {"D77": [0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]}

assistant: ```c
void fgamma_set(int max, float x, float *fset) {
  float a, b, c;
  int i, j;
  if (x < 0.0005) {
    for (i = 0; i <= max; i++)
      fset[i] = 1.0 / (i + i + 1.0) - x / (i + i + 3.0) + x * x / (i + i + i + i + 10.0);
    return;
  }
  fset[0] = fgamma_0(x);
  if (max < 1)
    return;
  a = 1.0 / (x + x);
  c = a * exp(-x);
  for (i = 1; i <= max; i++) {
    if ((b = (i + i - 1) * a) > 1.0)
      break;
    fset[i] = b * fset[i - 1] - c;
  }
  if (max < i)
    return;
  fset[max] = fgamma(max, x);
  a = 1.0 / a;
  c = c * a;
  for (j = max - 1; j >= i; j--)
    fset[j] = (a * fset[j + 1] + c) / (j + j + 1);
}
```