user: Demonstrate the C code that generates the assembly output below:

```asm
<ParseLongInt>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,%r12
  mov    %rsi,%rbx
  mov    %rsi,0x8(%rsp)
  mov    %rdx,%r15
  mov    %rcx,(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  movq   $0x0,0x1d(%rsp)
  movw   $0x0,0x25(%rsp)
  movb   $0x0,0x27(%rsp)
  test   %rdi,%rdi
  setne  %al
  test   %rsi,%rsi
  setne  %dil
  movzbl %dil,%edi
  and    %eax,%edi
  call   <assert@plt>
  mov    (%rbx),%rbx
  lea    (%r12,%rbx,1),%rbp
  movzbl 0x0(%rbp),%eax
  test   %al,%al
  je     L124
  lea    D40(%rip),%r14
  jmp    L168
L318:
  lea    0x1(%rbx),%r13
  movzbl 0x1(%r12,%rbx,1),%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L15
  mov    %r13,%rbx
  jmp    L293
L105:
  cmpq   $0x0,(%rsp)
  jne    L133
  mov    %r15,%rsi
  mov    %r14,%rdi
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit_wrapper@plt>
L293:
  lea    (%r12,%rbx,1),%rbp
  movzbl 0x0(%rbp),%eax
  test   %al,%al
  je     L124
L168:
  cmp    $0x30,%al
  je     L318
L15:
  movzbl 0x0(%rbp),%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L195
  movzbl 0x0(%rbp),%edi
  cmp    $0x2d,%dil
  je     L301
  movzbl %dil,%edi
  call   <isspace@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L105
  add    $0x1,%rbx
  jmp    L293
L133:
  mov    (%rsp),%rax
  movl   $0x1,(%rax)
  jmp    L97
L195:
  cmpb   $0x0,0x0(%rbp)
  je     L124
L301:
  mov    $0x0,%r13d
  jmp    L326
L124:
  mov    (%rsp),%rax
  test   %rax,%rax
  je     L40
  movl   $0x2,(%rax)
  mov    $0x0,%ebp
L97:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L13
  mov    %rbp,%rax
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L40:
  mov    %r15,%rsi
  lea    D31(%rip),%rdi
  call   <printf@plt>
  mov    $0x2,%edi
  call   <exit_wrapper@plt>
  jmp    L301
L50:
  movzbl (%r12,%rbx,1),%edx
  lea    0x1(%r13),%r14
  cmp    $0x2d,%dl
  je     L6
  test   %dl,%dl
  je     L249
  cmpq   $0x0,(%rsp)
  jne    L89
  mov    %r15,%rsi
  lea    D7(%rip),%rdi
  call   <printf@plt>
  mov    $0x3,%edi
  call   <exit_wrapper@plt>
  cmp    $0xa,%r13
  jbe    L109
  mov    %r13,%r14
L167:
  mov    %r15,%rsi
  lea    D22(%rip),%rdi
  call   <printf@plt>
  mov    $0x4,%edi
  call   <exit_wrapper@plt>
  mov    %r14,%r13
L109:
  add    $0x1,%rbx
L326:
  movzbl (%r12,%rbx,1),%edi
  call   <isspace@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  jne    L249
  movzbl (%r12,%rbx,1),%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L50
  lea    0x1(%r13),%r14
  movzbl (%r12,%rbx,1),%edx
L6:
  mov    %dl,0x1d(%rsp,%r13,1)
  cmp    $0xa,%r14
  jbe    L163
  cmpq   $0x0,(%rsp)
  je     L167
  mov    (%rsp),%rax
  movl   $0x4,(%rax)
  jmp    L97
L89:
  mov    (%rsp),%rcx
  movl   $0x3,(%rcx)
  mov    %rax,%rbp
  jmp    L97
L163:
  mov    %r14,%r13
  jmp    L109
L249:
  movb   $0x0,0x1d(%rsp,%r13,1)
  mov    0x8(%rsp),%rax
  mov    %rbx,(%rax)
  mov    $0x0,%ebp
  cmpb   $0x30,0x1d(%rsp)
  je     L97
  lea    0x1d(%rsp),%rdi
  call   <atol@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  jne    L97
  mov    (%rsp),%rax
  test   %rax,%rax
  je     L57
  movl   $0x5,(%rax)
  jmp    L97
L57:
  mov    %r15,%rsi
  lea    D47(%rip),%rdi
  call   <printf@plt>
  mov    $0x5,%edi
  call   <exit_wrapper@plt>
  jmp    L97
L13:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D40
data_type: string
name: disassemble_data
arguments: data_label: D31
data_type: string
name: disassemble_data
arguments: data_label: D7
data_type: string
name: disassemble_data
arguments: data_label: D22
data_type: string
name: disassemble_data
arguments: data_label: D47
data_type: string

tool: D40: Error: Invalid character encountered when numerical string is expected.
Error occurs in line %lu of input file
Aborting


tool: D31: Error: Unexpected end of line encountered.
Error occurs in line %lu of input file
Aborting


tool: D7: Error: Non-numerical character encountered when numerical string is expected.
Error occurs in line %lu of input file
Aborting


tool: D22: Error: The encountered numerical string is too large.
Error occurs in line %lu of input file
Aborting


tool: D47: Error converting numerical string to numerical value.
Error occurs in line %lu of input file
Aborting


assistant: ```c
long int ParseLongInt(char *buffer, unsigned long *startindex, unsigned long linenum, int *errorstatus) {
  unsigned long index;
  char buffer2[11] = {0};
  unsigned long index2 = 0;
  long value = 0;
  (assert((buffer != NULL) && (startindex != NULL)));
  index = *startindex;
  while (buffer[index] != '\0') {
    if ((buffer[index] == '0') && (isdigit((unsigned char)buffer[index + 1])))
      index++;
    else {
      if (isdigit((unsigned char)buffer[index]))
        break;
      if (buffer[index] == '-')
        break;
      if (isspace((unsigned char)buffer[index]))
        index++;
      else {
        if (errorstatus != NULL) {
          *errorstatus = 1;
          return 0;
        } else {
          printf("Error: Invalid character encountered when numerical string is expected.\nError occurs in line %lu of input file\nAborting\n", linenum);
          exit_wrapper(1);
        }
      }
    }
  }
  if (buffer[index] == '\0') {
    if (errorstatus != NULL) {
      *errorstatus = 2;
      return 0;
    } else {
      printf("Error: Unexpected end of line encountered.\nError occurs in line %lu of input file\nAborting\n", linenum);
      exit_wrapper(2);
    }
  }
  while (isspace((unsigned char)buffer[index]) == 0) {
    if (isdigit((unsigned char)buffer[index]))
      buffer2[index2++] = buffer[index];
    else if (buffer[index] == '-')
      buffer2[index2++] = buffer[index];
    else {
      if (buffer[index] == '\0')
        break;
      if (errorstatus != NULL) {
        *errorstatus = 3;
        return 0;
      } else {
        printf("Error: Non-numerical character encountered when numerical string is expected.\nError occurs in line %lu of input file\nAborting\n", linenum);
        exit_wrapper(3);
      }
    }
    if (index2 > 10) {
      if (errorstatus != NULL) {
        *errorstatus = 4;
        return 0;
      } else {
        printf("Error: The encountered numerical string is too large.\nError occurs in line %lu of input file\nAborting\n", linenum);
        exit_wrapper(4);
      }
    }
    index++;
  }
  buffer2[index2] = '\0';
  (*startindex) = index;
  if (buffer2[0] == '0')
    value = 0;
  else {
    value = atol(buffer2);
    if (value == 0) {
      if (errorstatus != NULL) {
        *errorstatus = 5;
        return 0;
      } else {
        printf("Error converting numerical string to numerical value.\nError occurs in line %lu of input file\nAborting\n", linenum);
        exit_wrapper(5);
      }
    }
  }
  return value;
}
```