#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*/ Bloque1();
int /*<<< orphan*/ Bloque2();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf_s(char *, int *);
int /*<<< orphan*/ system(char *);
int main() {
  int num = 0;
  printf("Ejercicios del pdf para la preparacion del parcial\n");
  printf("Selecciona el 1r o el 2ndo bloque:  ");
  scanf_s("%i", &num);
  switch (num) {
  case 1:
    Bloque1();
    break;
  case 2:
    Bloque2();
    break;
  default:
    break;
  }
  system("pause");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xe93(%rip),%rdi
call   1050 <printf@plt>
lea    0xebb(%rip),%rdi
call   1050 <printf@plt>
lea    0xed4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1070 <scanf_s@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     11b3 <main+0x63>
jmp    11a2 <main+0x52>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     11bf <main+0x6f>
jmp    11cb <main+0x7b>
mov    $0x0,%al
call   1060 <Bloque1@plt>
jmp    11d0 <main+0x80>
mov    $0x0,%al
call   1030 <Bloque2@plt>
jmp    11d0 <main+0x80>
jmp    11d0 <main+0x80>
lea    0xe85(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xebe(%rip),%rdi
call   1030 <puts@plt>
lea    0xe84(%rip),%rdi
call   1060 <printf@plt>
lea    0xe9d(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1080 <scanf_s@plt>
mov    0x4(%rsp),%eax
cmp    $0x2,%eax
je     11a9 <main+0x49>
cmp    $0x1,%eax
jne    11b0 <main+0x50>
xor    %eax,%eax
call   1070 <Bloque1@plt>
jmp    11b0 <main+0x50>
xor    %eax,%eax
call   1040 <Bloque2@plt>
lea    0xe71(%rip),%rdi
call   1050 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [52 x i8] c"Ejercicios del pdf para la preparacion del parcial\0A\00"
@.str.1 = [37 x i8] c"Selecciona el 1r o el 2ndo bloque: \00"
@.str.2 = [3 x i8] c"%i\00"
@.str.3 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
switch i32 %6, label %11 [
i32 1, label %7
i32 2, label %9
]
7: ; preds = %0
%8 = call i32 (...) @Bloque1()
br label %12
9: ; preds = %0
%10 = call i32 (...) @Bloque2()
br label %12
11: ; preds = %0
br label %12
12: ; preds = %11, %9, %7
%13 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [37 x i8] c"Selecciona el 1r o el 2ndo bloque: \00"
@.str.2 = [3 x i8] c"%i\00"
@.str.3 = [6 x i8] c"pause\00"
@str = [51 x i8] c"Ejercicios del pdf para la preparacion del parcial\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf_s(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 (...) @Bloque1()
br label %11
9: ; preds = %0
%10 = call i32 (...) @Bloque2()
br label %11
11: ; preds = %0, %9, %7
%12 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}