user: Please show me the C implementation that matches the assembly code listed below:

```asm
<file_create>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x238,%rsp
  mov    %rdi,%rbp
  mov    %rsi,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x228(%rsp)
  xor    %eax,%eax
  movl   $0x0,0x1c(%rsp)
  lea    0x1c(%rsp),%rsi
  call   <parse_tex@plt>
  mov    %rax,(%rsp)
  test   %rax,%rax
  je     L149
  mov    0x1c(%rsp),%esi
  lea    D84(%rip),%rdi
  call   <printf@plt>
  call   <fork@plt>
  test   %eax,%eax
  je     L7
L29:
  lea    0x18(%rsp),%rdi
  call   <wait@plt>
  call   <fork@plt>
  test   %eax,%eax
  je     L206
L159:
  lea    0x18(%rsp),%rdi
  call   <wait@plt>
  cmpl   $0x0,0x1c(%rsp)
  jg     L152
L41:
  call   <fork@plt>
  test   %eax,%eax
  je     L193
L82:
  lea    0x18(%rsp),%rdi
  call   <wait@plt>
  call   <fork@plt>
  test   %eax,%eax
  je     L64
L124:
  lea    0x18(%rsp),%rdi
  call   <wait@plt>
  mov    $0x1,%ebx
  lea    0x20(%rsp),%r12
  lea    D96(%rip),%r14
  lea    D121(%rip),%r13
L67:
  mov    %ebx,%r8d
  mov    %rbp,%rcx
  mov    %r14,%rdx
  mov    $0x200,%esi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  mov    %r13,%rsi
  mov    %r12,%rdi
  call   <fopen@plt>
  mov    %rax,%rdi
  test   %rax,%rax
  je     L42
  call   <fclose@plt>
  add    $0x1,%ebx
  jmp    L67
L7:
  lea    0x20(%rsp),%rdi
  mov    %rbp,%rcx
  lea    D157(%rip),%rdx
  mov    $0x200,%esi
  call   <snprintf@plt>
  lea    D121(%rip),%rbx
L191:
  lea    0x20(%rsp),%rdi
  mov    %rbx,%rsi
  call   <fopen@plt>
  test   %rax,%rax
  je     L191
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L29
L206:
  lea    0x20(%rsp),%rbx
  mov    %rbp,%rcx
  lea    D40(%rip),%rdx
  mov    $0x200,%esi
  mov    %rbx,%rdi
  call   <snprintf@plt>
  mov    $0x0,%r8d
  mov    %rbx,%rcx
  lea    D7(%rip),%rdx
  lea    D42(%rip),%rdi
  mov    %rdi,%rsi
  call   <execl@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L159
L152:
  call   <fork@plt>
  test   %eax,%eax
  je     L10
L140:
  lea    0x18(%rsp),%rdi
  call   <wait@plt>
  jmp    L41
L10:
  lea    0x20(%rsp),%rbx
  mov    %rbp,%rcx
  lea    D40(%rip),%rdx
  mov    $0x200,%esi
  mov    %rbx,%rdi
  call   <snprintf@plt>
  mov    $0x0,%r8d
  mov    %rbx,%rcx
  lea    D7(%rip),%rdx
  lea    D42(%rip),%rdi
  mov    %rdi,%rsi
  call   <execl@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L140
L193:
  lea    0x20(%rsp),%rbx
  mov    %rbp,%r8
  mov    %rbp,%rcx
  lea    D17(%rip),%rdx
  mov    $0x200,%esi
  mov    %rbx,%rdi
  call   <snprintf@plt>
  mov    $0x0,%r8d
  mov    %rbx,%rcx
  lea    D7(%rip),%rdx
  lea    D42(%rip),%rdi
  mov    %rdi,%rsi
  call   <execl@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L82
L64:
  lea    0x20(%rsp),%rbx
  mov    %rbp,%r9
  lea    D49(%rip),%r8
  mov    %rbp,%rcx
  lea    D93(%rip),%rdx
  mov    $0x200,%esi
  mov    %rbx,%rdi
  call   <snprintf@plt>
  mov    $0x0,%r8d
  mov    %rbx,%rcx
  lea    D7(%rip),%rdx
  lea    D42(%rip),%rdi
  mov    %rdi,%rsi
  call   <execl@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L124
L42:
  sub    $0x1,%ebx
  movl   $0x1,0x1c(%rsp)
  test   %ebx,%ebx
  jle    L66
  lea    0x20(%rsp),%r13
  lea    D11(%rip),%r15
  lea    D7(%rip),%r14
  lea    D42(%rip),%r12
  jmp    L105
L217:
  lea    0x18(%rsp),%rdi
  call   <wait@plt>
  mov    0x1c(%rsp),%eax
  add    $0x1,%eax
  mov    %eax,0x1c(%rsp)
  cmp    %ebx,%eax
  jg     L66
L105:
  call   <fork@plt>
  test   %eax,%eax
  jne    L217
  mov    0x1c(%rsp),%r8d
  sub    $0x8,%rsp
  push   %r8
  mov    %rbp,%r9
  mov    %rbp,%rcx
  mov    %r15,%rdx
  mov    $0x200,%esi
  mov    %r13,%rdi
  call   <snprintf@plt>
  mov    $0x0,%r8d
  mov    %r13,%rcx
  mov    %r14,%rdx
  mov    %r12,%rsi
  mov    %r12,%rdi
  call   <execl@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  add    $0x10,%rsp
  jmp    L217
L66:
  mov    0x8(%rsp),%rax
  mov    %ebx,(%rax)
L149:
  mov    0x228(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L100
  mov    (%rsp),%rax
  add    $0x238,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L100:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_tag: D84
data_type: string
name: unpack_data
arguments: data_tag: D96
data_type: string
name: unpack_data
arguments: data_tag: D121
data_type: string
name: unpack_data
arguments: data_tag: D157
data_type: string
name: unpack_data
arguments: data_tag: D40
data_type: string
name: unpack_data
arguments: data_tag: D7
data_type: string
name: unpack_data
arguments: data_tag: D42
data_type: string
name: unpack_data
arguments: data_tag: D17
data_type: string
name: unpack_data
arguments: data_tag: D49
data_type: string
name: unpack_data
arguments: data_tag: D93
data_type: string
name: unpack_data
arguments: data_tag: D11
data_type: string

tool: D84: MAP found %d tags that require resolving references.


tool: D96: %s-PREMAP%02d.pnm

tool: D121: r+

tool: D157: %s-PREMAP.tex

tool: D40: /usr/bin/latex -interaction=batchmode %s-PREMAP.tex

tool: D7: -c

tool: D42: /bin/sh

tool: D17: /usr/bin/dvips -t letter -f %s-PREMAP.dvi > %s-PREMAP.ps

tool: D49: %02d

tool: D93: /usr/bin/gs -q -dBATCH -dGraphicsAlphaBits=4 -dTextAlphaBits=4 -dNOPAUSE -sDEVICE=pnmraw -r100 -sOutputFile=%s-PREMAP%s.pnm %s-PREMAP.ps

tool: D11: /usr/bin/pnmcrop < %s-PREMAP%02d.pnm | /usr/bin/pnmpad -white -l20 -r20 -t20 -b20 | /usr/bin/pnmtopng > %s-PREMAP%02d.png

assistant: ```c
struct href *file_create(char name[], int *p) {
  char tmp_name[512];
  pid_t child;
  int pages, status, relay = 0;
  FILE *CHECK;
  struct href *hhead;
  if ((hhead = parse_tex(name, &relay)) == NULL)
    return NULL;
  printf("MAP found %d tags that require resolving references.\n", relay);
  if ((child = fork()) == 0) {
    snprintf(tmp_name, 512, "%s-PREMAP.tex", name);
    while ((CHECK = fopen(tmp_name, "r+")) == NULL) {
    }
    fclose(CHECK);
    exit(1);
  }
  wait(&status);
  if ((child = fork()) == 0) {
    snprintf(tmp_name, 512, "/usr/bin/latex -interaction=batchmode %s-PREMAP.tex", name);
    execl("/bin/sh", "/bin/sh", "-c", tmp_name, NULL);
    exit(1);
  }
  wait(&status);
  if (relay > 0) {
    if ((child = fork()) == 0) {
      snprintf(tmp_name, 512, "/usr/bin/latex -interaction=batchmode %s-PREMAP.tex", name);
      execl("/bin/sh", "/bin/sh", "-c", tmp_name, NULL);
      exit(1);
    }
    wait(&status);
  }
  if ((child = fork()) == 0) {
    snprintf(tmp_name, 512, "/usr/bin/dvips -t letter -f %s-PREMAP.dvi > %s-PREMAP.ps", name, name);
    execl("/bin/sh", "/bin/sh", "-c", tmp_name, NULL);
    exit(1);
  }
  wait(&status);
  if ((child = fork()) == 0) {
    snprintf(tmp_name, 512, "/usr/bin/gs -q -dBATCH -dGraphicsAlphaBits=4 -dTextAlphaBits=4 -dNOPAUSE -sDEVICE=pnmraw -r100 -sOutputFile=%s-PREMAP%s.pnm %s-PREMAP.ps", name, "%02d", name);
    execl("/bin/sh", "/bin/sh", "-c", tmp_name, NULL);
    exit(1);
  }
  wait(&status);
  for (pages = 1;; pages++) {
    snprintf(tmp_name, 512, "%s-PREMAP%02d.pnm", name, pages);
    if ((CHECK = fopen(tmp_name, "r+")) != NULL) {
      fclose(CHECK);
    } else {
      pages -= 1;
      break;
    }
  }
  for (relay = 1; relay < (pages + 1); relay++) {
    if ((child = fork()) == 0) {
      snprintf(tmp_name, 512, "/usr/bin/pnmcrop < %s-PREMAP%02d.pnm | /usr/bin/pnmpad -white -l20 -r20 -t20 -b20 | /usr/bin/pnmtopng > %s-PREMAP%02d.png", name, relay, name, relay);
      execl("/bin/sh", "/bin/sh", "-c", tmp_name, NULL);
      exit(1);
    }
    wait(&status);
  }
  *p = pages;
  return hhead;
}
```