#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*/ printf(char *);
int /*<<< orphan*/ raices_a();
int /*<<< orphan*/ raices_c();
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ system(char *);
void raices() {
  int menu;
  printf("Elegir el tipo de solucion\n");
  printf("1.- Raices Cerradas\n2.- Raices Abiertas\n");
  scanf("%d", &menu);
  switch (menu) {
  case 1:
    raices_c();
    break;
  case 2:
    raices_a();
    break;
  default:
    system("cls");
    printf("Opcion incorrecta\n");
    raices();
    break;
  }
}


x86 assembly (clang, -O0):
<raices>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xe91(%rip),%rdi
call   1060 <printf@plt>
lea    0xea1(%rip),%rdi
call   1060 <printf@plt>
lea    0xebe(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1070 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x1,%eax
je     11b5 <raices+0x55>
jmp    11a4 <raices+0x44>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
je     11c1 <raices+0x61>
jmp    11cd <raices+0x6d>
mov    $0x0,%al
call   1040 <raices_c@plt>
jmp    11ea <raices+0x8a>
mov    $0x0,%al
call   1030 <raices_a@plt>
jmp    11ea <raices+0x8a>
lea    0xe74(%rip),%rdi
call   1050 <system@plt>
lea    0xe6c(%rip),%rdi
call   1060 <printf@plt>
call   1080 <raices@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raices>:
push   %rax
lea    0xe9f(%rip),%rdi
call   1050 <puts@plt>
lea    0xeae(%rip),%rdi
call   1050 <puts@plt>
lea    0xe80(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1070 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x2,%eax
je     11a1 <raices+0x41>
cmp    $0x1,%eax
jne    11aa <raices+0x4a>
xor    %eax,%eax
call   1040 <raices_c@plt>
pop    %rax
ret
xor    %eax,%eax
call   1030 <raices_a@plt>
pop    %rax
ret
lea    0xe52(%rip),%rdi
call   1060 <system@plt>
lea    0xe8d(%rip),%rdi
call   1050 <puts@plt>
call   1080 <raices@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Elegir el tipo de solucion\0A\00"
@.str.1 = [41 x i8] c"1.- Raices Cerradas\0A2.- Raices Abiertas\0A\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [4 x i8] c"cls\00"
@.str.4 = [19 x i8] c"Opcion incorrecta\0A\00"
define void @raices() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
switch i32 %5, label %10 [
i32 1, label %6
i32 2, label %8
]
6: ; preds = %0
%7 = call i32 (...) @raices_c()
br label %13
8: ; preds = %0
%9 = call i32 (...) @raices_a()
br label %13
10: ; preds = %0
%11 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
br label %13
13: ; preds = %10, %8, %6
ret void
}

LLVM IR (-O2):
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [4 x i8] c"cls\00"
@str = [27 x i8] c"Elegir el tipo de solucion\00"
@str.5 = [40 x i8] c"1.- Raices Cerradas\0A2.- Raices Abiertas\00"
@str.6 = [18 x i8] c"Opcion incorrecta\00"
define void @raices() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.5, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
switch i32 %6, label %11 [
i32 1, label %7
i32 2, label %9
]
7: ; preds = %0
%8 = call i32 (...) @raices_c()
br label %14
9: ; preds = %0
%10 = call i32 (...) @raices_a()
br label %14
11: ; preds = %0
%12 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.6, i64 0, i64 0))
br label %14
14: ; preds = %11, %9, %7
ret void
}