user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  jmp    L93
L125:
  movl   $0x1,-0x28(%rbp)
  mov    -0x2c(%rbp),%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movsd  D199(%rip),%xmm0
  addsd  %xmm0,%xmm1
  mov    -0x34(%rbp),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  %xmm1,%xmm0
  mov    -0x30(%rbp),%eax
  pxor   %xmm2,%xmm2
  cvtsi2sd %eax,%xmm2
  movsd  D199(%rip),%xmm1
  mulsd  %xmm2,%xmm1
  subsd  %xmm1,%xmm0
  mov    -0x2c(%rbp),%edx
  mov    -0x34(%rbp),%eax
  imul   %edx,%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  divsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <floor@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x10(%rbp)
  pxor   %xmm0,%xmm0
  comisd -0x10(%rbp),%xmm0
  jb     L44
  movl   $0x0,-0x28(%rbp)
L44:
  cmpl   $0x0,-0x28(%rbp)
  je     L174
  mov    -0x34(%rbp),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  -0x10(%rbp),%xmm0
  mov    -0x2c(%rbp),%edx
  mov    -0x34(%rbp),%eax
  imul   %edx,%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movapd %xmm1,%xmm2
  mulsd  -0x10(%rbp),%xmm2
  movsd  -0x10(%rbp),%xmm1
  movsd  D232(%rip),%xmm3
  subsd  %xmm3,%xmm1
  mulsd  %xmm2,%xmm1
  movsd  D230(%rip),%xmm2
  divsd  %xmm2,%xmm1
  subsd  %xmm1,%xmm0
  movsd  -0x10(%rbp),%xmm1
  movsd  D232(%rip),%xmm3
  movapd %xmm1,%xmm2
  subsd  %xmm3,%xmm2
  mov    -0x30(%rbp),%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  mulsd  %xmm2,%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
L174:
  cmpl   $0x0,-0x28(%rbp)
  je     L2
  mov    -0x38(%rbp),%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movsd  -0x18(%rbp),%xmm0
  comisd %xmm1,%xmm0
  jbe    L2
  mov    $0x1,%eax
  jmp    L66
L2:
  mov    $0x0,%eax
