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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %edi,-0x34(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    D64(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  movl   $0x0,-0x24(%rbp)
  jmp    L60
L49:
  lea    D52(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmpl   $0x4,-0x24(%rbp)
  jg     L43
  mov    -0x24(%rbp),%eax
  sub    $0x2,%eax
  mov    %eax,-0x18(%rbp)
  movl   $0x1,-0x20(%rbp)
  jmp    L99
L29:
  mov    -0x18(%rbp),%eax
  imul   -0x20(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,%ecx
  mov    -0x20(%rbp),%eax
  mov    %eax,%edx
  mov    %ecx,%esi
  lea    D16(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmpl   $0x2,-0x20(%rbp)
  jg     L85
  mov    $0x2c,%edi
  call   <putchar@plt>
L85:
  addl   $0x1,-0x20(%rbp)
L99:
  cmpl   $0x3,-0x20(%rbp)
  jle    L29
  jmp    L73
L43:
  mov    $0x6,%eax
  sub    -0x24(%rbp),%eax
  mov    %eax,-0x18(%rbp)
  movl   $0x1,-0x1c(%rbp)
  jmp    L105
L101:
  mov    -0x18(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,%edx
  mov    -0x1c(%rbp),%eax
  mov    %eax,%esi
  lea    D16(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmpl   $0x2,-0x1c(%rbp)
  jg     L4
  mov    $0x2c,%edi
  call   <putchar@plt>
L4:
  addl   $0x1,-0x1c(%rbp)
L105:
  cmpl   $0x3,-0x1c(%rbp)
  jle    L101
L73:
  lea    D69(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmpl   $0xe,-0x24(%rbp)
  jg     L52
  lea    D27(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
L52:
  addl   $0x1,-0x24(%rbp)
L60:
  cmpl   $0x7,-0x24(%rbp)
  jle    L49
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L26
  call   <__stack_chk_fail@plt>
L26:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: label: D64
type_guessed: string
name: extract_symbolic_data
arguments: label: D52
type_guessed: string
name: extract_symbolic_data
arguments: label: D16
type_guessed: string
name: extract_symbolic_data
arguments: label: D69
type_guessed: string
name: extract_symbolic_data
arguments: label: D27
type_guessed: string
name: extract_symbolic_data
arguments: label: D2
type_guessed: string

tool: D64: int direction_offsets_table[8][3] = {

tool: D52:   {

tool: D16: %2i*OD_FILT_BSTRIDE + %2i

tool: D69:  }

tool: D27: ,

tool: D2: 
};

assistant: ```c
int main(int argc, char **argv) {
  printf("int direction_offsets_table[8][3] = {\n");
  int offset[3];
  for (int dir = 0; dir < 8; dir++) {
    int k;
    int f;
    printf("  {");
    if (dir <= 4) {
      f = dir - 2;
      for (int k = 1; k <= 3; k++) {
        printf("%2i*OD_FILT_BSTRIDE + %2i", f * k / 2, k);
        if (k < 3) {
          printf(",");
        }
      }
    } else {
      f = 6 - dir;
      for (int k = 1; k <= 3; k++) {
        printf("%2i*OD_FILT_BSTRIDE + %2i", k, f * k / 2);
        if (k < 3) {
          printf(",");
        }
      }
    }
    printf(" }");
    if (dir < 15) {
      printf(",\n");
    }
  }
  printf("\n};\n");
}
```