#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*/ ft_putendl_fd(char *, int);
int /*<<< orphan*/ ft_putstr_fd(char *, int);
int end_put(char *str1, char *str2, int ret) {
  if (str1) {
    if (str2) {
      ft_putstr_fd(str1, 2);
      ft_putendl_fd(str2, 2);
    } else
      ft_putendl_fd(str1, 2);
  } else if (str2)
    ft_putendl_fd(str2, 2);
  else
    ft_putendl_fd("error putstr_exit, str == NULL", 2);
  return (ret);
}


x86 assembly (clang, -O0):
<end_put>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     117d <end_put+0x5d>
cmpq   $0x0,-0x10(%rbp)
je     116a <end_put+0x4a>
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
call   1030 <ft_putstr_fd@plt>
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
call   1040 <ft_putendl_fd@plt>
jmp    1178 <end_put+0x58>
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
call   1040 <ft_putendl_fd@plt>
jmp    11b1 <end_put+0x91>
cmpq   $0x0,-0x10(%rbp)
je     119b <end_put+0x7b>
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
call   1040 <ft_putendl_fd@plt>
jmp    11ac <end_put+0x8c>
lea    0xe5e(%rip),%rdi
mov    $0x2,%esi
call   1040 <ft_putendl_fd@plt>
jmp    11b1 <end_put+0x91>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<end_put>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rbx
test   %rdi,%rdi
je     1141 <end_put+0x21>
test   %rbx,%rbx
je     1152 <end_put+0x32>
mov    $0x2,%esi
call   1030 <ft_putstr_fd@plt>
mov    %rbx,%rdi
jmp    1152 <end_put+0x32>
test   %rbx,%rbx
je     114b <end_put+0x2b>
mov    %rbx,%rdi
jmp    1152 <end_put+0x32>
lea    0xeae(%rip),%rdi
mov    $0x2,%esi
call   1040 <ft_putendl_fd@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"error putstr_exit, str == NULL\00"
define i32 @end_put(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %21
9: ; preds = %3
%10 = load i8*, i8** %5
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %17
12: ; preds = %9
%13 = load i8*, i8** %4
%14 = call i32 @ft_putstr_fd(i8* %13, i32 2)
%15 = load i8*, i8** %5
%16 = call i32 @ft_putendl_fd(i8* %15, i32 2)
br label %20
17: ; preds = %9
%18 = load i8*, i8** %4
%19 = call i32 @ft_putendl_fd(i8* %18, i32 2)
br label %20
20: ; preds = %17, %12
br label %30
21: ; preds = %3
%22 = load i8*, i8** %5
%23 = icmp ne i8* %22, null
br i1 %23, label %24, label %27
24: ; preds = %21
%25 = load i8*, i8** %5
%26 = call i32 @ft_putendl_fd(i8* %25, i32 2)
br label %29
27: ; preds = %21
%28 = call i32 @ft_putendl_fd(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 2)
br label %29
29: ; preds = %27, %24
br label %30
30: ; preds = %29, %20
%31 = load i32, i32* %6
ret i32 %31
}

LLVM IR (-O2):
@.str = [31 x i8] c"error putstr_exit, str == NULL\00"
define i32 @end_put(i8* %0, i8* %1, i32 returned %2) {
%4 = icmp eq i8* %0, null
%5 = icmp eq i8* %1, null
br i1 %4, label %12, label %6
6: ; preds = %3
br i1 %5, label %10, label %7
7: ; preds = %6
%8 = tail call i32 @ft_putstr_fd(i8* %0, i32 2)
%9 = tail call i32 @ft_putendl_fd(i8* %1, i32 2)
br label %17
10: ; preds = %6
%11 = tail call i32 @ft_putendl_fd(i8* %0, i32 2)
br label %17
12: ; preds = %3
br i1 %5, label %15, label %13
13: ; preds = %12
%14 = tail call i32 @ft_putendl_fd(i8* %1, i32 2)
br label %17
15: ; preds = %12
%16 = tail call i32 @ft_putendl_fd(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 2)
br label %17
17: ; preds = %13, %15, %7, %10
ret i32 %2
}