user: What would the C source look like for the assembly code provided here:

```asm
<parse_gamess_out>:
  endbr64
  push   %r15
  mov    %esi,%r15d
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xb8,%rsp
  mov    0xf0(%rsp),%rbx
  mov    %edi,(%rsp)
  mov    %esi,0x2c(%rsp)
  lea    D34(%rip),%rsi
  mov    %rdx,0x20(%rsp)
  lea    0x6(%rdi),%edx
  lea    D60(%rip),%rdi
  mov    %rcx,0x8(%rsp)
  mov    %r8,0x10(%rsp)
  mov    %r9,0x38(%rsp)
  mov    %rbx,0x40(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0xa8(%rsp)
  xor    %eax,%eax
  movslq %edx,%rax
  sar    $0x1f,%edx
  imul   $0x66666667,%rax,%rax
  sar    $0x21,%rax
  sub    %edx,%eax
  lea    0x1(%rax),%r14d
  mov    %eax,0x28(%rsp)
  mov    %r14d,0x1c(%rsp)
  call   <fopen@plt>
  test   %rax,%rax
  je     L228
  mov    %rax,%rbp
  lea    -0x1(%r15),%eax
  mov    %r14d,0x4(%rsp)
  lea    0x5f(%rsp),%r15
  lea    (%rax,%rax,2),%rax
  movl   $0x0,0x18(%rsp)
  shl    $0x4,%rax
  lea    0x30(%rbx,%rax,1),%rax
  lea    0x50(%rsp),%rbx
  mov    %rax,0x30(%rsp)
  nopw   0x0(%rax,%rax,1)
L193:
  mov    %rbp,%rdx
  mov    $0x50,%esi
  mov    %rbx,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  je     L334
  lea    D9(%rip),%rsi
  mov    %rbx,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L177
  mov    0x1c(%rsp),%ecx
  cmp    %ecx,0x4(%rsp)
  je     L69
  mov    0x4(%rsp),%ecx
  cmp    %ecx,0x28(%rsp)
  je     L425
  mov    0x4(%rsp),%ecx
  test   %ecx,%ecx
  jg     L144
L177:
  lea    D23(%rip),%rsi
  mov    %rbx,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  jne    L142
L17:
  lea    D31(%rip),%rsi
  mov    %rbx,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  jne    L84
L15:
  lea    D74(%rip),%rsi
  mov    %rbx,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L193
  mov    0x2c(%rsp),%eax
  test   %eax,%eax
  jle    L193
  mov    0x40(%rsp),%r12
  mov    0x30(%rsp),%r13
  nopl   0x0(%rax,%rax,1)
L113:
  mov    %rbp,%rdx
  mov    $0x50,%esi
  mov    %rbx,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  je     L103
  mov    %r15,%rdi
  call   <atof@plt>
  lea    0x6c(%rsp),%rdi
  movsd  %xmm0,(%r12)
  call   <atoi@plt>
  mov    $0xa,%edi
  mov    %eax,%esi
  call   <pow@plt>
  mulsd  (%r12),%xmm0
  movsd  %xmm0,(%r12)
L103:
  mov    %rbp,%rdx
  mov    $0x50,%esi
  mov    %rbx,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  je     L218
  mov    %r15,%rdi
  call   <atof@plt>
  lea    0x6c(%rsp),%rdi
  movsd  %xmm0,0x8(%r12)
  call   <atoi@plt>
  mov    $0xa,%edi
  mov    %eax,%esi
  call   <pow@plt>
  mulsd  0x8(%r12),%xmm0
  movsd  %xmm0,0x8(%r12)
L218:
  mov    %rbp,%rdx
  mov    $0x50,%esi
  mov    %rbx,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  je     L380
  mov    %r15,%rdi
  call   <atof@plt>
  lea    0x6c(%rsp),%rdi
  movsd  %xmm0,0x10(%r12)
  call   <atoi@plt>
  mov    $0xa,%edi
  mov    %eax,%esi
  call   <pow@plt>
  mulsd  0x10(%r12),%xmm0
  movsd  %xmm0,0x10(%r12)
L380:
  mov    %rbp,%rdx
  mov    $0x50,%esi
  mov    %rbx,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  je     L122
  mov    %r15,%rdi
  call   <atof@plt>
  lea    0x6c(%rsp),%rdi
  movsd  %xmm0,0x18(%r12)
  call   <atoi@plt>
  mov    $0xa,%edi
  mov    %eax,%esi
  call   <pow@plt>
  mulsd  0x18(%r12),%xmm0
  movsd  %xmm0,0x18(%r12)
L122:
  mov    %rbp,%rdx
  mov    $0x50,%esi
  mov    %rbx,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  je     L230
  mov    %r15,%rdi
  call   <atof@plt>
  lea    0x6c(%rsp),%rdi
  movsd  %xmm0,0x20(%r12)
  call   <atoi@plt>
  mov    $0xa,%edi
  mov    %eax,%esi
  call   <pow@plt>
  mulsd  0x20(%r12),%xmm0
  movsd  %xmm0,0x20(%r12)
L230:
  mov    %rbp,%rdx
  mov    $0x50,%esi
  mov    %rbx,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  je     L325
  mov    %rbp,%rdx
  mov    $0x50,%esi
  mov    %rbx,%rdi
  call   <fgets@plt>
L325:
  add    $0x30,%r12
  cmp    %r12,%r13
  jne    L113
  jmp    L193
L144:
  mov    (%rsp),%ecx
  cmp    %ecx,0x18(%rsp)
  jl     L164
L69:
  subl   $0x1,0x4(%rsp)
  jmp    L177
L84:
  mov    (%rsp),%edx
  test   %edx,%edx
  jle    L15
L108:
  mov    0x38(%rsp),%r13
  xor    %r14d,%r14d
  cs nopw 0x0(%rax,%rax,1)
L313:
  mov    %rbp,%rdx
  mov    $0x50,%esi
  mov    %rbx,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  je     L379
  mov    %r15,%rdi
  call   <atof@plt>
  lea    0x6c(%rsp),%rdi
  movsd  %xmm0,0x0(%r13)
  call   <atoi@plt>
  mov    $0xa,%edi
  mov    %eax,%esi
  call   <pow@plt>
  mulsd  0x0(%r13),%xmm0
  movsd  %xmm0,0x0(%r13)
L379:
  mov    %rbp,%rdx
  mov    $0x50,%esi
  mov    %rbx,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  je     L286
  mov    %r15,%rdi
  call   <atof@plt>
  lea    0x6c(%rsp),%rdi
  movsd  %xmm0,0x8(%r13)
  call   <atoi@plt>
  mov    $0xa,%edi
  mov    %eax,%esi
  call   <pow@plt>
  mulsd  0x8(%r13),%xmm0
  movsd  %xmm0,0x8(%r13)
L286:
  mov    %rbp,%rdx
  mov    $0x50,%esi
  mov    %rbx,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  je     L354
  mov    %r15,%rdi
  call   <atof@plt>
  lea    0x6c(%rsp),%rdi
  movsd  %xmm0,0x10(%r13)
  call   <atoi@plt>
  mov    $0xa,%edi
  mov    %eax,%esi
  call   <pow@plt>
  mulsd  0x10(%r13),%xmm0
  movsd  %xmm0,0x10(%r13)
L354:
  mov    $0xf,%r12d
  nopl   (%rax)
L422:
  mov    %rbp,%rdx
  mov    $0x50,%esi
  mov    %rbx,%rdi
  call   <fgets@plt>
  sub    $0x1,%r12d
  jne    L422
  add    $0x1,%r14d
  add    $0x20,%r13
  cmp    %r14d,(%rsp)
  jg     L313
  jmp    L15
L142:
  lea    0x64(%rsp),%r14
  lea    0x7b(%rsp),%r13
  mov    %r14,%rdi
  call   <atof@plt>
  mov    0x8(%rsp),%rax
  mov    %r13,%rdi
  movsd  %xmm0,(%rax)
  call   <atof@plt>
  mov    0x10(%rsp),%rax
  movsd  %xmm0,(%rax)
  movslq (%rsp),%rax
  cmp    $0x1,%eax
  jle    L17
  mov    %r15,0x48(%rsp)
  mov    $0x1,%r12d
  mov    %rax,%r15
  nopl   0x0(%rax)
L106:
  mov    %rbp,%rdx
  mov    $0x50,%esi
  mov    %rbx,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  je     L65
  mov    %r14,%rdi
  call   <atof@plt>
  mov    0x8(%rsp),%rax
  mov    %r13,%rdi
  movsd  %xmm0,(%rax,%r12,8)
  call   <atof@plt>
  mov    0x10(%rsp),%rax
  movsd  %xmm0,(%rax,%r12,8)
L65:
  add    $0x1,%r12
  cmp    %r12,%r15
  jne    L106
  lea    D31(%rip),%rsi
  mov    %rbx,%rdi
  mov    0x48(%rsp),%r15
  call   <strstr@plt>
  test   %rax,%rax
  je     L15
  jmp    L108
L334:
  mov    %rbp,%rdi
  call   <fclose@plt>
L421:
  mov    0xa8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L436
  add    $0xb8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L164:
  movslq 0x18(%rsp),%r12
  mov    0x20(%rsp),%rax
  lea    0x62(%rsp),%rdi
  mov    %r12,%r14
  shl    $0x3,%r12
  lea    (%rax,%r12,1),%r13
  call   <atof@plt>
  lea    0x1(%r14),%eax
  movsd  %xmm0,0x0(%r13)
  cmp    %eax,(%rsp)
  jle    L256
  mov    0x20(%rsp),%rax
  lea    0x6e(%rsp),%rdi
  lea    0x8(%rax,%r12,1),%r13
  call   <atof@plt>
  lea    0x2(%r14),%eax
  movsd  %xmm0,0x0(%r13)
  cmp    %eax,(%rsp)
  jle    L256
  mov    0x20(%rsp),%rax
  lea    0x7a(%rsp),%rdi
  lea    0x10(%rax,%r12,1),%r13
  call   <atof@plt>
  lea    0x3(%r14),%eax
  movsd  %xmm0,0x0(%r13)
  cmp    %eax,(%rsp)
  jle    L256
  mov    0x20(%rsp),%rax
  lea    0x86(%rsp),%rdi
  lea    0x18(%rax,%r12,1),%r13
  call   <atof@plt>
  lea    0x4(%r14),%eax
  movsd  %xmm0,0x0(%r13)
  cmp    %eax,(%rsp)
  jle    L256
  mov    0x20(%rsp),%rax
  lea    0x92(%rsp),%rdi
  add    $0x5,%r14d
  lea    0x20(%rax,%r12,1),%r12
  call   <atof@plt>
  subl   $0x1,0x4(%rsp)
  mov    %r14d,0x18(%rsp)
  movsd  %xmm0,(%r12)
  jmp    L177
L425:
  mov    (%rsp),%ecx
  cmp    %ecx,0x18(%rsp)
  jge    L69
  movslq 0x18(%rsp),%r12
  mov    0x20(%rsp),%rax
  lea    0x6e(%rsp),%rdi
  mov    %r12,%r14
  shl    $0x3,%r12
  lea    (%rax,%r12,1),%r13
  call   <atof@plt>
  lea    0x1(%r14),%eax
  movsd  %xmm0,0x0(%r13)
  cmp    %eax,(%rsp)
  jle    L256
  mov    0x20(%rsp),%rax
  lea    0x7a(%rsp),%rdi
  lea    0x8(%rax,%r12,1),%r13
  call   <atof@plt>
  lea    0x2(%r14),%eax
  movsd  %xmm0,0x0(%r13)
  cmp    %eax,(%rsp)
  jle    L256
  mov    0x20(%rsp),%rax
  lea    0x86(%rsp),%rdi
  lea    0x10(%rax,%r12,1),%r13
  call   <atof@plt>
  lea    0x3(%r14),%eax
  movsd  %xmm0,0x0(%r13)
  cmp    %eax,(%rsp)
  jle    L256
  mov    0x20(%rsp),%rax
  lea    0x92(%rsp),%rdi
  add    $0x4,%r14d
  lea    0x18(%rax,%r12,1),%r12
  call   <atof@plt>
  subl   $0x1,0x4(%rsp)
  mov    %r14d,0x18(%rsp)
  movsd  %xmm0,(%r12)
  jmp    L177
L228:
  lea    D75(%rip),%rdi
  call   <printf@plt>
  jmp    L421
L256:
  mov    %eax,0x18(%rsp)
  jmp    L69
L436:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D34
type_guessed: string
name: extract_symbolic_data
arguments: label: D60
type_guessed: string
name: extract_symbolic_data
arguments: label: D9
type_guessed: string
name: extract_symbolic_data
arguments: label: D23
type_guessed: string
name: extract_symbolic_data
arguments: label: D31
type_guessed: string
name: extract_symbolic_data
arguments: label: D74
type_guessed: string
name: extract_symbolic_data
arguments: label: D75
type_guessed: string

tool: D34: r

tool: D60: output

tool: D9: FREQUENCY:

tool: D23: MODE # 1   QRANGE=

tool: D31: QFF>  MODE=

tool: D74: QFF>  MODE (I,J)

tool: D75: Can not open 'output' GAMESS output file, data should be provided in the input file 


assistant: ```c
int parse_gamess_out(const int nmodes, const int npairs, double harmonic[nmodes], double xrange[nmodes], double deltax[nmodes], double fdiag[nmodes][4], double foffdiag[npairs][6]) {
  char line[82], *pos;
  FILE *fp;
  int ex;
  int freq_line_count, freq_line_max;
  int harmonic_count = 0, i, j;
  freq_line_count = freq_line_max = (nmodes + 6) / 5 + 1;
  if ((fp = fopen("output", "r")) != NULL) {
    while (fgets(line, 80, fp) != NULL) {
      if ((pos = strstr(line, "FREQUENCY:")) != NULL) {
        if (freq_line_count == freq_line_max) {
          freq_line_count--;
        } else if (freq_line_count == (freq_line_max - 1)) {
          for (i = 1; i < 5; i++)
            if (harmonic_count < nmodes) {
              harmonic[harmonic_count] = atof(&line[18 + 12 * i]);
              harmonic_count++;
            }
          freq_line_count--;
        } else if (freq_line_count > 0) {
          for (i = 0; i < 5; i++)
            if (harmonic_count < nmodes) {
              harmonic[harmonic_count] = atof(&line[18 + 12 * i]);
              harmonic_count++;
            }
          freq_line_count--;
        }
      }
      if (strstr(line, "MODE # 1   QRANGE=") != NULL) {
        xrange[0] = atof(&line[20]);
        deltax[0] = atof(&line[43]);
        for (i = 1; i < nmodes; i++) {
          if (fgets(line, 80, fp) != NULL) {
            xrange[i] = atof(&line[20]);
            deltax[i] = atof(&line[43]);
          }
        }
      }
      if (strstr(line, "QFF>  MODE=") != NULL) {
        for (i = 0; i < nmodes; i++) {
          if (fgets(line, 80, fp) != NULL) {
            fdiag[i][0] = atof(&line[15]);
            ex = atoi(&line[28]);
            fdiag[i][0] *= pow(10, ex);
          }
          if (fgets(line, 80, fp) != NULL) {
            fdiag[i][1] = atof(&line[15]);
            ex = atoi(&line[28]);
            fdiag[i][1] *= pow(10, ex);
          }
          if (fgets(line, 80, fp) != NULL) {
            fdiag[i][2] = atof(&line[15]);
            ex = atoi(&line[28]);
            fdiag[i][2] *= pow(10, ex);
          }
          for (j = 0; j < 15; j++)
            if (fgets(line, 80, fp) != NULL)
              ;
        }
      }
      if (strstr(line, "QFF>  MODE (I,J)") != NULL) {
        for (i = 0; i < npairs; i++) {
          if (fgets(line, 80, fp) != NULL) {
            foffdiag[i][0] = atof(&line[15]);
            ex = atoi(&line[28]);
            foffdiag[i][0] *= pow(10, ex);
          }
          if (fgets(line, 80, fp) != NULL) {
            foffdiag[i][1] = atof(&line[15]);
            ex = atoi(&line[28]);
            foffdiag[i][1] *= pow(10, ex);
          }
          if (fgets(line, 80, fp) != NULL) {
            foffdiag[i][2] = atof(&line[15]);
            ex = atoi(&line[28]);
            foffdiag[i][2] *= pow(10, ex);
          }
          if (fgets(line, 80, fp) != NULL) {
            foffdiag[i][3] = atof(&line[15]);
            ex = atoi(&line[28]);
            foffdiag[i][3] *= pow(10, ex);
          }
          if (fgets(line, 80, fp) != NULL) {
            foffdiag[i][4] = atof(&line[15]);
            ex = atoi(&line[28]);
            foffdiag[i][4] *= pow(10, ex);
          }
          if (fgets(line, 80, fp) != NULL)
            if (fgets(line, 80, fp) != NULL)
              ;
        }
      }
    }
    fclose(fp);
  } else {
    printf("Can not open \'output\' GAMESS output file, data should be provided in the input file \n");
  }
  return 0;
}
```