#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 **);
scalar_t__ strcmp(char *, char *);
int main(void) {
  char letra[10];
  printf("Insira seu sexo\n");
  scanf("%s", &letra);
  if ((strcmp(letra, "F") == 0))
    printf("Feminino\n");
  else if ((strcmp(letra, "M") == 0))
    printf("Masculino\n");
  else
    printf("Sexo invalido!!!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    -0xe(%rbp),%rsi
lea    0xebb(%rip),%rdi
call   1050 <scanf@plt>
lea    -0xe(%rbp),%rdi
lea    0xeae(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1186 <main+0x56>
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
jmp    11c2 <main+0x92>
lea    -0xe(%rbp),%rdi
lea    0xe8f(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11b1 <main+0x81>
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
jmp    11bd <main+0x8d>
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
jmp    11c2 <main+0x92>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb8(%rip),%rdi
lea    0x6(%rsp),%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
lea    0xea7(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1191 <main+0x61>
lea    0xe95(%rip),%rsi
lea    0x6(%rsp),%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
lea    0xea4(%rip),%rax
lea    0xe8c(%rip),%rdi
cmove  %rax,%rdi
jmp    1198 <main+0x68>
lea    0xe9a(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Insira seu sexo\0A\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [2 x i8] c"F\00"
@.str.3 = [10 x i8] c"Feminino\0A\00"
@.str.4 = [2 x i8] c"M\00"
@.str.5 = [11 x i8] c"Masculino\0A\00"
@.str.6 = [18 x i8] c"Sexo invalido!!!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = bitcast [10 x i8]* %2 to i8**
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %4)
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%7 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
br label %20
11: ; preds = %0
%12 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%13 = call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
br label %19
17: ; preds = %11
%18 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0))
br label %19
19: ; preds = %17, %15
br label %20
20: ; preds = %19, %9
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [2 x i8] c"F\00"
@.str.4 = [2 x i8] c"M\00"
@str = [16 x i8] c"Insira seu sexo\00"
@str.7 = [17 x i8] c"Sexo invalido!!!\00"
@str.8 = [10 x i8] c"Masculino\00"
@str.9 = [9 x i8] c"Feminino\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%4 = bitcast [10 x i8]* %1 to i8**
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %4)
%6 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %0
%9 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
%11 = select i1 %10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @str.8, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @str.7, i64 0, i64 0)
br label %12
12: ; preds = %8, %0
%13 = phi i8* [ getelementptr inbounds ([9 x i8], [9 x i8]* @str.9, i64 0, i64 0), %0 ], [ %11, %8 ]
%14 = call i32 @puts(i8* dereferenceable(1) %13)
ret i32 0
}