user: 请从给定的汇编指令推导出C源代码：

```asm
<main>:
  endbr64
  push   %r15
  lea    D46(%rip),%rdi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  lea    0x8(%rsp),%rsi
  call   <scanf@plt>
  mov    0x8(%rsp),%eax
  sub    $0x1,%eax
  cmp    $0x63,%eax
  ja     L114
  mov    $0x1,%ebx
  lea    0x14(%rsp),%r14
  lea    0x10(%rsp),%r13
  lea    0xc(%rsp),%r12
  lea    D17(%rip),%rbp
  jmp    L123
L52:
  call   <solve@plt>
  mov    %ebx,%esi
  lea    D38(%rip),%rdi
  mov    %eax,%r15d
  xor    %eax,%eax
  call   <printf@plt>
  test   %r15d,%r15d
  js     L31
  mov    %r15d,%esi
  lea    D63(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
L22:
  lea    0x1(%rbx),%eax
  cmp    %ebx,0x8(%rsp)
  jle    L24
L45:
  mov    %eax,%ebx
L123:
  mov    %rbp,%rdi
  mov    %r14,%rcx
  mov    %r13,%rdx
  mov    %r12,%rsi
  xor    %eax,%eax
  call   <scanf@plt>
  mov    0xc(%rsp),%edi
  lea    -0x1(%rdi),%eax
  cmp    $0x3e7,%eax
  ja     L23
  mov    0x10(%rsp),%esi
  lea    -0x1(%rsi),%eax
  cmp    $0x3e7,%eax
  ja     L80
  mov    0x14(%rsp),%edx
  lea    -0x1(%rdx),%eax
  cmp    $0x3e7,%eax
  jbe    L52
  lea    D1(%rip),%rdi
  call   <puts@plt>
  lea    0x1(%rbx),%eax
  cmp    %ebx,0x8(%rsp)
  jg     L45
L24:
  xor    %eax,%eax
L66:
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L81
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L23:
  lea    D74(%rip),%rdi
  call   <puts@plt>
  jmp    L22
  nopl   0x0(%rax)
L31:
  lea    D85(%rip),%rdi
  call   <puts@plt>
  jmp    L22
  nopl   0x0(%rax)
L80:
  lea    D29(%rip),%rdi
  call   <puts@plt>
  jmp    L22
L114:
  lea    D57(%rip),%rdi
  call   <puts@plt>
  mov    $0x1,%eax
  jmp    L66
L81:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D46
type_infered: string
name: read_data
arguments: data_label: D17
type_infered: string
name: read_data
arguments: data_label: D38
type_infered: string
name: read_data
arguments: data_label: D63
type_infered: string
name: read_data
arguments: data_label: D1
type_infered: string
name: read_data
arguments: data_label: D74
type_infered: string
name: read_data
arguments: data_label: D85
type_infered: string
name: read_data
arguments: data_label: D29
type_infered: string
name: read_data
arguments: data_label: D57
type_infered: string

tool: D46: %d

tool: D17: %d %d %d

tool: D38: Case #%d: 

tool: D63: %d


tool: D1: 1 <= k <= 1000

tool: D74: 1 <= a <= 1000

tool: D85: ERROR

tool: D29: 1 <= b <= 1000

tool: D57: Illegal number of tests (1 <= T <= 100)

assistant: ```c
int main(int argc, char **argv) {
  int num_tests, test = 0, ret = 1;
  int round;
  unsigned int a, b, k;
  scanf("%d", &num_tests);
  if (num_tests < 1 || num_tests > 100) {
    printf("Illegal number of tests (1 <= T <= 100)\n");
    goto out;
  }
  while (test++ < num_tests) {
    scanf("%d %d %d", &a, &b, &k);
    if (a < 1 || a > 1000) {
      printf("1 <= a <= 1000\n");
      continue;
    }
    if (b < 1 || b > 1000) {
      printf("1 <= b <= 1000\n");
      continue;
    }
    if (k < 1 || k > 1000) {
      printf("1 <= k <= 1000\n");
      continue;
    }
    round = solve(a, b, k);
    printf("Case #%d: ", test);
    if (round < 0)
      printf("ERROR\n");
    else
      printf("%d\n", round);
  }
  ret = 0;
out:
  return ret;
}
```