#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 */
char aFunction(char *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char const *argv[]) {
  char myArr[5];
  myArr[0] = 'a';
  myArr[1] = 'b';
  myArr[2] = 'c';
  myArr[3] = 'd';
  myArr[4] = 0;
  printf("%p\n", myArr);
  char res = aFunction(myArr);
  printf("%c\n", res);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x61,-0x15(%rbp)
movb   $0x62,-0x14(%rbp)
movb   $0x63,-0x13(%rbp)
movb   $0x64,-0x12(%rbp)
movb   $0x0,-0x11(%rbp)
lea    -0x15(%rbp),%rsi
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x15(%rbp),%rdi
call   1040 <aFunction@plt>
mov    %al,-0x16(%rbp)
movsbl -0x16(%rbp),%esi
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x64636261,0xb(%rsp)
64
movb   $0x0,0xf(%rsp)
lea    0xec7(%rip),%rdi
lea    0xb(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <aFunction@plt>
movsbl %al,%esi
lea    0xeaa(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%p\0A\00"
@.str.1 = [4 x i8] c"%c\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [5 x i8]
%6 = alloca i8
store i32 %0, i32* %3
store i8** %1, i8*** %4
%7 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 0
store i8 97, i8* %7
%8 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 1
store i8 98, i8* %8
%9 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 2
store i8 99, i8* %9
%10 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 3
store i8 100, i8* %10
%11 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 4
store i8 0, i8* %11
%12 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 0
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 0
%15 = call signext i8 @aFunction(i8* %14)
store i8 %15, i8* %6
%16 = load i8, i8* %6
%17 = sext i8 %16 to i32
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%p\0A\00"
@.str.1 = [4 x i8] c"%c\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [5 x i8]
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
store i8 97, i8* %4
%5 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 1
store i8 98, i8* %5
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 2
store i8 99, i8* %6
%7 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 3
store i8 100, i8* %7
%8 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 4
store i8 0, i8* %8
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%10 = call signext i8 @aFunction(i8* %4)
%11 = sext i8 %10 to i32
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret i32 0
}