#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*/ dsytrf_(char *, int *, double *, int *, int *, double *,
                           int *, int *);
int /*<<< orphan*/ dsytrs_(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*/ memcpy(double *, double *, int);
int /*<<< orphan*/ stderr;
int dAx_eq_b_BK(double *A, double *B, double *x, int m) {
  static double *buf = NULL;
  static int buf_sz = 0, nb = 0;
  double *a, *work;
  int a_sz, ipiv_sz, work_sz, tot_sz;
  int info, *ipiv, nrhs = 1;
  if (!A) {
    if (buf)
      free(buf);
    buf = NULL;
    buf_sz = 0;
    return 1;
  }
  ipiv_sz = m;
  a_sz = m * m;
  if (!nb) {
    double tmp;
    work_sz = -1;
    dsytrf_("L", (int *)&m, NULL, (int *)&m, NULL, (double *)&tmp,
            (int *)&work_sz, (int *)&info);
    nb = ((int)tmp) / m;
  }
  work_sz = (nb != -1) ? nb * m : 1;
  tot_sz = (a_sz + work_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_BK"
                      "() failed!\n");
      exit(1);
    }
  }
  a = buf;
  work = a + a_sz;
  ipiv = (int *)(work + work_sz);
  memcpy(a, A, a_sz * sizeof(double));
  memcpy(x, B, m * sizeof(double));
  dsytrf_("L", (int *)&m, a, (int *)&m, ipiv, work, (int *)&work_sz,
          (int *)&info);
  if (info != 0) {
    if (info < 0) {
      fprintf(stderr,
              "LAPACK error: illegal value for argument %d of "
              "dsytrf_"
              " in "
              "dAx_eq_b_BK"
              "()\n",
              -info);
      exit(1);
    } else {
      fprintf(stderr,
              "LAPACK error: singular block diagonal matrix D for"
              "dsytrf_"
              " in "
              "dAx_eq_b_BK"
              "() [D(%d, %d) is zero]\n",
              info, info);
      return 0;
    }
  }
  dsytrs_("L", (int *)&m, (int *)&nrhs, a, (int *)&m, ipiv, x, (int *)&m,
          (int *)&info);
  if (info < 0) {
    fprintf(stderr,
            "LAPACK error: illegal value for argument %d of "
            "dsytrs_"
            " in "
            "dAx_eq_b_BK"
            "()\n",
            -info);
    exit(1);
  }
  return 1;
}


