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

```asm
<not_main>:
  endbr64
  push   %r15
  mov    %rdx,%r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rsi,%r12
  lea    D16(%rip),%rsi
  push   %rbp
  push   %rbx
  mov    %ecx,%ebx
  sub    $0x78,%rsp
  mov    %rdi,0x10(%rsp)
  mov    %ecx,0x18(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  call   <fopen@plt>
  test   %rax,%rax
  je     L24
  lea    0x38(%rsp),%rsi
  mov    %rax,%rdx
  lea    0x30(%rsp),%rcx
  mov    %rax,%rbp
  lea    D24(%rip),%rdi
  call   <get_data@plt>
  mov    %rbp,%rdi
  lea    D17(%rip),%rbp
  call   <fclose@plt>
  mov    %r15,%rdi
  call   <strlen@plt>
  lea    0x24(%rsp),%rdx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  mov    %eax,%r13d
  movl   $0x0,0x2c(%rsp)
  call   <sscanf@plt>
  test   %r13d,%r13d
  jle    L33
  test   %ebx,%ebx
  lea    0x2c(%rsp),%r12
  lea    0x40(%rsp),%rbx
  sete   0xf(%rsp)
  sub    $0x1,%r13d
  shr    %r13d
  mov    %r13d,%eax
  mov    %r13d,0x1c(%rsp)
  lea    0x28(%rsp),%r13
  lea    0x2(%r15,%rax,2),%r14
  jmp    L65
  nopl   0x0(%rax,%rax,1)
L10:
  add    $0x2,%r15
  addl   $0x1,0x24(%rsp)
  cmp    %r14,%r15
  je     L26
L65:
  mov    $0x2,%edx
  mov    %r15,%rsi
  mov    %rbx,%rdi
  call   <strncpy@plt>
  mov    %r13,%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <sscanf@plt>
  mov    0x28(%rsp),%edx
  mov    0x24(%rsp),%esi
  mov    %r12,%r8
  mov    0x30(%rsp),%rcx
  mov    0x38(%rsp),%rdi
  call   <make_changes@plt>
  test   %rax,%rax
  jne    L10
  cmpb   $0x0,0xf(%rsp)
  je     L10
  mov    0x30(%rsp),%rdx
  mov    0x10(%rsp),%rsi
  add    $0x2,%r15
  mov    0x38(%rsp),%rdi
  call   <apply_changes@plt>
  addl   $0x1,0x24(%rsp)
  cmp    %r14,%r15
  jne    L65
  nopl   0x0(%rax)
L26:
  mov    0x1c(%rsp),%eax
  lea    0x2(%rax,%rax,1),%ebx
L107:
  mov    0x38(%rsp),%rdi
  call   <free@plt>
  mov    0x18(%rsp),%edx
  mov    $0x1,%eax
  test   %edx,%edx
  jle    L62
  xor    %eax,%eax
  sar    %ebx
  cmp    0x2c(%rsp),%ebx
  sete   %al
L62:
  mov    0x68(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L82
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L24:
  xor    %edi,%edi
  call   <fclose@plt>
  lea    D20(%rip),%rdi
  call   <printf@plt>
  xor    %eax,%eax
  jmp    L62
  nop
L33:
  xor    %ebx,%ebx
  jmp    L107
L82:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D16
type_guessed: string
name: disassemble_data
arguments: data_tag: D24
type_guessed: string
name: disassemble_data
arguments: data_tag: D17
type_guessed: string
name: disassemble_data
arguments: data_tag: D20
type_guessed: string

tool: D16: rb

tool: D24: rom.smc

tool: D17: %x

tool: D20: no such file???


assistant: ```c
int not_main(char *rom_name, char *offset, char *bytes, int apply_or_check) {
  FILE *file = fopen(rom_name, "rb");
  if (file) {
    size_t size;
    unsigned char *buf;
    get_data("rom.smc", &buf, file, &size);
    fclose(file);
    char to_use[30];
    int num = strlen(bytes);
    int offset_to_apply, bytes_to_apply, new_offset;
    int c = 0;
    int check_tweak = 0;
    sscanf(offset, "%x", &offset_to_apply);
    while (c < num) {
      strncpy(to_use, bytes + c, 2);
      sscanf(to_use, "%x", &bytes_to_apply);
      if ((make_changes(buf, offset_to_apply, bytes_to_apply, size, &check_tweak) == 0)) {
        if (apply_or_check == 0) {
          apply_changes(buf, rom_name, size);
        }
      }
      c += 2;
      offset_to_apply++;
    }
    free(buf);
    if (apply_or_check > 0)
      if (check_tweak == (c / 2))
        return 1;
      else
        return 0;
    return 1;
  } else {
    fclose(file);
    printf("no such file???\n");
    return 0;
  }
}
```