user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x90,%rsp
  mov    %edi,-0x84(%rbp)
  mov    %rsi,-0x90(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x1,-0x7c(%rbp)
  movq   $0x0,-0x78(%rbp)
  movq   $0x0,-0x70(%rbp)
  movq   $0x0,-0x68(%rbp)
  movq   $0x0,-0x60(%rbp)
  movq   $0x0,-0x58(%rbp)
  movq   $0x0,-0x50(%rbp)
  movq   $0x0,-0x48(%rbp)
  lea    D112(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  cmpl   $0x1,-0x84(%rbp)
  jg     L213
  mov    -0x90(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,%rsi
  lea    D62(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  jmp    L42
L213:
  cmpl   $0x1,-0x84(%rbp)
  jle    L227
  mov    -0x90(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  lea    D109(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L241
  mov    -0x90(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  lea    D80(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L241
  mov    -0x90(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  lea    D56(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L227
L241:
  lea    D118(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D8(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D38(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D12(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x0,%eax
  jmp    L42
L227:
  cmpl   $0x5,-0x84(%rbp)
  je     L147
  mov    $0x1,%eax
  jmp    L42
L147:
  mov    -0x90(%rbp),%rax
  mov    0x8(%rax),%rax
  mov    %rax,-0x40(%rbp)
  mov    -0x90(%rbp),%rax
  mov    0x10(%rax),%rax
  mov    %rax,-0x38(%rbp)
  mov    -0x90(%rbp),%rax
  mov    0x18(%rax),%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x90(%rbp),%rax
  mov    0x20(%rax),%rax
  mov    %rax,-0x28(%rbp)
  lea    -0x60(%rbp),%rdx
  lea    -0x78(%rbp),%rcx
  mov    -0x40(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <loader_read@plt>
  mov    -0x78(%rbp),%rax
  test   %rax,%rax
  je     L37
  mov    -0x60(%rbp),%rax
  test   %rax,%rax
  je     L37
  lea    -0x50(%rbp),%rdx
  lea    -0x68(%rbp),%rcx
  mov    -0x38(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <splash_read@plt>
  mov    -0x68(%rbp),%rax
  test   %rax,%rax
  je     L66
  mov    -0x50(%rbp),%rax
  test   %rax,%rax
  je     L66
  lea    -0x58(%rbp),%rdx
  lea    -0x70(%rbp),%rcx
  mov    -0x30(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <zero_bin_read@plt>
  mov    -0x70(%rbp),%rax
  test   %rax,%rax
  je     L177
  mov    -0x58(%rbp),%rax
  test   %rax,%rax
  je     L177
  mov    -0x58(%rbp),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  add    $0x2010,%rax
  mov    %rax,-0x60(%rbp)
  mov    -0x60(%rbp),%rax
  cmp    $0xfc000,%rax
  jbe    L231
  mov    -0x60(%rbp),%rax
  mov    $0xfc000,%edx
  mov    %rax,%rsi
  lea    D26(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L188
L231:
  movq   $0x2010,-0x20(%rbp)
  mov    -0x58(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x78(%rbp),%rax
  add    $0x2000,%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x20(%rbp),%rax
  add    $0x6004000,%rax
  mov    %rax,%rdi
  call   <bswap_ul@plt>
  mov    -0x10(%rbp),%rdx
  mov    %rax,(%rdx)
  mov    -0x78(%rbp),%rax
  add    $0x2004,%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <bswap_ul@plt>
  mov    -0x10(%rbp),%rdx
  mov    %rax,(%rdx)
  mov    -0x70(%rbp),%rax
  mov    -0x78(%rbp),%rcx
  mov    -0x20(%rbp),%rdx
  add    %rdx,%rcx
  mov    -0x18(%rbp),%rdx
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <memcpy@plt>
  mov    -0x58(%rbp),%rax
  add    $0x2010,%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x50(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x78(%rbp),%rax
  add    $0x2008,%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x20(%rbp),%rax
  add    $0x6004000,%rax
  mov    %rax,%rdi
  call   <bswap_ul@plt>
  mov    -0x10(%rbp),%rdx
  mov    %rax,(%rdx)
  mov    -0x78(%rbp),%rax
  add    $0x200c,%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <bswap_ul@plt>
  mov    -0x10(%rbp),%rdx
  mov    %rax,(%rdx)
  mov    -0x68(%rbp),%rax
  mov    -0x78(%rbp),%rcx
  mov    -0x20(%rbp),%rdx
  add    %rdx,%rcx
  mov    -0x18(%rbp),%rdx
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <memcpy@plt>
  mov    -0x28(%rbp),%rcx
  lea    -0x48(%rbp),%rax
  lea    D47(%rip),%rdx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <fopen_s@plt>
  mov    -0x48(%rbp),%rax
  test   %rax,%rax
  je     L195
  mov    -0x48(%rbp),%rcx
  mov    -0x60(%rbp),%rdx
  mov    -0x78(%rbp),%rax
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  movq   $0x0,-0x48(%rbp)
  mov    -0x60(%rbp),%rax
  shr    $0xa,%rax
  mov    %rax,%rdx
  mov    -0x60(%rbp),%rax
  mov    %rax,%rsi
  lea    D116(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x0,-0x7c(%rbp)
  jmp    L188
L195:
  mov    -0x28(%rbp),%rax
  mov    %rax,%rsi
  lea    D94(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L188
L37:
  nop
  jmp    L188
L66:
  nop
  jmp    L188
L177:
  nop
L188:
  mov    -0x68(%rbp),%rax
  test   %rax,%rax
  je     L191
  mov    -0x68(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  movq   $0x0,-0x68(%rbp)
L191:
  mov    -0x70(%rbp),%rax
  test   %rax,%rax
  je     L70
  mov    -0x70(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  movq   $0x0,-0x70(%rbp)
L70:
  mov    -0x78(%rbp),%rax
  test   %rax,%rax
  je     L202
  mov    -0x78(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  movq   $0x0,-0x78(%rbp)
L202:
  mov    -0x7c(%rbp),%eax
L42:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L101
  call   <__stack_chk_fail@plt>
L101:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: label: D112
data_type: string
name: unpack_data
arguments: label: D62
data_type: string
name: unpack_data
arguments: label: D109
data_type: string
name: unpack_data
arguments: label: D80
data_type: string
name: unpack_data
arguments: label: D56
data_type: string
name: unpack_data
arguments: label: D118
data_type: string
name: unpack_data
arguments: label: D8
data_type: string
name: unpack_data
arguments: label: D38
data_type: string
name: unpack_data
arguments: label: D12
data_type: string
name: unpack_data
arguments: label: D9
data_type: string
name: unpack_data
arguments: label: D26
data_type: string
name: unpack_data
arguments: label: D47
data_type: string
name: unpack_data
arguments: label: D116
data_type: string
name: unpack_data
arguments: label: D94
data_type: string

tool: D112: --- mksplash v0.1 by cafe-alpha. ---

tool: D62:  Type %s -h for help.


tool: D109: -h

tool: D80: -help

tool: D56: -?

tool: D118:  Note: uses LibLZF: http://oldhome.schmorp.de/marc/liblzf.html

tool: D8:  Usage : <loader.bin> <splash.bmp> <0.bin> <out.bin>

tool: D38:          -> Pack loader.bin, splash.bmp, 0.bin in out.bin file.

tool: D12:             After startup, splash.bmp is displayed

tool: D9:             and 0.bin is loaded after a key is pressed.

tool: D26: Error : total size too big (required %d bytes, max %d bytes) !


tool: D47: wb

tool: D116: Wrote %d bytes (%d KB) to disk.


tool: D94: Error : could not write to file (%s) !


assistant: ```c
int main(int argc, char *argv[]) {
  int ret = 1;
  char *file_loader;
  char *file_splash;
  char *file_zero;
  char *file_out;
  unsigned char *buff_out = NULL;
  unsigned char *buff_zero = NULL;
  unsigned char *buff_splash = NULL;
  unsigned long len_out = 0;
  unsigned long len_zero = 0;
  unsigned long len_splash = 0;
  unsigned long *ptr;
  unsigned long ofs, len;
  FILE *fp = NULL;
  printf("--- mksplash v0.1 by cafe-alpha. ---\n");
  if (argc <= 1) {
    printf(" Type %s -h for help.\n", argv[0]);
    return 0;
  }
  if (argc >= 2) {
    if ((!strcmp(argv[1], "-h")) || (!strcmp(argv[1], "-help")) || (!strcmp(argv[1], "-?"))) {
      printf(" Note: uses LibLZF: http://oldhome.schmorp.de/marc/liblzf.html\n");
      printf(" Usage : <loader.bin> <splash.bmp> <0.bin> <out.bin>\n");
      printf("         -> Pack loader.bin, splash.bmp, 0.bin in out.bin file.\n");
      printf("            After startup, splash.bmp is displayed\n");
      printf("            and 0.bin is loaded after a key is pressed.\n");
      return 0;
    }
  }
  if (argc != 5)
    return 1;
  file_loader = argv[1];
  file_splash = argv[2];
  file_zero = argv[3];
  file_out = argv[4];
  loader_read(file_loader, &buff_out, &len_out);
  if ((buff_out == NULL) || (len_out == 0))
    goto end;
  splash_read(file_splash, &buff_splash, &len_splash);
  if ((buff_splash == NULL) || (len_splash == 0))
    goto end;
  zero_bin_read(file_zero, &buff_zero, &len_zero);
  if ((buff_zero == NULL) || (len_zero == 0))
    goto end;
  len_out = (8 * 1024) + (16) + len_zero + len_splash;
  if (len_out > (1024 * 1024 - 0x4000)) {
    printf("Error : total size too big (required %d bytes, max %d bytes) !\n", len_out, (1024 * 1024 - 0x4000));
    goto end;
  }
  ofs = (8 * 1024) + (16);
  len = len_zero;
  ptr = (unsigned long *)(buff_out + ((8 * 1024) + 0));
  *ptr = bswap_ul(0x06004000 + ofs);
  ptr = (unsigned long *)(buff_out + ((8 * 1024) + 4));
  *ptr = bswap_ul(len);
  memcpy((void *)(buff_out + ofs), (void *)buff_zero, len);
  ofs = (8 * 1024) + (16) + len_zero;
  len = len_splash;
  ptr = (unsigned long *)(buff_out + ((8 * 1024) + 8));
  *ptr = bswap_ul(0x06004000 + ofs);
  ptr = (unsigned long *)(buff_out + ((8 * 1024) + 12));
  *ptr = bswap_ul(len);
  memcpy((void *)(buff_out + ofs), (void *)buff_splash, len);
  fopen_s(&fp, file_out, "wb");
  if (fp) {
    fwrite(buff_out, 1, len_out, fp);
    fclose(fp);
    fp = NULL;
    printf("Wrote %d bytes (%d KB) to disk.\n", len_out, len_out >> 10);
  } else {
    printf("Error : could not write to file (%s) !\n", file_out);
    goto end;
  }
  ret = 0;
end:
  if (buff_splash) {
    free(buff_splash);
    buff_splash = NULL;
  }
  if (buff_zero) {
    free(buff_zero);
    buff_zero = NULL;
  }
  if (buff_out) {
    free(buff_out);
    buff_out = NULL;
  }
  return ret;
}
```