#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*/ compare(char *, char *);
int /*<<< orphan*/ compare_case(char *, char *);
int /*<<< orphan*/ printf(char *, char *, char *);
int main(void) {
  char str1[] = "HELLO";
  char str2[] = "hello";
  compare(str1, str2);
  printf("after compare, str1 = %s, str2 = %s \n", str1, str2);
  compare_case(str1, str2);
  printf("after compare_case, str1 = %s, str2 = %s \n", str1, str2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xebb(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xeb5(%rip),%ax
mov    %ax,-0x6(%rbp)
mov    0xead(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xea7(%rip),%ax
mov    %ax,-0xc(%rbp)
lea    -0xa(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <compare@plt>
lea    -0xa(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
lea    -0xa(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <compare_case@plt>
lea    -0xa(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movw   $0x4f,0x14(%rsp)
movl   $0x4c4c4548,0x10(%rsp)
4c
movw   $0x6f,0xc(%rsp)
movl   $0x6c6c6568,0x8(%rsp)
6c
lea    0x10(%rsp),%rbx
lea    0x8(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <compare@plt>
lea    0xe9b(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <compare_case@plt>
lea    0xea4(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.str1 = [6 x i8] c"HELLO\00"
@__const.main.str2 = [6 x i8] c"hello\00"
@.str = [38 x i8] c"after compare, str1 = %s, str2 = %s \0A\00"
@.str.1 = [43 x i8] c"after compare_case, str1 = %s, str2 = %s \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
%3 = alloca [6 x i8]
store i32 0, i32* %1
%4 = bitcast [6 x i8]* %2 to i8*
%5 = bitcast [6 x i8]* %3 to i8*
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%8 = call i32 @compare(i8* %6, i8* %7)
%9 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%10 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10)
%12 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%13 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%14 = call i32 @compare_case(i8* %12, i8* %13)
%15 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%16 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%17 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i8* %15, i8* %16)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str1 = [6 x i8] c"HELLO\00"
@__const.main.str2 = [6 x i8] c"hello\00"
@.str = [38 x i8] c"after compare, str1 = %s, str2 = %s \0A\00"
@.str.1 = [43 x i8] c"after compare_case, str1 = %s, str2 = %s \0A\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = alloca [6 x i8]
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%5 = call i32 @compare(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
%7 = call i32 @compare_case(i8* %3, i8* %4)
%8 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i8* %3, i8* %4)
ret i32 0
}