#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 */
double *crear_vector(int);
int /*<<< orphan*/ destruye_vector(double *);
int /*<<< orphan*/ lu_decompose(double **, int, double *, double *);
int /*<<< orphan*/ lu_sustitucion(double **, double *, int, double *, double *);
void lu_decomp(double **a, double *b, int n, double *x) {
  double *O, *S;
  O = crear_vector(n);
  S = crear_vector(n);
  lu_decompose(a, n, O, S);
  lu_sustitucion(a, O, n, b, x);
  destruye_vector(S);
  destruye_vector(O);
}


x86 assembly (clang, -O0):
<lu_decomp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x14(%rbp),%edi
call   1060 <crear_vector@plt>
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%edi
call   1060 <crear_vector@plt>
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rcx
call   1040 <lu_decompose@plt>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%r8
call   1030 <lu_sustitucion@plt>
mov    -0x30(%rbp),%rdi
call   1050 <destruye_vector@plt>
mov    -0x28(%rbp),%rdi
call   1050 <destruye_vector@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lu_decomp>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %edx,%ebp
mov    %rsi,%r15
mov    %rdi,%r12
mov    %edx,%edi
call   1060 <crear_vector@plt>
mov    %rax,%rbx
mov    %ebp,%edi
call   1060 <crear_vector@plt>
mov    %rax,%r13
mov    %r12,%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1040 <lu_decompose@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
mov    %r15,%rcx
mov    %r14,%r8
call   1030 <lu_sustitucion@plt>
mov    %r13,%rdi
call   1050 <destruye_vector@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <destruye_vector@plt>

LLVM IR (-O0):
define void @lu_decomp(double** %0, double* %1, i32 %2, double* %3) {
%5 = alloca double**
%6 = alloca double*
%7 = alloca i32
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
store double** %0, double*** %5
store double* %1, double** %6
store i32 %2, i32* %7
store double* %3, double** %8
%11 = load i32, i32* %7
%12 = call double* @crear_vector(i32 %11)
store double* %12, double** %9
%13 = load i32, i32* %7
%14 = call double* @crear_vector(i32 %13)
store double* %14, double** %10
%15 = load double**, double*** %5
%16 = load i32, i32* %7
%17 = load double*, double** %9
%18 = load double*, double** %10
%19 = call i32 @lu_decompose(double** %15, i32 %16, double* %17, double* %18)
%20 = load double**, double*** %5
%21 = load double*, double** %9
%22 = load i32, i32* %7
%23 = load double*, double** %6
%24 = load double*, double** %8
%25 = call i32 @lu_sustitucion(double** %20, double* %21, i32 %22, double* %23, double* %24)
%26 = load double*, double** %10
%27 = call i32 @destruye_vector(double* %26)
%28 = load double*, double** %9
%29 = call i32 @destruye_vector(double* %28)
ret void
}

LLVM IR (-O2):
define void @lu_decomp(double** %0, double* %1, i32 %2, double* %3) {
%5 = tail call double* @crear_vector(i32 %2)
%6 = tail call double* @crear_vector(i32 %2)
%7 = tail call i32 @lu_decompose(double** %0, i32 %2, double* %5, double* %6)
%8 = tail call i32 @lu_sustitucion(double** %0, double* %5, i32 %2, double* %1, double* %3)
%9 = tail call i32 @destruye_vector(double* %6)
%10 = tail call i32 @destruye_vector(double* %5)
ret void
}