#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*/ my_strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
int my_int_error(char *error, char *color) {
  if (color)
    write(2, color, my_strlen(color));
  if (error)
    write(2, error, my_strlen(error));
  write(2, "\033[0m", my_strlen("\033[0m"));
  return (-1);
}


x86 assembly (clang, -O0):
<my_int_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115c <my_int_error+0x3c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <my_strlen@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
call   1040 <write@plt>
cmpq   $0x0,-0x8(%rbp)
je     1188 <my_int_error+0x68>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <my_strlen@plt>
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
call   1040 <write@plt>
lea    0xe71(%rip),%rdi
call   1030 <my_strlen@plt>
mov    %eax,%edx
mov    $0x2,%edi
lea    0xe5e(%rip),%rsi
call   1040 <write@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_int_error>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %rsi,%rsi
je     1146 <my_int_error+0x26>
mov    %rsi,%rbx
mov    %rsi,%rdi
call   1030 <my_strlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <write@plt>
test   %r14,%r14
je     1162 <my_int_error+0x42>
mov    %r14,%rdi
call   1030 <my_strlen@plt>
mov    $0x2,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1040 <write@plt>
lea    0xe97(%rip),%rbx
mov    %rbx,%rdi
call   1030 <my_strlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <write@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

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