#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 strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ ucase(char *);
int strUncmp(char *s1, char *s2, int len) {
  char zwi1[32768];
  char zwi2[32768];
  strcpy(zwi1, s1);
  strcpy(zwi2, s2);
  ucase(zwi1);
  ucase(zwi2);
  zwi1[len] = 0;
  zwi2[len] = 0;
  return (strcmp(zwi1, zwi2));
}


x86 assembly (clang, -O0):
<strUncmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10020,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    -0x8020(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x10020(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x8020(%rbp),%rdi
call   1050 <ucase@plt>
lea    -0x10020(%rbp),%rdi
call   1050 <ucase@plt>
movslq -0x14(%rbp),%rax
movb   $0x0,-0x8020(%rbp,%rax,1)
movslq -0x14(%rbp),%rax
movb   $0x0,-0x10020(%rbp,%rax,1)
lea    -0x8020(%rbp),%rdi
lea    -0x10020(%rbp),%rsi
call   1040 <strcmp@plt>
add    $0x10020,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strUncmp>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x10008,%rsp
mov    %edx,%r15d
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0x8000(%rsp),%r14
mov    %r14,%rdi
call   1030 <strcpy@plt>
mov    %rsp,%rbp
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %r14,%rdi
call   1050 <ucase@plt>
mov    %rbp,%rdi
call   1050 <ucase@plt>
movslq %r15d,%rax
movb   $0x0,0x8000(%rsp,%rax,1)
movb   $0x0,(%rsp,%rax,1)
mov    %r14,%rdi
mov    %rbp,%rsi
call   1040 <strcmp@plt>
add    $0x10008,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @strUncmp(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca [32768 x i8]
%8 = alloca [32768 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%9 = getelementptr inbounds [32768 x i8], [32768 x i8]* %7, i64 0, i64 0
%10 = load i8*, i8** %4
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = getelementptr inbounds [32768 x i8], [32768 x i8]* %8, i64 0, i64 0
%13 = load i8*, i8** %5
%14 = call i32 @strcpy(i8* %12, i8* %13)
%15 = getelementptr inbounds [32768 x i8], [32768 x i8]* %7, i64 0, i64 0
%16 = call i32 @ucase(i8* %15)
%17 = getelementptr inbounds [32768 x i8], [32768 x i8]* %8, i64 0, i64 0
%18 = call i32 @ucase(i8* %17)
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [32768 x i8], [32768 x i8]* %7, i64 0, i64 %20
store i8 0, i8* %21
%22 = load i32, i32* %6
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [32768 x i8], [32768 x i8]* %8, i64 0, i64 %23
store i8 0, i8* %24
%25 = getelementptr inbounds [32768 x i8], [32768 x i8]* %7, i64 0, i64 0
%26 = getelementptr inbounds [32768 x i8], [32768 x i8]* %8, i64 0, i64 0
%27 = call i32 @strcmp(i8* %25, i8* %26)
ret i32 %27
}

LLVM IR (-O2):
define i32 @strUncmp(i8* %0, i8* %1, i32 %2) {
%4 = alloca [32768 x i8]
%5 = alloca [32768 x i8]
%6 = getelementptr inbounds [32768 x i8], [32768 x i8]* %4, i64 0, i64 0
%7 = getelementptr inbounds [32768 x i8], [32768 x i8]* %5, i64 0, i64 0
%8 = call i32 @strcpy(i8* %6, i8* %0)
%9 = call i32 @strcpy(i8* %7, i8* %1)
%10 = call i32 @ucase(i8* %6)
%11 = call i32 @ucase(i8* %7)
%12 = sext i32 %2 to i64
%13 = getelementptr inbounds [32768 x i8], [32768 x i8]* %4, i64 0, i64 %12
store i8 0, i8* %13
%14 = getelementptr inbounds [32768 x i8], [32768 x i8]* %5, i64 0, i64 %12
store i8 0, i8* %14
%15 = call i32 @strcmp(i8* %6, i8* %7)
ret i32 %15
}