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

```asm
<GET_BTS>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,-0x28(%rbp)
  movl   $0x0,-0x20(%rbp)
  movl   $0x7fffffff,-0x1c(%rbp)
  movl   $0x1,-0x18(%rbp)
  mov    $0x0,%eax
  call   <getchar@plt>
  mov    %eax,%ebx
  movl   $0x0,-0x20(%rbp)
  jmp    L105
L178:
  mov    $0x0,%eax
  call   <getchar@plt>
  mov    %eax,%ebx
L90:
  cmp    $0xa,%ebx
  jne    L178
  lea    D15(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  call   <getchar@plt>
  mov    %eax,%ebx
L105:
  cmp    $0x2f,%ebx
  jle    L90
  cmp    $0x31,%ebx
  jg     L90
  jmp    L87
L70:
  lea    -0x30(%rbx),%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x20(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jae    L100
  mov    -0x20(%rbp),%eax
  lea    (%rax,%rax,1),%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x20(%rbp)
  mov    $0x0,%eax
  call   <getchar@plt>
  mov    %eax,%ebx
  jmp    L87
L100:
  mov    -0x20(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jne    L200
  mov    -0x14(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  ja     L229
  mov    -0x20(%rbp),%eax
  lea    (%rax,%rax,1),%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x20(%rbp)
  mov    $0x0,%eax
  call   <getchar@plt>
  mov    %eax,%ebx
  jmp    L87
L63:
  mov    $0x0,%eax
  call   <getchar@plt>
  mov    %eax,%ebx
L229:
  cmp    $0xa,%ebx
  jne    L63
  lea    D15(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  call   <getchar@plt>
  mov    %eax,%ebx
  movl   $0x0,-0x20(%rbp)
  jmp    L109
L129:
  mov    $0x0,%eax
  call   <getchar@plt>
  mov    %eax,%ebx
L161:
  cmp    $0xa,%ebx
  jne    L129
  lea    D15(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  call   <getchar@plt>
  mov    %eax,%ebx
L109:
  cmp    $0x2f,%ebx
  jle    L161
  cmp    $0x31,%ebx
  jg     L161
  jmp    L87
L108:
  mov    $0x0,%eax
  call   <getchar@plt>
  mov    %eax,%ebx
L200:
  cmp    $0xa,%ebx
  jne    L108
  lea    D15(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  call   <getchar@plt>
  mov    %eax,%ebx
  movl   $0x0,-0x20(%rbp)
  jmp    L212
L153:
  mov    $0x0,%eax
  call   <getchar@plt>
  mov    %eax,%ebx
L134:
  cmp    $0xa,%ebx
  jne    L153
  lea    D15(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  call   <getchar@plt>
  mov    %eax,%ebx
L212:
  cmp    $0x2f,%ebx
  jle    L134
  cmp    $0x31,%ebx
  jg     L134
L87:
  cmp    $0x2f,%ebx
  jle    L157
  cmp    $0x31,%ebx
  jle    L70
  jmp    L157
L51:
  mov    $0x0,%eax
  call   <getchar@plt>
  mov    %eax,%ebx
L157:
  cmp    $0xa,%ebx
  jne    L51
  mov    -0x20(%rbp),%edx
  mov    -0x28(%rbp),%rax
  mov    %edx,(%rax)
  nop
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: unpack_data
arguments: label: D15
data_type: string

tool: D15:     Not a bit string (0/1's) - re-input: 

assistant: ```c
GET_BTS(s) int *s;
{
  register int c;
  unsigned int k, l, m, n;
  {
    n = 0;
    k = 2147483647;
    l = 1;
    c = getchar();
    n = 0;
    while ((c < '0') || (c > '1')) {
      while (c != '\n') {
        c = getchar();
      }
      printf("    Not a bit string (0/1's) - re-input: ");
      c = getchar();
    };
    while ((c >= '0') && (c <= '1')) {
      m = c - '0';
      if (n < k) {
        n = 2 * n + m;
        c = getchar();
      } else if (n == k) {
        if (m <= l) {
          n = 2 * n + m;
          c = getchar();
        } else {
          while (c != '\n') {
            c = getchar();
          }
          printf("    Not a bit string (0/1's) - re-input: ");
          c = getchar();
          n = 0;
          while ((c < '0') || (c > '1')) {
            while (c != '\n') {
              c = getchar();
            }
            printf("    Not a bit string (0/1's) - re-input: ");
            c = getchar();
          };
        }
      } else {
        while (c != '\n') {
          c = getchar();
        }
        printf("    Not a bit string (0/1's) - re-input: ");
        c = getchar();
        n = 0;
        while ((c < '0') || (c > '1')) {
          while (c != '\n') {
            c = getchar();
          }
          printf("    Not a bit string (0/1's) - re-input: ");
          c = getchar();
        };
      }
    }
    while (c != '\n') {
      c = getchar();
    }
    *s = n;
  }
}
```