#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 atoi(char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fread(double *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite(double *, int, int, int /*<<< orphan*/ *);
double *malloc(int);
int /*<<< orphan*/ print_usage();
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ strcmp(char *, char *);
double utime();
int main(int argc, char *argv[]) {
  int i, j, k;
  int n;
  double *data;
  int iterations;
  FILE *file;
  double time;
  double omega;
  double eps;
  double temp, err1;
  int row_size;
  n = 128;
  eps = 1.0e-5;
  omega = 0.5;
  iterations = 100;
  if (argc > 1) {
    for (i = 1; i < argc;) {
      if (strcmp(argv[i], "-s") == 0) {
        n = atoi(argv[i + 1]);
        n = n;
        i += 2;
      } else if (strcmp(argv[i], "-i") == 0) {
        iterations = atoi(argv[i + 1]);
        i += 2;
      } else {
        print_usage();
        return 0;
      }
    }
  }
  data = malloc(sizeof(double) * (n + 2) * (n + 2));
  file = fopen("input.data", "r");
  if (file == NULL) {
    printf("can't not open the input.data file\n");
    return -1;
  }
  fread(data, sizeof(double), (n + 2) * (n + 2), file);
  fclose(file);
  row_size = n + 2;
  printf("sequence SOR processing...\n");
  time = -utime();
  for (k = 1; k < iterations; k++) {
    err1 = 0.0;
    for (i = 1; i <= n; i += 2) {
      for (j = 1; j <= n; j++) {
        temp =
            0.125 *
                (data[(i - 1) * row_size + j] + data[(i + 1) * row_size + j] +
                 data[i * row_size + j - 1] + data[i * row_size + j + 1] +
                 data[(i - 1) * row_size + j - 1] +
                 data[(i - 1) * row_size + j + 1] +
                 data[(i + 1) * row_size + j - 1] +
                 data[(i + 1) * row_size + j + 1]) -
            data[i * row_size + j];
        data[i * row_size + j] += omega * temp;
        if (temp < 0)
          temp = -temp;
        if (temp > err1)
          err1 = temp;
      }
    }
    for (i = 2; i <= n; i += 2) {
      for (j = 1; j <= n; j++) {
        temp =
            0.125 *
                (data[(i - 1) * row_size + j] + data[(i + 1) * row_size + j] +
                 data[i * row_size + j - 1] + data[i * row_size + j + 1] +
                 data[(i - 1) * row_size + j - 1] +
                 data[(i - 1) * row_size + j + 1] +
                 data[(i + 1) * row_size + j - 1] +
                 data[(i + 1) * row_size + j + 1]) -
            data[i * row_size + j];
        data[i * row_size + j] += omega * temp;
        if (temp < 0)
          temp = -temp;
        if (temp > err1)
          err1 = temp;
      }
    }
    if (err1 <= eps)
      break;
  }
  time += utime();
  printf("\n====================================================\n");
  printf("Result:\n");
  printf("\tTIME\tVector_Size\tLoops\tErr\n");
  printf("\t%f\t%d\t%d\t%.5e\n", time, n, k, err1);
  file = fopen("sequence_output.data", "w");
  if (file == NULL) {
    printf("can't not open sequence_output.data\n");
    return -1;
  }
  fwrite(data, sizeof(double), (n + 2) * (n + 2), file);
  fclose(file);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x80,-0x20(%rbp)
movsd  0xe43(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xe2e(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movl   $0x64,-0x2c(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    12b5 <main+0x115>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12b0 <main+0x110>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe0a(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    124a <main+0xaa>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   10a0 <atoi@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
jmp    12ab <main+0x10b>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xdbe(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1293 <main+0xf3>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   10a0 <atoi@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
jmp    12a6 <main+0x106>
mov    $0x0,%al
call   10c0 <print_usage@plt>
movl   $0x0,-0x4(%rbp)
jmp    1836 <main+0x696>
jmp    12ab <main+0x10b>
jmp    11ef <main+0x4f>
jmp    12b5 <main+0x115>
mov    -0x20(%rbp),%eax
add    $0x2,%eax
cltq
shl    $0x3,%rax
mov    -0x20(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
imul   %rcx,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x28(%rbp)
lea    0xd3e(%rip),%rdi
lea    0xd42(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    1315 <main+0x175>
lea    0xd29(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1836 <main+0x696>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%edx
add    $0x2,%edx
mov    -0x20(%rbp),%eax
add    $0x2,%eax
imul   %eax,%edx
mov    -0x38(%rbp),%rcx
mov    $0x8,%esi
call   1040 <fread@plt>
mov    -0x38(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x20(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x64(%rbp)
lea    0xd00(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x0,%al
call   1030 <utime@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x40(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1770 <main+0x5d0>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x20(%rbp),%eax
jg     156c <main+0x3cc>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x20(%rbp),%eax
jg     1559 <main+0x3b9>
mov    -0x28(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
imul   -0x64(%rbp),%ecx
add    -0x18(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
imul   -0x64(%rbp),%ecx
add    -0x18(%rbp),%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x14(%rbp),%ecx
imul   -0x64(%rbp),%ecx
add    -0x18(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x14(%rbp),%ecx
imul   -0x64(%rbp),%ecx
add    -0x18(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
imul   -0x64(%rbp),%ecx
add    -0x18(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
imul   -0x64(%rbp),%ecx
add    -0x18(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
imul   -0x64(%rbp),%ecx
add    -0x18(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
imul   -0x64(%rbp),%ecx
add    -0x18(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x14(%rbp),%ecx
imul   -0x64(%rbp),%ecx
add    -0x18(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xb4d(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
mov    -0x28(%rbp),%rax
mov    -0x14(%rbp),%ecx
imul   -0x64(%rbp),%ecx
add    -0x18(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
xorps  %xmm0,%xmm0
ucomisd -0x58(%rbp),%xmm0
jbe    152c <main+0x38c>
movsd  -0x58(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
ucomisd -0x60(%rbp),%xmm0
jbe    1546 <main+0x3a6>
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    154b <main+0x3ab>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    13ae <main+0x20e>
jmp    155e <main+0x3be>
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
jmp    139b <main+0x1fb>
movl   $0x2,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x20(%rbp),%eax
jg     1744 <main+0x5a4>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x20(%rbp),%eax
jg     1731 <main+0x591>
mov    -0x28(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
imul   -0x64(%rbp),%ecx
add    -0x18(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
imul   -0x64(%rbp),%ecx
add    -0x18(%rbp),%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x14(%rbp),%ecx
imul   -0x64(%rbp),%ecx
add    -0x18(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x14(%rbp),%ecx
imul   -0x64(%rbp),%ecx
add    -0x18(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
imul   -0x64(%rbp),%ecx
add    -0x18(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
imul   -0x64(%rbp),%ecx
add    -0x18(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
imul   -0x64(%rbp),%ecx
add    -0x18(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
imul   -0x64(%rbp),%ecx
add    -0x18(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x14(%rbp),%ecx
imul   -0x64(%rbp),%ecx
add    -0x18(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0x975(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
mov    -0x28(%rbp),%rax
mov    -0x14(%rbp),%ecx
imul   -0x64(%rbp),%ecx
add    -0x18(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
xorps  %xmm0,%xmm0
ucomisd -0x58(%rbp),%xmm0
jbe    1704 <main+0x564>
movsd  -0x58(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
ucomisd -0x60(%rbp),%xmm0
jbe    171e <main+0x57e>
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    1723 <main+0x583>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1586 <main+0x3e6>
jmp    1736 <main+0x596>
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
jmp    1573 <main+0x3d3>
movsd  -0x60(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     175d <main+0x5bd>
jmp    1770 <main+0x5d0>
jmp    1762 <main+0x5c2>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1380 <main+0x1e0>
mov    $0x0,%al
call   1030 <utime@plt>
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
lea    0x8e3(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0x90c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0x907(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movsd  -0x40(%rbp),%xmm0
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
movsd  -0x60(%rbp),%xmm1
lea    0x906(%rip),%rdi
mov    $0x2,%al
call   1060 <printf@plt>
lea    0x908(%rip),%rdi
lea    0x916(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    1805 <main+0x665>
lea    0x8fd(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1836 <main+0x696>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%edx
add    $0x2,%edx
mov    -0x20(%rbp),%eax
add    $0x2,%eax
imul   %eax,%edx
mov    -0x38(%rbp),%rcx
mov    $0x8,%esi
call   10b0 <fwrite@plt>
mov    -0x38(%rbp),%rdi
call   1050 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
cmp    $0x2,%edi
jl     123e <main+0x8e>
mov    %rsi,%rbp
mov    %edi,%r14d
mov    $0x80,%eax
mov    %rax,(%rsp)
mov    $0x64,%r12d
mov    $0x1,%ebx
lea    0xe4c(%rip),%r15
lea    0xe48(%rip),%r13
jmp    1207 <main+0x57>
nopl   (%rax)
mov    0x8(%rbp,%rbx,8),%rdi
call   10b0 <atoi@plt>
mov    %rax,(%rsp)
add    $0x2,%rbx
cmp    %r14d,%ebx
jge    124d <main+0x9d>
mov    0x0(%rbp,%rbx,8),%rdi
mov    %r15,%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     11f0 <main+0x40>
mov    0x0(%rbp,%rbx,8),%rdi
mov    %r13,%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
jne    15a3 <main+0x3f3>
mov    0x8(%rbp,%rbx,8),%rdi
call   10b0 <atoi@plt>
mov    %eax,%r12d
jmp    11fe <main+0x4e>
mov    $0x64,%r12d
mov    $0x80,%eax
mov    %rax,(%rsp)
mov    (%rsp),%rax
lea    0x2(%rax),%ebx
mov    %ebx,%r14d
imul   %r14d,%r14d
lea    0x0(,%r14,8),%edi
call   1090 <malloc@plt>
mov    %rax,%r13
lea    0xdc4(%rip),%rdi
lea    0xe4d(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     158b <main+0x3db>
mov    %rax,%rbp
mov    %r13,%rdi
mov    $0x8,%esi
mov    %r14d,%edx
mov    %rax,%rcx
call   1050 <fread@plt>
mov    %rbp,%rdi
call   1060 <fclose@plt>
lea    0xda7(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <utime@plt>
movsd  %xmm0,0x38(%rsp)
cmp    $0x2,%r12d
jl     1597 <main+0x3e7>
mov    %r12d,0xc(%rsp)
mov    %r14,0x18(%rsp)
mov    (%rsp),%rdx
lea    0x1(%rdx),%eax
movslq %ebx,%rcx
mov    %rdx,%rbx
movslq %ebx,%r15
lea    0x0(,%rcx,8),%r8
add    %r13,%r8
mov    %r15,%r12
shl    $0x4,%r12
lea    (%r12,%r13,1),%rbp
add    $0x20,%rbp
add    $0x20,%r12
lea    -0x2(%rcx),%rdx
lea    0x8(,%rcx,8),%rsi
add    %r13,%rsi
mov    %rsi,0x20(%rsp)
lea    (%rdx,%rdx,2),%r9
shl    $0x4,%rdx
mov    %r13,%rdi
lea    0x20(%rdx),%r13
lea    (%rdx,%rdi,1),%rsi
add    $0x30,%rsi
mov    %rsi,0x60(%rsp)
add    $0xffffffffffffffff,%rax
add    %rdi,%rdx
add    $0x28,%rdx
mov    %rdx,0x50(%rsp)
lea    0x40(%rdi,%r9,8),%rdx
mov    %rdx,0x48(%rsp)
mov    %rdi,0x10(%rsp)
lea    0x10(%rdi,%rcx,8),%rcx
mov    %rcx,0x40(%rsp)
movl   $0x1,0x8(%rsp)
movsd  0xca6(%rip),%xmm8
movsd  0xc8d(%rip),%xmm9
movsd  0xc8d(%rip),%xmm2
movapd 0xc9d(%rip),%xmm3
xorpd  %xmm4,%xmm4
mov    %rbp,0x58(%rsp)
nopl   0x0(%rax)
xorpd  %xmm5,%xmm5
test   %ebx,%ebx
jle    1463 <main+0x2b3>
xorpd  %xmm5,%xmm5
mov    $0x1,%edi
mov    0x10(%rsp),%rbx
mov    0x60(%rsp),%rdx
mov    0x20(%rsp),%rsi
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
mov    %r12,%rbp
imul   %rcx,%rbp
movsd  (%r8,%rbp,1),%xmm0
xor    %ebp,%ebp
nop
movapd %xmm5,%xmm6
movsd  0x8(%rbx,%rbp,8),%xmm7
addsd  -0x8(%rdx,%rbp,8),%xmm7
addsd  %xmm0,%xmm7
addsd  0x8(%rsi,%rbp,8),%xmm7
addsd  (%rbx,%rbp,8),%xmm7
addsd  0x10(%rbx,%rbp,8),%xmm7
addsd  -0x10(%rdx,%rbp,8),%xmm7
addsd  (%rdx,%rbp,8),%xmm7
movsd  (%rsi,%rbp,8),%xmm5
mulsd  %xmm9,%xmm7
subsd  %xmm5,%xmm7
movapd %xmm7,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm5,%xmm0
movsd  %xmm0,(%rsi,%rbp,8)
movapd %xmm7,%xmm1
xorpd  %xmm3,%xmm1
movapd %xmm7,%xmm5
cmpltsd %xmm4,%xmm5
andpd  %xmm5,%xmm1
andnpd %xmm7,%xmm5
orpd   %xmm1,%xmm5
maxsd  %xmm6,%xmm5
add    $0x1,%rbp
cmp    %rbp,%rax
jne    13d0 <main+0x220>
add    $0x2,%rdi
add    $0x1,%rcx
add    %r13,%rsi
add    %r13,%rdx
add    %r13,%rbx
cmp    %r15,%rdi
jle    13c0 <main+0x210>
mov    %r8,%rdx
mov    (%rsp),%rbx
cmp    $0x2,%ebx
jge    14a0 <main+0x2f0>
movapd %xmm5,%xmm7
ucomisd %xmm7,%xmm8
jae    15b1 <main+0x401>
mov    %rdx,%r8
mov    0x8(%rsp),%ecx
add    $0x1,%ecx
mov    %ecx,0x8(%rsp)
cmp    0xc(%rsp),%ecx
jne    1390 <main+0x1e0>
jmp    15c8 <main+0x418>
nopl   0x0(%rax,%rax,1)
mov    $0x2,%r11d
mov    0x40(%rsp),%r10
mov    0x48(%rsp),%r14
mov    0x50(%rsp),%r8
xor    %r9d,%r9d
mov    0x58(%rsp),%rbp
jmp    14de <main+0x32e>
nop
movapd %xmm5,%xmm7
add    $0x2,%r11
add    $0x1,%r9
add    %r13,%r8
add    %r13,%r14
add    %r13,%r10
movapd %xmm7,%xmm5
cmp    %r15,%r11
jg     1473 <main+0x2c3>
test   %ebx,%ebx
jle    14c0 <main+0x310>
mov    %r12,%rcx
imul   %r9,%rcx
movsd  0x0(%rbp,%rcx,1),%xmm6
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  -0x8(%r10,%rcx,8),%xmm0
addsd  -0x8(%r14,%rcx,8),%xmm0
addsd  %xmm6,%xmm0
addsd  0x8(%r8,%rcx,8),%xmm0
addsd  -0x10(%r10,%rcx,8),%xmm0
addsd  (%r10,%rcx,8),%xmm0
addsd  -0x10(%r14,%rcx,8),%xmm0
addsd  (%r14,%rcx,8),%xmm0
movsd  (%r8,%rcx,8),%xmm1
mulsd  %xmm9,%xmm0
subsd  %xmm1,%xmm0
movapd %xmm0,%xmm6
mulsd  %xmm2,%xmm6
addsd  %xmm1,%xmm6
movsd  %xmm6,(%r8,%rcx,8)
movapd %xmm0,%xmm1
xorpd  %xmm3,%xmm1
movapd %xmm0,%xmm7
cmpltsd %xmm4,%xmm7
andpd  %xmm7,%xmm1
andnpd %xmm0,%xmm7
orpd   %xmm1,%xmm7
maxsd  %xmm5,%xmm7
add    $0x1,%rcx
movapd %xmm7,%xmm5
cmp    %rcx,%rax
jne    1500 <main+0x350>
jmp    14c4 <main+0x314>
lea    0xb5a(%rip),%rdi
jmp    1671 <main+0x4c1>
mov    $0x1,%r15d
mov    (%rsp),%rbx
jmp    15dd <main+0x42d>
xor    %ebp,%ebp
xor    %eax,%eax
call   10d0 <print_usage@plt>
jmp    167b <main+0x4cb>
movapd %xmm7,0x20(%rsp)
mov    0x18(%rsp),%r14
mov    0x10(%rsp),%r13
mov    0x8(%rsp),%r15d
jmp    15dd <main+0x42d>
movapd %xmm7,0x20(%rsp)
mov    0xc(%rsp),%r15d
mov    0x18(%rsp),%r14
mov    0x10(%rsp),%r13
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <utime@plt>
subsd  0x38(%rsp),%xmm0
movsd  %xmm0,(%rsp)
lea    0xa76(%rip),%rdi
call   1040 <puts@plt>
lea    0xaa0(%rip),%rdi
call   1040 <puts@plt>
lea    0xa9c(%rip),%rdi
call   1040 <puts@plt>
lea    0xa25(%rip),%rdi
movsd  (%rsp),%xmm0
mov    %ebx,%esi
mov    %r15d,%edx
movaps 0x20(%rsp),%xmm1
mov    $0x2,%al
call   1070 <printf@plt>
lea    0xa9e(%rip),%rdi
lea    0xa11(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     166a <main+0x4ba>
mov    %rax,%rbx
mov    %r13,%rdi
mov    $0x8,%esi
mov    %r14d,%edx
mov    %rax,%rcx
call   10c0 <fwrite@plt>
mov    %rbx,%rdi
call   1060 <fclose@plt>
jmp    167b <main+0x4cb>
lea    0xa57(%rip),%rdi
call   1040 <puts@plt>
mov    $0xffffffff,%ebp
mov    %ebp,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"-s\00"
@.str.1 = [3 x i8] c"-i\00"
@.str.2 = [11 x i8] c"input.data\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [36 x i8] c"can't not open the input.data file\0A\00"
@.str.5 = [28 x i8] c"sequence SOR processing...\0A\00"
@.str.6 = [55 x i8] c"\0A====================================================\0A\00"
@.str.7 = [9 x i8] c"Result:\0A\00"
@.str.8 = [29 x i8] c"\09TIME\09Vector_Size\09Loops\09Err\0A\00"
@.str.9 = [16 x i8] c"\09%f\09%d\09%d\09%.5e\0A\00"
@.str.10 = [21 x i8] c"sequence_output.data\00"
@.str.11 = [2 x i8] c"w\00"
@.str.12 = [37 x i8] c"can't not open sequence_output.data\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca double*
%11 = alloca i32
%12 = alloca i32*
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 128, i32* %9
store double 1.000000e-05, double* %15
store double 5.000000e-01, double* %14
store i32 100, i32* %11
%19 = load i32, i32* %4
%20 = icmp sgt i32 %19, 1
br i1 %20, label %21, label %68
21: ; preds = %2
store i32 1, i32* %6
br label %22
22: ; preds = %66, %21
%23 = load i32, i32* %6
%24 = load i32, i32* %4
%25 = icmp slt i32 %23, %24
br i1 %25, label %26, label %67
26: ; preds = %22
%27 = load i8**, i8*** %5
%28 = load i32, i32* %6
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8*, i8** %27, i64 %29
%31 = load i8*, i8** %30
%32 = call i64 @strcmp(i8* %31, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %45
34: ; preds = %26
%35 = load i8**, i8*** %5
%36 = load i32, i32* %6
%37 = add nsw i32 %36, 1
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i8*, i8** %35, i64 %38
%40 = load i8*, i8** %39
%41 = call i32 @atoi(i8* %40)
store i32 %41, i32* %9
%42 = load i32, i32* %9
store i32 %42, i32* %9
%43 = load i32, i32* %6
%44 = add nsw i32 %43, 2
store i32 %44, i32* %6
br label %66
45: ; preds = %26
%46 = load i8**, i8*** %5
%47 = load i32, i32* %6
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds i8*, i8** %46, i64 %48
%50 = load i8*, i8** %49
%51 = call i64 @strcmp(i8* %50, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%52 = icmp eq i64 %51, 0
br i1 %52, label %53, label %63
53: ; preds = %45
%54 = load i8**, i8*** %5
%55 = load i32, i32* %6
%56 = add nsw i32 %55, 1
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds i8*, i8** %54, i64 %57
%59 = load i8*, i8** %58
%60 = call i32 @atoi(i8* %59)
store i32 %60, i32* %11
%61 = load i32, i32* %6
%62 = add nsw i32 %61, 2
store i32 %62, i32* %6
br label %65
63: ; preds = %45
%64 = call i32 (...) @print_usage()
store i32 0, i32* %3
br label %429
65: ; preds = %53
br label %66
66: ; preds = %65, %34
br label %22
67: ; preds = %22
br label %68
68: ; preds = %67, %2
%69 = load i32, i32* %9
%70 = add nsw i32 %69, 2
%71 = sext i32 %70 to i64
%72 = mul i64 8, %71
%73 = load i32, i32* %9
%74 = add nsw i32 %73, 2
%75 = sext i32 %74 to i64
%76 = mul i64 %72, %75
%77 = trunc i64 %76 to i32
%78 = call double* @malloc(i32 %77)
store double* %78, double** %10
%79 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 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* %79, i32** %12
%80 = load i32*, i32** %12
%81 = icmp eq i32* %80, null
br i1 %81, label %82, label %84
82: ; preds = %68
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0))
store i32 -1, i32* %3
br label %429
84: ; preds = %68
%85 = load double*, double** %10
%86 = load i32, i32* %9
%87 = add nsw i32 %86, 2
%88 = load i32, i32* %9
%89 = add nsw i32 %88, 2
%90 = mul nsw i32 %87, %89
%91 = load i32*, i32** %12
%92 = call i32 @fread(double* %85, i32 8, i32 %90, i32* %91)
%93 = load i32*, i32** %12
%94 = call i32 @fclose(i32* %93)
%95 = load i32, i32* %9
%96 = add nsw i32 %95, 2
store i32 %96, i32* %18
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0))
%98 = call double (...) @utime()
%99 = fneg double %98
store double %99, double* %13
store i32 1, i32* %8
br label %100
100: ; preds = %398, %84
%101 = load i32, i32* %8
%102 = load i32, i32* %11
%103 = icmp slt i32 %101, %102
br i1 %103, label %104, label %401
104: ; preds = %100
store double 0.000000e+00, double* %17
store i32 1, i32* %6
br label %105
105: ; preds = %245, %104
%106 = load i32, i32* %6
%107 = load i32, i32* %9
%108 = icmp sle i32 %106, %107
br i1 %108, label %109, label %248
109: ; preds = %105
store i32 1, i32* %7
br label %110
110: ; preds = %241, %109
%111 = load i32, i32* %7
%112 = load i32, i32* %9
%113 = icmp sle i32 %111, %112
br i1 %113, label %114, label %244
114: ; preds = %110
%115 = load double*, double** %10
%116 = load i32, i32* %6
%117 = sub nsw i32 %116, 1
%118 = load i32, i32* %18
%119 = mul nsw i32 %117, %118
%120 = load i32, i32* %7
%121 = add nsw i32 %119, %120
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds double, double* %115, i64 %122
%124 = load double, double* %123
%125 = load double*, double** %10
%126 = load i32, i32* %6
%127 = add nsw i32 %126, 1
%128 = load i32, i32* %18
%129 = mul nsw i32 %127, %128
%130 = load i32, i32* %7
%131 = add nsw i32 %129, %130
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds double, double* %125, i64 %132
%134 = load double, double* %133
%135 = fadd double %124, %134
%136 = load double*, double** %10
%137 = load i32, i32* %6
%138 = load i32, i32* %18
%139 = mul nsw i32 %137, %138
%140 = load i32, i32* %7
%141 = add nsw i32 %139, %140
%142 = sub nsw i32 %141, 1
%143 = sext i32 %142 to i64
%144 = getelementptr inbounds double, double* %136, i64 %143
%145 = load double, double* %144
%146 = fadd double %135, %145
%147 = load double*, double** %10
%148 = load i32, i32* %6
%149 = load i32, i32* %18
%150 = mul nsw i32 %148, %149
%151 = load i32, i32* %7
%152 = add nsw i32 %150, %151
%153 = add nsw i32 %152, 1
%154 = sext i32 %153 to i64
%155 = getelementptr inbounds double, double* %147, i64 %154
%156 = load double, double* %155
%157 = fadd double %146, %156
%158 = load double*, double** %10
%159 = load i32, i32* %6
%160 = sub nsw i32 %159, 1
%161 = load i32, i32* %18
%162 = mul nsw i32 %160, %161
%163 = load i32, i32* %7
%164 = add nsw i32 %162, %163
%165 = sub nsw i32 %164, 1
%166 = sext i32 %165 to i64
%167 = getelementptr inbounds double, double* %158, i64 %166
%168 = load double, double* %167
%169 = fadd double %157, %168
%170 = load double*, double** %10
%171 = load i32, i32* %6
%172 = sub nsw i32 %171, 1
%173 = load i32, i32* %18
%174 = mul nsw i32 %172, %173
%175 = load i32, i32* %7
%176 = add nsw i32 %174, %175
%177 = add nsw i32 %176, 1
%178 = sext i32 %177 to i64
%179 = getelementptr inbounds double, double* %170, i64 %178
%180 = load double, double* %179
%181 = fadd double %169, %180
%182 = load double*, double** %10
%183 = load i32, i32* %6
%184 = add nsw i32 %183, 1
%185 = load i32, i32* %18
%186 = mul nsw i32 %184, %185
%187 = load i32, i32* %7
%188 = add nsw i32 %186, %187
%189 = sub nsw i32 %188, 1
%190 = sext i32 %189 to i64
%191 = getelementptr inbounds double, double* %182, i64 %190
%192 = load double, double* %191
%193 = fadd double %181, %192
%194 = load double*, double** %10
%195 = load i32, i32* %6
%196 = add nsw i32 %195, 1
%197 = load i32, i32* %18
%198 = mul nsw i32 %196, %197
%199 = load i32, i32* %7
%200 = add nsw i32 %198, %199
%201 = add nsw i32 %200, 1
%202 = sext i32 %201 to i64
%203 = getelementptr inbounds double, double* %194, i64 %202
%204 = load double, double* %203
%205 = fadd double %193, %204
%206 = load double*, double** %10
%207 = load i32, i32* %6
%208 = load i32, i32* %18
%209 = mul nsw i32 %207, %208
%210 = load i32, i32* %7
%211 = add nsw i32 %209, %210
%212 = sext i32 %211 to i64
%213 = getelementptr inbounds double, double* %206, i64 %212
%214 = load double, double* %213
%215 = fneg double %214
%216 = call double @llvm.fmuladd.f64(double 1.250000e-01, double %205, double %215)
store double %216, double* %16
%217 = load double, double* %14
%218 = load double, double* %16
%219 = load double*, double** %10
%220 = load i32, i32* %6
%221 = load i32, i32* %18
%222 = mul nsw i32 %220, %221
%223 = load i32, i32* %7
%224 = add nsw i32 %222, %223
%225 = sext i32 %224 to i64
%226 = getelementptr inbounds double, double* %219, i64 %225
%227 = load double, double* %226
%228 = call double @llvm.fmuladd.f64(double %217, double %218, double %227)
store double %228, double* %226
%229 = load double, double* %16
%230 = fcmp olt double %229, 0.000000e+00
br i1 %230, label %231, label %234
231: ; preds = %114
%232 = load double, double* %16
%233 = fneg double %232
store double %233, double* %16
br label %234
234: ; preds = %231, %114
%235 = load double, double* %16
%236 = load double, double* %17
%237 = fcmp ogt double %235, %236
br i1 %237, label %238, label %240
238: ; preds = %234
%239 = load double, double* %16
store double %239, double* %17
br label %240
240: ; preds = %238, %234
br label %241
241: ; preds = %240
%242 = load i32, i32* %7
%243 = add nsw i32 %242, 1
store i32 %243, i32* %7
br label %110
244: ; preds = %110
br label %245
245: ; preds = %244
%246 = load i32, i32* %6
%247 = add nsw i32 %246, 2
store i32 %247, i32* %6
br label %105
248: ; preds = %105
store i32 2, i32* %6
br label %249
249: ; preds = %389, %248
%250 = load i32, i32* %6
%251 = load i32, i32* %9
%252 = icmp sle i32 %250, %251
br i1 %252, label %253, label %392
253: ; preds = %249
store i32 1, i32* %7
br label %254
254: ; preds = %385, %253
%255 = load i32, i32* %7
%256 = load i32, i32* %9
%257 = icmp sle i32 %255, %256
br i1 %257, label %258, label %388
258: ; preds = %254
%259 = load double*, double** %10
%260 = load i32, i32* %6
%261 = sub nsw i32 %260, 1
%262 = load i32, i32* %18
%263 = mul nsw i32 %261, %262
%264 = load i32, i32* %7
%265 = add nsw i32 %263, %264
%266 = sext i32 %265 to i64
%267 = getelementptr inbounds double, double* %259, i64 %266
%268 = load double, double* %267
%269 = load double*, double** %10
%270 = load i32, i32* %6
%271 = add nsw i32 %270, 1
%272 = load i32, i32* %18
%273 = mul nsw i32 %271, %272
%274 = load i32, i32* %7
%275 = add nsw i32 %273, %274
%276 = sext i32 %275 to i64
%277 = getelementptr inbounds double, double* %269, i64 %276
%278 = load double, double* %277
%279 = fadd double %268, %278
%280 = load double*, double** %10
%281 = load i32, i32* %6
%282 = load i32, i32* %18
%283 = mul nsw i32 %281, %282
%284 = load i32, i32* %7
%285 = add nsw i32 %283, %284
%286 = sub nsw i32 %285, 1
%287 = sext i32 %286 to i64
%288 = getelementptr inbounds double, double* %280, i64 %287
%289 = load double, double* %288
%290 = fadd double %279, %289
%291 = load double*, double** %10
%292 = load i32, i32* %6
%293 = load i32, i32* %18
%294 = mul nsw i32 %292, %293
%295 = load i32, i32* %7
%296 = add nsw i32 %294, %295
%297 = add nsw i32 %296, 1
%298 = sext i32 %297 to i64
%299 = getelementptr inbounds double, double* %291, i64 %298
%300 = load double, double* %299
%301 = fadd double %290, %300
%302 = load double*, double** %10
%303 = load i32, i32* %6
%304 = sub nsw i32 %303, 1
%305 = load i32, i32* %18
%306 = mul nsw i32 %304, %305
%307 = load i32, i32* %7
%308 = add nsw i32 %306, %307
%309 = sub nsw i32 %308, 1
%310 = sext i32 %309 to i64
%311 = getelementptr inbounds double, double* %302, i64 %310
%312 = load double, double* %311
%313 = fadd double %301, %312
%314 = load double*, double** %10
%315 = load i32, i32* %6
%316 = sub nsw i32 %315, 1
%317 = load i32, i32* %18
%318 = mul nsw i32 %316, %317
%319 = load i32, i32* %7
%320 = add nsw i32 %318, %319
%321 = add nsw i32 %320, 1
%322 = sext i32 %321 to i64
%323 = getelementptr inbounds double, double* %314, i64 %322
%324 = load double, double* %323
%325 = fadd double %313, %324
%326 = load double*, double** %10
%327 = load i32, i32* %6
%328 = add nsw i32 %327, 1
%329 = load i32, i32* %18
%330 = mul nsw i32 %328, %329
%331 = load i32, i32* %7
%332 = add nsw i32 %330, %331
%333 = sub nsw i32 %332, 1
%334 = sext i32 %333 to i64
%335 = getelementptr inbounds double, double* %326, i64 %334
%336 = load double, double* %335
%337 = fadd double %325, %336
%338 = load double*, double** %10
%339 = load i32, i32* %6
%340 = add nsw i32 %339, 1
%341 = load i32, i32* %18
%342 = mul nsw i32 %340, %341
%343 = load i32, i32* %7
%344 = add nsw i32 %342, %343
%345 = add nsw i32 %344, 1
%346 = sext i32 %345 to i64
%347 = getelementptr inbounds double, double* %338, i64 %346
%348 = load double, double* %347
%349 = fadd double %337, %348
%350 = load double*, double** %10
%351 = load i32, i32* %6
%352 = load i32, i32* %18
%353 = mul nsw i32 %351, %352
%354 = load i32, i32* %7
%355 = add nsw i32 %353, %354
%356 = sext i32 %355 to i64
%357 = getelementptr inbounds double, double* %350, i64 %356
%358 = load double, double* %357
%359 = fneg double %358
%360 = call double @llvm.fmuladd.f64(double 1.250000e-01, double %349, double %359)
store double %360, double* %16
%361 = load double, double* %14
%362 = load double, double* %16
%363 = load double*, double** %10
%364 = load i32, i32* %6
%365 = load i32, i32* %18
%366 = mul nsw i32 %364, %365
%367 = load i32, i32* %7
%368 = add nsw i32 %366, %367
%369 = sext i32 %368 to i64
%370 = getelementptr inbounds double, double* %363, i64 %369
%371 = load double, double* %370
%372 = call double @llvm.fmuladd.f64(double %361, double %362, double %371)
store double %372, double* %370
%373 = load double, double* %16
%374 = fcmp olt double %373, 0.000000e+00
br i1 %374, label %375, label %378
375: ; preds = %258
%376 = load double, double* %16
%377 = fneg double %376
store double %377, double* %16
br label %378
378: ; preds = %375, %258
%379 = load double, double* %16
%380 = load double, double* %17
%381 = fcmp ogt double %379, %380
br i1 %381, label %382, label %384
382: ; preds = %378
%383 = load double, double* %16
store double %383, double* %17
br label %384
384: ; preds = %382, %378
br label %385
385: ; preds = %384
%386 = load i32, i32* %7
%387 = add nsw i32 %386, 1
store i32 %387, i32* %7
br label %254
388: ; preds = %254
br label %389
389: ; preds = %388
%390 = load i32, i32* %6
%391 = add nsw i32 %390, 2
store i32 %391, i32* %6
br label %249
392: ; preds = %249
%393 = load double, double* %17
%394 = load double, double* %15
%395 = fcmp ole double %393, %394
br i1 %395, label %396, label %397
396: ; preds = %392
br label %401
397: ; preds = %392
br label %398
398: ; preds = %397
%399 = load i32, i32* %8
%400 = add nsw i32 %399, 1
store i32 %400, i32* %8
br label %100
401: ; preds = %396, %100
%402 = call double (...) @utime()
%403 = load double, double* %13
%404 = fadd double %403, %402
store double %404, double* %13
%405 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.6, i64 0, i64 0))
%406 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
%407 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0))
%408 = load double, double* %13
%409 = load i32, i32* %9
%410 = load i32, i32* %8
%411 = load double, double* %17
%412 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), double %408, i32 %409, i32 %410, double %411)
%413 = call i32* @fopen(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
store i32* %413, i32** %12
%414 = load i32*, i32** %12
%415 = icmp eq i32* %414, null
br i1 %415, label %416, label %418
416: ; preds = %401
%417 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.12, i64 0, i64 0))
store i32 -1, i32* %3
br label %429
418: ; preds = %401
%419 = load double*, double** %10
%420 = load i32, i32* %9
%421 = add nsw i32 %420, 2
%422 = load i32, i32* %9
%423 = add nsw i32 %422, 2
%424 = mul nsw i32 %421, %423
%425 = load i32*, i32** %12
%426 = call i32 @fwrite(double* %419, i32 8, i32 %424, i32* %425)
%427 = load i32*, i32** %12
%428 = call i32 @fclose(i32* %427)
store i32 0, i32* %3
br label %429
429: ; preds = %418, %416, %82, %63
%430 = load i32, i32* %3
ret i32 %430
}

LLVM IR (-O2):
@.str = [3 x i8] c"-s\00"
@.str.1 = [3 x i8] c"-i\00"
@.str.2 = [11 x i8] c"input.data\00"
@.str.3 = [2 x i8] c"r\00"
@.str.9 = [16 x i8] c"\09%f\09%d\09%d\09%.5e\0A\00"
@.str.10 = [21 x i8] c"sequence_output.data\00"
@.str.11 = [2 x i8] c"w\00"
@str = [27 x i8] c"sequence SOR processing...\00"
@str.13 = [54 x i8] c"\0A====================================================\00"
@str.14 = [8 x i8] c"Result:\00"
@str.15 = [28 x i8] c"\09TIME\09Vector_Size\09Loops\09Err\00"
@str.16 = [36 x i8] c"can't not open sequence_output.data\00"
@str.17 = [35 x i8] c"can't not open the input.data file\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %34
4: ; preds = %2, %28
%5 = phi i64 [ %31, %28 ], [ 1, %2 ]
%6 = phi i32 [ %30, %28 ], [ 100, %2 ]
%7 = phi i32 [ %29, %28 ], [ 128, %2 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %5
%9 = load i8*, i8** %8
%10 = tail call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %4
%13 = add nuw nsw i64 %5, 1
%14 = getelementptr inbounds i8*, i8** %1, i64 %13
%15 = load i8*, i8** %14
%16 = tail call i32 @atoi(i8* %15)
br label %28
17: ; preds = %4
%18 = load i8*, i8** %8
%19 = tail call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %26
21: ; preds = %17
%22 = add nuw nsw i64 %5, 1
%23 = getelementptr inbounds i8*, i8** %1, i64 %22
%24 = load i8*, i8** %23
%25 = tail call i32 @atoi(i8* %24)
br label %28
26: ; preds = %17
%27 = tail call i32 (...) @print_usage()
br label %222
28: ; preds = %21, %12
%29 = phi i32 [ %16, %12 ], [ %7, %21 ]
%30 = phi i32 [ %6, %12 ], [ %25, %21 ]
%31 = add nuw i64 %5, 2
%32 = trunc i64 %31 to i32
%33 = icmp slt i32 %32, %0
br i1 %33, label %4, label %34
34: ; preds = %28, %2
%35 = phi i32 [ 128, %2 ], [ %29, %28 ]
%36 = phi i32 [ 100, %2 ], [ %30, %28 ]
%37 = add nsw i32 %35, 2
%38 = shl i32 %37, 3
%39 = mul i32 %38, %37
%40 = tail call double* @malloc(i32 %39)
%41 = tail call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%42 = icmp eq i32* %41, null
br i1 %42, label %43, label %45
43: ; preds = %34
%44 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.17, i64 0, i64 0))
br label %222
45: ; preds = %34
%46 = mul nsw i32 %37, %37
%47 = tail call i32 @fread(double* %40, i32 8, i32 %46, i32* %41)
%48 = tail call i32 @fclose(i32* %41)
%49 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%50 = tail call double (...) @utime()
%51 = icmp sgt i32 %36, 1
br i1 %51, label %52, label %206
52: ; preds = %45
%53 = icmp slt i32 %35, 1
%54 = icmp slt i32 %35, 2
%55 = add i32 %35, 1
%56 = sext i32 %37 to i64
%57 = sext i32 %35 to i64
%58 = zext i32 %55 to i64
%59 = zext i32 %55 to i64
%60 = getelementptr double, double* %40, i64 %56
%61 = bitcast double* %60 to i8*
%62 = shl nsw i64 %57, 4
%63 = add nsw i64 %62, 32
%64 = shl nsw i64 %57, 1
%65 = add nsw i64 %64, 4
%66 = getelementptr double, double* %40, i64 %65
%67 = bitcast double* %66 to i8*
%68 = shl nsw i64 %57, 4
%69 = add nsw i64 %68, 32
br label %70
70: ; preds = %52, %203
%71 = phi i32 [ 1, %52 ], [ %204, %203 ]
br i1 %53, label %72, label %74
72: ; preds = %132, %70
%73 = phi double [ 0.000000e+00, %70 ], [ %129, %132 ]
br i1 %54, label %200, label %136
74: ; preds = %70, %132
%75 = phi i64 [ %135, %132 ], [ 0, %70 ]
%76 = phi i64 [ %133, %132 ], [ 1, %70 ]
%77 = phi double [ %129, %132 ], [ 0.000000e+00, %70 ]
%78 = mul i64 %63, %75
%79 = getelementptr i8, i8* %61, i64 %78
%80 = bitcast i8* %79 to double*
%81 = add nsw i64 %76, -1
%82 = mul nsw i64 %81, %56
%83 = add nuw nsw i64 %76, 1
%84 = mul nsw i64 %83, %56
%85 = mul nsw i64 %76, %56
%86 = load double, double* %80
br label %87
87: ; preds = %74, %87
%88 = phi double [ %86, %74 ], [ %124, %87 ]
%89 = phi i64 [ 1, %74 ], [ %130, %87 ]
%90 = phi double [ %77, %74 ], [ %129, %87 ]
%91 = add nsw i64 %89, %82
%92 = getelementptr inbounds double, double* %40, i64 %91
%93 = load double, double* %92
%94 = add nsw i64 %89, %84
%95 = getelementptr inbounds double, double* %40, i64 %94
%96 = load double, double* %95
%97 = fadd double %93, %96
%98 = add nsw i64 %89, %85
%99 = fadd double %97, %88
%100 = add nsw i64 %98, 1
%101 = getelementptr inbounds double, double* %40, i64 %100
%102 = load double, double* %101
%103 = fadd double %99, %102
%104 = add nsw i64 %91, -1
%105 = getelementptr inbounds double, double* %40, i64 %104
%106 = load double, double* %105
%107 = fadd double %103, %106
%108 = add nsw i64 %91, 1
%109 = getelementptr inbounds double, double* %40, i64 %108
%110 = load double, double* %109
%111 = fadd double %107, %110
%112 = add nsw i64 %94, -1
%113 = getelementptr inbounds double, double* %40, i64 %112
%114 = load double, double* %113
%115 = fadd double %111, %114
%116 = add nsw i64 %94, 1
%117 = getelementptr inbounds double, double* %40, i64 %116
%118 = load double, double* %117
%119 = fadd double %115, %118
%120 = getelementptr inbounds double, double* %40, i64 %98
%121 = load double, double* %120
%122 = fneg double %121
%123 = tail call double @llvm.fmuladd.f64(double %119, double 1.250000e-01, double %122)
%124 = tail call double @llvm.fmuladd.f64(double %123, double 5.000000e-01, double %121)
store double %124, double* %120
%125 = fcmp olt double %123, 0.000000e+00
%126 = fneg double %123
%127 = select i1 %125, double %126, double %123
%128 = fcmp ogt double %127, %90
%129 = select i1 %128, double %127, double %90
%130 = add nuw nsw i64 %89, 1
%131 = icmp eq i64 %130, %58
br i1 %131, label %132, label %87
132: ; preds = %87
%133 = add nuw nsw i64 %76, 2
%134 = icmp sgt i64 %133, %57
%135 = add i64 %75, 1
br i1 %134, label %72, label %74
136: ; preds = %72, %195
%137 = phi i64 [ %199, %195 ], [ 0, %72 ]
%138 = phi i64 [ %197, %195 ], [ 2, %72 ]
%139 = phi double [ %196, %195 ], [ %73, %72 ]
br i1 %53, label %195, label %140
140: ; preds = %136
%141 = mul i64 %69, %137
%142 = getelementptr i8, i8* %67, i64 %141
%143 = bitcast i8* %142 to double*
%144 = add nsw i64 %138, -1
%145 = mul nsw i64 %144, %56
%146 = or i64 %138, 1
%147 = mul nsw i64 %146, %56
%148 = mul nsw i64 %138, %56
%149 = load double, double* %143
br label %150
150: ; preds = %140, %150
%151 = phi double [ %149, %140 ], [ %187, %150 ]
%152 = phi i64 [ 1, %140 ], [ %193, %150 ]
%153 = phi double [ %139, %140 ], [ %192, %150 ]
%154 = add nsw i64 %152, %145
%155 = getelementptr inbounds double, double* %40, i64 %154
%156 = load double, double* %155
%157 = add nsw i64 %152, %147
%158 = getelementptr inbounds double, double* %40, i64 %157
%159 = load double, double* %158
%160 = fadd double %156, %159
%161 = add nsw i64 %152, %148
%162 = fadd double %160, %151
%163 = add nsw i64 %161, 1
%164 = getelementptr inbounds double, double* %40, i64 %163
%165 = load double, double* %164
%166 = fadd double %162, %165
%167 = add nsw i64 %154, -1
%168 = getelementptr inbounds double, double* %40, i64 %167
%169 = load double, double* %168
%170 = fadd double %166, %169
%171 = add nsw i64 %154, 1
%172 = getelementptr inbounds double, double* %40, i64 %171
%173 = load double, double* %172
%174 = fadd double %170, %173
%175 = add nsw i64 %157, -1
%176 = getelementptr inbounds double, double* %40, i64 %175
%177 = load double, double* %176
%178 = fadd double %174, %177
%179 = add nsw i64 %157, 1
%180 = getelementptr inbounds double, double* %40, i64 %179
%181 = load double, double* %180
%182 = fadd double %178, %181
%183 = getelementptr inbounds double, double* %40, i64 %161
%184 = load double, double* %183
%185 = fneg double %184
%186 = tail call double @llvm.fmuladd.f64(double %182, double 1.250000e-01, double %185)
%187 = tail call double @llvm.fmuladd.f64(double %186, double 5.000000e-01, double %184)
store double %187, double* %183
%188 = fcmp olt double %186, 0.000000e+00
%189 = fneg double %186
%190 = select i1 %188, double %189, double %186
%191 = fcmp ogt double %190, %153
%192 = select i1 %191, double %190, double %153
%193 = add nuw nsw i64 %152, 1
%194 = icmp eq i64 %193, %59
br i1 %194, label %195, label %150
195: ; preds = %150, %136
%196 = phi double [ %139, %136 ], [ %192, %150 ]
%197 = add nuw nsw i64 %138, 2
%198 = icmp sgt i64 %197, %57
%199 = add i64 %137, 1
br i1 %198, label %200, label %136
200: ; preds = %195, %72
%201 = phi double [ %73, %72 ], [ %196, %195 ]
%202 = fcmp ugt double %201, 1.000000e-05
br i1 %202, label %203, label %206
203: ; preds = %200
%204 = add nuw nsw i32 %71, 1
%205 = icmp eq i32 %204, %36
br i1 %205, label %206, label %70
206: ; preds = %203, %200, %45
%207 = phi i32 [ 1, %45 ], [ %71, %200 ], [ %36, %203 ]
%208 = phi double [ undef, %45 ], [ %201, %200 ], [ %201, %203 ]
%209 = tail call double (...) @utime()
%210 = fsub double %209, %50
%211 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.13, i64 0, i64 0))
%212 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.14, i64 0, i64 0))
%213 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.15, i64 0, i64 0))
%214 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), double %210, i32 %35, i32 %207, double %208)
%215 = tail call i32* @fopen(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%216 = icmp eq i32* %215, null
br i1 %216, label %217, label %219
217: ; preds = %206
%218 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.16, i64 0, i64 0))
br label %222
219: ; preds = %206
%220 = tail call i32 @fwrite(double* %40, i32 8, i32 %46, i32* %215)
%221 = tail call i32 @fclose(i32* %215)
br label %222
222: ; preds = %219, %217, %43, %26
%223 = phi i32 [ 0, %26 ], [ -1, %43 ], [ -1, %217 ], [ 0, %219 ]
ret i32 %223
}