#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 A_BOLD;
int COLOR_PAIR(int);
int /*<<< orphan*/ attron(int);
int /*<<< orphan*/ mvprintw(int, int, char *);
void xmas(void) {
  static int color1 = 1;
  static int color2 = 2;
  attron(COLOR_PAIR(color1) | A_BOLD);
  mvprintw(0, 30, "   __     __)               \n");
  mvprintw(1, 30, "  (, /|  /|                 \n");
  mvprintw(2, 30, "    / | / |   _  __  __     \n");
  mvprintw(3, 30, " ) /  |/  |__(/_/ (_/ (_(_/_\n");
  mvprintw(4, 30, "(_/   '                .-/  \n");
  mvprintw(5, 30, "                      (_/   \n");
  attron(COLOR_PAIR(color2) | A_BOLD);
  mvprintw(6, 30, " __   __)                   \n");
  mvprintw(7, 30, "(,  |/                      \n");
  mvprintw(8, 30, "    |  ___   _   _          \n");
  mvprintw(9, 30, " ) /|_ // (_(_(_/_)_        \n");
  mvprintw(10, 30, "(_/                         \n");
  color1 = 3 - color1;
  color2 = 3 - color2;
}


x86 assembly (clang, -O0):
<xmas>:
push   %rbp
mov    %rsp,%rbp
mov    0x2efe(%rip),%edi
call   1040 <COLOR_PAIR@plt>
mov    %eax,%edi
mov    0x2e98(%rip),%rax
or     (%rax),%edi
call   1030 <attron@plt>
xor    %edi,%edi
mov    $0x1e,%esi
lea    0xea3(%rip),%rdx
call   1050 <mvprintw@plt>
mov    $0x1,%edi
mov    $0x1e,%esi
lea    0xeab(%rip),%rdx
call   1050 <mvprintw@plt>
mov    $0x2,%edi
mov    $0x1e,%esi
lea    0xeb3(%rip),%rdx
call   1050 <mvprintw@plt>
mov    $0x3,%edi
mov    $0x1e,%esi
lea    0xebb(%rip),%rdx
call   1050 <mvprintw@plt>
mov    $0x4,%edi
mov    $0x1e,%esi
lea    0xec3(%rip),%rdx
call   1050 <mvprintw@plt>
mov    $0x5,%edi
mov    $0x1e,%esi
lea    0xecb(%rip),%rdx
call   1050 <mvprintw@plt>
mov    0x2e66(%rip),%edi
call   1040 <COLOR_PAIR@plt>
mov    %eax,%edi
mov    0x2dfc(%rip),%rax
or     (%rax),%edi
call   1030 <attron@plt>
mov    $0x6,%edi
mov    $0x1e,%esi
lea    0xeb8(%rip),%rdx
call   1050 <mvprintw@plt>
mov    $0x7,%edi
mov    $0x1e,%esi
lea    0xec0(%rip),%rdx
call   1050 <mvprintw@plt>
mov    $0x8,%edi
mov    $0x1e,%esi
lea    0xec8(%rip),%rdx
call   1050 <mvprintw@plt>
mov    $0x9,%edi
mov    $0x1e,%esi
lea    0xed0(%rip),%rdx
call   1050 <mvprintw@plt>
mov    $0xa,%edi
mov    $0x1e,%esi
lea    0xed8(%rip),%rdx
call   1050 <mvprintw@plt>
mov    $0x3,%eax
sub    0x2dd4(%rip),%eax
mov    %eax,0x2dce(%rip)
mov    $0x3,%eax
sub    0x2dc7(%rip),%eax
mov    %eax,0x2dc1(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmas>:
push   %r14
push   %rbx
push   %rax
mov    0x2efe(%rip),%edi
call   1040 <COLOR_PAIR@plt>
mov    0x2e9a(%rip),%r14
or     (%r14),%eax
mov    %eax,%edi
call   1030 <attron@plt>
lea    0xea9(%rip),%rdx
xor    %edi,%edi
mov    $0x1e,%esi
call   1050 <mvprintw@plt>
lea    0xeb4(%rip),%rdx
mov    $0x1,%edi
mov    $0x1e,%esi
call   1050 <mvprintw@plt>
lea    0xebc(%rip),%rdx
mov    $0x2,%edi
mov    $0x1e,%esi
call   1050 <mvprintw@plt>
lea    0xec4(%rip),%rdx
mov    $0x3,%ebx
mov    $0x3,%edi
mov    $0x1e,%esi
call   1050 <mvprintw@plt>
lea    0xec7(%rip),%rdx
mov    $0x4,%edi
mov    $0x1e,%esi
call   1050 <mvprintw@plt>
lea    0xecf(%rip),%rdx
mov    $0x5,%edi
mov    $0x1e,%esi
call   1050 <mvprintw@plt>
mov    0x2e60(%rip),%edi
call   1040 <COLOR_PAIR@plt>
or     (%r14),%eax
mov    %eax,%edi
call   1030 <attron@plt>
lea    0xec2(%rip),%rdx
mov    $0x6,%edi
mov    $0x1e,%esi
call   1050 <mvprintw@plt>
lea    0xeca(%rip),%rdx
mov    $0x7,%edi
mov    $0x1e,%esi
call   1050 <mvprintw@plt>
lea    0xed2(%rip),%rdx
mov    $0x8,%edi
mov    $0x1e,%esi
call   1050 <mvprintw@plt>
lea    0xeda(%rip),%rdx
mov    $0x9,%edi
mov    $0x1e,%esi
call   1050 <mvprintw@plt>
lea    0xee2(%rip),%rdx
mov    $0xa,%edi
mov    $0x1e,%esi
call   1050 <mvprintw@plt>
mov    $0x3,%eax
sub    0x2dd4(%rip),%eax
mov    %eax,0x2dce(%rip)
sub    0x2dcc(%rip),%ebx
mov    %ebx,0x2dc6(%rip)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@xmas.color1 = internal global i32 1
@xmas.color2 = internal global i32 2
@A_BOLD = global i32 0
@.str = [30 x i8] c" __ __) \0A\00"
@.str.1 = [30 x i8] c" (, /| /| \0A\00"
@.str.2 = [30 x i8] c" / | / | _ __ __ \0A\00"
@.str.3 = [30 x i8] c" ) / |/ |__(/_/ (_/ (_(_/_\0A\00"
@.str.4 = [30 x i8] c"(_/ ' .-/ \0A\00"
@.str.5 = [30 x i8] c" (_/ \0A\00"
@.str.6 = [30 x i8] c" __ __) \0A\00"
@.str.7 = [30 x i8] c"(, |/ \0A\00"
@.str.8 = [30 x i8] c" | ___ _ _ \0A\00"
@.str.9 = [30 x i8] c" ) /|_ // (_(_(_/_)_ \0A\00"
@.str.10 = [30 x i8] c"(_/ \0A\00"
define void @xmas() {
%1 = load i32, i32* @xmas.color1
%2 = call i32 @COLOR_PAIR(i32 %1)
%3 = load i32, i32* @A_BOLD
%4 = or i32 %2, %3
%5 = call i32 @attron(i32 %4)
%6 = call i32 @mvprintw(i32 0, i32 30, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @mvprintw(i32 1, i32 30, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @mvprintw(i32 2, i32 30, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @mvprintw(i32 3, i32 30, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 @mvprintw(i32 4, i32 30, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0))
%11 = call i32 @mvprintw(i32 5, i32 30, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0))
%12 = load i32, i32* @xmas.color2
%13 = call i32 @COLOR_PAIR(i32 %12)
%14 = load i32, i32* @A_BOLD
%15 = or i32 %13, %14
%16 = call i32 @attron(i32 %15)
%17 = call i32 @mvprintw(i32 6, i32 30, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0))
%18 = call i32 @mvprintw(i32 7, i32 30, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0))
%19 = call i32 @mvprintw(i32 8, i32 30, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.8, i64 0, i64 0))
%20 = call i32 @mvprintw(i32 9, i32 30, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.9, i64 0, i64 0))
%21 = call i32 @mvprintw(i32 10, i32 30, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.10, i64 0, i64 0))
%22 = load i32, i32* @xmas.color1
%23 = sub nsw i32 3, %22
store i32 %23, i32* @xmas.color1
%24 = load i32, i32* @xmas.color2
%25 = sub nsw i32 3, %24
store i32 %25, i32* @xmas.color2
ret void
}

