#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*/ allocateVariable(char *, char *, scalar_t__);
char *getVariable(char *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ strlen(char *);
int main(int argc, char *argv[]) {
  char *lol = "Ehsan", *hi = "Damn";
  allocateVariable("test", lol, strlen(lol) + 1);
  allocateVariable("kk", hi, strlen(hi) + 1);
  printf("%s\n", getVariable("test"));
  printf(getVariable("kk"));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeaa(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xea5(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x30(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
lea    0xe83(%rip),%rdi
call   1050 <allocateVariable@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
lea    0xe60(%rip),%rdi
call   1050 <allocateVariable@plt>
lea    0xe4f(%rip),%rdi
call   1060 <getVariable@plt>
mov    %rax,%rsi
lea    0xe48(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe37(%rip),%rdi
call   1060 <getVariable@plt>
mov    %rax,%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec0(%rip),%rbx
lea    0xeae(%rip),%rsi
mov    $0x6,%edx
mov    %rbx,%rdi
call   1050 <allocateVariable@plt>
lea    0xeaa(%rip),%r14
lea    0xe99(%rip),%rsi
mov    $0x5,%edx
mov    %r14,%rdi
call   1050 <allocateVariable@plt>
mov    %rbx,%rdi
call   1060 <getVariable@plt>
mov    %rax,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1060 <getVariable@plt>
mov    %rax,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"Ehsan\00"
@.str.1 = [5 x i8] c"Damn\00"
@.str.2 = [5 x i8] c"test\00"
@.str.3 = [3 x i8] c"kk\00"
@.str.4 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %5
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %5
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %9, 1
%11 = call i32 @allocateVariable(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %7, i64 %10)
%12 = load i8*, i8** %6
%13 = load i8*, i8** %6
%14 = call i64 @strlen(i8* %13)
%15 = add nsw i64 %14, 1
%16 = call i32 @allocateVariable(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %12, i64 %15)
%17 = call i8* @getVariable(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %17)
%19 = call i8* @getVariable(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%20 = call i32 (i8*, ...) @printf(i8* %19)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"Ehsan\00"
@.str.1 = [5 x i8] c"Damn\00"
@.str.2 = [5 x i8] c"test\00"
@.str.3 = [3 x i8] c"kk\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @allocateVariable(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 6)
%4 = tail call i32 @allocateVariable(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 5)
%5 = tail call i8* @getVariable(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) %5)
%7 = tail call i8* @getVariable(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %7)
ret i32 0
}