#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 */
bool rDictionarySmaller(char *str1, char *str2) {
  if (*str1 == '\0') {
    return false;
  } else if (*str1 == '\0') {
    return true;
  }
  if (*str2 < *str1) {
    return true;
  } else if (*str2 > *str1) {
    return false;
  } else {
    return rDictionarySmaller(str1 + 1, str2 + 1);
  }
}


x86 assembly (clang, -O0):
<rDictionarySmaller>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113c <rDictionarySmaller+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    11b9 <rDictionarySmaller+0xa9>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1158 <rDictionarySmaller+0x48>
movl   $0x1,-0x4(%rbp)
jmp    11b9 <rDictionarySmaller+0xa9>
jmp    115d <rDictionarySmaller+0x4d>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jge    117f <rDictionarySmaller+0x6f>
movl   $0x1,-0x4(%rbp)
jmp    11b9 <rDictionarySmaller+0xa9>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jle    11a1 <rDictionarySmaller+0x91>
movl   $0x0,-0x4(%rbp)
jmp    11b9 <rDictionarySmaller+0xa9>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    -0x18(%rbp),%rsi
add    $0x1,%rsi
call   1030 <rDictionarySmaller@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rDictionarySmaller>:
mov    (%rdi),%r8b
test   %r8b,%r8b
je     112e <rDictionarySmaller+0x2e>
xor    %edx,%edx
xor    %eax,%eax
nopl   0x0(%rax)
movzbl (%rsi,%rdx,1),%ecx
cmp    %r8b,%cl
jl     1131 <rDictionarySmaller+0x31>
cmp    %r8b,%cl
jg     112d <rDictionarySmaller+0x2d>
movzbl 0x1(%rdi,%rdx,1),%r8d
add    $0x1,%rdx
test   %r8b,%r8b
jne    1110 <rDictionarySmaller+0x10>
ret
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @rDictionarySmaller(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 0, i32* %3
br label %42
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %11
store i32 1, i32* %3
br label %42
17: ; preds = %11
br label %18
18: ; preds = %17
%19 = load i8*, i8** %5
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = load i8*, i8** %4
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp slt i32 %21, %24
br i1 %25, label %26, label %27
26: ; preds = %18
store i32 1, i32* %3
br label %42
27: ; preds = %18
%28 = load i8*, i8** %5
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = load i8*, i8** %4
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = icmp sgt i32 %30, %33
br i1 %34, label %35, label %36
35: ; preds = %27
store i32 0, i32* %3
br label %42
36: ; preds = %27
%37 = load i8*, i8** %4
%38 = getelementptr inbounds i8, i8* %37, i64 1
%39 = load i8*, i8** %5
%40 = getelementptr inbounds i8, i8* %39, i64 1
%41 = call i32 @rDictionarySmaller(i8* %38, i8* %40)
store i32 %41, i32* %3
br label %42
42: ; preds = %36, %35, %26, %16, %10
%43 = load i32, i32* %3
ret i32 %43
}

LLVM IR (-O2):
define i32 @rDictionarySmaller(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %18, label %5
5: ; preds = %2, %13
%6 = phi i8 [ %16, %13 ], [ %3, %2 ]
%7 = phi i8* [ %15, %13 ], [ %1, %2 ]
%8 = phi i8* [ %14, %13 ], [ %0, %2 ]
%9 = load i8, i8* %7
%10 = icmp slt i8 %9, %6
br i1 %10, label %18, label %11
11: ; preds = %5
%12 = icmp sgt i8 %9, %6
br i1 %12, label %18, label %13
13: ; preds = %11
%14 = getelementptr inbounds i8, i8* %8, i64 1
%15 = getelementptr inbounds i8, i8* %7, i64 1
%16 = load i8, i8* %14
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %5
18: ; preds = %13, %5, %11, %2
%19 = phi i32 [ 0, %2 ], [ 0, %11 ], [ 1, %5 ], [ 0, %13 ]
ret i32 %19
}