#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*/ stringCompare(char *, char *);
int /*<<< orphan*/ test(int /*<<< orphan*/, int);
void testStringCompare(void) {
  test(stringCompare("cat", "cat"), 0);
  test(stringCompare("cat", "dog"), -1);
  test(stringCompare("dog", "cat"), +1);
  test(stringCompare("", "xxx"), -1);
  test(stringCompare("xxx", ""), +1);
}


x86 assembly (clang, -O0):
<testStringCompare>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rsi
mov    %rsi,%rdi
call   1030 <stringCompare@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1040 <test@plt>
lea    0xebd(%rip),%rdi
lea    0xeba(%rip),%rsi
call   1030 <stringCompare@plt>
mov    %eax,%edi
mov    $0xffffffff,%esi
call   1040 <test@plt>
lea    0xea2(%rip),%rdi
lea    0xe97(%rip),%rsi
call   1030 <stringCompare@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1040 <test@plt>
lea    0xe86(%rip),%rdi
lea    0xe80(%rip),%rsi
call   1030 <stringCompare@plt>
mov    %eax,%edi
mov    $0xffffffff,%esi
call   1040 <test@plt>
lea    0xe68(%rip),%rdi
lea    0xe60(%rip),%rsi
call   1030 <stringCompare@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1040 <test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testStringCompare>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rbx
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1030 <stringCompare@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1040 <test@plt>
lea    0xebe(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <stringCompare@plt>
mov    %eax,%edi
mov    $0xffffffff,%esi
call   1040 <test@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <stringCompare@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1040 <test@plt>
lea    0xe8c(%rip),%r14
lea    0xe86(%rip),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <stringCompare@plt>
mov    %eax,%edi
mov    $0xffffffff,%esi
call   1040 <test@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <stringCompare@plt>
mov    %eax,%edi
mov    $0x1,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <test@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"cat\00"
@.str.1 = [4 x i8] c"dog\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [4 x i8] c"xxx\00"
define void @testStringCompare() {
%1 = call i32 @stringCompare(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @test(i32 %1, i32 0)
%3 = call i32 @stringCompare(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))
%4 = call i32 @test(i32 %3, i32 -1)
%5 = call i32 @stringCompare(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, i64 0, i64 0))
%6 = call i32 @test(i32 %5, i32 1)
%7 = call i32 @stringCompare(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 @test(i32 %7, i32 -1)
%9 = call i32 @stringCompare(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @test(i32 %9, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"cat\00"
@.str.1 = [4 x i8] c"dog\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [4 x i8] c"xxx\00"
define void @testStringCompare() {
%1 = tail call i32 @stringCompare(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @test(i32 %1, i32 0)
%3 = tail call i32 @stringCompare(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))
%4 = tail call i32 @test(i32 %3, i32 -1)
%5 = tail call i32 @stringCompare(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, i64 0, i64 0))
%6 = tail call i32 @test(i32 %5, i32 1)
%7 = tail call i32 @stringCompare(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%8 = tail call i32 @test(i32 %7, i32 -1)
%9 = tail call i32 @stringCompare(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%10 = tail call i32 @test(i32 %9, i32 1)
ret void
}