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

```asm
<main>:
  endbr64
  push   %r12
  mov    $0x2,%edx
  lea    D70(%rip),%rsi
  mov    $0x1,%edi
  push   %rbp
  lea    D140(%rip),%rbp
  lea    D37(%rip),%r12
  sub    $0x8,%rsp
  call   <_do_scan@plt>
  mov    $0x3,%edx
  mov    $0x2,%edi
  lea    D115(%rip),%rsi
  call   <_do_scan@plt>
  mov    $0x4,%edx
  mov    $0x2,%edi
  lea    D53(%rip),%rsi
  call   <_do_scan@plt>
  mov    $0x5,%edx
  mov    $0x4,%edi
  lea    D131(%rip),%rsi
  call   <_do_scan@plt>
  mov    %rbp,%rsi
  mov    $0x1,%edx
  xor    %edi,%edi
  call   <_do_scan@plt>
  mov    %r12,%rsi
  mov    $0x1,%edx
  xor    %edi,%edi
  call   <_do_scan@plt>
  mov    $0x2,%edx
  mov    $0x1,%edi
  lea    D119(%rip),%rsi
  call   <_do_scan@plt>
  mov    $0x3,%edx
  mov    $0x2,%edi
  lea    D21(%rip),%rsi
  call   <_do_scan@plt>
  mov    $0x4,%edx
  mov    $0x2,%edi
  lea    D39(%rip),%rsi
  call   <_do_scan@plt>
  mov    $0x5,%edx
  mov    $0x4,%edi
  lea    D11(%rip),%rsi
  call   <_do_scan@plt>
  mov    $0x1,%edx
  mov    $0x5,%edi
  lea    D30(%rip),%rsi
  call   <_do_scan@plt>
  mov    $0x6,%edx
  mov    $0x4,%edi
  lea    D16(%rip),%rsi
  call   <_do_scan@plt>
  mov    $0x7,%edx
  mov    $0x3,%edi
  lea    D64(%rip),%rsi
  call   <_do_scan@plt>
  mov    $0x1,%edx
  mov    $0x5,%edi
  lea    D150(%rip),%rsi
  call   <_do_scan@plt>
  mov    $0x1,%edx
  lea    D137(%rip),%rsi
  xor    %edi,%edi
  call   <_do_scan@plt>
  mov    $0x1,%edx
  mov    $0x5,%edi
  lea    D91(%rip),%rsi
  call   <_do_scan@plt>
  mov    %r12,%rsi
  mov    $0x1,%edx
  xor    %edi,%edi
  call   <_do_scan@plt>
  mov    %rbp,%rsi
  mov    $0x1,%edx
  xor    %edi,%edi
  call   <_do_scan@plt>
  mov    $0x1,%edx
  mov    $0x5,%edi
  lea    D120(%rip),%rsi
  call   <_do_scan@plt>
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  ret
```

tool_calls: name: unpack_data
arguments: label: D70
datatype: string
name: unpack_data
arguments: label: D140
datatype: string
name: unpack_data
arguments: label: D37
datatype: string
name: unpack_data
arguments: label: D115
datatype: string
name: unpack_data
arguments: label: D53
datatype: string
name: unpack_data
arguments: label: D131
datatype: string
name: unpack_data
arguments: label: D119
datatype: string
name: unpack_data
arguments: label: D21
datatype: string
name: unpack_data
arguments: label: D39
datatype: string
name: unpack_data
arguments: label: D11
datatype: string
name: unpack_data
arguments: label: D30
datatype: string
name: unpack_data
arguments: label: D16
datatype: string
name: unpack_data
arguments: label: D64
datatype: string
name: unpack_data
arguments: label: D150
datatype: string
name: unpack_data
arguments: label: D137
datatype: string
name: unpack_data
arguments: label: D91
datatype: string
name: unpack_data
arguments: label: D120
datatype: string

tool: D70: a


tool: D140: q

tool: D37: a

tool: D115: aa


tool: D53: aaa


tool: D131: aaaa


tool: D119: A


tool: D21: AA


tool: D39: aAa


tool: D11: AaaA


tool: D30: Q

tool: D16: AaaAa


tool: D64: AaaAaA


tool: D150: A

tool: D137: 


tool: D91: 0

tool: D120: x

assistant: ```c
main() {
  _do_scan(1, "a\n", sizeof("a\n") - 1);
  _do_scan(2, "aa\n", sizeof("aa\n") - 1);
  _do_scan(2, "aaa\n", sizeof("aaa\n") - 1);
  _do_scan(4, "aaaa\n", sizeof("aaaa\n") - 1);
  _do_scan(0, "q", sizeof("q") - 1);
  _do_scan(0, "a", sizeof("a") - 1);
  _do_scan(1, "A\n", sizeof("A\n") - 1);
  _do_scan(2, "AA\n", sizeof("AA\n") - 1);
  _do_scan(2, "aAa\n", sizeof("aAa\n") - 1);
  _do_scan(4, "AaaA\n", sizeof("AaaA\n") - 1);
  _do_scan(5, "Q", sizeof("Q") - 1);
  _do_scan(4, "AaaAa\n", sizeof("AaaAa\n") - 1);
  _do_scan(3, "AaaAaA\n", sizeof("AaaAaA\n") - 1);
  _do_scan(5, "A", sizeof("A") - 1);
  _do_scan(0, "\n", sizeof("\n") - 1);
  _do_scan(5, "0", sizeof("0") - 1);
  _do_scan(0, "a", sizeof("a") - 1);
  _do_scan(0, "q", sizeof("q") - 1);
  _do_scan(5, "x", sizeof("x") - 1);
}
```