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

```asm
<NJ_is_distance>:
  endbr64
  test   %rdi,%rdi
  je     L278
  push   %r15
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  movsbl (%rdi),%ebp
  mov    %ebp,%edi
  call   <NJ_is_number@plt>
  test   %eax,%eax
  jne    L158
  lea    -0x2d(%rbp),%eax
  cmp    $0x1,%al
  jbe    L158
  cmp    $0x2b,%bpl
  jne    L35
L158:
  mov    %r13,%rdi
  call   <strlen@plt>
  cmp    $0x1,%eax
  je     L233
L274:
  mov    %r13,%rdi
  movl   $0x0,0xc(%rsp)
  xor    %r15d,%r15d
  xor    %ebp,%ebp
  call   <strlen@plt>
  xor    %r12d,%r12d
  mov    %r15d,%r14d
  cmp    %r15d,%eax
  jle    L192
  nopw   0x0(%rax,%rax,1)
L130:
  movsbl 0x0(%r13,%r15,1),%edi
  mov    %edi,%ebx
  call   <NJ_is_number@plt>
  test   %eax,%eax
  jne    L247
  lea    -0x2b(%rbx),%eax
  cmp    $0x3a,%al
  ja     L35
  movabs $0xfbfffffffbfffff2,%rsi
  bt     %rax,%rsi
  jb     L35
L247:
  test   %r14d,%r14d
  jle    L103
  test   %r12d,%r12d
  jne    L103
  lea    -0x2b(%rbx),%eax
  test   $0xfd,%al
  je     L35
  test   %r12d,0xc(%rsp)
  jne    L270
  cmp    $0x2e,%bl
  sete   %al
  and    $0x1,%ebp
  je     L189
  test   %al,%al
  jne    L35
L189:
  test   %r12d,%r12d
  je     L91
L94:
  cmpl   $0x1,0xc(%rsp)
  mov    $0x1,%r12d
  je     L88
  sub    $0x2b,%ebx
  xor    %esi,%esi
  and    $0xfd,%ebx
  sete   %sil
  mov    %esi,0xc(%rsp)
L88:
  or     %ebp,%eax
  mov    %r13,%rdi
  add    $0x1,%r15
  movzbl %al,%ebp
  mov    %r15d,%r14d
  call   <strlen@plt>
  cmp    %r15d,%eax
  jg     L130
L192:
  mov    %r13,%rdi
  call   <strlen@plt>
  cltq
  movsbl -0x1(%r13,%rax,1),%edi
  call   <NJ_is_number@plt>
  test   %eax,%eax
  setne  %al
  add    $0x18,%rsp
  pop    %rbx
  movzbl %al,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L233:
  mov    %ebp,%edi
  call   <NJ_is_number@plt>
  test   %eax,%eax
  jne    L274
L35:
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L103:
  test   %r12d,0xc(%rsp)
  je     L255
  lea    -0x2b(%rbx),%eax
  test   $0xfd,%al
  je     L35
L270:
  cmp    $0x2e,%bl
  je     L35
  mov    %ebx,%eax
  and    $0xffffffdf,%eax
  cmp    $0x45,%al
  je     L35
  and    $0x1,%ebp
  xor    %eax,%eax
  test   %r12d,%r12d
  jne    L94
  jmp    L88
  nop
L255:
  test   %r12d,%r12d
  jne    L270
  cmp    $0x2e,%bl
  sete   %al
  and    $0x1,%ebp
  test   %al,%al
  je     L91
  test   %bpl,%bpl
  jne    L35
L91:
  mov    %ebx,%ecx
  xor    %r12d,%r12d
  and    $0xffffffdf,%ecx
  cmp    $0x45,%cl
  je     L94
  jmp    L88
  nopl   (%rax)
L278:
  xor    %eax,%eax
  ret
```

assistant: ```c
int NJ_is_distance(char *token) {
  int i;
  char c;
  int exponent_state;
  int expsign_state;
  int dpoint_state;
  if (!token) {
    return (0);
  }
  exponent_state = 0;
  expsign_state = 0;
  dpoint_state = 0;
  c = token[0];
  if (!NJ_is_number(c) && c != '.' && c != '-' && c != '+') {
    goto BAD;
  }
  if (strlen(token) == 1) {
    if (!NJ_is_number(c)) {
      goto BAD;
    }
  }
  for (i = 0; i < strlen(token); i++) {
    c = token[i];
    if (!NJ_is_number(c) && c != '.' && c != '-' && c != '+' && c != 'e' && c != 'E') {
      goto BAD;
    }
    if (i > 0 && !exponent_state) {
      if (c == '-' || c == '+') {
        goto BAD;
      }
    }
    if (exponent_state && expsign_state) {
      if (c == '-' || c == '+') {
        goto BAD;
      }
    }
    if (exponent_state) {
      if (c == '.') {
        goto BAD;
      }
    }
    if (exponent_state) {
      if (c == 'e' || c == 'E') {
        goto BAD;
      }
    }
    if (dpoint_state) {
      if (c == '.') {
        goto BAD;
      }
    }
    if (!exponent_state) {
      if (c == 'e' || c == 'E') {
        exponent_state = 1;
      }
    }
    if (exponent_state && !expsign_state) {
      if (c == '-' || c == '+') {
        expsign_state = 1;
      }
    }
    if (!dpoint_state) {
      if (c == '.') {
        dpoint_state = 1;
      }
    }
  }
  if (!NJ_is_number(token[strlen(token) - 1])) {
    goto BAD;
  }
  return (1);
BAD:
  return (0);
}
```