#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*/ Str_ToUpper(char *, char *);
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(scalar_t__);
int strcmp(int /*<<< orphan*/, int /*<<< orphan*/);
scalar_t__ strlen(char *);
int Str_CompareI(char *t, char *s) {
  char *t1 = (char *)malloc(strlen(t) + 1);
  char *s1 = (char *)malloc(strlen(s) + 1);
  int r = strcmp(Str_ToUpper(t, t1), Str_ToUpper(s, s1));
  free(t1);
  free(s1);
  return r;
}


x86 assembly (clang, -O0):
<Str_CompareI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1060 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1070 <Str_ToUpper@plt>
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1070 <Str_ToUpper@plt>
mov    -0x28(%rbp),%edi
mov    %eax,%esi
call   1050 <strcmp@plt>
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Str_CompareI>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1060 <malloc@plt>
mov    %rax,%r14
mov    %r15,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1060 <malloc@plt>
mov    %rax,%r12
mov    %rbx,%rdi
mov    %r14,%rsi
call   1070 <Str_ToUpper@plt>
mov    %eax,%ebx
mov    %r15,%rdi
mov    %r12,%rsi
call   1070 <Str_ToUpper@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1050 <strcmp@plt>
mov    %eax,%ebx
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @Str_CompareI(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %3
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %9, 1
%11 = call i64 @malloc(i64 %10)
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %5
%13 = load i8*, i8** %4
%14 = call i64 @strlen(i8* %13)
%15 = add nsw i64 %14, 1
%16 = call i64 @malloc(i64 %15)
%17 = inttoptr i64 %16 to i8*
store i8* %17, i8** %6
%18 = load i8*, i8** %3
%19 = load i8*, i8** %5
%20 = call i32 @Str_ToUpper(i8* %18, i8* %19)
%21 = load i8*, i8** %4
%22 = load i8*, i8** %6
%23 = call i32 @Str_ToUpper(i8* %21, i8* %22)
%24 = call i32 @strcmp(i32 %20, i32 %23)
store i32 %24, i32* %7
%25 = load i8*, i8** %5
%26 = call i32 @free(i8* %25)
%27 = load i8*, i8** %6
%28 = call i32 @free(i8* %27)
%29 = load i32, i32* %7
ret i32 %29
}

LLVM IR (-O2):
define i32 @Str_CompareI(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = add nsw i64 %3, 1
%5 = tail call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
%7 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%8 = add nsw i64 %7, 1
%9 = tail call i64 @malloc(i64 %8)
%10 = inttoptr i64 %9 to i8*
%11 = tail call i32 @Str_ToUpper(i8* %0, i8* %6)
%12 = tail call i32 @Str_ToUpper(i8* %1, i8* %10)
%13 = tail call i32 @strcmp(i32 %11, i32 %12)
%14 = tail call i32 @free(i8* %6)
%15 = tail call i32 @free(i8* %10)
ret i32 %13
}