#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*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ free(float *);
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(float *, float *, int);
int /*<<< orphan*/ ssytrf_(char *, int *, float *, int *, int *, float *, int *,
                           int *);
int /*<<< orphan*/ ssytrs_(char *, int *, int *, float *, int *, int *, float *,
                           int *, int *);
int /*<<< orphan*/ stderr;
int sAx_eq_b_BK(float *A, float *B, float *x, int m) {
  static float *buf = NULL;
  static int buf_sz = 0, nb = 0;
  float *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) {
    float tmp;
    work_sz = -1;
    ssytrf_("L", (int *)&m, NULL, (int *)&m, NULL, (float *)&tmp,
            (int *)&work_sz, (int *)&info);
    nb = ((int)tmp) / m;
  }
  work_sz = (nb != -1) ? nb * m : 1;
  tot_sz = (a_sz + work_sz) * sizeof(float) + ipiv_sz * sizeof(int);
  if (tot_sz > buf_sz) {
    if (buf)
      free(buf);
    buf_sz = tot_sz;
    buf = (float *)malloc(buf_sz);
    if (!buf) {
      fprintf(stderr, "memory allocation in "
                      "sAx_eq_b_BK"
                      "() failed!\n");
      exit(1);
    }
  }
  a = buf;
  work = a + a_sz;
  ipiv = (int *)(work + work_sz);
  memcpy(a, A, a_sz * sizeof(float));
  memcpy(x, B, m * sizeof(float));
  ssytrf_("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 "
              "ssytrf_"
              " in "
              "sAx_eq_b_BK"
              "()\n",
              -info);
      exit(1);
    } else {
      fprintf(stderr,
              "LAPACK error: singular block diagonal matrix D for"
              "ssytrf_"
              " in "
              "sAx_eq_b_BK"
              "() [D(%d, %d) is zero]\n",
              info, info);
      return 0;
    }
  }
  ssytrs_("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 "
            "ssytrs_"
            " in "
            "sAx_eq_b_BK"
            "()\n",
            -info);
    exit(1);
  }
  return 1;
}


