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

```asm
<main>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  cmp    $0x1,%edi
  jg     L20
  lea    D18(%rip),%rbp
  lea    D137(%rip),%rdi
  call   <system@plt>
  xor    %ecx,%ecx
  mov    $0x1000,%edx
  mov    %rbp,%rsi
  lea    D24(%rip),%rdi
  lea    D116(%rip),%r12
  call   <merge_flash@plt>
  xor    %ecx,%ecx
  mov    $0x8000,%edx
  mov    %rbp,%rsi
  lea    D85(%rip),%rdi
  call   <merge_flash@plt>
  xor    %ecx,%ecx
  mov    $0x180000,%edx
  mov    %rbp,%rsi
  lea    D30(%rip),%rdi
  call   <merge_flash@plt>
  xor    %ecx,%ecx
  mov    $0x10000,%edx
  mov    %rbp,%rsi
  lea    D63(%rip),%rdi
  call   <merge_flash@plt>
L4:
  mov    %r12,%rdi
  call   <system@plt>
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L20:
  mov    0x8(%rsi),%rdi
  mov    %rsi,%rbx
  lea    D55(%rip),%rsi
  lea    D18(%rip),%rbp
  lea    D24(%rip),%r13
  lea    D116(%rip),%r12
  call   <strcmp@plt>
  test   %rax,%rax
  je     L11
L26:
  lea    D137(%rip),%rdi
  call   <system@plt>
  xor    %ecx,%ecx
  mov    %rbp,%rsi
  mov    %r13,%rdi
  mov    $0x1000,%edx
  call   <merge_flash@plt>
  xor    %ecx,%ecx
  mov    %rbp,%rsi
  mov    $0x8000,%edx
  lea    D85(%rip),%rdi
  call   <merge_flash@plt>
  xor    %ecx,%ecx
  mov    %rbp,%rsi
  mov    $0x180000,%edx
  lea    D30(%rip),%rdi
  call   <merge_flash@plt>
  mov    0x8(%rbx),%rdi
  xor    %ecx,%ecx
  mov    $0x10000,%edx
  mov    %rbp,%rsi
  call   <merge_flash@plt>
  jmp    L4
L11:
  lea    D143(%rip),%rdi
  call   <printf@plt>
  xor    %ecx,%ecx
  mov    $0x1000,%edx
  mov    %rbp,%rsi
  mov    %r13,%rdi
  call   <merge_flash@plt>
  mov    %r12,%rdi
  call   <system@plt>
  xor    %edi,%edi
  call   <exit@plt>
  jmp    L26
```

tool_calls: name: disassemble_data
arguments: data_tag: D18
type_infered: string
name: disassemble_data
arguments: data_tag: D137
type_infered: string
name: disassemble_data
arguments: data_tag: D24
type_infered: string
name: disassemble_data
arguments: data_tag: D116
type_infered: string
name: disassemble_data
arguments: data_tag: D85
type_infered: string
name: disassemble_data
arguments: data_tag: D30
type_infered: string
name: disassemble_data
arguments: data_tag: D63
type_infered: string
name: disassemble_data
arguments: data_tag: D55
type_infered: string
name: disassemble_data
arguments: data_tag: D143
type_infered: string

tool: D18: esp32flash.bin

tool: D137: dd if=/dev/zero bs=1M count=4  | tr "\000" "\377" >  esp32flash.bin

tool: D24: build/bootloader/bootloader.bin

tool: D116: cp esp32flash.bin ~/qemu_esp32

tool: D85: build/partitions_example.bin

tool: D30: build/spiffs_image.img

tool: D63: build/app-template.bin

tool: D55: -bl

tool: D143: Overwrite bootloader only 


assistant: ```c
int main(int argc, char *argv[]) {
  if (argc > 1) {
    if (strcmp(argv[1], "-bl") == 0) {
      printf("Overwrite bootloader only \n");
      merge_flash("build/bootloader/bootloader.bin", "esp32flash.bin", 0x1000, 0);
      system("cp esp32flash.bin ~/qemu_esp32");
      exit(0);
    }
  }
  system("dd if=/dev/zero bs=1M count=4  | tr \"\\000\" \"\\377\" >  esp32flash.bin");
  merge_flash("build/bootloader/bootloader.bin", "esp32flash.bin", 0x1000, 0);
  merge_flash("build/partitions_example.bin", "esp32flash.bin", 0x8000, 0);
  merge_flash("build/spiffs_image.img", "esp32flash.bin", 0x180000, 0);
  if (argc > 1) {
    merge_flash(argv[1], "esp32flash.bin", 0x10000, 0);
  } else {
    merge_flash("build/app-template.bin", "esp32flash.bin", 0x10000, 0);
  }
  system("cp esp32flash.bin ~/qemu_esp32");
}
```