#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 /*<<< orphan*/ system(char *);
void printMessage(char message[128], int newLine, int pause, int clear) {
  printf("%s", message);
  if (newLine)
    printf("\n");
  if (pause)
    system("pause");
  if (clear)
    system("cls");
}


x86 assembly (clang, -O0):
<printMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x0,-0xc(%rbp)
je     115f <printMessage+0x3f>
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x0,-0x10(%rbp)
je     1175 <printMessage+0x55>
lea    0xe95(%rip),%rdi
call   1030 <system@plt>
cmpl   $0x0,-0x14(%rbp)
je     118b <printMessage+0x6b>
lea    0xe85(%rip),%rdi
call   1030 <system@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printMessage>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %esi,%ebx
mov    %rdi,%rsi
lea    0xebb(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   %ebx,%ebx
je     115a <printMessage+0x2a>
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %ebp,%ebp
je     116a <printMessage+0x3a>
lea    0xe9e(%rip),%rdi
call   1040 <system@plt>
test   %r14d,%r14d
je     117f <printMessage+0x4f>
lea    0xe93(%rip),%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <system@plt>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [6 x i8] c"pause\00"
@.str.3 = [4 x i8] c"cls\00"
define void @printMessage(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i32, i32* %6
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %4
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %13, %4
%16 = load i32, i32* %7
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %20
20: ; preds = %18, %15
%21 = load i32, i32* %8
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %25
25: ; preds = %23, %20
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.2 = [6 x i8] c"pause\00"
@.str.3 = [4 x i8] c"cls\00"
define void @printMessage(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = icmp eq i32 %1, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @putchar(i32 10)
br label %9
9: ; preds = %7, %4
%10 = icmp eq i32 %2, 0
br i1 %10, label %13, label %11
11: ; preds = %9
%12 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
%14 = icmp eq i32 %3, 0
br i1 %14, label %17, label %15
15: ; preds = %13
%16 = tail call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %17
17: ; preds = %15, %13
ret void
}