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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %edi,%ebp
  lea    D1(%rip),%rdi
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x8,%rsp
  call   <puts@plt>
  lea    D8(%rip),%rdi
  call   <puts@plt>
  lea    D37(%rip),%rdi
  call   <puts@plt>
  cmp    $0x1,%ebp
  jle    L111
L72:
  mov    $0x400,%edi
  call   <malloc@plt>
  mov    0x10(%rbx),%rsi
  mov    %rax,%rbp
  mov    %rax,%rdi
  call   <strcpy@plt>
  mov    %rbp,%rsi
  lea    D52(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x400,%edi
  call   <malloc@plt>
  mov    %rbp,%rsi
  mov    %rax,%r12
  mov    %rax,%rdi
  call   <strcpy@plt>
  lea    D57(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  mov    %r12,%rsi
  lea    D100(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x400,%edi
  call   <malloc@plt>
  mov    %rbp,%rsi
  mov    %rax,%r13
  mov    %rax,%rdi
  call   <strcpy@plt>
  lea    D39(%rip),%rsi
  mov    %r13,%rdi
  call   <strcat@plt>
  mov    %r13,%rsi
  lea    D85(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x8(%rbx),%r15
  lea    D40(%rip),%rsi
  mov    %r15,%rdi
  call   <strcmp@plt>
  mov    %eax,%ebx
  test   %eax,%eax
  jne    L83
L69:
  mov    %rbp,%rdi
  call   <IsISOValid@plt>
  test   %eax,%eax
  je     L113
L129:
  xor    %eax,%eax
  call   <init_tables@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <Iso2Raw@plt>
  test   %eax,%eax
  je     L123
L75:
  test   %ebx,%ebx
  jne    L74
L8:
  mov    %r13,%rsi
  mov    %r12,%rdi
  call   <BuildCueFile@plt>
  test   %eax,%eax
  je     L114
L73:
  mov    %r13,%rsi
  lea    D117(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L83:
  mov    %r15,%rsi
  lea    D13(%rip),%rdi
  xor    %eax,%eax
  mov    %r15,%r14
  call   <printf@plt>
  mov    $0x1,%ebx
  jmp    L69
L114:
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L73
L74:
  mov    %r12,%rsi
  mov    %r14,%rdi
  call   <PatchIso@plt>
  test   %eax,%eax
  jne    L8
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L8
L123:
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L75
L113:
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L129
L111:
  lea    D10(%rip),%rdi
  call   <puts@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L72
```

tool_calls: name: read_data
arguments: data_label: D1
datatype: string
name: read_data
arguments: data_label: D8
datatype: string
name: read_data
arguments: data_label: D37
datatype: string
name: read_data
arguments: data_label: D52
datatype: string
name: read_data
arguments: data_label: D57
datatype: string
name: read_data
arguments: data_label: D100
datatype: string
name: read_data
arguments: data_label: D39
datatype: string
name: read_data
arguments: data_label: D85
datatype: string
name: read_data
arguments: data_label: D40
datatype: string
name: read_data
arguments: data_label: D117
datatype: string
name: read_data
arguments: data_label: D13
datatype: string
name: read_data
arguments: data_label: D10
datatype: string

tool: D1: ---------------------------------

tool: D8: ISO9660 2048->2352 converter tool

tool: D37: ---------------------------------


tool: D52: Input file: %s


tool: D57: .bin

tool: D100: Output file: %s


tool: D39: .cue

tool: D85: Cue file: %s


tool: D40: nolicence

tool: D117: Done "%s".


tool: D13: Licence file: %s


tool: D10: Wrong number of argument.
	Usage: iso2raw licence isofile.iso
		If you don't want to merge a licence file, write nolicence

assistant: ```c
int main(int argc, char *argv[]) {
  char *licFile;
  char *isoFile;
  char *temp;
  char *infile;
  char *cueFile;
  char *rawFile;
  int licence = 1;
  printf("---------------------------------\n");
  printf("ISO9660 2048->2352 converter tool\n");
  printf("---------------------------------\n\n");
  if (argc < 2) {
    printf("Wrong number of argument.\n\tUsage: iso2raw licence isofile.iso\n\t\tIf you don't want to merge a licence file, write nolicence\n");
    exit(1);
  }
  infile = malloc(1024);
  strcpy(infile, argv[2]);
  printf("Input file: %s\n", infile);
  rawFile = malloc(1024);
  strcpy(rawFile, infile);
  strcat(rawFile, ".bin");
  printf("Output file: %s\n", rawFile);
  cueFile = malloc(1024);
  strcpy(cueFile, infile);
  strcat(cueFile, ".cue");
  printf("Cue file: %s\n", cueFile);
  if (!strcmp(argv[1], "nolicence"))
    licence = 0;
  else {
    licFile = argv[1];
    printf("Licence file: %s\n", licFile);
  }
  if (!IsISOValid(infile))
    exit(1);
  init_tables();
  if (!Iso2Raw(infile, rawFile))
    exit(1);
  if (licence)
    if (!PatchIso(licFile, rawFile))
      exit(1);
  if (!BuildCueFile(rawFile, cueFile))
    exit(1);
  printf("Done \"%s\".\n", cueFile);
}
```