#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 EXIT_SUCCESS;
int /*<<< orphan*/ clear();
int /*<<< orphan*/ create(char *, char *);
int /*<<< orphan*/ draw(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char secret[100];
  char word[100];
  int erros = 0;
  char letra;
  printf("*Jogo da Forca, (c) 2015*\n");
  printf("Informe a palavra secreta: ");
  scanf("%s", secret);
  clear();
  create(secret, word);
  while (erros < 6) {
    printf("[%s]\n", word);
    draw(erros);
    printf("Informe uma letra:");
    scanf("%c", &letra);
    scanf("%c", &letra);
    printf("A letra informada foi: [%c]\n", letra);
    erros++;
  }
  draw(erros);
  printf("*FIM*\n");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xe4(%rbp)
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x70(%rbp),%rsi
lea    0xea4(%rip),%rdi
call   1060 <scanf@plt>
mov    $0x0,%al
call   1070 <clear@plt>
lea    -0x70(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1050 <create@plt>
cmpl   $0x6,-0xe4(%rbp)
jge    1239 <main+0xe9>
lea    -0xe0(%rbp),%rsi
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xe4(%rbp),%edi
call   1030 <draw@plt>
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe62(%rip),%rdi
lea    -0xe5(%rbp),%rsi
call   1060 <scanf@plt>
lea    0xe4f(%rip),%rdi
lea    -0xe5(%rbp),%rsi
call   1060 <scanf@plt>
movsbl -0xe5(%rbp),%esi
lea    0xe38(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xe4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe4(%rbp)
jmp    11af <main+0x5f>
mov    -0xe4(%rbp),%edi
call   1030 <draw@plt>
lea    0xe28(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2d87(%rip),%rax
mov    (%rax),%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xe8,%rsp
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
lea    0xe7c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe8a(%rip),%rdi
lea    0x80(%rsp),%rbx
mov    %rbx,%rsi
call   1070 <scanf@plt>
xor    %eax,%eax
call   1080 <clear@plt>
lea    0x10(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <create@plt>
lea    0xe5f(%rip),%r12
mov    %r12,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %edi,%edi
call   1040 <draw@plt>
lea    0xe4a(%rip),%r13
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe4c(%rip),%rbx
lea    0xf(%rsp),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1070 <scanf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1070 <scanf@plt>
movsbl 0xf(%rsp),%esi
lea    0xe28(%rip),%rbp
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r12,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%edi
call   1040 <draw@plt>
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1070 <scanf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1070 <scanf@plt>
movsbl 0xf(%rsp),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r12,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x2,%edi
call   1040 <draw@plt>
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1070 <scanf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1070 <scanf@plt>
movsbl 0xf(%rsp),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r12,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x3,%edi
call   1040 <draw@plt>
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1070 <scanf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1070 <scanf@plt>
movsbl 0xf(%rsp),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r12,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x4,%edi
call   1040 <draw@plt>
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1070 <scanf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1070 <scanf@plt>
movsbl 0xf(%rsp),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r12,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x5,%edi
call   1040 <draw@plt>
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1070 <scanf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1070 <scanf@plt>
movsbl 0xf(%rsp),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x6,%edi
call   1040 <draw@plt>
lea    0xce6(%rip),%rdi
call   1030 <puts@plt>
mov    0x2c48(%rip),%rax
mov    (%rax),%eax
add    $0xe8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [27 x i8] c"*Jogo da Forca, (c) 2015*\0A\00"
@.str.1 = [28 x i8] c"Informe a palavra secreta: \00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [6 x i8] c"[%s]\0A\00"
@.str.4 = [19 x i8] c"Informe uma letra:\00"
@.str.5 = [3 x i8] c"%c\00"
@.str.6 = [29 x i8] c"A letra informada foi: [%c]\0A\00"
@.str.7 = [7 x i8] c"*FIM*\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
%4 = alloca i32
%5 = alloca i8
store i32 0, i32* %1
store i32 0, i32* %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %8)
%10 = call i32 (...) @clear()
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%13 = call i32 @create(i8* %11, i8* %12)
br label %14
14: ; preds = %17, %0
%15 = load i32, i32* %4
%16 = icmp slt i32 %15, 6
br i1 %16, label %17, label %30
17: ; preds = %14
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* %18)
%20 = load i32, i32* %4
%21 = call i32 @draw(i32 %20)
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %5)
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %5)
%25 = load i8, i8* %5
%26 = sext i8 %25 to i32
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0), i32 %26)
%28 = load i32, i32* %4
%29 = add nsw i32 %28, 1
store i32 %29, i32* %4
br label %14
30: ; preds = %14
%31 = load i32, i32* %4
%32 = call i32 @draw(i32 %31)
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
%34 = load i32, i32* @EXIT_SUCCESS
ret i32 %34
}

LLVM IR (-O2):
@.str.1 = [28 x i8] c"Informe a palavra secreta: \00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [6 x i8] c"[%s]\0A\00"
@.str.4 = [19 x i8] c"Informe uma letra:\00"
@.str.5 = [3 x i8] c"%c\00"
@.str.6 = [29 x i8] c"A letra informada foi: [%c]\0A\00"
@EXIT_SUCCESS = global i32 0
@str = [26 x i8] c"*Jogo da Forca, (c) 2015*\00"
@str.8 = [6 x i8] c"*FIM*\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = alloca i8
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %4)
%9 = call i32 (...) @clear()
%10 = call i32 @create(i8* %4, i8* %5)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* %5)
%12 = call i32 @draw(i32 0)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %3)
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %3)
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0), i32 %17)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* %5)
%20 = call i32 @draw(i32 1)
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %3)
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %3)
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0), i32 %25)
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* %5)
%28 = call i32 @draw(i32 2)
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%30 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %3)
%31 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %3)
%32 = load i8, i8* %3
%33 = sext i8 %32 to i32
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0), i32 %33)
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* %5)
%36 = call i32 @draw(i32 3)
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%38 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %3)
%39 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %3)
%40 = load i8, i8* %3
%41 = sext i8 %40 to i32
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0), i32 %41)
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* %5)
%44 = call i32 @draw(i32 4)
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%46 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %3)
%47 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %3)
%48 = load i8, i8* %3
%49 = sext i8 %48 to i32
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0), i32 %49)
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* %5)
%52 = call i32 @draw(i32 5)
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%54 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %3)
%55 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %3)
%56 = load i8, i8* %3
%57 = sext i8 %56 to i32
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0), i32 %57)
%59 = call i32 @draw(i32 6)
%60 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.8, i64 0, i64 0))
%61 = load i32, i32* @EXIT_SUCCESS
ret i32 %61
}