#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*/ scanf(char *, ...);
int main() {
  int opcao;
  printf("Bem Vindo ! \n O que deseja fazer ? \n 1 - Se cadastrar \n 2 - "
         "Reservar um lugar \n");
  scanf("%d", &opcao);
  if (opcao == 1) {
    int tipoPessoa;
    printf("Você é: \n 1 - Professor \n 2 - Aluno \n 3 - Convidado \n 4 - "
           "Portador de necessidade especial \n");
    scanf("%d", &tipoPessoa);
    switch (tipoPessoa) {
    case 1: {
      char nomePessoa[31], rgPessoa[10], emailPessoa[65];
      printf("Informe seu nome completo: ");
      scanf("%30s", nomePessoa);
      printf("Informe seu RG: ");
      scanf("%9s", rgPessoa);
      printf("Informe seu E-mail: ");
      scanf("%64s", emailPessoa);
    }
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0b(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
cmpl   $0x1,-0x8(%rbp)
jne    11e8 <main+0xc8>
lea    0xef2(%rip),%rdi
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
xor    %eax,%eax
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
jne    11e3 <main+0xc3>
jmp    1189 <main+0x69>
lea    0xf22(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rsi
lea    0xf2e(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xf25(%rip),%rdi
call   1030 <printf@plt>
lea    -0x3a(%rbp),%rsi
lea    0xf26(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xf1c(%rip),%rdi
call   1030 <printf@plt>
lea    -0x80(%rbp),%rsi
lea    0xf21(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
jmp    11e8 <main+0xc8>
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x88,%rsp
lea    0xf15(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb6(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cmpl   $0x1,0x10(%rsp)
jne    11e4 <main+0xb4>
lea    0xf3a(%rip),%rdi
call   1030 <puts@plt>
lea    0xe8c(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cmpl   $0x1,0xc(%rsp)
jne    11e4 <main+0xb4>
lea    0xe75(%rip),%rdi
call   1040 <printf@plt>
lea    0xe85(%rip),%rdi
lea    0x20(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xe77(%rip),%rdi
call   1040 <printf@plt>
lea    0xe7c(%rip),%rdi
lea    0x16(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xe6d(%rip),%rdi
call   1040 <printf@plt>
lea    0xe76(%rip),%rdi
lea    0x40(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
xor    %eax,%eax
add    $0x88,%rsp
ret

LLVM IR (-O0):
@.str = [80 x i8] c"Bem Vindo ! \0A O que deseja fazer ? \0A 1 - Se cadastrar \0A 2 - Reservar um lugar \0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [95 x i8] c"Voc\C3\AA \C3\A9: \0A 1 - Professor \0A 2 - Aluno \0A 3 - Convidado \0A 4 - Portador de necessidade especial \0A\00"
@.str.3 = [28 x i8] c"Informe seu nome completo: \00"
@.str.4 = [5 x i8] c"%30s\00"
@.str.5 = [17 x i8] c"Informe seu RG: \00"
@.str.6 = [4 x i8] c"%9s\00"
@.str.7 = [21 x i8] c"Informe seu E-mail: \00"
@.str.8 = [5 x i8] c"%64s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [31 x i8]
%5 = alloca [10 x i8]
%6 = alloca [65 x i8]
store i32 0, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %26
11: ; preds = %0
%12 = call i32 @printf(i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%14 = load i32, i32* %3
switch i32 %14, label %25 [
i32 1, label %15
]
15: ; preds = %11
%16 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%17 = getelementptr inbounds [31 x i8], [31 x i8]* %4, i64 0, i64 0
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* %17)
%19 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
%20 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%21 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %20)
%22 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0))
%23 = getelementptr inbounds [65 x i8], [65 x i8]* %6, i64 0, i64 0
%24 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* %23)
br label %25
25: ; preds = %15, %11
br label %26
26: ; preds = %25, %0
%27 = load i32, i32* %1
ret i32 %27
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [28 x i8] c"Informe seu nome completo: \00"
@.str.4 = [5 x i8] c"%30s\00"
@.str.5 = [17 x i8] c"Informe seu RG: \00"
@.str.6 = [4 x i8] c"%9s\00"
@.str.7 = [21 x i8] c"Informe seu E-mail: \00"
@.str.8 = [5 x i8] c"%64s\00"
@str = [79 x i8] c"Bem Vindo ! \0A O que deseja fazer ? \0A 1 - Se cadastrar \0A 2 - Reservar um lugar \00"
@str.9 = [94 x i8] c"Voc\C3\AA \C3\A9: \0A 1 - Professor \0A 2 - Aluno \0A 3 - Convidado \0A 4 - Portador de necessidade especial \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [31 x i8]
%4 = alloca [10 x i8]
%5 = alloca [65 x i8]
%6 = bitcast i32* %1 to i8*
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%9 = load i32, i32* %1
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %28
11: ; preds = %0
%12 = bitcast i32* %2 to i8*
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([94 x i8], [94 x i8]* @str.9, i64 0, i64 0))
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 1
br i1 %16, label %17, label %27
17: ; preds = %11
%18 = getelementptr inbounds [31 x i8], [31 x i8]* %3, i64 0, i64 0
%19 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%20 = getelementptr inbounds [65 x i8], [65 x i8]* %5, i64 0, i64 0
%21 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* %18)
%23 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
%24 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %19)
%25 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0))
%26 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* %20)
br label %27
27: ; preds = %11, %17
br label %28
28: ; preds = %27, %0
ret i32 0
}