#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 hkey(char *);
int /*<<< orphan*/ printf(char *, char *, int);
main() {
  char *a[] = {"orWld", "Hello", "World", "eHllo", "olleH"};
  char msg[] = "Hello";
  char msg2[] = "Hlelo";
  printf("%s: hkey=%d\n", msg, hkey(msg));
  printf("%s: hkey=%d\n", msg2, hkey(msg2));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
lea    0xeb1(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xeac(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xea7(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xea2(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xe9d(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xe81(%rip),%eax
mov    %eax,-0x36(%rbp)
mov    0xe7b(%rip),%ax
mov    %ax,-0x32(%rbp)
mov    0xe85(%rip),%eax
mov    %eax,-0x3c(%rbp)
mov    0xe7f(%rip),%ax
mov    %ax,-0x38(%rbp)
lea    -0x36(%rbp),%rax
mov    %rax,-0x50(%rbp)
lea    -0x36(%rbp),%rdi
call   1050 <hkey@plt>
mov    -0x50(%rbp),%rsi
mov    %eax,%edx
lea    0xe5f(%rip),%rdi
call   1030 <printf@plt>
lea    -0x3c(%rbp),%rax
mov    %rax,-0x48(%rbp)
lea    -0x3c(%rbp),%rdi
call   1050 <hkey@plt>
mov    -0x48(%rbp),%rsi
mov    %eax,%edx
lea    0xe3c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movw   $0x6f,0x14(%rsp)
movl   $0x6c6c6548,0x10(%rsp)
6c
movw   $0x6f,0xc(%rsp)
movl   $0x6c656c48,0x8(%rsp)
6c
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <hkey@plt>
lea    0xeb3(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <hkey@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"orWld\00"
@.str.1 = [6 x i8] c"Hello\00"
@.str.2 = [6 x i8] c"World\00"
@.str.3 = [6 x i8] c"eHllo\00"
@.str.4 = [6 x i8] c"olleH\00"
@__const.main.msg = [6 x i8] c"Hello\00"
@__const.main.msg2 = [6 x i8] c"Hlelo\00"
@.str.5 = [13 x i8] c"%s: hkey=%d\0A\00"
define i32 @main() {
%1 = alloca [5 x i8*]
%2 = alloca [6 x i8]
%3 = alloca [6 x i8]
%4 = bitcast [5 x i8*]* %1 to i8*
%5 = bitcast i8* %4 to [5 x i8*]*
%6 = getelementptr inbounds [5 x i8*], [5 x i8*]* %5, i32 0, i32 0
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i8** %6
%7 = getelementptr inbounds [5 x i8*], [5 x i8*]* %5, i32 0, i32 1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8** %7
%8 = getelementptr inbounds [5 x i8*], [5 x i8*]* %5, i32 0, i32 2
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0), i8** %8
%9 = getelementptr inbounds [5 x i8*], [5 x i8*]* %5, i32 0, i32 3
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i32 0, i32 0), i8** %9
%10 = getelementptr inbounds [5 x i8*], [5 x i8*]* %5, i32 0, i32 4
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i32 0, i32 0), i8** %10
%11 = bitcast [6 x i8]* %2 to i8*
%12 = bitcast [6 x i8]* %3 to i8*
%13 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%14 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%15 = call i32 @hkey(i8* %14)
%16 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i8* %13, i32 %15)
%17 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%18 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%19 = call i32 @hkey(i8* %18)
%20 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i8* %17, i32 %19)
ret i32 0
}

LLVM IR (-O2):
@__const.main.msg = [6 x i8] c"Hello\00"
@__const.main.msg2 = [6 x i8] c"Hlelo\00"
@.str.5 = [13 x i8] c"%s: hkey=%d\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 @hkey(i8* %3)
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i8* %3, i32 %5)
%7 = call i32 @hkey(i8* %4)
%8 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i8* %4, i32 %7)
ret i32 0
}