user: What is the c source code of the assembly code below:

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    -0x27000(%rsp),%r11
L15:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L15
  sub    $0x148,%rsp
  lea    D2(%rip),%rsi
  lea    D27(%rip),%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x27138(%rsp)
  xor    %eax,%eax
  call   <fopen@plt>
  lea    0x14(%rsp),%rsi
  lea    D54(%rip),%rdi
  mov    %rax,%r12
  xor    %eax,%eax
  call   <scanf@plt>
  mov    0x14(%rsp),%eax
  test   %eax,%eax
  jle    L10
  lea    0x1c(%rsp),%rax
  xor    %r13d,%r13d
  lea    0x20(%rsp),%rbp
  mov    %rax,0x8(%rsp)
  lea    0x18(%rsp),%rax
  lea    0x138b0(%rsp),%r14
  mov    %rax,(%rsp)
  lea    D45(%rip),%rbx
L23:
  mov    0x8(%rsp),%rdx
  mov    (%rsp),%rsi
  xor    %eax,%eax
  xor    %r15d,%r15d
  lea    D9(%rip),%rdi
  call   <scanf@plt>
  nopw   0x0(%rax,%rax,1)
L74:
  mov    0x1c(%rsp),%edx
  lea    (%rdx,%rdx,1),%eax
  cmp    %r15d,%eax
  jle    L12
L9:
  lea    0x13(%rsp),%rsi
  mov    %rbx,%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  movzbl 0x13(%rsp),%eax
  lea    -0x3a(%rax),%esi
  lea    -0x30(%rax),%edx
  cmp    $0x6,%sil
  jbe    L74
  cmp    $0x16,%dl
  ja     L74
  sub    $0x37,%eax
  movsbl %dl,%esi
  cmp    $0x9,%dl
  mov    0x1c(%rsp),%edx
  movsbl %al,%eax
  cmovbe %esi,%eax
  mov    %eax,0x0(%rbp,%r15,4)
  add    $0x1,%r15
  lea    (%rdx,%rdx,1),%eax
  cmp    %r15d,%eax
  jg     L9
L12:
  mov    %r14,%rsi
  mov    %rbp,%rdi
  add    $0x1,%r13d
  call   <Caculate_len@plt>
  mov    0x18(%rsp),%edx
  lea    D59(%rip),%rsi
  mov    %r12,%rdi
  mov    %eax,%ecx
  mov    %eax,%r15d
  shr    $0x1f,%ecx
  add    %eax,%ecx
  xor    %eax,%eax
  sar    %ecx
  call   <fprintf@plt>
  mov    %r12,%rdx
  mov    %r15d,%esi
  mov    %r14,%rdi
  call   <PrintEncode@plt>
  mov    %r12,%rsi
  mov    $0xa,%edi
  call   <fputc@plt>
  cmp    %r13d,0x14(%rsp)
  jg     L23
L10:
  mov    %r12,%rdi
  call   <fclose@plt>
  mov    0x27138(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L57
  add    $0x27148,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L57:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: tag: D2
datatype: string
name: unpack_data
arguments: tag: D27
datatype: string
name: unpack_data
arguments: tag: D54
datatype: string
name: unpack_data
arguments: tag: D45
datatype: string
name: unpack_data
arguments: tag: D9
datatype: string
name: unpack_data
arguments: tag: D59
datatype: string

tool: D2: w

tool: D27: a.out

tool: D54: %d

tool: D45: %c

tool: D9: %d%d

tool: D59: %d %d


assistant: ```c
int main() {
  int p, i, j;
  FILE *f = fopen("a.out", "w");
  scanf("%d", &p);
  for (i = 0; i < p; i++) {
    int n, B;
    int read[20000 + 1], wt[20000 + 1];
    char temp;
    scanf("%d%d", &n, &B);
    for (j = 0; j < 2 * B;) {
      scanf("%c", &temp);
      if ((temp > '9' && temp < 'A') || (temp < '0') || (temp > 'F')) {
        continue;
      }
      if (temp >= '0' && temp <= '9') {
        read[j] = temp - '0';
        j++;
      } else {
        read[j] = temp - 'A' + 10;
        j++;
      }
    }
    j = Caculate_len(read, wt, B);
    fprintf(f, "%d %d\n", n, j / 2);
    PrintEncode(wt, j, f);
    fprintf(f, "\n");
  }
  fclose(f);
  return 0;
}
```