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

```asm
<main>:
  endbr64
  push   %r14
  push   %rbp
  push   %rbx
  sub    $0x50,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  lea    D66(%rip),%rbx
  jmp    L139
L153:
  movsd  D10(%rip),%xmm1
  comisd 0x8(%rsp),%xmm1
  jb     L54
L107:
  movsd  D10(%rip),%xmm4
  comisd %xmm0,%xmm4
  jb     L54
  movsd  0x38(%rsp),%xmm2
  movsd  0x28(%rsp),%xmm1
  movsd  0x30(%rsp),%xmm0
  call   <max1@plt>
  movsd  %xmm0,0x8(%rsp)
  movsd  0x20(%rsp),%xmm2
  movsd  0x10(%rsp),%xmm1
  movsd  0x18(%rsp),%xmm0
  call   <min1@plt>
  movsd  0x8(%rsp),%xmm3
  comisd %xmm3,%xmm0
  jbe    L161
  movapd %xmm0,%xmm1
  subsd  %xmm3,%xmm1
  movq   %rbp,%xmm2
  addsd  %xmm1,%xmm2
  movq   %xmm2,%rbp
L161:
  movsd  0x10(%rsp),%xmm5
  ucomisd %xmm5,%xmm0
  jp     L123
  jne    L123
  movsd  0x28(%rsp),%xmm4
  addsd  D25(%rip),%xmm4
  movsd  %xmm4,0x28(%rsp)
  addsd  D25(%rip),%xmm5
  movsd  %xmm5,0x10(%rsp)
L123:
  movsd  0x18(%rsp),%xmm6
  ucomisd %xmm6,%xmm0
  jp     L138
  jne    L138
  movsd  0x30(%rsp),%xmm2
  addsd  D49(%rip),%xmm2
  movsd  %xmm2,0x30(%rsp)
  addsd  D49(%rip),%xmm6
  movsd  %xmm6,0x18(%rsp)
L138:
  movsd  0x20(%rsp),%xmm7
  ucomisd %xmm7,%xmm0
  jp     L153
  jne    L153
  movsd  0x38(%rsp),%xmm3
  addsd  D34(%rip),%xmm3
  movsd  %xmm3,0x38(%rsp)
  addsd  D34(%rip),%xmm7
  movsd  %xmm7,0x20(%rsp)
  jmp    L153
L54:
  movq   %rbp,%xmm0
  divsd  D96(%rip),%xmm0
  lea    D141(%rip),%rdi
  call   <printf@plt>
L139:
  lea    0x40(%rsp),%rsi
  mov    %rbx,%rdi
  call   <scanf@plt>
  cmp    $0x1,%eax
  jne    L98
  movsd  0x40(%rsp),%xmm0
  ucomisd D68(%rip),%xmm0
  jp     L70
  je     L98
L70:
  movsd  D25(%rip),%xmm4
  movapd %xmm0,%xmm2
  mulsd  %xmm4,%xmm2
  movsd  D35(%rip),%xmm1
  divsd  %xmm1,%xmm2
  movapd %xmm2,%xmm5
  movsd  %xmm2,0x28(%rsp)
  movsd  D49(%rip),%xmm3
  movapd %xmm0,%xmm2
  mulsd  %xmm3,%xmm2
  divsd  %xmm1,%xmm2
  movapd %xmm2,%xmm6
  movsd  %xmm2,0x30(%rsp)
  movsd  D34(%rip),%xmm2
  mulsd  %xmm2,%xmm0
  movapd %xmm0,%xmm7
  divsd  %xmm1,%xmm7
  movsd  %xmm7,0x38(%rsp)
  movapd %xmm5,%xmm1
  subsd  %xmm5,%xmm4
  movsd  %xmm4,0x10(%rsp)
  subsd  %xmm6,%xmm3
  movsd  %xmm3,0x18(%rsp)
  subsd  %xmm7,%xmm2
  movsd  %xmm2,0x20(%rsp)
  movapd %xmm7,%xmm2
  movapd %xmm6,%xmm0
  call   <max1@plt>
  movq   %xmm0,%r14
  movsd  0x20(%rsp),%xmm2
  movsd  0x10(%rsp),%xmm1
  movsd  0x18(%rsp),%xmm0
  call   <min1@plt>
  mov    D165(%rip),%rbp
  movsd  D10(%rip),%xmm1
  movq   %r14,%xmm4
  comisd %xmm4,%xmm1
  jae    L107
  jmp    L54
L98:
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L148
  mov    $0x0,%eax
  add    $0x50,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r14
  ret
L148:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D66
type: string
name: disassemble_data
arguments: data_label: D10
type: f64
name: disassemble_data
arguments: data_label: D25
type: byte[8]
name: disassemble_data
arguments: data_label: D49
type: byte[8]
name: disassemble_data
arguments: data_label: D34
type: byte[8]
name: disassemble_data
arguments: data_label: D96
type: f32[2]
name: disassemble_data
arguments: data_label: D141
type: string
name: disassemble_data
arguments: data_label: D68
type: f32[2]
name: disassemble_data
arguments: data_label: D35
type: f32[2]
name: disassemble_data
arguments: data_label: D165
type: f32[2]

tool: D66: %lf

tool: D10: 43200

tool: {"D25": [0xa5,0xee,0xcb,0x63,0x2b,0x82,0x4e,0x40]}

tool: {"D49": [0x84,0xb4,0xeb,0x76,0xae,0x0a,0x4e,0x40]}

tool: {"D34": [0x2f,0xba,0xe8,0xa2,0x8b,0xae,0xae,0x40]}

tool: {"D96": [0.0,3.921875]}

tool: D141: %.3lf


tool: {"D68": [0.0,-1.875]}

tool: {"D35": [0.0,3.8515625]}

tool: {"D165": [0.0,0.0]}

assistant: ```c
int main(int argc, char *argv[]) {
  double sum = 0.0;
  double tempx = 0.0;
  double tempy = 0.0;
  double sm;
  double sh;
  double mh;
  double dsm;
  double dsh;
  double dmh;
  double bsm, bsh, bmh;
  double d;
  sm = 3600.0 / 59;
  sh = 43200.0 / 719;
  mh = 43200.0 / 11;
  while (scanf("%lf", &d) == 1 && d != -1) {
    sum = 0;
    dsm = sm * d / 360;
    dsh = sh * d / 360;
    dmh = mh * d / 360;
    bsm = sm - dsm;
    bsh = sh - dsh;
    bmh = mh - dmh;
    tempx = max1(dsh, dsm, dmh);
    tempy = min1(bsh, bsm, bmh);
    while (tempx <= 43200 && tempy <= 43200) {
      tempx = max1(dsh, dsm, dmh);
      tempy = min1(bsh, bsm, bmh);
      if (tempx < tempy) {
        sum += (tempy - tempx);
      }
      if (tempy == bsm) {
        dsm += sm;
        bsm += sm;
      }
      if (tempy == bsh) {
        dsh += sh;
        bsh += sh;
      }
      if (tempy == bmh) {
        dmh += mh;
        bmh += mh;
      }
    }
    printf("%.3lf\n", sum / 432);
  }
  return 0;
}
```