#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*/ bar(char *);
int /*<<< orphan*/ bar2(char *);
int /*<<< orphan*/ bar3(char *, char *);
char foo(char, int);
scalar_t__ malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
int main(void) {
  char a = 0xA;
  int b = 0xB;
  char *string;
  char *string2;
  char *staticString = "DFDFSFSFSDFSDFSDFSF";
  a = foo(a, 5);
  string = (char *)malloc(100 * sizeof(char));
  strcpy(string, "Ana are mere");
  string2 = (char *)malloc(200 * sizeof(char));
  strcpy(string2, staticString);
  bar(string);
  bar(string2);
  bar2(string);
  bar2(string2);
  bar2(staticString);
  bar3(staticString, staticString);
  bar3(string, staticString);
  bar3(string, string);
  bar3(string, string2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0xa,-0x5(%rbp)
movl   $0xb,-0xc(%rbp)
lea    0xe7f(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    $0x5,%esi
movsbl -0x5(%rbp),%edi
call   1080 <foo@plt>
mov    %al,-0x5(%rbp)
mov    $0x64,%edi
call   1070 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe65(%rip),%rsi
call   1040 <strcpy@plt>
mov    $0xc8,%edi
call   1070 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x18(%rbp),%rdi
call   1050 <bar@plt>
mov    -0x20(%rbp),%rdi
call   1050 <bar@plt>
mov    -0x18(%rbp),%rdi
call   1030 <bar2@plt>
mov    -0x20(%rbp),%rdi
call   1030 <bar2@plt>
mov    -0x28(%rbp),%rdi
call   1030 <bar2@plt>
mov    -0x28(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1060 <bar3@plt>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1060 <bar3@plt>
mov    -0x18(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1060 <bar3@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1060 <bar3@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0xa,%edi
mov    $0x5,%esi
call   1080 <foo@plt>
mov    $0x64,%edi
call   1070 <malloc@plt>
mov    %rax,%rbx
lea    0xe8c(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcpy@plt>
mov    $0xc8,%edi
call   1070 <malloc@plt>
mov    %rax,%r14
lea    0xe5c(%rip),%r15
mov    %rax,%rdi
mov    %r15,%rsi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
call   1050 <bar@plt>
mov    %r14,%rdi
call   1050 <bar@plt>
mov    %rbx,%rdi
call   1030 <bar2@plt>
mov    %r14,%rdi
call   1030 <bar2@plt>
mov    %r15,%rdi
call   1030 <bar2@plt>
mov    %r15,%rdi
mov    %r15,%rsi
call   1060 <bar3@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1060 <bar3@plt>
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1060 <bar3@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <bar3@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [20 x i8] c"DFDFSFSFSDFSDFSDFSF\00"
@.str.1 = [13 x i8] c"Ana are mere\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i32 0, i32* %1
store i8 10, i8* %2
store i32 11, i32* %3
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8** %6
%7 = load i8, i8* %2
%8 = call signext i8 @foo(i8 signext %7, i32 5)
store i8 %8, i8* %2
%9 = call i64 @malloc(i32 100)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%13 = call i64 @malloc(i32 200)
%14 = inttoptr i64 %13 to i8*
store i8* %14, i8** %5
%15 = load i8*, i8** %5
%16 = load i8*, i8** %6
%17 = call i32 @strcpy(i8* %15, i8* %16)
%18 = load i8*, i8** %4
%19 = call i32 @bar(i8* %18)
%20 = load i8*, i8** %5
%21 = call i32 @bar(i8* %20)
%22 = load i8*, i8** %4
%23 = call i32 @bar2(i8* %22)
%24 = load i8*, i8** %5
%25 = call i32 @bar2(i8* %24)
%26 = load i8*, i8** %6
%27 = call i32 @bar2(i8* %26)
%28 = load i8*, i8** %6
%29 = load i8*, i8** %6
%30 = call i32 @bar3(i8* %28, i8* %29)
%31 = load i8*, i8** %4
%32 = load i8*, i8** %6
%33 = call i32 @bar3(i8* %31, i8* %32)
%34 = load i8*, i8** %4
%35 = load i8*, i8** %4
%36 = call i32 @bar3(i8* %34, i8* %35)
%37 = load i8*, i8** %4
%38 = load i8*, i8** %5
%39 = call i32 @bar3(i8* %37, i8* %38)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"DFDFSFSFSDFSDFSDFSF\00"
@.str.1 = [13 x i8] c"Ana are mere\00"
define i32 @main() {
%1 = tail call signext i8 @foo(i8 signext 10, i32 5)
%2 = tail call i64 @malloc(i32 100)
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i64 @malloc(i32 200)
%6 = inttoptr i64 %5 to i8*
%7 = tail call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @bar(i8* %3)
%9 = tail call i32 @bar(i8* %6)
%10 = tail call i32 @bar2(i8* %3)
%11 = tail call i32 @bar2(i8* %6)
%12 = tail call i32 @bar2(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%13 = tail call i32 @bar3(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%14 = tail call i32 @bar3(i8* %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%15 = tail call i32 @bar3(i8* %3, i8* %3)
%16 = tail call i32 @bar3(i8* %3, i8* %6)
ret i32 0
}