#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*/ dgetrf_(int *, int *, double *, int *, int *, int *);
int /*<<< orphan*/ dgetrs_(char *, int *, int *, double *, int *, int *,
                           double *, int *, int *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ free(double *);
scalar_t__ malloc(int);
int /*<<< orphan*/ stderr;
int dAx_eq_b_LU(double *A, double *B, double *x, int m) {
  static double *buf = NULL;
  static int buf_sz = 0;
  int a_sz, ipiv_sz, tot_sz;
  register int i, j;
  int info, *ipiv, nrhs = 1;
  double *a;
  if (!A) {
    if (buf)
      free(buf);
    buf = NULL;
    buf_sz = 0;
    return 1;
  }
  ipiv_sz = m;
  a_sz = m * m;
  tot_sz = a_sz * sizeof(double) + ipiv_sz * sizeof(int);
  if (tot_sz > buf_sz) {
    if (buf)
      free(buf);
    buf_sz = tot_sz;
    buf = (double *)malloc(buf_sz);
    if (!buf) {
      fprintf(stderr, "memory allocation in "
                      "dAx_eq_b_LU"
                      "() failed!\n");
      exit(1);
    }
  }
  a = buf;
  ipiv = (int *)(a + a_sz);
  for (i = 0; i < m; i++) {
    for (j = 0; j < m; j++)
      a[i + j * m] = A[i * m + j];
    x[i] = B[i];
  }
  dgetrf_((int *)&m, (int *)&m, a, (int *)&m, ipiv, (int *)&info);
  if (info != 0) {
    if (info < 0) {
      fprintf(stderr,
              "argument %d of "
              "dgetrf_"
              " illegal in "
              "dAx_eq_b_LU"
              "()\n",
              -info);
      exit(1);
    } else {
      fprintf(stderr, "singular matrix A for "
                      "dgetrf_"
                      " in "
                      "dAx_eq_b_LU"
                      "()\n");
      return 0;
    }
  }
  dgetrs_("N", (int *)&m, (int *)&nrhs, a, (int *)&m, ipiv, x, (int *)&m,
          (int *)&info);
  if (info != 0) {
    if (info < 0) {
      fprintf(stderr,
              "argument %d of "
              "dgetrs_"
              " illegal in "
              "dAx_eq_b_LU"
              "()\n",
              -info);
      exit(1);
    } else {
      fprintf(stderr, "unknown error for "
                      "dgetrs_"
                      " in "
                      "dAx_eq_b_LU"
                      "()\n");
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<dAx_eq_b_LU>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
movl   $0x1,-0x4c(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    11c4 <dAx_eq_b_LU+0x64>
cmpq   $0x0,0x2ec7(%rip)
je     11a3 <dAx_eq_b_LU+0x43>
mov    0x2eba(%rip),%rdi
call   1030 <free@plt>
movq   $0x0,0x2eaa(%rip)
movl   $0x0,0x2ea8(%rip)
movl   $0x1,-0x4(%rbp)
jmp    141e <dAx_eq_b_LU+0x2be>
mov    -0x24(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x24(%rbp),%eax
imul   -0x24(%rbp),%eax
mov    %eax,-0x28(%rbp)
movslq -0x28(%rbp),%rax
shl    $0x3,%rax
movslq -0x2c(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    0x2e6d(%rip),%eax
jle    1262 <dAx_eq_b_LU+0x102>
cmpq   $0x0,0x2e57(%rip)
je     1213 <dAx_eq_b_LU+0xb3>
mov    0x2e4a(%rip),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%eax
mov    %eax,0x2e44(%rip)
mov    0x2e3e(%rip),%edi
call   1050 <malloc@plt>
mov    %rax,0x2e2a(%rip)
cmpq   $0x0,0x2e22(%rip)
jne    125d <dAx_eq_b_LU+0xfd>
mov    0x2d9d(%rip),%rax
mov    (%rax),%edi
lea    0xdb4(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
jmp    1262 <dAx_eq_b_LU+0x102>
mov    0x2def(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
movslq -0x28(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    130a <dAx_eq_b_LU+0x1aa>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    12e2 <dAx_eq_b_LU+0x182>
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0x24(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x58(%rbp),%rax
mov    -0x34(%rbp),%ecx
mov    -0x38(%rbp),%edx
imul   -0x24(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    129a <dAx_eq_b_LU+0x13a>
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1287 <dAx_eq_b_LU+0x127>
mov    -0x58(%rbp),%rdx
mov    -0x48(%rbp),%r8
lea    -0x24(%rbp),%rcx
lea    -0x3c(%rbp),%r9
mov    %rcx,%rdi
mov    %rcx,%rsi
call   1060 <dgetrf_@plt>
cmpl   $0x0,-0x3c(%rbp)
je     1382 <dAx_eq_b_LU+0x222>
cmpl   $0x0,-0x3c(%rbp)
jge    135f <dAx_eq_b_LU+0x1ff>
mov    0x2ca0(%rip),%rax
mov    (%rax),%edi
xor    %edx,%edx
sub    -0x3c(%rbp),%edx
lea    0xcde(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    0x2c7a(%rip),%rax
mov    (%rax),%edi
lea    0xcee(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    141e <dAx_eq_b_LU+0x2be>
mov    -0x58(%rbp),%rcx
mov    -0x48(%rbp),%r9
mov    -0x20(%rbp),%r11
lea    0xcf8(%rip),%rdi
lea    -0x24(%rbp),%r10
lea    -0x4c(%rbp),%rdx
lea    -0x3c(%rbp),%rax
mov    %r10,%rsi
mov    %r10,%r8
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1070 <dgetrs_@plt>
cmpl   $0x0,-0x3c(%rbp)
je     1417 <dAx_eq_b_LU+0x2b7>
cmpl   $0x0,-0x3c(%rbp)
jge    13f4 <dAx_eq_b_LU+0x294>
mov    0x2c0b(%rip),%rax
mov    (%rax),%edi
xor    %edx,%edx
sub    -0x3c(%rbp),%edx
lea    0xcac(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    0x2be5(%rip),%rax
mov    (%rax),%edi
lea    0xcbc(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    141e <dAx_eq_b_LU+0x2be>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dAx_eq_b_LU>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %ecx,0x14(%rsp)
movl   $0x1,0x10(%rsp)
test   %rdi,%rdi
je     12ee <dAx_eq_b_LU+0x18e>
mov    %ecx,%r12d
mov    %rdx,%r14
mov    %rsi,%r15
mov    %ecx,%ebx
imul   %ebx,%ebx
lea    0x0(,%r12,4),%eax
lea    (%rax,%rbx,8),%ebp
mov    0x2eb5(%rip),%r13
cmp    0x2eb7(%rip),%ebp
jle    11e2 <dAx_eq_b_LU+0x82>
mov    %rdi,0x8(%rsp)
test   %r13,%r13
je     11bd <dAx_eq_b_LU+0x5d>
mov    %r13,%rdi
call   1030 <free@plt>
mov    %ebp,0x2e9d(%rip)
mov    %ebp,%edi
call   1050 <malloc@plt>
mov    %rax,%r13
mov    %rax,0x2e84(%rip)
test   %rax,%rax
mov    0x8(%rsp),%rdi
je     138b <dAx_eq_b_LU+0x22b>
lea    0x0(,%rbx,8),%rax
add    %r13,%rax
mov    %rax,0x8(%rsp)
test   %r12d,%r12d
jle    12a8 <dAx_eq_b_LU+0x148>
mov    %r12d,%r8d
mov    %r8d,%r11d
and    $0xfffffffe,%r11d
lea    0x8(%rdi),%rdx
lea    0x0(,%r8,8),%rsi
mov    %r8,%rcx
shl    $0x4,%rcx
xor    %r10d,%r10d
mov    %r13,%r9
jmp    123c <dAx_eq_b_LU+0xdc>
movsd  (%r15,%r10,8),%xmm0
movsd  %xmm0,(%r14,%r10,8)
add    $0x1,%r10
add    %rsi,%rdx
add    $0x8,%r9
cmp    %r8,%r10
je     12a8 <dAx_eq_b_LU+0x148>
cmp    $0x1,%r12d
jne    1250 <dAx_eq_b_LU+0xf0>
xor    %eax,%eax
jmp    1280 <dAx_eq_b_LU+0x120>
cs nopw 0x0(%rax,%rax,1)
mov    %r9,%rbx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nop
movsd  -0x8(%rdx,%rax,8),%xmm0
movsd  %xmm0,(%rbx)
movsd  (%rdx,%rax,8),%xmm0
movsd  %xmm0,(%rbx,%rsi,1)
add    $0x2,%rax
add    %rcx,%rbx
cmp    %rax,%r11
jne    1260 <dAx_eq_b_LU+0x100>
test   $0x1,%r8b
je     1220 <dAx_eq_b_LU+0xc0>
mov    %r10,%rbp
imul   %r8,%rbp
add    %rax,%rbp
movsd  (%rdi,%rbp,8),%xmm0
imul   %r8,%rax
add    %r10,%rax
movsd  %xmm0,0x0(%r13,%rax,8)
jmp    1220 <dAx_eq_b_LU+0xc0>
lea    0x14(%rsp),%rbx
lea    0x4(%rsp),%r15
mov    %rbx,%rdi
mov    %rbx,%rsi
mov    %r13,%rdx
mov    %rbx,%rcx
mov    0x8(%rsp),%rbp
mov    %rbp,%r8
mov    %r15,%r9
call   1060 <dgetrf_@plt>
mov    0x4(%rsp),%edx
test   %edx,%edx
je     131b <dAx_eq_b_LU+0x1bb>
mov    0x2d03(%rip),%rax
mov    (%rax),%edi
js     1380 <dAx_eq_b_LU+0x220>
lea    0xd71(%rip),%rsi
jmp    135f <dAx_eq_b_LU+0x1ff>
mov    0x2d63(%rip),%rdi
test   %rdi,%rdi
je     12ff <dAx_eq_b_LU+0x19f>
call   1030 <free@plt>
movq   $0x0,0x2d4e(%rip)
movl   $0x0,0x2d4c(%rip)
mov    $0x1,%ebx
jmp    1368 <dAx_eq_b_LU+0x208>
sub    $0x8,%rsp
lea    0xd67(%rip),%rdi
lea    0x18(%rsp),%rdx
mov    %rbx,%rsi
mov    %r13,%rcx
mov    %rbx,%r8
mov    %rbp,%r9
push   %r15
push   %rbx
push   %r14
call   1070 <dgetrs_@plt>
add    $0x20,%rsp
mov    0x4(%rsp),%edx
test   %edx,%edx
je     1379 <dAx_eq_b_LU+0x219>
mov    0x2c8c(%rip),%rax
mov    (%rax),%edi
js     13ac <dAx_eq_b_LU+0x24c>
lea    0xd61(%rip),%rsi
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %ebx,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x1,%ebx
jmp    1368 <dAx_eq_b_LU+0x208>
neg    %edx
lea    0xca3(%rip),%rsi
jmp    13b5 <dAx_eq_b_LU+0x255>
mov    0x2c4e(%rip),%rax
mov    (%rax),%edi
lea    0xc65(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
neg    %edx
lea    0xcda(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@dAx_eq_b_LU.buf = internal global double* null
@dAx_eq_b_LU.buf_sz = internal global i32 0
@stderr = global i32 0
@.str = [44 x i8] c"memory allocation in dAx_eq_b_LU() failed!\0A\00"
@.str.1 = [49 x i8] c"argument %d of dgetrf_ illegal in dAx_eq_b_LU()\0A\00"
@.str.2 = [48 x i8] c"singular matrix A for dgetrf_ in dAx_eq_b_LU()\0A\00"
@.str.3 = [2 x i8] c"N\00"
@.str.4 = [49 x i8] c"argument %d of dgetrs_ illegal in dAx_eq_b_LU()\0A\00"
@.str.5 = [44 x i8] c"unknown error for dgetrs_ in dAx_eq_b_LU()\0A\00"
define i32 @dAx_eq_b_LU(double* %0, double* %1, double* %2, i32 %3) {
%5 = alloca i32
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32*
%17 = alloca i32
%18 = alloca double*
store double* %0, double** %6
store double* %1, double** %7
store double* %2, double** %8
store i32 %3, i32* %9
store i32 1, i32* %17
%19 = load double*, double** %6
%20 = icmp ne double* %19, null
br i1 %20, label %28, label %21
21: ; preds = %4
%22 = load double*, double** @dAx_eq_b_LU.buf
%23 = icmp ne double* %22, null
br i1 %23, label %24, label %27
24: ; preds = %21
%25 = load double*, double** @dAx_eq_b_LU.buf
%26 = call i32 @free(double* %25)
br label %27
27: ; preds = %24, %21
store double* null, double** @dAx_eq_b_LU.buf
store i32 0, i32* @dAx_eq_b_LU.buf_sz
store i32 1, i32* %5
br label %150
28: ; preds = %4
%29 = load i32, i32* %9
store i32 %29, i32* %11
%30 = load i32, i32* %9
%31 = load i32, i32* %9
%32 = mul nsw i32 %30, %31
store i32 %32, i32* %10
%33 = load i32, i32* %10
%34 = sext i32 %33 to i64
%35 = mul i64 %34, 8
%36 = load i32, i32* %11
%37 = sext i32 %36 to i64
%38 = mul i64 %37, 4
%39 = add i64 %35, %38
%40 = trunc i64 %39 to i32
store i32 %40, i32* %12
%41 = load i32, i32* %12
%42 = load i32, i32* @dAx_eq_b_LU.buf_sz
%43 = icmp sgt i32 %41, %42
br i1 %43, label %44, label %62
44: ; preds = %28
%45 = load double*, double** @dAx_eq_b_LU.buf
%46 = icmp ne double* %45, null
br i1 %46, label %47, label %50
47: ; preds = %44
%48 = load double*, double** @dAx_eq_b_LU.buf
%49 = call i32 @free(double* %48)
br label %50
50: ; preds = %47, %44
%51 = load i32, i32* %12
store i32 %51, i32* @dAx_eq_b_LU.buf_sz
%52 = load i32, i32* @dAx_eq_b_LU.buf_sz
%53 = call i64 @malloc(i32 %52)
%54 = inttoptr i64 %53 to double*
store double* %54, double** @dAx_eq_b_LU.buf
%55 = load double*, double** @dAx_eq_b_LU.buf
%56 = icmp ne double* %55, null
br i1 %56, label %61, label %57
57: ; preds = %50
%58 = load i32, i32* @stderr
%59 = call i32 (i32, i8*, ...) @fprintf(i32 %58, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%60 = call i32 @exit(i32 1)
unreachable
61: ; preds = %50
br label %62
62: ; preds = %61, %28
%63 = load double*, double** @dAx_eq_b_LU.buf
store double* %63, double** %18
%64 = load double*, double** %18
%65 = load i32, i32* %10
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds double, double* %64, i64 %66
%68 = bitcast double* %67 to i32*
store i32* %68, i32** %16
store i32 0, i32* %13
br label %69
69: ; preds = %109, %62
%70 = load i32, i32* %13
%71 = load i32, i32* %9
%72 = icmp slt i32 %70, %71
br i1 %72, label %73, label %112
73: ; preds = %69
store i32 0, i32* %14
br label %74
74: ; preds = %96, %73
%75 = load i32, i32* %14
%76 = load i32, i32* %9
%77 = icmp slt i32 %75, %76
br i1 %77, label %78, label %99
78: ; preds = %74
%79 = load double*, double** %6
%80 = load i32, i32* %13
%81 = load i32, i32* %9
%82 = mul nsw i32 %80, %81
%83 = load i32, i32* %14
%84 = add nsw i32 %82, %83
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds double, double* %79, i64 %85
%87 = load double, double* %86
%88 = load double*, double** %18
%89 = load i32, i32* %13
%90 = load i32, i32* %14
%91 = load i32, i32* %9
%92 = mul nsw i32 %90, %91
%93 = add nsw i32 %89, %92
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds double, double* %88, i64 %94
store double %87, double* %95
br label %96
96: ; preds = %78
%97 = load i32, i32* %14
%98 = add nsw i32 %97, 1
store i32 %98, i32* %14
br label %74
99: ; preds = %74
%100 = load double*, double** %7
%101 = load i32, i32* %13
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds double, double* %100, i64 %102
%104 = load double, double* %103
%105 = load double*, double** %8
%106 = load i32, i32* %13
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds double, double* %105, i64 %107
store double %104, double* %108
br label %109
109: ; preds = %99
%110 = load i32, i32* %13
%111 = add nsw i32 %110, 1
store i32 %111, i32* %13
br label %69
112: ; preds = %69
%113 = load double*, double** %18
%114 = load i32*, i32** %16
%115 = call i32 @dgetrf_(i32* %9, i32* %9, double* %113, i32* %9, i32* %114, i32* %15)
%116 = load i32, i32* %15
%117 = icmp ne i32 %116, 0
br i1 %117, label %118, label %130
118: ; preds = %112
%119 = load i32, i32* %15
%120 = icmp slt i32 %119, 0
br i1 %120, label %121, label %127
121: ; preds = %118
%122 = load i32, i32* @stderr
%123 = load i32, i32* %15
%124 = sub nsw i32 0, %123
%125 = call i32 (i32, i8*, ...) @fprintf(i32 %122, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0), i32 %124)
%126 = call i32 @exit(i32 1)
unreachable
127: ; preds = %118
%128 = load i32, i32* @stderr
%129 = call i32 (i32, i8*, ...) @fprintf(i32 %128, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %5
br label %150
130: ; preds = %112
%131 = load double*, double** %18
%132 = load i32*, i32** %16
%133 = load double*, double** %8
%134 = call i32 @dgetrs_(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32* %9, i32* %17, double* %131, i32* %9, i32* %132, double* %133, i32* %9, i32* %15)
%135 = load i32, i32* %15
%136 = icmp ne i32 %135, 0
br i1 %136, label %137, label %149
137: ; preds = %130
%138 = load i32, i32* %15
%139 = icmp slt i32 %138, 0
br i1 %139, label %140, label %146
140: ; preds = %137
%141 = load i32, i32* @stderr
%142 = load i32, i32* %15
%143 = sub nsw i32 0, %142
%144 = call i32 (i32, i8*, ...) @fprintf(i32 %141, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.4, i64 0, i64 0), i32 %143)
%145 = call i32 @exit(i32 1)
unreachable
146: ; preds = %137
%147 = load i32, i32* @stderr
%148 = call i32 (i32, i8*, ...) @fprintf(i32 %147, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %5
br label %150
149: ; preds = %130
store i32 1, i32* %5
br label %150
150: ; preds = %149, %146, %127, %27
%151 = load i32, i32* %5
ret i32 %151
}

LLVM IR (-O2):
@dAx_eq_b_LU.buf = internal unnamed_addr global double* null
@dAx_eq_b_LU.buf_sz = internal unnamed_addr global i32 0
@stderr = global i32 0
@.str = [44 x i8] c"memory allocation in dAx_eq_b_LU() failed!\0A\00"
@.str.1 = [49 x i8] c"argument %d of dgetrf_ illegal in dAx_eq_b_LU()\0A\00"
@.str.2 = [48 x i8] c"singular matrix A for dgetrf_ in dAx_eq_b_LU()\0A\00"
@.str.3 = [2 x i8] c"N\00"
@.str.4 = [49 x i8] c"argument %d of dgetrs_ illegal in dAx_eq_b_LU()\0A\00"
@.str.5 = [44 x i8] c"unknown error for dgetrs_ in dAx_eq_b_LU()\0A\00"
define i32 @dAx_eq_b_LU(double* %0, double* nocapture %1, double* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %3, i32* %5
%8 = bitcast i32* %6 to i8*
%9 = bitcast i32* %7 to i8*
store i32 1, i32* %7
%10 = icmp eq double* %0, null
br i1 %10, label %11, label %17
11: ; preds = %4
%12 = load double*, double** @dAx_eq_b_LU.buf
%13 = icmp eq double* %12, null
br i1 %13, label %16, label %14
14: ; preds = %11
%15 = tail call i32 @free(double* %12)
br label %16
16: ; preds = %14, %11
store double* null, double** @dAx_eq_b_LU.buf
store i32 0, i32* @dAx_eq_b_LU.buf_sz
br label %113
17: ; preds = %4
%18 = mul nsw i32 %3, %3
%19 = zext i32 %18 to i64
%20 = shl i32 %18, 3
%21 = shl i32 %3, 2
%22 = add i32 %20, %21
%23 = load i32, i32* @dAx_eq_b_LU.buf_sz
%24 = icmp sgt i32 %22, %23
%25 = load double*, double** @dAx_eq_b_LU.buf
br i1 %24, label %26, label %38
26: ; preds = %17
%27 = icmp eq double* %25, null
br i1 %27, label %30, label %28
28: ; preds = %26
%29 = tail call i32 @free(double* %25)
br label %30
30: ; preds = %28, %26
store i32 %22, i32* @dAx_eq_b_LU.buf_sz
%31 = tail call i64 @malloc(i32 %22)
%32 = inttoptr i64 %31 to double*
store double* %32, double** @dAx_eq_b_LU.buf
%33 = icmp eq i64 %31, 0
br i1 %33, label %34, label %38
34: ; preds = %30
%35 = load i32, i32* @stderr
%36 = tail call i32 (i32, i8*, ...) @fprintf(i32 %35, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%37 = tail call i32 @exit(i32 1)
unreachable
38: ; preds = %17, %30
%39 = phi double* [ %32, %30 ], [ %25, %17 ]
%40 = getelementptr inbounds double, double* %39, i64 %19
%41 = bitcast double* %40 to i32*
%42 = icmp sgt i32 %3, 0
br i1 %42, label %43, label %87
43: ; preds = %38
%44 = zext i32 %3 to i64
%45 = zext i32 %3 to i64
%46 = and i64 %45, 1
%47 = icmp eq i32 %3, 1
%48 = and i64 %45, 4294967294
%49 = icmp eq i64 %46, 0
br label %50
50: ; preds = %81, %43
%51 = phi i64 [ 0, %43 ], [ %85, %81 ]
%52 = mul nsw i64 %51, %44
br i1 %47, label %72, label %53
53: ; preds = %50, %53
%54 = phi i64 [ %69, %53 ], [ 0, %50 ]
%55 = phi i64 [ %70, %53 ], [ 0, %50 ]
%56 = add nuw nsw i64 %54, %52
%57 = getelementptr inbounds double, double* %0, i64 %56
%58 = load double, double* %57
%59 = mul nsw i64 %54, %44
%60 = add nuw nsw i64 %59, %51
%61 = getelementptr inbounds double, double* %39, i64 %60
store double %58, double* %61
%62 = or i64 %54, 1
%63 = add nuw nsw i64 %62, %52
%64 = getelementptr inbounds double, double* %0, i64 %63
%65 = load double, double* %64
%66 = mul nsw i64 %62, %44
%67 = add nuw nsw i64 %66, %51
%68 = getelementptr inbounds double, double* %39, i64 %67
store double %65, double* %68
%69 = add nuw nsw i64 %54, 2
%70 = add i64 %55, 2
%71 = icmp eq i64 %70, %48
br i1 %71, label %72, label %53
72: ; preds = %53, %50
%73 = phi i64 [ 0, %50 ], [ %69, %53 ]
br i1 %49, label %81, label %74
74: ; preds = %72
%75 = add nuw nsw i64 %73, %52
%76 = getelementptr inbounds double, double* %0, i64 %75
%77 = load double, double* %76
%78 = mul nsw i64 %73, %44
%79 = add nuw nsw i64 %78, %51
%80 = getelementptr inbounds double, double* %39, i64 %79
store double %77, double* %80
br label %81
81: ; preds = %72, %74
%82 = getelementptr inbounds double, double* %1, i64 %51
%83 = load double, double* %82
%84 = getelementptr inbounds double, double* %2, i64 %51
store double %83, double* %84
%85 = add nuw nsw i64 %51, 1
%86 = icmp eq i64 %85, %45
br i1 %86, label %87, label %50
87: ; preds = %81, %38
%88 = call i32 @dgetrf_(i32* %5, i32* %5, double* %39, i32* %5, i32* %41, i32* %6)
%89 = load i32, i32* %6
%90 = icmp eq i32 %89, 0
br i1 %90, label %100, label %91
91: ; preds = %87
%92 = icmp slt i32 %89, 0
%93 = load i32, i32* @stderr
br i1 %92, label %94, label %98
94: ; preds = %91
%95 = sub nsw i32 0, %89
%96 = call i32 (i32, i8*, ...) @fprintf(i32 %93, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0), i32 %95)
%97 = call i32 @exit(i32 1)
unreachable
98: ; preds = %91
%99 = call i32 (i32, i8*, ...) @fprintf(i32 %93, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0))
br label %113
100: ; preds = %87
%101 = call i32 @dgetrs_(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32* %5, i32* %7, double* %39, i32* %5, i32* %41, double* %2, i32* %5, i32* %6)
%102 = load i32, i32* %6
%103 = icmp eq i32 %102, 0
br i1 %103, label %113, label %104
104: ; preds = %100
%105 = icmp slt i32 %102, 0
%106 = load i32, i32* @stderr
br i1 %105, label %107, label %111
107: ; preds = %104
%108 = sub nsw i32 0, %102
%109 = call i32 (i32, i8*, ...) @fprintf(i32 %106, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.4, i64 0, i64 0), i32 %108)
%110 = call i32 @exit(i32 1)
unreachable
111: ; preds = %104
%112 = call i32 (i32, i8*, ...) @fprintf(i32 %106, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.5, i64 0, i64 0))
br label %113
113: ; preds = %100, %111, %98, %16
%114 = phi i32 [ 0, %98 ], [ 0, %111 ], [ 1, %16 ], [ 1, %100 ]
ret i32 %114
}