#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);
scalar_t__ string_nocase_equal(char *, char *);
void test_string_nocase_equal(void) {
  char test1[] = "this is a test string";
  char test2[] = "this is a test string ";
  char test3[] = "this is a test strin";
  char test4[] = "this is a test strinG";
  char test5[] = "this is a test string";
  assert(string_nocase_equal(test1, test5) != 0);
  assert(string_nocase_equal(test1, test2) == 0);
  assert(string_nocase_equal(test1, test3) == 0);
  assert(string_nocase_equal(test1, test4) != 0);
}


x86 assembly (clang, -O0):
<test_string_nocase_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    0xece(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec9(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xec3(%rip),%ax
mov    %ax,-0xc(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xebf(%rip),%eax
mov    %eax,-0x30(%rbp)
mov    0xeb9(%rip),%ax
mov    %ax,-0x2c(%rbp)
mov    0xeb1(%rip),%al
mov    %al,-0x2a(%rbp)
mov    0xeb1(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xeae(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xeac(%rip),%eax
mov    %eax,-0x50(%rbp)
mov    0xea7(%rip),%al
mov    %al,-0x4c(%rbp)
mov    0xea9(%rip),%rax
mov    %rax,-0x80(%rbp)
mov    0xea6(%rip),%rax
mov    %rax,-0x78(%rbp)
mov    0xea4(%rip),%eax
mov    %eax,-0x70(%rbp)
mov    0xe9e(%rip),%ax
mov    %ax,-0x6c(%rbp)
mov    0xe1f(%rip),%rax
mov    %rax,-0xa0(%rbp)
mov    0xe19(%rip),%rax
mov    %rax,-0x98(%rbp)
mov    0xe14(%rip),%eax
mov    %eax,-0x90(%rbp)
mov    0xe0b(%rip),%ax
mov    %ax,-0x8c(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0xa0(%rbp),%rsi
call   1030 <string_nocase_equal@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1030 <string_nocase_equal@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x20(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1030 <string_nocase_equal@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x20(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1030 <string_nocase_equal@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_string_nocase_equal>:
push   %rbx
sub    $0xa0,%rsp
movaps 0xf31(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movabs $0x676e6972747320,%rax
mov    %rax,0x6e(%rsp)
movaps 0xeb6(%rip),%xmm1
movaps %xmm1,0x80(%rsp)
movabs $0x20676e69727473,%rcx
mov    %rcx,0x8f(%rsp)
movaps 0xeb5(%rip),%xmm1
movaps %xmm1,(%rsp)
movabs $0x6e697274732074,%rcx
mov    %rcx,0xd(%rsp)
movaps 0xebb(%rip),%xmm1
movaps %xmm1,0x40(%rsp)
movabs $0x476e6972747320,%rcx
mov    %rcx,0x4e(%rsp)
mov    %rax,0x2e(%rsp)
movaps %xmm0,0x20(%rsp)
lea    0x60(%rsp),%rbx
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <string_nocase_equal@plt>
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1040 <assert@plt>
lea    0x80(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <string_nocase_equal@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1030 <string_nocase_equal@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
lea    0x40(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <string_nocase_equal@plt>
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1040 <assert@plt>
add    $0xa0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test_string_nocase_equal.test1 = [22 x i8] c"this is a test string\00"
@__const.test_string_nocase_equal.test2 = [23 x i8] c"this is a test string \00"
@__const.test_string_nocase_equal.test3 = [21 x i8] c"this is a test strin\00"
@__const.test_string_nocase_equal.test4 = [22 x i8] c"this is a test strinG\00"
@__const.test_string_nocase_equal.test5 = [22 x i8] c"this is a test string\00"
define void @test_string_nocase_equal() {
%1 = alloca [22 x i8]
%2 = alloca [23 x i8]
%3 = alloca [21 x i8]
%4 = alloca [22 x i8]
%5 = alloca [22 x i8]
%6 = bitcast [22 x i8]* %1 to i8*
%7 = bitcast [23 x i8]* %2 to i8*
%8 = bitcast [21 x i8]* %3 to i8*
%9 = bitcast [22 x i8]* %4 to i8*
%10 = bitcast [22 x i8]* %5 to i8*
%11 = getelementptr inbounds [22 x i8], [22 x i8]* %1, i64 0, i64 0
%12 = getelementptr inbounds [22 x i8], [22 x i8]* %5, i64 0, i64 0
%13 = call i64 @string_nocase_equal(i8* %11, i8* %12)
%14 = icmp ne i64 %13, 0
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = getelementptr inbounds [22 x i8], [22 x i8]* %1, i64 0, i64 0
%18 = getelementptr inbounds [23 x i8], [23 x i8]* %2, i64 0, i64 0
%19 = call i64 @string_nocase_equal(i8* %17, i8* %18)
%20 = icmp eq i64 %19, 0
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
%23 = getelementptr inbounds [22 x i8], [22 x i8]* %1, i64 0, i64 0
%24 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 0
%25 = call i64 @string_nocase_equal(i8* %23, i8* %24)
%26 = icmp eq i64 %25, 0
%27 = zext i1 %26 to i32
%28 = call i32 @assert(i32 %27)
%29 = getelementptr inbounds [22 x i8], [22 x i8]* %1, i64 0, i64 0
%30 = getelementptr inbounds [22 x i8], [22 x i8]* %4, i64 0, i64 0
%31 = call i64 @string_nocase_equal(i8* %29, i8* %30)
%32 = icmp ne i64 %31, 0
%33 = zext i1 %32 to i32
%34 = call i32 @assert(i32 %33)
ret void
}

LLVM IR (-O2):
@__const.test_string_nocase_equal.test2 = [23 x i8] c"this is a test string \00"
@__const.test_string_nocase_equal.test3 = [21 x i8] c"this is a test strin\00"
@__const.test_string_nocase_equal.test4 = [22 x i8] c"this is a test strinG\00"
@__const.test_string_nocase_equal.test5 = [22 x i8] c"this is a test string\00"
define void @test_string_nocase_equal() {
%1 = alloca [22 x i8]
%2 = alloca [23 x i8]
%3 = alloca [21 x i8]
%4 = alloca [22 x i8]
%5 = alloca [22 x i8]
%6 = getelementptr inbounds [22 x i8], [22 x i8]* %1, i64 0, i64 0
%7 = getelementptr inbounds [23 x i8], [23 x i8]* %2, i64 0, i64 0
%8 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 0
%9 = getelementptr inbounds [22 x i8], [22 x i8]* %4, i64 0, i64 0
%10 = getelementptr inbounds [22 x i8], [22 x i8]* %5, i64 0, i64 0
%11 = call i64 @string_nocase_equal(i8* %6, i8* %10)
%12 = icmp ne i64 %11, 0
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = call i64 @string_nocase_equal(i8* %6, i8* %7)
%16 = icmp eq i64 %15, 0
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = call i64 @string_nocase_equal(i8* %6, i8* %8)
%20 = icmp eq i64 %19, 0
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
%23 = call i64 @string_nocase_equal(i8* %6, i8* %9)
%24 = icmp ne i64 %23, 0
%25 = zext i1 %24 to i32
%26 = call i32 @assert(i32 %25)
ret void
}