#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, int, int, int,
                           ...);
int /*<<< orphan*/ remove(char *);
int /*<<< orphan*/ rename(char *, char *);
int /*<<< orphan*/ sscanf(char *, char *, char *, ...);
int /*<<< orphan*/ strncmp(char *, char *, int);
main() {
  int i = 0, j = 0, k = 0, atom_number, mompar_number, bond_atom1, bond_atom2,
      angle_atom1, angle_atom2, angle_atom3, hybrid_atom1, hybrid_atom2,
      hybrid_atom3, hybrid_atom4, torsion_atom1[10000], torsion_atom2[10000],
      torsion_atom3[10000], torsion_atom4[10000], torsion_n2,
      line_length = 1000;
  float atom_coordx, atom_coordy, atom_coordz, atom_n1, atom_n2, atom_n3,
      atom_n4, mompar_n1, mompar_n2, bond_n1, bond_n2, angle_n1, angle_n2,
      hybrid_n1, hybrid_n2, torsion_n1, torsion_n3;
  char word[10], atom_name[10], buffer[line_length];
  FILE *ammp, *ammp_curr, *fopen();
  ammp = fopen("input_ligand.ammp", "r");
  ammp_curr = fopen("ammp_curr.ammp", "w");
  for (i = 0; i < 10000; i++) {
    fgets(buffer, line_length, ammp);
    sscanf(buffer, "%s", word);
    if (!strncmp(word, "atom", 4)) {
      sscanf(buffer, "%s %f %f %f %i %s %f %f %f %f", word, &atom_coordx,
             &atom_coordy, &atom_coordz, &atom_number, atom_name, &atom_n1,
             &atom_n2, &atom_n3, &atom_n4);
      atom_number = atom_number + 0;
      fprintf(ammp_curr, "%s %f %f %f %i %s %f %f %f %f %s\n", word,
              atom_coordx, atom_coordy, atom_coordz, atom_number, atom_name,
              atom_n1, atom_n2, atom_n3, atom_n4, ";");
    }
    if (!strncmp(word, "mompar", 6)) {
      sscanf(buffer, "%s %i %f %f", word, &mompar_number, &mompar_n1,
             &mompar_n2);
      mompar_number = mompar_number + 0;
      fprintf(ammp_curr, "%s %i %f %f %s\n", word, mompar_number, mompar_n1,
              mompar_n2, ";");
    }
    if (!strncmp(word, "bond", 4)) {
      sscanf(buffer, "%s %i %i %f %f", word, &bond_atom1, &bond_atom2, &bond_n1,
             &bond_n2);
      bond_atom1 = bond_atom1 + 0;
      bond_atom2 = bond_atom2 + 0;
      fprintf(ammp_curr, "%s %i %i %f %f %s\n", word, bond_atom1, bond_atom2,
              bond_n1, bond_n2, ";");
    }
    if (!strncmp(word, "angle", 5)) {
      sscanf(buffer, "%s %i %i %i %f %f", word, &angle_atom1, &angle_atom2,
             &angle_atom3, &angle_n1, &angle_n2);
      angle_atom1 = angle_atom1 + 0;
      angle_atom2 = angle_atom2 + 0;
      angle_atom3 = angle_atom3 + 0;
      fprintf(ammp_curr, "%s %i %i %i %f %f %s\n", word, angle_atom1,
              angle_atom2, angle_atom3, angle_n1, angle_n2, ";");
    }
    if (!strncmp(word, "hybrid", 6)) {
      sscanf(buffer, "%s %i %i %i %i %f %f", word, &hybrid_atom1, &hybrid_atom2,
             &hybrid_atom3, &hybrid_atom4, &hybrid_n1, &hybrid_n2);
      hybrid_atom1 = hybrid_atom1 + 0;
      hybrid_atom2 = hybrid_atom2 + 0;
      hybrid_atom3 = hybrid_atom3 + 0;
      hybrid_atom4 = hybrid_atom4 + 0;
      fprintf(ammp_curr, "%s %i %i %i %i %f %f %s\n", word, hybrid_atom1,
              hybrid_atom2, hybrid_atom3, hybrid_atom4, hybrid_n1, hybrid_n2,
              ";");
    }
    if (!strncmp(word, "torsion", 7)) {
      sscanf(buffer, "%s %i %i %i %i %f %i %f", word, &torsion_atom1[i],
             &torsion_atom2[i], &torsion_atom3[i], &torsion_atom4[i],
             &torsion_n1, &torsion_n2, &torsion_n3);
      torsion_atom1[i] = torsion_atom1[i] + 0;
      torsion_atom2[i] = torsion_atom2[i] + 0;
      torsion_atom3[i] = torsion_atom3[i] + 0;
      torsion_atom4[i] = torsion_atom4[i] + 0;
      if (i > 1 && torsion_atom1[i] == torsion_atom1[i - 1] &&
          torsion_atom2[i] == torsion_atom2[i - 1] &&
          torsion_atom3[i] == torsion_atom3[i - 1] &&
          torsion_atom4[i] == torsion_atom4[i - 1])
        break;
      fprintf(ammp_curr, "%s %i %i %i %i %f %i %f %s\n", word, torsion_atom1[i],
              torsion_atom2[i], torsion_atom3[i], torsion_atom4[i], torsion_n1,
              torsion_n2, torsion_n3, ";");
    }
  }
  fclose(ammp);
  fclose(ammp_curr);
  rename("ammp_curr.ammp", "input_ligand.ammp");
  remove("ammp_curr.ammp");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %rbx
sub    $0x271d8,%rsp
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x3e8,-0x27168(%rbp)
mov    -0x27168(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x271c8(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x271e8(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x271d0(%rbp)
lea    0xe11(%rip),%rdi
lea    0xe7c(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x271d8(%rbp)
lea    0xe09(%rip),%rdi
lea    0xe11(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x271e0(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0x2710,-0x20(%rbp)
jge    18fd <main+0x77d>
mov    -0x271e8(%rbp),%rdi
mov    -0x27168(%rbp),%esi
mov    -0x271d8(%rbp),%rdx
call   1060 <fgets@plt>
mov    -0x271e8(%rbp),%rdi
lea    -0x271b6(%rbp),%rdx
lea    0xdc5(%rip),%rsi
mov    $0x0,%al
call   1080 <sscanf@plt>
lea    -0x271b6(%rbp),%rdi
lea    0xdb3(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    139a <main+0x21a>
mov    -0x271e8(%rbp),%rdi
lea    -0x271b6(%rbp),%rdx
lea    -0x271c0(%rbp),%r14
lea    0xd89(%rip),%rsi
lea    -0x2716c(%rbp),%rcx
lea    -0x27170(%rbp),%r8
lea    -0x27174(%rbp),%r9
lea    -0x2c(%rbp),%r15
lea    -0x27178(%rbp),%rbx
lea    -0x2717c(%rbp),%r11
lea    -0x27180(%rbp),%r10
lea    -0x27184(%rbp),%rax
sub    $0x30,%rsp
mov    %r15,(%rsp)
mov    %r14,0x8(%rsp)
mov    %rbx,0x10(%rsp)
mov    %r11,0x18(%rsp)
mov    %r10,0x20(%rsp)
mov    %rax,0x28(%rsp)
mov    $0x0,%al
call   1080 <sscanf@plt>
add    $0x30,%rsp
mov    -0x2c(%rbp),%eax
add    $0x0,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x271e0(%rbp),%rdi
lea    -0x271b6(%rbp),%rdx
cvttss2si -0x2716c(%rbp),%ecx
ff
cvttss2si -0x27170(%rbp),%r8d
fd ff
cvttss2si -0x27174(%rbp),%r9d
fd ff
mov    -0x2c(%rbp),%r11d
lea    -0x271c0(%rbp),%r10
movss  -0x27178(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
movss  -0x2717c(%rbp),%xmm1
ff
cvtss2sd %xmm1,%xmm1
movss  -0x27180(%rbp),%xmm2
ff
cvtss2sd %xmm2,%xmm2
movss  -0x27184(%rbp),%xmm3
ff
cvtss2sd %xmm3,%xmm3
lea    0xcd3(%rip),%rsi
lea    0xcee(%rip),%rax
sub    $0x20,%rsp
mov    %r11d,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
mov    $0x4,%al
call   1070 <fprintf@plt>
add    $0x20,%rsp
lea    -0x271b6(%rbp),%rdi
lea    0xcc5(%rip),%rsi
mov    $0x6,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    1436 <main+0x2b6>
mov    -0x271e8(%rbp),%rdi
lea    -0x271b6(%rbp),%rdx
lea    0xca4(%rip),%rsi
lea    -0x30(%rbp),%rcx
lea    -0x27188(%rbp),%r8
lea    -0x2718c(%rbp),%r9
mov    $0x0,%al
call   1080 <sscanf@plt>
mov    -0x30(%rbp),%eax
add    $0x0,%eax
mov    %eax,-0x30(%rbp)
mov    -0x271e0(%rbp),%rdi
lea    -0x271b6(%rbp),%rdx
mov    -0x30(%rbp),%ecx
cvttss2si -0x27188(%rbp),%r8d
fd ff
cvttss2si -0x2718c(%rbp),%r9d
fd ff
lea    0xc64(%rip),%rsi
lea    0xc48(%rip),%rax
sub    $0x10,%rsp
mov    %rax,(%rsp)
mov    $0x0,%al
call   1070 <fprintf@plt>
add    $0x10,%rsp
lea    -0x271b6(%rbp),%rdi
lea    0xc4c(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    14f2 <main+0x372>
mov    -0x271e8(%rbp),%rdi
lea    -0x271b6(%rbp),%rdx
lea    0xc29(%rip),%rsi
lea    -0x34(%rbp),%rcx
lea    -0x38(%rbp),%r8
lea    -0x27190(%rbp),%r9
lea    -0x27194(%rbp),%rax
sub    $0x10,%rsp
mov    %rax,(%rsp)
mov    $0x0,%al
call   1080 <sscanf@plt>
add    $0x10,%rsp
mov    -0x34(%rbp),%eax
add    $0x0,%eax
mov    %eax,-0x34(%rbp)
mov    -0x38(%rbp),%eax
add    $0x0,%eax
mov    %eax,-0x38(%rbp)
mov    -0x271e0(%rbp),%rdi
lea    -0x271b6(%rbp),%rdx
mov    -0x34(%rbp),%ecx
mov    -0x38(%rbp),%r8d
cvttss2si -0x27190(%rbp),%r9d
fd ff
movss  -0x27194(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
lea    0xbcc(%rip),%rsi
lea    0xb8c(%rip),%rax
sub    $0x10,%rsp
mov    %rax,(%rsp)
mov    $0x1,%al
call   1070 <fprintf@plt>
add    $0x10,%rsp
lea    -0x271b6(%rbp),%rdi
lea    0xbb7(%rip),%rsi
mov    $0x5,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    15c7 <main+0x447>
mov    -0x271e8(%rbp),%rdi
lea    -0x271b6(%rbp),%rdx
lea    0xb95(%rip),%rsi
lea    -0x3c(%rbp),%rcx
lea    -0x40(%rbp),%r8
lea    -0x44(%rbp),%r9
lea    -0x27198(%rbp),%r10
lea    -0x2719c(%rbp),%rax
sub    $0x10,%rsp
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x0,%al
call   1080 <sscanf@plt>
add    $0x10,%rsp
mov    -0x3c(%rbp),%eax
add    $0x0,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x40(%rbp),%eax
add    $0x0,%eax
mov    %eax,-0x40(%rbp)
mov    -0x44(%rbp),%eax
add    $0x0,%eax
mov    %eax,-0x44(%rbp)
mov    -0x271e0(%rbp),%rdi
lea    -0x271b6(%rbp),%rdx
mov    -0x3c(%rbp),%ecx
mov    -0x40(%rbp),%r8d
mov    -0x44(%rbp),%r9d
movss  -0x27198(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
movss  -0x2719c(%rbp),%xmm1
ff
cvtss2sd %xmm1,%xmm1
lea    0xb22(%rip),%rsi
lea    0xab7(%rip),%rax
sub    $0x10,%rsp
mov    %rax,(%rsp)
mov    $0x2,%al
call   1070 <fprintf@plt>
add    $0x10,%rsp
lea    -0x271b6(%rbp),%rdi
lea    0xb10(%rip),%rsi
mov    $0x6,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    16b7 <main+0x537>
mov    -0x271e8(%rbp),%rdi
lea    -0x271b6(%rbp),%rdx
lea    0xaef(%rip),%rsi
lea    -0x48(%rbp),%rcx
lea    -0x4c(%rbp),%r8
lea    -0x50(%rbp),%r9
lea    -0x54(%rbp),%r11
lea    -0x271a0(%rbp),%r10
lea    -0x271a4(%rbp),%rax
sub    $0x20,%rsp
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
mov    $0x0,%al
call   1080 <sscanf@plt>
add    $0x20,%rsp
mov    -0x48(%rbp),%eax
add    $0x0,%eax
mov    %eax,-0x48(%rbp)
mov    -0x4c(%rbp),%eax
add    $0x0,%eax
mov    %eax,-0x4c(%rbp)
mov    -0x50(%rbp),%eax
add    $0x0,%eax
mov    %eax,-0x50(%rbp)
mov    -0x54(%rbp),%eax
add    $0x0,%eax
mov    %eax,-0x54(%rbp)
mov    -0x271e0(%rbp),%rdi
lea    -0x271b6(%rbp),%rdx
mov    -0x48(%rbp),%ecx
mov    -0x4c(%rbp),%r8d
mov    -0x50(%rbp),%r9d
mov    -0x54(%rbp),%r10d
movss  -0x271a0(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
movss  -0x271a4(%rbp),%xmm1
ff
cvtss2sd %xmm1,%xmm1
lea    0xa69(%rip),%rsi
lea    0x9cc(%rip),%rax
sub    $0x10,%rsp
mov    %r10d,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x2,%al
call   1070 <fprintf@plt>
add    $0x10,%rsp
lea    -0x271b6(%rbp),%rdi
lea    0xa55(%rip),%rsi
mov    $0x7,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    18ea <main+0x76a>
mov    -0x271e8(%rbp),%rdi
lea    -0x271b6(%rbp),%rdx
movslq -0x20(%rbp),%rax
lea    -0x9ca0(%rbp),%rcx
shl    $0x2,%rax
add    %rax,%rcx
movslq -0x20(%rbp),%rax
lea    -0x138e0(%rbp),%r8
shl    $0x2,%rax
add    %rax,%r8
movslq -0x20(%rbp),%rax
lea    -0x1d520(%rbp),%r9
shl    $0x2,%rax
add    %rax,%r9
movslq -0x20(%rbp),%rax
lea    -0x27160(%rbp),%rbx
shl    $0x2,%rax
add    %rax,%rbx
lea    0x9ed(%rip),%rsi
lea    -0x271a8(%rbp),%r11
lea    -0x27164(%rbp),%r10
lea    -0x271ac(%rbp),%rax
sub    $0x20,%rsp
mov    %rbx,(%rsp)
mov    %r11,0x8(%rsp)
mov    %r10,0x10(%rsp)
mov    %rax,0x18(%rsp)
mov    $0x0,%al
call   1080 <sscanf@plt>
add    $0x20,%rsp
movslq -0x20(%rbp),%rax
mov    -0x9ca0(%rbp,%rax,4),%ecx
add    $0x0,%ecx
movslq -0x20(%rbp),%rax
mov    %ecx,-0x9ca0(%rbp,%rax,4)
movslq -0x20(%rbp),%rax
mov    -0x138e0(%rbp,%rax,4),%ecx
add    $0x0,%ecx
movslq -0x20(%rbp),%rax
mov    %ecx,-0x138e0(%rbp,%rax,4)
movslq -0x20(%rbp),%rax
mov    -0x1d520(%rbp,%rax,4),%ecx
add    $0x0,%ecx
movslq -0x20(%rbp),%rax
mov    %ecx,-0x1d520(%rbp,%rax,4)
movslq -0x20(%rbp),%rax
mov    -0x27160(%rbp,%rax,4),%ecx
add    $0x0,%ecx
movslq -0x20(%rbp),%rax
mov    %ecx,-0x27160(%rbp,%rax,4)
cmpl   $0x1,-0x20(%rbp)
jle    1863 <main+0x6e3>
movslq -0x20(%rbp),%rax
mov    -0x9ca0(%rbp,%rax,4),%eax
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
cmp    -0x9ca0(%rbp,%rcx,4),%eax
jne    1863 <main+0x6e3>
movslq -0x20(%rbp),%rax
mov    -0x138e0(%rbp,%rax,4),%eax
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
cmp    -0x138e0(%rbp,%rcx,4),%eax
jne    1863 <main+0x6e3>
movslq -0x20(%rbp),%rax
mov    -0x1d520(%rbp,%rax,4),%eax
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
cmp    -0x1d520(%rbp,%rcx,4),%eax
jne    1863 <main+0x6e3>
movslq -0x20(%rbp),%rax
mov    -0x27160(%rbp,%rax,4),%eax
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
cmp    -0x27160(%rbp,%rcx,4),%eax
jne    1863 <main+0x6e3>
jmp    18fd <main+0x77d>
mov    -0x271e0(%rbp),%rdi
lea    -0x271b6(%rbp),%rdx
movslq -0x20(%rbp),%rax
mov    -0x9ca0(%rbp,%rax,4),%ecx
movslq -0x20(%rbp),%rax
mov    -0x138e0(%rbp,%rax,4),%r8d
ff
movslq -0x20(%rbp),%rax
mov    -0x1d520(%rbp,%rax,4),%r9d
ff
movslq -0x20(%rbp),%rax
mov    -0x27160(%rbp,%rax,4),%r11d
ff
movss  -0x271a8(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
mov    -0x27164(%rbp),%r10d
movss  -0x271ac(%rbp),%xmm1
ff
cvtss2sd %xmm1,%xmm1
lea    0x874(%rip),%rsi
lea    0x79e(%rip),%rax
sub    $0x20,%rsp
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %rax,0x10(%rsp)
mov    $0x2,%al
call   1070 <fprintf@plt>
add    $0x20,%rsp
jmp    18ef <main+0x76f>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1223 <main+0xa3>
mov    -0x271d8(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x271e0(%rbp),%rdi
call   1050 <fclose@plt>
lea    0x6f6(%rip),%rdi
lea    0x6dd(%rip),%rsi
call   10a0 <rename@plt>
lea    0x6e3(%rip),%rdi
call   1030 <remove@plt>
mov    -0x271c8(%rbp),%rax
mov    %rax,%rsp
mov    -0x1c(%rbp),%eax
lea    -0x18(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x27598,%rsp
mov    %rsp,0x80(%rsp)
lea    0xe60(%rip),%rdi
lea    0xecb(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,0x78(%rsp)
lea    0xe5a(%rip),%rdi
lea    0xe62(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,%r13
lea    0xa0(%rsp),%r15
lea    0x96(%rsp),%rbx
xor    %r12d,%r12d
xor    %r14d,%r14d
jmp    1236 <main+0xb6>
nop
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    0x48(%rsp),%r11d
movss  0x4(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
sub    $0x8,%rsp
mov    %r13,%rdi
lea    0xf33(%rip),%rsi
mov    %rbx,%rdx
mov    $0x2,%al
lea    0xe58(%rip),%rbp
push   %rbp
push   %r11
push   %r10
call   1070 <fprintf@plt>
add    $0x20,%rsp
add    $0x1,%r14
add    $0x4,%r12
cmp    $0x9c40,%r12
je     1636 <main+0x4b6>
mov    %r15,%rdi
mov    $0x3e8,%esi
mov    0x78(%rsp),%rdx
call   1060 <fgets@plt>
mov    %r15,%rdi
lea    0xdd1(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1080 <sscanf@plt>
mov    %rbx,%rdi
lea    0xdc0(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
jne    133b <main+0x1bb>
mov    %r15,%rdi
lea    0xda9(%rip),%rsi
mov    %rbx,%rdx
lea    0x44(%rsp),%rcx
lea    0x40(%rsp),%r8
lea    0x3c(%rsp),%r9
xor    %eax,%eax
lea    0x2c(%rsp),%rbp
push   %rbp
lea    0x38(%rsp),%rbp
push   %rbp
lea    0x44(%rsp),%rbp
push   %rbp
lea    0x50(%rsp),%rbp
push   %rbp
lea    0xac(%rsp),%r15
push   %r15
lea    0x9c(%rsp),%rbp
push   %rbp
call   1080 <sscanf@plt>
add    $0x30,%rsp
cvttss2si 0x44(%rsp),%ecx
cvttss2si 0x40(%rsp),%r8d
mov    0x74(%rsp),%r10d
cvttss2si 0x3c(%rsp),%r9d
movss  0x38(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x34(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  0x30(%rsp),%xmm2
cvtss2sd %xmm2,%xmm2
movss  0x2c(%rsp),%xmm3
cvtss2sd %xmm3,%xmm3
sub    $0x8,%rsp
mov    %r13,%rdi
lea    0xd30(%rip),%rsi
mov    %rbx,%rdx
mov    $0x4,%al
lea    0xd46(%rip),%rbp
push   %rbp
push   %r15
lea    0xb8(%rsp),%r15
push   %r10
call   1070 <fprintf@plt>
add    $0x20,%rsp
mov    %rbx,%rdi
lea    0xd28(%rip),%rsi
mov    $0x6,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
jne    13ac <main+0x22c>
mov    %r15,%rdi
lea    0xd17(%rip),%rsi
mov    %rbx,%rdx
lea    0x70(%rsp),%rcx
lea    0x28(%rsp),%r8
lea    0x24(%rsp),%r9
xor    %eax,%eax
call   1080 <sscanf@plt>
cvttss2si 0x28(%rsp),%r8d
mov    0x70(%rsp),%ecx
cvttss2si 0x24(%rsp),%r9d
sub    $0x8,%rsp
mov    %r13,%rdi
lea    0xcea(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
lea    0xcc9(%rip),%rbp
push   %rbp
call   1070 <fprintf@plt>
add    $0x10,%rsp
mov    %rbx,%rdi
lea    0xcda(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
jne    1433 <main+0x2b3>
sub    $0x8,%rsp
mov    %r15,%rdi
lea    0xcc3(%rip),%rsi
mov    %rbx,%rdx
lea    0x74(%rsp),%rcx
lea    0x70(%rsp),%r8
lea    0x28(%rsp),%r9
xor    %eax,%eax
lea    0x24(%rsp),%rbp
push   %rbp
call   1080 <sscanf@plt>
add    $0x10,%rsp
cvttss2si 0x20(%rsp),%r9d
mov    0x6c(%rsp),%ecx
mov    0x68(%rsp),%r8d
movss  0x1c(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
sub    $0x8,%rsp
mov    %r13,%rdi
lea    0xc87(%rip),%rsi
mov    %rbx,%rdx
mov    $0x1,%al
lea    0xc42(%rip),%rbp
push   %rbp
call   1070 <fprintf@plt>
add    $0x10,%rsp
mov    %rbx,%rdi
lea    0xc7a(%rip),%rsi
mov    $0x5,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
jne    14c4 <main+0x344>
mov    %r15,%rdi
lea    0xc68(%rip),%rsi
mov    %rbx,%rdx
lea    0x64(%rsp),%rcx
lea    0x60(%rsp),%r8
lea    0x5c(%rsp),%r9
xor    %eax,%eax
lea    0x14(%rsp),%rbp
push   %rbp
lea    0x20(%rsp),%rbp
push   %rbp
call   1080 <sscanf@plt>
add    $0x10,%rsp
mov    0x64(%rsp),%ecx
mov    0x60(%rsp),%r8d
mov    0x5c(%rsp),%r9d
movss  0x18(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x14(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
sub    $0x8,%rsp
mov    %r13,%rdi
lea    0xc21(%rip),%rsi
mov    %rbx,%rdx
mov    $0x2,%al
lea    0xbb1(%rip),%rbp
push   %rbp
call   1070 <fprintf@plt>
add    $0x10,%rsp
mov    %rbx,%rdi
lea    0xc17(%rip),%rsi
mov    $0x6,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
jne    1566 <main+0x3e6>
sub    $0x8,%rsp
mov    %r15,%rdi
lea    0xbfe(%rip),%rsi
mov    %rbx,%rdx
lea    0x60(%rsp),%rcx
lea    0x5c(%rsp),%r8
lea    0x58(%rsp),%r9
xor    %eax,%eax
lea    0x14(%rsp),%rbp
push   %rbp
lea    0x20(%rsp),%rbp
push   %rbp
lea    0x64(%rsp),%rbp
push   %rbp
call   1080 <sscanf@plt>
add    $0x20,%rsp
mov    0x58(%rsp),%ecx
mov    0x54(%rsp),%r8d
mov    0x50(%rsp),%r9d
mov    0x4c(%rsp),%r10d
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0xc(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
mov    %r13,%rdi
lea    0xbb3(%rip),%rsi
mov    %rbx,%rdx
mov    $0x2,%al
lea    0xb11(%rip),%rbp
push   %rbp
push   %r10
call   1070 <fprintf@plt>
add    $0x10,%rsp
mov    %rbx,%rdi
lea    0xbaa(%rip),%rsi
mov    $0x7,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
jne    1221 <main+0xa1>
lea    (%rsp,%r12,1),%rcx
add    $0x1d950,%rcx
lea    0x13d10(%rsp,%r12,1),%r8
lea    0xa0d0(%rsp,%r12,1),%r9
lea    0x490(%rsp,%r12,1),%r10
mov    %r15,%rdi
lea    0xb73(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
lea    0x4(%rsp),%rbp
push   %rbp
lea    0x50(%rsp),%rbp
push   %rbp
lea    0x18(%rsp),%rbp
push   %rbp
push   %r10
call   1080 <sscanf@plt>
add    $0x20,%rsp
mov    0x13d10(%rsp,%r12,1),%r8d
mov    0xa0d0(%rsp,%r12,1),%r9d
mov    0x490(%rsp,%r12,1),%r10d
mov    0x1d950(%rsp,%r12,1),%ecx
cmp    $0x2,%r14
jb     11e0 <main+0x60>
lea    -0x1(%r14),%eax
cmp    0x1d950(%rsp,%rax,4),%ecx
jne    11e0 <main+0x60>
cmp    0x13d10(%rsp,%rax,4),%r8d
jne    11e0 <main+0x60>
cmp    0xa0d0(%rsp,%rax,4),%r9d
jne    11e0 <main+0x60>
cmp    0x490(%rsp,%rax,4),%r10d
jne    11e0 <main+0x60>
mov    0x78(%rsp),%rdi
call   1050 <fclose@plt>
mov    %r13,%rdi
call   1050 <fclose@plt>
lea    0x9c3(%rip),%rbx
lea    0x9aa(%rip),%rsi
mov    %rbx,%rdi
call   10a0 <rename@plt>
mov    %rbx,%rdi
call   1030 <remove@plt>
mov    0x80(%rsp),%rsp
xor    %eax,%eax
add    $0x27598,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"input_ligand.ammp\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [15 x i8] c"ammp_curr.ammp\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [3 x i8] c"%s\00"
@.str.5 = [5 x i8] c"atom\00"
@.str.6 = [30 x i8] c"%s %f %f %f %i %s %f %f %f %f\00"
@.str.7 = [34 x i8] c"%s %f %f %f %i %s %f %f %f %f %s\0A\00"
@.str.8 = [2 x i8] c";\00"
@.str.9 = [7 x i8] c"mompar\00"
@.str.10 = [12 x i8] c"%s %i %f %f\00"
@.str.11 = [16 x i8] c"%s %i %f %f %s\0A\00"
@.str.12 = [5 x i8] c"bond\00"
@.str.13 = [15 x i8] c"%s %i %i %f %f\00"
@.str.14 = [19 x i8] c"%s %i %i %f %f %s\0A\00"
@.str.15 = [6 x i8] c"angle\00"
@.str.16 = [18 x i8] c"%s %i %i %i %f %f\00"
@.str.17 = [22 x i8] c"%s %i %i %i %f %f %s\0A\00"
@.str.18 = [7 x i8] c"hybrid\00"
@.str.19 = [21 x i8] c"%s %i %i %i %i %f %f\00"
@.str.20 = [25 x i8] c"%s %i %i %i %i %f %f %s\0A\00"
@.str.21 = [8 x i8] c"torsion\00"
@.str.22 = [24 x i8] c"%s %i %i %i %i %f %i %f\00"
@.str.23 = [28 x i8] c"%s %i %i %i %i %f %i %f %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca [10000 x i32]
%17 = alloca [10000 x i32]
%18 = alloca [10000 x i32]
%19 = alloca [10000 x i32]
%20 = alloca i32
%21 = alloca i32
%22 = alloca float
%23 = alloca float
%24 = alloca float
%25 = alloca float
%26 = alloca float
%27 = alloca float
%28 = alloca float
%29 = alloca float
%30 = alloca float
%31 = alloca float
%32 = alloca float
%33 = alloca float
%34 = alloca float
%35 = alloca float
%36 = alloca float
%37 = alloca float
%38 = alloca float
%39 = alloca [10 x i8]
%40 = alloca [10 x i8]
%41 = alloca i8*
%42 = alloca i64
%43 = alloca i32*
%44 = alloca i32*
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 1000, i32* %21
%45 = load i32, i32* %21
%46 = zext i32 %45 to i64
%47 = call i8* @llvm.stacksave()
store i8* %47, i8** %41
%48 = alloca i8, i64 %46
store i64 %46, i64* %42
%49 = call i32* @fopen(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %49, i32** %43
%50 = call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %50, i32** %44
store i32 0, i32* %2
br label %51
51: ; preds = %298, %0
%52 = load i32, i32* %2
%53 = icmp slt i32 %52, 10000
br i1 %53, label %54, label %301
54: ; preds = %51
%55 = load i32, i32* %21
%56 = load i32*, i32** %43
%57 = call i32 @fgets(i8* %48, i32 %55, i32* %56)
%58 = getelementptr inbounds [10 x i8], [10 x i8]* %39, i64 0, i64 0
%59 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %48, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %58)
%60 = getelementptr inbounds [10 x i8], [10 x i8]* %39, i64 0, i64 0
%61 = call i32 @strncmp(i8* %60, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 4)
%62 = icmp ne i32 %61, 0
br i1 %62, label %88, label %63
63: ; preds = %54
%64 = getelementptr inbounds [10 x i8], [10 x i8]* %39, i64 0, i64 0
%65 = getelementptr inbounds [10 x i8], [10 x i8]* %40, i64 0, i64 0
%66 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %48, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* %64, float* %22, float* %23, float* %24, i32* %5, i8* %65, float* %25, float* %26, float* %27, float* %28)
%67 = load i32, i32* %5
%68 = add nsw i32 %67, 0
store i32 %68, i32* %5
%69 = load i32*, i32** %44
%70 = getelementptr inbounds [10 x i8], [10 x i8]* %39, i64 0, i64 0
%71 = load float, float* %22
%72 = fptosi float %71 to i32
%73 = load float, float* %23
%74 = fptosi float %73 to i32
%75 = load float, float* %24
%76 = fptosi float %75 to i32
%77 = load i32, i32* %5
%78 = getelementptr inbounds [10 x i8], [10 x i8]* %40, i64 0, i64 0
%79 = load float, float* %25
%80 = fpext float %79 to double
%81 = load float, float* %26
%82 = fpext float %81 to double
%83 = load float, float* %27
%84 = fpext float %83 to double
%85 = load float, float* %28
%86 = fpext float %85 to double
%87 = call i32 (i32*, i8*, i8*, i32, i32, i32, ...) @fprintf(i32* %69, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0), i8* %70, i32 %72, i32 %74, i32 %76, i32 %77, i8* %78, double %80, double %82, double %84, double %86, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %88
88: ; preds = %63, %54
%89 = getelementptr inbounds [10 x i8], [10 x i8]* %39, i64 0, i64 0
%90 = call i32 @strncmp(i8* %89, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i32 6)
%91 = icmp ne i32 %90, 0
br i1 %91, label %105, label %92
92: ; preds = %88
%93 = getelementptr inbounds [10 x i8], [10 x i8]* %39, i64 0, i64 0
%94 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %48, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0), i8* %93, i32* %6, float* %29, float* %30)
%95 = load i32, i32* %6
%96 = add nsw i32 %95, 0
store i32 %96, i32* %6
%97 = load i32*, i32** %44
%98 = getelementptr inbounds [10 x i8], [10 x i8]* %39, i64 0, i64 0
%99 = load i32, i32* %6
%100 = load float, float* %29
%101 = fptosi float %100 to i32
%102 = load float, float* %30
%103 = fptosi float %102 to i32
%104 = call i32 (i32*, i8*, i8*, i32, i32, i32, ...) @fprintf(i32* %97, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.11, i64 0, i64 0), i8* %98, i32 %99, i32 %101, i32 %103, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %105
105: ; preds = %92, %88
%106 = getelementptr inbounds [10 x i8], [10 x i8]* %39, i64 0, i64 0
%107 = call i32 @strncmp(i8* %106, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), i32 4)
%108 = icmp ne i32 %107, 0
br i1 %108, label %125, label %109
109: ; preds = %105
%110 = getelementptr inbounds [10 x i8], [10 x i8]* %39, i64 0, i64 0
%111 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %48, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.13, i64 0, i64 0), i8* %110, i32* %7, i32* %8, float* %31, float* %32)
%112 = load i32, i32* %7
%113 = add nsw i32 %112, 0
store i32 %113, i32* %7
%114 = load i32, i32* %8
%115 = add nsw i32 %114, 0
store i32 %115, i32* %8
%116 = load i32*, i32** %44
%117 = getelementptr inbounds [10 x i8], [10 x i8]* %39, i64 0, i64 0
%118 = load i32, i32* %7
%119 = load i32, i32* %8
%120 = load float, float* %31
%121 = fptosi float %120 to i32
%122 = load float, float* %32
%123 = fpext float %122 to double
%124 = call i32 (i32*, i8*, i8*, i32, i32, i32, ...) @fprintf(i32* %116, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.14, i64 0, i64 0), i8* %117, i32 %118, i32 %119, i32 %121, double %123, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %125
125: ; preds = %109, %105
%126 = getelementptr inbounds [10 x i8], [10 x i8]* %39, i64 0, i64 0
%127 = call i32 @strncmp(i8* %126, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0), i32 5)
%128 = icmp ne i32 %127, 0
br i1 %128, label %148, label %129
129: ; preds = %125
%130 = getelementptr inbounds [10 x i8], [10 x i8]* %39, i64 0, i64 0
%131 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %48, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.16, i64 0, i64 0), i8* %130, i32* %9, i32* %10, i32* %11, float* %33, float* %34)
%132 = load i32, i32* %9
%133 = add nsw i32 %132, 0
store i32 %133, i32* %9
%134 = load i32, i32* %10
%135 = add nsw i32 %134, 0
store i32 %135, i32* %10
%136 = load i32, i32* %11
%137 = add nsw i32 %136, 0
store i32 %137, i32* %11
%138 = load i32*, i32** %44
%139 = getelementptr inbounds [10 x i8], [10 x i8]* %39, i64 0, i64 0
%140 = load i32, i32* %9
%141 = load i32, i32* %10
%142 = load i32, i32* %11
%143 = load float, float* %33
%144 = fpext float %143 to double
%145 = load float, float* %34
%146 = fpext float %145 to double
%147 = call i32 (i32*, i8*, i8*, i32, i32, i32, ...) @fprintf(i32* %138, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.17, i64 0, i64 0), i8* %139, i32 %140, i32 %141, i32 %142, double %144, double %146, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %148
148: ; preds = %129, %125
%149 = getelementptr inbounds [10 x i8], [10 x i8]* %39, i64 0, i64 0
%150 = call i32 @strncmp(i8* %149, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0), i32 6)
%151 = icmp ne i32 %150, 0
br i1 %151, label %174, label %152
152: ; preds = %148
%153 = getelementptr inbounds [10 x i8], [10 x i8]* %39, i64 0, i64 0
%154 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %48, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.19, i64 0, i64 0), i8* %153, i32* %12, i32* %13, i32* %14, i32* %15, float* %35, float* %36)
%155 = load i32, i32* %12
%156 = add nsw i32 %155, 0
store i32 %156, i32* %12
%157 = load i32, i32* %13
%158 = add nsw i32 %157, 0
store i32 %158, i32* %13
%159 = load i32, i32* %14
%160 = add nsw i32 %159, 0
store i32 %160, i32* %14
%161 = load i32, i32* %15
%162 = add nsw i32 %161, 0
store i32 %162, i32* %15
%163 = load i32*, i32** %44
%164 = getelementptr inbounds [10 x i8], [10 x i8]* %39, i64 0, i64 0
%165 = load i32, i32* %12
%166 = load i32, i32* %13
%167 = load i32, i32* %14
%168 = load i32, i32* %15
%169 = load float, float* %35
%170 = fpext float %169 to double
%171 = load float, float* %36
%172 = fpext float %171 to double
%173 = call i32 (i32*, i8*, i8*, i32, i32, i32, ...) @fprintf(i32* %163, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.20, i64 0, i64 0), i8* %164, i32 %165, i32 %166, i32 %167, i32 %168, double %170, double %172, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %174
174: ; preds = %152, %148
%175 = getelementptr inbounds [10 x i8], [10 x i8]* %39, i64 0, i64 0
%176 = call i32 @strncmp(i8* %175, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.21, i64 0, i64 0), i32 7)
%177 = icmp ne i32 %176, 0
br i1 %177, label %297, label %178
178: ; preds = %174
%179 = getelementptr inbounds [10 x i8], [10 x i8]* %39, i64 0, i64 0
%180 = load i32, i32* %2
%181 = sext i32 %180 to i64
%182 = getelementptr inbounds [10000 x i32], [10000 x i32]* %16, i64 0, i64 %181
%183 = load i32, i32* %2
%184 = sext i32 %183 to i64
%185 = getelementptr inbounds [10000 x i32], [10000 x i32]* %17, i64 0, i64 %184
%186 = load i32, i32* %2
%187 = sext i32 %186 to i64
%188 = getelementptr inbounds [10000 x i32], [10000 x i32]* %18, i64 0, i64 %187
%189 = load i32, i32* %2
%190 = sext i32 %189 to i64
%191 = getelementptr inbounds [10000 x i32], [10000 x i32]* %19, i64 0, i64 %190
%192 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %48, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.22, i64 0, i64 0), i8* %179, i32* %182, i32* %185, i32* %188, i32* %191, float* %37, i32* %20, float* %38)
%193 = load i32, i32* %2
%194 = sext i32 %193 to i64
%195 = getelementptr inbounds [10000 x i32], [10000 x i32]* %16, i64 0, i64 %194
%196 = load i32, i32* %195
%197 = add nsw i32 %196, 0
%198 = load i32, i32* %2
%199 = sext i32 %198 to i64
%200 = getelementptr inbounds [10000 x i32], [10000 x i32]* %16, i64 0, i64 %199
store i32 %197, i32* %200
%201 = load i32, i32* %2
%202 = sext i32 %201 to i64
%203 = getelementptr inbounds [10000 x i32], [10000 x i32]* %17, i64 0, i64 %202
%204 = load i32, i32* %203
%205 = add nsw i32 %204, 0
%206 = load i32, i32* %2
%207 = sext i32 %206 to i64
%208 = getelementptr inbounds [10000 x i32], [10000 x i32]* %17, i64 0, i64 %207
store i32 %205, i32* %208
%209 = load i32, i32* %2
%210 = sext i32 %209 to i64
%211 = getelementptr inbounds [10000 x i32], [10000 x i32]* %18, i64 0, i64 %210
%212 = load i32, i32* %211
%213 = add nsw i32 %212, 0
%214 = load i32, i32* %2
%215 = sext i32 %214 to i64
%216 = getelementptr inbounds [10000 x i32], [10000 x i32]* %18, i64 0, i64 %215
store i32 %213, i32* %216
%217 = load i32, i32* %2
%218 = sext i32 %217 to i64
%219 = getelementptr inbounds [10000 x i32], [10000 x i32]* %19, i64 0, i64 %218
%220 = load i32, i32* %219
%221 = add nsw i32 %220, 0
%222 = load i32, i32* %2
%223 = sext i32 %222 to i64
%224 = getelementptr inbounds [10000 x i32], [10000 x i32]* %19, i64 0, i64 %223
store i32 %221, i32* %224
%225 = load i32, i32* %2
%226 = icmp sgt i32 %225, 1
br i1 %226, label %227, label %272
227: ; preds = %178
%228 = load i32, i32* %2
%229 = sext i32 %228 to i64
%230 = getelementptr inbounds [10000 x i32], [10000 x i32]* %16, i64 0, i64 %229
%231 = load i32, i32* %230
%232 = load i32, i32* %2
%233 = sub nsw i32 %232, 1
%234 = sext i32 %233 to i64
%235 = getelementptr inbounds [10000 x i32], [10000 x i32]* %16, i64 0, i64 %234
%236 = load i32, i32* %235
%237 = icmp eq i32 %231, %236
br i1 %237, label %238, label %272
238: ; preds = %227
%239 = load i32, i32* %2
%240 = sext i32 %239 to i64
%241 = getelementptr inbounds [10000 x i32], [10000 x i32]* %17, i64 0, i64 %240
%242 = load i32, i32* %241
%243 = load i32, i32* %2
%244 = sub nsw i32 %243, 1
%245 = sext i32 %244 to i64
%246 = getelementptr inbounds [10000 x i32], [10000 x i32]* %17, i64 0, i64 %245
%247 = load i32, i32* %246
%248 = icmp eq i32 %242, %247
br i1 %248, label %249, label %272
249: ; preds = %238
%250 = load i32, i32* %2
%251 = sext i32 %250 to i64
%252 = getelementptr inbounds [10000 x i32], [10000 x i32]* %18, i64 0, i64 %251
%253 = load i32, i32* %252
%254 = load i32, i32* %2
%255 = sub nsw i32 %254, 1
%256 = sext i32 %255 to i64
%257 = getelementptr inbounds [10000 x i32], [10000 x i32]* %18, i64 0, i64 %256
%258 = load i32, i32* %257
%259 = icmp eq i32 %253, %258
br i1 %259, label %260, label %272
260: ; preds = %249
%261 = load i32, i32* %2
%262 = sext i32 %261 to i64
%263 = getelementptr inbounds [10000 x i32], [10000 x i32]* %19, i64 0, i64 %262
%264 = load i32, i32* %263
%265 = load i32, i32* %2
%266 = sub nsw i32 %265, 1
%267 = sext i32 %266 to i64
%268 = getelementptr inbounds [10000 x i32], [10000 x i32]* %19, i64 0, i64 %267
%269 = load i32, i32* %268
%270 = icmp eq i32 %264, %269
br i1 %270, label %271, label %272
271: ; preds = %260
br label %301
272: ; preds = %260, %249, %238, %227, %178
%273 = load i32*, i32** %44
%274 = getelementptr inbounds [10 x i8], [10 x i8]* %39, i64 0, i64 0
%275 = load i32, i32* %2
%276 = sext i32 %275 to i64
%277 = getelementptr inbounds [10000 x i32], [10000 x i32]* %16, i64 0, i64 %276
%278 = load i32, i32* %277
%279 = load i32, i32* %2
%280 = sext i32 %279 to i64
%281 = getelementptr inbounds [10000 x i32], [10000 x i32]* %17, i64 0, i64 %280
%282 = load i32, i32* %281
%283 = load i32, i32* %2
%284 = sext i32 %283 to i64
%285 = getelementptr inbounds [10000 x i32], [10000 x i32]* %18, i64 0, i64 %284
%286 = load i32, i32* %285
%287 = load i32, i32* %2
%288 = sext i32 %287 to i64
%289 = getelementptr inbounds [10000 x i32], [10000 x i32]* %19, i64 0, i64 %288
%290 = load i32, i32* %289
%291 = load float, float* %37
%292 = fpext float %291 to double
%293 = load i32, i32* %20
%294 = load float, float* %38
%295 = fpext float %294 to double
%296 = call i32 (i32*, i8*, i8*, i32, i32, i32, ...) @fprintf(i32* %273, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.23, i64 0, i64 0), i8* %274, i32 %278, i32 %282, i32 %286, i32 %290, double %292, i32 %293, double %295, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %297
297: ; preds = %272, %174
br label %298
298: ; preds = %297
%299 = load i32, i32* %2
%300 = add nsw i32 %299, 1
store i32 %300, i32* %2
br label %51
301: ; preds = %271, %51
%302 = load i32*, i32** %43
%303 = call i32 @fclose(i32* %302)
%304 = load i32*, i32** %44
%305 = call i32 @fclose(i32* %304)
%306 = call i32 @rename(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%307 = call i32 @remove(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%308 = load i8*, i8** %41
%309 = load i32, i32* %1
ret i32 %309
}

LLVM IR (-O2):
@.str = [18 x i8] c"input_ligand.ammp\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [15 x i8] c"ammp_curr.ammp\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [3 x i8] c"%s\00"
@.str.5 = [5 x i8] c"atom\00"
@.str.6 = [30 x i8] c"%s %f %f %f %i %s %f %f %f %f\00"
@.str.7 = [34 x i8] c"%s %f %f %f %i %s %f %f %f %f %s\0A\00"
@.str.8 = [2 x i8] c";\00"
@.str.9 = [7 x i8] c"mompar\00"
@.str.10 = [12 x i8] c"%s %i %f %f\00"
@.str.11 = [16 x i8] c"%s %i %f %f %s\0A\00"
@.str.12 = [5 x i8] c"bond\00"
@.str.13 = [15 x i8] c"%s %i %i %f %f\00"
@.str.14 = [19 x i8] c"%s %i %i %f %f %s\0A\00"
@.str.15 = [6 x i8] c"angle\00"
@.str.16 = [18 x i8] c"%s %i %i %i %f %f\00"
@.str.17 = [22 x i8] c"%s %i %i %i %f %f %s\0A\00"
@.str.18 = [7 x i8] c"hybrid\00"
@.str.19 = [21 x i8] c"%s %i %i %i %i %f %f\00"
@.str.20 = [25 x i8] c"%s %i %i %i %i %f %f %s\0A\00"
@.str.21 = [8 x i8] c"torsion\00"
@.str.22 = [24 x i8] c"%s %i %i %i %i %f %i %f\00"
@.str.23 = [28 x i8] c"%s %i %i %i %i %f %i %f %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca [10000 x i32]
%13 = alloca [10000 x i32]
%14 = alloca [10000 x i32]
%15 = alloca [10000 x i32]
%16 = alloca i32
%17 = alloca float
%18 = alloca float
%19 = alloca float
%20 = alloca float
%21 = alloca float
%22 = alloca float
%23 = alloca float
%24 = alloca float
%25 = alloca float
%26 = alloca float
%27 = alloca float
%28 = alloca float
%29 = alloca float
%30 = alloca float
%31 = alloca float
%32 = alloca float
%33 = alloca float
%34 = alloca [10 x i8]
%35 = alloca [10 x i8]
%36 = bitcast i32* %1 to i8*
%37 = bitcast i32* %2 to i8*
%38 = bitcast i32* %3 to i8*
%39 = bitcast i32* %4 to i8*
%40 = bitcast i32* %5 to i8*
%41 = bitcast i32* %6 to i8*
%42 = bitcast i32* %7 to i8*
%43 = bitcast i32* %8 to i8*
%44 = bitcast i32* %9 to i8*
%45 = bitcast i32* %10 to i8*
%46 = bitcast i32* %11 to i8*
%47 = bitcast [10000 x i32]* %12 to i8*
%48 = bitcast [10000 x i32]* %13 to i8*
%49 = bitcast [10000 x i32]* %14 to i8*
%50 = bitcast [10000 x i32]* %15 to i8*
%51 = bitcast i32* %16 to i8*
%52 = bitcast float* %17 to i8*
%53 = bitcast float* %18 to i8*
%54 = bitcast float* %19 to i8*
%55 = bitcast float* %20 to i8*
%56 = bitcast float* %21 to i8*
%57 = bitcast float* %22 to i8*
%58 = bitcast float* %23 to i8*
%59 = bitcast float* %24 to i8*
%60 = bitcast float* %25 to i8*
%61 = bitcast float* %26 to i8*
%62 = bitcast float* %27 to i8*
%63 = bitcast float* %28 to i8*
%64 = bitcast float* %29 to i8*
%65 = bitcast float* %30 to i8*
%66 = bitcast float* %31 to i8*
%67 = bitcast float* %32 to i8*
%68 = bitcast float* %33 to i8*
%69 = getelementptr inbounds [10 x i8], [10 x i8]* %34, i64 0, i64 0
%70 = getelementptr inbounds [10 x i8], [10 x i8]* %35, i64 0, i64 0
%71 = tail call i8* @llvm.stacksave()
%72 = alloca [1000 x i8]
%73 = getelementptr inbounds [1000 x i8], [1000 x i8]* %72, i64 0, i64 0
%74 = tail call i32* @fopen(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%75 = tail call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %76
76: ; preds = %0, %189
%77 = phi i64 [ 0, %0 ], [ %190, %189 ]
%78 = call i32 @fgets(i8* %73, i32 1000, i32* %74)
%79 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %73, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %69)
%80 = call i32 @strncmp(i8* %69, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 4)
%81 = icmp eq i32 %80, 0
br i1 %81, label %82, label %100
82: ; preds = %76
%83 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %73, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* %69, float* %17, float* %18, float* %19, i32* %1, i8* %70, float* %20, float* %21, float* %22, float* %23)
%84 = load i32, i32* %1
%85 = load float, float* %17
%86 = fptosi float %85 to i32
%87 = load float, float* %18
%88 = fptosi float %87 to i32
%89 = load float, float* %19
%90 = fptosi float %89 to i32
%91 = load float, float* %20
%92 = fpext float %91 to double
%93 = load float, float* %21
%94 = fpext float %93 to double
%95 = load float, float* %22
%96 = fpext float %95 to double
%97 = load float, float* %23
%98 = fpext float %97 to double
%99 = call i32 (i32*, i8*, i8*, i32, i32, i32, ...) @fprintf(i32* %75, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0), i8* %69, i32 %86, i32 %88, i32 %90, i32 %84, i8* %70, double %92, double %94, double %96, double %98, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %100
100: ; preds = %82, %76
%101 = call i32 @strncmp(i8* %69, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i32 6)
%102 = icmp eq i32 %101, 0
br i1 %102, label %103, label %111
103: ; preds = %100
%104 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %73, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0), i8* %69, i32* %2, float* %24, float* %25)
%105 = load i32, i32* %2
%106 = load float, float* %24
%107 = fptosi float %106 to i32
%108 = load float, float* %25
%109 = fptosi float %108 to i32
%110 = call i32 (i32*, i8*, i8*, i32, i32, i32, ...) @fprintf(i32* %75, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.11, i64 0, i64 0), i8* %69, i32 %105, i32 %107, i32 %109, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %111
111: ; preds = %103, %100
%112 = call i32 @strncmp(i8* %69, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), i32 4)
%113 = icmp eq i32 %112, 0
br i1 %113, label %114, label %123
114: ; preds = %111
%115 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %73, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.13, i64 0, i64 0), i8* %69, i32* %3, i32* %4, float* %26, float* %27)
%116 = load i32, i32* %3
%117 = load i32, i32* %4
%118 = load float, float* %26
%119 = fptosi float %118 to i32
%120 = load float, float* %27
%121 = fpext float %120 to double
%122 = call i32 (i32*, i8*, i8*, i32, i32, i32, ...) @fprintf(i32* %75, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.14, i64 0, i64 0), i8* %69, i32 %116, i32 %117, i32 %119, double %121, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %123
123: ; preds = %114, %111
%124 = call i32 @strncmp(i8* %69, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0), i32 5)
%125 = icmp eq i32 %124, 0
br i1 %125, label %126, label %136
126: ; preds = %123
%127 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %73, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.16, i64 0, i64 0), i8* %69, i32* %5, i32* %6, i32* %7, float* %28, float* %29)
%128 = load i32, i32* %5
%129 = load i32, i32* %6
%130 = load i32, i32* %7
%131 = load float, float* %28
%132 = fpext float %131 to double
%133 = load float, float* %29
%134 = fpext float %133 to double
%135 = call i32 (i32*, i8*, i8*, i32, i32, i32, ...) @fprintf(i32* %75, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.17, i64 0, i64 0), i8* %69, i32 %128, i32 %129, i32 %130, double %132, double %134, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %136
136: ; preds = %126, %123
%137 = call i32 @strncmp(i8* %69, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0), i32 6)
%138 = icmp eq i32 %137, 0
br i1 %138, label %139, label %150
139: ; preds = %136
%140 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %73, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.19, i64 0, i64 0), i8* %69, i32* %8, i32* %9, i32* %10, i32* %11, float* %30, float* %31)
%141 = load i32, i32* %8
%142 = load i32, i32* %9
%143 = load i32, i32* %10
%144 = load i32, i32* %11
%145 = load float, float* %30
%146 = fpext float %145 to double
%147 = load float, float* %31
%148 = fpext float %147 to double
%149 = call i32 (i32*, i8*, i8*, i32, i32, i32, ...) @fprintf(i32* %75, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.20, i64 0, i64 0), i8* %69, i32 %141, i32 %142, i32 %143, i32 %144, double %146, double %148, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %150
150: ; preds = %139, %136
%151 = call i32 @strncmp(i8* %69, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.21, i64 0, i64 0), i32 7)
%152 = icmp eq i32 %151, 0
br i1 %152, label %153, label %189
153: ; preds = %150
%154 = getelementptr inbounds [10000 x i32], [10000 x i32]* %12, i64 0, i64 %77
%155 = getelementptr inbounds [10000 x i32], [10000 x i32]* %13, i64 0, i64 %77
%156 = getelementptr inbounds [10000 x i32], [10000 x i32]* %14, i64 0, i64 %77
%157 = getelementptr inbounds [10000 x i32], [10000 x i32]* %15, i64 0, i64 %77
%158 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %73, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.22, i64 0, i64 0), i8* %69, i32* %154, i32* %155, i32* %156, i32* %157, float* %32, i32* %16, float* %33)
%159 = load i32, i32* %155
%160 = load i32, i32* %156
%161 = load i32, i32* %157
%162 = icmp ugt i64 %77, 1
%163 = load i32, i32* %154
br i1 %162, label %164, label %182
164: ; preds = %153
%165 = add nuw i64 %77, 4294967295
%166 = and i64 %165, 4294967295
%167 = getelementptr inbounds [10000 x i32], [10000 x i32]* %12, i64 0, i64 %166
%168 = load i32, i32* %167
%169 = icmp eq i32 %163, %168
br i1 %169, label %170, label %182
170: ; preds = %164
%171 = getelementptr inbounds [10000 x i32], [10000 x i32]* %13, i64 0, i64 %166
%172 = load i32, i32* %171
%173 = icmp eq i32 %159, %172
br i1 %173, label %174, label %182
174: ; preds = %170
%175 = getelementptr inbounds [10000 x i32], [10000 x i32]* %14, i64 0, i64 %166
%176 = load i32, i32* %175
%177 = icmp eq i32 %160, %176
br i1 %177, label %178, label %182
178: ; preds = %174
%179 = getelementptr inbounds [10000 x i32], [10000 x i32]* %15, i64 0, i64 %166
%180 = load i32, i32* %179
%181 = icmp eq i32 %161, %180
br i1 %181, label %192, label %182
182: ; preds = %153, %178, %174, %170, %164
%183 = load float, float* %32
%184 = fpext float %183 to double
%185 = load i32, i32* %16
%186 = load float, float* %33
%187 = fpext float %186 to double
%188 = call i32 (i32*, i8*, i8*, i32, i32, i32, ...) @fprintf(i32* %75, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.23, i64 0, i64 0), i8* %69, i32 %163, i32 %159, i32 %160, i32 %161, double %184, i32 %185, double %187, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %189
189: ; preds = %150, %182
%190 = add nuw nsw i64 %77, 1
%191 = icmp eq i64 %190, 10000
br i1 %191, label %192, label %76
192: ; preds = %178, %189
%193 = call i32 @fclose(i32* %74)
%194 = call i32 @fclose(i32* %75)
%195 = call i32 @rename(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%196 = call i32 @remove(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}