x86 assembly (clang, -O0):
<dAx_eq_b_BK>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
movl   $0x1,-0x5c(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    11d7 <dAx_eq_b_BK+0x67>
cmpq   $0x0,0x2ebc(%rip)
je     11b6 <dAx_eq_b_BK+0x46>
mov    0x2eaf(%rip),%rdi
call   1030 <free@plt>
movq   $0x0,0x2e9f(%rip)
movl   $0x0,0x2e9d(%rip)
movl   $0x1,-0x4(%rbp)
jmp    145f <dAx_eq_b_BK+0x2ef>
mov    -0x24(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x24(%rbp),%eax
imul   -0x24(%rbp),%eax
mov    %eax,-0x3c(%rbp)
cmpl   $0x0,0x2e7e(%rip)
jne    123a <dAx_eq_b_BK+0xca>
movl   $0xffffffff,-0x44(%rbp)
lea    0xdfe(%rip),%rdi
lea    -0x24(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
lea    -0x68(%rbp),%r9
lea    -0x44(%rbp),%r10
lea    -0x4c(%rbp),%rax
mov    %rcx,%rsi
mov    %r8,%rdx
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1040 <dsytrf_@plt>
cvttsd2si -0x68(%rbp),%eax
cltd
idivl  -0x24(%rbp)
mov    %eax,0x2e32(%rip)
cmpl   $0xffffffff,0x2e2b(%rip)
je     1259 <dAx_eq_b_BK+0xe9>
mov    0x2e1f(%rip),%eax
imul   -0x24(%rbp),%eax
mov    %eax,-0x6c(%rbp)
jmp    1266 <dAx_eq_b_BK+0xf6>
mov    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    1266 <dAx_eq_b_BK+0xf6>
mov    -0x6c(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x3c(%rbp),%eax
add    -0x44(%rbp),%eax
cltq
shl    $0x3,%rax
movslq -0x40(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %eax,-0x48(%rbp)
mov    -0x48(%rbp),%eax
cmp    0x2dd9(%rip),%eax
jle    12fe <dAx_eq_b_BK+0x18e>
cmpq   $0x0,0x2dc3(%rip)
je     12af <dAx_eq_b_BK+0x13f>
mov    0x2db6(%rip),%rdi
call   1030 <free@plt>
mov    -0x48(%rbp),%eax
mov    %eax,0x2db0(%rip)
mov    0x2daa(%rip),%edi
call   1080 <malloc@plt>
mov    %rax,0x2d96(%rip)
cmpq   $0x0,0x2d8e(%rip)
jne    12f9 <dAx_eq_b_BK+0x189>
mov    0x2d01(%rip),%rax
mov    (%rax),%edi
lea    0xd1a(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
jmp    12fe <dAx_eq_b_BK+0x18e>
mov    0x2d5b(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
movslq -0x3c(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
movslq -0x44(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x3c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
call   1070 <memcpy@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
movslq -0x24(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
call   1070 <memcpy@plt>
mov    -0x30(%rbp),%rdx
mov    -0x58(%rbp),%r8
mov    -0x38(%rbp),%r9
lea    0xc90(%rip),%rdi
lea    -0x24(%rbp),%rcx
lea    -0x44(%rbp),%r10
lea    -0x4c(%rbp),%rax
mov    %rcx,%rsi
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1040 <dsytrf_@plt>
cmpl   $0x0,-0x4c(%rbp)
je     13f0 <dAx_eq_b_BK+0x280>
cmpl   $0x0,-0x4c(%rbp)
jge    13c7 <dAx_eq_b_BK+0x257>
mov    0x2c38(%rip),%rax
mov    (%rax),%edi
xor    %edx,%edx
sub    -0x4c(%rbp),%edx
lea    0xc78(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    0x2c12(%rip),%rax
mov    (%rax),%edi
mov    -0x4c(%rbp),%edx
mov    -0x4c(%rbp),%ecx
lea    0xc9a(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    145f <dAx_eq_b_BK+0x2ef>
mov    -0x30(%rbp),%rcx
mov    -0x58(%rbp),%r9
mov    -0x20(%rbp),%r11
lea    0xbfd(%rip),%rdi
lea    -0x24(%rbp),%r10
lea    -0x5c(%rbp),%rdx
lea    -0x4c(%rbp),%rax
mov    %r10,%rsi
mov    %r10,%r8
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1050 <dsytrs_@plt>
cmpl   $0x0,-0x4c(%rbp)
jge    1458 <dAx_eq_b_BK+0x2e8>
mov    0x2ba7(%rip),%rax
mov    (%rax),%edi
xor    %edx,%edx
sub    -0x4c(%rbp),%edx
lea    0xc90(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dAx_eq_b_BK>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %ecx,0xc(%rsp)
movl   $0x1,0x14(%rsp)
test   %rdi,%rdi
je     125b <dAx_eq_b_BK+0xeb>
mov    %ecx,%ebx
mov    %rsi,%r14
mov    %rdi,%r12
mov    %rdx,0x18(%rsp)
mov    %ecx,%r13d
imul   %r13d,%r13d
mov    0x2ebf(%rip),%eax
test   %eax,%eax
jne    11fa <dAx_eq_b_BK+0x8a>
movl   $0xffffffff,0x8(%rsp)
ff
lea    0x10(%rsp),%rax
lea    0x8(%rsp),%rbp
lea    0xe36(%rip),%rdi
lea    0xc(%rsp),%rcx
lea    0x20(%rsp),%r9
mov    %rcx,%rsi
xor    %edx,%edx
xor    %r8d,%r8d
push   %rax
push   %rbp
call   1040 <dsytrf_@plt>
add    $0x10,%rsp
cvttsd2si 0x20(%rsp),%eax
mov    0xc(%rsp),%ecx
cltd
idiv   %ecx
mov    %eax,0x2e72(%rip)
imul   %eax,%ecx
cmp    $0xffffffff,%eax
mov    $0x1,%eax
cmovne %ecx,%eax
mov    %eax,0x8(%rsp)
lea    (%rax,%r13,1),%ecx
shl    $0x2,%ebx
lea    (%rbx,%rcx,8),%ebp
mov    0x2e43(%rip),%rbx
cmp    0x2e45(%rip),%ebp
jle    128b <dAx_eq_b_BK+0x11b>
test   %rbx,%rbx
je     1232 <dAx_eq_b_BK+0xc2>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,0x2e30(%rip)
mov    %ebp,%edi
call   1080 <malloc@plt>
mov    %rax,0x2e1a(%rip)
test   %rax,%rax
je     136f <dAx_eq_b_BK+0x1ff>
mov    %rax,%rbx
mov    %r14,%rbp
mov    0x8(%rsp),%eax
jmp    128e <dAx_eq_b_BK+0x11e>
mov    0x2dfe(%rip),%rdi
test   %rdi,%rdi
je     126c <dAx_eq_b_BK+0xfc>
call   1030 <free@plt>
movq   $0x0,0x2de9(%rip)
movl   $0x0,0x2de7(%rip)
mov    $0x1,%ebx
jmp    1353 <dAx_eq_b_BK+0x1e3>
mov    %r14,%rbp
mov    %r13d,%ecx
lea    (%rbx,%rcx,8),%r15
cltq
lea    (%r15,%rax,8),%r14
shl    $0x3,%r13d
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r13d,%edx
call   1070 <memcpy@plt>
mov    0xc(%rsp),%edx
shl    $0x3,%edx
mov    0x18(%rsp),%r13
mov    %r13,%rdi
mov    %rbp,%rsi
call   1070 <memcpy@plt>
lea    0x10(%rsp),%r12
lea    0x8(%rsp),%rax
lea    0xd2b(%rip),%rdi
lea    0xc(%rsp),%rbp
mov    %rbp,%rsi
mov    %rbx,%rdx
mov    %rbp,%rcx
mov    %r14,%r8
mov    %r15,%r9
push   %r12
push   %rax
call   1040 <dsytrf_@plt>
add    $0x10,%rsp
mov    0x10(%rsp),%edx
test   %edx,%edx
je     131c <dAx_eq_b_BK+0x1ac>
mov    0x2cdc(%rip),%rax
mov    (%rax),%edi
js     1364 <dAx_eq_b_BK+0x1f4>
lea    0xd68(%rip),%rsi
xor    %ebx,%ebx
mov    %edx,%ecx
xor    %eax,%eax
call   1060 <fprintf@plt>
jmp    1353 <dAx_eq_b_BK+0x1e3>
sub    $0x8,%rsp
lea    0xcd9(%rip),%rdi
lea    0x1c(%rsp),%rdx
mov    %rbp,%rsi
mov    %rbx,%rcx
mov    %rbp,%r8
mov    %r14,%r9
push   %r12
push   %rbp
push   %r13
call   1050 <dsytrs_@plt>
add    $0x20,%rsp
mov    0x10(%rsp),%edx
mov    $0x1,%ebx
test   %edx,%edx
js     1390 <dAx_eq_b_BK+0x220>
mov    %ebx,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
neg    %edx
lea    0xcc1(%rip),%rsi
jmp    13a2 <dAx_eq_b_BK+0x232>
mov    0x2c6a(%rip),%rax
mov    (%rax),%edi
lea    0xc83(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    0x2c49(%rip),%rax
mov    (%rax),%edi
neg    %edx
lea    0xd35(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>

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

LLVM IR (-O2):
@dAx_eq_b_BK.buf = internal unnamed_addr global double* null
@dAx_eq_b_BK.buf_sz = internal unnamed_addr global i32 0
@dAx_eq_b_BK.nb = internal unnamed_addr global i32 0
@.str = [2 x i8] c"L\00"
@stderr = global i32 0
@.str.1 = [44 x i8] c"memory allocation in dAx_eq_b_BK() failed!\0A\00"
@.str.2 = [73 x i8] c"LAPACK error: illegal value for argument %d of dsytrf_ in dAx_eq_b_BK()\0A\00"
@.str.3 = [96 x i8] c"LAPACK error: singular block diagonal matrix D fordsytrf_ in dAx_eq_b_BK() [D(%d, %d) is zero]\0A\00"
@.str.4 = [73 x i8] c"LAPACK error: illegal value for argument %d of dsytrs_ in dAx_eq_b_BK()\0A\00"
define i32 @dAx_eq_b_BK(double* %0, double* %1, double* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca double
store i32 %3, i32* %5
%10 = bitcast i32* %6 to i8*
%11 = bitcast i32* %7 to i8*
%12 = bitcast i32* %8 to i8*
store i32 1, i32* %8
%13 = icmp eq double* %0, null
br i1 %13, label %14, label %20
14: ; preds = %4
%15 = load double*, double** @dAx_eq_b_BK.buf
%16 = icmp eq double* %15, null
br i1 %16, label %19, label %17
17: ; preds = %14
%18 = tail call i32 @free(double* %15)
br label %19
19: ; preds = %17, %14
store double* null, double** @dAx_eq_b_BK.buf
store i32 0, i32* @dAx_eq_b_BK.buf_sz
br label %92
20: ; preds = %4
%21 = mul nsw i32 %3, %3
%22 = load i32, i32* @dAx_eq_b_BK.nb
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %31
24: ; preds = %20
%25 = bitcast double* %9 to i8*
store i32 -1, i32* %6
%26 = call i32 @dsytrf_(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32* %5, double* null, i32* %5, i32* null, double* %9, i32* %6, i32* %7)
%27 = load double, double* %9
%28 = fptosi double %27 to i32
%29 = load i32, i32* %5
%30 = sdiv i32 %28, %29
store i32 %30, i32* @dAx_eq_b_BK.nb
br label %31
31: ; preds = %24, %20
%32 = phi i32 [ %29, %24 ], [ %3, %20 ]
%33 = phi i32 [ %30, %24 ], [ %22, %20 ]
%34 = icmp eq i32 %33, -1
%35 = mul nsw i32 %32, %33
%36 = select i1 %34, i32 1, i32 %35
store i32 %36, i32* %6
%37 = add nsw i32 %36, %21
%38 = shl i32 %37, 3
%39 = shl i32 %3, 2
%40 = add i32 %38, %39
%41 = load i32, i32* @dAx_eq_b_BK.buf_sz
%42 = icmp sgt i32 %40, %41
%43 = load double*, double** @dAx_eq_b_BK.buf
br i1 %42, label %44, label %58
44: ; preds = %31
%45 = icmp eq double* %43, null
br i1 %45, label %48, label %46
46: ; preds = %44
%47 = call i32 @free(double* %43)
br label %48
48: ; preds = %46, %44
store i32 %40, i32* @dAx_eq_b_BK.buf_sz
%49 = call i64 @malloc(i32 %40)
%50 = inttoptr i64 %49 to double*
store double* %50, double** @dAx_eq_b_BK.buf
%51 = icmp eq i64 %49, 0
br i1 %51, label %54, label %52
52: ; preds = %48
%53 = load i32, i32* %6
br label %58
54: ; preds = %48
%55 = load i32, i32* @stderr
%56 = call i32 (i32, i8*, ...) @fprintf(i32 %55, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%57 = call i32 @exit(i32 1)
unreachable
58: ; preds = %31, %52
%59 = phi i32 [ %53, %52 ], [ %36, %31 ]
%60 = phi double* [ %50, %52 ], [ %43, %31 ]
%61 = zext i32 %21 to i64
%62 = getelementptr inbounds double, double* %60, i64 %61
%63 = sext i32 %59 to i64
%64 = getelementptr inbounds double, double* %62, i64 %63
%65 = bitcast double* %64 to i32*
%66 = shl i32 %21, 3
%67 = call i32 @memcpy(double* %60, double* %0, i32 %66)
%68 = load i32, i32* %5
%69 = shl i32 %68, 3
%70 = call i32 @memcpy(double* %2, double* %1, i32 %69)
%71 = call i32 @dsytrf_(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32* %5, double* %60, i32* %5, i32* %65, double* %62, i32* %6, i32* %7)
%72 = load i32, i32* %7
%73 = icmp eq i32 %72, 0
br i1 %73, label %83, label %74
74: ; preds = %58
%75 = icmp slt i32 %72, 0
%76 = load i32, i32* @stderr
br i1 %75, label %77, label %81
77: ; preds = %74
%78 = sub nsw i32 0, %72
%79 = call i32 (i32, i8*, ...) @fprintf(i32 %76, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.2, i64 0, i64 0), i32 %78)
%80 = call i32 @exit(i32 1)
unreachable
81: ; preds = %74
%82 = call i32 (i32, i8*, ...) @fprintf(i32 %76, i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str.3, i64 0, i64 0), i32 %72, i32 %72)
br label %92
83: ; preds = %58
%84 = call i32 @dsytrs_(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32* %5, i32* %8, double* %60, i32* %5, i32* %65, double* %2, i32* %5, i32* %7)
%85 = load i32, i32* %7
%86 = icmp slt i32 %85, 0
br i1 %86, label %87, label %92
87: ; preds = %83
%88 = load i32, i32* @stderr
%89 = sub nsw i32 0, %85
%90 = call i32 (i32, i8*, ...) @fprintf(i32 %88, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.4, i64 0, i64 0), i32 %89)
%91 = call i32 @exit(i32 1)
unreachable
92: ; preds = %83, %81, %19
%93 = phi i32 [ 0, %81 ], [ 1, %19 ], [ 1, %83 ]
ret i32 %93
}