#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 */
char *ft_strdup(char *);
char *ft_strfreplace(char *, char *, char *);
char *ft_makecolor(char **str) {
  *str = ft_strdup(*str);
  *str = ft_strfreplace(*str, "{red}", "\033[22;31m");
  *str = ft_strfreplace(*str, "{green}", "\033[22;32m");
  *str = ft_strfreplace(*str, "{blue}", "\033[22;34m");
  *str = ft_strfreplace(*str, "{magenta}", "\033[22;35m");
  *str = ft_strfreplace(*str, "{yellow}", "\033[01;33m");
  *str = ft_strfreplace(*str, "{pink}", "\033[01;35m");
  *str = ft_strfreplace(*str, "{cyan}", "\033[01;36m");
  *str = ft_strfreplace(*str, "{white}", "\033[01;37m");
  *str = ft_strfreplace(*str, "{gray}", "\033[01;37m");
  *str = ft_strfreplace(*str, "{blink}", "\033[5m");
  *str = ft_strfreplace(*str, "{eoc}", "\033[22;37m");
  return (*str);
}


x86 assembly (clang, -O0):
<ft_makecolor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <ft_strdup@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
lea    0xeb0(%rip),%rsi
lea    0xeaf(%rip),%rdx
call   1040 <ft_strfreplace@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
lea    0xe9b(%rip),%rsi
lea    0xe9c(%rip),%rdx
call   1040 <ft_strfreplace@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
lea    0xe88(%rip),%rsi
lea    0xe88(%rip),%rdx
call   1040 <ft_strfreplace@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
lea    0xe74(%rip),%rsi
lea    0xe77(%rip),%rdx
call   1040 <ft_strfreplace@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
lea    0xe63(%rip),%rsi
lea    0xe65(%rip),%rdx
call   1040 <ft_strfreplace@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
lea    0xe51(%rip),%rsi
lea    0xe51(%rip),%rdx
call   1040 <ft_strfreplace@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
lea    0xe3d(%rip),%rsi
lea    0xe3d(%rip),%rdx
call   1040 <ft_strfreplace@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
lea    0xe29(%rip),%rsi
lea    0xe2a(%rip),%rdx
call   1040 <ft_strfreplace@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
lea    0xe16(%rip),%rsi
lea    0xe06(%rip),%rdx
call   1040 <ft_strfreplace@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
lea    0xdf9(%rip),%rsi
lea    0xdfa(%rip),%rdx
call   1040 <ft_strfreplace@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
lea    0xde2(%rip),%rsi
lea    0xde1(%rip),%rdx
call   1040 <ft_strfreplace@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_makecolor>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <ft_strdup@plt>
mov    %rax,(%rbx)
lea    0xec7(%rip),%rsi
lea    0xec6(%rip),%rdx
mov    %rax,%rdi
call   1040 <ft_strfreplace@plt>
mov    %rax,(%rbx)
lea    0xebd(%rip),%rsi
lea    0xebe(%rip),%rdx
mov    %rax,%rdi
call   1040 <ft_strfreplace@plt>
mov    %rax,(%rbx)
lea    0xeb5(%rip),%rsi
lea    0xeb5(%rip),%rdx
mov    %rax,%rdi
call   1040 <ft_strfreplace@plt>
mov    %rax,(%rbx)
lea    0xeac(%rip),%rsi
lea    0xeaf(%rip),%rdx
mov    %rax,%rdi
call   1040 <ft_strfreplace@plt>
mov    %rax,(%rbx)
lea    0xea6(%rip),%rsi
lea    0xea8(%rip),%rdx
mov    %rax,%rdi
call   1040 <ft_strfreplace@plt>
mov    %rax,(%rbx)
lea    0xe9f(%rip),%rsi
lea    0xe9f(%rip),%rdx
mov    %rax,%rdi
call   1040 <ft_strfreplace@plt>
mov    %rax,(%rbx)
lea    0xe96(%rip),%rsi
lea    0xe96(%rip),%rdx
mov    %rax,%rdi
call   1040 <ft_strfreplace@plt>
mov    %rax,(%rbx)
lea    0xe8d(%rip),%rsi
lea    0xe8e(%rip),%r14
mov    %rax,%rdi
mov    %r14,%rdx
call   1040 <ft_strfreplace@plt>
mov    %rax,(%rbx)
lea    0xe82(%rip),%rsi
mov    %rax,%rdi
mov    %r14,%rdx
call   1040 <ft_strfreplace@plt>
mov    %rax,(%rbx)
lea    0xe74(%rip),%rsi
lea    0xe75(%rip),%rdx
mov    %rax,%rdi
call   1040 <ft_strfreplace@plt>
mov    %rax,(%rbx)
lea    0xe68(%rip),%rsi
lea    0xe67(%rip),%rdx
mov    %rax,%rdi
call   1040 <ft_strfreplace@plt>
mov    %rax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"{red}\00"
@.str.1 = [9 x i8] c"\1B[22;31m\00"
@.str.2 = [8 x i8] c"{green}\00"
@.str.3 = [9 x i8] c"\1B[22;32m\00"
@.str.4 = [7 x i8] c"{blue}\00"
@.str.5 = [9 x i8] c"\1B[22;34m\00"
@.str.6 = [10 x i8] c"{magenta}\00"
@.str.7 = [9 x i8] c"\1B[22;35m\00"
@.str.8 = [9 x i8] c"{yellow}\00"
@.str.9 = [9 x i8] c"\1B[01;33m\00"
@.str.10 = [7 x i8] c"{pink}\00"
@.str.11 = [9 x i8] c"\1B[01;35m\00"
@.str.12 = [7 x i8] c"{cyan}\00"
@.str.13 = [9 x i8] c"\1B[01;36m\00"
@.str.14 = [8 x i8] c"{white}\00"
@.str.15 = [9 x i8] c"\1B[01;37m\00"
@.str.16 = [7 x i8] c"{gray}\00"
@.str.17 = [8 x i8] c"{blink}\00"
@.str.18 = [5 x i8] c"\1B[5m\00"
@.str.19 = [6 x i8] c"{eoc}\00"
@.str.20 = [9 x i8] c"\1B[22;37m\00"
define i8* @ft_makecolor(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
%5 = call i8* @ft_strdup(i8* %4)
%6 = load i8**, i8*** %2
store i8* %5, i8** %6
%7 = load i8**, i8*** %2
%8 = load i8*, i8** %7
%9 = call i8* @ft_strfreplace(i8* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%10 = load i8**, i8*** %2
store i8* %9, i8** %10
%11 = load i8**, i8*** %2
%12 = load i8*, i8** %11
%13 = call i8* @ft_strfreplace(i8* %12, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%14 = load i8**, i8*** %2
store i8* %13, i8** %14
%15 = load i8**, i8*** %2
%16 = load i8*, i8** %15
%17 = call i8* @ft_strfreplace(i8* %16, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
%18 = load i8**, i8*** %2
store i8* %17, i8** %18
%19 = load i8**, i8*** %2
%20 = load i8*, i8** %19
%21 = call i8* @ft_strfreplace(i8* %20, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
%22 = load i8**, i8*** %2
store i8* %21, i8** %22
%23 = load i8**, i8*** %2
%24 = load i8*, i8** %23
%25 = call i8* @ft_strfreplace(i8* %24, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0))
%26 = load i8**, i8*** %2
store i8* %25, i8** %26
%27 = load i8**, i8*** %2
%28 = load i8*, i8** %27
%29 = call i8* @ft_strfreplace(i8* %28, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0))
%30 = load i8**, i8*** %2
store i8* %29, i8** %30
%31 = load i8**, i8*** %2
%32 = load i8*, i8** %31
%33 = call i8* @ft_strfreplace(i8* %32, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0))
%34 = load i8**, i8*** %2
store i8* %33, i8** %34
%35 = load i8**, i8*** %2
%36 = load i8*, i8** %35
%37 = call i8* @ft_strfreplace(i8* %36, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0))
%38 = load i8**, i8*** %2
store i8* %37, i8** %38
%39 = load i8**, i8*** %2
%40 = load i8*, i8** %39
%41 = call i8* @ft_strfreplace(i8* %40, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0))
%42 = load i8**, i8*** %2
store i8* %41, i8** %42
%43 = load i8**, i8*** %2
%44 = load i8*, i8** %43
%45 = call i8* @ft_strfreplace(i8* %44, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.18, i64 0, i64 0))
%46 = load i8**, i8*** %2
store i8* %45, i8** %46
%47 = load i8**, i8*** %2
%48 = load i8*, i8** %47
%49 = call i8* @ft_strfreplace(i8* %48, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.20, i64 0, i64 0))
%50 = load i8**, i8*** %2
store i8* %49, i8** %50
%51 = load i8**, i8*** %2
%52 = load i8*, i8** %51
ret i8* %52
}

