#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*/ clrprintf(char *, char *, char const *, char *);
int main(int argc, char **argv) {
  const char *str = "hello world";
  clrprintf("%s%s%s\n", "\E[30m", str, "\E[0m");
  clrprintf("%s%s%s\n", "\E[31m", str, "\E[0m");
  clrprintf("%s%s%s\n", "\E[32m", str, "\E[0m");
  clrprintf("%s%s%s\n", "\E[33m", str, "\E[0m");
  clrprintf("%s%s%s\n", "\E[34m", str, "\E[0m");
  clrprintf("%s%s%s\n", "\E[35m", str, "\E[0m");
  clrprintf("%s%s%s\n", "\E[36m", str, "\E[0m");
  clrprintf("%s%s%s\n", "\E[37m", str, "\E[0m");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdx
lea    0xed0(%rip),%rdi
lea    0xed1(%rip),%rsi
lea    0xed0(%rip),%rcx
call   1030 <clrprintf@plt>
mov    -0x18(%rbp),%rdx
lea    0xeb2(%rip),%rdi
lea    0xebe(%rip),%rsi
lea    0xeb2(%rip),%rcx
call   1030 <clrprintf@plt>
mov    -0x18(%rbp),%rdx
lea    0xe94(%rip),%rdi
lea    0xea6(%rip),%rsi
lea    0xe94(%rip),%rcx
call   1030 <clrprintf@plt>
mov    -0x18(%rbp),%rdx
lea    0xe76(%rip),%rdi
lea    0xe8e(%rip),%rsi
lea    0xe76(%rip),%rcx
call   1030 <clrprintf@plt>
mov    -0x18(%rbp),%rdx
lea    0xe58(%rip),%rdi
lea    0xe76(%rip),%rsi
lea    0xe58(%rip),%rcx
call   1030 <clrprintf@plt>
mov    -0x18(%rbp),%rdx
lea    0xe3a(%rip),%rdi
lea    0xe5e(%rip),%rsi
lea    0xe3a(%rip),%rcx
call   1030 <clrprintf@plt>
mov    -0x18(%rbp),%rdx
lea    0xe1c(%rip),%rdi
lea    0xe46(%rip),%rsi
lea    0xe1c(%rip),%rcx
call   1030 <clrprintf@plt>
mov    -0x18(%rbp),%rdx
lea    0xdfe(%rip),%rdi
lea    0xe2e(%rip),%rsi
lea    0xdfe(%rip),%rcx
call   1030 <clrprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
lea    0xef0(%rip),%rbx
lea    0xef1(%rip),%rsi
lea    0xed6(%rip),%r14
lea    0xee9(%rip),%r15
mov    %rbx,%rdi
mov    %r14,%rdx
mov    %r15,%rcx
call   1030 <clrprintf@plt>
lea    0xed9(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
mov    %r15,%rcx
call   1030 <clrprintf@plt>
lea    0xeca(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
mov    %r15,%rcx
call   1030 <clrprintf@plt>
lea    0xebb(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
mov    %r15,%rcx
call   1030 <clrprintf@plt>
lea    0xeac(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
mov    %r15,%rcx
call   1030 <clrprintf@plt>
lea    0xe9d(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
mov    %r15,%rcx
call   1030 <clrprintf@plt>
lea    0xe8e(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
mov    %r15,%rcx
call   1030 <clrprintf@plt>
lea    0xe7f(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
mov    %r15,%rcx
call   1030 <clrprintf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [12 x i8] c"hello world\00"
@.str.1 = [8 x i8] c"%s%s%s\0A\00"
@.str.2 = [6 x i8] c"\1B[30m\00"
@.str.3 = [5 x i8] c"\1B[0m\00"
@.str.4 = [6 x i8] c"\1B[31m\00"
@.str.5 = [6 x i8] c"\1B[32m\00"
@.str.6 = [6 x i8] c"\1B[33m\00"
@.str.7 = [6 x i8] c"\1B[34m\00"
@.str.8 = [6 x i8] c"\1B[35m\00"
@.str.9 = [6 x i8] c"\1B[36m\00"
@.str.10 = [6 x i8] c"\1B[37m\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %6
%7 = load i8*, i8** %6
%8 = call i32 @clrprintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%9 = load i8*, i8** %6
%10 = call i32 @clrprintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%11 = load i8*, i8** %6
%12 = call i32 @clrprintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%13 = load i8*, i8** %6
%14 = call i32 @clrprintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i8* %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%15 = load i8*, i8** %6
%16 = call i32 @clrprintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8* %15, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%17 = load i8*, i8** %6
%18 = call i32 @clrprintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i8* %17, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%19 = load i8*, i8** %6
%20 = call i32 @clrprintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8* %19, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%21 = load i8*, i8** %6
%22 = call i32 @clrprintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), i8* %21, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"hello world\00"
@.str.1 = [8 x i8] c"%s%s%s\0A\00"
@.str.2 = [6 x i8] c"\1B[30m\00"
@.str.3 = [5 x i8] c"\1B[0m\00"
@.str.4 = [6 x i8] c"\1B[31m\00"
@.str.5 = [6 x i8] c"\1B[32m\00"
@.str.6 = [6 x i8] c"\1B[33m\00"
@.str.7 = [6 x i8] c"\1B[34m\00"
@.str.8 = [6 x i8] c"\1B[35m\00"
@.str.9 = [6 x i8] c"\1B[36m\00"
@.str.10 = [6 x i8] c"\1B[37m\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @clrprintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%4 = tail call i32 @clrprintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @clrprintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%6 = tail call i32 @clrprintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%7 = tail call i32 @clrprintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%8 = tail call i32 @clrprintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%9 = tail call i32 @clrprintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%10 = tail call i32 @clrprintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}