LLVM IR (-O2):
@xmas.color1 = internal unnamed_addr global i32 1
@xmas.color2 = internal unnamed_addr global i32 2
@A_BOLD = global i32 0
@.str = [30 x i8] c" __ __) \0A\00"
@.str.1 = [30 x i8] c" (, /| /| \0A\00"
@.str.2 = [30 x i8] c" / | / | _ __ __ \0A\00"
@.str.3 = [30 x i8] c" ) / |/ |__(/_/ (_/ (_(_/_\0A\00"
@.str.4 = [30 x i8] c"(_/ ' .-/ \0A\00"
@.str.5 = [30 x i8] c" (_/ \0A\00"
@.str.6 = [30 x i8] c" __ __) \0A\00"
@.str.7 = [30 x i8] c"(, |/ \0A\00"
@.str.8 = [30 x i8] c" | ___ _ _ \0A\00"
@.str.9 = [30 x i8] c" ) /|_ // (_(_(_/_)_ \0A\00"
@.str.10 = [30 x i8] c"(_/ \0A\00"
define void @xmas() {
%1 = load i32, i32* @xmas.color1
%2 = tail call i32 @COLOR_PAIR(i32 %1)
%3 = load i32, i32* @A_BOLD
%4 = or i32 %3, %2
%5 = tail call i32 @attron(i32 %4)
%6 = tail call i32 @mvprintw(i32 0, i32 30, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @mvprintw(i32 1, i32 30, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 @mvprintw(i32 2, i32 30, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%9 = tail call i32 @mvprintw(i32 3, i32 30, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%10 = tail call i32 @mvprintw(i32 4, i32 30, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0))
%11 = tail call i32 @mvprintw(i32 5, i32 30, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0))
%12 = load i32, i32* @xmas.color2
%13 = tail call i32 @COLOR_PAIR(i32 %12)
%14 = load i32, i32* @A_BOLD
%15 = or i32 %14, %13
%16 = tail call i32 @attron(i32 %15)
%17 = tail call i32 @mvprintw(i32 6, i32 30, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0))
%18 = tail call i32 @mvprintw(i32 7, i32 30, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0))
%19 = tail call i32 @mvprintw(i32 8, i32 30, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.8, i64 0, i64 0))
%20 = tail call i32 @mvprintw(i32 9, i32 30, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.9, i64 0, i64 0))
%21 = tail call i32 @mvprintw(i32 10, i32 30, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.10, i64 0, i64 0))
%22 = load i32, i32* @xmas.color1
%23 = sub nsw i32 3, %22
store i32 %23, i32* @xmas.color1
%24 = load i32, i32* @xmas.color2
%25 = sub nsw i32 3, %24
store i32 %25, i32* @xmas.color2
ret void
}