#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 */
char getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char **);
main() {
  char exe[8] = "./ex";
  while ((exe[4] != '0') && (exe[5] != '0')) {
    printf("\nBem Vindo Marco Tulio\n\n");
    printf("\n\t\tProgramação I - Lista 02\n\n");
    printf("(01)-Exercicio 01\t(02)-Exercicio 02\t(03)-Exercicio "
           "03\n(04)-Exercicio 04\t(05)-Exercicio 05\t(06)-Exercicio "
           "06\n(07)-Exercicio 07\t(08)-Exercicio 08\t(09)-Exercicio "
           "09\n(10)-Exercicio 10\t(11)-Exercicio 11\t(12)-Exercicio "
           "12\n(13)-Exercicio 13\t(14)-Exercicio 14\t(15)-Exercicio "
           "15\n(16)-Exercicio 16\t(17)-Exercicio 17\t(18)-Exercicio "
           "18\n(19)-Exercicio 19\t(20)-Exercicio 20\nQual exercicio vc deseja "
           "executar?: ");
    exe[4] = getchar();
    exe[5] = getchar();
    if ((exe[4] != '0') && (exe[5] != '0'))
      system(&exe);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0xc(%rbp)
movsbl -0x8(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0xd(%rbp)
je     1169 <main+0x39>
movsbl -0x7(%rbp),%eax
cmp    $0x30,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1179 <main+0x49>
jmp    11d9 <main+0xa9>
lea    0xe88(%rip),%rdi
call   1040 <printf@plt>
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x8(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x7(%rbp)
movsbl -0x8(%rbp),%eax
cmp    $0x30,%eax
je     11d4 <main+0xa4>
movsbl -0x7(%rbp),%eax
cmp    $0x30,%eax
je     11d4 <main+0xa4>
lea    -0xc(%rbp),%rdi
call   1030 <system@plt>
jmp    114a <main+0x1a>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movq   $0x78652f2e,(%rsp)
78
lea    0x1033(%rip),%r14
lea    0x1044(%rip),%r15
lea    0xe98(%rip),%r13
mov    %rsp,%r12
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %r13,%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    %eax,%ebx
mov    %al,0x4(%rsp)
xor    %eax,%eax
call   1060 <getchar@plt>
mov    %eax,%ebp
mov    %al,0x5(%rsp)
cmp    $0x30,%bl
je     11b5 <main+0x75>
cmp    $0x30,%bpl
je     11b5 <main+0x75>
mov    %r12,%rdi
call   1040 <system@plt>
cmp    $0x30,%bl
je     11c0 <main+0x80>
cmp    $0x30,%bpl
jne    1170 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.exe = [8 x i8] c"./ex\00\00\00\00"
@.str = [25 x i8] c"\0ABem Vindo Marco Tulio\0A\0A\00"
@.str.1 = [32 x i8] c"\0A\09\09Programa\C3\A7\C3\A3o I - Lista 02\0A\0A\00"
@.str.2 = [397 x i8] c"(01)-Exercicio 01\09(02)-Exercicio 02\09(03)-Exercicio 03\0A(04)-Exercicio 04\09(05)-Exercicio 05\09(06)-Exercicio 06\0A(07)-Exercicio 07\09(08)-Exercicio 08\09(09)-Exercicio 09\0A(10)-Exercicio 10\09(11)-Exercicio 11\09(12)-Exercicio 12\0A(13)-Exercicio 13\09(14)-Exercicio 14\09(15)-Exercicio 15\0A(16)-Exercicio 16\09(17)-Exercicio 17\09(18)-Exercicio 18\0A(19)-Exercicio 19\09(20)-Exercicio 20\0AQual exercicio vc deseja executar?: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i8]
store i32 0, i32* %1
%3 = bitcast [8 x i8]* %2 to i8*
br label %4
4: ; preds = %36, %0
%5 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 48
br i1 %8, label %9, label %14
9: ; preds = %4
%10 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 5
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 48
br label %14
14: ; preds = %9, %4
%15 = phi i1 [ false, %4 ], [ %13, %9 ]
br i1 %15, label %16, label %37
16: ; preds = %14
%17 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%18 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%19 = call i32 @printf(i8* getelementptr inbounds ([397 x i8], [397 x i8]* @.str.2, i64 0, i64 0))
%20 = call signext i8 (...) @getchar()
%21 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 4
store i8 %20, i8* %21
%22 = call signext i8 (...) @getchar()
%23 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 5
store i8 %22, i8* %23
%24 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 4
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp ne i32 %26, 48
br i1 %27, label %28, label %36
28: ; preds = %16
%29 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 5
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = icmp ne i32 %31, 48
br i1 %32, label %33, label %36
33: ; preds = %28
%34 = bitcast [8 x i8]* %2 to i8**
%35 = call i32 @system(i8** %34)
br label %36
36: ; preds = %33, %28, %16
br label %4
37: ; preds = %14
%38 = load i32, i32* %1
ret i32 %38
}

LLVM IR (-O2):
@.str.2 = [397 x i8] c"(01)-Exercicio 01\09(02)-Exercicio 02\09(03)-Exercicio 03\0A(04)-Exercicio 04\09(05)-Exercicio 05\09(06)-Exercicio 06\0A(07)-Exercicio 07\09(08)-Exercicio 08\09(09)-Exercicio 09\0A(10)-Exercicio 10\09(11)-Exercicio 11\09(12)-Exercicio 12\0A(13)-Exercicio 13\09(14)-Exercicio 14\09(15)-Exercicio 15\0A(16)-Exercicio 16\09(17)-Exercicio 17\09(18)-Exercicio 18\0A(19)-Exercicio 19\09(20)-Exercicio 20\0AQual exercicio vc deseja executar?: \00"
@str = [24 x i8] c"\0ABem Vindo Marco Tulio\0A\00"
@str.3 = [31 x i8] c"\0A\09\09Programa\C3\A7\C3\A3o I - Lista 02\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to [8 x i8]*
%3 = bitcast i64* %1 to i8*
store i64 2019897134, i64* %1
%4 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 4
%5 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 5
%6 = bitcast i64* %1 to i8**
br label %7
7: ; preds = %0, %18
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.3, i64 0, i64 0))
%10 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([397 x i8], [397 x i8]* @.str.2, i64 0, i64 0))
%11 = tail call signext i8 (...) @getchar()
store i8 %11, i8* %4
%12 = tail call signext i8 (...) @getchar()
store i8 %12, i8* %5
%13 = icmp ne i8 %11, 48
%14 = icmp ne i8 %12, 48
%15 = and i1 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %7
%17 = call i32 @system(i8** %6)
br label %18
18: ; preds = %16, %7
%19 = and i1 %13, %14
br i1 %19, label %7, label %20
20: ; preds = %18
ret i32 0
}