L66:
  mov    %eax,-0x28(%rbp)
  cmpl   $0x0,-0x28(%rbp)
  je     L87
  mov    -0x34(%rbp),%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movsd  D230(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x2c(%rbp),%edx
  mov    -0x34(%rbp),%eax
  imul   %edx,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  addsd  %xmm1,%xmm0
  mov    -0x30(%rbp),%eax
  pxor   %xmm2,%xmm2
  cvtsi2sd %eax,%xmm2
  movsd  D230(%rip),%xmm1
  mulsd  %xmm2,%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x48(%rbp)
  mov    -0x34(%rbp),%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movsd  D230(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x2c(%rbp),%edx
  mov    -0x34(%rbp),%eax
  imul   %edx,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  addsd  %xmm1,%xmm0
  mov    -0x30(%rbp),%eax
  pxor   %xmm2,%xmm2
  cvtsi2sd %eax,%xmm2
  movsd  D230(%rip),%xmm1
  mulsd  %xmm2,%xmm1
  movapd %xmm0,%xmm4
  subsd  %xmm1,%xmm4
  movq   %xmm4,%rax
  movsd  D217(%rip),%xmm0
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <pow@plt>
  movq   %xmm0,%rax
  mov    -0x2c(%rbp),%edx
  pxor   %xmm1,%xmm1
  cvtsi2sd %edx,%xmm1
  movsd  D229(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x34(%rbp),%edx
  pxor   %xmm0,%xmm0
  cvtsi2sd %edx,%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x38(%rbp),%edx
  mov    -0x30(%rbp),%ecx
  sub    %ecx,%edx
  pxor   %xmm0,%xmm0
  cvtsi2sd %edx,%xmm0
  mulsd  %xmm1,%xmm0
  movq   %rax,%xmm5
  subsd  %xmm0,%xmm5
  movq   %xmm5,%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  movsd  -0x48(%rbp),%xmm1
  addsd  %xmm0,%xmm1
  mov    -0x2c(%rbp),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movapd %xmm0,%xmm2
  addsd  %xmm0,%xmm2
  mov    -0x34(%rbp),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  %xmm0,%xmm2
  divsd  %xmm2,%xmm1
  movapd %xmm1,%xmm0
  movsd  D211(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <floor@plt>
  cvttsd2si %xmm0,%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x34(%rbp),%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movsd  D230(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x2c(%rbp),%edx
  mov    -0x34(%rbp),%eax
  imul   %edx,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  addsd  %xmm1,%xmm0
  mov    -0x30(%rbp),%eax
  pxor   %xmm2,%xmm2
  cvtsi2sd %eax,%xmm2
  movsd  D230(%rip),%xmm1
  mulsd  %xmm2,%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x48(%rbp)
  mov    -0x34(%rbp),%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movsd  D230(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x2c(%rbp),%edx
  mov    -0x34(%rbp),%eax
  imul   %edx,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  addsd  %xmm1,%xmm0
  mov    -0x30(%rbp),%eax
  pxor   %xmm2,%xmm2
  cvtsi2sd %eax,%xmm2
  movsd  D230(%rip),%xmm1
  mulsd  %xmm2,%xmm1
  movapd %xmm0,%xmm6
  subsd  %xmm1,%xmm6
  movq   %xmm6,%rax
  movsd  D217(%rip),%xmm0
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <pow@plt>
  movq   %xmm0,%rax
  mov    -0x2c(%rbp),%edx
  pxor   %xmm1,%xmm1
  cvtsi2sd %edx,%xmm1
  movsd  D229(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x34(%rbp),%edx
  pxor   %xmm0,%xmm0
  cvtsi2sd %edx,%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x38(%rbp),%edx
  mov    -0x30(%rbp),%ecx
  sub    %ecx,%edx
  pxor   %xmm0,%xmm0
  cvtsi2sd %edx,%xmm0
  mulsd  %xmm1,%xmm0
  movq   %rax,%xmm7
  subsd  %xmm0,%xmm7
  movq   %xmm7,%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  movsd  -0x48(%rbp),%xmm1
  subsd  %xmm0,%xmm1
  mov    -0x2c(%rbp),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movapd %xmm0,%xmm2
  addsd  %xmm0,%xmm2
  mov    -0x34(%rbp),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  %xmm2,%xmm0
  divsd  %xmm0,%xmm1
  movsd  D211(%rip),%xmm0
  addsd  %xmm0,%xmm1
  movq   %xmm1,%rax
  movq   %rax,%xmm0
  call   <ceil@plt>
  cvttsd2si %xmm0,%eax
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  jle    L175
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0x24(%rbp)
L175:
  mov    -0x24(%rbp),%eax
  mov    %eax,%esi
  lea    D47(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L93
L87:
  mov    -0x2c(%rbp),%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movsd  D199(%rip),%xmm0
  addsd  %xmm1,%xmm0
  mov    -0x2c(%rbp),%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  divsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <ceil@plt>
  cvttsd2si %xmm0,%eax
  mov    %eax,-0x20(%rbp)
  mov    -0x34(%rbp),%eax
  mov    -0x30(%rbp),%edx
  sub    %edx,%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movsd  D230(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  mov    -0x2c(%rbp),%edx
  mov    -0x34(%rbp),%eax
  imul   %edx,%eax
  pxor   %xmm2,%xmm2
  cvtsi2sd %eax,%xmm2
  movapd %xmm0,%xmm1
  divsd  %xmm2,%xmm1
  movsd  D232(%rip),%xmm0
  addsd  %xmm0,%xmm1
  movsd  D211(%rip),%xmm0
  addsd  %xmm0,%xmm1
  movq   %xmm1,%rax
  movq   %rax,%xmm0
  call   <ceil@plt>
  cvttsd2si %xmm0,%eax
  mov    %eax,-0x24(%rbp)
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x20(%rbp),%xmm1
  movsd  D230(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x34(%rbp),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  %xmm1,%xmm0
  mov    -0x20(%rbp),%eax
  sub    $0x1,%eax
  imul   -0x20(%rbp),%eax
  mov    %eax,%edx
  mov    -0x2c(%rbp),%eax
  imul   %eax,%edx
  mov    -0x34(%rbp),%eax
  imul   %edx,%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  subsd  %xmm1,%xmm0
  mov    -0x30(%rbp),%eax
  pxor   %xmm2,%xmm2
  cvtsi2sd %eax,%xmm2
  movsd  D230(%rip),%xmm1
  mulsd  %xmm1,%xmm2
  movapd %xmm0,%xmm1
  divsd  %xmm2,%xmm1
  movsd  D211(%rip),%xmm0
  addsd  %xmm0,%xmm1
  movq   %xmm1,%rax
  movq   %rax,%xmm0
  call   <ceil@plt>
  cvttsd2si %xmm0,%eax
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x0,-0x24(%rbp)
  jle    L79
  mov    -0x24(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  jl     L25
L79:
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0x24(%rbp)
L25:
  mov    -0x24(%rbp),%eax
  mov    %eax,%esi
  lea    D70(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L93:
  lea    -0x2c(%rbp),%rsi
  lea    -0x30(%rbp),%rcx
  lea    -0x34(%rbp),%rdx
  lea    -0x38(%rbp),%rax
  mov    %rsi,%r8
  mov    %rax,%rsi
  lea    D120(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    -0x38(%rbp),%eax
  test   %eax,%eax
  jne    L117
  mov    -0x34(%rbp),%eax
  test   %eax,%eax
  jne    L117
  mov    -0x30(%rbp),%eax
  test   %eax,%eax
  jne    L117
  mov    -0x2c(%rbp),%eax
  test   %eax,%eax
  je     L142
L117:
  mov    $0x1,%eax
  jmp    L92
L142:
  mov    $0x0,%eax
L92:
  test   %eax,%eax
  jne    L125
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L18
  call   <__stack_chk_fail@plt>
L18:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D199
data_type: f64
name: unpack_data
arguments: data_tag: D232
data_type: f32[2]
name: unpack_data
arguments: data_tag: D230
data_type: f64
name: unpack_data
arguments: data_tag: D217
data_type: f64
name: unpack_data
arguments: data_tag: D229
data_type: f64
name: unpack_data
arguments: data_tag: D211
data_type: byte[8]
name: unpack_data
arguments: data_tag: D47
data_type: string
name: unpack_data
arguments: data_tag: D70
data_type: string
name: unpack_data
arguments: data_tag: D120
data_type: string

tool: D199: 100

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

tool: D230: 200

tool: D217: 2

tool: D229: 800

tool: {"D211": [0x8d,0xed,0xb5,0xa0,0xf7,0xc6,0xb0,0x3e]}

tool: D47: success on day %d


tool: D70: failure on day %d


tool: D120: %d%d%d%d

assistant: ```c
int main() {
  int H, U, D, F;
  double k;
  double s = 0.0;
  int flag;
  int ans1, ans2;
  int k1;
  while (scanf("%d%d%d%d", &H, &U, &D, &F), H || U || D || F) {
    flag = 1;
    k = floor(((100.0 + F) * U - 100.0 * D) / (F * U));
    if (k <= 0)
      flag = 0;
    if (flag)
      s = k * U - F * U * k * (k - 1) / 200.0 - (k - 1) * D;
    flag = (flag && s > H);
    if (flag) {
      ans1 = floor((200.0 * U + F * U - 200.0 * D + sqrt(pow(200.0 * U + F * U - 200.0 * D, 2) - 800.0 * F * U * (H - D))) / (2.0 * F * U) - 1e-6);
      ans2 = ceil((200.0 * U + F * U - 200.0 * D - sqrt(pow(200.0 * U + F * U - 200.0 * D, 2) - 800.0 * F * U * (H - D))) / (2.0 * F * U) + 1e-6);
      if (ans2 > 0)
        ans1 = ans2;
      printf("success on day %d\n", ans1);
    } else {
      k1 = ceil((100.0 + F) / F);
      ans1 = ceil(200.0 * (U - D) / (F * U) + 1 + 1e-6);
      ans2 = ceil((200.0 * k1 * U - k1 * (k1 - 1) * F * U) / (200.0 * D) + 1e-6);
      if (ans1 <= 0 || ans1 >= k1)
        ans1 = ans2;
      printf("failure on day %d\n", ans1);
    }
  }
  return 0;
}
```