#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*/ exe01();
int /*<<< orphan*/ exe02();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int opc;
  do {
    printf("---------------------------------------------------------\n");
    printf("EXERCICIO 01 - EM SEGUNDOS\n");
    printf("EXERCICIO 02 - QUEDA LIVRE\n");
    printf("---------------------------------------------------------\n");
    scanf("%d", &opc);
    switch (opc) {
    case 1: {
      exe01();
      break;
    }
    case 2: {
      exe02();
      break;
    }
    }
  } while ((opc < 1) || (opc > 10));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
mov    %rdi,-0x18(%rbp)
call   1040 <printf@plt>
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
lea    0xee5(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1040 <printf@plt>
lea    0xeec(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     11b5 <main+0x75>
jmp    11a4 <main+0x64>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     11c1 <main+0x81>
jmp    11c8 <main+0x88>
mov    $0x0,%al
call   1030 <exe01@plt>
jmp    11c8 <main+0x88>
mov    $0x0,%al
call   1050 <exe02@plt>
jmp    11cd <main+0x8d>
mov    $0x1,%al
cmpl   $0x1,-0x8(%rbp)
mov    %al,-0x19(%rbp)
jl     11e6 <main+0xa6>
cmpl   $0xa,-0x8(%rbp)
setg   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    114f <main+0xf>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xee5(%rip),%rbx
lea    0xea8(%rip),%r14
lea    0xebc(%rip),%r15
lea    0xe97(%rip),%r12
lea    0xc(%rsp),%r13
jmp    1183 <main+0x43>
xor    %eax,%eax
call   1050 <exe02@plt>
mov    0xc(%rsp),%eax
add    $0xfffffff5,%eax
cmp    $0xfffffff6,%eax
jae    11c5 <main+0x85>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
mov    %r13,%rsi
call   1060 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    $0x2,%eax
je     1170 <main+0x30>
cmp    $0x1,%eax
jne    1177 <main+0x37>
xor    %eax,%eax
call   1040 <exe01@plt>
jmp    1177 <main+0x37>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [59 x i8] c"---------------------------------------------------------\0A\00"
@.str.1 = [28 x i8] c"EXERCICIO 01 - EM SEGUNDOS\0A\00"
@.str.2 = [28 x i8] c"EXERCICIO 02 - QUEDA LIVRE\0A\00"
@.str.3 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %21, %0
%4 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %2
switch i32 %9, label %14 [
i32 1, label %10
i32 2, label %12
]
10: ; preds = %3
%11 = call i32 (...) @exe01()
br label %14
12: ; preds = %3
%13 = call i32 (...) @exe02()
br label %14
14: ; preds = %3, %12, %10
br label %15
15: ; preds = %14
%16 = load i32, i32* %2
%17 = icmp slt i32 %16, 1
br i1 %17, label %21, label %18
18: ; preds = %15
%19 = load i32, i32* %2
%20 = icmp sgt i32 %19, 10
br label %21
21: ; preds = %18, %15
%22 = phi i1 [ true, %15 ], [ %20, %18 ]
br i1 %22, label %3, label %23
23: ; preds = %21
ret i32 0
}

LLVM IR (-O2):
@.str.3 = [3 x i8] c"%d\00"
@str.4 = [27 x i8] c"EXERCICIO 01 - EM SEGUNDOS\00"
@str.5 = [27 x i8] c"EXERCICIO 02 - QUEDA LIVRE\00"
@str.6 = [58 x i8] c"---------------------------------------------------------\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %14, %0
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.6, i64 0, i64 0))
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.4, i64 0, i64 0))
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.5, i64 0, i64 0))
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.6, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %1)
%9 = load i32, i32* %1
switch i32 %9, label %14 [
i32 1, label %10
i32 2, label %12
]
10: ; preds = %3
%11 = call i32 (...) @exe01()
br label %14
12: ; preds = %3
%13 = call i32 (...) @exe02()
br label %14
14: ; preds = %10, %12, %3
%15 = load i32, i32* %1
%16 = add i32 %15, -11
%17 = icmp ult i32 %16, -10
br i1 %17, label %3, label %18
18: ; preds = %14
ret i32 0
}