#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*/ assert(int);
int dircmp(char *, char *);
scalar_t__ dircmpi(char *, char *);
int numcmp(char *, char *);
int strcmpi(char *, char *);
int main(int argc, char *argv[]) {
  assert(numcmp("abc", "9ab") == -1);
  assert(numcmp("9ab", "10c") == -1);
  assert(numcmp("10c", "10d") == 0);
  assert(strcmpi("abc", "ABC") == 0);
  assert(strcmpi("ab", "A") == 1);
  assert(strcmpi("AB", "c") == -1);
  char s1[] = {'\t', 'a', ' ', '\0'};
  char s2[] = {'a', ' ', '\t', '\0'};
  char s3[] = {'A', '\t', ' ', '\0'};
  assert(dircmp(s1, s2) == 0);
  assert(dircmp(s3, s2) == -1);
  assert(dircmp(s1, s3) == 1);
  assert(dircmpi(s1, s3) == 0);
  assert(dircmpi(s2, s3) == 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe9a(%rip),%rdi
lea    0xe97(%rip),%rsi
call   1070 <numcmp@plt>
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    0xe7b(%rip),%rdi
lea    0xe78(%rip),%rsi
call   1070 <numcmp@plt>
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    0xe5c(%rip),%rdi
lea    0xe59(%rip),%rsi
call   1070 <numcmp@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    0xe31(%rip),%rdi
lea    0xe3a(%rip),%rsi
call   1050 <strcmpi@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    0xe13(%rip),%rdi
lea    0xe1b(%rip),%rsi
call   1050 <strcmpi@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    0xe01(%rip),%rdi
lea    0xdee(%rip),%rsi
call   1050 <strcmpi@plt>
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    0xde2(%rip),%eax
mov    %eax,-0x14(%rbp)
mov    0xddd(%rip),%eax
mov    %eax,-0x18(%rbp)
mov    0xdd8(%rip),%eax
mov    %eax,-0x1c(%rbp)
lea    -0x14(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <dircmp@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    -0x1c(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <dircmp@plt>
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    -0x14(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
call   1040 <dircmp@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    -0x14(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
call   1030 <dircmpi@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    -0x18(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
call   1030 <dircmpi@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xea0(%rip),%r14
lea    0xe9d(%rip),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1070 <numcmp@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
call   1060 <assert@plt>
lea    0xe81(%rip),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1070 <numcmp@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
call   1060 <assert@plt>
lea    0xe65(%rip),%rsi
mov    %r15,%rdi
call   1070 <numcmp@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1060 <assert@plt>
lea    0xe4d(%rip),%rsi
mov    %r14,%rdi
call   1050 <strcmpi@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1060 <assert@plt>
lea    0xe26(%rip),%rdi
lea    0xe2e(%rip),%rsi
call   1050 <strcmpi@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1060 <assert@plt>
lea    0xe16(%rip),%rdi
lea    0xe03(%rip),%rsi
call   1050 <strcmpi@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
call   1060 <assert@plt>
movl   $0x206109,0xc(%rsp)
movl   $0x92061,0x8(%rsp)
movl   $0x200941,0x4(%rsp)
lea    0xc(%rsp),%r15
lea    0x8(%rsp),%r14
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <dircmp@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1060 <assert@plt>
lea    0x4(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <dircmp@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
call   1060 <assert@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <dircmp@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1060 <assert@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <dircmpi@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1060 <assert@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <dircmpi@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1060 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"abc\00"
@.str.1 = [4 x i8] c"9ab\00"
@.str.2 = [4 x i8] c"10c\00"
@.str.3 = [4 x i8] c"10d\00"
@.str.4 = [4 x i8] c"ABC\00"
@.str.5 = [3 x i8] c"ab\00"
@.str.6 = [2 x i8] c"A\00"
@.str.7 = [3 x i8] c"AB\00"
@.str.8 = [2 x i8] c"c\00"
@__const.main.s1 = [4 x i8] c"\09a \00"
@__const.main.s2 = [4 x i8] c"a \09\00"
@__const.main.s3 = [4 x i8] c"A\09 \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [4 x i8]
%6 = alloca [4 x i8]
%7 = alloca [4 x i8]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%8 = call i32 @numcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i32 %8, -1
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = call i32 @numcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%13 = icmp eq i32 %12, -1
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = call i32 @numcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%17 = icmp eq i32 %16, 0
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
%20 = call i32 @strcmpi(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%21 = icmp eq i32 %20, 0
%22 = zext i1 %21 to i32
%23 = call i32 @assert(i32 %22)
%24 = call i32 @strcmpi(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%25 = icmp eq i32 %24, 1
%26 = zext i1 %25 to i32
%27 = call i32 @assert(i32 %26)
%28 = call i32 @strcmpi(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%29 = icmp eq i32 %28, -1
%30 = zext i1 %29 to i32
%31 = call i32 @assert(i32 %30)
%32 = bitcast [4 x i8]* %5 to i8*
%33 = bitcast [4 x i8]* %6 to i8*
%34 = bitcast [4 x i8]* %7 to i8*
%35 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%36 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%37 = call i32 @dircmp(i8* %35, i8* %36)
%38 = icmp eq i32 %37, 0
%39 = zext i1 %38 to i32
%40 = call i32 @assert(i32 %39)
%41 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 0
%42 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%43 = call i32 @dircmp(i8* %41, i8* %42)
%44 = icmp eq i32 %43, -1
%45 = zext i1 %44 to i32
%46 = call i32 @assert(i32 %45)
%47 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%48 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 0
%49 = call i32 @dircmp(i8* %47, i8* %48)
%50 = icmp eq i32 %49, 1
%51 = zext i1 %50 to i32
%52 = call i32 @assert(i32 %51)
%53 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%54 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 0
%55 = call i64 @dircmpi(i8* %53, i8* %54)
%56 = icmp eq i64 %55, 0
%57 = zext i1 %56 to i32
%58 = call i32 @assert(i32 %57)
%59 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%60 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 0
%61 = call i64 @dircmpi(i8* %59, i8* %60)
%62 = icmp eq i64 %61, 0
%63 = zext i1 %62 to i32
%64 = call i32 @assert(i32 %63)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"abc\00"
@.str.1 = [4 x i8] c"9ab\00"
@.str.2 = [4 x i8] c"10c\00"
@.str.3 = [4 x i8] c"10d\00"
@.str.4 = [4 x i8] c"ABC\00"
@.str.5 = [3 x i8] c"ab\00"
@.str.6 = [2 x i8] c"A\00"
@.str.7 = [3 x i8] c"AB\00"
@.str.8 = [2 x i8] c"c\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = tail call i32 @numcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i32 %6, -1
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = tail call i32 @numcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%11 = icmp eq i32 %10, -1
%12 = zext i1 %11 to i32
%13 = tail call i32 @assert(i32 %12)
%14 = tail call i32 @numcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%15 = icmp eq i32 %14, 0
%16 = zext i1 %15 to i32
%17 = tail call i32 @assert(i32 %16)
%18 = tail call i32 @strcmpi(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%19 = icmp eq i32 %18, 0
%20 = zext i1 %19 to i32
%21 = tail call i32 @assert(i32 %20)
%22 = tail call i32 @strcmpi(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%23 = icmp eq i32 %22, 1
%24 = zext i1 %23 to i32
%25 = tail call i32 @assert(i32 %24)
%26 = tail call i32 @strcmpi(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%27 = icmp eq i32 %26, -1
%28 = zext i1 %27 to i32
%29 = tail call i32 @assert(i32 %28)
%30 = bitcast i32* %3 to i8*
store i32 2121993, i32* %3
%31 = bitcast i32* %4 to i8*
store i32 598113, i32* %4
%32 = bitcast i32* %5 to i8*
store i32 2099521, i32* %5
%33 = call i32 @dircmp(i8* %30, i8* %31)
%34 = icmp eq i32 %33, 0
%35 = zext i1 %34 to i32
%36 = call i32 @assert(i32 %35)
%37 = call i32 @dircmp(i8* %32, i8* %31)
%38 = icmp eq i32 %37, -1
%39 = zext i1 %38 to i32
%40 = call i32 @assert(i32 %39)
%41 = call i32 @dircmp(i8* %30, i8* %32)
%42 = icmp eq i32 %41, 1
%43 = zext i1 %42 to i32
%44 = call i32 @assert(i32 %43)
%45 = call i64 @dircmpi(i8* %30, i8* %32)
%46 = icmp eq i64 %45, 0
%47 = zext i1 %46 to i32
%48 = call i32 @assert(i32 %47)
%49 = call i64 @dircmpi(i8* %31, i8* %32)
%50 = icmp eq i64 %49, 0
%51 = zext i1 %50 to i32
%52 = call i32 @assert(i32 %51)
ret i32 0
}