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

```asm
<main>:
  endbr64
  push   %r14
  lea    D46(%rip),%r14
  push   %r13
  lea    D3(%rip),%r13
  push   %r12
  push   %rbp
  lea    D35(%rip),%rbp
  push   %rbx
  mov    $0x1,%ebx
  sub    $0x40,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  lea    0x1c(%rsp),%r12
  jmp    L105
  nopl   0x0(%rax)
L70:
  cmp    $0x2,%eax
  je     L137
  cmp    $0x3,%eax
  je     L80
  cmp    $0x4,%eax
  je     L49
L131:
  add    $0x1,%ebx
L105:
  mov    %r12,%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  mov    0x1c(%rsp),%eax
  test   %eax,%eax
  je     L148
  lea    0x30(%rsp),%rcx
  lea    0x28(%rsp),%rdx
  mov    %r13,%rdi
  xor    %eax,%eax
  lea    0x20(%rsp),%rsi
  call   <scanf@plt>
  mov    0x1c(%rsp),%eax
  cmp    $0x1,%eax
  jne    L70
  movsd  0x20(%rsp),%xmm2
  movsd  0x28(%rsp),%xmm1
  mov    %ebx,%esi
  mov    %r14,%rdi
  movsd  0x30(%rsp),%xmm3
  movsd  D22(%rip),%xmm0
  subsd  %xmm2,%xmm1
  mulsd  %xmm3,%xmm2
  divsd  %xmm3,%xmm1
  mulsd  %xmm1,%xmm0
  mulsd  %xmm3,%xmm0
  mulsd  %xmm3,%xmm0
  addsd  %xmm2,%xmm0
  call   <printf@plt>
  jmp    L131
  nopl   0x0(%rax,%rax,1)
L137:
  movsd  0x20(%rsp),%xmm2
  movsd  0x28(%rsp),%xmm1
  mov    %ebx,%esi
  mov    %r14,%rdi
  movsd  0x30(%rsp),%xmm0
  subsd  %xmm2,%xmm1
  divsd  %xmm0,%xmm1
  mulsd  D22(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  mulsd  %xmm1,%xmm2
  mulsd  %xmm1,%xmm0
  addsd  %xmm2,%xmm0
  call   <printf@plt>
  jmp    L131
  nopl   0x0(%rax)
L80:
  movsd  0x20(%rsp),%xmm3
  movsd  0x28(%rsp),%xmm2
  pxor   %xmm4,%xmm4
  movapd %xmm2,%xmm0
  movapd %xmm3,%xmm1
  mulsd  %xmm3,%xmm1
  addsd  %xmm2,%xmm0
  mulsd  0x30(%rsp),%xmm0
  addsd  %xmm1,%xmm0
  ucomisd %xmm0,%xmm4
  ja     L25
  sqrtsd %xmm0,%xmm0
L12:
  movapd %xmm0,%xmm1
  mov    %ebx,%esi
  mov    %r14,%rdi
  subsd  %xmm3,%xmm1
  divsd  %xmm2,%xmm1
  call   <printf@plt>
  jmp    L131
  nopl   0x0(%rax,%rax,1)
L148:
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L118
  add    $0x40,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax,%rax,1)
L49:
  movsd  0x20(%rsp),%xmm1
  movsd  0x28(%rsp),%xmm2
  pxor   %xmm5,%xmm5
  movapd %xmm1,%xmm0
  movapd %xmm2,%xmm3
  mulsd  %xmm1,%xmm0
  addsd  %xmm2,%xmm3
  mulsd  0x30(%rsp),%xmm3
  subsd  %xmm3,%xmm0
  ucomisd %xmm0,%xmm5
  ja     L115
  sqrtsd %xmm0,%xmm0
L48:
  subsd  %xmm0,%xmm1
  mov    %ebx,%esi
  mov    %r14,%rdi
  divsd  %xmm2,%xmm1
  call   <printf@plt>
  jmp    L131
L25:
  movsd  %xmm2,0x8(%rsp)
  movsd  %xmm3,(%rsp)
  call   <sqrt@plt>
  movsd  0x8(%rsp),%xmm2
  movsd  (%rsp),%xmm3
  jmp    L12
L115:
  movsd  %xmm2,0x8(%rsp)
  movsd  %xmm1,(%rsp)
  call   <sqrt@plt>
  movsd  0x8(%rsp),%xmm2
  movsd  (%rsp),%xmm1
  jmp    L48
L118:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_label: D46
type_infered: string
name: parse_data
arguments: data_label: D3
type_infered: string
name: parse_data
arguments: data_label: D35
type_infered: string
name: parse_data
arguments: data_label: D22
type_infered: byte[8]

tool: D46: Case %d: %.3lf %.3lf


tool: D3: %lf %lf %lf

tool: D35: %d

tool: {"D22": [0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x3f]}

assistant: ```c
int main() {
  double b, c, d, u, v, a, t, s;
  int i, j, n;
  i = 1;
  while (1) {
    scanf("%d", &n);
    if (n == 0) {
      break;
    } else
      scanf("%lf %lf %lf", &b, &c, &d);
    if (n == 1) {
      u = b;
      v = c;
      t = d;
      a = (v - u) / t;
      s = u * t + .5 * a * t * t;
      printf("Case %d: %.3lf %.3lf\n", i, s, a);
    } else if (n == 2) {
      u = b;
      v = c;
      a = d;
      t = (v - u) / a;
      s = u * t + .5 * a * t * t;
      printf("Case %d: %.3lf %.3lf\n", i, s, t);
    } else if (n == 3) {
      u = b;
      a = c;
      s = d;
      v = sqrt(u * u + 2 * a * s);
      t = (v - u) / a;
      printf("Case %d: %.3lf %.3lf\n", i, v, t);
    } else if (n == 4) {
      v = b;
      a = c;
      s = d;
      u = sqrt(v * v - 2 * a * s);
      t = (v - u) / a;
      printf("Case %d: %.3lf %.3lf\n", i, u, t);
    }
    i++;
  }
  return 0;
}
```