#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*/ printf(char *, ...);
int main(int argc, const char *argv[]) {
  printf("\033[%sm%s\033[0m", "0;35",
         "I am printing something with no new line!");
  ;
  printf("\033[%sm%s\033[0m\n", "1;33", "\nNow we are in new line");
  ;
  printf("\033["
         "0;34"
         "m"
         "This support formatted strings, like %d, and let's try %s"
         "\033[0m",
         5, "string");
  ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
lea    0xed8(%rip),%rsi
lea    0xed6(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef2(%rip),%rdi
lea    0xef8(%rip),%rsi
lea    0xef6(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf00(%rip),%rdi
mov    $0x5,%esi
lea    0xf39(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xeed(%rip),%rsi
lea    0xeeb(%rip),%rdx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf07(%rip),%rdi
lea    0xf0d(%rip),%rsi
lea    0xf0b(%rip),%rdx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf15(%rip),%rdi
lea    0xf53(%rip),%rdx
mov    $0x5,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"\1B[%sm%s\1B[0m\00"
@.str.1 = [5 x i8] c"0;35\00"
@.str.2 = [42 x i8] c"I am printing something with no new line!\00"
@.str.3 = [13 x i8] c"\1B[%sm%s\1B[0m\0A\00"
@.str.4 = [5 x i8] c"1;33\00"
@.str.5 = [24 x i8] c"\0ANow we are in new line\00"
@.str.6 = [69 x i8] c"\1B[0;34mThis support formatted strings, like %d, and let's try %s\1B[0m\00"
@.str.7 = [7 x i8] c"string\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.6, i64 0, i64 0), i32 5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"\1B[%sm%s\1B[0m\00"
@.str.1 = [5 x i8] c"0;35\00"
@.str.2 = [42 x i8] c"I am printing something with no new line!\00"
@.str.3 = [13 x i8] c"\1B[%sm%s\1B[0m\0A\00"
@.str.4 = [5 x i8] c"1;33\00"
@.str.5 = [24 x i8] c"\0ANow we are in new line\00"
@.str.6 = [69 x i8] c"\1B[0;34mThis support formatted strings, like %d, and let's try %s\1B[0m\00"
@.str.7 = [7 x i8] c"string\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @.str.6, i64 0, i64 0), i32 5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
ret i32 0
}