#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*/ hangman(int);
int /*<<< orphan*/ isalpha(char);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ strcmp(char *, char *);
int strlen(char *);
int main(void) {
  int i, j, n, flag, fl_used, wordLength;
  char word[21], *visibleWord, letter, usedLetters[10];
  printf("Enter the secret word: ");
  scanf("%s", word);
  wordLength = strlen(word);
  n = j = 0;
  visibleWord = (char *)malloc((wordLength + 1) * sizeof(char));
  for (i = 0; i < wordLength; i++) {
    visibleWord[i] = '*';
  }
  visibleWord[wordLength] = '\0';
  while (1) {
    for (i = 0; i < 25; i++)
      printf("\n");
    hangman(n);
    if (n == 6) {
      flag = 0;
      break;
    }
    if (!strcmp(word, visibleWord)) {
      flag = 1;
      break;
    }
    flag = 0;
    printf("\nHidden word: %s\n", visibleWord);
    printf("Guess a letter: ");
    while (1) {
      scanf("%c", &letter);
      if (letter == ' ' || letter == '\n')
        continue;
      if (!isalpha(letter)) {
        printf("That isn't a letter, try again: ");
        continue;
      } else
        break;
    }
    for (i = 0; i < wordLength; i++) {
      if (letter == word[i] || letter == word[i] + ('a' - 'A') ||
          letter == word[i] - ('a' - 'A')) {
        visibleWord[i] = word[i];
        flag = 1;
      }
    }
    for (fl_used = 0, i = 0; i < j; i++) {
      if (letter == usedLetters[i] || letter == usedLetters[i] + ('a' - 'A') ||
          letter == usedLetters[i] - ('a' - 'A')) {
        fl_used = 1;
      }
    }
    if (fl_used) {
      printf("That letter has already been used, try again: \n");
      continue;
    }
    if (!flag) {
      printf("Wrong...\n");
      n++;
    } else
      printf("Bravo!\n");
    usedLetters[j++] = letter;
  }
  if (flag) {
    printf("Congratulations you guessed the secret world: %s\n", word);
  } else {
    printf("You lost...\nThe secret word was: %s\n", word);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x40(%rbp),%rsi
lea    0xe80(%rip),%rdi
call   1090 <scanf@plt>
lea    -0x40(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11fb <main+0x8b>
mov    -0x48(%rbp),%rax
movslq -0x8(%rbp),%rcx
movb   $0x2a,(%rax,%rcx,1)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11d5 <main+0x65>
mov    -0x48(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
movl   $0x0,-0x8(%rbp)
cmpl   $0x19,-0x8(%rbp)
jge    1234 <main+0xc4>
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    120e <main+0x9e>
mov    -0x10(%rbp),%edi
call   1070 <hangman@plt>
cmpl   $0x6,-0x10(%rbp)
jne    1252 <main+0xe2>
movl   $0x0,-0x14(%rbp)
jmp    145c <main+0x2ec>
lea    -0x40(%rbp),%rdi
mov    -0x48(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    1274 <main+0x104>
movl   $0x1,-0x14(%rbp)
jmp    145c <main+0x2ec>
movl   $0x0,-0x14(%rbp)
mov    -0x48(%rbp),%rsi
lea    0xd95(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd99(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd9c(%rip),%rdi
lea    -0x49(%rbp),%rsi
call   1090 <scanf@plt>
movsbl -0x49(%rbp),%eax
cmp    $0x20,%eax
je     12c5 <main+0x155>
movsbl -0x49(%rbp),%eax
cmp    $0xa,%eax
jne    12ca <main+0x15a>
jmp    129b <main+0x12b>
movsbl -0x49(%rbp),%edi
call   1080 <isalpha@plt>
cmp    $0x0,%eax
jne    12ef <main+0x17f>
lea    0xd5e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    129b <main+0x12b>
jmp    12f4 <main+0x184>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1379 <main+0x209>
movsbl -0x49(%rbp),%eax
movslq -0x8(%rbp),%rcx
movsbl -0x40(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
je     134c <main+0x1dc>
movsbl -0x49(%rbp),%eax
movslq -0x8(%rbp),%rcx
movsbl -0x40(%rbp,%rcx,1),%ecx
add    $0x20,%ecx
cmp    %ecx,%eax
je     134c <main+0x1dc>
movsbl -0x49(%rbp),%eax
movslq -0x8(%rbp),%rcx
movsbl -0x40(%rbp,%rcx,1),%ecx
sub    $0x20,%ecx
cmp    %ecx,%eax
jne    1366 <main+0x1f6>
movslq -0x8(%rbp),%rax
mov    -0x40(%rbp,%rax,1),%dl
mov    -0x48(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
movl   $0x1,-0x14(%rbp)
jmp    136b <main+0x1fb>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12fb <main+0x18b>
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    13f2 <main+0x282>
movsbl -0x49(%rbp),%eax
movslq -0x8(%rbp),%rcx
movsbl -0x53(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
je     13d8 <main+0x268>
movsbl -0x49(%rbp),%eax
movslq -0x8(%rbp),%rcx
movsbl -0x53(%rbp,%rcx,1),%ecx
add    $0x20,%ecx
cmp    %ecx,%eax
je     13d8 <main+0x268>
movsbl -0x49(%rbp),%eax
movslq -0x8(%rbp),%rcx
movsbl -0x53(%rbp,%rcx,1),%ecx
sub    $0x20,%ecx
cmp    %ecx,%eax
jne    13df <main+0x26f>
movl   $0x1,-0x18(%rbp)
jmp    13e4 <main+0x274>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1387 <main+0x217>
cmpl   $0x0,-0x18(%rbp)
je     140f <main+0x29f>
lea    0xc5f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1207 <main+0x97>
cmpl   $0x0,-0x14(%rbp)
jne    1435 <main+0x2c5>
lea    0xc72(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1443 <main+0x2d3>
lea    0xc60(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x49(%rbp),%cl
mov    -0xc(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
cltq
mov    %cl,-0x53(%rbp,%rax,1)
jmp    1207 <main+0x97>
cmpl   $0x0,-0x14(%rbp)
je     147d <main+0x30d>
lea    -0x40(%rbp),%rsi
lea    0xc33(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    148f <main+0x31f>
lea    -0x40(%rbp),%rsi
lea    0xc4e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
lea    0xe4b(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe55(%rip),%rdi
lea    0x40(%rsp),%rbx
mov    %rbx,%rsi
call   10c0 <scanf@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %eax,%ebx
lea    0x1(%rbx),%edi
call   1090 <malloc@plt>
mov    %ebx,%r14d
mov    %rbx,0x28(%rsp)
test   %ebx,%ebx
mov    %rax,%rbx
jle    1201 <main+0x61>
mov    %rbx,%rdi
mov    $0x2a,%esi
mov    %r14,%rdx
call   1070 <memset@plt>
movslq 0x28(%rsp),%rax
movb   $0x0,(%rbx,%rax,1)
lea    0xe2d(%rip),%r12
lea    0xb(%rsp),%rbp
mov    $0x1,%r13d
xor    %r15d,%r15d
movl   $0x0,0xc(%rsp)
mov    %rbx,0x38(%rsp)
mov    %r15,0x10(%rsp)
and    $0xfffffffffffffffe,%r15
mov    %r15,0x30(%rsp)
nopw   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0xc(%rsp),%r15d
mov    %r15d,%edi
call   10a0 <hangman@plt>
cmp    $0x6,%r15d
je     1510 <main+0x370>
lea    0x40(%rsp),%rdi
mov    %rbx,%rsi
call   1080 <strcmp@plt>
test   %eax,%eax
je     1519 <main+0x379>
lea    0xcae(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xcaf(%rip),%rdi
xchg   %ax,%ax
xor    %eax,%eax
call   1060 <printf@plt>
nopw   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %rbp,%rsi
call   10c0 <scanf@plt>
movzbl 0xb(%rsp),%eax
cmp    $0xa,%al
je     1390 <main+0x1f0>
cmp    $0x20,%al
je     1390 <main+0x1f0>
movsbl %al,%edi
call   10b0 <isalpha@plt>
lea    0xc8a(%rip),%rdi
test   %eax,%eax
je     1380 <main+0x1e0>
cmpl   $0x0,0x28(%rsp)
jle    1410 <main+0x270>
xor    %ecx,%ecx
xor    %r8d,%r8d
mov    0x10(%rsp),%r9
jmp    13e2 <main+0x242>
xchg   %ax,%ax
mov    %dl,(%rbx,%rcx,1)
mov    $0x1,%r8d
add    $0x1,%rcx
cmp    %rcx,%r14
je     1418 <main+0x278>
movsbl 0xb(%rsp),%esi
movsbl 0x40(%rsp,%rcx,1),%edx
cmp    %dl,%sil
je     13d0 <main+0x230>
lea    0x20(%rdx),%edi
cmp    %esi,%edi
je     13d0 <main+0x230>
mov    %edx,%edi
add    $0xffffffe0,%edi
cmp    %esi,%edi
jne    13d9 <main+0x239>
jmp    13d0 <main+0x230>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %r8d,%r8d
mov    0x10(%rsp),%r9
test   %r9,%r9
je     14d0 <main+0x330>
movsbl 0xb(%rsp),%ecx
xor    %esi,%esi
xor    %edx,%edx
cmp    $0x1,%r9
je     1486 <main+0x2e6>
mov    0x30(%rsp),%r10
cs nopw 0x0(%rax,%rax,1)
nop
movsbl 0x1e(%rsp,%rsi,1),%edi
lea    0x20(%rdi),%ebx
mov    %edi,%eax
add    $0xffffffe0,%eax
cmp    %ecx,%eax
cmove  %r13d,%edx
movsbl 0x1f(%rsp,%rsi,1),%eax
cmp    %ecx,%ebx
cmove  %r13d,%edx
lea    0x20(%rax),%ebx
cmp    %dil,%cl
cmove  %r13d,%edx
lea    -0x20(%rax),%edi
cmp    %ecx,%edi
cmove  %r13d,%edx
cmp    %ecx,%ebx
cmove  %r13d,%edx
cmp    %al,%cl
cmove  %r13d,%edx
add    $0x2,%rsi
cmp    %rsi,%r10
jne    1440 <main+0x2a0>
test   $0x1,%r9b
je     14ab <main+0x30b>
movsbl 0x1e(%rsp,%rsi,1),%eax
mov    %eax,%esi
add    $0xffffffe0,%esi
cmp    %ecx,%esi
cmove  %r13d,%edx
lea    0x20(%rax),%esi
cmp    %ecx,%esi
cmove  %r13d,%edx
cmp    %al,%cl
cmove  %r13d,%edx
test   %edx,%edx
mov    0x38(%rsp),%rbx
je     14d0 <main+0x330>
lea    0xc0e(%rip),%rdi
call   1040 <puts@plt>
jmp    1240 <main+0xa0>
cs nopw 0x0(%rax,%rax,1)
nop
test   %r8d,%r8d
je     14e8 <main+0x348>
lea    0xbe6(%rip),%rdi
call   1040 <puts@plt>
mov    0x10(%rsp),%r15
jmp    14fe <main+0x35e>
lea    0xbca(%rip),%rdi
call   1040 <puts@plt>
mov    0x10(%rsp),%r15
addl   $0x1,0xc(%rsp)
mov    0xb(%rsp),%al
mov    %al,0x1e(%rsp,%r15,1)
add    $0x1,%r15
jmp    122c <main+0x8c>
lea    0xb7d(%rip),%rdi
jmp    1520 <main+0x380>
lea    0xb42(%rip),%rdi
lea    0x40(%rsp),%rsi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Enter the secret word: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [18 x i8] c"\0AHidden word: %s\0A\00"
@.str.4 = [17 x i8] c"Guess a letter: \00"
@.str.5 = [3 x i8] c"%c\00"
@.str.6 = [33 x i8] c"That isn't a letter, try again: \00"
@.str.7 = [48 x i8] c"That letter has already been used, try again: \0A\00"
@.str.8 = [10 x i8] c"Wrong...\0A\00"
@.str.9 = [8 x i8] c"Bravo!\0A\00"
@.str.10 = [50 x i8] c"Congratulations you guessed the secret world: %s\0A\00"
@.str.11 = [37 x i8] c"You lost...\0AThe secret word was: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca [21 x i8]
%9 = alloca i8*
%10 = alloca i8
%11 = alloca [10 x i8]
store i32 0, i32* %1
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%13 = getelementptr inbounds [21 x i8], [21 x i8]* %8, i64 0, i64 0
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %13)
%15 = getelementptr inbounds [21 x i8], [21 x i8]* %8, i64 0, i64 0
%16 = call i32 @strlen(i8* %15)
store i32 %16, i32* %7
store i32 0, i32* %3
store i32 0, i32* %4
%17 = load i32, i32* %7
%18 = add nsw i32 %17, 1
%19 = sext i32 %18 to i64
%20 = mul i64 %19, 1
%21 = trunc i64 %20 to i32
%22 = call i64 @malloc(i32 %21)
%23 = inttoptr i64 %22 to i8*
store i8* %23, i8** %9
store i32 0, i32* %2
br label %24
24: ; preds = %33, %0
%25 = load i32, i32* %2
%26 = load i32, i32* %7
%27 = icmp slt i32 %25, %26
br i1 %27, label %28, label %36
28: ; preds = %24
%29 = load i8*, i8** %9
%30 = load i32, i32* %2
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8, i8* %29, i64 %31
store i8 42, i8* %32
br label %33
33: ; preds = %28
%34 = load i32, i32* %2
%35 = add nsw i32 %34, 1
store i32 %35, i32* %2
br label %24
36: ; preds = %24
%37 = load i8*, i8** %9
%38 = load i32, i32* %7
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i8, i8* %37, i64 %39
store i8 0, i8* %40
br label %41
41: ; preds = %36, %172, %183
store i32 0, i32* %2
br label %42
42: ; preds = %47, %41
%43 = load i32, i32* %2
%44 = icmp slt i32 %43, 25
br i1 %44, label %45, label %50
45: ; preds = %42
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %47
47: ; preds = %45
%48 = load i32, i32* %2
%49 = add nsw i32 %48, 1
store i32 %49, i32* %2
br label %42
50: ; preds = %42
%51 = load i32, i32* %4
%52 = call i32 @hangman(i32 %51)
%53 = load i32, i32* %4
%54 = icmp eq i32 %53, 6
br i1 %54, label %55, label %56
55: ; preds = %50
store i32 0, i32* %5
br label %189
56: ; preds = %50
%57 = getelementptr inbounds [21 x i8], [21 x i8]* %8, i64 0, i64 0
%58 = load i8*, i8** %9
%59 = call i32 @strcmp(i8* %57, i8* %58)
%60 = icmp ne i32 %59, 0
br i1 %60, label %62, label %61
61: ; preds = %56
store i32 1, i32* %5
br label %189
62: ; preds = %56
store i32 0, i32* %5
%63 = load i8*, i8** %9
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* %63)
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
br label %66
66: ; preds = %62, %75, %80
%67 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %10)
%68 = load i8, i8* %10
%69 = sext i8 %68 to i32
%70 = icmp eq i32 %69, 32
br i1 %70, label %75, label %71
71: ; preds = %66
%72 = load i8, i8* %10
%73 = sext i8 %72 to i32
%74 = icmp eq i32 %73, 10
br i1 %74, label %75, label %76
75: ; preds = %71, %66
br label %66
76: ; preds = %71
%77 = load i8, i8* %10
%78 = call i32 @isalpha(i8 signext %77)
%79 = icmp ne i32 %78, 0
br i1 %79, label %82, label %80
80: ; preds = %76
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0))
br label %66
82: ; preds = %76
br label %83
83: ; preds = %82
store i32 0, i32* %2
br label %84
84: ; preds = %127, %83
%85 = load i32, i32* %2
%86 = load i32, i32* %7
%87 = icmp slt i32 %85, %86
br i1 %87, label %88, label %130
88: ; preds = %84
%89 = load i8, i8* %10
%90 = sext i8 %89 to i32
%91 = load i32, i32* %2
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds [21 x i8], [21 x i8]* %8, i64 0, i64 %92
%94 = load i8, i8* %93
%95 = sext i8 %94 to i32
%96 = icmp eq i32 %90, %95
br i1 %96, label %117, label %97
97: ; preds = %88
%98 = load i8, i8* %10
%99 = sext i8 %98 to i32
%100 = load i32, i32* %2
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds [21 x i8], [21 x i8]* %8, i64 0, i64 %101
%103 = load i8, i8* %102
%104 = sext i8 %103 to i32
%105 = add nsw i32 %104, 32
%106 = icmp eq i32 %99, %105
br i1 %106, label %117, label %107
107: ; preds = %97
%108 = load i8, i8* %10
%109 = sext i8 %108 to i32
%110 = load i32, i32* %2
%111 = sext i32 %110 to i64
%112 = getelementptr inbounds [21 x i8], [21 x i8]* %8, i64 0, i64 %111
%113 = load i8, i8* %112
%114 = sext i8 %113 to i32
%115 = sub nsw i32 %114, 32
%116 = icmp eq i32 %109, %115
br i1 %116, label %117, label %126
117: ; preds = %107, %97, %88
%118 = load i32, i32* %2
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds [21 x i8], [21 x i8]* %8, i64 0, i64 %119
%121 = load i8, i8* %120
%122 = load i8*, i8** %9
%123 = load i32, i32* %2
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds i8, i8* %122, i64 %124
store i8 %121, i8* %125
store i32 1, i32* %5
br label %126
126: ; preds = %117, %107
br label %127
127: ; preds = %126
%128 = load i32, i32* %2
%129 = add nsw i32 %128, 1
store i32 %129, i32* %2
br label %84
130: ; preds = %84
store i32 0, i32* %6
store i32 0, i32* %2
br label %131
131: ; preds = %166, %130
%132 = load i32, i32* %2
%133 = load i32, i32* %3
%134 = icmp slt i32 %132, %133
br i1 %134, label %135, label %169
135: ; preds = %131
%136 = load i8, i8* %10
%137 = sext i8 %136 to i32
%138 = load i32, i32* %2
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds [10 x i8], [10 x i8]* %11, i64 0, i64 %139
%141 = load i8, i8* %140
%142 = sext i8 %141 to i32
%143 = icmp eq i32 %137, %142
br i1 %143, label %164, label %144
144: ; preds = %135
%145 = load i8, i8* %10
%146 = sext i8 %145 to i32
%147 = load i32, i32* %2
%148 = sext i32 %147 to i64
%149 = getelementptr inbounds [10 x i8], [10 x i8]* %11, i64 0, i64 %148
%150 = load i8, i8* %149
%151 = sext i8 %150 to i32
%152 = add nsw i32 %151, 32
%153 = icmp eq i32 %146, %152
br i1 %153, label %164, label %154
154: ; preds = %144
%155 = load i8, i8* %10
%156 = sext i8 %155 to i32
%157 = load i32, i32* %2
%158 = sext i32 %157 to i64
%159 = getelementptr inbounds [10 x i8], [10 x i8]* %11, i64 0, i64 %158
%160 = load i8, i8* %159
%161 = sext i8 %160 to i32
%162 = sub nsw i32 %161, 32
%163 = icmp eq i32 %156, %162
br i1 %163, label %164, label %165
164: ; preds = %154, %144, %135
store i32 1, i32* %6
br label %165
165: ; preds = %164, %154
br label %166
166: ; preds = %165
%167 = load i32, i32* %2
%168 = add nsw i32 %167, 1
store i32 %168, i32* %2
br label %131
169: ; preds = %131
%170 = load i32, i32* %6
%171 = icmp ne i32 %170, 0
br i1 %171, label %172, label %174
172: ; preds = %169
%173 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.7, i64 0, i64 0))
br label %41
174: ; preds = %169
%175 = load i32, i32* %5
%176 = icmp ne i32 %175, 0
br i1 %176, label %181, label %177
177: ; preds = %174
%178 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
%179 = load i32, i32* %4
%180 = add nsw i32 %179, 1
store i32 %180, i32* %4
br label %183
181: ; preds = %174
%182 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
br label %183
183: ; preds = %181, %177
%184 = load i8, i8* %10
%185 = load i32, i32* %3
%186 = add nsw i32 %185, 1
store i32 %186, i32* %3
%187 = sext i32 %185 to i64
%188 = getelementptr inbounds [10 x i8], [10 x i8]* %11, i64 0, i64 %187
store i8 %184, i8* %188
br label %41
189: ; preds = %61, %55
%190 = load i32, i32* %5
%191 = icmp ne i32 %190, 0
br i1 %191, label %192, label %195
192: ; preds = %189
%193 = getelementptr inbounds [21 x i8], [21 x i8]* %8, i64 0, i64 0
%194 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.10, i64 0, i64 0), i8* %193)
br label %198
195: ; preds = %189
%196 = getelementptr inbounds [21 x i8], [21 x i8]* %8, i64 0, i64 0
%197 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.11, i64 0, i64 0), i8* %196)
br label %198
198: ; preds = %195, %192
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"Enter the secret word: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.3 = [18 x i8] c"\0AHidden word: %s\0A\00"
@.str.4 = [17 x i8] c"Guess a letter: \00"
@.str.5 = [3 x i8] c"%c\00"
@.str.6 = [33 x i8] c"That isn't a letter, try again: \00"
@.str.10 = [50 x i8] c"Congratulations you guessed the secret world: %s\0A\00"
@.str.11 = [37 x i8] c"You lost...\0AThe secret word was: %s\0A\00"
@str = [9 x i8] c"Wrong...\00"
@str.12 = [7 x i8] c"Bravo!\00"
@str.13 = [47 x i8] c"That letter has already been used, try again: \00"
define i32 @main() {
%1 = alloca [21 x i8]
%2 = alloca i8
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [21 x i8], [21 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%8 = call i32 @strlen(i8* %4)
%9 = add nsw i32 %8, 1
%10 = call i64 @malloc(i32 %9)
%11 = inttoptr i64 %10 to i8*
%12 = icmp sgt i32 %8, 0
br i1 %12, label %13, label %15
13: ; preds = %0
%14 = zext i32 %8 to i64
br label %15
15: ; preds = %13, %0
%16 = sext i32 %8 to i64
%17 = getelementptr inbounds i8, i8* %11, i64 %16
store i8 0, i8* %17
%18 = zext i32 %8 to i64
br label %19
19: ; preds = %155, %15
%20 = phi i64 [ %158, %155 ], [ 0, %15 ]
%21 = phi i32 [ %156, %155 ], [ 0, %15 ]
%22 = icmp eq i32 %21, 6
%23 = icmp eq i64 %20, 0
%24 = and i64 %20, 1
%25 = icmp eq i64 %20, 1
%26 = and i64 %20, -2
%27 = icmp eq i64 %24, 0
br label %28
28: ; preds = %19, %146
%29 = call i32 @putchar(i32 10)
%30 = call i32 @putchar(i32 10)
%31 = call i32 @putchar(i32 10)
%32 = call i32 @putchar(i32 10)
%33 = call i32 @putchar(i32 10)
%34 = call i32 @putchar(i32 10)
%35 = call i32 @putchar(i32 10)
%36 = call i32 @putchar(i32 10)
%37 = call i32 @putchar(i32 10)
%38 = call i32 @putchar(i32 10)
%39 = call i32 @putchar(i32 10)
%40 = call i32 @putchar(i32 10)
%41 = call i32 @putchar(i32 10)
%42 = call i32 @putchar(i32 10)
%43 = call i32 @putchar(i32 10)
%44 = call i32 @putchar(i32 10)
%45 = call i32 @putchar(i32 10)
%46 = call i32 @putchar(i32 10)
%47 = call i32 @putchar(i32 10)
%48 = call i32 @putchar(i32 10)
%49 = call i32 @putchar(i32 10)
%50 = call i32 @putchar(i32 10)
%51 = call i32 @putchar(i32 10)
%52 = call i32 @putchar(i32 10)
%53 = call i32 @putchar(i32 10)
%54 = call i32 @hangman(i32 %21)
br i1 %22, label %160, label %55
55: ; preds = %28
%56 = call i32 @strcmp(i8* %4, i8* dereferenceable(1) %11)
%57 = icmp eq i32 %56, 0
br i1 %57, label %160, label %58
58: ; preds = %55
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* %11)
br label %60
60: ; preds = %67, %58
%61 = phi i8* [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), %58 ], [ getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0), %67 ]
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %61)
br label %63
63: ; preds = %66, %60
%64 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %2)
%65 = load i8, i8* %2
switch i8 %65, label %67 [
i8 32, label %66
i8 10, label %66
]
66: ; preds = %63, %63
br label %63
67: ; preds = %63
%68 = call i32 @isalpha(i8 signext %65)
%69 = icmp eq i32 %68, 0
br i1 %69, label %60, label %70
70: ; preds = %67
br i1 %12, label %76, label %71
71: ; preds = %93, %70
%72 = phi i32 [ 0, %70 ], [ %94, %93 ]
br i1 %23, label %148, label %73
73: ; preds = %71
%74 = load i8, i8* %2
%75 = sext i8 %74 to i32
br i1 %25, label %127, label %97
76: ; preds = %70, %93
%77 = phi i64 [ %95, %93 ], [ 0, %70 ]
%78 = phi i32 [ %94, %93 ], [ 0, %70 ]
%79 = load i8, i8* %2
%80 = sext i8 %79 to i32
%81 = getelementptr inbounds [21 x i8], [21 x i8]* %1, i64 0, i64 %77
%82 = load i8, i8* %81
%83 = sext i8 %82 to i32
%84 = icmp eq i8 %79, %82
%85 = add nsw i32 %83, 32
%86 = icmp eq i32 %85, %80
%87 = select i1 %84, i1 true, i1 %86
%88 = add nsw i32 %83, -32
%89 = icmp eq i32 %88, %80
%90 = select i1 %87, i1 true, i1 %89
br i1 %90, label %91, label %93
91: ; preds = %76
%92 = getelementptr inbounds i8, i8* %11, i64 %77
store i8 %82, i8* %92
br label %93
93: ; preds = %76, %91
%94 = phi i32 [ 1, %91 ], [ %78, %76 ]
%95 = add nuw nsw i64 %77, 1
%96 = icmp eq i64 %95, %18
br i1 %96, label %71, label %76
97: ; preds = %73, %97
%98 = phi i64 [ %124, %97 ], [ 0, %73 ]
%99 = phi i32 [ %123, %97 ], [ 0, %73 ]
%100 = phi i64 [ %125, %97 ], [ 0, %73 ]
%101 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 %98
%102 = load i8, i8* %101
%103 = sext i8 %102 to i32
%104 = icmp eq i8 %74, %102
%105 = add nsw i32 %103, 32
%106 = icmp eq i32 %105, %75
%107 = add nsw i32 %103, -32
%108 = icmp eq i32 %107, %75
%109 = or i64 %98, 1
%110 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 %109
%111 = load i8, i8* %110
%112 = sext i8 %111 to i32
%113 = icmp eq i8 %74, %111
%114 = add nsw i32 %112, 32
%115 = icmp eq i32 %114, %75
%116 = select i1 %113, i1 true, i1 %115
%117 = add nsw i32 %112, -32
%118 = icmp eq i32 %117, %75
%119 = select i1 %116, i1 true, i1 %118
%120 = select i1 %119, i1 true, i1 %104
%121 = select i1 %120, i1 true, i1 %106
%122 = select i1 %121, i1 true, i1 %108
%123 = select i1 %122, i32 1, i32 %99
%124 = add nuw nsw i64 %98, 2
%125 = add i64 %100, 2
%126 = icmp eq i64 %125, %26
br i1 %126, label %127, label %97
127: ; preds = %97, %73
%128 = phi i32 [ undef, %73 ], [ %123, %97 ]
%129 = phi i64 [ 0, %73 ], [ %124, %97 ]
%130 = phi i32 [ 0, %73 ], [ %123, %97 ]
br i1 %27, label %143, label %131
131: ; preds = %127
%132 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 %129
%133 = load i8, i8* %132
%134 = sext i8 %133 to i32
%135 = icmp eq i8 %74, %133
%136 = add nsw i32 %134, 32
%137 = icmp eq i32 %136, %75
%138 = select i1 %135, i1 true, i1 %137
%139 = add nsw i32 %134, -32
%140 = icmp eq i32 %139, %75
%141 = select i1 %138, i1 true, i1 %140
%142 = select i1 %141, i32 1, i32 %130
br label %143
143: ; preds = %127, %131
%144 = phi i32 [ %128, %127 ], [ %142, %131 ]
%145 = icmp eq i32 %144, 0
br i1 %145, label %148, label %146
146: ; preds = %143
%147 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.13, i64 0, i64 0))
br label %28
148: ; preds = %71, %143
%149 = icmp eq i32 %72, 0
br i1 %149, label %150, label %153
150: ; preds = %148
%151 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%152 = add nsw i32 %21, 1
br label %155
153: ; preds = %148
%154 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.12, i64 0, i64 0))
br label %155
155: ; preds = %153, %150
%156 = phi i32 [ %21, %153 ], [ %152, %150 ]
%157 = load i8, i8* %2
%158 = add nuw i64 %20, 1
%159 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 %20
store i8 %157, i8* %159
br label %19
160: ; preds = %28, %55
%161 = phi i8* [ getelementptr inbounds ([50 x i8], [50 x i8]* @.str.10, i64 0, i64 0), %55 ], [ getelementptr inbounds ([37 x i8], [37 x i8]* @.str.11, i64 0, i64 0), %28 ]
%162 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %161, i8* %4)
ret i32 0
}