user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    -0x249000(%rsp),%r11
L146:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L146
  sub    $0xf38,%rsp
  lea    D7(%rip),%r13
  mov    %fs:0x28,%rax
  mov    %rax,0x249f28(%rsp)
  xor    %eax,%eax
  lea    0x1c(%rsp),%rax
  movl   $0x1,0x4(%rsp)
  mov    %rax,0x8(%rsp)
  nopw   0x0(%rax,%rax,1)
L39:
  mov    0x8(%rsp),%rsi
  mov    %r13,%rdi
  call   <scanf@plt>
  mov    0x1c(%rsp),%ecx
  test   %ecx,%ecx
  je     L106
  jle    L129
  lea    0x38(%rsp),%r12
  xor    %ebp,%ebp
  xor    %ebx,%ebx
  xor    %r14d,%r14d
  nopl   0x0(%rax,%rax,1)
L23:
  lea    -0x18(%r12),%r15
L149:
  mov    %r15,%rsi
  mov    %r13,%rdi
  call   <scanf@plt>
  lea    (%r15,%rbx,1),%rax
  add    $0x8,%r15
  movl   $0x3b9ac9ff,0x4(%rax,%rbp,1)
  cmp    %r12,%r15
  jne    L149
  mov    0x1c(%rsp),%ecx
  add    $0x1,%r14
  sub    $0x18,%rbx
  add    $0x18,%rbp
  lea    0x18(%r15),%r12
  cmp    %r14d,%ecx
  jg     L23
  movl   $0x0,0x2c(%rsp)
  test   %ecx,%ecx
  jle    L40
  lea    0x28(%rsp),%rbx
  xor    %edi,%edi
  xor    %r12d,%r12d
  jmp    L147
  nopw   0x0(%rax,%rax,1)
L114:
  add    0x8(%rbx),%eax
  mov    %eax,0xc(%rbx)
L36:
  cmp    %ebp,%ecx
  jle    L40
L53:
  mov    0x10(%rbx),%edi
  add    0x14(%rbx),%edi
  mov    %edi,0x14(%rbx)
  mov    0x1c(%rbx),%esi
  call   <min@plt>
  mov    %eax,0x1c(%rbx)
  mov    %eax,%edi
  mov    0x1c(%rsp),%eax
  sub    $0x1,%eax
  cmp    %ebp,%eax
  jg     L157
L52:
  add    $0x18,%rbx
  mov    %ebp,%r12d
L147:
  add    (%rbx),%edi
  mov    0xc(%rbx),%esi
  lea    0x1(%r12),%ebp
  mov    %edi,0x4(%rbx)
  call   <min@plt>
  mov    0x1c(%rsp),%ecx
  mov    %eax,0xc(%rbx)
  lea    -0x1(%rcx),%edx
  cmp    %r12d,%edx
  jle    L114
  mov    0x14(%rbx),%esi
  mov    0x4(%rbx),%edi
  call   <min@plt>
  mov    0x1c(%rbx),%esi
  mov    0x4(%rbx),%edi
  mov    %eax,0x14(%rbx)
  call   <min@plt>
  mov    0x4(%rbx),%edi
  mov    0x24(%rbx),%esi
  mov    %eax,0x1c(%rbx)
  call   <min@plt>
  mov    0x1c(%rsp),%ecx
  mov    0xc(%rbx),%edi
  mov    %eax,0x24(%rbx)
  add    0x8(%rbx),%edi
  lea    -0x1(%rcx),%eax
  mov    %edi,0xc(%rbx)
  cmp    %eax,%r12d
  jge    L36
  mov    0x1c(%rbx),%esi
  call   <min@plt>
  mov    0x24(%rbx),%esi
  mov    0xc(%rbx),%edi
  mov    %eax,0x1c(%rbx)
  call   <min@plt>
  mov    0x1c(%rsp),%ecx
  mov    %eax,0x24(%rbx)
  cmp    %ebp,%ecx
  jg     L53
L40:
  sub    $0x1,%ecx
  mov    0x4(%rsp),%ebx
  lea    D4(%rip),%rdi
  movslq %ecx,%rcx
  lea    (%rcx,%rcx,2),%rax
  mov    %ebx,%esi
  mov    0x2c(%rsp,%rax,8),%edx
  call   <printf@plt>
  mov    %ebx,%eax
  add    $0x1,%eax
  mov    %eax,0x4(%rsp)
  jmp    L39
  nopl   0x0(%rax)
L157:
  mov    0x2c(%rbx),%esi
  mov    0x14(%rbx),%edi
  call   <min@plt>
  mov    0x14(%rbx),%edi
  mov    0x34(%rbx),%esi
  mov    %eax,0x2c(%rbx)
  call   <min@plt>
  mov    0x1c(%rbx),%edi
  mov    %eax,0x34(%rbx)
  jmp    L52
L106:
  mov    0x249f28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L151
  add    $0x249f38,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L129:
  movl   $0x0,0x2c(%rsp)
  jmp    L40
L151:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D7
data_type: string
name: extract_symbolic_data
arguments: data_tag: D4
data_type: string

tool: D7: %d

tool: D4: %d. %d


assistant: ```c
int main() {
  int i, j, q, N;
  int A[100000][3][2];
  for (q = 1;; ++q) {
    scanf("%d", &N);
    if (!N) {
      break;
    }
    for (i = 0; i < N; ++i) {
      for (j = 0; j < 3; ++j) {
        scanf("%d", &A[i][j][0]);
        A[i][j][1] = 999999999;
      }
    }
    A[0][1][1] = 0;
    for (i = 0; i < N; ++i) {
      if (i > 0) {
        A[i][0][1] += A[i][0][0];
        A[i][1][1] = min(A[i][0][1], A[i][1][1]);
        if (i < N - 1) {
          A[i + 1][0][1] = min(A[i][0][1], A[i + 1][0][1]);
          A[i + 1][1][1] = min(A[i][0][1], A[i + 1][1][1]);
        }
      }
      A[i][1][1] += A[i][1][0];
      A[i][2][1] = min(A[i][1][1], A[i][2][1]);
      if (i < N - 1) {
        A[i + 1][0][1] = min(A[i][1][1], A[i + 1][0][1]);
        A[i + 1][1][1] = min(A[i][1][1], A[i + 1][1][1]);
        A[i + 1][2][1] = min(A[i][1][1], A[i + 1][2][1]);
      }
      A[i][2][1] += A[i][2][0];
      if (i < N - 1) {
        A[i + 1][1][1] = min(A[i][2][1], A[i + 1][1][1]);
        A[i + 1][2][1] = min(A[i][2][1], A[i + 1][2][1]);
      }
    }
    printf("%d. %d\n", q, A[N - 1][1][1]);
  }
  return 0;
}
```