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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,-0x4(%rbp)
  mov    %rsi,-0x10(%rbp)
  cmpl   $0x1,-0x4(%rbp)
  jle    L23
  mov    -0x10(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  lea    D19(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L23
  lea    D91(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%ecx
  mov    $0x1000,%edx
  lea    D76(%rip),%rax
  mov    %rax,%rsi
  lea    D154(%rip),%rax
  mov    %rax,%rdi
  call   <merge_flash@plt>
  lea    D152(%rip),%rax
  mov    %rax,%rdi
  call   <system@plt>
  mov    $0x0,%edi
  call   <exit@plt>
L23:
  lea    D151(%rip),%rax
  mov    %rax,%rdi
  call   <system@plt>
  mov    $0x0,%ecx
  mov    $0x1000,%edx
  lea    D76(%rip),%rax
  mov    %rax,%rsi
  lea    D154(%rip),%rax
  mov    %rax,%rdi
  call   <merge_flash@plt>
  mov    $0x0,%ecx
  mov    $0x8000,%edx
  lea    D76(%rip),%rax
  mov    %rax,%rsi
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  call   <merge_flash@plt>
  mov    $0x0,%ecx
  mov    $0x180000,%edx
  lea    D76(%rip),%rax
  mov    %rax,%rsi
  lea    D39(%rip),%rax
  mov    %rax,%rdi
  call   <merge_flash@plt>
  cmpl   $0x1,-0x4(%rbp)
  jle    L28
  mov    -0x10(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  mov    $0x0,%ecx
  mov    $0x10000,%edx
  lea    D76(%rip),%rsi
  mov    %rax,%rdi
  call   <merge_flash@plt>
  jmp    L29
L28:
  mov    $0x0,%ecx
  mov    $0x10000,%edx
  lea    D76(%rip),%rax
  mov    %rax,%rsi
  lea    D0(%rip),%rax
  mov    %rax,%rdi
  call   <merge_flash@plt>
L29:
  lea    D152(%rip),%rax
  mov    %rax,%rdi
  call   <system@plt>
  mov    $0x0,%eax
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D19
datatype: string
name: unpack_data
arguments: data_tag: D91
datatype: string
name: unpack_data
arguments: data_tag: D76
datatype: string
name: unpack_data
arguments: data_tag: D154
datatype: string
name: unpack_data
arguments: data_tag: D152
datatype: string
name: unpack_data
arguments: data_tag: D151
datatype: string
name: unpack_data
arguments: data_tag: D9
datatype: string
name: unpack_data
arguments: data_tag: D39
datatype: string
name: unpack_data
arguments: data_tag: D0
datatype: string

tool: D19: -bl

tool: D91: Overwrite bootloader only 


tool: D76: esp32flash.bin

tool: D154: build/bootloader/bootloader.bin

tool: D152: cp esp32flash.bin ~/qemu_esp32

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

tool: D9: build/partitions_example.bin

tool: D39: build/spiffs_image.img

tool: D0: build/app-template.bin

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");
}
```