#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 *, char *);
int main() {
  char sex, nome[200];
  printf("Digite o seu nome: ");
  scanf(" %[^\n]s", nome);
  printf("\nDigite seu sexo f ou m:");
  scanf("%s", &sex);
  if (sex == 'm' || sex == 'M')
    printf("Bem vindo Senhor %s\n", nome);
  else if (sex == 'f' || sex == 'F')
    printf("Bem vinda Senhora %s\n", nome);
  else
    printf("\n ERRO! \n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xd0(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1040 <scanf@plt>
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x6d,%eax
je     118b <main+0x6b>
movsbl -0x5(%rbp),%eax
cmp    $0x4d,%eax
jne    11a5 <main+0x85>
lea    -0xd0(%rbp),%rsi
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ec <main+0xcc>
movsbl -0x5(%rbp),%eax
cmp    $0x66,%eax
je     11bf <main+0x9f>
movsbl -0x5(%rbp),%eax
cmp    $0x46,%eax
jne    11d9 <main+0xb9>
lea    -0xd0(%rbp),%rsi
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e7 <main+0xc7>
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ec <main+0xcc>
mov    -0x4(%rbp),%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0xd8,%rsp
lea    0xec2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec8(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1050 <scanf@plt>
lea    0xebf(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeca(%rip),%rdi
lea    0xf(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xf(%rsp),%al
and    $0xdf,%al
cmp    $0x46,%al
je     118c <main+0x5c>
cmp    $0x4d,%al
jne    11a1 <main+0x71>
lea    0xeae(%rip),%rdi
jmp    1193 <main+0x63>
lea    0xeba(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11ad <main+0x7d>
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0xd8,%rsp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Digite o seu nome: \00"
@.str.1 = [8 x i8] c" %[^\0A]s\00"
@.str.2 = [25 x i8] c"\0ADigite seu sexo f ou m:\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [21 x i8] c"Bem vindo Senhor %s\0A\00"
@.str.5 = [22 x i8] c"Bem vinda Senhora %s\0A\00"
@.str.6 = [10 x i8] c"\0A ERRO! \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca [200 x i8]
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%6 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %2)
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 109
br i1 %11, label %16, label %12
12: ; preds = %0
%13 = load i8, i8* %2
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 77
br i1 %15, label %16, label %19
16: ; preds = %12, %0
%17 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i8* %17)
br label %33
19: ; preds = %12
%20 = load i8, i8* %2
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 102
br i1 %22, label %27, label %23
23: ; preds = %19
%24 = load i8, i8* %2
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 70
br i1 %26, label %27, label %30
27: ; preds = %23, %19
%28 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i8* %28)
br label %32
30: ; preds = %23
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
br label %32
32: ; preds = %30, %27
br label %33
33: ; preds = %32, %16
%34 = load i32, i32* %1
ret i32 %34
}

LLVM IR (-O2):
@.str = [20 x i8] c"Digite o seu nome: \00"
@.str.1 = [8 x i8] c" %[^\0A]s\00"
@.str.2 = [25 x i8] c"\0ADigite seu sexo f ou m:\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [21 x i8] c"Bem vindo Senhor %s\0A\00"
@.str.5 = [22 x i8] c"Bem vinda Senhora %s\0A\00"
@str = [9 x i8] c"\0A ERRO! \00"
define i32 @main() {
%1 = alloca i8
%2 = alloca [200 x i8]
%3 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %1)
%8 = load i8, i8* %1
%9 = and i8 %8, -33
switch i8 %9, label %14 [
i8 77, label %10
i8 70, label %12
]
10: ; preds = %0
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i8* %3)
br label %16
12: ; preds = %0
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i8* %3)
br label %16
14: ; preds = %0
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
br label %16
16: ; preds = %12, %14, %10
ret i32 0
}