user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    -0x31000(%rsp),%r11
L68:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L68
  sub    $0x7e8,%rsp
  xor    %r14d,%r14d
  lea    D1(%rip),%r12
  mov    %fs:0x28,%rax
  mov    %rax,0x317d8(%rsp)
  xor    %eax,%eax
  lea    0x28(%rsp),%rax
  movq   $0x0,(%rsp)
  lea    0x31740(%rsp),%r15
  mov    %rax,0x18(%rsp)
  lea    0x20(%rsp),%rax
  mov    %rax,0x10(%rsp)
  lea    0x5820(%rsp),%rax
  mov    %rax,0x8(%rsp)
  nopl   0x0(%rax)
L209:
  mov    %r15,%rdi
  call   <gets@plt>
  mov    0x18(%rsp),%rcx
  mov    0x10(%rsp),%rdx
  mov    %r15,%rdi
  lea    D10(%rip),%rsi
  call   <sscanf@plt>
  mov    0x20(%rsp),%rbp
  test   %rbp,%rbp
  jne    L148
  cmpq   $0x0,0x28(%rsp)
  je     L81
  mov    0x8(%rsp),%rdi
  mov    $0x2bf20,%edx
  xor    %esi,%esi
  call   <memset@plt>
L54:
  cmp    $0x1,%r14
  je     L179
  cs nopw 0x0(%rax,%rax,1)
L72:
  addq   $0x1,(%rsp)
  mov    (%rsp),%rsi
  xor    %eax,%eax
  lea    D3(%rip),%rdi
  call   <printf@plt>
  cmpq   $0x0,0x20(%rsp)
  jle    L94
  mov    0x8(%rsp),%rbp
  lea    0x30(%rsp),%rbx
  xor    %r13d,%r13d
  nopl   0x0(%rax)
L50:
  xor    %r14d,%r14d
  cmpq   $0x0,0x28(%rsp)
  jg     L172
  jmp    L56
  nopl   (%rax)
L170:
  mov    0x0(%rbp,%r14,8),%rsi
  mov    %r12,%rdi
  xor    %eax,%eax
  add    $0x1,%r14
  call   <printf@plt>
  cmp    %r14,0x28(%rsp)
  jle    L56
L172:
  cmpb   $0x2a,(%rbx,%r14,1)
  jne    L170
  mov    $0x2a,%edi
  add    $0x1,%r14
  call   <putchar@plt>
  cmp    %r14,0x28(%rsp)
  jg     L172
L56:
  mov    $0xa,%edi
  add    $0x1,%r13
  add    $0x4b0,%rbp
  add    $0x96,%rbx
  call   <putchar@plt>
  cmp    %r13,0x20(%rsp)
  jg     L50
L94:
  mov    $0x1,%r14d
  jmp    L209
L148:
  mov    0x8(%rsp),%rdi
  xor    %esi,%esi
  mov    $0x2bf20,%edx
  call   <memset@plt>
  test   %rbp,%rbp
  jle    L54
  lea    0x30(%rsp),%rbp
  xor    %r13d,%r13d
  mov    %rbp,%rbx
  nopl   0x0(%rax)
L169:
  mov    %rbx,%rdi
  add    $0x1,%r13
  add    $0x96,%rbx
  call   <gets@plt>
  mov    0x20(%rsp),%rax
  cmp    %r13,%rax
  jg     L169
  test   %rax,%rax
  jle    L54
  mov    0x28(%rsp),%r8
  imul   $0x96,%rax,%rax
  mov    0x8(%rsp),%rbx
  mov    %r8,%r9
  lea    0x4b0(%rbx,%r8,8),%rsi
  neg    %r9
  lea    (%rax,%rbp,1),%rdi
  shl    $0x3,%r9
  lea    -0x4a8(%r9),%r10
  nopl   0x0(%rax)
L49:
  lea    (%r10,%rsi,1),%rax
  lea    (%rsi,%r9,1),%rdx
  mov    %rbp,%rcx
  test   %r8,%r8
  jle    L210
  nopl   0x0(%rax,%rax,1)
L161:
  cmpb   $0x2a,(%rcx)
  jne    L0
  addq   $0x1,(%rax)
  addq   $0x1,0x8(%rdx)
  addq   $0x1,(%rdx)
  addq   $0x1,-0x8(%rdx)
  addq   $0x1,-0x10(%rax)
  addq   $0x1,-0x4c0(%rax)
  addq   $0x1,-0x4b8(%rax)
  addq   $0x1,-0x4b0(%rax)
L0:
  add    $0x8,%rdx
  add    $0x1,%rcx
  add    $0x8,%rax
  cmp    %rsi,%rdx
  jne    L161
L210:
  add    $0x96,%rbp
  add    $0x4b0,%rsi
  cmp    %rdi,%rbp
  jne    L49
  cmp    $0x1,%r14
  jne    L72
L179:
  mov    $0xa,%edi
  call   <putchar@plt>
  jmp    L72
L81:
  mov    0x317d8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L96
  add    $0x317e8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L96:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: tag: D1
data_type: string
name: disassemble_data
arguments: tag: D10
data_type: string
name: disassemble_data
arguments: tag: D3
data_type: string

tool: D1: %ld

tool: D10: %ld%ld

tool: D3: Field #%ld:


assistant: ```c
int main() {
  char a[150][150], c[150];
  long int i, j, l = 0, n, m, flag = 0;
  while (1) {
    gets(c);
    sscanf(c, "%ld%ld", &n, &m);
    if (n == 0 && m == 0)
      break;
    long b[150][150] = {0};
    for (i = 0; i < n; i++)
      gets(a[i]);
    for (i = 0; i < n; i++) {
      for (j = 0; j < m; j++) {
        if (a[i][j] == '*') {
          b[i][j + 1]++;
          b[i + 1][j + 1]++;
          b[i + 1][j]++;
          b[i + 1][j - 1]++;
          b[i][j - 1]++;
          b[i - 1][j - 1]++;
          b[i - 1][j]++;
          b[i - 1][j + 1]++;
        }
      }
    }
    if (flag == 1)
      printf("\n");
    flag = 1;
    printf("Field #%ld:\n", ++l);
    for (i = 0; i < n; i++) {
      for (j = 0; j < m; j++) {
        if (a[i][j] == '*')
          printf("%c", a[i][j]);
        else
          printf("%ld", b[i][j]);
      }
      printf("\n");
    }
  }
  return 0;
}
```