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

```asm
<main>:
  endbr64
  push   %r15
  lea    D31(%rip),%r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    D15(%rip),%rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  lea    0x24(%rsp),%r14
  lea    0x20(%rsp),%r13
  lea    0x1c(%rsp),%r12
  lea    0x18(%rsp),%rbp
  nopl   0x0(%rax)
L24:
  mov    %r14,%r8
  mov    %r13,%rcx
  mov    %r12,%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <scanf@plt>
  test   %rax,%rax
  je     L49
  mov    0x18(%rsp),%eax
  mov    0x1c(%rsp),%esi
  mov    0x20(%rsp),%edi
  mov    0x24(%rsp),%ecx
  mov    %eax,%edx
  imul   %esi,%edx
  imul   %edi,%edx
  imul   %ecx,%edx
  test   %edx,%edx
  je     L49
  pxor   %xmm2,%xmm2
  pxor   %xmm0,%xmm0
  pxor   %xmm1,%xmm1
  cltd
  cvtsi2ss %ecx,%xmm2
  cvtsi2ss %eax,%xmm0
  idiv   %ecx
  divss  %xmm2,%xmm0
  cvtsi2ss %edi,%xmm1
  xor    %eax,%eax
  cvtss2sd %xmm1,%xmm1
  divsd  D32(%rip),%xmm1
  test   %edx,%edx
  setg   %al
  cvttss2si %xmm0,%r9d
  pxor   %xmm0,%xmm0
  cvtsi2ss %esi,%xmm0
  add    %eax,%r9d
  mov    %esi,%eax
  divss  %xmm2,%xmm0
  cltd
  idiv   %ecx
  xor    %eax,%eax
  cvttss2si %xmm0,%edi
  test   %edx,%edx
  setg   %al
  add    %eax,%edi
  ucomisd D59(%rip),%xmm1
  lea    (%r9,%rdi,1),%r8d
  jp     L2
  jne    L2
  pxor   %xmm0,%xmm0
  pxor   %xmm1,%xmm1
  mov    %r15,%rdi
  cvtsi2ss %r9d,%xmm0
  cvtsi2ss %r8d,%xmm1
  divss  %xmm1,%xmm0
  cvtss2sd %xmm0,%xmm0
  mulsd  D46(%rip),%xmm0
  cvttsd2si %xmm0,%esi
  call   <printf@plt>
  jmp    L24
  nopl   0x0(%rax,%rax,1)
L2:
  movsd  D18(%rip),%xmm0
  mov    %r9d,%edi
  mov    %r8d,0xc(%rsp)
  subsd  %xmm1,%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rsp)
  call   <pow@plt>
  mov    0xc(%rsp),%edi
  movsd  (%rsp),%xmm0
  mov    %eax,0x8(%rsp)
  call   <pow@plt>
  mov    0x8(%rsp),%edx
  mov    $0x1,%ecx
  mov    %r15,%rdi
  mov    %eax,%r8d
  mov    %ecx,%eax
  sub    %edx,%eax
  sub    %r8d,%ecx
  cltd
  idiv   %ecx
  imul   $0x64,%eax,%esi
  call   <printf@plt>
  jmp    L24
  nopw   0x0(%rax,%rax,1)
L49:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L50
  add    $0x38,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L50:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D31
type_guessed: string
name: extract_symbolic_data
arguments: label: D15
type_guessed: string
name: extract_symbolic_data
arguments: label: D32
type_guessed: f64
name: extract_symbolic_data
arguments: label: D59
type_guessed: f64
name: extract_symbolic_data
arguments: label: D46
type_guessed: byte[8]
name: extract_symbolic_data
arguments: label: D18
type_guessed: byte[8]

tool: D31: %.1lf


tool: D15: %d%d%d%d

tool: D32: 6

tool: D59: 0.5

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

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

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;
}
```