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

```asm
<main>:
  endbr64
  push   %r15
  mov    $0x3134,%edx
  push   %r14
  push   %r13
  push   %r12
  mov    $0x30,%r12d
  push   %rbp
  push   %rbx
  sub    $0xb8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0xa8(%rsp)
  xor    %eax,%eax
  mov    $0x3638,%eax
  mov    %dx,0x25(%rsp)
  lea    0x20(%rsp),%rbx
  mov    %ax,0x20(%rsp)
  lea    0x1e(%rsp),%rax
  movl   $0x0,0xc(%rsp)
  movl   $0x0,0x8(%rsp)
  mov    %rax,(%rsp)
L95:
  mov    $0x30,%ebp
  nopl   (%rax)
L167:
  mov    $0x30,%r15d
  lea    0x1f(%rsp),%r13
  cmp    %ebp,%r12d
  jne    L132
  jmp    L109
  nopl   (%rax)
L4:
  add    $0x1,%r15d
  cmp    $0x3a,%r15d
  je     L117
L132:
  xor    %eax,%eax
  mov    %r15d,%ecx
  mov    (%rsp),%rdx
  mov    $0x7,%esi
  mov    %r12b,%al
  mov    %rbx,%rdi
  mov    %bpl,0x24(%rsp)
  mov    %cl,%ah
  mov    %ax,0x22(%rsp)
  call   <decchk@plt>
  movzbl 0x1e(%rsp),%eax
  mov    %r13,%rdx
  mov    %rbx,%rdi
  mov    $0x8,%esi
  mov    %al,0x27(%rsp)
  call   <decchk@plt>
  mov    %r13,%rdx
  mov    $0x8,%esi
  mov    %rbx,%rdi
  mov    %eax,%r14d
  mov    %bpl,0x22(%rsp)
  mov    %r12b,0x24(%rsp)
  call   <decchk@plt>
  test   %r14d,%r14d
  je     L42
  test   %eax,%eax
  je     L4
L42:
  add    $0x1,%r15d
  addl   $0x1,0x8(%rsp)
  cmp    $0x3a,%r15d
  jne    L132
L117:
  addl   $0xa,0xc(%rsp)
L10:
  add    $0x1,%ebp
  cmp    $0x3a,%ebp
  jne    L167
  add    $0x1,%r12d
  cmp    $0x3a,%r12d
  jne    L95
  mov    0xc(%rsp),%r14d
  lea    D9(%rip),%r12
  lea    D63(%rip),%rsi
  xor    %eax,%eax
  mov    %r12,%rdx
  lea    D44(%rip),%rdi
  lea    D12(%rip),%r13
  mov    %r14d,%ecx
  call   <printf@plt>
  mov    0x8(%rsp),%r15d
  mov    %r12,%rdx
  xor    %eax,%eax
  lea    D15(%rip),%rsi
  lea    D18(%rip),%rdi
  mov    %r15d,%ecx
  call   <printf@plt>
  mov    %r14d,%eax
  pxor   %xmm0,%xmm0
  pxor   %xmm1,%xmm1
  sub    %r15d,%eax
  cvtsi2ss %r14d,%xmm1
  mov    %r12,%rdx
  cvtsi2ss %eax,%xmm0
  lea    D72(%rip),%rsi
  mov    $0x1,%eax
  lea    D70(%rip),%rdi
  lea    D88(%rip),%r12
  divss  %xmm1,%xmm0
  cvtss2sd %xmm0,%xmm0
  call   <printf@plt>
L73:
  mov    %r12,%rdi
  call   <puts@plt>
  mov    %rbx,%rdi
  call   <gets@plt>
  test   %rax,%rax
  je     L140
  xor    %eax,%eax
  jmp    L62
  nopl   0x0(%rax,%rax,1)
L29:
  add    $0x1,%rax
  cmp    $0x80,%rax
  je     L101
L62:
  cmpb   $0x78,(%rbx,%rax,1)
  movslq %eax,%rbp
  jne    L29
  test   %ebp,%ebp
  je     L140
  lea    0x1(%rbp),%r14d
L43:
  lea    0x1e(%rsp),%rdx
  mov    %ebp,%esi
  mov    %rbx,%rdi
  call   <decchk@plt>
  movzbl 0x1e(%rsp),%eax
  mov    %r14d,%esi
  mov    %rbx,%rdi
  lea    0x1f(%rsp),%rdx
  movslq %r14d,%r14
  mov    %al,0x20(%rsp,%rbp,1)
  call   <decchk@plt>
  mov    %rbx,%rsi
  mov    %r13,%rdi
  movb   $0x0,0x20(%rsp,%r14,1)
  cmp    $0x1,%eax
  sbb    %edx,%edx
  xor    %eax,%eax
  and    $0xfffffff2,%edx
  add    $0x54,%edx
  call   <printf@plt>
  jmp    L73
  nopl   0x0(%rax,%rax,1)
L109:
  movb   $0x39,0x23(%rsp)
  jmp    L10
L101:
  mov    $0x81,%r14d
  mov    $0x80,%ebp
  jmp    L43
L140:
  lea    D40(%rip),%rdi
  call   <puts@plt>
  mov    0xa8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L157
  add    $0xb8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L157:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: tag: D9
type_infered: string
name: parse_data
arguments: tag: D63
type_infered: string
name: parse_data
arguments: tag: D44
type_infered: string
name: parse_data
arguments: tag: D12
type_infered: string
name: parse_data
arguments: tag: D15
type_infered: string
name: parse_data
arguments: tag: D18
type_infered: string
name: parse_data
arguments: tag: D72
type_infered: string
name: parse_data
arguments: tag: D70
type_infered: string
name: parse_data
arguments: tag: D88
type_infered: string
name: parse_data
arguments: tag: D40
type_infered: string

tool: D9:  

tool: D63: Total tries:

tool: D44: %s %14s %3d


tool: D12: %s checks as %c


tool: D15: Bad tries:

tool: D18: %s %16s %3d


tool: D72: Fraction good:

tool: D70: %s %11s %4.2f


tool: D88: enter string terminated by x:

tool: D40: Normal completion

assistant: ```c
int main(void) {
  int j, k, l, n, nbad = 0, ntot = 0;
  int iok, jok;
  char lin[128 + 2], ch, chh;
  lin[0] = '8';
  lin[1] = '6';
  lin[5] = '4';
  lin[6] = '1';
  for (j = 48; j <= 57; j++) {
    for (k = 48; k <= 57; k++) {
      for (l = 48; l <= 57; l++) {
        lin[3] = l;
        if (j != k) {
          ntot++;
          lin[2] = j;
          lin[4] = k;
          iok = decchk(lin, 7, &ch);
          lin[7] = ch;
          iok = decchk(lin, 8, &chh);
          lin[2] = k;
          lin[4] = j;
          jok = decchk(lin, 8, &chh);
          if (!iok || jok)
            nbad++;
        }
      }
    }
  }
  printf("%s %14s %3d\n", "Total tries:", " ", ntot);
  printf("%s %16s %3d\n", "Bad tries:", " ", nbad);
  printf("%s %11s %4.2f\n", "Fraction good:", " ", ((float)(ntot - nbad)) / ntot);
  for (;;) {
    printf("enter string terminated by x:\n");
    if (gets(lin) == NULL)
      break;
    for (j = 0; j < 128; j++)
      if (lin[j] == 'x')
        break;
    n = j;
    if (!n)
      break;
    iok = decchk(lin, n, &ch);
    lin[n] = ch;
    jok = decchk(lin, n + 1, &chh);
    lin[n + 1] = 0;
    printf("%s checks as %c\n", lin, jok ? 'T' : 'F');
  }
  printf("Normal completion\n");
  return 0;
}
```