user: Translate the below assembly code into C programming language:

```asm
<GET_NBR>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  movslq %esi,%r13
  push   %r12
  push   %rbp
  lea    D5(%rip),%rbp
  push   %rbx
  mov    %r13,%rbx
  imul   $0x66666667,%r13,%r13
  mov    %ebx,%eax
  mov    %ebx,%r15d
  sar    $0x1f,%eax
  sar    $0x22,%r13
  sub    $0x18,%rsp
  sub    %eax,%r13d
  mov    %rdi,0x8(%rsp)
  lea    0x0(%r13,%r13,4),%eax
  add    %eax,%eax
  sub    %eax,%r15d
  xor    %eax,%eax
  call   <getchar@plt>
  lea    -0x30(%rax),%edx
  cmp    $0x9,%edx
  ja     L139
  jmp    L120
  nopl   (%rax)
L101:
  xor    %eax,%eax
  call   <getchar@plt>
L139:
  cmp    $0xa,%eax
  jne    L101
  mov    %ebx,%esi
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %eax,%eax
  call   <getchar@plt>
  lea    -0x30(%rax),%edx
  cmp    $0x9,%edx
  ja     L139
L120:
  lea    0x0(%r13,%r13,4),%r14d
  xor    %r12d,%r12d
  lea    D5(%rip),%rbp
  add    %r14d,%r14d
  nopl   0x0(%rax)
L57:
  cmp    %r12d,%r13d
  jg     L121
L135:
  jne    L185
  cmp    %edx,%r15d
  jl     L103
  xor    %eax,%eax
  lea    (%r14,%rdx,1),%r12d
  call   <getchar@plt>
L50:
  lea    -0x30(%rax),%edx
  cmp    $0x9,%edx
  ja     L83
  cmp    %r12d,%r13d
  jle    L135
L121:
  lea    (%r12,%r12,4),%eax
  lea    (%rdx,%rax,2),%r12d
  xor    %eax,%eax
  call   <getchar@plt>
  jmp    L50
  nopl   0x0(%rax)
L185:
  xor    %eax,%eax
  call   <getchar@plt>
  cmp    $0xa,%eax
  jne    L185
  nopl   0x0(%rax)
L46:
  mov    %ebx,%esi
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %eax,%eax
  call   <getchar@plt>
  lea    -0x30(%rax),%edx
  cmp    $0x9,%edx
  jbe    L189
  nopw   0x0(%rax,%rax,1)
L54:
  cmp    $0xa,%eax
  je     L46
  xor    %eax,%eax
  call   <getchar@plt>
  jmp    L54
  xchg   %ax,%ax
L103:
  xor    %eax,%eax
  call   <getchar@plt>
  cmp    $0xa,%eax
  jne    L103
  nopl   0x0(%rax)
L26:
  mov    %ebx,%esi
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %eax,%eax
  call   <getchar@plt>
  lea    -0x30(%rax),%edx
  cmp    $0x9,%edx
  jbe    L189
  nopl   0x0(%rax,%rax,1)
L147:
  cmp    $0xa,%eax
  je     L26
  xor    %eax,%eax
  call   <getchar@plt>
  jmp    L147
  xchg   %ax,%ax
L58:
  xor    %eax,%eax
  call   <getchar@plt>
L83:
  cmp    $0xa,%eax
  jne    L58
  mov    0x8(%rsp),%rax
  mov    %r12d,(%rax)
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L189:
  xor    %r12d,%r12d
  jmp    L57
```

tool_calls: name: read_data
arguments: data_label: D5
datatype: string

tool: D5:     Not a number (0..%d) - re-input: 

assistant: ```c
void GET_NBR(r, d) int *r, d;
{
  register int c, m, k, l, n;
  {
    n = 0;
    k = d / 10;
    l = d - 10 * (d / 10);
    c = getchar();
    n = 0;
    while ((c < '0') || (c > '9')) {
      while (c != '\n') {
        c = getchar();
      }
      printf("    Not a number (0..%d) - re-input: ", d);
      c = getchar();
    };
    while ((c >= '0') && (c <= '9')) {
      m = c - '0';
      if (n < k) {
        n = 10 * n + m;
        c = getchar();
      } else if (n == k) {
        if (m <= l) {
          n = 10 * n + m;
          c = getchar();
        } else {
          while (c != '\n') {
            c = getchar();
          }
          printf("    Not a number (0..%d) - re-input: ", d);
          c = getchar();
          n = 0;
          while ((c < '0') || (c > '9')) {
            while (c != '\n') {
              c = getchar();
            }
            printf("    Not a number (0..%d) - re-input: ", d);
            c = getchar();
          };
        }
      } else {
        while (c != '\n') {
          c = getchar();
        }
        printf("    Not a number (0..%d) - re-input: ", d);
        c = getchar();
        n = 0;
        while ((c < '0') || (c > '9')) {
          while (c != '\n') {
            c = getchar();
          }
          printf("    Not a number (0..%d) - re-input: ", d);
          c = getchar();
        };
      }
    }
    while (c != '\n') {
      c = getchar();
    }
    *r = n;
  }
}
```