#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*/ init_gauss();
int /*<<< orphan*/ init_gauss_mod();
int /*<<< orphan*/ init_gauss_seid();
int /*<<< orphan*/ init_lu();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ system(char *);
void gauss() {
  int menu;
  printf("Elegir el metodo a realizar\n");
  printf("1.- Gauss Simple\n2.- Gauss Modificado\n3.- Gauss Seidel\n");
  printf("4.- LU\n");
  scanf("%d", &menu);
  switch (menu) {
  case 1:
    init_gauss();
    break;
  case 2:
    init_gauss_mod();
    break;
  case 3:
    init_gauss_seid();
    break;
  case 4:
    init_lu();
    break;
  default:
    system("cls");
    printf("Opcion incorrecta\n");
    gauss();
    break;
  }
}


x86 assembly (clang, -O0):
<gauss>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xe81(%rip),%rdi
call   1070 <printf@plt>
lea    0xe92(%rip),%rdi
call   1070 <printf@plt>
lea    0xebe(%rip),%rdi
call   1070 <printf@plt>
lea    0xeba(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1090 <scanf@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x3,%eax
ja     1215 <gauss+0x95>
mov    -0x10(%rbp),%rax
lea    0xe24(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1080 <init_gauss@plt>
jmp    1232 <gauss+0xb2>
mov    $0x0,%al
call   1030 <init_gauss_mod@plt>
jmp    1232 <gauss+0xb2>
mov    $0x0,%al
call   10a0 <init_gauss_seid@plt>
jmp    1232 <gauss+0xb2>
mov    $0x0,%al
call   1060 <init_lu@plt>
jmp    1232 <gauss+0xb2>
lea    0xe54(%rip),%rdi
call   1050 <system@plt>
lea    0xe4c(%rip),%rdi
call   1070 <printf@plt>
call   1040 <gauss@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gauss>:
push   %rax
lea    0xe8f(%rip),%rdi
call   1040 <puts@plt>
lea    0xe9f(%rip),%rdi
call   1040 <puts@plt>
lea    0xeca(%rip),%rdi
call   1040 <puts@plt>
lea    0xe64(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1090 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x3,%eax
ja     11db <gauss+0x5b>
lea    0xe37(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %eax,%eax
call   1080 <init_gauss@plt>
pop    %rax
ret
lea    0xe31(%rip),%rdi
call   1060 <system@plt>
lea    0xe83(%rip),%rdi
call   1040 <puts@plt>
call   1050 <gauss@plt>
pop    %rax
ret
xor    %eax,%eax
call   1030 <init_gauss_mod@plt>
pop    %rax
ret
xor    %eax,%eax
call   10a0 <init_gauss_seid@plt>
pop    %rax
ret
xor    %eax,%eax
call   1070 <init_lu@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Elegir el metodo a realizar\0A\00"
@.str.1 = [56 x i8] c"1.- Gauss Simple\0A2.- Gauss Modificado\0A3.- Gauss Seidel\0A\00"
@.str.2 = [8 x i8] c"4.- LU\0A\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [4 x i8] c"cls\00"
@.str.5 = [19 x i8] c"Opcion incorrecta\0A\00"
define void @gauss() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
switch i32 %6, label %15 [
i32 1, label %7
i32 2, label %9
i32 3, label %11
i32 4, label %13
]
7: ; preds = %0
%8 = call i32 (...) @init_gauss()
br label %18
9: ; preds = %0
%10 = call i32 (...) @init_gauss_mod()
br label %18
11: ; preds = %0
%12 = call i32 (...) @init_gauss_seid()
br label %18
13: ; preds = %0
%14 = call i32 (...) @init_lu()
br label %18
15: ; preds = %0
%16 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%17 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
br label %18
18: ; preds = %15, %13, %11, %9, %7
ret void
}

LLVM IR (-O2):
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [4 x i8] c"cls\00"
@str = [28 x i8] c"Elegir el metodo a realizar\00"
@str.6 = [55 x i8] c"1.- Gauss Simple\0A2.- Gauss Modificado\0A3.- Gauss Seidel\00"
@str.7 = [7 x i8] c"4.- LU\00"
@str.8 = [18 x i8] c"Opcion incorrecta\00"
define void @gauss() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.6, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.7, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
switch i32 %7, label %16 [
i32 1, label %8
i32 2, label %10
i32 3, label %12
i32 4, label %14
]
8: ; preds = %0
%9 = call i32 (...) @init_gauss()
br label %19
10: ; preds = %0
%11 = call i32 (...) @init_gauss_mod()
br label %19
12: ; preds = %0
%13 = call i32 (...) @init_gauss_seid()
br label %19
14: ; preds = %0
%15 = call i32 (...) @init_lu()
br label %19
16: ; preds = %0
%17 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.8, i64 0, i64 0))
br label %19
19: ; preds = %16, %14, %12, %10, %8
ret void
}