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

```asm
<main>:
  endbr64
  push   %r15
  lea    D38(%rip),%rdi
  lea    D0(%rip),%r15
  push   %r14
  lea    D20(%rip),%r14
  push   %r13
  lea    D37(%rip),%r13
  push   %r12
  mov    %r13,%rsi
  push   %rbp
  xor    %ebp,%ebp
  push   %rbx
  sub    $0x8,%rsp
  call   <fopen@plt>
  mov    %rax,%r12
L75:
  mov    $0x1,%ebx
  jmp    L78
  nopw   0x0(%rax,%rax,1)
L48:
  sub    $0x8,%rsp
  mov    $0x40,%r9d
  mov    %ebp,%r8d
  mov    %ebx,%ecx
  push   %rbx
  mov    %ebp,%edx
  mov    %r15,%rsi
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <fprintf@plt>
  mov    %ebx,%ecx
  mov    %r14,%rsi
  mov    $0x40,%r9d
  mov    %ebp,%r8d
  mov    %ebp,%edx
  mov    %r12,%rdi
  xor    %eax,%eax
  mov    %ebx,(%rsp)
  call   <fprintf@plt>
  pop    %rcx
  pop    %rsi
  cmp    $0x40,%ebx
  je     L41
L25:
  add    $0x1,%ebx
L78:
  cmp    $0x10,%ebx
  jbe    L85
  cmp    $0x20,%ebx
  jg     L48
  sub    $0x8,%rsp
  mov    $0x20,%r9d
  mov    %ebp,%r8d
  mov    %ebx,%ecx
  push   %rbx
  mov    %ebp,%edx
  mov    %r15,%rsi
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <fprintf@plt>
  mov    %ebx,(%rsp)
  mov    $0x20,%r9d
L105:
  mov    %ebp,%edx
  mov    %ebp,%r8d
  mov    %ebx,%ecx
  mov    %r14,%rsi
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <fprintf@plt>
  pop    %rax
  pop    %rdx
  jmp    L25
  nopl   0x0(%rax,%rax,1)
L85:
  sub    $0x8,%rsp
  mov    $0x10,%r9d
  mov    %ebp,%r8d
  mov    %ebx,%ecx
  push   %rbx
  mov    %ebp,%edx
  mov    %r15,%rsi
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <fprintf@plt>
  mov    %ebx,(%rsp)
  mov    $0x10,%r9d
  jmp    L105
L41:
  add    $0x1,%ebp
  cmp    $0x8,%ebp
  jne    L75
  mov    %r12,%rdi
  lea    D31(%rip),%r15
  mov    $0x1,%r12d
  call   <fclose@plt>
  mov    %r13,%rsi
  lea    D79(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%r14
  nopl   (%rax)
L77:
  mov    %r12d,%ebp
  xor    %ebx,%ebx
  shl    $0x4,%ebp
  nopl   0x0(%rax,%rax,1)
L91:
  mov    %ebx,%ecx
  mov    %ebp,%edx
  mov    %r12d,%r9d
  mov    $0x75,%r8d
  mov    %r15,%rsi
  mov    %r14,%rdi
  xor    %eax,%eax
  call   <fprintf@plt>
  lea    0x1(%rbp),%edx
  mov    %ebx,%ecx
  mov    %r12d,%r9d
  mov    $0x69,%r8d
  mov    %r15,%rsi
  mov    %r14,%rdi
  xor    %eax,%eax
  call   <fprintf@plt>
  add    $0x1,%ebx
  add    $0x2,%ebp
  cmp    $0x8,%ebx
  jne    L91
  add    $0x1,%r12d
  cmp    $0x41,%r12d
  jne    L77
  mov    %r13,%rsi
  lea    D19(%rip),%rdi
  mov    $0x1,%ebp
  call   <fopen@plt>
  lea    D26(%rip),%r14
  mov    %rax,%r13
  nopl   0x0(%rax,%rax,1)
L42:
  mov    %ebp,%r12d
  xor    %ebx,%ebx
  shl    $0x4,%r12d
  nopl   0x0(%rax)
L38:
  sub    $0x8,%rsp
  mov    %ebx,%ecx
  mov    %r12d,%edx
  mov    %ebp,%r9d
  push   %rbp
  mov    $0x75,%r8d
  mov    %r14,%rsi
  mov    %r13,%rdi
  push   $0x75
  xor    %eax,%eax
  push   %rbx
  call   <fprintf@plt>
  add    $0x18,%rsp
  lea    0x1(%r12),%edx
  mov    %ebx,%ecx
  push   %rbp
  mov    %ebp,%r9d
  mov    $0x69,%r8d
  mov    %r14,%rsi
  push   $0x69
  mov    %r13,%rdi
  xor    %eax,%eax
  add    $0x2,%r12d
  push   %rbx
  add    $0x1,%ebx
  call   <fprintf@plt>
  add    $0x20,%rsp
  cmp    $0x8,%ebx
  jne    L38
  add    $0x1,%ebp
  cmp    $0x41,%ebp
  jne    L42
  mov    %r13,%rdi
  call   <fclose@plt>
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D38
data_type: string
name: unpack_data
arguments: data_label: D0
data_type: string
name: unpack_data
arguments: data_label: D20
data_type: string
name: unpack_data
arguments: data_label: D37
data_type: string
name: unpack_data
arguments: data_label: D31
data_type: string
name: unpack_data
arguments: data_label: D79
data_type: string
name: unpack_data
arguments: data_label: D19
data_type: string
name: unpack_data
arguments: data_label: D26
data_type: string

tool: D38: bitfield.struct.inc

tool: D0: struct off%di%d { long : %d; int%d_t  data : %d; } __attribute__ ((packed));


tool: D20: struct off%du%d { long : %d; uint%d_t data : %d; } __attribute__ ((packed));


tool: D37: w

tool: D31: case %d: return ((struct off%d%c%d *) data)->data;


tool: D79: bitfield.function.get.inc

tool: D19: bitfield.function.set.inc

tool: D26: case %d: { int64_t ov = ((struct off%d%c%d *) data)->data; ((struct off%d%c%d *) data)->data = value; return ov; }


assistant: ```c
int main() {
  int i;
  int off;
  FILE *f;
  f = fopen("bitfield.struct.inc", "w");
  for (off = 0; off < 8; off++) {
    for (i = 1; i <= 64; i++) {
      int nbits;
      if (i <= 16)
        nbits = 16;
      else if (i <= 32)
        nbits = 32;
      else
        nbits = 64;
      fprintf(f, "struct off%di%d { long : %d; int%d_t  data : %d; } __attribute__ ((packed));\n", off, i, off, nbits, i);
      fprintf(f, "struct off%du%d { long : %d; uint%d_t data : %d; } __attribute__ ((packed));\n", off, i, off, nbits, i);
    }
  }
  fclose(f);
  int is_signed;
  f = fopen("bitfield.function.get.inc", "w");
  for (i = 1; i <= 64; i++) {
    for (off = 0; off < 8; off++) {
      for (is_signed = 0; is_signed < 2; is_signed++) {
        fprintf(f, "case %d: return ((struct off%d%c%d *) data)->data;\n", i * 16 + off * 2 + is_signed, off, is_signed ? 'i' : 'u', i);
      }
    }
  }
  f = fopen("bitfield.function.set.inc", "w");
  for (i = 1; i <= 64; i++) {
    for (off = 0; off < 8; off++) {
      for (is_signed = 0; is_signed < 2; is_signed++) {
        fprintf(f, "case %d: { int64_t ov = ((struct off%d%c%d *) data)->data; ((struct off%d%c%d *) data)->data = value; return ov; }\n", i * 16 + off * 2 + is_signed, off, is_signed ? 'i' : 'u', i, off, is_signed ? 'i' : 'u', i);
      }
    }
  }
  fclose(f);
}
```