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

```asm
<pi_check>:
  endbr64
  push   %rbx
  sub    $0x10,%rsp
  mov    %rsi,%rbx
  test   %rdi,%rdi
  js     L49
  pxor   %xmm5,%xmm5
  cvtsi2sd %rdi,%xmm5
  movsd  %xmm5,(%rsp)
L58:
  mov    %rbx,%rsi
  movsd  (%rsp),%xmm0
  lea    D80(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  test   %rbx,%rbx
  js     L97
  pxor   %xmm6,%xmm6
  cvtsi2sd %rbx,%xmm6
  movsd  %xmm6,0x8(%rsp)
L31:
  movsd  (%rsp),%xmm0
  mulsd  D62(%rip),%xmm0
  divsd  0x8(%rsp),%xmm0
  movsd  D92(%rip),%xmm2
  movapd %xmm0,%xmm4
  subsd  %xmm2,%xmm4
  movapd %xmm4,%xmm1
  mulsd  D17(%rip),%xmm1
  divsd  %xmm2,%xmm1
  lea    D112(%rip),%rdi
  mov    $0x2,%eax
  call   <printf@plt>
  movsd  0x8(%rsp),%xmm1
  mulsd  D95(%rip),%xmm1
  movsd  (%rsp),%xmm0
  subsd  %xmm1,%xmm0
  mulsd  %xmm0,%xmm0
  mulsd  D129(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movsd  D73(%rip),%xmm1
  comisd %xmm0,%xmm1
  ja     L93
  movsd  D62(%rip),%xmm1
  comisd %xmm0,%xmm1
  ja     L69
  movsd  D34(%rip),%xmm1
  comisd %xmm0,%xmm1
  jbe    L10
  lea    D60(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    $0x0,%eax
L23:
  add    $0x10,%rsp
  pop    %rbx
  ret
L49:
  mov    %rdi,%rax
  shr    %rax
  and    $0x1,%edi
  or     %rdi,%rax
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  addsd  %xmm0,%xmm0
  movsd  %xmm0,(%rsp)
  jmp    L58
L97:
  mov    %rbx,%rax
  shr    %rax
  and    $0x1,%ebx
  or     %rbx,%rax
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  addsd  %xmm0,%xmm0
  movsd  %xmm0,0x8(%rsp)
  jmp    L31
L93:
  lea    D74(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  jmp    L23
L69:
  lea    D102(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  jmp    L23
L10:
  lea    D28(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    $0x1,%eax
  jmp    L23
```

tool_calls: name: read_data
arguments: label: D80
data_type: string
name: read_data
arguments: label: D62
data_type: f64
name: read_data
arguments: label: D92
data_type: f64
name: read_data
arguments: label: D17
data_type: f64
name: read_data
arguments: label: D112
data_type: string
name: read_data
arguments: label: D95
data_type: byte[8]
name: read_data
arguments: label: D129
data_type: byte[8]
name: read_data
arguments: label: D73
data_type: f64
name: read_data
arguments: label: D34
data_type: f64
name: read_data
arguments: label: D60
data_type: string
name: read_data
arguments: label: D74
data_type: string
name: read_data
arguments: label: D102
data_type: string
name: read_data
arguments: label: D28
data_type: string

tool: D80: %lu out of %lu darts thrown at a square board hit the inscribed circle


tool: D62: 4

tool: D92: 3.141592653589793

tool: D17: 100

tool: D112: pi is approximately %.8g (diff = %.2g %%)


tool: {"D95": [0x18,0x2d,0x44,0x54,0xfb,0x21,0xe9,0x3f]}

tool: {"D129": [0xa0,0x4b,0xef,0xae,0x12,0x78,0xcb,0x3f]}

tool: D73: 1

tool: D34: 9

tool: D60: Maybe OK, # of hits is between two and three 'sigma' away from expectation
(chisquared = %.2g)


tool: D74: OK, # of hits is less than one 'sigma' away from expectation
(chisquared = %.2g)


tool: D102: OK, # of hits is between one and two 'sigma' away from expectation
(chisquared = %.2g)


tool: D28: May not be OK, # of hits is more than three 'sigma'.  Worth looking into.
(chisquared = %.2g)


assistant: ```c
int pi_check(unsigned long hits, unsigned long tries) {
  const double PI = 3.14159265358979323846;
  double ourpi, mean, var, delta, chisq;
  printf("%lu out of %lu darts thrown at a square board hit the inscribed circle\n", hits, tries);
  ourpi = 4. * hits / tries;
  printf("pi is approximately %.8g (diff = %.2g %%)\n", ourpi, (ourpi - PI) * 100. / PI);
  mean = tries * (PI / 4.);
  var = tries * (PI / 4.) * (1. - (PI / 4.));
  delta = hits - mean;
  chisq = delta * delta / var;
  if (chisq < 1.)
    printf("OK, # of hits is less than one 'sigma' away from expectation\n(chisquared = %.2g)\n", chisq);
  else if (chisq < 4.)
    printf("OK, # of hits is between one and two 'sigma' away from expectation\n(chisquared = %.2g)\n", chisq);
  else if (chisq < 9.)
    printf("Maybe OK, # of hits is between two and three 'sigma' away from expectation\n(chisquared = %.2g)\n", chisq);
  else {
    printf("May not be OK, # of hits is more than three 'sigma'.  Worth looking into.\n(chisquared = %.2g)\n", chisq);
    return 1;
  }
  return 0;
}
```