#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*/ message_get_style(char *, char const *, char const *,
                                     char const *);
int /*<<< orphan*/ printf(char *, char *, char const *, char *);
void message_custom(const char *msg, const char *style, const char *color,
                    const char *background) {
  char default_style[12];
  char custom_style[12];
  message_get_style(default_style, "00", "39", "49");
  message_get_style(custom_style, style, color, background);
  printf("%s%s%s", custom_style, msg, default_style);
}


x86 assembly (clang, -O0):
<message_custom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    -0x2c(%rbp),%rdi
lea    0xebd(%rip),%rsi
lea    0xeb9(%rip),%rdx
lea    0xeb5(%rip),%rcx
call   1030 <message_get_style@plt>
lea    -0x38(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <message_get_style@plt>
lea    -0x38(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    -0x2c(%rbp),%rcx
lea    0xe8b(%rip),%rdi
call   1040 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<message_custom>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%r12
lea    0xebf(%rip),%rsi
lea    0xebb(%rip),%rdx
lea    0xeb7(%rip),%rcx
lea    0xc(%rsp),%r13
mov    %r13,%rdi
call   1030 <message_get_style@plt>
mov    %rsp,%rbp
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1030 <message_get_style@plt>
lea    0xe92(%rip),%rdi
mov    %rbp,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
call   1040 <printf@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"00\00"
@.str.1 = [3 x i8] c"39\00"
@.str.2 = [3 x i8] c"49\00"
@.str.3 = [7 x i8] c"%s%s%s\00"
define void @message_custom(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca [12 x i8]
%10 = alloca [12 x i8]
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%11 = getelementptr inbounds [12 x i8], [12 x i8]* %9, i64 0, i64 0
%12 = call i32 @message_get_style(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%13 = getelementptr inbounds [12 x i8], [12 x i8]* %10, i64 0, i64 0
%14 = load i8*, i8** %6
%15 = load i8*, i8** %7
%16 = load i8*, i8** %8
%17 = call i32 @message_get_style(i8* %13, i8* %14, i8* %15, i8* %16)
%18 = getelementptr inbounds [12 x i8], [12 x i8]* %10, i64 0, i64 0
%19 = load i8*, i8** %5
%20 = getelementptr inbounds [12 x i8], [12 x i8]* %9, i64 0, i64 0
%21 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %18, i8* %19, i8* %20)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"00\00"
@.str.1 = [3 x i8] c"39\00"
@.str.2 = [3 x i8] c"49\00"
@.str.3 = [7 x i8] c"%s%s%s\00"
define void @message_custom(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca [12 x i8]
%6 = alloca [12 x i8]
%7 = getelementptr inbounds [12 x i8], [12 x i8]* %5, i64 0, i64 0
%8 = getelementptr inbounds [12 x i8], [12 x i8]* %6, i64 0, i64 0
%9 = call i32 @message_get_style(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @message_get_style(i8* %8, i8* %1, i8* %2, i8* %3)
%11 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %8, i8* %0, i8* %7)
ret void
}