user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  movl   $0x1000000,0x1c(%rsp)
  movl   $0x10000,0x20(%rsp)
  movl   $0x2,0x24(%rsp)
  cmp    $0x1,%edi
  jle    L124
  lea    -0x2(%rdi),%eax
  lea    0x8(%rsi),%rbx
  lea    0x10(%rsi,%rax,8),%r12
  lea    D82(%rip),%rbp
  lea    D71(%rip),%r13
  lea    D33(%rip),%r14
  jmp    L154
  cs nopw 0x0(%rax,%rax,1)
L21:
  mov    (%rbx),%rsi
  cmpb   $0x3d,(%rsi,%r15,1)
  je     L137
  mov    %r14,%rdi
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  mov    (%rbx),%rsi
L137:
  lea    0x20(%rsp),%r8
  lea    0x1(%rsi,%r15,1),%rdi
  mov    %r8,%rdx
  lea    D63(%rip),%rsi
  call   <sscanf@plt>
L182:
  add    $0x8,%rbx
  cmp    %r12,%rbx
  je     L124
L154:
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    (%rbx),%rdi
  mov    %rbp,%rsi
  movslq %eax,%r15
  mov    %r15d,%edx
  call   <strncmp@plt>
  test   %rax,%rax
  je     L21
  mov    %r13,%rdi
  call   <strlen@plt>
  mov    (%rbx),%rdi
  mov    %r13,%rsi
  mov    %eax,%edx
  mov    %eax,%r15d
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L177
  mov    (%rbx),%rsi
  movslq %r15d,%rdx
  cmpb   $0x3d,(%rsi,%rdx,1)
  je     L160
  mov    %r14,%rdi
  mov    %rdx,0x8(%rsp)
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  mov    (%rbx),%rsi
  mov    0x8(%rsp),%rdx
L160:
  lea    0x1c(%rsp),%r8
  lea    0x1(%rsi,%rdx,1),%rdi
  add    $0x8,%rbx
  mov    %r8,%rdx
  lea    D63(%rip),%rsi
  call   <sscanf@plt>
  cmp    %r12,%rbx
  jne    L154
  nopl   (%rax)
L124:
  mov    0x1c(%rsp),%edi
  call   <malloc@plt>
  mov    0x1c(%rsp),%edi
  mov    %rax,%rbp
  call   <malloc@plt>
  mov    0x1c(%rsp),%edx
  mov    %rbp,%rsi
  xor    %ecx,%ecx
  mov    %rax,%rdi
  mov    %rax,%r12
  sub    %rbp,%rdi
  cmp    $0x3,%edx
  jle    L31
  nopl   0x0(%rax)
L171:
  add    $0x1,%ecx
  mov    %ecx,(%rsi)
  movl   $0x0,(%rdi,%rsi,1)
  mov    0x1c(%rsp),%edx
  add    $0x4,%rsi
  lea    0x3(%rdx),%eax
  test   %edx,%edx
  cmovns %edx,%eax
  sar    $0x2,%eax
  cmp    %eax,%ecx
  jl     L171
L31:
  mov    0x20(%rsp),%ecx
  mov    0x24(%rsp),%r8d
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <gdev_test_memcpy@plt>
  mov    0x1c(%rsp),%eax
  test   %eax,%eax
  lea    0x3(%rax),%ecx
  cmovns %eax,%ecx
  sar    $0x2,%ecx
  cmp    $0x3,%eax
  jle    L162
  mov    %r12,%rdi
  mov    %rbp,%rax
  xor    %esi,%esi
  sub    %rbp,%rdi
  jmp    L113
  nopl   0x0(%rax)
L14:
  add    $0x1,%esi
  add    $0x4,%rax
  cmp    %esi,%ecx
  jle    L162
L113:
  mov    (%rax),%edx
  mov    (%rdi,%rax,1),%r8d
  cmp    %r8d,%edx
  je     L14
  mov    %esi,%ecx
  lea    D73(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D11(%rip),%rdi
  call   <puts@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %r12,%rdi
  call   <free@plt>
  jmp    L46
  nopl   0x0(%rax,%rax,1)
L177:
  lea    D49(%rip),%rdi
  call   <strlen@plt>
  mov    (%rbx),%rdi
  lea    D49(%rip),%rsi
  mov    %eax,%edx
  mov    %eax,0x8(%rsp)
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L182
  mov    (%rbx),%rsi
  movslq 0x8(%rsp),%rdx
  cmpb   $0x3d,(%rsi,%rdx,1)
  je     L188
  mov    %r14,%rdi
  mov    %rdx,0x8(%rsp)
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  mov    (%rbx),%rsi
  mov    0x8(%rsp),%rdx
L188:
  lea    0x24(%rsp),%r8
  lea    0x1(%rsi,%rdx,1),%rdi
  mov    %r8,%rdx
  lea    D70(%rip),%rsi
  call   <sscanf@plt>
  jmp    L182
L162:
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %r12,%rdi
  call   <free@plt>
L46:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L145
  add    $0x38,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L145:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: tag: D82
type_guessed: string
name: parse_data
arguments: tag: D71
type_guessed: string
name: parse_data
arguments: tag: D33
type_guessed: string
name: parse_data
arguments: tag: D63
type_guessed: string
name: parse_data
arguments: tag: D73
type_guessed: string
name: parse_data
arguments: tag: D11
type_guessed: string
name: parse_data
arguments: tag: D49
type_guessed: string
name: parse_data
arguments: tag: D70
type_guessed: string

tool: D82: --chunk

tool: D71: --data

tool: D33: option "%s" is invalid.


tool: D63: %x

tool: D73: in[%d] = %lu, out[%d] = %lu


tool: D11: Test failed.

tool: D49: --pl

tool: D70: %d

assistant: ```c
int main(int argc, char *argv[]) {
  uint32_t *in, *out;
  uint32_t size = 0x1000000;
  uint32_t ch_size = 0x10000;
  int pl = 2;
  int i, tmp;
  for (i = 1; i < argc; i++) {
    if (strncmp(argv[i], "--chunk", (tmp = strlen("--chunk"))) == 0) {
      if (argv[i][tmp] != '=') {
        printf("option \"%s\" is invalid.\n", argv[i]);
        exit(1);
      }
      sscanf(&argv[i][tmp + 1], "%x", &ch_size);
    } else if (strncmp(argv[i], "--data", (tmp = strlen("--data"))) == 0) {
      if (argv[i][tmp] != '=') {
        printf("option \"%s\" is invalid.\n", argv[i]);
        exit(1);
      }
      sscanf(&argv[i][tmp + 1], "%x", &size);
    } else if (strncmp(argv[i], "--pl", (tmp = strlen("--pl"))) == 0) {
      if (argv[i][tmp] != '=') {
        printf("option \"%s\" is invalid.\n", argv[i]);
        exit(1);
      }
      sscanf(&argv[i][tmp + 1], "%d", &pl);
    }
  }
  in = (uint32_t *)malloc(size);
  out = (uint32_t *)malloc(size);
  for (i = 0; i < size / 4; i++) {
    in[i] = i + 1;
    out[i] = 0;
  }
  gdev_test_memcpy(in, out, size, ch_size, pl);
  for (i = 0; i < size / 4; i++) {
    if (in[i] != out[i]) {
      printf("in[%d] = %lu, out[%d] = %lu\n", i, in[i], i, out[i]);
      printf("Test failed.\n");
      goto end;
    }
  }
  free(in);
  free(out);
  return 0;
end:
  free(in);
  free(out);
  return 0;
}
```