#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 ft_strlen(char *);
int /*<<< orphan*/ write(int, char *, int);
void print(char *title, char *message, char *additional) {
  write(1, title, ft_strlen(title));
  if (additional)
    write(1, additional, ft_strlen(additional));
  write(1, message, ft_strlen(message));
  write(1, "\n", 1);
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
cmpq   $0x0,-0x18(%rbp)
je     1181 <print+0x61>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    -0x28(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    -0x30(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
mov    $0x1,%edx
lea    0xe52(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <ft_strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
test   %r15,%r15
je     115e <print+0x3e>
mov    %r15,%rdi
call   1040 <ft_strlen@plt>
mov    $0x1,%edi
mov    %r15,%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    %r14,%rdi
call   1040 <ft_strlen@plt>
mov    $0x1,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <write@plt>
lea    0xe84(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <write@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @print(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @ft_strlen(i8* %0)
%5 = tail call i32 @write(i32 1, i8* %0, i32 %4)
%6 = icmp eq i8* %2, null
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = tail call i32 @ft_strlen(i8* %2)
%9 = tail call i32 @write(i32 1, i8* %2, i32 %8)
br label %10
10: ; preds = %7, %3
%11 = tail call i32 @ft_strlen(i8* %1)
%12 = tail call i32 @write(i32 1, i8* %1, i32 %11)
%13 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}