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

```asm
<main>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x510,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x508(%rsp)
  xor    %eax,%eax
  movabs $0x3131313031313031,%rax
  mov    %rax,0xe2(%rsp)
  movw   $0x3131,0xea(%rsp)
  lea    D14(%rip),%rdx
  mov    %rdx,0x30(%rsp)
  lea    D18(%rip),%rax
  mov    %rax,0x38(%rsp)
  mov    %rax,0x40(%rsp)
  mov    %rax,0x48(%rsp)
  mov    %rdx,0x50(%rsp)
  lea    D2(%rip),%rcx
  mov    %rcx,0x58(%rsp)
  mov    %rcx,0x60(%rsp)
  mov    %rax,0x68(%rsp)
  mov    %rdx,0x70(%rsp)
  mov    %rdx,0x78(%rsp)
  movabs $0x3031313131313030,%rsi
  mov    %rsi,0xec(%rsp)
  movw   $0x3131,0xf4(%rsp)
  mov    %rdx,0x80(%rsp)
  mov    %rax,0x88(%rsp)
  mov    %rcx,0x90(%rsp)
  mov    %rax,0x98(%rsp)
  mov    %rax,0xa0(%rsp)
  mov    %rax,0xa8(%rsp)
  mov    %rdx,0xb0(%rsp)
  mov    %rax,0xb8(%rsp)
  mov    %rdx,0xc0(%rsp)
  mov    %rax,0xc8(%rsp)
  movabs $0x3031313031313031,%rax
  mov    %rax,0xf6(%rsp)
  movw   $0x3131,0xfe(%rsp)
  lea    D36(%rip),%r12
  jmp    L74
L65:
  lea    0xd9(%rsp),%rdi
  call   <strlen@plt>
  test   %eax,%eax
  jle    L136
  mov    $0x0,%edx
  lea    0xd9(%rsp),%rsi
L41:
  movsbl (%rdx,%rsi,1),%ecx
  sub    $0x30,%ecx
  mov    %ecx,0x10(%rsp,%rdx,4)
  add    $0x1,%rdx
  cmp    %edx,%eax
  jg     L41
  movl   $0x0,0xc(%rsp)
  lea    0x10(%rsp),%rbp
  lea    -0x1(%rax),%eax
  lea    0x14(%rsp,%rax,4),%rbx
  mov    %rbp,%r13
  lea    0xc(%rsp),%r14
L55:
  lea    0x100(%rsp),%rcx
  lea    0xe2(%rsp),%rdx
  mov    %r14,%r8
  mov    0x8(%rsp),%esi
  mov    0x0(%r13),%edi
  call   <make_hor_output@plt>
  mov    0xc(%rsp),%edx
  lea    0x1(%rdx),%eax
  cltq
  movb   $0x20,0x100(%rsp,%rax,1)
  lea    0x2(%rdx),%eax
  mov    %eax,0xc(%rsp)
  add    $0x4,%r13
  cmp    %rbx,%r13
  jne    L55
  add    $0x1,%edx
  movslq %edx,%rdx
  movb   $0x0,0x100(%rsp,%rdx,1)
  movl   $0x0,0xc(%rsp)
  mov    %rbp,%r13
  lea    0xc(%rsp),%r14
L95:
  lea    0x370(%rsp),%rcx
  lea    0x30(%rsp),%rdx
  mov    %r14,%r8
  mov    0x8(%rsp),%esi
  mov    0x0(%r13),%edi
  call   <make_ver_output@plt>
  mov    0xc(%rsp),%edx
  lea    0x1(%rdx),%eax
  cltq
  movb   $0x20,0x370(%rsp,%rax,1)
  lea    0x2(%rdx),%eax
  mov    %eax,0xc(%rsp)
  add    $0x4,%r13
  cmp    %rbx,%r13
  jne    L95
  add    $0x1,%edx
  movslq %edx,%rdx
  movb   $0x0,0x370(%rsp,%rdx,1)
  movl   $0x0,0xc(%rsp)
  mov    %rbp,%r13
  lea    0xc(%rsp),%r14
L44:
  lea    0x1d0(%rsp),%rcx
  lea    0xec(%rsp),%rdx
  mov    %r14,%r8
  mov    0x8(%rsp),%esi
  mov    0x0(%r13),%edi
  call   <make_hor_output@plt>
  mov    0xc(%rsp),%edx
  lea    0x1(%rdx),%eax
  cltq
  movb   $0x20,0x1d0(%rsp,%rax,1)
  lea    0x2(%rdx),%eax
  mov    %eax,0xc(%rsp)
  add    $0x4,%r13
  cmp    %rbx,%r13
  jne    L44
  add    $0x1,%edx
  movslq %edx,%rdx
  movb   $0x0,0x1d0(%rsp,%rdx,1)
  movl   $0x0,0xc(%rsp)
  mov    %rbp,%r13
  lea    0xc(%rsp),%r14
L21:
  lea    0x440(%rsp),%rcx
  lea    0x80(%rsp),%rdx
  mov    %r14,%r8
  mov    0x8(%rsp),%esi
  mov    0x0(%r13),%edi
  call   <make_ver_output@plt>
  mov    0xc(%rsp),%edx
  lea    0x1(%rdx),%eax
  cltq
  movb   $0x20,0x440(%rsp,%rax,1)
  lea    0x2(%rdx),%eax
  mov    %eax,0xc(%rsp)
  add    $0x4,%r13
  cmp    %rbx,%r13
  jne    L21
  add    $0x1,%edx
  movslq %edx,%rdx
  movb   $0x0,0x440(%rsp,%rdx,1)
  movl   $0x0,0xc(%rsp)
  lea    0xc(%rsp),%r13
L37:
  lea    0x2a0(%rsp),%rcx
  lea    0xf6(%rsp),%rdx
  mov    %r13,%r8
  mov    0x8(%rsp),%esi
  mov    0x0(%rbp),%edi
  call   <make_hor_output@plt>
  mov    0xc(%rsp),%eax
  lea    0x1(%rax),%edx
  movslq %edx,%rdx
  movb   $0x20,0x2a0(%rsp,%rdx,1)
  add    $0x2,%eax
  mov    %eax,0xc(%rsp)
  add    $0x4,%rbp
  cmp    %rbx,%rbp
  jne    L37
L29:
  mov    0xc(%rsp),%eax
  sub    $0x1,%eax
  cltq
  movb   $0x0,0x2a0(%rsp,%rax,1)
  lea    0x100(%rsp),%rdi
  call   <puts@plt>
  cmpl   $0x0,0x8(%rsp)
  jle    L158
  mov    $0x0,%ebx
  lea    0x370(%rsp),%rbp
L161:
  mov    %rbp,%rdi
  call   <puts@plt>
  add    $0x1,%ebx
  cmp    %ebx,0x8(%rsp)
  jg     L161
L158:
  lea    0x1d0(%rsp),%rdi
  call   <puts@plt>
  cmpl   $0x0,0x8(%rsp)
  jle    L79
  mov    $0x0,%ebx
  lea    0x440(%rsp),%rbp
L86:
  mov    %rbp,%rdi
  call   <puts@plt>
  add    $0x1,%ebx
  cmp    %ebx,0x8(%rsp)
  jg     L86
L79:
  lea    0x2a0(%rsp),%rdi
  call   <puts@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
L74:
  lea    0xd9(%rsp),%rdx
  lea    0x8(%rsp),%rsi
  mov    %r12,%rdi
  call   <scanf@plt>
  cmp    $0x2,%eax
  jne    L17
  cmpl   $0x0,0x8(%rsp)
  jne    L65
  cmpb   $0x30,0xd9(%rsp)
  jne    L65
L17:
  mov    0x508(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L167
  mov    $0x0,%eax
  add    $0x510,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L136:
  movb   $0x0,0xff(%rsp)
  movb   $0x0,0x36f(%rsp)
  movb   $0x0,0x1cf(%rsp)
  movb   $0x0,0x43f(%rsp)
  movl   $0x0,0xc(%rsp)
  jmp    L29
L167:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D14
type_guessed: string
name: read_data
arguments: data_label: D18
type_guessed: string
name: read_data
arguments: data_label: D2
type_guessed: string
name: read_data
arguments: data_label: D36
type_guessed: string

tool: D14: 11

tool: D18: 01

tool: D2: 10

tool: D36: %d %s

assistant: ```c
int main() {
  const char hor_1[10] = {'1', '0', '1', '1', '0', '1', '1', '1', '1', '1'};
  const char *ver_1[10] = {"11", "01", "01", "01", "11", "10", "10", "01", "11", "11"};
  const char hor_2[10] = {'0', '0', '1', '1', '1', '1', '1', '0', '1', '1'};
  const char *ver_2[10] = {"11", "01", "10", "01", "01", "01", "11", "01", "11", "01"};
  const char hor_3[10] = {'1', '0', '1', '1', '0', '1', '1', '0', '1', '1'};
  int size;
  char num_string[8 + 1];
  int number[8];
  int num_digit;
  int i, pos;
  char output_hor_1[200], output_hor_2[200], output_hor_3[200];
  char output_ver_1[200], output_ver_2[200];
  while (scanf("%d %s", &size, num_string) == 2) {
    if (size == 0 && num_string[0] == '0') {
      break;
    }
    num_digit = strlen(num_string);
    for (i = 0; i < num_digit; i++) {
      number[i] = num_string[i] - '0';
    }
    for (pos = 0, i = 0; i < num_digit; i++) {
      make_hor_output(number[i], size, hor_1, output_hor_1, &pos);
      output_hor_1[++pos] = ' ';
      ++pos;
    }
    output_hor_1[pos - 1] = '\0';
    for (pos = 0, i = 0; i < num_digit; i++) {
      make_ver_output(number[i], size, ver_1, output_ver_1, &pos);
      output_ver_1[++pos] = ' ';
      ++pos;
    }
    output_ver_1[pos - 1] = '\0';
    for (pos = 0, i = 0; i < num_digit; i++) {
      make_hor_output(number[i], size, hor_2, output_hor_2, &pos);
      output_hor_2[++pos] = ' ';
      ++pos;
    }
    output_hor_2[pos - 1] = '\0';
    for (pos = 0, i = 0; i < num_digit; i++) {
      make_ver_output(number[i], size, ver_2, output_ver_2, &pos);
      output_ver_2[++pos] = ' ';
      ++pos;
    }
    output_ver_2[pos - 1] = '\0';
    for (pos = 0, i = 0; i < num_digit; i++) {
      make_hor_output(number[i], size, hor_3, output_hor_3, &pos);
      output_hor_3[++pos] = ' ';
      ++pos;
    }
    output_hor_3[pos - 1] = '\0';
    printf("%s\n", output_hor_1);
    for (i = 0; i < size; i++) {
      printf("%s\n", output_ver_1);
    }
    printf("%s\n", output_hor_2);
    for (i = 0; i < size; i++) {
      printf("%s\n", output_ver_2);
    }
    printf("%s\n", output_hor_3);
    printf("\n");
  }
  return 0;
}
```