#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 ordering_err_2();
int strcmp(char const *, char const *);
int compare_strz(void *context, const char *check, const char *baseline) {
  if (!check || !baseline)
    return ordering_err_2();
  return (
      (((((strcmp(check, baseline))) !=
         (((int)-(((int)0x37ED)
                  << (8 * (((!!(((!!(sizeof(int))) * ((sizeof(int)) - 1)))) *
                            ((((!!(sizeof(int))) * ((sizeof(int)) - 1))) -
                             1)))))))) &&
        (((strcmp(check, baseline))) !=
         (((int)-(((int)0x37EE)
                  << (8 * (((!!(((!!(sizeof(int))) * ((sizeof(int)) - 1)))) *
                            ((((!!(sizeof(int))) * ((sizeof(int)) - 1))) -
                             1))))))))))
          ? (strcmp(check, baseline))
          : ((((((strcmp(check, baseline)))) <= ((0)))
                  ? (((((strcmp(check, baseline)))) < ((0)))
                         ? (((((int)-(((int)0x37EF)
                                      << (8 * (((!!(((!!(sizeof(int))) *
                                                     ((sizeof(int)) - 1)))) *
                                                ((((!!(sizeof(int))) *
                                                   ((sizeof(int)) - 1))) -
                                                 1)))))))))
                         : (((0))))
                  : (((((int)-(((int)-(
                        ((int)0x37EF)
                        << (8 *
                            (((!!(((!!(sizeof(int))) * ((sizeof(int)) - 1)))) *
                              ((((!!(sizeof(int))) * ((sizeof(int)) - 1))) -
                               1))))))))))))));
}


x86 assembly (clang, -O0):
<compare_strz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114a <compare_strz+0x2a>
cmpq   $0x0,-0x20(%rbp)
jne    1159 <compare_strz+0x39>
mov    $0x0,%al
call   1040 <ordering_err_2@plt>
mov    %eax,-0x4(%rbp)
jmp    11f1 <compare_strz+0xd1>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0xc8130000,%eax
je     119e <compare_strz+0x7e>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0xc8120000,%eax
je     119e <compare_strz+0x7e>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x24(%rbp)
jmp    11eb <compare_strz+0xcb>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jg     11d8 <compare_strz+0xb8>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0xc8110000,%ecx
cmp    $0x0,%edx
cmovl  %ecx,%eax
mov    %eax,-0x28(%rbp)
jmp    11e5 <compare_strz+0xc5>
mov    $0x37ef0000,%eax
mov    %eax,-0x28(%rbp)
jmp    11e5 <compare_strz+0xc5>
mov    -0x28(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_strz>:
test   %rsi,%rsi
je     1151 <compare_strz+0x31>
test   %rdx,%rdx
je     1151 <compare_strz+0x31>
push   %rax
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <strcmp@plt>
mov    %eax,%ecx
or     $0x10000,%ecx
cmp    $0xc8130000,%ecx
lea    0x8(%rsp),%rsp
jne    1150 <compare_strz+0x30>
mov    $0xc8110000,%eax
ret
xor    %eax,%eax
jmp    1040 <ordering_err_2@plt>

LLVM IR (-O0):
define i32 @compare_strz(i8* %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%8 = load i8*, i8** %6
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = load i8*, i8** %7
%12 = icmp ne i8* %11, null
br i1 %12, label %15, label %13
13: ; preds = %10, %3
%14 = call i32 (...) @ordering_err_2()
store i32 %14, i32* %4
br label %46
15: ; preds = %10
%16 = load i8*, i8** %6
%17 = load i8*, i8** %7
%18 = call i32 @strcmp(i8* %16, i8* %17)
%19 = icmp ne i32 %18, -938278912
br i1 %19, label %20, label %29
20: ; preds = %15
%21 = load i8*, i8** %6
%22 = load i8*, i8** %7
%23 = call i32 @strcmp(i8* %21, i8* %22)
%24 = icmp ne i32 %23, -938344448
br i1 %24, label %25, label %29
25: ; preds = %20
%26 = load i8*, i8** %6
%27 = load i8*, i8** %7
%28 = call i32 @strcmp(i8* %26, i8* %27)
br label %44
29: ; preds = %20, %15
%30 = load i8*, i8** %6
%31 = load i8*, i8** %7
%32 = call i32 @strcmp(i8* %30, i8* %31)
%33 = icmp sle i32 %32, 0
br i1 %33, label %34, label %41
34: ; preds = %29
%35 = load i8*, i8** %6
%36 = load i8*, i8** %7
%37 = call i32 @strcmp(i8* %35, i8* %36)
%38 = icmp slt i32 %37, 0
%39 = zext i1 %38 to i64
%40 = select i1 %38, i32 -938409984, i32 0
br label %42
41: ; preds = %29
br label %42
42: ; preds = %41, %34
%43 = phi i32 [ %40, %34 ], [ 938409984, %41 ]
br label %44
44: ; preds = %42, %25
%45 = phi i32 [ %28, %25 ], [ %43, %42 ]
store i32 %45, i32* %4
br label %46
46: ; preds = %44, %13
%47 = load i32, i32* %4
ret i32 %47
}

LLVM IR (-O2):
define i32 @compare_strz(i8* nocapture readnone %0, i8* %1, i8* %2) {
%4 = icmp ne i8* %1, null
%5 = icmp ne i8* %2, null
%6 = and i1 %4, %5
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 (...) @ordering_err_2()
br label %12
9: ; preds = %3
%10 = tail call i32 @strcmp(i8* %1, i8* %2)
switch i32 %10, label %12 [
i32 -938278912, label %11
i32 -938344448, label %11
]
11: ; preds = %9, %9
br label %12
12: ; preds = %11, %9, %7
%13 = phi i32 [ %8, %7 ], [ -938409984, %11 ], [ %10, %9 ]
ret i32 %13
}