user: 请将以下的汇编代码转换成C语言代码：

```asm
<main>:
  endbr64
  push   %r15
  lea    D10(%rip),%rdi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  lea    0x24(%rsp),%rsi
  call   <scanf@plt>
  mov    0x24(%rsp),%ebx
  test   %ebx,%ebx
  jle    L34
  lea    0x34(%rsp),%rax
  movl   $0x0,0x4(%rsp)
  lea    D27(%rip),%r14
  mov    %rax,0x10(%rsp)
  lea    0x30(%rsp),%rax
  mov    %rax,0x18(%rsp)
  nopw   0x0(%rax,%rax,1)
L5:
  mov    0x10(%rsp),%rdx
  mov    0x18(%rsp),%rsi
  lea    D12(%rip),%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  mov    $0x8,%esi
  mov    $0x989680,%edi
  call   <calloc@plt>
  mov    $0x8,%esi
  mov    $0x989680,%edi
  mov    %rax,%r12
  call   <calloc@plt>
  mov    0x30(%rsp),%edi
  mov    $0x8,%esi
  mov    %rax,%rbp
  call   <calloc@plt>
  mov    %rax,0x8(%rsp)
  mov    0x30(%rsp),%eax
  test   %eax,%eax
  jle    L63
  xor    %r15d,%r15d
  lea    0x2c(%rsp),%r13
  lea    0x28(%rsp),%rbx
  nopl   0x0(%rax)
L64:
  mov    %r13,%rdx
  mov    %rbx,%rsi
  mov    %r14,%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  push   $0x1
  mov    0x34(%rsp),%eax
  xor    %ecx,%ecx
  mov    $0x1,%edx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  add    $0x1,%r15d
  push   %rax
  mov    0x40(%rsp),%eax
  mov    0x38(%rsp),%r9d
  lea    -0x1(%rax),%r8d
  call   <update_tree@plt>
  mov    0x40(%rsp),%eax
  pop    %r10
  pop    %r11
  cmp    %r15d,%eax
  jg     L64
L63:
  mov    0x34(%rsp),%edx
  sub    $0x8,%rsp
  xor    %r9d,%r9d
  lea    -0x1(%rax),%r8d
  xor    %ecx,%ecx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  mov    %edx,%r15d
  sub    $0x1,%edx
  push   %rdx
  imul   %eax,%r15d
  mov    $0x1,%edx
  call   <query_tree@plt>
  mov    0x44(%rsp),%edx
  sub    %eax,%r15d
  mov    0x40(%rsp),%eax
  pop    %r8
  pop    %r9
  cmp    %edx,%eax
  jle    L40
  mov    $0x1,%r13d
  nopl   0x0(%rax)
L38:
  mov    %eax,%ebx
  sub    $0x8,%rsp
  xor    %ecx,%ecx
  mov    %r13d,%r9d
  imul   %edx,%ebx
  lea    -0x1(%rdx,%r13,1),%edx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  push   %rdx
  lea    -0x1(%rax),%r8d
  mov    $0x1,%edx
  call   <query_tree@plt>
  mov    0x44(%rsp),%edx
  mov    %eax,%r8d
  mov    %ebx,%eax
  sub    %r8d,%eax
  cmp    %eax,%r15d
  cmovg  %eax,%r15d
  mov    0x40(%rsp),%eax
  add    $0x1,%r13d
  pop    %rsi
  pop    %rdi
  mov    %eax,%ecx
  sub    %edx,%ecx
  cmp    %r13d,%ecx
  jge    L38
L40:
  mov    %r15d,%esi
  lea    D21(%rip),%rdi
  call   <printf@plt>
  mov    %r12,%rdi
  call   <free@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    0x8(%rsp),%rdi
  call   <free@plt>
  addl   $0x1,0x4(%rsp)
  mov    0x4(%rsp),%eax
  cmp    %eax,0x24(%rsp)
  jg     L5
L34:
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L66
  add    $0x48,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L66:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: tag: D10
data_type: string
name: parse_data
arguments: tag: D27
data_type: string
name: parse_data
arguments: tag: D12
data_type: string
name: parse_data
arguments: tag: D21
data_type: string

tool: D10: %d

tool: D27: %d%d

tool: D12: %d %d

tool: D21: %d


assistant: ```c
int main(void) {
  int t, li, hi;
  scanf("%d", &t);
  int a;
  for (a = 0; a < t; a++) {
    int g, h;
    scanf("%d %d", &g, &h);
    int i;
    int *tree = (int *)calloc(10000000, 8);
    int *lazy = (int *)calloc(10000000, 8);
    int *arr = (int *)calloc(g, 8);
    for (i = 0; i < g; i++) {
      scanf("%d%d", &li, &hi);
      update_tree(tree, lazy, 1, 0, g - 1, li, hi, 1);
    }
    int min = g * h - query_tree(tree, lazy, 1, 0, g - 1, 0, h - 1);
    for (i = 1; i < g - h + 1; i++) {
      int y = g * h - query_tree(tree, lazy, 1, 0, g - 1, i, i + h - 1);
      if (y < min)
        min = y;
    }
    printf("%d\n", min);
    free(tree);
    free(lazy);
    free(arr);
  }
}
```