#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 /*<<< orphan*/);
int /*<<< orphan*/ attron(int /*<<< orphan*/);
int /*<<< orphan*/ cards_getname(int, int, char *);
int /*<<< orphan*/ cards_gettype(int, int);
int /*<<< orphan*/ gettypecolor(int /*<<< orphan*/);
int /*<<< orphan*/ mvprintw(int, int, char *);
int /*<<< orphan*/ printw(char *, ...);
int /*<<< orphan*/ turn_off_attributes();
void io_printname(int x, int y, int era, int card) {
  mvprintw(y, x, "#  ");
  attron(COLOR_PAIR(gettypecolor(cards_gettype(era, card))));
  char array[40];
  printw("%-23s", cards_getname(era, card, array));
  turn_off_attributes();
  printw(" #");
}


x86 assembly (clang, -O0):
<io_printname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
lea    0xe5f(%rip),%rdx
call   10a0 <mvprintw@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1070 <cards_gettype@plt>
mov    %eax,%edi
call   1090 <gettypecolor@plt>
mov    %eax,%edi
call   1060 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1040 <attron@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
lea    -0x40(%rbp),%rdx
call   1080 <cards_getname@plt>
mov    %eax,%esi
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1050 <printw@plt>
mov    $0x0,%al
call   1030 <turn_off_attributes@plt>
lea    0xe17(%rip),%rdi
mov    $0x0,%al
call   1050 <printw@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_printname>:
push   %rbp
push   %rbx
sub    $0x28,%rsp
mov    %ecx,%ebx
mov    %edx,%ebp
mov    %edi,%eax
lea    0xe6d(%rip),%rdx
mov    %esi,%edi
mov    %eax,%esi
call   10a0 <mvprintw@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1070 <cards_gettype@plt>
mov    %eax,%edi
call   1090 <gettypecolor@plt>
mov    %eax,%edi
call   1060 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1040 <attron@plt>
mov    %rsp,%rdx
mov    %ebp,%edi
mov    %ebx,%esi
call   1080 <cards_getname@plt>
lea    0xe37(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printw@plt>
xor    %eax,%eax
call   1030 <turn_off_attributes@plt>
lea    0xe26(%rip),%rdi
xor    %eax,%eax
call   1050 <printw@plt>
add    $0x28,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"# \00"
@.str.1 = [6 x i8] c"%-23s\00"
@.str.2 = [3 x i8] c" #\00"
define void @io_printname(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [40 x i8]
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %6
%11 = load i32, i32* %5
%12 = call i32 @mvprintw(i32 %10, i32 %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = call i32 @cards_gettype(i32 %13, i32 %14)
%16 = call i32 @gettypecolor(i32 %15)
%17 = call i32 @COLOR_PAIR(i32 %16)
%18 = call i32 @attron(i32 %17)
%19 = load i32, i32* %7
%20 = load i32, i32* %8
%21 = getelementptr inbounds [40 x i8], [40 x i8]* %9, i64 0, i64 0
%22 = call i32 @cards_getname(i32 %19, i32 %20, i8* %21)
%23 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %22)
%24 = call i32 (...) @turn_off_attributes()
%25 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"# \00"
@.str.1 = [6 x i8] c"%-23s\00"
@.str.2 = [3 x i8] c" #\00"
define void @io_printname(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca [40 x i8]
%6 = tail call i32 @mvprintw(i32 %1, i32 %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @cards_gettype(i32 %2, i32 %3)
%8 = tail call i32 @gettypecolor(i32 %7)
%9 = tail call i32 @COLOR_PAIR(i32 %8)
%10 = tail call i32 @attron(i32 %9)
%11 = getelementptr inbounds [40 x i8], [40 x i8]* %5, i64 0, i64 0
%12 = call i32 @cards_getname(i32 %2, i32 %3, i8* %11)
%13 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = call i32 (...) @turn_off_attributes()
%15 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret void
}