x86 assembly (clang, -O0):
<sAx_eq_b_BK>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%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 <sAx_eq_b_BK+0x67>
cmpq   $0x0,0x2ebc(%rip)
je     11b6 <sAx_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 <sAx_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 <sAx_eq_b_BK+0xca>
movl   $0xffffffff,-0x44(%rbp)
lea    0xdfe(%rip),%rdi
lea    -0x24(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
lea    -0x60(%rbp),%r9
lea    -0x44(%rbp),%r10
lea    -0x4c(%rbp),%rax
mov    %rcx,%rsi
mov    %r8,%rdx
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1070 <ssytrf_@plt>
cvttss2si -0x60(%rbp),%eax
cltd
idivl  -0x24(%rbp)
mov    %eax,0x2e32(%rip)
cmpl   $0xffffffff,0x2e2b(%rip)
je     1259 <sAx_eq_b_BK+0xe9>
mov    0x2e1f(%rip),%eax
imul   -0x24(%rbp),%eax
mov    %eax,-0x64(%rbp)
jmp    1266 <sAx_eq_b_BK+0xf6>
mov    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1266 <sAx_eq_b_BK+0xf6>
mov    -0x64(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x3c(%rbp),%eax
add    -0x44(%rbp),%eax
cltq
shl    $0x2,%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 <sAx_eq_b_BK+0x18e>
cmpq   $0x0,0x2dc3(%rip)
je     12af <sAx_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   1060 <malloc@plt>
mov    %rax,0x2d96(%rip)
cmpq   $0x0,0x2d8e(%rip)
jne    12f9 <sAx_eq_b_BK+0x189>
mov    0x2d01(%rip),%rax
mov    (%rax),%edi
lea    0xd1a(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
jmp    12fe <sAx_eq_b_BK+0x18e>
mov    0x2d5b(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
movslq -0x3c(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
movslq -0x44(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x3c(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edx
call   1050 <memcpy@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
movslq -0x24(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edx
call   1050 <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   1070 <ssytrf_@plt>
cmpl   $0x0,-0x4c(%rbp)
je     13f0 <sAx_eq_b_BK+0x280>
cmpl   $0x0,-0x4c(%rbp)
jge    13c7 <sAx_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   1040 <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   1040 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    145f <sAx_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   1080 <ssytrs_@plt>
cmpl   $0x0,-0x4c(%rbp)
jge    1458 <sAx_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   1040 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sAx_eq_b_BK>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %ecx,0x10(%rsp)
movl   $0x1,0x1c(%rsp)
test   %rdi,%rdi
je     1259 <sAx_eq_b_BK+0xe9>
mov    %ecx,%ebp
mov    %rsi,%r14
mov    %rdi,%r12
mov    %rdx,0x20(%rsp)
mov    %ecx,%r13d
imul   %ebp,%r13d
mov    0x2ebf(%rip),%eax
test   %eax,%eax
jne    11fa <sAx_eq_b_BK+0x8a>
movl   $0xffffffff,0xc(%rsp)
ff
lea    0x14(%rsp),%rax
lea    0xc(%rsp),%rbx
lea    0xe36(%rip),%rdi
lea    0x10(%rsp),%rcx
lea    0x18(%rsp),%r9
mov    %rcx,%rsi
xor    %edx,%edx
xor    %r8d,%r8d
push   %rax
push   %rbx
call   1070 <ssytrf_@plt>
add    $0x10,%rsp
cvttss2si 0x18(%rsp),%eax
mov    0x10(%rsp),%ecx
cltd
idiv   %ecx
mov    %eax,0x2e72(%rip)
imul   %eax,%ecx
cmp    $0xffffffff,%eax
mov    $0x1,%eax
cmovne %ecx,%eax
mov    %eax,0xc(%rsp)
add    %r13d,%ebp
add    %eax,%ebp
shl    $0x2,%ebp
mov    0x2e45(%rip),%rbx
cmp    0x2e47(%rip),%ebp
jle    1289 <sAx_eq_b_BK+0x119>
test   %rbx,%rbx
je     1230 <sAx_eq_b_BK+0xc0>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,0x2e32(%rip)
mov    %ebp,%edi
call   1060 <malloc@plt>
mov    %rax,0x2e1c(%rip)
test   %rax,%rax
je     136d <sAx_eq_b_BK+0x1fd>
mov    %rax,%rbx
mov    %r14,%rbp
mov    0xc(%rsp),%eax
jmp    128c <sAx_eq_b_BK+0x11c>
mov    0x2e00(%rip),%rdi
test   %rdi,%rdi
je     126a <sAx_eq_b_BK+0xfa>
call   1030 <free@plt>
movq   $0x0,0x2deb(%rip)
movl   $0x0,0x2de9(%rip)
mov    $0x1,%ebx
jmp    1351 <sAx_eq_b_BK+0x1e1>
mov    %r14,%rbp
mov    %r13d,%ecx
lea    (%rbx,%rcx,4),%r15
cltq
lea    (%r15,%rax,4),%r14
shl    $0x2,%r13d
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r13d,%edx
call   1050 <memcpy@plt>
mov    0x10(%rsp),%edx
shl    $0x2,%edx
mov    0x20(%rsp),%r13
mov    %r13,%rdi
mov    %rbp,%rsi
call   1050 <memcpy@plt>
lea    0x14(%rsp),%r12
lea    0xc(%rsp),%rax
lea    0xd2d(%rip),%rdi
lea    0x10(%rsp),%rbp
mov    %rbp,%rsi
mov    %rbx,%rdx
mov    %rbp,%rcx
mov    %r14,%r8
mov    %r15,%r9
push   %r12
push   %rax
call   1070 <ssytrf_@plt>
add    $0x10,%rsp
mov    0x14(%rsp),%edx
test   %edx,%edx
je     131a <sAx_eq_b_BK+0x1aa>
mov    0x2cde(%rip),%rax
mov    (%rax),%edi
js     1362 <sAx_eq_b_BK+0x1f2>
lea    0xd6a(%rip),%rsi
xor    %ebx,%ebx
mov    %edx,%ecx
xor    %eax,%eax
call   1040 <fprintf@plt>
jmp    1351 <sAx_eq_b_BK+0x1e1>
sub    $0x8,%rsp
lea    0xcdb(%rip),%rdi
lea    0x24(%rsp),%rdx
mov    %rbp,%rsi
mov    %rbx,%rcx
mov    %rbp,%r8
mov    %r14,%r9
push   %r12
push   %rbp
push   %r13
call   1080 <ssytrs_@plt>
add    $0x20,%rsp
mov    0x14(%rsp),%edx
mov    $0x1,%ebx
test   %edx,%edx
js     138e <sAx_eq_b_BK+0x21e>
mov    %ebx,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
neg    %edx
lea    0xcc3(%rip),%rsi
jmp    13a0 <sAx_eq_b_BK+0x230>
mov    0x2c6c(%rip),%rax
mov    (%rax),%edi
lea    0xc85(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    0x2c4b(%rip),%rax
mov    (%rax),%edi
neg    %edx
lea    0xd37(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@sAx_eq_b_BK.buf = internal global float* null
@sAx_eq_b_BK.buf_sz = internal global i32 0
@sAx_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 sAx_eq_b_BK() failed!\0A\00"
@.str.2 = [73 x i8] c"LAPACK error: illegal value for argument %d of ssytrf_ in sAx_eq_b_BK()\0A\00"
@.str.3 = [96 x i8] c"LAPACK error: singular block diagonal matrix D forssytrf_ in sAx_eq_b_BK() [D(%d, %d) is zero]\0A\00"
@.str.4 = [73 x i8] c"LAPACK error: illegal value for argument %d of ssytrs_ in sAx_eq_b_BK()\0A\00"
define i32 @sAx_eq_b_BK(float* %0, float* %1, float* %2, i32 %3) {
%5 = alloca i32
%6 = alloca float*
%7 = alloca float*
%8 = alloca float*
%9 = alloca i32
%10 = alloca float*
%11 = alloca float*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32*
%18 = alloca i32
%19 = alloca float
store float* %0, float** %6
store float* %1, float** %7
store float* %2, float** %8
store i32 %3, i32* %9
store i32 1, i32* %18
%20 = load float*, float** %6
%21 = icmp ne float* %20, null
br i1 %21, label %29, label %22
22: ; preds = %4
%23 = load float*, float** @sAx_eq_b_BK.buf
%24 = icmp ne float* %23, null
br i1 %24, label %25, label %28
25: ; preds = %22
%26 = load float*, float** @sAx_eq_b_BK.buf
%27 = call i32 @free(float* %26)
br label %28
28: ; preds = %25, %22
store float* null, float** @sAx_eq_b_BK.buf
store i32 0, i32* @sAx_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* @sAx_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 @ssytrf_(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32* %9, float* null, i32* %9, i32* null, float* %19, i32* %14, i32* %16)
%38 = load float, float* %19
%39 = fptosi float %38 to i32
%40 = load i32, i32* %9
%41 = sdiv i32 %39, %40
store i32 %41, i32* @sAx_eq_b_BK.nb
br label %42
42: ; preds = %36, %29
%43 = load i32, i32* @sAx_eq_b_BK.nb
%44 = icmp ne i32 %43, -1
br i1 %44, label %45, label %49
45: ; preds = %42
%46 = load i32, i32* @sAx_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, 4
%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* @sAx_eq_b_BK.buf_sz
%64 = icmp sgt i32 %62, %63
br i1 %64, label %65, label %83
65: ; preds = %50
%66 = load float*, float** @sAx_eq_b_BK.buf
%67 = icmp ne float* %66, null
br i1 %67, label %68, label %71
68: ; preds = %65
%69 = load float*, float** @sAx_eq_b_BK.buf
%70 = call i32 @free(float* %69)
br label %71
71: ; preds = %68, %65
%72 = load i32, i32* %15
store i32 %72, i32* @sAx_eq_b_BK.buf_sz
%73 = load i32, i32* @sAx_eq_b_BK.buf_sz
%74 = call i64 @malloc(i32 %73)
%75 = inttoptr i64 %74 to float*
store float* %75, float** @sAx_eq_b_BK.buf
%76 = load float*, float** @sAx_eq_b_BK.buf
%77 = icmp ne float* %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 float*, float** @sAx_eq_b_BK.buf
store float* %84, float** %10
%85 = load float*, float** %10
%86 = load i32, i32* %12
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds float, float* %85, i64 %87
store float* %88, float** %11
%89 = load float*, float** %11
%90 = load i32, i32* %14
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds float, float* %89, i64 %91
%93 = bitcast float* %92 to i32*
store i32* %93, i32** %17
%94 = load float*, float** %10
%95 = load float*, float** %6
%96 = load i32, i32* %12
%97 = sext i32 %96 to i64
%98 = mul i64 %97, 4
%99 = trunc i64 %98 to i32
%100 = call i32 @memcpy(float* %94, float* %95, i32 %99)
%101 = load float*, float** %8
%102 = load float*, float** %7
%103 = load i32, i32* %9
%104 = sext i32 %103 to i64
%105 = mul i64 %104, 4
%106 = trunc i64 %105 to i32
%107 = call i32 @memcpy(float* %101, float* %102, i32 %106)
%108 = load float*, float** %10
%109 = load i32*, i32** %17
%110 = load float*, float** %11
%111 = call i32 @ssytrf_(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32* %9, float* %108, i32* %9, i32* %109, float* %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 float*, float** %10
%130 = load i32*, i32** %17
%131 = load float*, float** %8
%132 = call i32 @ssytrs_(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32* %9, i32* %18, float* %129, i32* %9, i32* %130, float* %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):
@sAx_eq_b_BK.buf = internal unnamed_addr global float* null
@sAx_eq_b_BK.buf_sz = internal unnamed_addr global i32 0
@sAx_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 sAx_eq_b_BK() failed!\0A\00"
@.str.2 = [73 x i8] c"LAPACK error: illegal value for argument %d of ssytrf_ in sAx_eq_b_BK()\0A\00"
@.str.3 = [96 x i8] c"LAPACK error: singular block diagonal matrix D forssytrf_ in sAx_eq_b_BK() [D(%d, %d) is zero]\0A\00"
@.str.4 = [73 x i8] c"LAPACK error: illegal value for argument %d of ssytrs_ in sAx_eq_b_BK()\0A\00"
define i32 @sAx_eq_b_BK(float* %0, float* %1, float* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca float
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 float* %0, null
br i1 %13, label %14, label %20
14: ; preds = %4
%15 = load float*, float** @sAx_eq_b_BK.buf
%16 = icmp eq float* %15, null
br i1 %16, label %19, label %17
17: ; preds = %14
%18 = tail call i32 @free(float* %15)
br label %19
19: ; preds = %17, %14
store float* null, float** @sAx_eq_b_BK.buf
store i32 0, i32* @sAx_eq_b_BK.buf_sz
br label %91
20: ; preds = %4
%21 = mul nsw i32 %3, %3
%22 = load i32, i32* @sAx_eq_b_BK.nb
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %31
24: ; preds = %20
%25 = bitcast float* %9 to i8*
store i32 -1, i32* %6
%26 = call i32 @ssytrf_(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32* %5, float* null, i32* %5, i32* null, float* %9, i32* %6, i32* %7)
%27 = load float, float* %9
%28 = fptosi float %27 to i32
%29 = load i32, i32* %5
%30 = sdiv i32 %28, %29
store i32 %30, i32* @sAx_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 i32 %21, %3
%38 = add i32 %37, %36
%39 = shl i32 %38, 2
%40 = load i32, i32* @sAx_eq_b_BK.buf_sz
%41 = icmp sgt i32 %39, %40
%42 = load float*, float** @sAx_eq_b_BK.buf
br i1 %41, label %43, label %57
43: ; preds = %31
%44 = icmp eq float* %42, null
br i1 %44, label %47, label %45
45: ; preds = %43
%46 = call i32 @free(float* %42)
br label %47
47: ; preds = %45, %43
store i32 %39, i32* @sAx_eq_b_BK.buf_sz
%48 = call i64 @malloc(i32 %39)
%49 = inttoptr i64 %48 to float*
store float* %49, float** @sAx_eq_b_BK.buf
%50 = icmp eq i64 %48, 0
br i1 %50, label %53, label %51
51: ; preds = %47
%52 = load i32, i32* %6
br label %57
53: ; preds = %47
%54 = load i32, i32* @stderr
%55 = call i32 (i32, i8*, ...) @fprintf(i32 %54, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%56 = call i32 @exit(i32 1)
unreachable
57: ; preds = %31, %51
%58 = phi i32 [ %52, %51 ], [ %36, %31 ]
%59 = phi float* [ %49, %51 ], [ %42, %31 ]
%60 = zext i32 %21 to i64
%61 = getelementptr inbounds float, float* %59, i64 %60
%62 = sext i32 %58 to i64
%63 = getelementptr inbounds float, float* %61, i64 %62
%64 = bitcast float* %63 to i32*
%65 = shl i32 %21, 2
%66 = call i32 @memcpy(float* %59, float* %0, i32 %65)
%67 = load i32, i32* %5
%68 = shl i32 %67, 2
%69 = call i32 @memcpy(float* %2, float* %1, i32 %68)
%70 = call i32 @ssytrf_(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32* %5, float* %59, i32* %5, i32* %64, float* %61, i32* %6, i32* %7)
%71 = load i32, i32* %7
%72 = icmp eq i32 %71, 0
br i1 %72, label %82, label %73
73: ; preds = %57
%74 = icmp slt i32 %71, 0
%75 = load i32, i32* @stderr
br i1 %74, label %76, label %80
76: ; preds = %73
%77 = sub nsw i32 0, %71
%78 = call i32 (i32, i8*, ...) @fprintf(i32 %75, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.2, i64 0, i64 0), i32 %77)
%79 = call i32 @exit(i32 1)
unreachable
80: ; preds = %73
%81 = call i32 (i32, i8*, ...) @fprintf(i32 %75, i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str.3, i64 0, i64 0), i32 %71, i32 %71)
br label %91
82: ; preds = %57
%83 = call i32 @ssytrs_(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32* %5, i32* %8, float* %59, i32* %5, i32* %64, float* %2, i32* %5, i32* %7)
%84 = load i32, i32* %7
%85 = icmp slt i32 %84, 0
br i1 %85, label %86, label %91
86: ; preds = %82
%87 = load i32, i32* @stderr
%88 = sub nsw i32 0, %84
%89 = call i32 (i32, i8*, ...) @fprintf(i32 %87, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.4, i64 0, i64 0), i32 %88)
%90 = call i32 @exit(i32 1)
unreachable
91: ; preds = %82, %80, %19
%92 = phi i32 [ 0, %80 ], [ 1, %19 ], [ 1, %82 ]
ret i32 %92
}