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

```asm
<ic_b2c_compile>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  test   %rdi,%rdi
  je     L83
  mov    %rsi,%rbp
  test   %rsi,%rsi
  je     L193
  mov    %rdi,%r12
  lea    D99(%rip),%rsi
  mov    %rbp,%rdi
  call   <fopen@plt>
  test   %rax,%rax
  je     L202
  mov    %rbp,%rsi
  lea    D21(%rip),%rdi
  call   <printf@plt>
  xor    %eax,%eax
L48:
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L202:
  lea    D129(%rip),%rsi
  mov    %rbp,%rdi
  call   <fopen@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L158
  mov    %rax,%rsi
  mov    %r12,%rdi
  call   <ic_b2c_compile_builtins@plt>
  test   %eax,%eax
  je     L130
  mov    %r13,%rsi
  mov    %r12,%rdi
  call   <ic_b2c_compile_types_pre@plt>
  test   %eax,%eax
  je     L136
  mov    %r13,%rsi
  mov    %r12,%rdi
  call   <ic_b2c_compile_generates_pre@plt>
  test   %eax,%eax
  je     L155
  mov    %r13,%rsi
  mov    %r12,%rdi
  call   <ic_b2c_compile_functions_pre@plt>
  test   %eax,%eax
  je     L101
  mov    %r13,%rsi
  mov    %r12,%rdi
  call   <ic_b2c_compile_types@plt>
  test   %eax,%eax
  je     L76
  mov    %r13,%rsi
  mov    %r12,%rdi
  call   <ic_b2c_compile_generates@plt>
  test   %eax,%eax
  je     L170
  mov    %r13,%rsi
  mov    %r12,%rdi
  call   <ic_b2c_compile_functions@plt>
  test   %eax,%eax
  je     L101
  mov    %r13,%rsi
  mov    %r12,%rdi
  call   <ic_b2c_compile_entry@plt>
  test   %eax,%eax
  je     L164
  mov    %r13,%rdi
  call   <fclose@plt>
  mov    $0x1,%eax
  jmp    L48
  nopl   (%rax)
L130:
  lea    D44(%rip),%rdi
  call   <puts@plt>
  xor    %eax,%eax
  jmp    L48
  nopl   0x0(%rax,%rax,1)
L193:
  lea    D83(%rip),%rdi
  call   <puts@plt>
  pop    %rbp
  xor    %eax,%eax
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L83:
  lea    D47(%rip),%rdi
  call   <puts@plt>
  xor    %eax,%eax
  jmp    L48
  nopl   0x0(%rax,%rax,1)
L136:
  lea    D111(%rip),%rdi
  call   <puts@plt>
  xor    %eax,%eax
  jmp    L48
  nopl   0x0(%rax,%rax,1)
L158:
  mov    %rbp,%rsi
  lea    D40(%rip),%rdi
  call   <printf@plt>
  xor    %eax,%eax
  jmp    L48
  xchg   %ax,%ax
L76:
  lea    D10(%rip),%rdi
  call   <puts@plt>
  xor    %eax,%eax
  jmp    L48
  nopl   0x0(%rax,%rax,1)
L155:
  lea    D93(%rip),%rdi
  call   <puts@plt>
  xor    %eax,%eax
  jmp    L48
  nopl   0x0(%rax,%rax,1)
L101:
  lea    D98(%rip),%rdi
  call   <puts@plt>
  xor    %eax,%eax
  jmp    L48
  nopl   0x0(%rax,%rax,1)
L170:
  lea    D8(%rip),%rdi
  call   <puts@plt>
  xor    %eax,%eax
  jmp    L48
L164:
  lea    D114(%rip),%rdi
  call   <puts@plt>
  xor    %eax,%eax
  jmp    L48
```

tool_calls: name: unpack_data
arguments: label: D99
type: string
name: unpack_data
arguments: label: D21
type: string
name: unpack_data
arguments: label: D129
type: string
name: unpack_data
arguments: label: D44
type: string
name: unpack_data
arguments: label: D83
type: string
name: unpack_data
arguments: label: D47
type: string
name: unpack_data
arguments: label: D111
type: string
name: unpack_data
arguments: label: D40
type: string
name: unpack_data
arguments: label: D10
type: string
name: unpack_data
arguments: label: D93
type: string
name: unpack_data
arguments: label: D98
type: string
name: unpack_data
arguments: label: D8
type: string
name: unpack_data
arguments: label: D114
type: string

tool: D99: r

tool: D21: ic_b2c_compile: error file already existed '%s'


tool: D129: w

tool: D44: ic_b2c_compile: call to ic_b2c_compile_builtins failed

tool: D83: ic_b2c_compile: out_filename was null

tool: D47: ic_b2c_compile: kludge was null

tool: D111: ic_b2c_compile: call to ic_b2c_compile_types_pre failed

tool: D40: ic_b2c_compile: failed to open out_filename '%s'


tool: D10: ic_b2c_compile: call to ic_b2c_compile_types failed

tool: D93: ic_b2c_compile: call to ic_b2c_compile_generates_pre failed

tool: D98: ic_b2c_compile: call to ic_b2c_compile_functions failed

tool: D8: ic_b2c_compile: call to ic_b2c_compile_generates failed

tool: D114: ic_b2c_compile: call to ic_b2c_compile_entry failed

assistant: ```c
unsigned int ic_b2c_compile(struct ic_kludge *kludge, char *out_filename) {
  FILE *f = 0;
  if (!kludge) {
    puts("ic_b2c_compile: kludge was null");
    return 0;
  }
  if (!out_filename) {
    puts("ic_b2c_compile: out_filename was null");
    return 0;
  }
  f = fopen(out_filename, "r");
  if (f) {
    printf("ic_b2c_compile: error file already existed '%s'\n", out_filename);
    return 0;
  }
  f = fopen(out_filename, "w");
  if (!f) {
    printf("ic_b2c_compile: failed to open out_filename '%s'\n", out_filename);
    return 0;
  }
  if (!ic_b2c_compile_builtins(kludge, f)) {
    puts("ic_b2c_compile: call to ic_b2c_compile_builtins failed");
    return 0;
  }
  if (!ic_b2c_compile_types_pre(kludge, f)) {
    puts("ic_b2c_compile: call to ic_b2c_compile_types_pre failed");
    return 0;
  }
  if (!ic_b2c_compile_generates_pre(kludge, f)) {
    puts("ic_b2c_compile: call to ic_b2c_compile_generates_pre failed");
    return 0;
  }
  if (!ic_b2c_compile_functions_pre(kludge, f)) {
    puts("ic_b2c_compile: call to ic_b2c_compile_functions failed");
    return 0;
  }
  if (!ic_b2c_compile_types(kludge, f)) {
    puts("ic_b2c_compile: call to ic_b2c_compile_types failed");
    return 0;
  }
  if (!ic_b2c_compile_generates(kludge, f)) {
    puts("ic_b2c_compile: call to ic_b2c_compile_generates failed");
    return 0;
  }
  if (!ic_b2c_compile_functions(kludge, f)) {
    puts("ic_b2c_compile: call to ic_b2c_compile_functions failed");
    return 0;
  }
  if (!ic_b2c_compile_entry(kludge, f)) {
    puts("ic_b2c_compile: call to ic_b2c_compile_entry failed");
    return 0;
  }
  fclose(f);
  return 1;
}
```