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

```asm
<create_main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %edi,%r15d
  mov    %edi,0xc(%rsp)
  mov    %esi,%r14d
  mov    %esi,0x8(%rsp)
  mov    %edx,%r13d
  lea    D218(%rip),%rsi
  lea    D25(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%rbp
  mov    %rax,%rcx
  mov    $0x3,%edx
  mov    $0x1,%esi
  lea    D109(%rip),%rbx
  mov    %rbx,%rdi
  call   <fwrite@plt>
  mov    %rbp,%rcx
  mov    $0x3,%edx
  mov    $0x1,%esi
  mov    %rbx,%rdi
  call   <fwrite@plt>
  mov    %rbp,%rcx
  mov    $0x13,%edx
  mov    $0x1,%esi
  lea    D74(%rip),%rdi
  call   <fwrite@plt>
  mov    %rbp,%rcx
  mov    $0x14,%edx
  mov    $0x1,%esi
  lea    D142(%rip),%rdi
  call   <fwrite@plt>
  mov    %rbp,%rcx
  mov    $0x14,%edx
  mov    $0x1,%esi
  lea    D183(%rip),%rdi
  call   <fwrite@plt>
  mov    %rbp,%rcx
  mov    $0x1f,%edx
  mov    $0x1,%esi
  lea    D72(%rip),%rdi
  call   <fwrite@plt>
  mov    %rbp,%rcx
  mov    $0x14,%edx
  mov    $0x1,%esi
  lea    D41(%rip),%rdi
  call   <fwrite@plt>
  mov    %rbp,%rsi
  mov    $0xa,%edi
  call   <fputc@plt>
  mov    %rbp,%rcx
  mov    $0x21,%edx
  mov    $0x1,%esi
  lea    D152(%rip),%rdi
  call   <fwrite@plt>
  mov    %rbp,%rcx
  mov    $0x2,%edx
  mov    $0x1,%esi
  lea    D99(%rip),%rdi
  call   <fwrite@plt>
  mov    %rbp,%rcx
  mov    $0x11,%edx
  mov    $0x1,%esi
  lea    D245(%rip),%rdi
  call   <fwrite@plt>
  mov    %rbp,%rcx
  mov    $0xb,%edx
  mov    $0x1,%esi
  lea    D263(%rip),%rdi
  call   <fwrite@plt>
  mov    %rbp,%rcx
  mov    $0x16,%edx
  mov    $0x1,%esi
  lea    D256(%rip),%rdi
  call   <fwrite@plt>
  mov    %rbp,%rcx
  mov    $0x15,%edx
  mov    $0x1,%esi
  lea    D144(%rip),%rdi
  call   <fwrite@plt>
  mov    %r14d,%edx
  imul   %r13d,%edx
  mov    %r15d,%ebx
  imul   %r15d,%edx
  lea    D55(%rip),%rsi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    %rbp,%rcx
  mov    $0x32,%edx
  mov    $0x1,%esi
  lea    D135(%rip),%rdi
  call   <fwrite@plt>
  mov    %rbp,%rcx
  mov    $0x19,%edx
  mov    $0x1,%esi
  lea    D215(%rip),%rdi
  call   <fwrite@plt>
  mov    $0x0,%r14d
  lea    D262(%rip),%r15
  test   %ebx,%ebx
  jg     L30
  mov    %rbp,%rcx
  mov    $0x16,%edx
  mov    $0x1,%esi
  lea    D33(%rip),%rdi
  call   <fwrite@plt>
  mov    %rbp,%rcx
  mov    $0x6,%edx
  mov    $0x1,%esi
  lea    D100(%rip),%rdi
  call   <fwrite@plt>
L69:
  mov    %rbp,%rcx
  mov    $0x3,%edx
  mov    $0x1,%esi
  lea    D116(%rip),%rdi
  call   <fwrite@plt>
  mov    %rbp,%rsi
  mov    $0xa,%edi
  call   <fputc@plt>
  mov    %rbp,%rcx
  mov    $0xb,%edx
  mov    $0x1,%esi
  lea    D27(%rip),%rdi
  call   <fwrite@plt>
  mov    %rbp,%rcx
  mov    $0x2,%edx
  mov    $0x1,%esi
  lea    D159(%rip),%rdi
  call   <fwrite@plt>
  mov    %rbp,%rdi
  call   <fclose@plt>
  mov    $0x0,%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L91:
  mov    %ebx,%r8d
  mov    %r12d,%ecx
  mov    %r14d,%edx
  mov    %r15,%rsi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    %rbp,%rcx
  mov    $0x7,%edx
  mov    $0x1,%esi
  lea    D270(%rip),%rdi
  call   <fwrite@plt>
  add    $0x1,%ebx
  cmp    %ebx,%r13d
  jne    L91
L67:
  add    $0x1,%r12d
  cmp    %r12d,0x8(%rsp)
  je     L87
L124:
  mov    $0x0,%ebx
  test   %r13d,%r13d
  jg     L91
  jmp    L67
L87:
  lea    0x1(%r14),%eax
  cmp    %eax,0xc(%rsp)
  je     L61
  mov    %eax,%r14d
L30:
  mov    $0x0,%r12d
  cmpl   $0x0,0x8(%rsp)
  jg     L124
  jmp    L87
L17:
  mov    %rbp,%rcx
  mov    $0x13,%edx
  mov    $0x1,%esi
  mov    %r12,%rdi
  call   <fwrite@plt>
  mov    %r13d,%edx
  mov    %r15,%rsi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  add    $0x1,%ebx
  cmp    %ebx,0x8(%rsp)
  jne    L17
L22:
  mov    0xc(%rsp),%ecx
  lea    0x1(%rcx),%eax
  cmp    %ecx,%r14d
  je     L69
  mov    %eax,0xc(%rsp)
L121:
  mov    $0x0,%ebx
  cmpl   $0x0,0x8(%rsp)
  jg     L17
  jmp    L22
L61:
  mov    %rbp,%rcx
  mov    $0x16,%edx
  mov    $0x1,%esi
  lea    D33(%rip),%rdi
  call   <fwrite@plt>
  mov    %rbp,%rcx
  mov    $0x6,%edx
  mov    $0x1,%esi
  lea    D100(%rip),%rdi
  call   <fwrite@plt>
  movl   $0x0,0xc(%rsp)
  lea    D47(%rip),%r12
  lea    D248(%rip),%r15
  jmp    L121
```

