#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 *, char const *, ...);
scalar_t__ strcasecmp(char const *, char *);
void error_add(const char *obj, const char *fail, const char *soln) {
  if (obj == 0 || *obj == '\0')
    return;
  if (strcasecmp(obj, "INFORMATION") != 0) {
    printf("ERROR returned from: %s\n%s\n", obj, fail);
  } else {
    printf("%s\n", fail);
  }
  if (soln != 0 && *soln != '\0')
    printf("SOLUTION: %s\n", soln);
}


x86 assembly (clang, -O0):
<error_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114f <error_add+0x2f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1154 <error_add+0x34>
jmp    11c8 <error_add+0xa8>
mov    -0x8(%rbp),%rdi
lea    0xea1(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
je     1189 <error_add+0x69>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    119b <error_add+0x7b>
mov    -0x10(%rbp),%rsi
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpq   $0x0,-0x18(%rbp)
je     11c8 <error_add+0xa8>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     11c8 <error_add+0xa8>
mov    -0x18(%rbp),%rsi
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error_add>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1199 <error_add+0x79>
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     1199 <error_add+0x79>
mov    %rdx,%r14
mov    %rsi,%r15
lea    0xec1(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     1167 <error_add+0x47>
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
test   %r14,%r14
jne    117d <error_add+0x5d>
jmp    1199 <error_add+0x79>
lea    0xeb6(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
test   %r14,%r14
je     1199 <error_add+0x79>
cmpb   $0x0,(%r14)
je     1199 <error_add+0x79>
lea    0xe9e(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <printf@plt>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [12 x i8] c"INFORMATION\00"
@.str.1 = [28 x i8] c"ERROR returned from: %s\0A%s\0A\00"
@.str.2 = [4 x i8] c"%s\0A\00"
@.str.3 = [14 x i8] c"SOLUTION: %s\0A\00"
define void @error_add(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 = icmp eq i8* %7, null
br i1 %8, label %14, label %9
9: ; preds = %3
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %9, %3
br label %37
15: ; preds = %9
%16 = load i8*, i8** %4
%17 = call i64 @strcasecmp(i8* %16, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %23
19: ; preds = %15
%20 = load i8*, i8** %4
%21 = load i8*, i8** %5
%22 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* %20, i8* %21)
br label %26
23: ; preds = %15
%24 = load i8*, i8** %5
%25 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %24)
br label %26
26: ; preds = %23, %19
%27 = load i8*, i8** %6
%28 = icmp ne i8* %27, null
br i1 %28, label %29, label %37
29: ; preds = %26
%30 = load i8*, i8** %6
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp ne i32 %32, 0
br i1 %33, label %34, label %37
34: ; preds = %29
%35 = load i8*, i8** %6
%36 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* %35)
br label %37
37: ; preds = %14, %34, %29, %26
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"INFORMATION\00"
@.str.1 = [28 x i8] c"ERROR returned from: %s\0A%s\0A\00"
@.str.2 = [4 x i8] c"%s\0A\00"
@.str.3 = [14 x i8] c"SOLUTION: %s\0A\00"
define void @error_add(i8* %0, i8* %1, i8* %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %22, label %5
5: ; preds = %3
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 0
br i1 %7, label %22, label %8
8: ; preds = %5
%9 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %8
%12 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %1)
br label %15
13: ; preds = %8
%14 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %1)
br label %15
15: ; preds = %13, %11
%16 = icmp eq i8* %2, null
br i1 %16, label %22, label %17
17: ; preds = %15
%18 = load i8, i8* %2
%19 = icmp eq i8 %18, 0
br i1 %19, label %22, label %20
20: ; preds = %17
%21 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* %2)
br label %22
22: ; preds = %3, %5, %20, %17, %15
ret void
}