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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  jmp    L87
L5:
  mov    -0x40(%rbp),%eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  cvtss2sd %xmm0,%xmm0
  movsd  D65(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  movsd  D7(%rip),%xmm0
  subsd  -0x30(%rbp),%xmm0
  movsd  %xmm0,-0x28(%rbp)
  mov    -0x48(%rbp),%eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  mov    -0x3c(%rbp),%eax
  pxor   %xmm1,%xmm1
  cvtsi2ss %eax,%xmm1
  divss  %xmm1,%xmm0
  cvttss2si %xmm0,%eax
  mov    %eax,-0x38(%rbp)
  mov    -0x48(%rbp),%eax
  mov    -0x3c(%rbp),%ecx
  cltd
  idiv   %ecx
  mov    %edx,%eax
  test   %eax,%eax
  jle    L55
  addl   $0x1,-0x38(%rbp)
L55:
  mov    -0x44(%rbp),%eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  mov    -0x3c(%rbp),%eax
  pxor   %xmm1,%xmm1
  cvtsi2ss %eax,%xmm1
  divss  %xmm1,%xmm0
  cvttss2si %xmm0,%eax
  mov    %eax,-0x34(%rbp)
  mov    -0x44(%rbp),%eax
  mov    -0x3c(%rbp),%ecx
  cltd
  idiv   %ecx
  mov    %edx,%eax
  test   %eax,%eax
  jle    L49
  addl   $0x1,-0x34(%rbp)
L49:
  movsd  -0x30(%rbp),%xmm0
  ucomisd D72(%rip),%xmm0
  jp     L19
  movsd  -0x30(%rbp),%xmm0
  ucomisd D72(%rip),%xmm0
  jne    L19
  pxor   %xmm0,%xmm0
  cvtsi2ssl -0x38(%rbp),%xmm0
  mov    -0x38(%rbp),%edx
  mov    -0x34(%rbp),%eax
  add    %edx,%eax
  pxor   %xmm1,%xmm1
  cvtsi2ss %eax,%xmm1
  divss  %xmm1,%xmm0
  cvtss2sd %xmm0,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  movsd  -0x20(%rbp),%xmm1
  movsd  D27(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,%esi
  lea    D4(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L87
L19:
  movsd  -0x28(%rbp),%xmm0
  divsd  -0x30(%rbp),%xmm0
  movq   %xmm0,%rax
  mov    -0x38(%rbp),%edx
  mov    %edx,%edi
  movq   %rax,%xmm0
  call   <pow@plt>
  mov    $0x1,%edx
  mov    %edx,%ebx
  sub    %eax,%ebx
  mov    -0x38(%rbp),%edx
  mov    -0x34(%rbp),%eax
  add    %eax,%edx
  movsd  -0x28(%rbp),%xmm0
  divsd  -0x30(%rbp),%xmm0
  movq   %xmm0,%rax
  mov    %edx,%edi
  movq   %rax,%xmm0
  call   <pow@plt>
  mov    $0x1,%edx
  mov    %edx,%esi
  sub    %eax,%esi
  mov    %ebx,%eax
  cltd
  idiv   %esi
  imul   $0x64,%eax,%eax
  mov    %eax,%esi
  lea    D4(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L87:
  lea    -0x3c(%rbp),%rsi
  lea    -0x40(%rbp),%rcx
  lea    -0x44(%rbp),%rdx
  lea    -0x48(%rbp),%rax
  mov    %rsi,%r8
  mov    %rax,%rsi
  lea    D57(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  test   %rax,%rax
  je     L85
  mov    -0x48(%rbp),%edx
  mov    -0x44(%rbp),%eax
  imul   %eax,%edx
  mov    -0x40(%rbp),%eax
  imul   %eax,%edx
  mov    -0x3c(%rbp),%eax
  imul   %edx,%eax
  test   %eax,%eax
  jne    L5
L85:
  mov    $0x0,%eax
  mov    -0x18(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L0
  call   <__stack_chk_fail@plt>
L0:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D65
type: f64
name: parse_data
arguments: data_tag: D7
type: byte[8]
name: parse_data
arguments: data_tag: D72
type: f64
name: parse_data
arguments: data_tag: D27
type: byte[8]
name: parse_data
arguments: data_tag: D4
type: string
name: parse_data
arguments: data_tag: D57
type: string

tool: D65: 6

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

tool: D72: 0.5

tool: {"D27": [0x00,0x00,0x00,0x00,0x00,0x00,0x59,0x40]}

tool: D4: %.1lf


tool: D57: %d%d%d%d

assistant: ```c
int main() {
  int ev1, ev2, at, d, n1, n2;
  double p, q, prob;
  while (scanf("%d%d%d%d", &ev1, &ev2, &at, &d) && ev1 * ev2 * at * d != 0) {
    p = (float)at / 6.0;
    q = 1 - p;
    n1 = (float)ev1 / d;
    if (ev1 % d > 0) {
      n1++;
    }
    n2 = (float)ev2 / d;
    if (ev2 % d > 0) {
      n2++;
    }
    if (p == 0.5) {
      prob = (float)n1 / (n1 + n2);
      printf("%.1lf\n", 100 * prob);
    } else {
      printf("%.1lf\n", 100 * ((1 - pow((q / p), n1)) / (1 - pow((q / p), n1 + n2))));
    }
  }
  return 0;
}
```