tool_calls: name: retrieve_data
arguments: label: D218
data_type: string
name: retrieve_data
arguments: label: D25
data_type: string
name: retrieve_data
arguments: label: D109
data_type: string
name: retrieve_data
arguments: label: D74
data_type: string
name: retrieve_data
arguments: label: D142
data_type: string
name: retrieve_data
arguments: label: D183
data_type: string
name: retrieve_data
arguments: label: D72
data_type: string
name: retrieve_data
arguments: label: D41
data_type: string
name: retrieve_data
arguments: label: D152
data_type: string
name: retrieve_data
arguments: label: D99
data_type: string
name: retrieve_data
arguments: label: D245
data_type: string
name: retrieve_data
arguments: label: D263
data_type: string
name: retrieve_data
arguments: label: D256
data_type: string
name: retrieve_data
arguments: label: D144
data_type: string
name: retrieve_data
arguments: label: D55
data_type: string
name: retrieve_data
arguments: label: D135
data_type: string
name: retrieve_data
arguments: label: D215
data_type: string
name: retrieve_data
arguments: label: D262
data_type: string
name: retrieve_data
arguments: label: D33
data_type: string
name: retrieve_data
arguments: label: D100
data_type: string
name: retrieve_data
arguments: label: D116
data_type: string
name: retrieve_data
arguments: label: D27
data_type: string
name: retrieve_data
arguments: label: D159
data_type: string
name: retrieve_data
arguments: label: D270
data_type: string
name: retrieve_data
arguments: label: D47
data_type: string
name: retrieve_data
arguments: label: D248
data_type: string

tool: D218: w+

tool: D25: FOO_main.c

tool: D109: //


tool: D74: #include <stdio.h>


tool: D142: #include <stdlib.h>


tool: D183: #include <malloc.h>


tool: D72: typedef long (*FOO_pt) (long);


tool: D41: FOO_pt *FOO_global;


tool: D152: int main(int argc, char* argv[])


tool: D99: {


tool: D245: #include "FOO.h"


tool: D263: 	long i=0;


tool: D256: 	long j,k,m,n=0,loop;


tool: D144: 	loop=atol(argv[1]);


tool: D55: 	m=%d;


tool: D135: 	FOO_array = (FOO_pt *) malloc(sizeof(FOO_pt)*m);


tool: D215: 	FOO_global = FOO_array;


tool: D262: 		FOO_array[n] = &FOO_%03d_%03d_%03d;


tool: D33: 	for(k=0;k<loop;k++){


tool: D100: 	n=0;


tool: D116: 	}


tool: D27: 	return 0;


tool: D159: }


tool: D270: 		n++;


tool: D47: 		FOO_array[n](n);


tool: D248: 	n+=%d;


assistant: ```c
int create_main(int max_so, int max_chain, int max_depth) {
  int i, j, k, rval;
  FILE *fp_main;
  char filename[100];
  fp_main = fopen("FOO_main.c", "w+");
  fprintf(fp_main, "//\n");
  fprintf(fp_main, "//\n");
  fprintf(fp_main, "#include <stdio.h>\n");
  fprintf(fp_main, "#include <stdlib.h>\n");
  fprintf(fp_main, "#include <malloc.h>\n");
  fprintf(fp_main, "typedef long (*FOO_pt) (long);\n");
  fprintf(fp_main, "FOO_pt *FOO_global;\n");
  fprintf(fp_main, "\n");
  fprintf(fp_main, "int main(int argc, char* argv[])\n");
  fprintf(fp_main, "{\n");
  fprintf(fp_main, "#include \"FOO.h\"\n");
  fprintf(fp_main, "\tlong i=0;\n");
  fprintf(fp_main, "\tlong j,k,m,n=0,loop;\n");
  fprintf(fp_main, "\tloop=atol(argv[1]);\n");
  fprintf(fp_main, "\tm=%d;\n", max_depth * max_chain * max_so);
  fprintf(fp_main, "\tFOO_array = (FOO_pt *) malloc(sizeof(FOO_pt)*m);\n");
  fprintf(fp_main, "\tFOO_global = FOO_array;\n");
  for (i = 0; i < max_so; i++) {
    for (j = 0; j < max_chain; j++) {
      for (k = 0; k < max_depth; k++) {
        fprintf(fp_main, "\t\tFOO_array[n] = &FOO_%03d_%03d_%03d;\n", i, j, k);
        fprintf(fp_main, "\t\tn++;\n");
      }
    }
  }
  fprintf(fp_main, "\tfor(k=0;k<loop;k++){\n");
  fprintf(fp_main, "\tn=0;\n");
  for (i = 0; i < max_so; i++) {
    for (j = 0; j < max_chain; j++) {
      fprintf(fp_main, "\t\tFOO_array[n](n);\n");
      fprintf(fp_main, "\tn+=%d;\n", max_depth);
    }
  }
  fprintf(fp_main, "\t}\n");
  fprintf(fp_main, "\n");
  fprintf(fp_main, "\treturn 0;\n");
  fprintf(fp_main, "}\n");
  rval = fclose(fp_main);
  return 0;
}
```