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

```asm
<copy_out_nth_token>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %ecx,-0x3c(%rbp)
  cmpl   $0x0,-0x3c(%rbp)
  jg     L126
  mov    $0x1,%eax
  jmp    L45
L126:
  mov    -0x3c(%rbp),%edx
  mov    -0x38(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <nth_token_location@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L63
  mov    $0x1,%eax
  jmp    L45
L63:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x22,%al
  je     L146
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x27,%al
  jne    L180
L146:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x11(%rbp)
  movl   $0x0,-0x10(%rbp)
  jmp    L256
L30:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    -0x10(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0x10(%rbp)
  mov    -0x10(%rbp),%eax
  cltq
  cmp    %rax,-0x30(%rbp)
  ja     L256
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    $0x1,%eax
  jmp    L45
L256:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    %al,-0x11(%rbp)
  je     L186
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L30
L186:
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  jmp    L168
L180:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x28,%al
  jne    L226
  movl   $0x0,-0x10(%rbp)
  movl   $0x1,-0xc(%rbp)
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    -0x10(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0x10(%rbp)
  jmp    L107
L203:
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  cmp    $0x28,%eax
  je     L140
  cmp    $0x29,%eax
  jne    L103
  subl   $0x1,-0xc(%rbp)
  jmp    L103
L140:
  addl   $0x1,-0xc(%rbp)
  nop
L103:
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    -0x10(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0x10(%rbp)
L107:
  cmpl   $0x0,-0xc(%rbp)
  je     L88
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L203
L88:
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  jmp    L168
L226:
  movl   $0x0,-0x10(%rbp)
  jmp    L97
L12:
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    -0x10(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0x10(%rbp)
  mov    -0x10(%rbp),%eax
  cltq
  cmp    %rax,-0x30(%rbp)
  ja     L97
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    $0x1,%eax
  jmp    L45
L97:
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L234
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L234
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x9,%al
  jne    L12
L234:
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
L168:
  mov    $0x0,%eax
L45:
  leave
  ret
```

assistant: ```c
int copy_out_nth_token(char *tostr, unsigned long len, char *istr, int n) {
  int i;
  int bcount;
  char *token;
  char qterm;
  if (n <= 0)
    return (1);
  if (NULL == (token = nth_token_location(istr, n)))
    return (1);
  if ((token[0] == '\"') || (token[0] == '\'')) {
    qterm = token[0];
    i = 0;
    while ((token[i + 1] != qterm) && (token[i + 1] != 0)) {
      tostr[i] = token[i + 1];
      i++;
      if (i >= len) {
        tostr[i] = 0;
        return (1);
      }
    }
    tostr[i] = 0;
  } else if (token[0] == '(') {
    i = 0;
    bcount = 1;
    tostr[i] = token[i];
    i++;
    while ((0 != bcount) && (token[i] != 0)) {
      switch (token[i]) {
      case ')':
        bcount--;
        break;
      case '(':
        bcount++;
        break;
      }
      tostr[i] = token[i];
      i++;
    }
    tostr[i] = 0;
  } else {
    i = 0;
    while ((token[i] != ' ') && (token[i] != 0) && (token[i] != '\t')) {
      tostr[i] = token[i];
      i++;
      if (i >= len) {
        tostr[i] = 0;
        return (1);
      }
    }
    tostr[i] = 0;
  }
  return (0);
}
```