#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*/ COLOR_PAIR(int);
int /*<<< orphan*/ attroff(int /*<<< orphan*/);
int /*<<< orphan*/ attron(int /*<<< orphan*/);
int /*<<< orphan*/ getch();
int /*<<< orphan*/ move(int, int /*<<< orphan*/);
int /*<<< orphan*/ printw(char *, ...);
int /*<<< orphan*/ refresh();
void imprime_erro(int torre1, int torre2, int tipo) {
  attron(COLOR_PAIR(4));
  switch (tipo) {
  case 1:
    move(18, 0);
    printw("Jogada ilegal:                             ");
    move(19, 0);
    printw("Torre (%d) esta vazia!                     ", torre1);
    move(20, 0);
    printw("Pressione qualquer tecla para continuar ...");
    refresh();
    getch();
    move(18, 0);
    printw("                                           ");
    move(19, 0);
    printw("                                           ");
    move(20, 0);
    printw("                                           ");
    refresh();
    break;
  case 2:
    move(18, 0);
    printw("Jogada ilegal:                                             ");
    move(19, 0);
    printw("Disco no topo da Torre (%d) > Disco no topo da Torre (%d) !",
           torre1, torre2);
    move(20, 0);
    printw("Pressione qualquer tecla para continuar ...                ");
    refresh();
    getch();
    move(18, 0);
    printw("                                                           ");
    move(19, 0);
    printw("                                                           ");
    move(20, 0);
    printw("                                                           ");
    refresh();
    break;
  }
  attroff(COLOR_PAIR(4));
  return;
}


