#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*/ printf(char *, ...);
int strcasecmp(char *, char *);
int /*<<< orphan*/ strlower(char *);
int /*<<< orphan*/ strupper(char *);
void __test_strcase(void) {
  char s1[] = "HeLlo WoRld! -Th1s 73sT#";
  char s2[] = "HeLlo WoRld! -Th1s 73sT#";
  strupper(s1);
  strlower(s2);
  printf("S1 %s\n", s1);
  printf("S2 %s\n", s2);
  printf("CASE CMP: %d\n", strcasecmp(s1, s2));
}


x86 assembly (clang, -O0):
<__test_strcase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0xeb1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeae(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeab(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xea9(%rip),%al
mov    %al,-0x8(%rbp)
mov    0xe87(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xe84(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xe81(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe7f(%rip),%al
mov    %al,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
call   1050 <strupper@plt>
lea    -0x40(%rbp),%rdi
call   1060 <strlower@plt>
lea    -0x20(%rbp),%rsi
lea    0xe60(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x40(%rbp),%rsi
lea    0xe55(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1030 <strcasecmp@plt>
mov    %eax,%esi
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__test_strcase>:
push   %r14
push   %rbx
sub    $0x48,%rsp
movups 0xebb(%rip),%xmm0
movups %xmm0,0x29(%rsp)
movaps 0xea6(%rip),%xmm1
movaps %xmm1,0x20(%rsp)
movups %xmm0,0x9(%rsp)
movaps %xmm1,(%rsp)
lea    0x20(%rsp),%r14
mov    %r14,%rdi
call   1050 <strupper@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1060 <strlower@plt>
lea    0xe92(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe88(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strcasecmp@plt>
lea    0xe73(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.__test_strcase.s1 = [25 x i8] c"HeLlo WoRld! -Th1s 73sT#\00"
@__const.__test_strcase.s2 = [25 x i8] c"HeLlo WoRld! -Th1s 73sT#\00"
@.str = [7 x i8] c"S1 %s\0A\00"
@.str.1 = [7 x i8] c"S2 %s\0A\00"
@.str.2 = [14 x i8] c"CASE CMP: %d\0A\00"
define void @__test_strcase() {
%1 = alloca [25 x i8]
%2 = alloca [25 x i8]
%3 = bitcast [25 x i8]* %1 to i8*
%4 = bitcast [25 x i8]* %2 to i8*
%5 = getelementptr inbounds [25 x i8], [25 x i8]* %1, i64 0, i64 0
%6 = call i32 @strupper(i8* %5)
%7 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 0
%8 = call i32 @strlower(i8* %7)
%9 = getelementptr inbounds [25 x i8], [25 x i8]* %1, i64 0, i64 0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 0
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = getelementptr inbounds [25 x i8], [25 x i8]* %1, i64 0, i64 0
%14 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 0
%15 = call i32 @strcasecmp(i8* %13, i8* %14)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %15)
ret void
}

LLVM IR (-O2):
@__const.__test_strcase.s2 = [25 x i8] c"HeLlo WoRld! -Th1s 73sT#\00"
@.str = [7 x i8] c"S1 %s\0A\00"
@.str.1 = [7 x i8] c"S2 %s\0A\00"
@.str.2 = [14 x i8] c"CASE CMP: %d\0A\00"
define void @__test_strcase() {
%1 = alloca [25 x i8]
%2 = alloca [25 x i8]
%3 = getelementptr inbounds [25 x i8], [25 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 0
%5 = call i32 @strupper(i8* %3)
%6 = call i32 @strlower(i8* %4)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %3)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%9 = call i32 @strcasecmp(i8* %3, i8* %4)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret void
}