LLVM IR (-O2):
@.str = [6 x i8] c"{red}\00"
@.str.1 = [9 x i8] c"\1B[22;31m\00"
@.str.2 = [8 x i8] c"{green}\00"
@.str.3 = [9 x i8] c"\1B[22;32m\00"
@.str.4 = [7 x i8] c"{blue}\00"
@.str.5 = [9 x i8] c"\1B[22;34m\00"
@.str.6 = [10 x i8] c"{magenta}\00"
@.str.7 = [9 x i8] c"\1B[22;35m\00"
@.str.8 = [9 x i8] c"{yellow}\00"
@.str.9 = [9 x i8] c"\1B[01;33m\00"
@.str.10 = [7 x i8] c"{pink}\00"
@.str.11 = [9 x i8] c"\1B[01;35m\00"
@.str.12 = [7 x i8] c"{cyan}\00"
@.str.13 = [9 x i8] c"\1B[01;36m\00"
@.str.14 = [8 x i8] c"{white}\00"
@.str.15 = [9 x i8] c"\1B[01;37m\00"
@.str.16 = [7 x i8] c"{gray}\00"
@.str.17 = [8 x i8] c"{blink}\00"
@.str.18 = [5 x i8] c"\1B[5m\00"
@.str.19 = [6 x i8] c"{eoc}\00"
@.str.20 = [9 x i8] c"\1B[22;37m\00"
define i8* @ft_makecolor(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i8* @ft_strdup(i8* %2)
store i8* %3, i8** %0
%4 = tail call i8* @ft_strfreplace(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
store i8* %4, i8** %0
%5 = tail call i8* @ft_strfreplace(i8* %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
store i8* %5, i8** %0
%6 = tail call i8* @ft_strfreplace(i8* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
store i8* %6, i8** %0
%7 = tail call i8* @ft_strfreplace(i8* %6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
store i8* %7, i8** %0
%8 = tail call i8* @ft_strfreplace(i8* %7, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0))
store i8* %8, i8** %0
%9 = tail call i8* @ft_strfreplace(i8* %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0))
store i8* %9, i8** %0
%10 = tail call i8* @ft_strfreplace(i8* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0))
store i8* %10, i8** %0
%11 = tail call i8* @ft_strfreplace(i8* %10, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0))
store i8* %11, i8** %0
%12 = tail call i8* @ft_strfreplace(i8* %11, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0))
store i8* %12, i8** %0
%13 = tail call i8* @ft_strfreplace(i8* %12, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.18, i64 0, i64 0))
store i8* %13, i8** %0
%14 = tail call i8* @ft_strfreplace(i8* %13, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.20, i64 0, i64 0))
store i8* %14, i8** %0
ret i8* %14
}