#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*/ printf(char *);
double sqrt(int);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main() {
  char eat_pie[7] = "eat pie";
  int i = 1;
  for (i; i < 98; i++) {
    strcpy(eat_pie, "eat pie");
  }
  int count = 1;
  char x[1000000] = "a";
  while (count < 999999) {
    strcat(x, "a");
    count++;
  }
  double squiggly = sqrt(5);
  printf("Hi\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf4270,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xe98(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xe92(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xe8a(%rip),%al
mov    %al,-0x5(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0x62,-0x10(%rbp)
jge    11ae <main+0x5e>
lea    -0xb(%rbp),%rdi
lea    0xe6c(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1186 <main+0x36>
movl   $0x1,-0x14(%rbp)
lea    -0xf4260(%rbp),%rdi
xor    %esi,%esi
mov    $0xf4240,%edx
call   1050 <memset@plt>
movb   $0x61,-0xf4260(%rbp)
cmpl   $0xf423f,-0x14(%rbp)
jge    11fd <main+0xad>
lea    -0xf4260(%rbp),%rdi
lea    0xe25(%rip),%rsi
call   1070 <strcat@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11cf <main+0x7f>
mov    $0x5,%edi
call   1060 <sqrt@plt>
movsd  %xmm0,-0xf4268(%rbp)
ff
lea    0xdfb(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xf4270,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0xf4250,%rsp
movl   $0x65697020,0xb(%rsp)
65
movl   $0x20746165,0x8(%rsp)
20
mov    $0x61,%ebp
lea    0xe90(%rip),%r14
lea    0x8(%rsp),%rbx
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
add    $0xffffffff,%ebp
jne    1180 <main+0x30>
lea    0x10(%rsp),%r14
mov    $0xf4240,%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1050 <memset@plt>
movb   $0x61,0x10(%rsp)
mov    $0xf423e,%ebp
lea    0xe5a(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %rbx,%rsi
call   1070 <strcat@plt>
add    $0xffffffff,%ebp
jne    11c0 <main+0x70>
mov    $0x5,%edi
call   1060 <sqrt@plt>
lea    0xe30(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0xf4250,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.eat_pie = [7 x i8] c"eat pie"
@.str = [8 x i8] c"eat pie\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [4 x i8] c"Hi\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca [1000000 x i8]
%6 = alloca double
store i32 0, i32* %1
%7 = bitcast [7 x i8]* %2 to i8*
store i32 1, i32* %3
%8 = load i32, i32* %3
br label %9
9: ; preds = %15, %0
%10 = load i32, i32* %3
%11 = icmp slt i32 %10, 98
br i1 %11, label %12, label %18
12: ; preds = %9
%13 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%14 = call i32 @strcpy(i8* %13, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %12
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %9
18: ; preds = %9
store i32 1, i32* %4
%19 = bitcast [1000000 x i8]* %5 to i8*
%20 = bitcast i8* %19 to [1000000 x i8]*
%21 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %20, i32 0, i32 0
store i8 97, i8* %21
br label %22
22: ; preds = %25, %18
%23 = load i32, i32* %4
%24 = icmp slt i32 %23, 999999
br i1 %24, label %25, label %30
25: ; preds = %22
%26 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %5, i64 0, i64 0
%27 = call i32 @strcat(i8* %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%28 = load i32, i32* %4
%29 = add nsw i32 %28, 1
store i32 %29, i32* %4
br label %22
30: ; preds = %22
%31 = call double @sqrt(i32 5)
store double %31, double* %6
%32 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.eat_pie = [7 x i8] c"eat pie"
@.str = [8 x i8] c"eat pie\00"
@.str.1 = [2 x i8] c"a\00"
@str = [3 x i8] c"Hi\00"
define i32 @main() {
%1 = alloca [7 x i8]
%2 = alloca [1000000 x i8]
%3 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
br label %4
4: ; preds = %0, %4
%5 = phi i32 [ 1, %0 ], [ %7, %4 ]
%6 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, 98
br i1 %8, label %9, label %4
9: ; preds = %4
%10 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %2, i64 0, i64 0
store i8 97, i8* %10
br label %11
11: ; preds = %9, %11
%12 = phi i32 [ 1, %9 ], [ %14, %11 ]
%13 = call i32 @strcat(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%14 = add nuw nsw i32 %12, 1
%15 = icmp eq i32 %14, 999999
br i1 %15, label %16, label %11
16: ; preds = %11
%17 = call double @sqrt(i32 5)
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret i32 0
}