int main() {
  char cc[][10] = {"\x1b[31m", "hello world"};
  printf("\x1b[31m");
  printf("%d%", strlen("\x1b[31m"));
  printf("hello world\n");
  printf("\x1b[33m");
  printf("hello world\n");
  printf("%s%s", cc[0], cc[1]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
mov    $0x5,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    -0x20(%rbp),%rdx
add    $0xa,%rdx
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    0xee5(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xeca(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xed3(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecb(%rip),%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec7(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xead(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xa(%rsp),%rdx
lea    0xe98(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.cc = [2 x [10 x i8]] [[10 x i8] c"\1B[31m\00\00\00\00\00", [10 x i8] c"hello worl"]
@.str = [6 x i8] c"\1B[31m\00"
@.str.1 = [4 x i8] c"%d%\00"
@.str.2 = [13 x i8] c"hello world\0A\00"
@.str.3 = [6 x i8] c"\1B[33m\00"
@.str.4 = [5 x i8] c"%s%s\00"
define i32 @main() {
%1 = alloca [2 x [10 x i8]]
%2 = bitcast [2 x [10 x i8]]* %1 to i8*
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 5)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%8 = getelementptr inbounds [2 x [10 x i8]], [2 x [10 x i8]]* %1, i64 0, i64 0
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 0
%10 = getelementptr inbounds [2 x [10 x i8]], [2 x [10 x i8]]* %1, i64 0, i64 1
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %10, i64 0, i64 0
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* %9, i8* %11)
ret i32 0
}

LLVM IR (-O2):
@__const.main.cc = [2 x [10 x i8]] [[10 x i8] c"\1B[31m\00\00\00\00\00", [10 x i8] c"hello worl"]
@.str = [6 x i8] c"\1B[31m\00"
@.str.1 = [4 x i8] c"%d%\00"
@.str.3 = [6 x i8] c"\1B[33m\00"
@.str.4 = [5 x i8] c"%s%s\00"
@str.5 = [12 x i8] c"hello world\00"
define i32 @main() {
%1 = alloca [2 x [10 x i8]]
%2 = getelementptr inbounds [2 x [10 x i8]], [2 x [10 x i8]]* %1, i64 0, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 5)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.5, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.5, i64 0, i64 0))
%8 = getelementptr inbounds [2 x [10 x i8]], [2 x [10 x i8]]* %1, i64 0, i64 1, i64 0
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* %2, i8* %8)
ret i32 0
}