#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*/ free_ivector(int *, int /*<<< orphan*/, int);
int *ivector(int /*<<< orphan*/, int);
int /*<<< orphan*/ lu_backsub(double **, int, int *, double *);
scalar_t__ lu_decomp(double **, int, int *, double *);
int solve_se(double **a, double *b, int n) {
  double rip;
  int *pivx, PIVX[10];
  if (n <= 10)
    pivx = PIVX;
  else
    pivx = ivector(0, n - 1);
  if (lu_decomp(a, n, pivx, &rip)) {
    if (pivx != PIVX)
      free_ivector(pivx, 0, n - 1);
    return 1;
  }
  lu_backsub(a, n, pivx, b);
  if (pivx != PIVX)
    free_ivector(pivx, 0, n - 1);
  return 0;
}


x86 assembly (clang, -O0):
<solve_se>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpl   $0xa,-0x1c(%rbp)
jg     116a <solve_se+0x2a>
lea    -0x60(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    117b <solve_se+0x3b>
mov    -0x1c(%rbp),%esi
sub    $0x1,%esi
xor    %edi,%edi
call   1060 <ivector@plt>
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x30(%rbp),%rdx
lea    -0x28(%rbp),%rcx
call   1050 <lu_decomp@plt>
cmp    $0x0,%rax
je     11c7 <solve_se+0x87>
mov    -0x30(%rbp),%rax
lea    -0x60(%rbp),%rcx
cmp    %rcx,%rax
je     11bb <solve_se+0x7b>
mov    -0x30(%rbp),%rdi
mov    -0x1c(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1040 <free_ivector@plt>
movl   $0x1,-0x4(%rbp)
jmp    1204 <solve_se+0xc4>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x30(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <lu_backsub@plt>
mov    -0x30(%rbp),%rax
lea    -0x60(%rbp),%rcx
cmp    %rcx,%rax
je     11fd <solve_se+0xbd>
mov    -0x30(%rbp),%rdi
mov    -0x1c(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1040 <free_ivector@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve_se>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x40,%rsp
mov    %edx,%ebx
mov    %rsi,%r15
mov    %rdi,%r12
cmp    $0xa,%edx
jg     1160 <solve_se+0x20>
lea    0x10(%rsp),%r14
jmp    116d <solve_se+0x2d>
lea    -0x1(%rbx),%esi
xor    %edi,%edi
call   1060 <ivector@plt>
mov    %rax,%r14
lea    0x8(%rsp),%rcx
mov    %r12,%rdi
mov    %ebx,%esi
mov    %r14,%rdx
call   1050 <lu_decomp@plt>
test   %rax,%rax
je     118b <solve_se+0x4b>
mov    $0x1,%ebp
jmp    119d <solve_se+0x5d>
mov    %r12,%rdi
mov    %ebx,%esi
mov    %r14,%rdx
mov    %r15,%rcx
call   1030 <lu_backsub@plt>
xor    %ebp,%ebp
lea    0x10(%rsp),%rax
cmp    %rax,%r14
je     11b6 <solve_se+0x76>
add    $0xffffffff,%ebx
mov    %r14,%rdi
xor    %esi,%esi
mov    %ebx,%edx
call   1040 <free_ivector@plt>
mov    %ebp,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @solve_se(double** %0, double* %1, i32 %2) {
%4 = alloca i32
%5 = alloca double**
%6 = alloca double*
%7 = alloca i32
%8 = alloca double
%9 = alloca i32*
%10 = alloca [10 x i32]
store double** %0, double*** %5
store double* %1, double** %6
store i32 %2, i32* %7
%11 = load i32, i32* %7
%12 = icmp sle i32 %11, 10
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = getelementptr inbounds [10 x i32], [10 x i32]* %10, i64 0, i64 0
store i32* %14, i32** %9
br label %19
15: ; preds = %3
%16 = load i32, i32* %7
%17 = sub nsw i32 %16, 1
%18 = call i32* @ivector(i32 0, i32 %17)
store i32* %18, i32** %9
br label %19
19: ; preds = %15, %13
%20 = load double**, double*** %5
%21 = load i32, i32* %7
%22 = load i32*, i32** %9
%23 = call i64 @lu_decomp(double** %20, i32 %21, i32* %22, double* %8)
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %35
25: ; preds = %19
%26 = load i32*, i32** %9
%27 = getelementptr inbounds [10 x i32], [10 x i32]* %10, i64 0, i64 0
%28 = icmp ne i32* %26, %27
br i1 %28, label %29, label %34
29: ; preds = %25
%30 = load i32*, i32** %9
%31 = load i32, i32* %7
%32 = sub nsw i32 %31, 1
%33 = call i32 @free_ivector(i32* %30, i32 0, i32 %32)
br label %34
34: ; preds = %29, %25
store i32 1, i32* %4
br label %50
35: ; preds = %19
%36 = load double**, double*** %5
%37 = load i32, i32* %7
%38 = load i32*, i32** %9
%39 = load double*, double** %6
%40 = call i32 @lu_backsub(double** %36, i32 %37, i32* %38, double* %39)
%41 = load i32*, i32** %9
%42 = getelementptr inbounds [10 x i32], [10 x i32]* %10, i64 0, i64 0
%43 = icmp ne i32* %41, %42
br i1 %43, label %44, label %49
44: ; preds = %35
%45 = load i32*, i32** %9
%46 = load i32, i32* %7
%47 = sub nsw i32 %46, 1
%48 = call i32 @free_ivector(i32* %45, i32 0, i32 %47)
br label %49
49: ; preds = %44, %35
store i32 0, i32* %4
br label %50
50: ; preds = %49, %34
%51 = load i32, i32* %4
ret i32 %51
}

LLVM IR (-O2):
define i32 @solve_se(double** %0, double* %1, i32 %2) {
%4 = alloca double
%5 = alloca [10 x i32]
%6 = bitcast double* %4 to i8*
%7 = bitcast [10 x i32]* %5 to i8*
%8 = icmp slt i32 %2, 11
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 0
br label %14
11: ; preds = %3
%12 = add nsw i32 %2, -1
%13 = tail call i32* @ivector(i32 0, i32 %12)
br label %14
14: ; preds = %11, %9
%15 = phi i32* [ %10, %9 ], [ %13, %11 ]
%16 = call i64 @lu_decomp(double** %0, i32 %2, i32* %15, double* %4)
%17 = icmp eq i64 %16, 0
br i1 %17, label %21, label %18
18: ; preds = %14
%19 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 0
%20 = icmp eq i32* %15, %19
br i1 %20, label %29, label %25
21: ; preds = %14
%22 = call i32 @lu_backsub(double** %0, i32 %2, i32* %15, double* %1)
%23 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 0
%24 = icmp eq i32* %15, %23
br i1 %24, label %29, label %25
25: ; preds = %21, %18
%26 = phi i32 [ 1, %18 ], [ 0, %21 ]
%27 = add nsw i32 %2, -1
%28 = call i32 @free_ivector(i32* %15, i32 0, i32 %27)
br label %29
29: ; preds = %25, %21, %18
%30 = phi i32 [ 1, %18 ], [ 0, %21 ], [ %26, %25 ]
ret i32 %30
}