#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 + 1000000;
      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 + 1000000;
      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 + 1000000;
      bond_atom2 = bond_atom2 + 1000000;
      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 + 1000000;
      angle_atom2 = angle_atom2 + 1000000;
      angle_atom3 = angle_atom3 + 1000000;
      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 + 1000000;
      hybrid_atom2 = hybrid_atom2 + 1000000;
      hybrid_atom3 = hybrid_atom3 + 1000000;
      hybrid_atom4 = hybrid_atom4 + 1000000;
      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] + 1000000;
      torsion_atom2[i] = torsion_atom2[i] + 1000000;
      torsion_atom3[i] = torsion_atom3[i] + 1000000;
      torsion_atom4[i] = torsion_atom4[i] + 1000000;
      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    191f <main+0x79f>
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    139c <main+0x21c>
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    $0xf4240,%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    0xcd1(%rip),%rsi
lea    0xcec(%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    0xcc3(%rip),%rsi
mov    $0x6,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    143a <main+0x2ba>
mov    -0x271e8(%rbp),%rdi
lea    -0x271b6(%rbp),%rdx
lea    0xca2(%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    $0xf4240,%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    0xc60(%rip),%rsi
lea    0xc44(%rip),%rax
sub    $0x10,%rsp
mov    %rax,(%rsp)
mov    $0x0,%al
call   1070 <fprintf@plt>
add    $0x10,%rsp
lea    -0x271b6(%rbp),%rdi
lea    0xc48(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    14fa <main+0x37a>
mov    -0x271e8(%rbp),%rdi
lea    -0x271b6(%rbp),%rdx
lea    0xc25(%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    $0xf4240,%eax
mov    %eax,-0x34(%rbp)
mov    -0x38(%rbp),%eax
add    $0xf4240,%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    0xbc4(%rip),%rsi
lea    0xb84(%rip),%rax
sub    $0x10,%rsp
mov    %rax,(%rsp)
mov    $0x1,%al
call   1070 <fprintf@plt>
add    $0x10,%rsp
lea    -0x271b6(%rbp),%rdi
lea    0xbaf(%rip),%rsi
mov    $0x5,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    15d5 <main+0x455>
mov    -0x271e8(%rbp),%rdi
lea    -0x271b6(%rbp),%rdx
lea    0xb8d(%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    $0xf4240,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x40(%rbp),%eax
add    $0xf4240,%eax
mov    %eax,-0x40(%rbp)
mov    -0x44(%rbp),%eax
add    $0xf4240,%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    0xb14(%rip),%rsi
lea    0xaa9(%rip),%rax
sub    $0x10,%rsp
mov    %rax,(%rsp)
mov    $0x2,%al
call   1070 <fprintf@plt>
add    $0x10,%rsp
lea    -0x271b6(%rbp),%rdi
lea    0xb02(%rip),%rsi
mov    $0x6,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    16cd <main+0x54d>
mov    -0x271e8(%rbp),%rdi
lea    -0x271b6(%rbp),%rdx
lea    0xae1(%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    $0xf4240,%eax
mov    %eax,-0x48(%rbp)
mov    -0x4c(%rbp),%eax
add    $0xf4240,%eax
mov    %eax,-0x4c(%rbp)
mov    -0x50(%rbp),%eax
add    $0xf4240,%eax
mov    %eax,-0x50(%rbp)
mov    -0x54(%rbp),%eax
add    $0xf4240,%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    0xa53(%rip),%rsi
lea    0x9b6(%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    0xa3f(%rip),%rsi
mov    $0x7,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    190c <main+0x78c>
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    0x9d7(%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    $0xf4240,%ecx
movslq -0x20(%rbp),%rax
mov    %ecx,-0x9ca0(%rbp,%rax,4)
movslq -0x20(%rbp),%rax
mov    -0x138e0(%rbp,%rax,4),%ecx
add    $0xf4240,%ecx
movslq -0x20(%rbp),%rax
mov    %ecx,-0x138e0(%rbp,%rax,4)
movslq -0x20(%rbp),%rax
mov    -0x1d520(%rbp,%rax,4),%ecx
add    $0xf4240,%ecx
movslq -0x20(%rbp),%rax
mov    %ecx,-0x1d520(%rbp,%rax,4)
movslq -0x20(%rbp),%rax
mov    -0x27160(%rbp,%rax,4),%ecx
add    $0xf4240,%ecx
movslq -0x20(%rbp),%rax
mov    %ecx,-0x27160(%rbp,%rax,4)
cmpl   $0x1,-0x20(%rbp)
jle    1885 <main+0x705>
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    1885 <main+0x705>
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    1885 <main+0x705>
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    1885 <main+0x705>
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    1885 <main+0x705>
jmp    191f <main+0x79f>
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    0x852(%rip),%rsi
lea    0x77c(%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    1911 <main+0x791>
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    0x6d4(%rip),%rdi
lea    0x6bb(%rip),%rsi
call   10a0 <rename@plt>
lea    0x6c1(%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    $0x275a8,%rsp
mov    %rsp,0x90(%rsp)
lea    0xe60(%rip),%rdi
lea    0xecb(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,0x88(%rsp)
lea    0xe57(%rip),%rdi
lea    0xe5f(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,0x8(%rsp)
lea    0xa6(%rsp),%r13
mov    $0xf4240,%r15d
xor    %r14d,%r14d
xor    %r12d,%r12d
jmp    124a <main+0xca>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movss  0x44(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    0x84(%rsp),%r10d
movss  0x40(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
sub    $0x8,%rsp
mov    0x10(%rsp),%rdi
lea    0xf1e(%rip),%rsi
mov    %r13,%rdx
mov    $0x2,%al
lea    0xe43(%rip),%rbx
push   %rbx
push   %r10
push   %rbp
call   1070 <fprintf@plt>
add    $0x20,%rsp
add    $0x1,%r12
add    $0x4,%r14
cmp    $0x9c40,%r14
je     1714 <main+0x594>
lea    0xb0(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x3e8,%esi
mov    0x88(%rsp),%rdx
call   1060 <fgets@plt>
mov    %rbp,%rdi
lea    0xdb2(%rip),%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1080 <sscanf@plt>
mov    %r13,%rdi
lea    0xda1(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
jne    1379 <main+0x1f9>
lea    0xb0(%rsp),%rdi
lea    0xd85(%rip),%rsi
mov    %r13,%rdx
lea    0x80(%rsp),%rcx
lea    0x7c(%rsp),%r8
lea    0x78(%rsp),%r9
xor    %eax,%eax
lea    0x68(%rsp),%rbp
push   %rbp
lea    0x74(%rsp),%rbp
push   %rbp
lea    0x80(%rsp),%rbp
push   %rbp
lea    0x8c(%rsp),%rbp
push   %rbp
lea    0xbc(%rsp),%rbx
mov    $0xf4240,%r15d
push   %rbx
lea    0x64(%rsp),%rbp
push   %rbp
call   1080 <sscanf@plt>
add    $0x30,%rsp
mov    0x3c(%rsp),%ebp
cvttss2si 0x80(%rsp),%ecx
add    %r15d,%ebp
cvttss2si 0x7c(%rsp),%r8d
mov    %ebp,0x3c(%rsp)
cvttss2si 0x78(%rsp),%r9d
movss  0x74(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x70(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  0x6c(%rsp),%xmm2
cvtss2sd %xmm2,%xmm2
movss  0x68(%rsp),%xmm3
cvtss2sd %xmm3,%xmm3
sub    $0x8,%rsp
mov    0x10(%rsp),%rdi
lea    0xcf6(%rip),%rsi
mov    %r13,%rdx
mov    $0x4,%al
lea    0xd0c(%rip),%rbx
push   %rbx
lea    0xac(%rsp),%rbx
push   %rbx
mov    $0xf4240,%r15d
push   %rbp
call   1070 <fprintf@plt>
add    $0x20,%rsp
mov    %r13,%rdi
lea    0xcea(%rip),%rsi
mov    $0x6,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
jne    13f8 <main+0x278>
lea    0xb0(%rsp),%rdi
lea    0xcd4(%rip),%rsi
mov    %r13,%rdx
lea    0x38(%rsp),%rcx
lea    0x64(%rsp),%r8
lea    0x60(%rsp),%r9
xor    %eax,%eax
call   1080 <sscanf@plt>
mov    0x38(%rsp),%ecx
add    %r15d,%ecx
cvttss2si 0x64(%rsp),%r8d
mov    %ecx,0x38(%rsp)
cvttss2si 0x60(%rsp),%r9d
sub    $0x8,%rsp
mov    0x10(%rsp),%rdi
lea    0xc9e(%rip),%rsi
mov    %r13,%rdx
xor    %eax,%eax
lea    0xc7d(%rip),%rbp
push   %rbp
call   1070 <fprintf@plt>
add    $0x10,%rsp
mov    %r13,%rdi
lea    0xc8e(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
jne    1499 <main+0x319>
sub    $0x8,%rsp
lea    0xb8(%rsp),%rdi
lea    0xc6e(%rip),%rsi
mov    %r13,%rdx
lea    0x3c(%rsp),%rcx
lea    0x38(%rsp),%r8
lea    0x64(%rsp),%r9
xor    %eax,%eax
lea    0x60(%rsp),%rbp
push   %rbp
call   1080 <sscanf@plt>
add    $0x10,%rsp
mov    0x34(%rsp),%ecx
add    %r15d,%ecx
mov    %ecx,0x34(%rsp)
mov    0x30(%rsp),%r8d
cvttss2si 0x5c(%rsp),%r9d
add    %r15d,%r8d
mov    %r8d,0x30(%rsp)
movss  0x58(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
sub    $0x8,%rsp
mov    0x10(%rsp),%rdi
lea    0xc21(%rip),%rsi
mov    %r13,%rdx
mov    $0x1,%al
lea    0xbdc(%rip),%rbp
push   %rbp
call   1070 <fprintf@plt>
add    $0x10,%rsp
mov    %r13,%rdi
lea    0xc14(%rip),%rsi
mov    $0x5,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
jne    154c <main+0x3cc>
lea    0xb0(%rsp),%rdi
lea    0xbf9(%rip),%rsi
mov    %r13,%rdx
lea    0x2c(%rsp),%rcx
lea    0x28(%rsp),%r8
lea    0x24(%rsp),%r9
xor    %eax,%eax
lea    0x50(%rsp),%rbp
push   %rbp
lea    0x5c(%rsp),%rbp
push   %rbp
call   1080 <sscanf@plt>
add    $0x10,%rsp
mov    0x2c(%rsp),%ecx
add    %r15d,%ecx
mov    %ecx,0x2c(%rsp)
mov    0x28(%rsp),%r8d
add    %r15d,%r8d
mov    %r8d,0x28(%rsp)
mov    0x24(%rsp),%r9d
add    %r15d,%r9d
mov    %r9d,0x24(%rsp)
movss  0x54(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x50(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
sub    $0x8,%rsp
mov    0x10(%rsp),%rdi
lea    0xb99(%rip),%rsi
mov    %r13,%rdx
mov    $0x2,%al
lea    0xb29(%rip),%rbp
push   %rbp
call   1070 <fprintf@plt>
add    $0x10,%rsp
mov    %r13,%rdi
lea    0xb8f(%rip),%rsi
mov    $0x6,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
jne    1611 <main+0x491>
sub    $0x8,%rsp
lea    0xb8(%rsp),%rdi
lea    0xb71(%rip),%rsi
mov    %r13,%rdx
lea    0x28(%rsp),%rcx
lea    0x24(%rsp),%r8
lea    0x20(%rsp),%r9
xor    %eax,%eax
lea    0x50(%rsp),%rbp
push   %rbp
lea    0x5c(%rsp),%rbp
push   %rbp
lea    0x2c(%rsp),%rbp
push   %rbp
call   1080 <sscanf@plt>
add    $0x20,%rsp
mov    0x20(%rsp),%ecx
add    %r15d,%ecx
mov    %ecx,0x20(%rsp)
mov    0x1c(%rsp),%r8d
add    %r15d,%r8d
mov    %r8d,0x1c(%rsp)
mov    0x18(%rsp),%r9d
add    %r15d,%r9d
mov    %r9d,0x18(%rsp)
mov    0x14(%rsp),%ebp
add    %r15d,%ebp
mov    %ebp,0x14(%rsp)
movss  0x4c(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x48(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
mov    0x8(%rsp),%rdi
lea    0xb07(%rip),%rsi
mov    %r13,%rdx
mov    $0x2,%al
lea    0xa65(%rip),%rbx
push   %rbx
push   %rbp
call   1070 <fprintf@plt>
add    $0x10,%rsp
mov    %r13,%rdi
lea    0xaff(%rip),%rsi
mov    $0x7,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
jne    1235 <main+0xb5>
lea    (%rsp,%r14,1),%rcx
add    $0x1d960,%rcx
lea    0x13d20(%rsp,%r14,1),%r8
lea    0xa0e0(%rsp,%r14,1),%r9
lea    0x4a0(%rsp,%r14,1),%rbp
lea    0xb0(%rsp),%rdi
lea    0xac3(%rip),%rsi
mov    %r13,%rdx
xor    %eax,%eax
lea    0x40(%rsp),%rbx
push   %rbx
lea    0x8c(%rsp),%rbx
push   %rbx
lea    0x54(%rsp),%rbx
push   %rbx
push   %rbp
call   1080 <sscanf@plt>
add    $0x20,%rsp
mov    0x1d960(%rsp,%r14,1),%ecx
add    %r15d,%ecx
mov    %ecx,0x1d960(%rsp,%r14,1)
mov    0x13d20(%rsp,%r14,1),%r8d
add    %r15d,%r8d
mov    %r8d,0x13d20(%rsp,%r14,1)
mov    0xa0e0(%rsp,%r14,1),%r9d
add    %r15d,%r9d
mov    %r9d,0xa0e0(%rsp,%r14,1)
mov    0x4a0(%rsp,%r14,1),%ebp
add    %r15d,%ebp
mov    %ebp,0x4a0(%rsp,%r14,1)
cmp    $0x2,%r12
jb     11f0 <main+0x70>
lea    -0x1(%r12),%eax
cmp    0x1d960(%rsp,%rax,4),%ecx
jne    11f0 <main+0x70>
cmp    0x13d20(%rsp,%rax,4),%r8d
jne    11f0 <main+0x70>
cmp    0xa0e0(%rsp,%rax,4),%r9d
jne    11f0 <main+0x70>
cmp    0x4a0(%rsp,%rax,4),%ebp
jne    11f0 <main+0x70>
mov    0x88(%rsp),%rdi
call   1050 <fclose@plt>
mov    0x8(%rsp),%rdi
call   1050 <fclose@plt>
lea    0x8e0(%rip),%rbx
lea    0x8c7(%rip),%rsi
mov    %rbx,%rdi
call   10a0 <rename@plt>
mov    %rbx,%rdi
call   1030 <remove@plt>
mov    0x90(%rsp),%rsp
xor    %eax,%eax
add    $0x275a8,%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, 1000000
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, 1000000
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, 1000000
store i32 %113, i32* %7
%114 = load i32, i32* %8
%115 = add nsw i32 %114, 1000000
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, 1000000
store i32 %133, i32* %9
%134 = load i32, i32* %10
%135 = add nsw i32 %134, 1000000
store i32 %135, i32* %10
%136 = load i32, i32* %11
%137 = add nsw i32 %136, 1000000
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, 1000000
store i32 %156, i32* %12
%157 = load i32, i32* %13
%158 = add nsw i32 %157, 1000000
store i32 %158, i32* %13
%159 = load i32, i32* %14
%160 = add nsw i32 %159, 1000000
store i32 %160, i32* %14
%161 = load i32, i32* %15
%162 = add nsw i32 %161, 1000000
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, 1000000
%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, 1000000
%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, 1000000
%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, 1000000
%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, %204
%77 = phi i64 [ 0, %0 ], [ %205, %204 ]
%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 %101
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 = add nsw i32 %84, 1000000
store i32 %85, i32* %1
%86 = load float, float* %17
%87 = fptosi float %86 to i32
%88 = load float, float* %18
%89 = fptosi float %88 to i32
%90 = load float, float* %19
%91 = fptosi float %90 to i32
%92 = load float, float* %20
%93 = fpext float %92 to double
%94 = load float, float* %21
%95 = fpext float %94 to double
%96 = load float, float* %22
%97 = fpext float %96 to double
%98 = load float, float* %23
%99 = fpext float %98 to double
%100 = 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 %87, i32 %89, i32 %91, i32 %85, i8* %70, double %93, double %95, double %97, double %99, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %101
101: ; preds = %82, %76
%102 = call i32 @strncmp(i8* %69, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i32 6)
%103 = icmp eq i32 %102, 0
br i1 %103, label %104, label %113
104: ; preds = %101
%105 = 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)
%106 = load i32, i32* %2
%107 = add nsw i32 %106, 1000000
store i32 %107, i32* %2
%108 = load float, float* %24
%109 = fptosi float %108 to i32
%110 = load float, float* %25
%111 = fptosi float %110 to i32
%112 = 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 %107, i32 %109, i32 %111, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %113
113: ; preds = %104, %101
%114 = call i32 @strncmp(i8* %69, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), i32 4)
%115 = icmp eq i32 %114, 0
br i1 %115, label %116, label %127
116: ; preds = %113
%117 = 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)
%118 = load i32, i32* %3
%119 = add nsw i32 %118, 1000000
store i32 %119, i32* %3
%120 = load i32, i32* %4
%121 = add nsw i32 %120, 1000000
store i32 %121, i32* %4
%122 = load float, float* %26
%123 = fptosi float %122 to i32
%124 = load float, float* %27
%125 = fpext float %124 to double
%126 = 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 %119, i32 %121, i32 %123, double %125, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %127
127: ; preds = %116, %113
%128 = call i32 @strncmp(i8* %69, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0), i32 5)
%129 = icmp eq i32 %128, 0
br i1 %129, label %130, label %143
130: ; preds = %127
%131 = 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)
%132 = load i32, i32* %5
%133 = add nsw i32 %132, 1000000
store i32 %133, i32* %5
%134 = load i32, i32* %6
%135 = add nsw i32 %134, 1000000
store i32 %135, i32* %6
%136 = load i32, i32* %7
%137 = add nsw i32 %136, 1000000
store i32 %137, i32* %7
%138 = load float, float* %28
%139 = fpext float %138 to double
%140 = load float, float* %29
%141 = fpext float %140 to double
%142 = 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 %133, i32 %135, i32 %137, double %139, double %141, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %143
143: ; preds = %130, %127
%144 = call i32 @strncmp(i8* %69, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0), i32 6)
%145 = icmp eq i32 %144, 0
br i1 %145, label %146, label %161
146: ; preds = %143
%147 = 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)
%148 = load i32, i32* %8
%149 = add nsw i32 %148, 1000000
store i32 %149, i32* %8
%150 = load i32, i32* %9
%151 = add nsw i32 %150, 1000000
store i32 %151, i32* %9
%152 = load i32, i32* %10
%153 = add nsw i32 %152, 1000000
store i32 %153, i32* %10
%154 = load i32, i32* %11
%155 = add nsw i32 %154, 1000000
store i32 %155, i32* %11
%156 = load float, float* %30
%157 = fpext float %156 to double
%158 = load float, float* %31
%159 = fpext float %158 to double
%160 = 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 %149, i32 %151, i32 %153, i32 %155, double %157, double %159, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %161
161: ; preds = %146, %143
%162 = call i32 @strncmp(i8* %69, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.21, i64 0, i64 0), i32 7)
%163 = icmp eq i32 %162, 0
br i1 %163, label %164, label %204
164: ; preds = %161
%165 = getelementptr inbounds [10000 x i32], [10000 x i32]* %12, i64 0, i64 %77
%166 = getelementptr inbounds [10000 x i32], [10000 x i32]* %13, i64 0, i64 %77
%167 = getelementptr inbounds [10000 x i32], [10000 x i32]* %14, i64 0, i64 %77
%168 = getelementptr inbounds [10000 x i32], [10000 x i32]* %15, i64 0, i64 %77
%169 = 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* %165, i32* %166, i32* %167, i32* %168, float* %32, i32* %16, float* %33)
%170 = load i32, i32* %165
%171 = add nsw i32 %170, 1000000
store i32 %171, i32* %165
%172 = load i32, i32* %166
%173 = add nsw i32 %172, 1000000
store i32 %173, i32* %166
%174 = load i32, i32* %167
%175 = add nsw i32 %174, 1000000
store i32 %175, i32* %167
%176 = load i32, i32* %168
%177 = add nsw i32 %176, 1000000
store i32 %177, i32* %168
%178 = icmp ugt i64 %77, 1
br i1 %178, label %179, label %197
179: ; preds = %164
%180 = add nuw i64 %77, 4294967295
%181 = and i64 %180, 4294967295
%182 = getelementptr inbounds [10000 x i32], [10000 x i32]* %12, i64 0, i64 %181
%183 = load i32, i32* %182
%184 = icmp eq i32 %171, %183
br i1 %184, label %185, label %197
185: ; preds = %179
%186 = getelementptr inbounds [10000 x i32], [10000 x i32]* %13, i64 0, i64 %181
%187 = load i32, i32* %186
%188 = icmp eq i32 %173, %187
br i1 %188, label %189, label %197
189: ; preds = %185
%190 = getelementptr inbounds [10000 x i32], [10000 x i32]* %14, i64 0, i64 %181
%191 = load i32, i32* %190
%192 = icmp eq i32 %175, %191
br i1 %192, label %193, label %197
193: ; preds = %189
%194 = getelementptr inbounds [10000 x i32], [10000 x i32]* %15, i64 0, i64 %181
%195 = load i32, i32* %194
%196 = icmp eq i32 %177, %195
br i1 %196, label %207, label %197
197: ; preds = %193, %189, %185, %179, %164
%198 = load float, float* %32
%199 = fpext float %198 to double
%200 = load i32, i32* %16
%201 = load float, float* %33
%202 = fpext float %201 to double
%203 = 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 %171, i32 %173, i32 %175, i32 %177, double %199, i32 %200, double %202, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %204
204: ; preds = %161, %197
%205 = add nuw nsw i64 %77, 1
%206 = icmp eq i64 %205, 10000
br i1 %206, label %207, label %76
207: ; preds = %193, %204
%208 = call i32 @fclose(i32* %74)
%209 = call i32 @fclose(i32* %75)
%210 = 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))
%211 = call i32 @remove(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}