#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 *, float, char *, float,
                           char *, float);
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ sscanf(char *, char *, ...);
scalar_t__ strncmp(char *, char *, int);
main() {
  int i = 0, j = 0, k = 0, line_length = 1000, atom_numb;
  float numb_1, numb_2, numb_3, bef_int, bef_ext, bef_total, aft_int, aft_ext,
      aft_total, delta_energy;
  char buffer[line_length], *word_1[1000], *word_2[1000], *word_3[1000],
      *word_4[1000], *word_5[1000], *word_6[1000];
  for (i = 0; i < 1000; i++) {
    word_1[i] = (char *)malloc(line_length);
    word_2[i] = (char *)malloc(line_length);
    word_3[i] = (char *)malloc(line_length);
    word_4[i] = (char *)malloc(line_length);
    word_5[i] = (char *)malloc(line_length);
    word_6[i] = (char *)malloc(line_length);
  }
  FILE *before, *after, *final, *fopen();
  before = fopen("before_opt.txt", "r");
  after = fopen("after_opt.txt", "r");
  final = fopen("energy.txt", "w");
  for (j = 0; j < 1000; j++) {
    fgets(buffer, line_length, before);
    sscanf(buffer, "%s %s %s %i %s %f %s %f %s %f", word_1[j], word_2[j],
           word_3[j], &atom_numb, word_4[j], &numb_1, word_5[j], &numb_2,
           word_6[j], &numb_3);
    if (strncmp(word_3[j], "internal", 8) == 0)
      break;
    else
      continue;
  }
  sscanf(buffer, "%s %s %s %f", word_1[j], word_2[j], word_3[j], &bef_int);
  fgets(buffer, line_length, before);
  sscanf(buffer, "%s %s %s %f", word_1[j], word_2[j], word_3[j], &bef_ext);
  fgets(buffer, line_length, before);
  sscanf(buffer, "%s %s %f", word_1[j], word_2[j], &bef_total);
  fgets(buffer, line_length, before);
  fgets(buffer, line_length, before);
  sscanf(buffer, "%f %s %s %s", &bef_total, word_1[j], word_2[j], word_3[j]);
  for (j = 0; j < 1000; j++) {
    fgets(buffer, line_length, after);
    sscanf(buffer, "%s %s %s %i %s %f %s %f %s %f", word_1[j], word_2[j],
           word_3[j], &atom_numb, word_4[j], &numb_1, word_5[j], &numb_2,
           word_6[j], &numb_3);
    if (strncmp(word_3[j], "internal", 8) == 0)
      break;
    else
      continue;
  }
  sscanf(buffer, "%s %s %s %f", word_1[j], word_2[j], word_3[j], &aft_int);
  fgets(buffer, line_length, after);
  sscanf(buffer, "%s %s %s %f", word_1[j], word_2[j], word_3[j], &aft_ext);
  fgets(buffer, line_length, after);
  sscanf(buffer, "%s %s %f", word_1[j], word_2[j], &aft_total);
  fgets(buffer, line_length, before);
  fgets(buffer, line_length, before);
  sscanf(buffer, "%f %s %s %s", &aft_total, word_1[j], word_2[j], word_3[j]);
  delta_energy = aft_total - bef_total;
  fprintf(final, " %f %s %f %s %f", bef_total, ":", aft_total, ":",
          delta_energy);
  for (i = 0; i < 1000; ++i) {
    free(word_1[i]);
    free(word_2[i]);
    free(word_3[i]);
    free(word_4[i]);
    free(word_5[i]);
    free(word_6[i]);
  }
  fclose(before);
  fclose(after);
  fclose(final);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %rbx
sub    $0xbbf8,%rsp
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x3e8,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x60(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0xbc10(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x68(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0x3e8,-0x20(%rbp)
jge    1288 <main+0x108>
mov    -0x2c(%rbp),%edi
call   1080 <malloc@plt>
mov    %rax,%rcx
movslq -0x20(%rbp),%rax
mov    %rcx,-0x1fb0(%rbp,%rax,8)
ff
mov    -0x2c(%rbp),%edi
call   1080 <malloc@plt>
mov    %rax,%rcx
movslq -0x20(%rbp),%rax
mov    %rcx,-0x3ef0(%rbp,%rax,8)
ff
mov    -0x2c(%rbp),%edi
call   1080 <malloc@plt>
mov    %rax,%rcx
movslq -0x20(%rbp),%rax
mov    %rcx,-0x5e30(%rbp,%rax,8)
ff
mov    -0x2c(%rbp),%edi
call   1080 <malloc@plt>
mov    %rax,%rcx
movslq -0x20(%rbp),%rax
mov    %rcx,-0x7d70(%rbp,%rax,8)
ff
mov    -0x2c(%rbp),%edi
call   1080 <malloc@plt>
mov    %rax,%rcx
movslq -0x20(%rbp),%rax
mov    %rcx,-0x9cb0(%rbp,%rax,8)
ff
mov    -0x2c(%rbp),%edi
call   1080 <malloc@plt>
mov    %rax,%rcx
movslq -0x20(%rbp),%rax
mov    %rcx,-0xbbf0(%rbp,%rax,8)
ff
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11e3 <main+0x63>
lea    0xd71(%rip),%rdi
lea    0xd79(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0xbbf8(%rbp)
lea    0xd68(%rip),%rdi
lea    0xd5f(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0xbc00(%rbp)
lea    0xd5c(%rip),%rdi
lea    0xd60(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0xbc08(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x3e8,-0x24(%rbp)
jge    13d1 <main+0x251>
mov    -0xbc10(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0xbbf8(%rbp),%rdx
call   1060 <fgets@plt>
mov    -0xbc10(%rbp),%rdi
movslq -0x24(%rbp),%rax
mov    -0x1fb0(%rbp,%rax,8),%rdx
ff
movslq -0x24(%rbp),%rax
mov    -0x3ef0(%rbp,%rax,8),%rcx
ff
movslq -0x24(%rbp),%rax
mov    -0x5e30(%rbp,%rax,8),%r8
ff
movslq -0x24(%rbp),%rax
mov    -0x7d70(%rbp,%rax,8),%r15
ff
movslq -0x24(%rbp),%rax
mov    -0x9cb0(%rbp,%rax,8),%rbx
ff
movslq -0x24(%rbp),%rax
mov    -0xbbf0(%rbp,%rax,8),%r10
ff
lea    0xcd6(%rip),%rsi
lea    -0x30(%rbp),%r9
lea    -0x34(%rbp),%r14
lea    -0x38(%rbp),%r11
lea    -0x3c(%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   1090 <sscanf@plt>
add    $0x30,%rsp
movslq -0x24(%rbp),%rax
mov    -0x5e30(%rbp,%rax,8),%rdi
ff
lea    0xca5(%rip),%rsi
mov    $0x8,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    13be <main+0x23e>
jmp    13d1 <main+0x251>
jmp    13c3 <main+0x243>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    12dd <main+0x15d>
mov    -0xbc10(%rbp),%rdi
movslq -0x24(%rbp),%rax
mov    -0x1fb0(%rbp,%rax,8),%rdx
ff
movslq -0x24(%rbp),%rax
mov    -0x3ef0(%rbp,%rax,8),%rcx
ff
movslq -0x24(%rbp),%rax
mov    -0x5e30(%rbp,%rax,8),%r8
ff
lea    0xc50(%rip),%rsi
lea    -0x40(%rbp),%r9
mov    $0x0,%al
call   1090 <sscanf@plt>
mov    -0xbc10(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0xbbf8(%rbp),%rdx
call   1060 <fgets@plt>
mov    -0xbc10(%rbp),%rdi
movslq -0x24(%rbp),%rax
mov    -0x1fb0(%rbp,%rax,8),%rdx
ff
movslq -0x24(%rbp),%rax
mov    -0x3ef0(%rbp,%rax,8),%rcx
ff
movslq -0x24(%rbp),%rax
mov    -0x5e30(%rbp,%rax,8),%r8
ff
lea    0xbfd(%rip),%rsi
lea    -0x44(%rbp),%r9
mov    $0x0,%al
call   1090 <sscanf@plt>
mov    -0xbc10(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0xbbf8(%rbp),%rdx
call   1060 <fgets@plt>
mov    -0xbc10(%rbp),%rdi
movslq -0x24(%rbp),%rax
mov    -0x1fb0(%rbp,%rax,8),%rdx
ff
movslq -0x24(%rbp),%rax
mov    -0x3ef0(%rbp,%rax,8),%rcx
ff
lea    0xbb9(%rip),%rsi
lea    -0x48(%rbp),%r8
mov    $0x0,%al
call   1090 <sscanf@plt>
mov    -0xbc10(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0xbbf8(%rbp),%rdx
call   1060 <fgets@plt>
mov    -0xbc10(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0xbbf8(%rbp),%rdx
call   1060 <fgets@plt>
mov    -0xbc10(%rbp),%rdi
movslq -0x24(%rbp),%rax
mov    -0x1fb0(%rbp,%rax,8),%rcx
ff
movslq -0x24(%rbp),%rax
mov    -0x3ef0(%rbp,%rax,8),%r8
ff
movslq -0x24(%rbp),%rax
mov    -0x5e30(%rbp,%rax,8),%r9
ff
lea    0xb59(%rip),%rsi
lea    -0x48(%rbp),%rdx
mov    $0x0,%al
call   1090 <sscanf@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0x3e8,-0x24(%rbp)
jge    160c <main+0x48c>
mov    -0xbc10(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0xbc00(%rbp),%rdx
call   1060 <fgets@plt>
mov    -0xbc10(%rbp),%rdi
movslq -0x24(%rbp),%rax
mov    -0x1fb0(%rbp,%rax,8),%rdx
ff
movslq -0x24(%rbp),%rax
mov    -0x3ef0(%rbp,%rax,8),%rcx
ff
movslq -0x24(%rbp),%rax
mov    -0x5e30(%rbp,%rax,8),%r8
ff
movslq -0x24(%rbp),%rax
mov    -0x7d70(%rbp,%rax,8),%r15
ff
movslq -0x24(%rbp),%rax
mov    -0x9cb0(%rbp,%rax,8),%rbx
ff
movslq -0x24(%rbp),%rax
mov    -0xbbf0(%rbp,%rax,8),%r10
ff
lea    0xa9b(%rip),%rsi
lea    -0x30(%rbp),%r9
lea    -0x34(%rbp),%r14
lea    -0x38(%rbp),%r11
lea    -0x3c(%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   1090 <sscanf@plt>
add    $0x30,%rsp
movslq -0x24(%rbp),%rax
mov    -0x5e30(%rbp,%rax,8),%rdi
ff
lea    0xa6a(%rip),%rsi
mov    $0x8,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    15f9 <main+0x479>
jmp    160c <main+0x48c>
jmp    15fe <main+0x47e>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1518 <main+0x398>
mov    -0xbc10(%rbp),%rdi
movslq -0x24(%rbp),%rax
mov    -0x1fb0(%rbp,%rax,8),%rdx
ff
movslq -0x24(%rbp),%rax
mov    -0x3ef0(%rbp,%rax,8),%rcx
ff
movslq -0x24(%rbp),%rax
mov    -0x5e30(%rbp,%rax,8),%r8
ff
lea    0xa15(%rip),%rsi
lea    -0x4c(%rbp),%r9
mov    $0x0,%al
call   1090 <sscanf@plt>
mov    -0xbc10(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0xbc00(%rbp),%rdx
call   1060 <fgets@plt>
mov    -0xbc10(%rbp),%rdi
movslq -0x24(%rbp),%rax
mov    -0x1fb0(%rbp,%rax,8),%rdx
ff
movslq -0x24(%rbp),%rax
mov    -0x3ef0(%rbp,%rax,8),%rcx
ff
movslq -0x24(%rbp),%rax
mov    -0x5e30(%rbp,%rax,8),%r8
ff
lea    0x9c2(%rip),%rsi
lea    -0x50(%rbp),%r9
mov    $0x0,%al
call   1090 <sscanf@plt>
mov    -0xbc10(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0xbc00(%rbp),%rdx
call   1060 <fgets@plt>
mov    -0xbc10(%rbp),%rdi
movslq -0x24(%rbp),%rax
mov    -0x1fb0(%rbp,%rax,8),%rdx
ff
movslq -0x24(%rbp),%rax
mov    -0x3ef0(%rbp,%rax,8),%rcx
ff
lea    0x97e(%rip),%rsi
lea    -0x54(%rbp),%r8
mov    $0x0,%al
call   1090 <sscanf@plt>
mov    -0xbc10(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0xbbf8(%rbp),%rdx
call   1060 <fgets@plt>
mov    -0xbc10(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0xbbf8(%rbp),%rdx
call   1060 <fgets@plt>
mov    -0xbc10(%rbp),%rdi
movslq -0x24(%rbp),%rax
mov    -0x1fb0(%rbp,%rax,8),%rcx
ff
movslq -0x24(%rbp),%rax
mov    -0x3ef0(%rbp,%rax,8),%r8
ff
movslq -0x24(%rbp),%rax
mov    -0x5e30(%rbp,%rax,8),%r9
ff
lea    0x91e(%rip),%rsi
lea    -0x54(%rbp),%rdx
mov    $0x0,%al
call   1090 <sscanf@plt>
movss  -0x54(%rbp),%xmm0
subss  -0x48(%rbp),%xmm0
movss  %xmm0,-0x58(%rbp)
mov    -0xbc08(%rbp),%rdi
movss  -0x48(%rbp),%xmm0
movss  -0x54(%rbp),%xmm1
movss  -0x58(%rbp),%xmm2
lea    0x8c2(%rip),%rsi
lea    0x8ec(%rip),%rcx
mov    %rcx,%rdx
call   1070 <fprintf@plt>
movl   $0x0,-0x20(%rbp)
cmpl   $0x3e8,-0x20(%rbp)
jge    180f <main+0x68f>
movslq -0x20(%rbp),%rax
mov    -0x1fb0(%rbp,%rax,8),%rdi
ff
call   1030 <free@plt>
movslq -0x20(%rbp),%rax
mov    -0x3ef0(%rbp,%rax,8),%rdi
ff
call   1030 <free@plt>
movslq -0x20(%rbp),%rax
mov    -0x5e30(%rbp,%rax,8),%rdi
ff
call   1030 <free@plt>
movslq -0x20(%rbp),%rax
mov    -0x7d70(%rbp,%rax,8),%rdi
ff
call   1030 <free@plt>
movslq -0x20(%rbp),%rax
mov    -0x9cb0(%rbp,%rax,8),%rdi
ff
call   1030 <free@plt>
movslq -0x20(%rbp),%rax
mov    -0xbbf0(%rbp,%rax,8),%rdi
ff
call   1030 <free@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    178e <main+0x60e>
mov    -0xbbf8(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0xbc00(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0xbc08(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x60(%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    $0xbfc8,%rsp
mov    %rsp,0x38(%rsp)
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    $0x3e8,%edi
call   1080 <malloc@plt>
mov    %rax,0x42c0(%rsp,%rbx,1)
mov    $0x3e8,%edi
call   1080 <malloc@plt>
mov    %rax,0x2380(%rsp,%rbx,1)
mov    $0x3e8,%edi
call   1080 <malloc@plt>
mov    %rax,0x440(%rsp,%rbx,1)
mov    $0x3e8,%edi
call   1080 <malloc@plt>
mov    %rax,0xa080(%rsp,%rbx,1)
mov    $0x3e8,%edi
call   1080 <malloc@plt>
mov    %rax,0x8140(%rsp,%rbx,1)
mov    $0x3e8,%edi
call   1080 <malloc@plt>
mov    %rax,0x6200(%rsp,%rbx,1)
add    $0x8,%rbx
cmp    $0x1f40,%rbx
jne    11a0 <main+0x20>
lea    0xde0(%rip),%rdi
lea    0xde8(%rip),%rbx
mov    %rbx,%rsi
call   10a0 <fopen@plt>
mov    %rax,0x8(%rsp)
lea    0xdd6(%rip),%rdi
mov    %rbx,%rsi
call   10a0 <fopen@plt>
mov    %rax,0x10(%rsp)
lea    0xdd0(%rip),%rdi
lea    0xdd4(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,0x30(%rsp)
lea    0x50(%rsp),%rbx
lea    0x2c(%rsp),%r13
lea    0xdd9(%rip),%r15
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
mov    $0x3e8,%esi
mov    0x8(%rsp),%rdx
call   1060 <fgets@plt>
mov    0x42c0(%rsp,%r12,8),%rdx
mov    0x2380(%rsp,%r12,8),%rcx
mov    0x440(%rsp,%r12,8),%r14
mov    %rbx,%rdi
lea    0xd78(%rip),%rsi
mov    %r14,%r8
mov    %r13,%r9
xor    %eax,%eax
lea    0x20(%rsp),%rbp
push   %rbp
push   0x6208(%rsp,%r12,8)
lea    0x34(%rsp),%rbp
push   %rbp
push   0x8158(%rsp,%r12,8)
lea    0x48(%rsp),%rbp
push   %rbp
push   0xa0a8(%rsp,%r12,8)
call   1090 <sscanf@plt>
add    $0x30,%rsp
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0x8,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     131b <main+0x19b>
add    $0x1,%r12
cmp    $0x3e8,%r12
jne    1280 <main+0x100>
mov    $0x3e8,%r12d
mov    %r12d,%eax
shl    $0x3,%rax
mov    0x42c0(%rsp,%rax,1),%r13
mov    0x2380(%rsp,%rax,1),%rbp
mov    0x440(%rsp,%rax,1),%r15
lea    0xd12(%rip),%r14
lea    0x50(%rsp),%r12
lea    0x4c(%rsp),%r9
mov    %r12,%rdi
mov    %r14,%rsi
mov    %r13,%rdx
mov    %rbp,%rcx
mov    %r15,%r8
xor    %eax,%eax
call   1090 <sscanf@plt>
mov    %r12,%rdi
mov    $0x3e8,%esi
mov    0x8(%rsp),%rbx
mov    %rbx,%rdx
call   1060 <fgets@plt>
lea    0x48(%rsp),%r9
mov    %r12,%rdi
mov    %r14,%rsi
mov    %r13,%rdx
mov    %rbp,%rcx
mov    %r15,%r8
xor    %eax,%eax
call   1090 <sscanf@plt>
mov    %r12,%rdi
mov    $0x3e8,%esi
mov    %rbx,%rdx
call   1060 <fgets@plt>
lea    0xcae(%rip),%rsi
lea    0x1c(%rsp),%r14
mov    %r12,%rdi
mov    %r13,%rdx
mov    %rbp,%rcx
mov    %r14,%r8
xor    %eax,%eax
call   1090 <sscanf@plt>
mov    %r12,%rdi
mov    $0x3e8,%esi
mov    %rbx,%rdx
call   1060 <fgets@plt>
mov    %r12,%rdi
mov    $0x3e8,%esi
mov    %rbx,%rdx
call   1060 <fgets@plt>
lea    0xc78(%rip),%rsi
mov    %r12,%rdi
mov    %r14,%rdx
mov    %r13,%rcx
mov    %rbp,%r8
mov    %r15,%r9
xor    %eax,%eax
call   1090 <sscanf@plt>
lea    0x2c(%rsp),%r13
lea    0xc41(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    $0x3e8,%esi
mov    0x10(%rsp),%rdx
call   1060 <fgets@plt>
mov    0x42c0(%rsp,%rbx,8),%rdx
mov    0x2380(%rsp,%rbx,8),%rcx
mov    0x440(%rsp,%rbx,8),%r15
mov    %r12,%rdi
lea    0xbe8(%rip),%rsi
mov    %r15,%r8
mov    %r13,%r9
xor    %eax,%eax
lea    0x20(%rsp),%rbp
push   %rbp
push   0x6208(%rsp,%rbx,8)
lea    0x34(%rsp),%rbp
push   %rbp
push   0x8158(%rsp,%rbx,8)
lea    0x48(%rsp),%rbp
push   %rbp
push   0xa0a8(%rsp,%rbx,8)
call   1090 <sscanf@plt>
add    $0x30,%rsp
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x8,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     14a7 <main+0x327>
add    $0x1,%rbx
cmp    $0x3e8,%rbx
jne    1410 <main+0x290>
mov    $0x3e8,%ebx
mov    %ebx,%eax
shl    $0x3,%rax
mov    0x42c0(%rsp,%rax,1),%r13
mov    0x2380(%rsp,%rax,1),%r12
mov    0x440(%rsp,%rax,1),%r15
lea    0xb87(%rip),%rsi
xor    %ebp,%ebp
lea    0x50(%rsp),%rbx
lea    0x44(%rsp),%r9
mov    %rbx,%rdi
mov    %r13,%rdx
mov    %r12,%rcx
mov    %r15,%r8
xor    %eax,%eax
call   1090 <sscanf@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
mov    0x10(%rsp),%r14
mov    %r14,%rdx
call   1060 <fgets@plt>
lea    0x40(%rsp),%r9
mov    %rbx,%rdi
lea    0xb44(%rip),%rsi
mov    %r13,%rdx
mov    %r12,%rcx
mov    %r15,%r8
xor    %eax,%eax
call   1090 <sscanf@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
mov    %r14,%rdx
call   1060 <fgets@plt>
lea    0xb20(%rip),%rsi
lea    0x4(%rsp),%r8
mov    %rbx,%rdi
mov    %r13,%rdx
mov    %r12,%rcx
xor    %eax,%eax
call   1090 <sscanf@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
mov    0x8(%rsp),%r14
mov    %r14,%rdx
call   1060 <fgets@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
mov    %r14,%rdx
call   1060 <fgets@plt>
lea    0xae8(%rip),%rsi
mov    %rbx,%rdi
lea    0x4(%rsp),%rdx
mov    %r13,%rcx
mov    %r12,%r8
mov    %r15,%r9
xor    %eax,%eax
call   1090 <sscanf@plt>
movss  0x4(%rsp),%xmm1
movss  0x1c(%rsp),%xmm0
movaps %xmm1,%xmm2
subss  %xmm0,%xmm2
lea    0xa91(%rip),%rsi
lea    0xabb(%rip),%rcx
mov    0x30(%rsp),%rbx
mov    %rbx,%rdi
mov    %rcx,%rdx
call   1070 <fprintf@plt>
mov    0x42c0(%rsp,%rbp,1),%rdi
call   1030 <free@plt>
mov    0x2380(%rsp,%rbp,1),%rdi
call   1030 <free@plt>
mov    0x440(%rsp,%rbp,1),%rdi
call   1030 <free@plt>
mov    0xa080(%rsp,%rbp,1),%rdi
call   1030 <free@plt>
mov    0x8140(%rsp,%rbp,1),%rdi
call   1030 <free@plt>
mov    0x6200(%rsp,%rbp,1),%rdi
call   1030 <free@plt>
add    $0x8,%rbp
cmp    $0x1f40,%rbp
jne    15c0 <main+0x440>
mov    0x8(%rsp),%rdi
call   1050 <fclose@plt>
mov    0x10(%rsp),%rdi
call   1050 <fclose@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
mov    0x38(%rsp),%rsp
xor    %eax,%eax
add    $0xbfc8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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