#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 rbt_compare_data(int, char *, int, char *);
void test_suite() {
  assert(rbt_compare_data(3, "abc", 3, "bcd") == -1);
  assert(rbt_compare_data(3, "abc", 2, "ab") == 1);
  assert(rbt_compare_data(2, "ab", 3, "abc") == -1);
  assert(rbt_compare_data(2, "ab", 2, "ab") == 0);
  assert(rbt_compare_data(4, "123\x7f", 4, "123\x80") == -1);
  assert(rbt_compare_data(4, "123\x80", 4, "123\x7f") == 1);
  assert(rbt_compare_data(1, "J", 1, "7") == 1);
  assert(rbt_compare_data(1, "7", 1, "J") == -1);
}


x86 assembly (clang, -O0):
<test_suite>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edx
lea    0xed0(%rip),%rsi
lea    0xecd(%rip),%rcx
mov    %edx,%edi
call   1030 <rbt_compare_data@plt>
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x3,%edi
lea    0xea6(%rip),%rsi
mov    $0x2,%edx
lea    0xea2(%rip),%rcx
call   1030 <rbt_compare_data@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x2,%edi
lea    0xe81(%rip),%rsi
mov    $0x3,%edx
lea    0xe6d(%rip),%rcx
call   1030 <rbt_compare_data@plt>
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x2,%edx
lea    0xe54(%rip),%rcx
mov    %edx,%edi
mov    %rcx,%rsi
call   1030 <rbt_compare_data@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x4,%edx
lea    0xe31(%rip),%rsi
lea    0xe2f(%rip),%rcx
mov    %edx,%edi
call   1030 <rbt_compare_data@plt>
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x4,%edx
lea    0xe0c(%rip),%rsi
lea    0xe00(%rip),%rcx
mov    %edx,%edi
call   1030 <rbt_compare_data@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x1,%edx
lea    0xde7(%rip),%rsi
lea    0xde2(%rip),%rcx
mov    %edx,%edi
call   1030 <rbt_compare_data@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x1,%edx
lea    0xdbf(%rip),%rsi
lea    0xdb6(%rip),%rcx
mov    %edx,%edi
call   1030 <rbt_compare_data@plt>
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_suite>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%r14
lea    0xed2(%rip),%rcx
mov    $0x3,%edi
mov    %r14,%rsi
mov    $0x3,%edx
call   1030 <rbt_compare_data@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
call   1040 <assert@plt>
lea    0xeaf(%rip),%rbx
mov    $0x3,%edi
mov    %r14,%rsi
mov    $0x2,%edx
mov    %rbx,%rcx
call   1030 <rbt_compare_data@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    $0x3,%edx
mov    %r14,%rcx
call   1030 <rbt_compare_data@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    $0x2,%edx
mov    %rbx,%rcx
call   1030 <rbt_compare_data@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
lea    0xe43(%rip),%r14
lea    0xe41(%rip),%rbx
mov    $0x4,%edi
mov    %r14,%rsi
mov    $0x4,%edx
mov    %rbx,%rcx
call   1030 <rbt_compare_data@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0x4,%edi
mov    %rbx,%rsi
mov    $0x4,%edx
mov    %r14,%rcx
call   1030 <rbt_compare_data@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1040 <assert@plt>
lea    0xdf9(%rip),%r14
lea    0xdf4(%rip),%rbx
mov    $0x1,%edi
mov    %r14,%rsi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <rbt_compare_data@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
mov    %r14,%rcx
call   1030 <rbt_compare_data@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <assert@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"abc\00"
@.str.1 = [4 x i8] c"bcd\00"
@.str.2 = [3 x i8] c"ab\00"
@.str.3 = [5 x i8] c"123\7F\00"
@.str.4 = [5 x i8] c"123\80\00"
@.str.5 = [2 x i8] c"J\00"
@.str.6 = [2 x i8] c"7\00"
define void @test_suite() {
%1 = call i32 @rbt_compare_data(i32 3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32 %1, -1
%3 = zext i1 %2 to i32
%4 = call i32 @assert(i32 %3)
%5 = call i32 @rbt_compare_data(i32 3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = call i32 @rbt_compare_data(i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i32 %9, -1
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = call i32 @rbt_compare_data(i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%14 = icmp eq i32 %13, 0
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = call i32 @rbt_compare_data(i32 4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%18 = icmp eq i32 %17, -1
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
%21 = call i32 @rbt_compare_data(i32 4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%22 = icmp eq i32 %21, 1
%23 = zext i1 %22 to i32
%24 = call i32 @assert(i32 %23)
%25 = call i32 @rbt_compare_data(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%26 = icmp eq i32 %25, 1
%27 = zext i1 %26 to i32
%28 = call i32 @assert(i32 %27)
%29 = call i32 @rbt_compare_data(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%30 = icmp eq i32 %29, -1
%31 = zext i1 %30 to i32
%32 = call i32 @assert(i32 %31)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"abc\00"
@.str.1 = [4 x i8] c"bcd\00"
@.str.2 = [3 x i8] c"ab\00"
@.str.3 = [5 x i8] c"123\7F\00"
@.str.4 = [5 x i8] c"123\80\00"
@.str.5 = [2 x i8] c"J\00"
@.str.6 = [2 x i8] c"7\00"
define void @test_suite() {
%1 = tail call i32 @rbt_compare_data(i32 3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32 %1, -1
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @rbt_compare_data(i32 3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @rbt_compare_data(i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i32 %9, -1
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
%13 = tail call i32 @rbt_compare_data(i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%14 = icmp eq i32 %13, 0
%15 = zext i1 %14 to i32
%16 = tail call i32 @assert(i32 %15)
%17 = tail call i32 @rbt_compare_data(i32 4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%18 = icmp eq i32 %17, -1
%19 = zext i1 %18 to i32
%20 = tail call i32 @assert(i32 %19)
%21 = tail call i32 @rbt_compare_data(i32 4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%22 = icmp eq i32 %21, 1
%23 = zext i1 %22 to i32
%24 = tail call i32 @assert(i32 %23)
%25 = tail call i32 @rbt_compare_data(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%26 = icmp eq i32 %25, 1
%27 = zext i1 %26 to i32
%28 = tail call i32 @assert(i32 %27)
%29 = tail call i32 @rbt_compare_data(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%30 = icmp eq i32 %29, -1
%31 = zext i1 %30 to i32
%32 = tail call i32 @assert(i32 %31)
ret void
}