#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, float, float,
                           float, float, 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, bef_nonbond, aft_nonbond, 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);
  sscanf(buffer, "%f %s %s %s", &bef_nonbond, word_1[j], word_2[j], word_3[j]);
  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, after);
  sscanf(buffer, "%f %s %s %s", &aft_nonbond, word_1[j], word_2[j], word_3[j]);
  fgets(buffer, line_length, after);
  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 : %f : %f : %f : %f : %f", bef_total, aft_total,
          delta_energy, bef_nonbond, aft_nonbond, aft_nonbond - bef_nonbond);
  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,-0x68(%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,-0x70(%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
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    0xb6f(%rip),%rsi
lea    -0x58(%rbp),%rdx
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),%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    0xb1c(%rip),%rsi
lea    -0x48(%rbp),%rdx
mov    $0x0,%al
call   1090 <sscanf@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0x3e8,-0x24(%rbp)
jge    1649 <main+0x4c9>
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    0xa5e(%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    0xa2d(%rip),%rsi
mov    $0x8,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    1636 <main+0x4b6>
jmp    1649 <main+0x4c9>
jmp    163b <main+0x4bb>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1555 <main+0x3d5>
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    0x9d8(%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    0x985(%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    0x941(%rip),%rsi
lea    -0x54(%rbp),%r8
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),%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    0x8f7(%rip),%rsi
lea    -0x5c(%rbp),%rdx
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),%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    0x8a4(%rip),%rsi
lea    -0x54(%rbp),%rdx
mov    $0x0,%al
call   1090 <sscanf@plt>
movss  -0x54(%rbp),%xmm0
subss  -0x48(%rbp),%xmm0
movss  %xmm0,-0x60(%rbp)
mov    -0xbc08(%rbp),%rdi
movss  -0x48(%rbp),%xmm0
movss  -0x54(%rbp),%xmm1
movss  -0x60(%rbp),%xmm2
movss  -0x58(%rbp),%xmm3
movss  -0x5c(%rbp),%xmm4
movss  -0x5c(%rbp),%xmm5
subss  -0x58(%rbp),%xmm5
lea    0x865(%rip),%rsi
call   1070 <fprintf@plt>
movl   $0x0,-0x20(%rbp)
cmpl   $0x3e8,-0x20(%rbp)
jge    1893 <main+0x713>
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    1812 <main+0x692>
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    -0x68(%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,0x10(%rsp)
lea    0xdd6(%rip),%rdi
mov    %rbx,%rsi
call   10a0 <fopen@plt>
mov    %rax,0x8(%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    0x10(%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    0x10(%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    0x4(%rsp),%r8
mov    %r12,%rdi
mov    %r13,%rdx
mov    %rbp,%rcx
xor    %eax,%eax
call   1090 <sscanf@plt>
mov    %r12,%rdi
mov    $0x3e8,%esi
mov    %rbx,%rdx
call   1060 <fgets@plt>
lea    0xc8b(%rip),%r14
lea    0x1c(%rsp),%rdx
mov    %r12,%rdi
mov    %r14,%rsi
mov    %r13,%rcx
mov    %rbp,%r8
mov    %r15,%r9
xor    %eax,%eax
call   1090 <sscanf@plt>
mov    %r12,%rdi
mov    $0x3e8,%esi
mov    %rbx,%rdx
call   1060 <fgets@plt>
mov    %r12,%rdi
mov    %r14,%rsi
lea    0x4(%rsp),%rdx
mov    %r13,%rcx
mov    %rbp,%r8
mov    %r15,%r9
xor    %eax,%eax
call   1090 <sscanf@plt>
lea    0x2c(%rsp),%r13
lea    0xc24(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    $0x3e8,%esi
mov    0x8(%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    0xbc8(%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     14c7 <main+0x347>
add    $0x1,%rbx
cmp    $0x3e8,%rbx
jne    1430 <main+0x2b0>
mov    $0x3e8,%ebx
mov    %ebx,%eax
shl    $0x3,%rax
mov    0x42c0(%rsp,%rax,1),%r12
mov    0x2380(%rsp,%rax,1),%rbp
mov    0x440(%rsp,%rax,1),%r15
lea    0xb67(%rip),%rsi
xor    %ebx,%ebx
lea    0x50(%rsp),%r13
lea    0x44(%rsp),%r9
mov    %r13,%rdi
mov    %r12,%rdx
mov    %rbp,%rcx
mov    %r15,%r8
xor    %eax,%eax
call   1090 <sscanf@plt>
mov    %r13,%rdi
mov    $0x3e8,%esi
mov    0x8(%rsp),%r14
mov    %r14,%rdx
call   1060 <fgets@plt>
lea    0x40(%rsp),%r9
mov    %r13,%rdi
lea    0xb24(%rip),%rsi
mov    %r12,%rdx
mov    %rbp,%rcx
mov    %r15,%r8
xor    %eax,%eax
call   1090 <sscanf@plt>
mov    %r13,%rdi
mov    $0x3e8,%esi
mov    %r14,%rdx
call   1060 <fgets@plt>
lea    0xb00(%rip),%rsi
mov    %rsp,%r8
mov    %r13,%rdi
mov    %r12,%rdx
mov    %rbp,%rcx
xor    %eax,%eax
call   1090 <sscanf@plt>
mov    %r13,%rdi
mov    $0x3e8,%esi
mov    %r14,%rdx
call   1060 <fgets@plt>
lea    0xadf(%rip),%rsi
lea    0x18(%rsp),%rdx
mov    %r13,%rdi
mov    %r12,%rcx
mov    %rbp,%r8
mov    %r15,%r9
xor    %eax,%eax
call   1090 <sscanf@plt>
mov    %r13,%rdi
mov    $0x3e8,%esi
mov    %r14,%rdx
call   1060 <fgets@plt>
mov    %r13,%rdi
lea    0xaad(%rip),%rsi
mov    %rsp,%rdx
mov    %r12,%rcx
mov    %rbp,%r8
mov    %r15,%r9
xor    %eax,%eax
call   1090 <sscanf@plt>
movss  (%rsp),%xmm1
movss  0x4(%rsp),%xmm0
movaps %xmm1,%xmm2
subss  %xmm0,%xmm2
movss  0x1c(%rsp),%xmm3
movss  0x18(%rsp),%xmm4
movaps %xmm4,%xmm5
subss  %xmm3,%xmm5
lea    0xa7a(%rip),%rsi
mov    0x30(%rsp),%rbp
mov    %rbp,%rdi
call   1070 <fprintf@plt>
xchg   %ax,%ax
mov    0x42c0(%rsp,%rbx,1),%rdi
call   1030 <free@plt>
mov    0x2380(%rsp,%rbx,1),%rdi
call   1030 <free@plt>
mov    0x440(%rsp,%rbx,1),%rdi
call   1030 <free@plt>
mov    0xa080(%rsp,%rbx,1),%rdi
call   1030 <free@plt>
mov    0x8140(%rsp,%rbx,1),%rdi
call   1030 <free@plt>
mov    0x6200(%rsp,%rbx,1),%rdi
call   1030 <free@plt>
add    $0x8,%rbx
cmp    $0x1f40,%rbx
jne    1600 <main+0x480>
mov    0x10(%rsp),%rdi
call   1050 <fclose@plt>
mov    0x8(%rsp),%rdi
call   1050 <fclose@plt>
mov    %rbp,%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 = [29 x i8] c" %f : %f : %f : %f : %f : %f\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 float
%18 = alloca float
%19 = alloca i8*
%20 = alloca i64
%21 = alloca [1000 x i8*]
%22 = alloca [1000 x i8*]
%23 = alloca [1000 x i8*]
%24 = alloca [1000 x i8*]
%25 = alloca [1000 x i8*]
%26 = alloca [1000 x i8*]
%27 = alloca i32*
%28 = alloca i32*
%29 = 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
%30 = load i32, i32* %5
%31 = zext i32 %30 to i64
%32 = call i8* @llvm.stacksave()
store i8* %32, i8** %19
%33 = alloca i8, i64 %31
store i64 %31, i64* %20
store i32 0, i32* %2
br label %34
34: ; preds = %74, %0
%35 = load i32, i32* %2
%36 = icmp slt i32 %35, 1000
br i1 %36, label %37, label %77
37: ; preds = %34
%38 = load i32, i32* %5
%39 = call i64 @malloc(i32 %38)
%40 = inttoptr i64 %39 to i8*
%41 = load i32, i32* %2
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %21, i64 0, i64 %42
store i8* %40, i8** %43
%44 = load i32, i32* %5
%45 = call i64 @malloc(i32 %44)
%46 = inttoptr i64 %45 to i8*
%47 = load i32, i32* %2
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %22, i64 0, i64 %48
store i8* %46, i8** %49
%50 = load i32, i32* %5
%51 = call i64 @malloc(i32 %50)
%52 = inttoptr i64 %51 to i8*
%53 = load i32, i32* %2
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %23, i64 0, i64 %54
store i8* %52, i8** %55
%56 = load i32, i32* %5
%57 = call i64 @malloc(i32 %56)
%58 = inttoptr i64 %57 to i8*
%59 = load i32, i32* %2
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %24, i64 0, i64 %60
store i8* %58, i8** %61
%62 = load i32, i32* %5
%63 = call i64 @malloc(i32 %62)
%64 = inttoptr i64 %63 to i8*
%65 = load i32, i32* %2
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %25, i64 0, i64 %66
store i8* %64, i8** %67
%68 = load i32, i32* %5
%69 = call i64 @malloc(i32 %68)
%70 = inttoptr i64 %69 to i8*
%71 = load i32, i32* %2
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %26, i64 0, i64 %72
store i8* %70, i8** %73
br label %74
74: ; preds = %37
%75 = load i32, i32* %2
%76 = add nsw i32 %75, 1
store i32 %76, i32* %2
br label %34
77: ; preds = %34
%78 = 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* %78, i32** %27
%79 = 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* %79, i32** %28
%80 = 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* %80, i32** %29
store i32 0, i32* %3
br label %81
81: ; preds = %121, %77
%82 = load i32, i32* %3
%83 = icmp slt i32 %82, 1000
br i1 %83, label %84, label %124
84: ; preds = %81
%85 = load i32, i32* %5
%86 = load i32*, i32** %27
%87 = call i32 @fgets(i8* %33, i32 %85, i32* %86)
%88 = load i32, i32* %3
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %21, i64 0, i64 %89
%91 = load i8*, i8** %90
%92 = load i32, i32* %3
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %22, i64 0, i64 %93
%95 = load i8*, i8** %94
%96 = load i32, i32* %3
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %23, i64 0, i64 %97
%99 = load i8*, i8** %98
%100 = load i32, i32* %3
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %24, i64 0, i64 %101
%103 = load i8*, i8** %102
%104 = load i32, i32* %3
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %25, i64 0, i64 %105
%107 = load i8*, i8** %106
%108 = load i32, i32* %3
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %26, i64 0, i64 %109
%111 = load i8*, i8** %110
%112 = call i32 (i8*, i8*, ...) @sscanf(i8* %33, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i8* %91, i8* %95, i8* %99, i32* %6, i8* %103, float* %7, i8* %107, float* %8, i8* %111, float* %9)
%113 = load i32, i32* %3
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %23, i64 0, i64 %114
%116 = load i8*, i8** %115
%117 = call i64 @strncmp(i8* %116, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 8)
%118 = icmp eq i64 %117, 0
br i1 %118, label %119, label %120
119: ; preds = %84
br label %124
120: ; preds = %84
br label %121
121: ; preds = %120
%122 = load i32, i32* %3
%123 = add nsw i32 %122, 1
store i32 %123, i32* %3
br label %81
124: ; preds = %119, %81
%125 = load i32, i32* %3
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %21, i64 0, i64 %126
%128 = load i8*, i8** %127
%129 = load i32, i32* %3
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %22, i64 0, i64 %130
%132 = load i8*, i8** %131
%133 = load i32, i32* %3
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %23, i64 0, i64 %134
%136 = load i8*, i8** %135
%137 = call i32 (i8*, i8*, ...) @sscanf(i8* %33, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i8* %128, i8* %132, i8* %136, float* %10)
%138 = load i32, i32* %5
%139 = load i32*, i32** %27
%140 = call i32 @fgets(i8* %33, i32 %138, i32* %139)
%141 = load i32, i32* %3
%142 = sext i32 %141 to i64
%143 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %21, i64 0, i64 %142
%144 = load i8*, i8** %143
%145 = load i32, i32* %3
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %22, i64 0, i64 %146
%148 = load i8*, i8** %147
%149 = load i32, i32* %3
%150 = sext i32 %149 to i64
%151 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %23, i64 0, i64 %150
%152 = load i8*, i8** %151
%153 = call i32 (i8*, i8*, ...) @sscanf(i8* %33, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i8* %144, i8* %148, i8* %152, float* %11)
%154 = load i32, i32* %5
%155 = load i32*, i32** %27
%156 = call i32 @fgets(i8* %33, i32 %154, i32* %155)
%157 = load i32, i32* %3
%158 = sext i32 %157 to i64
%159 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %21, i64 0, i64 %158
%160 = load i8*, i8** %159
%161 = load i32, i32* %3
%162 = sext i32 %161 to i64
%163 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %22, i64 0, i64 %162
%164 = load i8*, i8** %163
%165 = call i32 (i8*, i8*, ...) @sscanf(i8* %33, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i8* %160, i8* %164, float* %12)
%166 = load i32, i32* %5
%167 = load i32*, i32** %27
%168 = call i32 @fgets(i8* %33, i32 %166, i32* %167)
%169 = load i32, i32* %3
%170 = sext i32 %169 to i64
%171 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %21, i64 0, i64 %170
%172 = load i8*, i8** %171
%173 = load i32, i32* %3
%174 = sext i32 %173 to i64
%175 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %22, i64 0, i64 %174
%176 = load i8*, i8** %175
%177 = load i32, i32* %3
%178 = sext i32 %177 to i64
%179 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %23, i64 0, i64 %178
%180 = load i8*, i8** %179
%181 = call i32 (i8*, i8*, ...) @sscanf(i8* %33, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), float* %16, i8* %172, i8* %176, i8* %180)
%182 = load i32, i32* %5
%183 = load i32*, i32** %27
%184 = call i32 @fgets(i8* %33, i32 %182, i32* %183)
%185 = load i32, i32* %3
%186 = sext i32 %185 to i64
%187 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %21, i64 0, i64 %186
%188 = load i8*, i8** %187
%189 = load i32, i32* %3
%190 = sext i32 %189 to i64
%191 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %22, i64 0, i64 %190
%192 = load i8*, i8** %191
%193 = load i32, i32* %3
%194 = sext i32 %193 to i64
%195 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %23, i64 0, i64 %194
%196 = load i8*, i8** %195
%197 = call i32 (i8*, i8*, ...) @sscanf(i8* %33, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), float* %12, i8* %188, i8* %192, i8* %196)
store i32 0, i32* %3
br label %198
198: ; preds = %238, %124
%199 = load i32, i32* %3
%200 = icmp slt i32 %199, 1000
br i1 %200, label %201, label %241
201: ; preds = %198
%202 = load i32, i32* %5
%203 = load i32*, i32** %28
%204 = call i32 @fgets(i8* %33, i32 %202, i32* %203)
%205 = load i32, i32* %3
%206 = sext i32 %205 to i64
%207 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %21, i64 0, i64 %206
%208 = load i8*, i8** %207
%209 = load i32, i32* %3
%210 = sext i32 %209 to i64
%211 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %22, i64 0, i64 %210
%212 = load i8*, i8** %211
%213 = load i32, i32* %3
%214 = sext i32 %213 to i64
%215 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %23, i64 0, i64 %214
%216 = load i8*, i8** %215
%217 = load i32, i32* %3
%218 = sext i32 %217 to i64
%219 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %24, i64 0, i64 %218
%220 = load i8*, i8** %219
%221 = load i32, i32* %3
%222 = sext i32 %221 to i64
%223 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %25, i64 0, i64 %222
%224 = load i8*, i8** %223
%225 = load i32, i32* %3
%226 = sext i32 %225 to i64
%227 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %26, i64 0, i64 %226
%228 = load i8*, i8** %227
%229 = call i32 (i8*, i8*, ...) @sscanf(i8* %33, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i8* %208, i8* %212, i8* %216, i32* %6, i8* %220, float* %7, i8* %224, float* %8, i8* %228, float* %9)
%230 = load i32, i32* %3
%231 = sext i32 %230 to i64
%232 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %23, i64 0, i64 %231
%233 = load i8*, i8** %232
%234 = call i64 @strncmp(i8* %233, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 8)
%235 = icmp eq i64 %234, 0
br i1 %235, label %236, label %237
236: ; preds = %201
br label %241
237: ; preds = %201
br label %238
238: ; preds = %237
%239 = load i32, i32* %3
%240 = add nsw i32 %239, 1
store i32 %240, i32* %3
br label %198
241: ; preds = %236, %198
%242 = load i32, i32* %3
%243 = sext i32 %242 to i64
%244 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %21, i64 0, i64 %243
%245 = load i8*, i8** %244
%246 = load i32, i32* %3
%247 = sext i32 %246 to i64
%248 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %22, i64 0, i64 %247
%249 = load i8*, i8** %248
%250 = load i32, i32* %3
%251 = sext i32 %250 to i64
%252 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %23, i64 0, i64 %251
%253 = load i8*, i8** %252
%254 = call i32 (i8*, i8*, ...) @sscanf(i8* %33, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i8* %245, i8* %249, i8* %253, float* %13)
%255 = load i32, i32* %5
%256 = load i32*, i32** %28
%257 = call i32 @fgets(i8* %33, i32 %255, i32* %256)
%258 = load i32, i32* %3
%259 = sext i32 %258 to i64
%260 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %21, i64 0, i64 %259
%261 = load i8*, i8** %260
%262 = load i32, i32* %3
%263 = sext i32 %262 to i64
%264 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %22, i64 0, i64 %263
%265 = load i8*, i8** %264
%266 = load i32, i32* %3
%267 = sext i32 %266 to i64
%268 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %23, i64 0, i64 %267
%269 = load i8*, i8** %268
%270 = call i32 (i8*, i8*, ...) @sscanf(i8* %33, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i8* %261, i8* %265, i8* %269, float* %14)
%271 = load i32, i32* %5
%272 = load i32*, i32** %28
%273 = call i32 @fgets(i8* %33, i32 %271, i32* %272)
%274 = load i32, i32* %3
%275 = sext i32 %274 to i64
%276 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %21, 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*]* %22, i64 0, i64 %279
%281 = load i8*, i8** %280
%282 = call i32 (i8*, i8*, ...) @sscanf(i8* %33, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i8* %277, i8* %281, float* %15)
%283 = load i32, i32* %5
%284 = load i32*, i32** %28
%285 = call i32 @fgets(i8* %33, i32 %283, i32* %284)
%286 = load i32, i32* %3
%287 = sext i32 %286 to i64
%288 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %21, i64 0, i64 %287
%289 = load i8*, i8** %288
%290 = load i32, i32* %3
%291 = sext i32 %290 to i64
%292 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %22, i64 0, i64 %291
%293 = load i8*, i8** %292
%294 = load i32, i32* %3
%295 = sext i32 %294 to i64
%296 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %23, i64 0, i64 %295
%297 = load i8*, i8** %296
%298 = call i32 (i8*, i8*, ...) @sscanf(i8* %33, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), float* %17, i8* %289, i8* %293, i8* %297)
%299 = load i32, i32* %5
%300 = load i32*, i32** %28
%301 = call i32 @fgets(i8* %33, i32 %299, i32* %300)
%302 = load i32, i32* %3
%303 = sext i32 %302 to i64
%304 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %21, i64 0, i64 %303
%305 = load i8*, i8** %304
%306 = load i32, i32* %3
%307 = sext i32 %306 to i64
%308 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %22, i64 0, i64 %307
%309 = load i8*, i8** %308
%310 = load i32, i32* %3
%311 = sext i32 %310 to i64
%312 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %23, i64 0, i64 %311
%313 = load i8*, i8** %312
%314 = call i32 (i8*, i8*, ...) @sscanf(i8* %33, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), float* %15, i8* %305, i8* %309, i8* %313)
%315 = load float, float* %15
%316 = load float, float* %12
%317 = fsub float %315, %316
store float %317, float* %18
%318 = load i32*, i32** %29
%319 = load float, float* %12
%320 = load float, float* %15
%321 = load float, float* %18
%322 = load float, float* %16
%323 = load float, float* %17
%324 = load float, float* %17
%325 = load float, float* %16
%326 = fsub float %324, %325
%327 = call i32 @fprintf(i32* %318, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.10, i64 0, i64 0), float %319, float %320, float %321, float %322, float %323, float %326)
store i32 0, i32* %2
br label %328
328: ; preds = %362, %241
%329 = load i32, i32* %2
%330 = icmp slt i32 %329, 1000
br i1 %330, label %331, label %365
331: ; preds = %328
%332 = load i32, i32* %2
%333 = sext i32 %332 to i64
%334 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %21, i64 0, i64 %333
%335 = load i8*, i8** %334
%336 = call i32 @free(i8* %335)
%337 = load i32, i32* %2
%338 = sext i32 %337 to i64
%339 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %22, i64 0, i64 %338
%340 = load i8*, i8** %339
%341 = call i32 @free(i8* %340)
%342 = load i32, i32* %2
%343 = sext i32 %342 to i64
%344 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %23, i64 0, i64 %343
%345 = load i8*, i8** %344
%346 = call i32 @free(i8* %345)
%347 = load i32, i32* %2
%348 = sext i32 %347 to i64
%349 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %24, i64 0, i64 %348
%350 = load i8*, i8** %349
%351 = call i32 @free(i8* %350)
%352 = load i32, i32* %2
%353 = sext i32 %352 to i64
%354 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %25, i64 0, i64 %353
%355 = load i8*, i8** %354
%356 = call i32 @free(i8* %355)
%357 = load i32, i32* %2
%358 = sext i32 %357 to i64
%359 = getelementptr inbounds [1000 x i8*], [1000 x i8*]* %26, i64 0, i64 %358
%360 = load i8*, i8** %359
%361 = call i32 @free(i8* %360)
br label %362
362: ; preds = %331
%363 = load i32, i32* %2
%364 = add nsw i32 %363, 1
store i32 %364, i32* %2
br label %328
365: ; preds = %328
%366 = load i32*, i32** %27
%367 = call i32 @fclose(i32* %366)
%368 = load i32*, i32** %28
%369 = call i32 @fclose(i32* %368)
%370 = load i32*, i32** %29
%371 = call i32 @fclose(i32* %370)
%372 = load i8*, i8** %19
%373 = load i32, i32* %1
ret i32 %373
}

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