user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %rsi,-0x30(%rbp)
  cmpl   $0x4,-0x24(%rbp)
  je     L147
  lea    D10(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x1,%eax
  jmp    L11
L147:
  mov    -0x30(%rbp),%rax
  add    $0x18,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    $0x1,%eax
  jne    L54
  mov    -0x30(%rbp),%rax
  add    $0x18,%rax
  mov    (%rax),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %eax,%eax
  jne    L145
L54:
  lea    D55(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x1,%eax
  jmp    L11
L145:
  mov    -0x30(%rbp),%rax
  add    $0x18,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    %eax,-0x14(%rbp)
  cmpl   $0x0,-0x14(%rbp)
  js     L146
  cmpl   $0x3,-0x14(%rbp)
  jle    L172
L146:
  lea    D55(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x1,%eax
  jmp    L11
L172:
  mov    -0x30(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  lea    D91(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  jne    L2
  lea    D120(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x1,%eax
  jmp    L11
L2:
  mov    -0x30(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%rax
  lea    D33(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L42
  lea    D6(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x1,%eax
  jmp    L11
L42:
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <verifyBootSignature@plt>
  test   %rax,%rax
  je     L113
  lea    D107(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <readPartitionsInfo@plt>
  test   %eax,%eax
  jne    L160
  jmp    L136
L113:
  lea    D45(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x1,%eax
  jmp    L11
L136:
  lea    D20(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x1,%eax
  jmp    L11
L160:
  mov    -0x14(%rbp),%eax
  mov    %eax,%edi
  call   <verifyPartition@plt>
  test   %eax,%eax
  jne    L171
  lea    D82(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x1,%eax
  jmp    L11
L171:
  mov    -0x14(%rbp),%edx
  mov    -0x8(%rbp),%rcx
  mov    -0x10(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <copyPartition@plt>
  test   %eax,%eax
  jne    L0
  lea    D69(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x1,%eax
  jmp    L11
L0:
  lea    D100(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    $0x0,%eax
L11:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D10
type: string
name: disassemble_data
arguments: tag: D55
type: string
name: disassemble_data
arguments: tag: D91
type: string
name: disassemble_data
arguments: tag: D120
type: string
name: disassemble_data
arguments: tag: D33
type: string
name: disassemble_data
arguments: tag: D6
type: string
name: disassemble_data
arguments: tag: D107
type: string
name: disassemble_data
arguments: tag: D45
type: string
name: disassemble_data
arguments: tag: D20
type: string
name: disassemble_data
arguments: tag: D82
type: string
name: disassemble_data
arguments: tag: D69
type: string
name: disassemble_data
arguments: tag: D100
type: string

tool: D10: Usage: fileIn filePartitionOut numberOfPartition(0,1,2 or 3)


tool: D55: Wrong partition number


tool: D91: r

tool: D120: Can't open fileIn


tool: D33: w

tool: D6: Can't open filePartitionOut


tool: D107: Boot signature OK!


tool: D45: Wrong boot signature in mbr! Is fileIn valid disk image?


tool: D20: Failed to read data about partitions

tool: D82: Selected partition does not exist


tool: D69: Error while extracting partition


tool: D100: Done!


assistant: ```c
int main(int argc, char **argv) {
  FILE *in;
  FILE *out;
  if (argc != 4) {
    printf("Usage: fileIn filePartitionOut "
           "numberOfPartition(0,1,2 or 3)\n");
    return 1;
  }
  if (strlen(argv[3]) != 1 || !isdigit(argv[3][0])) {
    printf("Wrong partition number\n");
    return 1;
  }
  int getPartition = atoi(argv[3]);
  if (getPartition < 0 || getPartition > 3) {
    printf("Wrong partition number\n");
    return 1;
  }
  in = fopen(argv[1], "r");
  if (in == NULL) {
    printf("Can't open fileIn\n");
    return 1;
  }
  out = fopen(argv[2], "w");
  if (out == NULL) {
    printf("Can't open filePartitionOut\n");
    return 1;
  }
  if (verifyBootSignature(in))
    printf("Boot signature OK!\n");
  else {
    printf("Wrong boot signature in mbr! Is fileIn valid disk image?\n");
    return 1;
  }
  if (!readPartitionsInfo(in)) {
    printf("Failed to read data about partitions");
    return 1;
  }
  if (!verifyPartition(getPartition)) {
    printf("Selected partition does not exist\n");
    return 1;
  }
  if (!copyPartition(in, out, getPartition)) {
    printf("Error while extracting partition\n");
    return 1;
  }
  printf("Done!\n");
  fclose(in);
  fclose(out);
  return 0;
}
```