#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*/ _ok(char *, int, char *, int, char *);
int /*<<< orphan*/ printf(char *, char const *);
int strcmp(char const *, char const *);
void _is(char *test_name, const char *str1, const char *str2, char *file,
         int linenum) {
  int diff;
  if (str1 == NULL || str2 == NULL) {
    diff = 1;
  } else {
    diff = strcmp(str1, str2);
  }
  if (!test_name)
    test_name = "()";
  _ok(test_name, (diff == 0), file, linenum, "");
  if (diff) {
    printf("#      got: %s\n", str1 ? str1 : "(null)");
    printf("# expected: %s\n", str2 ? str2 : "(null)");
  }
}


x86 assembly (clang, -O0):
<_is>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1162 <_is+0x32>
cmpq   $0x0,-0x18(%rbp)
jne    116e <_is+0x3e>
movl   $0x1,-0x28(%rbp)
jmp    117e <_is+0x4e>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcmp@plt>
mov    %eax,-0x28(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1194 <_is+0x64>
lea    0xe70(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
cmpl   $0x0,-0x28(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%esi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
lea    0xe77(%rip),%r8
call   1050 <_ok@plt>
cmpl   $0x0,-0x28(%rbp)
je     1231 <_is+0x101>
cmpq   $0x0,-0x10(%rbp)
je     11d9 <_is+0xa9>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    11e9 <_is+0xb9>
lea    0xe33(%rip),%rax
mov    %rax,-0x30(%rbp)
jmp    11e9 <_is+0xb9>
mov    -0x30(%rbp),%rsi
lea    0xe0f(%rip),%rdi
call   1030 <printf@plt>
cmpq   $0x0,-0x18(%rbp)
je     1211 <_is+0xe1>
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
jmp    1221 <_is+0xf1>
lea    0xdfb(%rip),%rax
mov    %rax,-0x38(%rbp)
jmp    1221 <_is+0xf1>
mov    -0x38(%rbp),%rsi
lea    0xdee(%rip),%rdi
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_is>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%r15d
mov    %rcx,%r12
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%rbp
xor    %eax,%eax
test   %rsi,%rsi
je     1163 <_is+0x33>
test   %r14,%r14
je     1163 <_is+0x33>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
test   %eax,%eax
sete   %al
test   %rbp,%rbp
lea    0xe93(%rip),%rdi
cmovne %rbp,%rdi
movzbl %al,%ebp
lea    0xeae(%rip),%r8
mov    %ebp,%esi
mov    %r12,%rdx
mov    %r15d,%ecx
call   1050 <_ok@plt>
test   %bpl,%bpl
je     1196 <_is+0x66>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
test   %rbx,%rbx
lea    0xe73(%rip),%rbp
cmove  %rbp,%rbx
lea    0xe58(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
test   %r14,%r14
cmove  %rbp,%r14
lea    0xe59(%rip),%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"()\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [16 x i8] c"# got: %s\0A\00"
@.str.3 = [7 x i8] c"(null)\00"
@.str.4 = [16 x i8] c"# expected: %s\0A\00"
define void @_is(i8* %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%12 = load i8*, i8** %7
%13 = icmp eq i8* %12, null
br i1 %13, label %17, label %14
14: ; preds = %5
%15 = load i8*, i8** %8
%16 = icmp eq i8* %15, null
br i1 %16, label %17, label %18
17: ; preds = %14, %5
store i32 1, i32* %11
br label %22
18: ; preds = %14
%19 = load i8*, i8** %7
%20 = load i8*, i8** %8
%21 = call i32 @strcmp(i8* %19, i8* %20)
store i32 %21, i32* %11
br label %22
22: ; preds = %18, %17
%23 = load i8*, i8** %6
%24 = icmp ne i8* %23, null
br i1 %24, label %26, label %25
25: ; preds = %22
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %6
br label %26
26: ; preds = %25, %22
%27 = load i8*, i8** %6
%28 = load i32, i32* %11
%29 = icmp eq i32 %28, 0
%30 = zext i1 %29 to i32
%31 = load i8*, i8** %9
%32 = load i32, i32* %10
%33 = call i32 @_ok(i8* %27, i32 %30, i8* %31, i32 %32, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%34 = load i32, i32* %11
%35 = icmp ne i32 %34, 0
br i1 %35, label %36, label %53
36: ; preds = %26
%37 = load i8*, i8** %7
%38 = icmp ne i8* %37, null
br i1 %38, label %39, label %41
39: ; preds = %36
%40 = load i8*, i8** %7
br label %42
41: ; preds = %36
br label %42
42: ; preds = %41, %39
%43 = phi i8* [ %40, %39 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), %41 ]
%44 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* %43)
%45 = load i8*, i8** %8
%46 = icmp ne i8* %45, null
br i1 %46, label %47, label %49
47: ; preds = %42
%48 = load i8*, i8** %8
br label %50
49: ; preds = %42
br label %50
50: ; preds = %49, %47
%51 = phi i8* [ %48, %47 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), %49 ]
%52 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8* %51)
br label %53
53: ; preds = %50, %26
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"()\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [16 x i8] c"# got: %s\0A\00"
@.str.3 = [7 x i8] c"(null)\00"
@.str.4 = [16 x i8] c"# expected: %s\0A\00"
define void @_is(i8* %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = icmp eq i8* %1, null
%7 = icmp eq i8* %2, null
%8 = or i1 %6, %7
br i1 %8, label %12, label %9
9: ; preds = %5
%10 = tail call i32 @strcmp(i8* dereferenceable(1) %1, i8* dereferenceable(1) %2)
%11 = icmp eq i32 %10, 0
br label %12
12: ; preds = %5, %9
%13 = phi i1 [ %11, %9 ], [ false, %5 ]
%14 = icmp eq i8* %0, null
%15 = select i1 %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0
%16 = zext i1 %13 to i32
%17 = tail call i32 @_ok(i8* %15, i32 %16, i8* %3, i32 %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br i1 %13, label %23, label %18
18: ; preds = %12
%19 = select i1 %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %1
%20 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* %19)
%21 = select i1 %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %2
%22 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8* %21)
br label %23
23: ; preds = %18, %12
ret void
}