#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*/ CreateInterpreter();
int /*<<< orphan*/ InitOptions(int /*<<< orphan*/, char *);
int /*<<< orphan*/ Interpret(char *);
int /*<<< orphan*/ WriteString(char *);
int /*<<< orphan*/ getstring(char *, char *);
void amaproc(char path[]) {
  InitOptions(0, path);
  CreateInterpreter();
  for (;;) {
    char expr[256] = "";
    getstring(">> ", expr);
    WriteString("\n<\n");
    Interpret(expr);
    WriteString("\n>\n");
  }
}


x86 assembly (clang, -O0):
<amaproc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
xor    %edi,%edi
call   1070 <InitOptions@plt>
mov    $0x0,%al
call   1080 <CreateInterpreter@plt>
lea    -0x110(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1050 <memset@plt>
lea    -0x110(%rbp),%rsi
lea    0xe5e(%rip),%rdi
call   1030 <getstring@plt>
lea    0xe56(%rip),%rdi
call   1040 <WriteString@plt>
lea    -0x110(%rbp),%rdi
call   1060 <Interpret@plt>
lea    0xe42(%rip),%rdi
call   1040 <WriteString@plt>
jmp    1181 <amaproc+0x21>

x86 assembly (clang, -O2):
<amaproc>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x108,%rsp
mov    %rdi,%rsi
xor    %edi,%edi
call   1060 <InitOptions@plt>
xor    %eax,%eax
call   1070 <CreateInterpreter@plt>
lea    0xe8a(%rip),%r14
mov    %rsp,%rbx
lea    0xe84(%rip),%r15
lea    0xe81(%rip),%r12
nopw   0x0(%rax,%rax,1)
xorps  %xmm0,%xmm0
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <getstring@plt>
mov    %r15,%rdi
call   1040 <WriteString@plt>
mov    %rbx,%rdi
call   1050 <Interpret@plt>
mov    %r12,%rdi
call   1040 <WriteString@plt>
jmp    1190 <amaproc+0x40>

LLVM IR (-O0):
@.str = [4 x i8] c">> \00"
@.str.1 = [4 x i8] c"\0A<\0A\00"
@.str.2 = [4 x i8] c"\0A>\0A\00"
define void @amaproc(i8* %0) {
%2 = alloca i8*
%3 = alloca [256 x i8]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @InitOptions(i32 0, i8* %4)
%6 = call i32 (...) @CreateInterpreter()
br label %7
7: ; preds = %7, %1
%8 = bitcast [256 x i8]* %3 to i8*
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%10 = call i32 @getstring(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = call i32 @WriteString(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%13 = call i32 @Interpret(i8* %12)
%14 = call i32 @WriteString(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %7
}

LLVM IR (-O2):
@.str = [4 x i8] c">> \00"
@.str.1 = [4 x i8] c"\0A<\0A\00"
@.str.2 = [4 x i8] c"\0A>\0A\00"
define void @amaproc(i8* %0) {
%2 = alloca [256 x i8]
%3 = tail call i32 @InitOptions(i32 0, i8* %0)
%4 = tail call i32 (...) @CreateInterpreter()
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
br label %6
6: ; preds = %6, %1
%7 = call i32 @getstring(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
%8 = call i32 @WriteString(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @Interpret(i8* %5)
%10 = call i32 @WriteString(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %6
}