#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*/ clearScreen();
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ print_colored(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ readStr();
int /*<<< orphan*/ set_screen_color(int, int);
int str_to_int(int /*<<< orphan*/);
void set_background_color() {
  print("\nColor codes : ");
  print("\n0 : black");
  print_colored("\n1 : blue", 1, 0);
  print_colored("\n2 : green", 2, 0);
  print_colored("\n3 : cyan", 3, 0);
  print_colored("\n4 : red", 4, 0);
  print_colored("\n5 : purple", 5, 0);
  print_colored("\n6 : orange", 6, 0);
  print_colored("\n7 : grey", 7, 0);
  print_colored("\n8 : dark grey", 8, 0);
  print_colored("\n9 : blue light", 9, 0);
  print_colored("\n10 : green light", 10, 0);
  print_colored("\n11 : blue lighter", 11, 0);
  print_colored("\n12 : red light", 12, 0);
  print_colored("\n13 : rose", 13, 0);
  print_colored("\n14 : yellow", 14, 0);
  print_colored("\n15 : white", 15, 0);
  print("\n\n Text color ? : ");
  int text_color = str_to_int(readStr());
  print("\n\n Background color ? : ");
  int bg_color = str_to_int(readStr());
  set_screen_color(text_color, bg_color);
  clearScreen();
}


x86 assembly (clang, -O0):
<set_background_color>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xe91(%rip),%rdi
call   1050 <print@plt>
lea    0xe95(%rip),%rdi
call   1050 <print@plt>
lea    0xe94(%rip),%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <print_colored@plt>
lea    0xe8b(%rip),%rdi
mov    $0x2,%esi
xor    %edx,%edx
call   1030 <print_colored@plt>
lea    0xe83(%rip),%rdi
mov    $0x3,%esi
xor    %edx,%edx
call   1030 <print_colored@plt>
lea    0xe7a(%rip),%rdi
mov    $0x4,%esi
xor    %edx,%edx
call   1030 <print_colored@plt>
lea    0xe70(%rip),%rdi
mov    $0x5,%esi
xor    %edx,%edx
call   1030 <print_colored@plt>
lea    0xe69(%rip),%rdi
mov    $0x6,%esi
xor    %edx,%edx
call   1030 <print_colored@plt>
lea    0xe62(%rip),%rdi
mov    $0x7,%esi
xor    %edx,%edx
call   1030 <print_colored@plt>
lea    0xe59(%rip),%rdi
mov    $0x8,%esi
xor    %edx,%edx
call   1030 <print_colored@plt>
lea    0xe55(%rip),%rdi
mov    $0x9,%esi
xor    %edx,%edx
call   1030 <print_colored@plt>
lea    0xe52(%rip),%rdi
mov    $0xa,%esi
xor    %edx,%edx
call   1030 <print_colored@plt>
lea    0xe51(%rip),%rdi
mov    $0xb,%esi
xor    %edx,%edx
call   1030 <print_colored@plt>
lea    0xe51(%rip),%rdi
mov    $0xc,%esi
xor    %edx,%edx
call   1030 <print_colored@plt>
lea    0xe4e(%rip),%rdi
mov    $0xd,%esi
xor    %edx,%edx
call   1030 <print_colored@plt>
lea    0xe46(%rip),%rdi
mov    $0xe,%esi
xor    %edx,%edx
call   1030 <print_colored@plt>
lea    0xe40(%rip),%rdi
mov    $0xf,%esi
xor    %edx,%edx
call   1030 <print_colored@plt>
lea    0xe39(%rip),%rdi
call   1050 <print@plt>
mov    $0x0,%al
call   1080 <readStr@plt>
mov    %eax,%edi
call   1040 <str_to_int@plt>
mov    %eax,-0x4(%rbp)
lea    0xe2f(%rip),%rdi
call   1050 <print@plt>
mov    $0x0,%al
call   1080 <readStr@plt>
mov    %eax,%edi
call   1040 <str_to_int@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1060 <set_screen_color@plt>
mov    $0x0,%al
call   1070 <clearScreen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_background_color>:
push   %rbx
lea    0xe98(%rip),%rdi
call   1050 <print@plt>
lea    0xe9c(%rip),%rdi
call   1050 <print@plt>
lea    0xe9b(%rip),%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <print_colored@plt>
lea    0xe92(%rip),%rdi
mov    $0x2,%esi
xor    %edx,%edx
call   1030 <print_colored@plt>
lea    0xe8a(%rip),%rdi
mov    $0x3,%esi
xor    %edx,%edx
call   1030 <print_colored@plt>
lea    0xe81(%rip),%rdi
mov    $0x4,%esi
xor    %edx,%edx
call   1030 <print_colored@plt>
lea    0xe77(%rip),%rdi
mov    $0x5,%esi
xor    %edx,%edx
call   1030 <print_colored@plt>
lea    0xe70(%rip),%rdi
mov    $0x6,%esi
xor    %edx,%edx
call   1030 <print_colored@plt>
lea    0xe69(%rip),%rdi
mov    $0x7,%esi
xor    %edx,%edx
call   1030 <print_colored@plt>
lea    0xe60(%rip),%rdi
mov    $0x8,%esi
xor    %edx,%edx
call   1030 <print_colored@plt>
lea    0xe5c(%rip),%rdi
mov    $0x9,%esi
xor    %edx,%edx
call   1030 <print_colored@plt>
lea    0xe59(%rip),%rdi
mov    $0xa,%esi
xor    %edx,%edx
call   1030 <print_colored@plt>
lea    0xe58(%rip),%rdi
mov    $0xb,%esi
xor    %edx,%edx
call   1030 <print_colored@plt>
lea    0xe58(%rip),%rdi
mov    $0xc,%esi
xor    %edx,%edx
call   1030 <print_colored@plt>
lea    0xe55(%rip),%rdi
mov    $0xd,%esi
xor    %edx,%edx
call   1030 <print_colored@plt>
lea    0xe4d(%rip),%rdi
mov    $0xe,%esi
xor    %edx,%edx
call   1030 <print_colored@plt>
lea    0xe47(%rip),%rdi
mov    $0xf,%esi
xor    %edx,%edx
call   1030 <print_colored@plt>
lea    0xe40(%rip),%rdi
call   1050 <print@plt>
xor    %eax,%eax
call   1080 <readStr@plt>
mov    %eax,%edi
call   1040 <str_to_int@plt>
mov    %eax,%ebx
lea    0xe37(%rip),%rdi
call   1050 <print@plt>
xor    %eax,%eax
call   1080 <readStr@plt>
mov    %eax,%edi
call   1040 <str_to_int@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1060 <set_screen_color@plt>
xor    %eax,%eax
pop    %rbx
jmp    1070 <clearScreen@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"\0AColor codes : \00"
@.str.1 = [11 x i8] c"\0A0 : black\00"
@.str.2 = [10 x i8] c"\0A1 : blue\00"
@.str.3 = [11 x i8] c"\0A2 : green\00"
@.str.4 = [10 x i8] c"\0A3 : cyan\00"
@.str.5 = [9 x i8] c"\0A4 : red\00"
@.str.6 = [12 x i8] c"\0A5 : purple\00"
@.str.7 = [12 x i8] c"\0A6 : orange\00"
@.str.8 = [10 x i8] c"\0A7 : grey\00"
@.str.9 = [15 x i8] c"\0A8 : dark grey\00"
@.str.10 = [16 x i8] c"\0A9 : blue light\00"
@.str.11 = [18 x i8] c"\0A10 : green light\00"
@.str.12 = [19 x i8] c"\0A11 : blue lighter\00"
@.str.13 = [16 x i8] c"\0A12 : red light\00"
@.str.14 = [11 x i8] c"\0A13 : rose\00"
@.str.15 = [13 x i8] c"\0A14 : yellow\00"
@.str.16 = [12 x i8] c"\0A15 : white\00"
@.str.17 = [19 x i8] c"\0A\0A Text color ? : \00"
@.str.18 = [25 x i8] c"\0A\0A Background color ? : \00"
define void @set_background_color() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @print(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @print(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @print_colored(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 0)
%6 = call i32 @print_colored(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 2, i32 0)
%7 = call i32 @print_colored(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 3, i32 0)
%8 = call i32 @print_colored(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i32 4, i32 0)
%9 = call i32 @print_colored(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i32 5, i32 0)
%10 = call i32 @print_colored(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i32 6, i32 0)
%11 = call i32 @print_colored(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i32 7, i32 0)
%12 = call i32 @print_colored(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i32 8, i32 0)
%13 = call i32 @print_colored(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i32 9, i32 0)
%14 = call i32 @print_colored(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0), i32 10, i32 0)
%15 = call i32 @print_colored(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0), i32 11, i32 0)
%16 = call i32 @print_colored(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.13, i64 0, i64 0), i32 12, i32 0)
%17 = call i32 @print_colored(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0), i32 13, i32 0)
%18 = call i32 @print_colored(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.15, i64 0, i64 0), i32 14, i32 0)
%19 = call i32 @print_colored(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.16, i64 0, i64 0), i32 15, i32 0)
%20 = call i32 @print(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.17, i64 0, i64 0))
%21 = call i32 (...) @readStr()
%22 = call i32 @str_to_int(i32 %21)
store i32 %22, i32* %1
%23 = call i32 @print(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.18, i64 0, i64 0))
%24 = call i32 (...) @readStr()
%25 = call i32 @str_to_int(i32 %24)
store i32 %25, i32* %2
%26 = load i32, i32* %1
%27 = load i32, i32* %2
%28 = call i32 @set_screen_color(i32 %26, i32 %27)
%29 = call i32 (...) @clearScreen()
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"\0AColor codes : \00"
@.str.1 = [11 x i8] c"\0A0 : black\00"
@.str.2 = [10 x i8] c"\0A1 : blue\00"
@.str.3 = [11 x i8] c"\0A2 : green\00"
@.str.4 = [10 x i8] c"\0A3 : cyan\00"
@.str.5 = [9 x i8] c"\0A4 : red\00"
@.str.6 = [12 x i8] c"\0A5 : purple\00"
@.str.7 = [12 x i8] c"\0A6 : orange\00"
@.str.8 = [10 x i8] c"\0A7 : grey\00"
@.str.9 = [15 x i8] c"\0A8 : dark grey\00"
@.str.10 = [16 x i8] c"\0A9 : blue light\00"
@.str.11 = [18 x i8] c"\0A10 : green light\00"
@.str.12 = [19 x i8] c"\0A11 : blue lighter\00"
@.str.13 = [16 x i8] c"\0A12 : red light\00"
@.str.14 = [11 x i8] c"\0A13 : rose\00"
@.str.15 = [13 x i8] c"\0A14 : yellow\00"
@.str.16 = [12 x i8] c"\0A15 : white\00"
@.str.17 = [19 x i8] c"\0A\0A Text color ? : \00"
@.str.18 = [25 x i8] c"\0A\0A Background color ? : \00"
define void @set_background_color() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @print(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @print_colored(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 0)
%4 = tail call i32 @print_colored(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 2, i32 0)
%5 = tail call i32 @print_colored(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 3, i32 0)
%6 = tail call i32 @print_colored(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i32 4, i32 0)
%7 = tail call i32 @print_colored(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i32 5, i32 0)
%8 = tail call i32 @print_colored(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i32 6, i32 0)
%9 = tail call i32 @print_colored(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i32 7, i32 0)
%10 = tail call i32 @print_colored(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i32 8, i32 0)
%11 = tail call i32 @print_colored(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i32 9, i32 0)
%12 = tail call i32 @print_colored(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0), i32 10, i32 0)
%13 = tail call i32 @print_colored(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0), i32 11, i32 0)
%14 = tail call i32 @print_colored(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.13, i64 0, i64 0), i32 12, i32 0)
%15 = tail call i32 @print_colored(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0), i32 13, i32 0)
%16 = tail call i32 @print_colored(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.15, i64 0, i64 0), i32 14, i32 0)
%17 = tail call i32 @print_colored(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.16, i64 0, i64 0), i32 15, i32 0)
%18 = tail call i32 @print(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.17, i64 0, i64 0))
%19 = tail call i32 (...) @readStr()
%20 = tail call i32 @str_to_int(i32 %19)
%21 = tail call i32 @print(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.18, i64 0, i64 0))
%22 = tail call i32 (...) @readStr()
%23 = tail call i32 @str_to_int(i32 %22)
%24 = tail call i32 @set_screen_color(i32 %20, i32 %23)
%25 = tail call i32 (...) @clearScreen()
ret void
}