user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<main>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    D198(%rip),%rbx
  sub    $0x50,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  lea    0x44(%rsp),%r14
  lea    0x40(%rsp),%r13
  lea    0x3c(%rsp),%r12
  lea    0x38(%rsp),%rbp
  jmp    L149
  nopl   (%rax)
L63:
  lea    D70(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
L149:
  mov    %r13,%rcx
  mov    %r12,%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  xor    %eax,%eax
  mov    %r14,%r8
  call   <scanf@plt>
  mov    0x38(%rsp),%edi
  mov    0x3c(%rsp),%eax
  mov    0x40(%rsp),%esi
  mov    0x44(%rsp),%edx
  mov    %edi,%ecx
  or     %eax,%ecx
  or     %esi,%ecx
  or     %edx,%ecx
  je     L92
  pxor   %xmm7,%xmm7
  pxor   %xmm4,%xmm4
  pxor   %xmm1,%xmm1
  mov    %eax,%ecx
  cvtsi2sd %edx,%xmm7
  movsd  D5(%rip),%xmm2
  pxor   %xmm6,%xmm6
  movsd  D5(%rip),%xmm8
  cvtsi2sd %eax,%xmm4
  movsd  D81(%rip),%xmm5
  cvtsi2sd %esi,%xmm1
  imul   %edx,%ecx
  addsd  %xmm7,%xmm8
  mulsd  %xmm1,%xmm2
  cvtsi2sd %ecx,%xmm6
  mov    D213(%rip),%rcx
  movapd %xmm8,%xmm0
  mulsd  %xmm4,%xmm0
  subsd  %xmm2,%xmm0
  movsd  D98(%rip),%xmm2
  divsd  %xmm6,%xmm0
  movapd %xmm0,%xmm3
  andpd  %xmm5,%xmm3
  ucomisd %xmm3,%xmm2
  movq   %rcx,%xmm2
  jbe    L54
  cvttsd2si %xmm0,%rcx
  pxor   %xmm3,%xmm3
  andnpd %xmm0,%xmm5
  cvtsi2sd %rcx,%xmm3
  movapd %xmm3,%xmm9
  cmpnlesd %xmm0,%xmm9
  andpd  %xmm2,%xmm9
  subsd  %xmm9,%xmm3
  orpd   %xmm5,%xmm3
  movapd %xmm3,%xmm0
L54:
  pxor   %xmm9,%xmm9
  movsd  D113(%rip),%xmm5
  movapd %xmm1,%xmm3
  comisd %xmm0,%xmm9
  mulsd  %xmm5,%xmm3
  jae    L128
  movapd %xmm4,%xmm11
  movapd %xmm0,%xmm12
  pxor   %xmm10,%xmm10
  mulsd  %xmm0,%xmm11
  cvtsi2sd %edi,%xmm10
  subsd  %xmm2,%xmm12
  mulsd  %xmm6,%xmm0
  mulsd  %xmm12,%xmm1
  mulsd  %xmm12,%xmm0
  divsd  %xmm5,%xmm0
  subsd  %xmm0,%xmm11
  subsd  %xmm1,%xmm11
  comisd %xmm10,%xmm11
  ja     L176
L128:
  movsd  D98(%rip),%xmm13
  movapd %xmm8,%xmm0
  divsd  %xmm7,%xmm0
  movsd  D81(%rip),%xmm7
  movapd %xmm0,%xmm1
  andpd  %xmm7,%xmm1
  ucomisd %xmm1,%xmm13
  jbe    L86
  cvttsd2si %xmm0,%rcx
  pxor   %xmm1,%xmm1
  movapd %xmm0,%xmm8
  andnpd %xmm0,%xmm7
  cvtsi2sd %rcx,%xmm1
  cmpnlesd %xmm1,%xmm8
  andpd  %xmm2,%xmm8
  addsd  %xmm8,%xmm1
  orpd   %xmm7,%xmm1
  movapd %xmm1,%xmm0
L86:
  mov    %eax,%edi
  cvttsd2si %xmm0,%ecx
  pxor   %xmm0,%xmm0
  movsd  D106(%rip),%xmm7
  movsd  D98(%rip),%xmm14
  sub    %esi,%edi
  cvtsi2sd %edi,%xmm0
  mulsd  %xmm5,%xmm0
  divsd  %xmm6,%xmm0
  movsd  D81(%rip),%xmm6
  addsd  %xmm2,%xmm0
  addsd  %xmm7,%xmm0
  movapd %xmm0,%xmm1
  andpd  %xmm6,%xmm1
  ucomisd %xmm1,%xmm14
  jbe    L180
  cvttsd2si %xmm0,%rsi
  pxor   %xmm1,%xmm1
  movapd %xmm0,%xmm8
  andnpd %xmm0,%xmm6
  cvtsi2sd %rsi,%xmm1
  cmpnlesd %xmm1,%xmm8
  andpd  %xmm2,%xmm8
  addsd  %xmm8,%xmm1
  orpd   %xmm6,%xmm1
  movapd %xmm1,%xmm0
L180:
  cvttsd2si %xmm0,%esi
  test   %esi,%esi
  jle    L140
  cmp    %esi,%ecx
  jg     L63
L140:
  pxor   %xmm1,%xmm1
  lea    -0x1(%rcx),%esi
  cvtsi2sd %ecx,%xmm1
  imul   %esi,%ecx
  mulsd  %xmm5,%xmm1
  imul   %ecx,%edx
  imul   %edx,%eax
  movapd %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  mulsd  %xmm4,%xmm0
  cvtsi2sd %eax,%xmm1
  movsd  D98(%rip),%xmm4
  subsd  %xmm1,%xmm0
  divsd  %xmm3,%xmm0
  movsd  D81(%rip),%xmm3
  addsd  %xmm7,%xmm0
  movapd %xmm0,%xmm1
  andpd  %xmm3,%xmm1
  ucomisd %xmm1,%xmm4
  jbe    L60
  cvttsd2si %xmm0,%rax
  pxor   %xmm1,%xmm1
  movapd %xmm0,%xmm4
  andnpd %xmm0,%xmm3
  cvtsi2sd %rax,%xmm1
  cmpnlesd %xmm1,%xmm4
  andpd  %xmm2,%xmm4
  addsd  %xmm4,%xmm1
  orpd   %xmm3,%xmm1
  movapd %xmm1,%xmm0
L60:
  cvttsd2si %xmm0,%esi
  jmp    L63
  nopl   0x0(%rax)
L176:
  mulsd  %xmm4,%xmm5
  movsd  D54(%rip),%xmm0
  sub    %esi,%edi
  pxor   %xmm1,%xmm1
  cvtsi2sd %edi,%xmm1
  mulsd  %xmm7,%xmm0
  addsd  %xmm6,%xmm5
  mulsd  %xmm4,%xmm0
  subsd  %xmm3,%xmm5
  movapd %xmm5,%xmm3
  mulsd  %xmm5,%xmm3
  mulsd  %xmm1,%xmm0
  subsd  %xmm0,%xmm3
  ucomisd %xmm3,%xmm9
  ja     L78
  addsd  %xmm7,%xmm7
  sqrtsd %xmm3,%xmm3
  movapd %xmm7,%xmm1
  movapd %xmm3,%xmm6
  mulsd  %xmm4,%xmm1
L57:
  movapd %xmm5,%xmm0
  movsd  D106(%rip),%xmm7
  movsd  D81(%rip),%xmm4
  movsd  D98(%rip),%xmm15
  subsd  %xmm3,%xmm0
  divsd  %xmm1,%xmm0
  addsd  %xmm7,%xmm0
  movapd %xmm0,%xmm3
  andpd  %xmm4,%xmm3
  ucomisd %xmm3,%xmm15
  jbe    L41
  cvttsd2si %xmm0,%rax
  pxor   %xmm3,%xmm3
  movapd %xmm0,%xmm8
  andnpd %xmm0,%xmm4
  cvtsi2sd %rax,%xmm3
  cmpnlesd %xmm3,%xmm8
  andpd  %xmm2,%xmm8
  addsd  %xmm8,%xmm3
  orpd   %xmm4,%xmm3
  movapd %xmm3,%xmm0
L41:
  cvttsd2si %xmm0,%esi
  test   %esi,%esi
  jle    L72
L80:
  lea    D58(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L149
  nop
L72:
  addsd  %xmm6,%xmm5
  movsd  D98(%rip),%xmm4
  divsd  %xmm1,%xmm5
  movsd  D81(%rip),%xmm1
  subsd  %xmm7,%xmm5
  movapd %xmm5,%xmm0
  andpd  %xmm1,%xmm0
  ucomisd %xmm0,%xmm4
  jbe    L187
  cvttsd2si %xmm5,%rax
  pxor   %xmm0,%xmm0
  andnpd %xmm5,%xmm1
  cvtsi2sd %rax,%xmm0
  movapd %xmm0,%xmm3
  cmpnlesd %xmm5,%xmm3
  andpd  %xmm2,%xmm3
  subsd  %xmm3,%xmm0
  movapd %xmm0,%xmm5
  orpd   %xmm1,%xmm5
L187:
  cvttsd2si %xmm5,%esi
  jmp    L80
  nopl   0x0(%rax,%rax,1)
L92:
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L43
  add    $0x50,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L78:
  movapd %xmm3,%xmm0
  movsd  %xmm2,0x28(%rsp)
  movsd  %xmm5,0x20(%rsp)
  movsd  %xmm4,0x18(%rsp)
  movsd  %xmm7,0x10(%rsp)
  movsd  %xmm3,0x8(%rsp)
  call   <sqrt@plt>
  movsd  0x10(%rsp),%xmm7
  pxor   %xmm9,%xmm9
  movsd  0x8(%rsp),%xmm3
  movsd  0x18(%rsp),%xmm4
  movsd  0x20(%rsp),%xmm5
  movapd %xmm0,%xmm6
  addsd  %xmm7,%xmm7
  ucomisd %xmm3,%xmm9
  movsd  0x28(%rsp),%xmm2
  movapd %xmm7,%xmm1
  mulsd  %xmm4,%xmm1
  jbe    L73
  movsd  %xmm0,0x10(%rsp)
  movapd %xmm3,%xmm0
  movsd  %xmm2,0x20(%rsp)
  movsd  %xmm1,0x18(%rsp)
  movsd  %xmm5,0x8(%rsp)
  call   <sqrt@plt>
  movsd  0x20(%rsp),%xmm2
  movsd  0x18(%rsp),%xmm1
  movsd  0x10(%rsp),%xmm6
  movsd  0x8(%rsp),%xmm5
  movapd %xmm0,%xmm3
  jmp    L57
L43:
  call   <__stack_chk_fail@plt>
L73:
  sqrtsd %xmm3,%xmm3
  jmp    L57
```

tool_calls: name: retrieve_data
arguments: tag: D198
type: string
name: retrieve_data
arguments: tag: D70
type: string
name: retrieve_data
arguments: tag: D5
type: f64
name: retrieve_data
arguments: tag: D81
type: byte[8]
name: retrieve_data
arguments: tag: D213
type: f32[2]
name: retrieve_data
arguments: tag: D98
type: f32[2]
name: retrieve_data
arguments: tag: D113
type: f64
name: retrieve_data
arguments: tag: D106
type: byte[8]
name: retrieve_data
arguments: tag: D54
type: f64
name: retrieve_data
arguments: tag: D58
type: string

tool: D198: %d%d%d%d

tool: D70: failure on day %d


tool: D5: 100

tool: {"D81": [0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f]}

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

tool: {"D98": [0.0,176.0]}

tool: D113: 200

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

tool: D54: 800

tool: D58: success on day %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;
}
```