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

```asm
<extract2>:
  endbr64
  push   %r15
  mov    %rdi,%r15
  push   %r14
  mov    %rsi,%r14
  push   %r13
  push   %r12
  mov    %edx,%r12d
  push   %rbp
  mov    %r8d,%ebp
  push   %rbx
  sub    $0x188,%rsp
  mov    0x1d0(%rsp),%rax
  mov    %edx,0x4c(%rsp)
  mov    %r9,0x30(%rsp)
  mov    0x1c8(%rsp),%r13d
  mov    %rax,0x50(%rsp)
  mov    0x1d8(%rsp),%rax
  mov    0x1e0(%rsp),%rbx
  mov    %rax,0x58(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x178(%rsp)
  xor    %eax,%eax
  call   <rewind@plt>
  test   %ebp,%ebp
  jle    L230
  lea    -0x1(%rbp),%eax
  mov    0x30(%rsp),%rcx
  mov    %rbx,0x18(%rsp)
  lea    (%rax,%rax,4),%rax
  lea    0x14(%rbx,%rax,4),%rax
  mov    %rax,0x40(%rsp)
  lea    -0x1(%r12),%eax
  lea    0x4(%rcx,%rax,4),%rax
  mov    %rax,0x38(%rsp)
L57:
  mov    0x4c(%rsp),%eax
  test   %eax,%eax
  jle    L6
  mov    0x50(%rsp),%rax
  mov    %rax,0x20(%rsp)
  mov    0x30(%rsp),%rax
  mov    %rax,0x28(%rsp)
L135:
  mov    0x58(%rsp),%rax
  movl   $0x0,0x48(%rsp)
  mov    %rax,0x10(%rsp)
  mov    0x28(%rsp),%rax
  mov    (%rax),%edx
  test   %edx,%edx
  jle    L18
  nop
L243:
  cmpl   $0x1,0x208(%rsp)
  je     L34
L101:
  mov    0x10(%rsp),%rcx
  mov    0x20(%rsp),%rdx
  mov    %r15,%rdi
  mov    0x18(%rsp),%rsi
  call   <find_TSVL@plt>
  mov    %rax,%r15
  test   %rax,%rax
  je     L60
  mov    $0xe,%ebx
  lea    0x70(%rsp),%rbp
  nopl   0x0(%rax,%rax,1)
L45:
  mov    $0xff,%esi
  mov    %rbp,%rdi
  mov    %r15,%rdx
  call   <fgets@plt>
  mov    %r14,%rsi
  mov    %rbp,%rdi
  call   <fputs@plt>
  sub    $0x1,%ebx
  jne    L45
  mov    0x1c0(%rsp),%esi
  movl   $0x0,0x8(%rsp)
  mov    $0x1,%eax
  lea    D37(%rip),%rbp
  test   %esi,%esi
  jle    L24
  mov    %r14,(%rsp)
  mov    %eax,%r12d
  nopw   0x0(%rax,%rax,1)
L222:
  test   %r13d,%r13d
  jle    L263
  cmp    %r12d,0x200(%rsp)
  jl     L39
  mov    $0x1,%r14d
  lea    0x6c(%rsp),%rbx
  cmp    %r12d,0x1f8(%rsp)
  jg     L39
  mov    %r12d,0xc(%rsp)
  mov    %r14d,%r12d
  mov    %rbx,%r14
  mov    0x1f0(%rsp),%ebx
  jmp    L115
  nopl   0x0(%rax)
L116:
  mov    (%rsp),%rdi
  lea    D20(%rip),%rsi
  mov    $0x1,%eax
  call   <fprintf@plt>
  movl   $0x0,0x8(%rsp)
  nopl   (%rax)
L151:
  add    $0x1,%r12d
  cmp    %r12d,%r13d
  jl     L253
L115:
  mov    %r14,%rdx
  mov    %rbp,%rsi
  mov    %r15,%rdi
  call   <fscanf@plt>
  cmp    %r12d,%ebx
  jg     L151
  cmp    %r12d,0x1e8(%rsp)
  jl     L151
  addl   $0x1,0x8(%rsp)
  mov    0x8(%rsp),%eax
  pxor   %xmm0,%xmm0
  cvtss2sd 0x6c(%rsp),%xmm0
  cmp    $0x7,%eax
  jg     L116
  mov    (%rsp),%rdi
  lea    D3(%rip),%rsi
  mov    $0x1,%eax
  add    $0x1,%r12d
  call   <fprintf@plt>
  cmp    %r12d,%r13d
  jge    L115
  nopl   0x0(%rax)
L253:
  mov    0xc(%rsp),%r12d
L263:
  add    $0x1,%r12d
  cmp    %r12d,0x1c0(%rsp)
  jge    L222
L100:
  mov    0x8(%rsp),%ecx
  mov    (%rsp),%r14
  test   %ecx,%ecx
  je     L24
  mov    %r14,%rsi
  mov    $0xa,%edi
  call   <fputc@plt>
L24:
  mov    0x28(%rsp),%rcx
  addl   $0x1,0x48(%rsp)
  addq   $0xa,0x10(%rsp)
  mov    0x48(%rsp),%eax
  cmp    %eax,(%rcx)
  jg     L243
L18:
  addq   $0x4,0x28(%rsp)
  mov    0x28(%rsp),%rax
  addq   $0xa,0x20(%rsp)
  cmp    %rax,0x38(%rsp)
  jne    L135
L6:
  addq   $0x14,0x18(%rsp)
  mov    0x18(%rsp),%rax
  cmp    0x40(%rsp),%rax
  jne    L57
L230:
  xor    %eax,%eax
  jmp    L50
  nopw   0x0(%rax,%rax,1)
L39:
  mov    $0x1,%r14d
  lea    0x6c(%rsp),%rbx
  nopl   0x0(%rax,%rax,1)
L265:
  mov    %rbx,%rdx
  mov    %rbp,%rsi
  mov    %r15,%rdi
  add    $0x1,%r14d
  call   <fscanf@plt>
  cmp    %r14d,%r13d
  jge    L265
  add    $0x1,%r12d
  cmp    %r12d,0x1c0(%rsp)
  jge    L222
  jmp    L100
L34:
  mov    0x10(%rsp),%rcx
  mov    0x20(%rsp),%rdx
  lea    D31(%rip),%rdi
  mov    0x18(%rsp),%rsi
  call   <printf@plt>
  jmp    L101
L60:
  mov    $0xffffffff,%eax
L50:
  mov    0x178(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L7
  add    $0x188,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L7:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D37
data_type: string
name: retrieve_data
arguments: tag: D20
data_type: string
name: retrieve_data
arguments: tag: D3
data_type: string
name: retrieve_data
arguments: tag: D31
data_type: string

tool: D37:  %f

tool: D20: %.6e


tool: D3: %.6e 

tool: D31: [%s][%s][%s]


assistant: ```c
int extract2(FILE *fpin, FILE *fpout, int NumVars, int NumLev, int NumTimes, int Nl[], int Nr, int Nc, char VarName[][10], char LevName[][10], char TStepName[][20], int east_bound, int west_bound, int north_bound, int south_bound, int flag_i) {
  int it, iv, ir, ic, il, skip, val_cnt;
  float val;
  char inStr[255];
  rewind(fpin);
  for (it = 0; it < NumTimes; it++) {
    for (iv = 0; iv < NumVars; iv++) {
      for (il = 0; il < Nl[iv]; il++) {
        if (flag_i == 1)
          printf("[%s][%s][%s]\n", TStepName[it], VarName[iv], LevName[il]);
        fpin = find_TSVL(fpin, TStepName[it], VarName[iv], LevName[il]);
        if (fpin == NULL)
          goto err;
        for (skip = 1; skip <= 14; skip++) {
          fgets(inStr, 255, fpin);
          fprintf(fpout, "%s", inStr);
        }
        val_cnt = 0;
        for (ir = 1; ir <= Nr; ir++) {
          for (ic = 1; ic <= Nc; ic++) {
            fscanf(fpin, " %f", &val);
            if ((ir <= south_bound) && (ir >= north_bound) && (ic >= west_bound) && (ic <= east_bound)) {
              val_cnt++;
              if (val_cnt >= 8) {
                fprintf(fpout, "%.6e\n", val);
                val_cnt = 0;
              } else
                fprintf(fpout, "%.6e ", val);
            }
          }
        }
        if (val_cnt != 0) {
          fprintf(fpout, "\n");
          val_cnt = 0;
        }
      }
    }
  }
  return 0;
err:
  return -1;
}
```