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

```asm
<lgamma>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  movsd  %xmm0,-0x18(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movsd  -0x18(%rbp),%xmm1
  movsd  D20(%rip),%xmm0
  addsd  %xmm0,%xmm1
  movsd  D68(%rip),%xmm0
  divsd  %xmm1,%xmm0
  movsd  -0x8(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movsd  -0x18(%rbp),%xmm1
  movsd  D52(%rip),%xmm0
  addsd  %xmm0,%xmm1
  movsd  D155(%rip),%xmm0
  divsd  %xmm1,%xmm0
  movsd  -0x8(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movsd  -0x18(%rbp),%xmm1
  movsd  D114(%rip),%xmm0
  movapd %xmm1,%xmm2
  addsd  %xmm0,%xmm2
  movsd  D30(%rip),%xmm0
  movapd %xmm0,%xmm1
  divsd  %xmm2,%xmm1
  movsd  -0x8(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movsd  -0x18(%rbp),%xmm1
  movsd  D21(%rip),%xmm0
  addsd  %xmm0,%xmm1
  movsd  D40(%rip),%xmm0
  divsd  %xmm1,%xmm0
  movsd  -0x8(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movsd  -0x18(%rbp),%xmm1
  movsd  D162(%rip),%xmm0
  movapd %xmm1,%xmm2
  addsd  %xmm0,%xmm2
  movsd  D91(%rip),%xmm0
  movapd %xmm0,%xmm1
  divsd  %xmm2,%xmm1
  movsd  -0x8(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movsd  -0x18(%rbp),%xmm1
  movsd  D174(%rip),%xmm0
  addsd  %xmm0,%xmm1
  movsd  D27(%rip),%xmm0
  divsd  %xmm1,%xmm0
  movsd  -0x8(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movsd  -0x18(%rbp),%xmm1
  movsd  D101(%rip),%xmm0
  movapd %xmm1,%xmm2
  addsd  %xmm0,%xmm2
  movsd  D158(%rip),%xmm0
  movapd %xmm0,%xmm1
  divsd  %xmm2,%xmm1
  movsd  -0x8(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movsd  D79(%rip),%xmm0
  divsd  -0x18(%rbp),%xmm0
  movsd  -0x8(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movsd  -0x8(%rbp),%xmm1
  movsd  D73(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  movq   %rax,%xmm0
  call   <log@plt>
  movq   %xmm0,%rax
  movsd  D17(%rip),%xmm1
  movq   %rax,%xmm0
  subsd  %xmm1,%xmm0
  subsd  -0x18(%rbp),%xmm0
  movsd  %xmm0,-0x20(%rbp)
  movsd  -0x18(%rbp),%xmm0
  movsd  D13(%rip),%xmm1
  movapd %xmm0,%xmm4
  subsd  %xmm1,%xmm4
  movsd  %xmm4,-0x28(%rbp)
  movsd  -0x18(%rbp),%xmm1
  movsd  D100(%rip),%xmm0
  addsd  %xmm0,%xmm1
  movq   %xmm1,%rax
  movq   %rax,%xmm0
  call   <log@plt>
  mulsd  -0x28(%rbp),%xmm0
  addsd  -0x20(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  leave
  ret
```

tool_calls: name: read_data
arguments: tag: D20
type_infered: f32[2]
name: read_data
arguments: tag: D68
type_infered: byte[8]
name: read_data
arguments: tag: D52
type_infered: f32[2]
name: read_data
arguments: tag: D155
type_infered: byte[8]
name: read_data
arguments: tag: D114
type_infered: f32[2]
name: read_data
arguments: tag: D30
type_infered: f64
name: read_data
arguments: tag: D21
type_infered: f32[2]
name: read_data
arguments: tag: D40
type_infered: f64
name: read_data
arguments: tag: D162
type_infered: f32[2]
name: read_data
arguments: tag: D91
type_infered: f64
name: read_data
arguments: tag: D174
type_infered: f32[2]
name: read_data
arguments: tag: D27
type_infered: f64
name: read_data
arguments: tag: D101
type_infered: f32[2]
name: read_data
arguments: tag: D158
type_infered: f64
name: read_data
arguments: tag: D79
type_infered: f64
name: read_data
arguments: tag: D73
type_infered: f64
name: read_data
arguments: tag: D17
type_infered: f64
name: read_data
arguments: tag: D13
type_infered: f64
name: read_data
arguments: tag: D100
type_infered: f64

tool: {"D20": [0.0,2.4375]}

tool: {"D68": [0xc8,0xdb,0xe1,0x69,0xe5,0x45,0x86,0x3e]}

tool: {"D52": [0.0,2.375]}

tool: {"D155": [0xe3,0x7e,0x18,0x5c,0xc7,0xd5,0xe4,0x3e]}

tool: {"D114": [0.0,2.3125]}

tool: D30: 0.1385710331296526

tool: {"D21": [0.0,2.25]}

tool: D40: 12.50734324009056

tool: {"D162": [0.0,2.125]}

tool: D91: 176.6150291498386

tool: {"D174": [0.0,2.0]}

tool: D27: 771.3234287757674

tool: {"D101": [0.0,1.875]}

tool: D158: 1259.139216722289

tool: D79: 676.5203681218835

tool: D73: 0.9999999999995183

tool: D17: 5.581061466795328

tool: D13: 0.5

tool: D100: 6.5

assistant: ```c
double lgamma(double z) {
  double x = 0;
  x += 0.1659470187408462e-06 / (z + 7);
  x += 0.9934937113930748e-05 / (z + 6);
  x -= 0.1385710331296526 / (z + 5);
  x += 12.50734324009056 / (z + 4);
  x -= 176.6150291498386 / (z + 3);
  x += 771.3234287757674 / (z + 2);
  x -= 1259.139216722289 / (z + 1);
  x += 676.5203681218835 / z;
  x += 0.9999999999995183;
  return log(x) - 5.58106146679532777 - z + (z - 0.5) * log(z + 6.5);
}
```