user: 请将以下的汇编代码转换成C语言代码：

```asm
<main>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x118,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x108(%rsp)
  xor    %eax,%eax
  movabs $0x1222708819f90846,%rax
  mov    %rax,0x8(%rsp)
  movabs $0x26c2060c86231778,%rax
  mov    %rax,0x10(%rsp)
  movabs $0xb04970cb4052790b,%rax
  movabs $0xb4f80323eb3191c,%rdx
  mov    %rax,0x20(%rsp)
  mov    %rdx,0x28(%rsp)
  movabs $0xd76c39412a34b946,%rax
  movabs $0xced7043180f56b38,%rdx
  mov    %rax,0xb0(%rsp)
  mov    %rdx,0xb8(%rsp)
  movabs $0xaf9b1332912b12dc,%rax
  movabs $0x4f5378e14ec9ed2e,%rdx
  mov    %rax,0xc0(%rsp)
  mov    %rdx,0xc8(%rsp)
  movabs $0x49744d075d232d2f,%rax
  mov    %rax,0xd0(%rsp)
  lea    0x90(%rsp),%r12
  mov    $0x9,%edx
  lea    D32(%rip),%rsi
  mov    %r12,%rdi
  call   <strncpy@plt>
  lea    0x99(%rsp),%rdi
  mov    $0x1,%edx
  lea    D147(%rip),%rsi
  call   <strncpy@plt>
  lea    0x9a(%rsp),%rdi
  mov    $0x6,%edx
  lea    D59(%rip),%rsi
  call   <strncpy@plt>
  lea    0xa0(%rsp),%rdi
  mov    $0x1,%edx
  lea    D23(%rip),%rsi
  call   <strncpy@plt>
  lea    0xa1(%rsp),%rdi
  mov    $0x6,%edx
  lea    D27(%rip),%rsi
  call   <strncpy@plt>
  lea    0xa7(%rsp),%rdi
  mov    $0x1,%edx
  lea    D82(%rip),%rsi
  call   <strncpy@plt>
  lea    0x40(%rsp),%rbp
  lea    0x30(%rsp),%rbx
  mov    %rbp,%rdx
  mov    %rbx,%rsi
  mov    %r12,%rdi
  call   <mrtd_bac_kmrz_to_kenc_kmac@plt>
  mov    $0x10,%edx
  mov    %rbx,%rsi
  lea    D150(%rip),%rdi
  call   <printhex@plt>
  mov    $0x10,%edx
  mov    %rbp,%rsi
  lea    D11(%rip),%rdi
  call   <printhex@plt>
  lea    0xe0(%rsp),%r13
  lea    0x8(%rsp),%rdx
  lea    0x20(%rsp),%rsi
  lea    0x10(%rsp),%r12
  mov    %r13,%r9
  mov    %rbp,%r8
  mov    %rbx,%rcx
  mov    %r12,%rdi
  call   <mrtd_bac_cmd_data@plt>
  mov    $0x28,%edx
  mov    %r13,%rsi
  lea    D54(%rip),%rdi
  call   <printhex@plt>
  lea    0x18(%rsp),%rcx
  lea    0xb0(%rsp),%rdi
  lea    0x50(%rsp),%r8
  mov    %r12,%rdx
  mov    %rbx,%rsi
  call   <mrtd_bac_challenge_ok@plt>
  test   %rax,%rax
  je     L32
  lea    D137(%rip),%rdi
  call   <puts@plt>
L36:
  lea    0x10(%rsp),%rsi
  mov    $0x8,%edx
  lea    D98(%rip),%rdi
  call   <printhex@plt>
  lea    0x50(%rsp),%rsi
  mov    $0x10,%edx
  lea    D117(%rip),%rdi
  call   <printhex@plt>
  mov    $0x0,%eax
  lea    0x50(%rsp),%rcx
L26:
  movzbl 0x20(%rsp,%rax,1),%edx
  xor    (%rax,%rcx,1),%dl
  mov    %dl,0x60(%rsp,%rax,1)
  add    $0x1,%rax
  cmp    $0x10,%rax
  jne    L26
  lea    0x80(%rsp),%rbx
  lea    0x70(%rsp),%rbp
  lea    0x60(%rsp),%rdi
  mov    %rbx,%rdx
  mov    %rbp,%rsi
  call   <mrtd_bac_kenc_kmac@plt>
  mov    $0x10,%edx
  mov    %rbp,%rsi
  lea    D93(%rip),%rdi
  call   <printhex@plt>
  mov    $0x10,%edx
  mov    %rbx,%rsi
  lea    D156(%rip),%rdi
  call   <printhex@plt>
  lea    0x10(%rsp),%rsi
  lea    0x8(%rsp),%rdi
  call   <mrtd_bac_get_ssc@plt>
  mov    %eax,%esi
  lea    D61(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    0x108(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L17
  mov    $0x0,%eax
  add    $0x118,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L32:
  lea    D37(%rip),%rdi
  call   <puts@plt>
  jmp    L36
L17:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: tag: D32
datatype: string
name: extract_symbolic_data
arguments: tag: D147
datatype: string
name: extract_symbolic_data
arguments: tag: D59
datatype: string
name: extract_symbolic_data
arguments: tag: D23
datatype: string
name: extract_symbolic_data
arguments: tag: D27
datatype: string
name: extract_symbolic_data
arguments: tag: D82
datatype: string
name: extract_symbolic_data
arguments: tag: D150
datatype: string
name: extract_symbolic_data
arguments: tag: D11
datatype: string
name: extract_symbolic_data
arguments: tag: D54
datatype: string
name: extract_symbolic_data
arguments: tag: D137
datatype: string
name: extract_symbolic_data
arguments: tag: D98
datatype: string
name: extract_symbolic_data
arguments: tag: D117
datatype: string
name: extract_symbolic_data
arguments: tag: D93
datatype: string
name: extract_symbolic_data
arguments: tag: D156
datatype: string
name: extract_symbolic_data
arguments: tag: D61
datatype: string
name: extract_symbolic_data
arguments: tag: D37
datatype: string

tool: D32: L898902C<

tool: D147: 3

tool: D59: 690806

tool: D23: 1

tool: D27: 940623

tool: D82: 6

tool: D150: kenc

tool: D11: kmac

tool: D54: cmd_data

tool: D137: ======================
Challenge successful!
======================

tool: D98: rnd_ifd

tool: D117: kicc

tool: D93: ksenc

tool: D156: ksmac

tool: D61: ssc: %lx


tool: D37: ======================
Challenge failed...
======================

assistant: ```c
int main() {
  int i;
  char *mrp_number = "L898902C<";
  char *mrp_numbercd = "3";
  char *mrp_dob = "690806";
  char *mrp_dobcd = "1";
  char *mrp_expiry = "940623";
  char *mrp_expirycd = "6";
  char remotechallenge[8] = {0x46, 0x08, 0xf9, 0x19, 0x88, 0x70, 0x22, 0x12};
  char rnd_ifd[8] = {0x78, 0x17, 0x23, 0x86, 0x0c, 0x06, 0xc2, 0x26};
  char kifd[16] = {0x0b, 0x79, 0x52, 0x40, 0xcb, 0x70, 0x49, 0xb0, 0x1c, 0x19, 0xb3, 0x3e, 0x32, 0x80, 0x4f, 0x0b};
  char rx_data[40] = {0x46, 0xB9, 0x34, 0x2A, 0x41, 0x39, 0x6C, 0xD7, 0x38, 0x6B, 0xF5, 0x80, 0x31, 0x04, 0xD7, 0xCE, 0xDC, 0x12, 0x2B, 0x91, 0x32, 0x13, 0x9B, 0xAF, 0x2E, 0xED, 0xC9, 0x4E, 0xE1, 0x78, 0x53, 0x4F, 0x2f, 0x2D, 0x23, 0x5D, 0x07, 0x4D, 0x74, 0x49};
  char kmrz[25];
  char kenc[16];
  char kmac[16];
  char cmd_data[40];
  char rnd_icc[8];
  char kicc[16];
  char xored[16];
  char ksenc[16];
  char ksmac[16];
  uint64_t ssc_long;
  strncpy(kmrz, mrp_number, 9);
  strncpy(kmrz + 9, mrp_numbercd, 1);
  strncpy(kmrz + 10, mrp_dob, 6);
  strncpy(kmrz + 16, mrp_dobcd, 1);
  strncpy(kmrz + 17, mrp_expiry, 6);
  strncpy(kmrz + 23, mrp_expirycd, 1);
  mrtd_bac_kmrz_to_kenc_kmac(kmrz, kenc, kmac);
  printhex("kenc", kenc, 16);
  printhex("kmac", kmac, 16);
  mrtd_bac_cmd_data(rnd_ifd, kifd, remotechallenge, kenc, kmac, cmd_data);
  printhex("cmd_data", cmd_data, 40);
  if (mrtd_bac_challenge_ok(rx_data, kenc, rnd_ifd, rnd_icc, kicc)) {
    printf("======================\nChallenge successful!\n======================\n");
  } else {
    printf("======================\nChallenge failed...\n======================\n");
  }
  printhex("rnd_ifd", rnd_ifd, 8);
  printhex("kicc", kicc, 16);
  for (i = 0; i < 16; i++) {
    xored[i] = kifd[i] ^ kicc[i];
  }
  mrtd_bac_kenc_kmac(xored, ksenc, ksmac);
  printhex("ksenc", ksenc, 16);
  printhex("ksmac", ksmac, 16);
  ssc_long = mrtd_bac_get_ssc(remotechallenge, rnd_ifd);
  printf("ssc: %lx\n", ssc_long);
  return 0;
}
```