#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 *const, char const *const);
int compare_strzr(void *context, const char *const *check,
                  const char *const *baseline) {
  if (!check || !baseline)
    return ordering_err_2();
  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_strzr>:
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_strzr+0x2a>
cmpq   $0x0,-0x20(%rbp)
jne    1159 <compare_strzr+0x39>
mov    $0x0,%al
call   1040 <ordering_err_2@plt>
mov    %eax,-0x4(%rbp)
jmp    123a <compare_strzr+0x11a>
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
je     1175 <compare_strzr+0x55>
mov    -0x20(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1184 <compare_strzr+0x64>
mov    $0x0,%al
call   1040 <ordering_err_2@plt>
mov    %eax,-0x4(%rbp)
jmp    123a <compare_strzr+0x11a>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
call   1030 <strcmp@plt>
cmp    $0xc8130000,%eax
je     11db <compare_strzr+0xbb>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
call   1030 <strcmp@plt>
cmp    $0xc8120000,%eax
je     11db <compare_strzr+0xbb>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x24(%rbp)
jmp    1234 <compare_strzr+0x114>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jg     1221 <compare_strzr+0x101>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
mov    -0x20(%rbp),%rax
mov    (%rax),%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    122e <compare_strzr+0x10e>
mov    $0x37ef0000,%eax
mov    %eax,-0x28(%rbp)
jmp    122e <compare_strzr+0x10e>
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_strzr>:
push   %r14
push   %rbx
push   %rax
test   %rsi,%rsi
je     117f <compare_strzr+0x5f>
test   %rdx,%rdx
je     117f <compare_strzr+0x5f>
mov    (%rsi),%rbx
test   %rbx,%rbx
je     117f <compare_strzr+0x5f>
mov    (%rdx),%r14
test   %r14,%r14
je     117f <compare_strzr+0x5f>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcmp@plt>
mov    %eax,%ecx
or     $0x10000,%ecx
cmp    $0xc8130000,%ecx
jne    1177 <compare_strzr+0x57>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcmp@plt>
mov    %eax,%ecx
mov    $0x37ef0000,%eax
test   %ecx,%ecx
jg     1177 <compare_strzr+0x57>
mov    $0xc8110000,%eax
cmove  %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <ordering_err_2@plt>

LLVM IR (-O0):
define i32 @compare_strzr(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 %66
15: ; preds = %10
%16 = load i8**, i8*** %6
%17 = load i8*, i8** %16
%18 = icmp ne i8* %17, null
br i1 %18, label %19, label %23
19: ; preds = %15
%20 = load i8**, i8*** %7
%21 = load i8*, i8** %20
%22 = icmp ne i8* %21, null
br i1 %22, label %25, label %23
23: ; preds = %19, %15
%24 = call i32 (...) @ordering_err_2()
store i32 %24, i32* %4
br label %66
25: ; preds = %19
%26 = load i8**, i8*** %6
%27 = load i8*, i8** %26
%28 = load i8**, i8*** %7
%29 = load i8*, i8** %28
%30 = call i32 @strcmp(i8* %27, i8* %29)
%31 = icmp ne i32 %30, -938278912
br i1 %31, label %32, label %45
32: ; preds = %25
%33 = load i8**, i8*** %6
%34 = load i8*, i8** %33
%35 = load i8**, i8*** %7
%36 = load i8*, i8** %35
%37 = call i32 @strcmp(i8* %34, i8* %36)
%38 = icmp ne i32 %37, -938344448
br i1 %38, label %39, label %45
39: ; preds = %32
%40 = load i8**, i8*** %6
%41 = load i8*, i8** %40
%42 = load i8**, i8*** %7
%43 = load i8*, i8** %42
%44 = call i32 @strcmp(i8* %41, i8* %43)
br label %64
45: ; preds = %32, %25
%46 = load i8**, i8*** %6
%47 = load i8*, i8** %46
%48 = load i8**, i8*** %7
%49 = load i8*, i8** %48
%50 = call i32 @strcmp(i8* %47, i8* %49)
%51 = icmp sle i32 %50, 0
br i1 %51, label %52, label %61
52: ; preds = %45
%53 = load i8**, i8*** %6
%54 = load i8*, i8** %53
%55 = load i8**, i8*** %7
%56 = load i8*, i8** %55
%57 = call i32 @strcmp(i8* %54, i8* %56)
%58 = icmp slt i32 %57, 0
%59 = zext i1 %58 to i64
%60 = select i1 %58, i32 -938409984, i32 0
br label %62
61: ; preds = %45
br label %62
62: ; preds = %61, %52
%63 = phi i32 [ %60, %52 ], [ 938409984, %61 ]
br label %64
64: ; preds = %62, %39
%65 = phi i32 [ %44, %39 ], [ %63, %62 ]
store i32 %65, i32* %4
br label %66
66: ; preds = %64, %23, %13
%67 = load i32, i32* %4
ret i32 %67
}

LLVM IR (-O2):
define i32 @compare_strzr(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 %25
9: ; preds = %3
%10 = load i8*, i8** %1
%11 = icmp eq i8* %10, null
br i1 %11, label %15, label %12
12: ; preds = %9
%13 = load i8*, i8** %2
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %17
15: ; preds = %12, %9
%16 = tail call i32 (...) @ordering_err_2()
br label %25
17: ; preds = %12
%18 = tail call i32 @strcmp(i8* %10, i8* %13)
switch i32 %18, label %25 [
i32 -938278912, label %19
i32 -938344448, label %19
]
19: ; preds = %17, %17
%20 = tail call i32 @strcmp(i8* dereferenceable(1) %10, i8* dereferenceable(1) %13)
%21 = icmp slt i32 %20, 1
br i1 %21, label %22, label %25
22: ; preds = %19
%23 = icmp eq i32 %20, 0
%24 = select i1 %23, i32 0, i32 -938409984
br label %25
25: ; preds = %19, %22, %17, %15, %7
%26 = phi i32 [ %16, %15 ], [ %8, %7 ], [ %24, %22 ], [ 938409984, %19 ], [ %18, %17 ]
ret i32 %26
}