#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 *, char, char, char, char, char, char, char);
void hangman(int n) {
  char head, hand1, hand2, body, leg1, leg2;
  head = hand1 = hand2 = body = leg1 = leg2 = ' ';
  switch (n) {
  case 6:
    leg2 = '\\';
  case 5:
    leg1 = '/';
  case 4:
    hand2 = '\\';
  case 3:
    hand1 = '/';
  case 2:
    body = '|';
  case 1:
    head = 'O';
  default: {
    printf("++----\n|    |\n|    %c\n|   %c%c%c\n|    %c\n|   %c %c\n|\n", head,
           hand1, body, hand2, body, leg1, leg2);
  }
  }
}


x86 assembly (clang, -O0):
<hangman>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movb   $0x20,-0xa(%rbp)
movb   $0x20,-0x9(%rbp)
movb   $0x20,-0x8(%rbp)
movb   $0x20,-0x7(%rbp)
movb   $0x20,-0x6(%rbp)
movb   $0x20,-0x5(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x5,%eax
ja     1174 <hangman+0x64>
mov    -0x18(%rbp),%rax
lea    0xead(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x5c,-0xa(%rbp)
movb   $0x2f,-0x9(%rbp)
movb   $0x5c,-0x7(%rbp)
movb   $0x2f,-0x6(%rbp)
movb   $0x7c,-0x8(%rbp)
movb   $0x4f,-0x5(%rbp)
mov    -0x5(%rbp),%sil
mov    -0x6(%rbp),%dl
mov    -0x8(%rbp),%cl
mov    -0x7(%rbp),%r8b
mov    -0x8(%rbp),%r9b
mov    -0x9(%rbp),%al
lea    0xe88(%rip),%rdi
movsbl %sil,%esi
movsbl %dl,%edx
movsbl %cl,%ecx
movsbl %r8b,%r8d
movsbl %r9b,%r9d
movsbl %al,%eax
mov    %eax,(%rsp)
movsbl -0xa(%rbp),%eax
mov    %eax,0x8(%rsp)
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hangman>:
push   %rbp
push   %r14
push   %rbx
mov    $0x20,%al
add    $0xffffffff,%edi
cmp    $0x5,%edi
ja     11a5 <hangman+0x95>
lea    0xed7(%rip),%rcx
movslq (%rcx,%rdi,4),%rsi
add    %rcx,%rsi
mov    $0x20,%r14b
mov    $0x20,%r9b
mov    $0x20,%r11b
mov    $0x20,%r10b
mov    $0x20,%bpl
mov    $0x20,%bl
mov    $0x20,%r8b
mov    $0x20,%dil
mov    $0x20,%dl
mov    $0x20,%cl
jmp    *%rsi
mov    $0x5c,%al
mov    %eax,%r14d
mov    $0x2f,%al
mov    %eax,%r9d
mov    $0x5c,%al
mov    %r14d,%r11d
mov    %eax,%r10d
mov    $0x2f,%al
mov    %r9d,%ebp
mov    %r11d,%ebx
mov    $0x7c,%dil
mov    %r10d,%r8d
mov    %ebp,%edx
mov    %ebx,%ecx
mov    %eax,%r9d
mov    $0x4f,%al
movzbl %cl,%ebp
movzbl %dl,%ebx
movzbl %al,%esi
movzbl %r9b,%edx
movzbl %r8b,%r8d
movzbl %dil,%ecx
lea    0xe86(%rip),%rdi
mov    %ecx,%r9d
push   %rbp
push   %rbx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    $0x20,%r9b
mov    $0x20,%r8b
mov    $0x20,%dil
mov    $0x20,%dl
mov    $0x20,%cl
jmp    1176 <hangman+0x66>

LLVM IR (-O0):
@.str = [54 x i8] c"++----\0A| |\0A| %c\0A| %c%c%c\0A| %c\0A| %c %c\0A|\0A\00"
define void @hangman(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i32 %0, i32* %2
store i8 32, i8* %8
store i8 32, i8* %7
store i8 32, i8* %6
store i8 32, i8* %5
store i8 32, i8* %4
store i8 32, i8* %3
%9 = load i32, i32* %2
switch i32 %9, label %16 [
i32 6, label %10
i32 5, label %11
i32 4, label %12
i32 3, label %13
i32 2, label %14
i32 1, label %15
]
10: ; preds = %1
store i8 92, i8* %8
br label %11
11: ; preds = %1, %10
store i8 47, i8* %7
br label %12
12: ; preds = %1, %11
store i8 92, i8* %5
br label %13
13: ; preds = %1, %12
store i8 47, i8* %4
br label %14
14: ; preds = %1, %13
store i8 124, i8* %6
br label %15
15: ; preds = %1, %14
store i8 79, i8* %3
br label %16
16: ; preds = %1, %15
%17 = load i8, i8* %3
%18 = load i8, i8* %4
%19 = load i8, i8* %6
%20 = load i8, i8* %5
%21 = load i8, i8* %6
%22 = load i8, i8* %7
%23 = load i8, i8* %8
%24 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8 signext %17, i8 signext %18, i8 signext %19, i8 signext %20, i8 signext %21, i8 signext %22, i8 signext %23)
br label %25
25: ; preds = %16
ret void
}

LLVM IR (-O2):
@.str = [54 x i8] c"++----\0A| |\0A| %c\0A| %c%c%c\0A| %c\0A| %c %c\0A|\0A\00"
define void @hangman(i32 %0) {
switch i32 %0, label %23 [
i32 6, label %2
i32 5, label %3
i32 4, label %5
i32 3, label %8
i32 2, label %12
i32 1, label %17
]
2: ; preds = %1
br label %3
3: ; preds = %1, %2
%4 = phi i8 [ 32, %1 ], [ 92, %2 ]
br label %5
5: ; preds = %1, %3
%6 = phi i8 [ 32, %1 ], [ 47, %3 ]
%7 = phi i8 [ 32, %1 ], [ %4, %3 ]
br label %8
8: ; preds = %1, %5
%9 = phi i8 [ 32, %1 ], [ 92, %5 ]
%10 = phi i8 [ 32, %1 ], [ %6, %5 ]
%11 = phi i8 [ 32, %1 ], [ %7, %5 ]
br label %12
12: ; preds = %1, %8
%13 = phi i8 [ 32, %1 ], [ 47, %8 ]
%14 = phi i8 [ 32, %1 ], [ %9, %8 ]
%15 = phi i8 [ 32, %1 ], [ %10, %8 ]
%16 = phi i8 [ 32, %1 ], [ %11, %8 ]
br label %17
17: ; preds = %1, %12
%18 = phi i8 [ 32, %1 ], [ %13, %12 ]
%19 = phi i8 [ 32, %1 ], [ %14, %12 ]
%20 = phi i8 [ 32, %1 ], [ 124, %12 ]
%21 = phi i8 [ 32, %1 ], [ %15, %12 ]
%22 = phi i8 [ 32, %1 ], [ %16, %12 ]
br label %23
23: ; preds = %1, %17
%24 = phi i8 [ 32, %1 ], [ 79, %17 ]
%25 = phi i8 [ 32, %1 ], [ %18, %17 ]
%26 = phi i8 [ 32, %1 ], [ %19, %17 ]
%27 = phi i8 [ 32, %1 ], [ %20, %17 ]
%28 = phi i8 [ 32, %1 ], [ %21, %17 ]
%29 = phi i8 [ 32, %1 ], [ %22, %17 ]
%30 = tail call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8 signext %24, i8 signext %25, i8 signext %27, i8 signext %26, i8 signext %27, i8 signext %28, i8 signext %29)
ret void
}