x86 assembly (clang, -O0):
<imprime_erro>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x4,%edi
call   1060 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1040 <attron@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1,%eax
je     11b7 <imprime_erro+0x47>
jmp    11a6 <imprime_erro+0x36>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     1270 <imprime_erro+0x100>
jmp    1327 <imprime_erro+0x1b7>
mov    $0x12,%edi
xor    %esi,%esi
call   1090 <move@plt>
lea    0xe36(%rip),%rdi
mov    $0x0,%al
call   1050 <printw@plt>
mov    $0x13,%edi
xor    %esi,%esi
call   1090 <move@plt>
mov    -0x4(%rbp),%esi
lea    0xe45(%rip),%rdi
mov    $0x0,%al
call   1050 <printw@plt>
mov    $0x14,%edi
xor    %esi,%esi
call   1090 <move@plt>
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1050 <printw@plt>
mov    $0x0,%al
call   1070 <refresh@plt>
mov    $0x0,%al
call   1080 <getch@plt>
mov    $0x12,%edi
xor    %esi,%esi
call   1090 <move@plt>
lea    0xf1f(%rip),%rdi
mov    $0x0,%al
call   1050 <printw@plt>
mov    $0x13,%edi
xor    %esi,%esi
call   1090 <move@plt>
lea    0xf05(%rip),%rdi
mov    $0x0,%al
call   1050 <printw@plt>
mov    $0x14,%edi
xor    %esi,%esi
call   1090 <move@plt>
lea    0xeeb(%rip),%rdi
mov    $0x0,%al
call   1050 <printw@plt>
mov    $0x0,%al
call   1070 <refresh@plt>
jmp    1327 <imprime_erro+0x1b7>
mov    $0x12,%edi
xor    %esi,%esi
call   1090 <move@plt>
lea    0xe01(%rip),%rdi
mov    $0x0,%al
call   1050 <printw@plt>
mov    $0x13,%edi
xor    %esi,%esi
call   1090 <move@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe1d(%rip),%rdi
mov    $0x0,%al
call   1050 <printw@plt>
mov    $0x14,%edi
xor    %esi,%esi
call   1090 <move@plt>
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1050 <printw@plt>
mov    $0x0,%al
call   1070 <refresh@plt>
mov    $0x0,%al
call   1080 <getch@plt>
mov    $0x12,%edi
xor    %esi,%esi
call   1090 <move@plt>
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1050 <printw@plt>
mov    $0x13,%edi
xor    %esi,%esi
call   1090 <move@plt>
lea    0xe39(%rip),%rdi
mov    $0x0,%al
call   1050 <printw@plt>
mov    $0x14,%edi
xor    %esi,%esi
call   1090 <move@plt>
lea    0xe1f(%rip),%rdi
mov    $0x0,%al
call   1050 <printw@plt>
mov    $0x0,%al
call   1070 <refresh@plt>
mov    $0x4,%edi
call   1060 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1030 <attroff@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprime_erro>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edi,%r14d
mov    $0x4,%edi
call   1060 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1040 <attron@plt>
cmp    $0x2,%ebx
je     11e1 <imprime_erro+0x71>
cmp    $0x1,%ebx
jne    1295 <imprime_erro+0x125>
mov    $0x12,%edi
xor    %esi,%esi
call   1090 <move@plt>
lea    0xe53(%rip),%rdi
xor    %eax,%eax
call   1050 <printw@plt>
mov    $0x13,%edi
xor    %esi,%esi
call   1090 <move@plt>
lea    0xe65(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1050 <printw@plt>
lea    0xf70(%rip),%rbx
lea    0xe79(%rip),%rbp
jmp    1228 <imprime_erro+0xb8>
mov    $0x12,%edi
xor    %esi,%esi
call   1090 <move@plt>
lea    0xe90(%rip),%rdi
xor    %eax,%eax
call   1050 <printw@plt>
mov    $0x13,%edi
xor    %esi,%esi
call   1090 <move@plt>
lea    0xeb2(%rip),%rdi
mov    %r14d,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1050 <printw@plt>
lea    0xf17(%rip),%rbx
lea    0xed4(%rip),%rbp
mov    $0x14,%edi
xor    %esi,%esi
call   1090 <move@plt>
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printw@plt>
xor    %eax,%eax
call   1070 <refresh@plt>
xor    %eax,%eax
call   1080 <getch@plt>
mov    $0x12,%edi
xor    %esi,%esi
call   1090 <move@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printw@plt>
mov    $0x13,%edi
xor    %esi,%esi
call   1090 <move@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printw@plt>
mov    $0x14,%edi
xor    %esi,%esi
call   1090 <move@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printw@plt>
xor    %eax,%eax
call   1070 <refresh@plt>
mov    $0x4,%edi
call   1060 <COLOR_PAIR@plt>
mov    %eax,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <attroff@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"Jogada ilegal: \00"
@.str.1 = [44 x i8] c"Torre (%d) esta vazia! \00"
@.str.2 = [44 x i8] c"Pressione qualquer tecla para continuar ...\00"
@.str.3 = [44 x i8] c" \00"
@.str.4 = [60 x i8] c"Jogada ilegal: \00"
@.str.5 = [60 x i8] c"Disco no topo da Torre (%d) > Disco no topo da Torre (%d) !\00"
@.str.6 = [60 x i8] c"Pressione qualquer tecla para continuar ... \00"
@.str.7 = [60 x i8] c" \00"
define void @imprime_erro(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 @COLOR_PAIR(i32 4)
%8 = call i32 @attron(i32 %7)
%9 = load i32, i32* %6
switch i32 %9, label %45 [
i32 1, label %10
i32 2, label %27
]
10: ; preds = %3
%11 = call i32 @move(i32 18, i32 0)
%12 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @move(i32 19, i32 0)
%14 = load i32, i32* %4
%15 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = call i32 @move(i32 20, i32 0)
%17 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
%18 = call i32 (...) @refresh()
%19 = call i32 (...) @getch()
%20 = call i32 @move(i32 18, i32 0)
%21 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0))
%22 = call i32 @move(i32 19, i32 0)
%23 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0))
%24 = call i32 @move(i32 20, i32 0)
%25 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0))
%26 = call i32 (...) @refresh()
br label %45
27: ; preds = %3
%28 = call i32 @move(i32 18, i32 0)
%29 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.4, i64 0, i64 0))
%30 = call i32 @move(i32 19, i32 0)
%31 = load i32, i32* %4
%32 = load i32, i32* %5
%33 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.5, i64 0, i64 0), i32 %31, i32 %32)
%34 = call i32 @move(i32 20, i32 0)
%35 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.6, i64 0, i64 0))
%36 = call i32 (...) @refresh()
%37 = call i32 (...) @getch()
%38 = call i32 @move(i32 18, i32 0)
%39 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.7, i64 0, i64 0))
%40 = call i32 @move(i32 19, i32 0)
%41 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.7, i64 0, i64 0))
%42 = call i32 @move(i32 20, i32 0)
%43 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.7, i64 0, i64 0))
%44 = call i32 (...) @refresh()
br label %45
45: ; preds = %3, %27, %10
%46 = call i32 @COLOR_PAIR(i32 4)
%47 = call i32 @attroff(i32 %46)
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"Jogada ilegal: \00"
@.str.1 = [44 x i8] c"Torre (%d) esta vazia! \00"
@.str.2 = [44 x i8] c"Pressione qualquer tecla para continuar ...\00"
@.str.3 = [44 x i8] c" \00"
@.str.4 = [60 x i8] c"Jogada ilegal: \00"
@.str.5 = [60 x i8] c"Disco no topo da Torre (%d) > Disco no topo da Torre (%d) !\00"
@.str.6 = [60 x i8] c"Pressione qualquer tecla para continuar ... \00"
@.str.7 = [60 x i8] c" \00"
define void @imprime_erro(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @COLOR_PAIR(i32 4)
%5 = tail call i32 @attron(i32 %4)
switch i32 %2, label %30 [
i32 1, label %6
i32 2, label %11
]
6: ; preds = %3
%7 = tail call i32 @move(i32 18, i32 0)
%8 = tail call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @move(i32 19, i32 0)
%10 = tail call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %16
11: ; preds = %3
%12 = tail call i32 @move(i32 18, i32 0)
%13 = tail call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.4, i64 0, i64 0))
%14 = tail call i32 @move(i32 19, i32 0)
%15 = tail call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.5, i64 0, i64 0), i32 %0, i32 %1)
br label %16
16: ; preds = %6, %11
%17 = phi i8* [ getelementptr inbounds ([60 x i8], [60 x i8]* @.str.6, i64 0, i64 0), %11 ], [ getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0), %6 ]
%18 = phi i8* [ getelementptr inbounds ([60 x i8], [60 x i8]* @.str.7, i64 0, i64 0), %11 ], [ getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0), %6 ]
%19 = tail call i32 @move(i32 20, i32 0)
%20 = tail call i32 (i8*, ...) @printw(i8* %17)
%21 = tail call i32 (...) @refresh()
%22 = tail call i32 (...) @getch()
%23 = tail call i32 @move(i32 18, i32 0)
%24 = tail call i32 (i8*, ...) @printw(i8* %18)
%25 = tail call i32 @move(i32 19, i32 0)
%26 = tail call i32 (i8*, ...) @printw(i8* %18)
%27 = tail call i32 @move(i32 20, i32 0)
%28 = tail call i32 (i8*, ...) @printw(i8* %18)
%29 = tail call i32 (...) @refresh()
br label %30
30: ; preds = %16, %3
%31 = tail call i32 @COLOR_PAIR(i32 4)
%32 = tail call i32 @attroff(i32 %31)
ret void
}