#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 */

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  unsigned int rows, columns;
  scanf("%d", &rows);
  columns = rows + 1;
  assert(rows < 1000);
  assert(columns < 1000);
  double matrix[1000][1000];
  int i, j;
  for (i = 0; i < rows; i++) {
    for (j = 0; j < columns; j++) {
      scanf("%lf", &matrix[i][j]);
    }
  }
  double pivot, coefficient, swap;
  int k, l, m, flag;
  int temp1, temp2;
  for (i = 0; i < rows; i++) {
    printf("\nRow %d\n------\n", i);
    if (matrix[i][i] == 0) {
      flag = 0;
      for (l = i + 1; l < rows; l++) {
        if (matrix[l][i] != 0) {
          flag = 1;
          for (m = i; m < columns; m++) {
            swap = matrix[l][m];
            matrix[l][m] = matrix[i][m];
            matrix[i][m] = swap;
          }
          printf("Pivoting row %d with row %d\n\n", i, l);
          for (temp1 = 0; temp1 < rows; temp1++) {
            for (temp2 = 0; temp2 < columns; temp2++) {
              printf("%lf\t", matrix[temp1][temp2]);
            }
            printf("\n");
          }
          printf("\n");
          break;
        }
      }
      if (!flag) {
        printf("Cannot pivot. Exiting");
        exit(1);
      }
    }
    pivot = matrix[i][i];
    for (j = i + 1; j < rows; j++) {
      coefficient = matrix[j][i] / pivot;
      matrix[j][i] = 0;
      for (k = i + 1; k < columns; k++) {
        matrix[j][k] -= coefficient * matrix[i][k];
      }
      for (temp1 = 0; temp1 < rows; temp1++) {
        for (temp2 = 0; temp2 < columns; temp2++) {
          printf("%lf\t", matrix[temp1][temp2]);
        }
        printf("\n");
      }
      printf("\n");
    }
  }
  double result[rows];
  double sum;
  for (i = rows - 1; i >= 0; i--) {
    sum = matrix[i][columns - 1];
    for (j = rows - 1; j > i; j--) {
      sum -= matrix[i][j] * result[j];
    }
    result[i] = sum / matrix[i][i];
  }
  for (i = 0; i < rows; i++) {
    printf("\nValue of x[%d] is %lf", i + 1, result[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7a1270,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xea7(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cmpl   $0x3e8,-0xc(%rbp)
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
movl   $0x0,-0x7a1214(%rbp)
mov    -0x7a1214(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    1228 <main+0xe8>
movl   $0x0,-0x7a1218(%rbp)
mov    -0x7a1218(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    120f <main+0xcf>
movslq -0x7a1214(%rbp),%rax
lea    -0x7a1210(%rbp),%rsi
imul   $0x1f40,%rax,%rax
add    %rax,%rsi
movslq -0x7a1218(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
lea    0xe6b(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x7a1218(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7a1218(%rbp)
jmp    11b8 <main+0x78>
jmp    1214 <main+0xd4>
mov    -0x7a1214(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7a1214(%rbp)
jmp    119f <main+0x5f>
movl   $0x0,-0x7a1214(%rbp)
mov    -0x7a1214(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    16f3 <main+0x5b3>
mov    -0x7a1214(%rbp),%esi
lea    0xdb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x7a1214(%rbp),%rcx
lea    -0x7a1210(%rbp),%rax
imul   $0x1f40,%rcx,%rcx
add    %rcx,%rax
movslq -0x7a1214(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    14d3 <main+0x393>
jp     14d3 <main+0x393>
movl   $0x0,-0x7a1240(%rbp)
mov    -0x7a1214(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7a1238(%rbp)
mov    -0x7a1238(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    14a9 <main+0x369>
movslq -0x7a1238(%rbp),%rcx
lea    -0x7a1210(%rbp),%rax
imul   $0x1f40,%rcx,%rcx
add    %rcx,%rax
movslq -0x7a1214(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    12f0 <main+0x1b0>
jp     12f0 <main+0x1b0>
jmp    1490 <main+0x350>
movl   $0x1,-0x7a1240(%rbp)
mov    -0x7a1214(%rbp),%eax
mov    %eax,-0x7a123c(%rbp)
mov    -0x7a123c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    13c9 <main+0x289>
movslq -0x7a1238(%rbp),%rcx
lea    -0x7a1210(%rbp),%rax
imul   $0x1f40,%rcx,%rcx
add    %rcx,%rax
movslq -0x7a123c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x7a1230(%rbp)
ff
movslq -0x7a1214(%rbp),%rcx
lea    -0x7a1210(%rbp),%rax
imul   $0x1f40,%rcx,%rcx
add    %rcx,%rax
movslq -0x7a123c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movslq -0x7a1238(%rbp),%rcx
lea    -0x7a1210(%rbp),%rax
imul   $0x1f40,%rcx,%rcx
add    %rcx,%rax
movslq -0x7a123c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x7a1230(%rbp),%xmm0
ff
movslq -0x7a1214(%rbp),%rcx
lea    -0x7a1210(%rbp),%rax
imul   $0x1f40,%rcx,%rcx
add    %rcx,%rax
movslq -0x7a123c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x7a123c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7a123c(%rbp)
jmp    1306 <main+0x1c6>
mov    -0x7a1214(%rbp),%esi
mov    -0x7a1238(%rbp),%edx
lea    0xc37(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x7a1244(%rbp)
mov    -0x7a1244(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    147d <main+0x33d>
movl   $0x0,-0x7a1248(%rbp)
mov    -0x7a1248(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    145b <main+0x31b>
movslq -0x7a1244(%rbp),%rcx
lea    -0x7a1210(%rbp),%rax
imul   $0x1f40,%rcx,%rcx
add    %rcx,%rax
movslq -0x7a1248(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xbf1(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x7a1248(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7a1248(%rbp)
jmp    1406 <main+0x2c6>
lea    0xbcd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x7a1244(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7a1244(%rbp)
jmp    13ed <main+0x2ad>
lea    0xbab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    14a9 <main+0x369>
jmp    1495 <main+0x355>
mov    -0x7a1238(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7a1238(%rbp)
jmp    12a5 <main+0x165>
cmpl   $0x0,-0x7a1240(%rbp)
jne    14ce <main+0x38e>
lea    0xb79(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
jmp    14d3 <main+0x393>
movslq -0x7a1214(%rbp),%rcx
lea    -0x7a1210(%rbp),%rax
imul   $0x1f40,%rcx,%rcx
add    %rcx,%rax
movslq -0x7a1214(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x7a1220(%rbp)
ff
mov    -0x7a1214(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7a1218(%rbp)
mov    -0x7a1218(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    16da <main+0x59a>
movslq -0x7a1218(%rbp),%rcx
lea    -0x7a1210(%rbp),%rax
imul   $0x1f40,%rcx,%rcx
add    %rcx,%rax
movslq -0x7a1214(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
divsd  -0x7a1220(%rbp),%xmm0
ff
movsd  %xmm0,-0x7a1228(%rbp)
ff
movslq -0x7a1218(%rbp),%rcx
lea    -0x7a1210(%rbp),%rax
imul   $0x1f40,%rcx,%rcx
add    %rcx,%rax
movslq -0x7a1214(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x7a1214(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7a1234(%rbp)
mov    -0x7a1234(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    161e <main+0x4de>
movsd  -0x7a1228(%rbp),%xmm0
ff
movslq -0x7a1214(%rbp),%rcx
lea    -0x7a1210(%rbp),%rax
imul   $0x1f40,%rcx,%rcx
add    %rcx,%rax
movslq -0x7a1234(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movslq -0x7a1218(%rbp),%rcx
lea    -0x7a1210(%rbp),%rax
imul   $0x1f40,%rcx,%rcx
add    %rcx,%rax
movslq -0x7a1234(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movq   %xmm0,%rdx
movabs $0x8000000000000000,%rsi
xor    %rsi,%rdx
movq   %rdx,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x7a1234(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7a1234(%rbp)
jmp    1587 <main+0x447>
movl   $0x0,-0x7a1244(%rbp)
mov    -0x7a1244(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    16b8 <main+0x578>
movl   $0x0,-0x7a1248(%rbp)
mov    -0x7a1248(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1696 <main+0x556>
movslq -0x7a1244(%rbp),%rcx
lea    -0x7a1210(%rbp),%rax
imul   $0x1f40,%rcx,%rcx
add    %rcx,%rax
movslq -0x7a1248(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0x9b6(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x7a1248(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7a1248(%rbp)
jmp    1641 <main+0x501>
lea    0x992(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x7a1244(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7a1244(%rbp)
jmp    1628 <main+0x4e8>
lea    0x970(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x7a1218(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7a1218(%rbp)
jmp    150e <main+0x3ce>
jmp    16df <main+0x59f>
mov    -0x7a1214(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7a1214(%rbp)
jmp    1232 <main+0xf2>
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x7a1250(%rbp)
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x7a1268(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x7a1258(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x7a1214(%rbp)
cmpl   $0x0,-0x7a1214(%rbp)
jl     1854 <main+0x714>
movslq -0x7a1214(%rbp),%rcx
lea    -0x7a1210(%rbp),%rax
imul   $0x1f40,%rcx,%rcx
add    %rcx,%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
mov    %ecx,%ecx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x7a1260(%rbp)
ff
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x7a1218(%rbp)
mov    -0x7a1218(%rbp),%eax
cmp    -0x7a1214(%rbp),%eax
jle    1801 <main+0x6c1>
mov    -0x7a1268(%rbp),%rax
movslq -0x7a1214(%rbp),%rdx
lea    -0x7a1210(%rbp),%rcx
imul   $0x1f40,%rdx,%rdx
add    %rdx,%rcx
movslq -0x7a1218(%rbp),%rdx
movsd  (%rcx,%rdx,8),%xmm0
movslq -0x7a1218(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x7a1260(%rbp),%xmm1
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x7a1260(%rbp)
ff
mov    -0x7a1218(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x7a1218(%rbp)
jmp    1775 <main+0x635>
mov    -0x7a1268(%rbp),%rax
movsd  -0x7a1260(%rbp),%xmm0
ff
movslq -0x7a1214(%rbp),%rdx
lea    -0x7a1210(%rbp),%rcx
imul   $0x1f40,%rdx,%rdx
add    %rdx,%rcx
movslq -0x7a1214(%rbp),%rdx
divsd  (%rcx,%rdx,8),%xmm0
movslq -0x7a1214(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x7a1214(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x7a1214(%rbp)
jmp    172f <main+0x5ef>
movl   $0x0,-0x7a1214(%rbp)
mov    -0x7a1214(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    18ab <main+0x76b>
mov    -0x7a1268(%rbp),%rax
mov    -0x7a1214(%rbp),%esi
add    $0x1,%esi
movslq -0x7a1214(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0x7bc(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x7a1214(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7a1214(%rbp)
jmp    185e <main+0x71e>
movl   $0x0,-0x4(%rbp)
mov    -0x7a1250(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x7a12e8,%rsp
lea    0xea5(%rip),%rdi
xor    %r15d,%r15d
lea    -0x2c(%rbp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    -0x2c(%rbp),%eax
xor    %edi,%edi
cmp    $0x3e8,%rax
setb   %dil
mov    %rax,-0xd8(%rbp)
lea    0x1(%rax),%ebx
call   1050 <assert@plt>
xor    %edi,%edi
mov    %ebx,-0x30(%rbp)
cmp    $0x3e8,%ebx
setb   %dil
call   1050 <assert@plt>
mov    -0x2c(%rbp),%eax
test   %eax,%eax
je     1966 <main+0x816>
mov    -0x30(%rbp),%r13d
lea    -0x7a1310(%rbp),%rbx
lea    0xea7(%rip),%r14
xor    %r12d,%r12d
jmp    11e6 <main+0x96>
nopl   (%rax)
add    $0x1,%r12
mov    %eax,%ecx
mov    -0x38(%rbp),%rbx
add    $0x1f40,%rbx
cmp    %rcx,%r12
jae    121c <main+0xcc>
mov    %r13,%r15
mov    %rbx,-0x38(%rbp)
cmpl   $0x0,-0x30(%rbp)
je     11d0 <main+0x80>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
add    $0x8,%rbx
add    $0xffffffffffffffff,%r15
jne    1200 <main+0xb0>
mov    -0x2c(%rbp),%eax
jmp    11d0 <main+0x80>
test   %eax,%eax
je     1963 <main+0x813>
lea    -0x7a1310(,%r13,8),%rax
ff
add    %rbp,%rax
mov    %rax,-0xd0(%rbp)
mov    %r13,%rax
neg    %rax
mov    %rax,-0xb8(%rbp)
lea    -0x79f3d0(%rbp),%rax
mov    %rax,-0xa8(%rbp)
lea    -0x5(%r13),%rax
mov    %rax,-0xa0(%rbp)
lea    -0x7a12d8(%rbp),%rax
lea    -0x1(%r13),%rcx
mov    %rcx,-0x98(%rbp)
lea    -0x7a12f8(%rbp),%rcx
lea    -0x79f3b8(%rbp),%rdx
mov    %rdx,-0x90(%rbp)
lea    -0x79f3c8(%rbp),%rdx
mov    %rdx,-0x88(%rbp)
mov    $0x1,%edx
mov    %rdx,-0x48(%rbp)
lea    -0x7a1310(%rbp),%r12
lea    0xd99(%rip),%r14
mov    %rax,%rdx
xor    %r8d,%r8d
jmp    1313 <main+0x1c3>
mov    -0x60(%rbp),%rax
mov    -0x68(%rbp),%rcx
mov    -0x58(%rbp),%rdx
addq   $0x1,-0x48(%rbp)
addq   $0x1f48,-0xa8(%rbp)
addq   $0xffffffffffffffff,-0xa0(%rbp)
ff
add    $0x8,%rdx
add    $0x1f48,%rax
add    $0x1f40,%r12
addq   $0xffffffffffffffff,-0x98(%rbp)
ff
add    $0x1f48,%rcx
addq   $0x1f48,-0x90(%rbp)
addq   $0x1f40,-0x88(%rbp)
cmp    %r15,%r8
jae    1966 <main+0x816>
mov    %rdx,-0x58(%rbp)
mov    %rcx,-0x68(%rbp)
mov    %rax,-0x60(%rbp)
mov    %r8,%rbx
mov    %r8,%rax
not    %rax
mov    %rax,-0x38(%rbp)
add    %r13,%rax
mov    %rax,-0x40(%rbp)
imul   $0x3e9,%r8,%rax
mov    %rax,-0xb0(%rbp)
lea    -0x7a1308(,%rax,8),%rax
ff
add    %rbp,%rax
mov    %rax,-0x70(%rbp)
imul   $0x1f40,%r8,%rax
lea    (%rax,%rbp,1),%r15
add    $0xffffffffff85ecf0,%r15
lea    (%r15,%r13,8),%rax
mov    %rax,-0x78(%rbp)
lea    0xca2(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rsi
xorpd  %xmm1,%xmm1
movsd  (%r15,%rbx,8),%xmm0
movsd  %xmm0,-0x80(%rbp)
ucomisd %xmm1,%xmm0
mov    %r12,-0xc8(%rbp)
mov    %rbx,-0xc0(%rbp)
mov    %r15,-0x50(%rbp)
jne    16c5 <main+0x575>
jp     16c5 <main+0x575>
mov    %r15,%rcx
mov    -0xa0(%rbp),%rdi
shr    $0x2,%rdi
add    $0x1,%rdi
and    $0xfffffffffffffffe,%rdi
mov    -0x38(%rbp),%rax
lea    (%rax,%r13,1),%r11
add    $0xfffffffffffffffc,%r11
mov    %r11,%r15
shr    $0x2,%r15
add    $0x1,%r15
mov    -0x48(%rbp),%rax
lea    -0x7a1310(,%rax,8),%r10
ff
add    %rbp,%r10
lea    (%rcx,%rsi,8),%rbx
mov    -0x2c(%rbp),%eax
mov    -0xa8(%rbp),%rcx
mov    %rsi,%rdx
nopl   0x0(%rax,%rax,1)
add    $0x1,%rdx
cmp    %rax,%rdx
jae    1a82 <main+0x932>
movsd  (%rcx),%xmm0
add    $0x1f40,%rcx
ucomisd %xmm1,%xmm0
jne    1420 <main+0x2d0>
jnp    1400 <main+0x2b0>
mov    %rbx,-0x38(%rbp)
mov    %rsi,%rbx
cmp    %r13,%rsi
jae    1620 <main+0x4d0>
mov    %edx,%eax
imul   $0x1f40,%rax,%rax
lea    (%rax,%rbp,1),%r8
add    $0xffffffffff85ecf0,%r8
mov    %rbx,%rsi
movsd  (%r8,%rbx,8),%xmm0
movsd  -0x80(%rbp),%xmm1
movsd  %xmm1,(%r8,%rbx,8)
mov    -0x50(%rbp),%rcx
movsd  %xmm0,(%rcx,%rbx,8)
lea    0x1(%rbx),%r9
cmp    %r13,%r9
je     1620 <main+0x4d0>
cmpq   $0x4,-0x40(%rbp)
jae    150e <main+0x3be>
mov    %r13d,%ecx
sub    %r9d,%ecx
mov    %r9,%rax
test   $0x1,%cl
je     14a7 <main+0x357>
mov    -0x50(%rbp),%rax
movsd  (%rax,%r9,8),%xmm0
movsd  (%r8,%r9,8),%xmm1
movsd  %xmm0,(%r8,%r9,8)
movsd  %xmm1,(%rax,%r9,8)
lea    0x1(%r9),%rax
not    %r9
cmp    -0xb8(%rbp),%r9
je     1620 <main+0x4d0>
mov    %edx,%ecx
imul   $0x1f40,%rcx,%rcx
lea    -0x7a1308(%rbp),%rsi
add    %rsi,%rcx
nopw   0x0(%rax,%rax,1)
movsd  (%r12,%rax,8),%xmm0
movsd  -0x8(%rcx,%rax,8),%xmm1
movsd  %xmm0,-0x8(%rcx,%rax,8)
movsd  %xmm1,(%r12,%rax,8)
movsd  0x8(%r12,%rax,8),%xmm0
movsd  (%rcx,%rax,8),%xmm1
movsd  %xmm0,(%rcx,%rax,8)
movsd  %xmm1,0x8(%r12,%rax,8)
add    $0x2,%rax
cmp    %rax,%r13
jne    14d0 <main+0x380>
jmp    1620 <main+0x4d0>
add    %rax,%r10
add    -0xd0(%rbp),%rax
cmp    -0x78(%rbp),%r10
setb   %cl
cmp    %rax,-0x70(%rbp)
setb   %al
and    %cl,%al
test   %al,%al
jne    1479 <main+0x329>
jne    1479 <main+0x329>
mov    -0x78(%rbp),%rax
cmp    %rax,-0x70(%rbp)
jb     1479 <main+0x329>
cmp    $0x4,%r11
jae    1551 <main+0x401>
xor    %eax,%eax
jmp    15ce <main+0x47e>
mov    %edx,%eax
imul   $0x1f40,%rax,%rcx
add    -0x58(%rbp),%rcx
xor    %eax,%eax
mov    -0x60(%rbp),%rsi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movups -0x30(%rsi,%rax,8),%xmm0
movups -0x20(%rsi,%rax,8),%xmm1
movups -0x30(%rcx,%rax,8),%xmm2
movups -0x20(%rcx,%rax,8),%xmm3
movups %xmm0,-0x30(%rcx,%rax,8)
movups %xmm1,-0x20(%rcx,%rax,8)
movups %xmm2,-0x30(%rsi,%rax,8)
movups %xmm3,-0x20(%rsi,%rax,8)
movupd -0x10(%rsi,%rax,8),%xmm0
movupd (%rsi,%rax,8),%xmm1
movupd -0x10(%rcx,%rax,8),%xmm2
movupd (%rcx,%rax,8),%xmm3
movupd %xmm0,-0x10(%rcx,%rax,8)
movupd %xmm1,(%rcx,%rax,8)
movupd %xmm2,-0x10(%rsi,%rax,8)
movupd %xmm3,(%rsi,%rax,8)
add    $0x8,%rax
add    $0xfffffffffffffffe,%rdi
jne    1570 <main+0x420>
mov    -0x40(%rbp),%rcx
and    $0xfffffffffffffffc,%rcx
test   $0x1,%r15b
je     1613 <main+0x4c3>
add    %r9,%rax
mov    -0x50(%rbp),%rsi
movupd (%rsi,%rax,8),%xmm0
movupd 0x10(%rsi,%rax,8),%xmm1
movupd (%r8,%rax,8),%xmm2
movupd 0x10(%r8,%rax,8),%xmm3
movupd %xmm0,(%r8,%rax,8)
movupd %xmm1,0x10(%r8,%rax,8)
movupd %xmm2,(%rsi,%rax,8)
movupd %xmm3,0x10(%rsi,%rax,8)
cmp    %rcx,-0x40(%rbp)
jne    195b <main+0x80b>
nopl   (%rax)
lea    0x9fc(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0x0,-0x2c(%rbp)
je     16a0 <main+0x550>
lea    -0x7a1310(%rbp),%r12
xor    %r15d,%r15d
jmp    166d <main+0x51d>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r15
mov    -0x2c(%rbp),%eax
add    $0x1f40,%r12
cmp    %rax,%r15
jae    16a0 <main+0x550>
cmpl   $0x0,-0x30(%rbp)
je     1650 <main+0x500>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
movsd  (%r12,%rbx,8),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1680 <main+0x530>
jmp    1650 <main+0x500>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x38(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0xc8(%rbp),%r12
mov    -0xc0(%rbp),%rsi
lea    0x1(%rsi),%r8
mov    -0x2c(%rbp),%r15d
cmp    %r15,%r8
jae    12b0 <main+0x160>
mov    -0x98(%rbp),%rax
and    $0xfffffffffffffffc,%rax
mov    %rax,-0xf0(%rbp)
addq   $0x1,-0xb0(%rbp)
01
mov    -0x40(%rbp),%rcx
and    $0xfffffffffffffffc,%rcx
mov    -0x48(%rbp),%rax
mov    %rcx,-0xe8(%rbp)
add    %rax,%rcx
mov    %rcx,-0xe0(%rbp)
mov    -0x88(%rbp),%rdi
mov    -0x90(%rbp),%rbx
xor    %r9d,%r9d
mov    %r8,-0xf8(%rbp)
jmp    178b <main+0x63b>
nopw   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x100(%rbp),%rax
add    $0x1,%rax
mov    -0x2c(%rbp),%r15d
mov    -0x108(%rbp),%r9
add    $0x1,%r9
mov    -0x110(%rbp),%rbx
add    $0x1f40,%rbx
mov    -0x38(%rbp),%rdi
add    $0x1f40,%rdi
cmp    %r15,%rax
mov    -0xc8(%rbp),%r12
mov    -0xc0(%rbp),%rsi
mov    -0xf8(%rbp),%r8
jae    12b0 <main+0x160>
mov    %rax,-0x100(%rbp)
imul   $0x1f40,%rax,%rax
add    %rbp,%rax
add    $0xffffffffff85ecf0,%rax
movsd  (%rax,%rsi,8),%xmm0
movq   $0x0,(%rax,%rsi,8)
cmp    %r13,%r8
jae    18e4 <main+0x794>
xorpd  0x840(%rip),%xmm0
divsd  -0x80(%rbp),%xmm0
mov    -0x48(%rbp),%rcx
cmpq   $0x4,-0x40(%rbp)
jb     1870 <main+0x720>
imul   $0x1f40,%r9,%rcx
lea    -0x7a1310(%rbp),%rdx
add    %rdx,%rcx
mov    -0xb0(%rbp),%rdx
lea    (%rcx,%rdx,8),%rcx
add    $0x1f40,%rcx
cmp    -0x78(%rbp),%rcx
jae    180b <main+0x6bb>
lea    (%rax,%r13,8),%rdx
mov    -0x48(%rbp),%rcx
cmp    %rdx,-0x70(%rbp)
jb     1870 <main+0x720>
movapd %xmm0,%xmm1
unpcklpd %xmm0,%xmm1
xor    %ecx,%ecx
mov    -0x68(%rbp),%rdx
mov    -0xf0(%rbp),%rsi
movupd -0x10(%rdx,%rcx,8),%xmm2
movupd (%rdx,%rcx,8),%xmm3
movupd -0x10(%rbx,%rcx,8),%xmm4
movupd (%rbx,%rcx,8),%xmm5
mulpd  %xmm1,%xmm2
addpd  %xmm4,%xmm2
mulpd  %xmm1,%xmm3
addpd  %xmm5,%xmm3
movupd %xmm2,-0x10(%rbx,%rcx,8)
movupd %xmm3,(%rbx,%rcx,8)
add    $0x4,%rcx
cmp    %rcx,%rsi
jne    1820 <main+0x6d0>
mov    -0xe0(%rbp),%rcx
mov    -0xe8(%rbp),%rdx
cmp    %rdx,-0x40(%rbp)
je     18e4 <main+0x794>
xchg   %ax,%ax
mov    %r13d,%esi
sub    %ecx,%esi
mov    %rcx,%rdx
test   $0x1,%sil
je     1899 <main+0x749>
mov    -0x50(%rbp),%rdx
movsd  (%rdx,%rcx,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rax,%rcx,8),%xmm1
movsd  %xmm1,(%rax,%rcx,8)
lea    0x1(%rcx),%rdx
not    %rcx
cmp    -0xb8(%rbp),%rcx
je     18e4 <main+0x794>
cs nopw 0x0(%rax,%rax,1)
nop
movsd  (%r12,%rdx,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  -0x8(%rdi,%rdx,8),%xmm1
movsd  %xmm1,-0x8(%rdi,%rdx,8)
movsd  0x8(%r12,%rdx,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rdi,%rdx,8),%xmm1
movsd  %xmm1,(%rdi,%rdx,8)
add    $0x2,%rdx
cmp    %rdx,%r13
jne    18b0 <main+0x760>
mov    %r9,-0x108(%rbp)
mov    %rbx,-0x110(%rbp)
mov    %rdi,-0x38(%rbp)
test   %r15d,%r15d
je     1730 <main+0x5e0>
lea    -0x7a1310(%rbp),%r15
xor    %r12d,%r12d
jmp    1931 <main+0x7e1>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r12
mov    -0x2c(%rbp),%eax
add    $0x1f40,%r15
cmp    %rax,%r12
jae    1730 <main+0x5e0>
cmpl   $0x0,-0x30(%rbp)
je     1910 <main+0x7c0>
xor    %ebx,%ebx
nopl   0x0(%rax)
movsd  (%r15,%rbx,8),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1940 <main+0x7f0>
jmp    1910 <main+0x7c0>
add    %rcx,%r9
jmp    1479 <main+0x329>
xor    %r15d,%r15d
mov    %r15,%rax
mov    %rsp,%r15
mov    %eax,%eax
mov    %rsp,%r12
lea    0xf(,%rax,8),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r12
mov    %r12,%rsp
mov    -0x2c(%rbp),%r8d
mov    %r8d,%ecx
add    $0xffffffff,%ecx
mov    -0xd8(%rbp),%rsi
js     1a3d <main+0x8ed>
mov    %ecx,%r10d
lea    -0x1(%r10),%r9
xor    %edi,%edi
mov    %ecx,%ebx
jmp    19c3 <main+0x873>
nopw   0x0(%rax,%rax,1)
divsd  (%rax,%rbx,8),%xmm0
movsd  %xmm0,(%r12,%rbx,8)
add    $0x1,%edi
add    $0xffffffff,%ebx
js     1a3d <main+0x8ed>
mov    %ebx,%edx
mov    %ebx,%ebx
imul   $0x1f40,%rbx,%rax
add    %rbp,%rax
add    $0xffffffffff85ecf0,%rax
movsd  (%rax,%rsi,8),%xmm0
cmp    %edx,%ecx
jle    19b0 <main+0x860>
test   $0x1,%dil
jne    19f0 <main+0x8a0>
mov    %r10,%rdx
cmp    $0x1,%edi
jne    1a10 <main+0x8c0>
jmp    19b0 <main+0x860>
movsd  (%rax,%r10,8),%xmm1
mulsd  (%r12,%r10,8),%xmm1
subsd  %xmm1,%xmm0
mov    %r9,%rdx
cmp    $0x1,%edi
je     19b0 <main+0x860>
nopl   0x0(%rax,%rax,1)
movsd  -0x8(%rax,%rdx,8),%xmm1
movsd  (%rax,%rdx,8),%xmm2
mulsd  (%r12,%rdx,8),%xmm2
mulsd  -0x8(%r12,%rdx,8),%xmm1
subsd  %xmm2,%xmm0
subsd  %xmm1,%xmm0
add    $0xfffffffffffffffe,%rdx
cmp    %edx,%ebx
jl     1a10 <main+0x8c0>
jmp    19b0 <main+0x860>
test   %r8d,%r8d
je     1a6e <main+0x91e>
xor    %ebx,%ebx
lea    0x611(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsd  (%r12,%rbx,8),%xmm0
add    $0x1,%rbx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x2c(%rbp),%eax
cmp    %rax,%rbx
jb     1a50 <main+0x900>
mov    %r15,%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x5bd(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

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

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