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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x38(%rbp),%rax
  mov    %rax,%rsi
  lea    D7(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  mov    -0x38(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x18(%rbp)
  mov    -0x38(%rbp),%eax
  cltq
  shl    $0x3,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x10(%rbp)
  movl   $0x0,-0x30(%rbp)
  jmp    L115
L83:
  mov    -0x38(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    -0x30(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x10(%rbp),%rdx
  add    %rcx,%rdx
  mov    %rax,(%rdx)
  addl   $0x1,-0x30(%rbp)
L115:
  mov    -0x38(%rbp),%eax
  cmp    %eax,-0x30(%rbp)
  jl     L83
  movl   $0x0,-0x2c(%rbp)
  jmp    L146
L141:
  movl   $0x0,-0x28(%rbp)
  jmp    L80
L51:
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x28(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    %rax,%rsi
  lea    D7(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  addl   $0x1,-0x28(%rbp)
L80:
  mov    -0x38(%rbp),%eax
  cmp    %eax,-0x28(%rbp)
  jl     L51
  addl   $0x1,-0x2c(%rbp)
L146:
  mov    -0x38(%rbp),%eax
  cmp    %eax,-0x2c(%rbp)
  jl     L141
  lea    -0x34(%rbp),%rax
  mov    %rax,%rsi
  lea    D7(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  movl   $0x0,-0x24(%rbp)
  jmp    L97
L17:
  movl   $0x0,-0x20(%rbp)
  jmp    L123
L117:
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x20(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jne    L48
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    -0x20(%rbp),%edx
  add    $0x1,%edx
  mov    %edx,(%rax)
  jmp    L121
L48:
  addl   $0x1,-0x20(%rbp)
L123:
  mov    -0x38(%rbp),%eax
  cmp    %eax,-0x20(%rbp)
  jl     L117
L121:
  addl   $0x1,-0x24(%rbp)
L97:
  mov    -0x38(%rbp),%eax
  cmp    %eax,-0x24(%rbp)
  jl     L17
  movl   $0x0,-0x1c(%rbp)
  jmp    L64
L100:
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,%esi
  lea    D35(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  addl   $0x1,-0x1c(%rbp)
L64:
  mov    -0x38(%rbp),%eax
  cmp    %eax,-0x1c(%rbp)
  jl     L100
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L99
  call   <__stack_chk_fail@plt>
L99:
  leave
  ret
```

tool_calls: name: parse_data
arguments: tag: D7
type_infered: string
name: parse_data
arguments: tag: D35
type_infered: string

tool: D7: %d

tool: D35: %d 

assistant: ```c
int main() {
  int **a, n, c;
  scanf("%d", &n);
  int *b;
  b = (int *)malloc(n * sizeof(int));
  a = (int **)malloc(n * sizeof(int *));
  for (int p = 0; p < n; p++) {
    a[p] = (int *)malloc(n * sizeof(int));
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      scanf("%d", &a[i][j]);
    }
  }
  scanf("%d", &c);
  for (int q = 0; q < n; q++) {
    for (int r = 0; r < n; r++) {
      if (a[q][r] == 0) {
        b[q] = r + 1;
        break;
      }
    }
  }
  for (int j = 0; j < n; j++) {
    printf("%d ", b[j]);
  }
  return 0;
}
```