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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  jmp    L171
L51:
  mov    -0x28(%rbp),%eax
  test   %eax,%eax
  jne    L133
  mov    -0x20(%rbp),%eax
  test   %eax,%eax
  jne    L133
  mov    -0x24(%rbp),%eax
  test   %eax,%eax
  jne    L133
  mov    -0x1c(%rbp),%eax
  test   %eax,%eax
  je     L177
L133:
  mov    -0x28(%rbp),%eax
  test   %eax,%eax
  jne    L32
  movl   $0x18,-0x28(%rbp)
L32:
  mov    -0x20(%rbp),%eax
  test   %eax,%eax
  jne    L148
  movl   $0x18,-0x20(%rbp)
L148:
  movl   $0x5a0,-0x14(%rbp)
  mov    -0x20(%rbp),%edx
  mov    -0x28(%rbp),%eax
  cmp    %eax,%edx
  jle    L116
  mov    -0x20(%rbp),%eax
  mov    -0x28(%rbp),%edx
  sub    %edx,%eax
  imul   $0x3c,%eax,%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x24(%rbp),%edx
  mov    -0x1c(%rbp),%eax
  cmp    %eax,%edx
  jg     L61
  mov    -0x1c(%rbp),%eax
  mov    -0x24(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x10(%rbp),%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x18(%rbp)
  jmp    L102
L61:
  mov    -0x24(%rbp),%eax
  mov    -0x1c(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x10(%rbp),%eax
  sub    -0xc(%rbp),%eax
  mov    %eax,-0x18(%rbp)
  jmp    L102
L116:
  mov    -0x20(%rbp),%edx
  mov    -0x28(%rbp),%eax
  cmp    %eax,%edx
  jne    L35
  mov    -0x1c(%rbp),%edx
  mov    -0x24(%rbp),%eax
  cmp    %eax,%edx
  jl     L168
  mov    -0x1c(%rbp),%eax
  mov    -0x24(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  mov    %eax,-0x18(%rbp)
  jmp    L102
L168:
  mov    -0x24(%rbp),%eax
  mov    -0x1c(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x14(%rbp),%eax
  sub    -0xc(%rbp),%eax
  mov    %eax,-0x18(%rbp)
  jmp    L102
L35:
  mov    -0x28(%rbp),%eax
  mov    -0x20(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,%ecx
  mov    $0x18,%eax
  sub    %ecx,%eax
  imul   $0x3c,%eax,%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x1c(%rbp),%edx
  mov    -0x24(%rbp),%eax
  cmp    %eax,%edx
  jl     L99
  mov    -0x1c(%rbp),%eax
  mov    -0x24(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x10(%rbp),%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x18(%rbp)
  jmp    L102
L99:
  mov    -0x24(%rbp),%eax
  mov    -0x1c(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x10(%rbp),%eax
  sub    -0xc(%rbp),%eax
  mov    %eax,-0x18(%rbp)
L102:
  mov    -0x18(%rbp),%eax
  mov    %eax,%esi
  lea    D4(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L171:
  lea    -0x1c(%rbp),%rsi
  lea    -0x20(%rbp),%rcx
  lea    -0x24(%rbp),%rdx
  lea    -0x28(%rbp),%rax
  mov    %rsi,%r8
  mov    %rax,%rsi
  lea    D16(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  cmp    $0x4,%eax
  je     L51
  jmp    L17
L177:
  nop
L17:
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L104
  call   <__stack_chk_fail@plt>
L104:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D4
datatype: string
name: unpack_data
arguments: data_label: D16
datatype: string

tool: D4: %d


tool: D16: %d %d %d %d

assistant: ```c
int main() {
  int h1, m1, h2, m2, h, m, total, hour;
  while (scanf("%d %d %d %d", &h1, &m1, &h2, &m2) == 4) {
    if (h1 == 0 && h2 == 0 && m1 == 0 && m2 == 0)
      break;
    if (h1 == 0) {
      h1 = 24;
    }
    if (h2 == 0) {
      h2 = 24;
    }
    total = 24 * 60;
    if (h2 > h1) {
      h = (h2 - h1) * 60;
      if (m1 <= m2) {
        m = m2 - m1;
        hour = h + m;
      } else {
        m = m1 - m2;
        hour = h - m;
      }
    } else if (h2 == h1) {
      if (m2 >= m1) {
        m = m2 - m1;
        hour = m;
      } else {
        m = m1 - m2;
        hour = total - m;
      }
    } else {
      h = (24 - (h1 - h2)) * 60;
      if (m2 >= m1) {
        m = m2 - m1;
        hour = h + m;
      } else {
        m = m1 - m2;
        hour = h - m;
      }
    }
    printf("%d\n", hour);
  }
}
```