zhm
L_zk 2 weeks ago
parent c2c3e40e1e
commit a2a8bcd042

@ -45,10 +45,13 @@ class Value;
class User;
class ConstantValue;
class ConstantInt;
class ConstantFloat;
class GlobalValue;
class Instruction;
class BasicBlock;
class Function;
class Argument;
class GlobalVariable;
// Use 表示一个 Value 的一次使用记录。
// 当前实现设计:
@ -83,28 +86,34 @@ class Context {
~Context();
// 去重创建 i32 常量。
ConstantInt* GetConstInt(int v);
ConstantFloat* GetConstFloat(double v);
std::string NextTemp();
private:
std::unordered_map<int, std::unique_ptr<ConstantInt>> const_ints_;
std::unordered_map<std::string, std::unique_ptr<ConstantFloat>> const_floats_;
int temp_index_ = -1;
};
class Type {
public:
enum class Kind { Void, Int32, PtrInt32 };
enum class Kind { Void, Int32, Float32, PtrInt32, PtrFloat32 };
explicit Type(Kind k);
// 使用静态共享对象获取类型。
// 同一类型可直接比较返回值是否相等,例如:
// Type::GetInt32Type() == Type::GetInt32Type()
static const std::shared_ptr<Type>& GetVoidType();
static const std::shared_ptr<Type>& GetInt32Type();
static const std::shared_ptr<Type>& GetFloat32Type();
static const std::shared_ptr<Type>& GetPtrInt32Type();
static const std::shared_ptr<Type>& GetPtrFloat32Type();
Kind GetKind() const;
bool IsVoid() const;
bool IsInt32() const;
bool IsFloat32() const;
bool IsPtrInt32() const;
bool IsPtrFloat32() const;
private:
Kind kind_;
@ -119,7 +128,9 @@ class Value {
void SetName(std::string n);
bool IsVoid() const;
bool IsInt32() const;
bool IsFloat32() const;
bool IsPtrInt32() const;
bool IsPtrFloat32() const;
bool IsConstant() const;
bool IsInstruction() const;
bool IsUser() const;
@ -151,8 +162,39 @@ class ConstantInt : public ConstantValue {
int value_{};
};
class ConstantFloat : public ConstantValue {
public:
ConstantFloat(std::shared_ptr<Type> ty, double v);
double GetValue() const { return value_; }
private:
double value_{};
};
// 后续还需要扩展更多指令类型。
enum class Opcode { Add, Sub, Mul, Alloca, Load, Store, Ret };
enum class Opcode {
Add,
Sub,
Mul,
Div,
Mod,
SIToFP,
FPToSI,
Eq,
Ne,
Lt,
Le,
Gt,
Ge,
Alloca,
Load,
Store,
GEP,
Call,
Br,
CondBr,
Ret
};
// User 是所有“会使用其他 Value 作为输入”的 IR 对象的抽象基类。
// 当前实现中只有 Instruction 继承自 User。
@ -178,6 +220,38 @@ class GlobalValue : public User {
GlobalValue(std::shared_ptr<Type> ty, std::string name);
};
class GlobalVariable : public GlobalValue {
public:
enum class StorageKind {
Scalar,
Array,
};
enum class ElemKind {
Int32,
Float32,
};
GlobalVariable(std::string name, int init_value);
GlobalVariable(std::string name, double init_value);
GlobalVariable(std::string name, size_t array_size);
GlobalVariable(std::string name, size_t array_size, ElemKind elem_kind);
StorageKind GetStorageKind() const;
bool IsArray() const;
ElemKind GetElemKind() const;
bool IsFloatElem() const;
int GetInitValue() const;
double GetInitFloatValue() const;
size_t GetArraySize() const;
private:
StorageKind storage_kind_ = StorageKind::Scalar;
ElemKind elem_kind_ = ElemKind::Int32;
int init_value_ = 0;
double init_float_value_ = 0.0;
size_t array_size_ = 0;
};
class Instruction : public User {
public:
Instruction(Opcode op, std::shared_ptr<Type> ty, std::string name = "");
@ -196,18 +270,62 @@ class BinaryInst : public Instruction {
BinaryInst(Opcode op, std::shared_ptr<Type> ty, Value* lhs, Value* rhs,
std::string name);
Value* GetLhs() const;
Value* GetRhs() const;
Value* GetRhs() const;
};
class CastInst : public Instruction {
public:
CastInst(Opcode op, std::shared_ptr<Type> ty, Value* operand,
std::string name);
Value* GetOperandValue() const;
};
class BranchInst : public Instruction {
public:
BranchInst(std::shared_ptr<Type> void_ty, BasicBlock* target);
BasicBlock* GetTarget() const;
};
class CondBranchInst : public Instruction {
public:
CondBranchInst(std::shared_ptr<Type> void_ty, Value* cond, BasicBlock* true_bb,
BasicBlock* false_bb);
Value* GetCond() const;
BasicBlock* GetTrueTarget() const;
BasicBlock* GetFalseTarget() const;
};
class CallInst : public Instruction {
public:
CallInst(std::shared_ptr<Type> ret_ty, Function* callee,
const std::vector<Value*>& args, std::string name);
Function* GetCallee() const;
size_t GetNumArgs() const;
Value* GetArg(size_t index) const;
};
class ReturnInst : public Instruction {
public:
ReturnInst(std::shared_ptr<Type> void_ty, Value* val);
ReturnInst(std::shared_ptr<Type> void_ty, Value* val = nullptr);
Value* GetValue() const;
bool HasValue() const;
};
class AllocaInst : public Instruction {
public:
AllocaInst(std::shared_ptr<Type> ptr_ty, std::string name);
AllocaInst(std::shared_ptr<Type> elem_ty, std::string name,
Value* count = nullptr);
bool IsArrayAlloca() const;
Value* GetCount() const;
std::shared_ptr<Type> GetElementType() const;
};
class GetElementPtrInst : public Instruction {
public:
GetElementPtrInst(std::shared_ptr<Type> ptr_ty, Value* base_ptr,
Value* index, std::string name);
Value* GetBasePtr() const;
Value* GetIndex() const;
};
class LoadInst : public Instruction {
@ -223,6 +341,15 @@ class StoreInst : public Instruction {
Value* GetPtr() const;
};
class Argument : public Value {
public:
Argument(std::shared_ptr<Type> ty, std::string name, size_t index);
size_t GetIndex() const;
private:
size_t index_ = 0;
};
// BasicBlock 已纳入 Value 体系,便于后续向更完整 IR 类图靠拢。
// 当前其类型仍使用 void 作为占位,后续可替换为专门的 label type。
class BasicBlock : public Value {
@ -263,14 +390,20 @@ class BasicBlock : public Value {
class Function : public Value {
public:
// 当前构造函数接收的也是返回类型,而不是完整函数类型。
Function(std::string name, std::shared_ptr<Type> ret_type);
Function(std::string name, std::shared_ptr<Type> ret_type,
bool is_external = false);
Argument* AddParam(const std::string& name, std::shared_ptr<Type> type);
const std::vector<std::unique_ptr<Argument>>& GetParams() const;
bool IsExternal() const;
BasicBlock* CreateBlock(const std::string& name);
BasicBlock* GetEntry();
const BasicBlock* GetEntry() const;
const std::vector<std::unique_ptr<BasicBlock>>& GetBlocks() const;
private:
bool is_external_ = false;
BasicBlock* entry_ = nullptr;
std::vector<std::unique_ptr<Argument>> params_;
std::vector<std::unique_ptr<BasicBlock>> blocks_;
};
@ -281,11 +414,22 @@ class Module {
const Context& GetContext() const;
// 创建函数时当前只显式传入返回类型,尚未接入完整的 FunctionType。
Function* CreateFunction(const std::string& name,
std::shared_ptr<Type> ret_type);
std::shared_ptr<Type> ret_type,
bool is_external = false);
Function* GetFunction(const std::string& name) const;
GlobalVariable* CreateGlobalI32(const std::string& name, int init_value);
GlobalVariable* CreateGlobalF32(const std::string& name, double init_value);
GlobalVariable* CreateGlobalArrayI32(const std::string& name,
size_t array_size);
GlobalVariable* CreateGlobalArrayF32(const std::string& name,
size_t array_size);
GlobalVariable* GetGlobal(const std::string& name) const;
const std::vector<std::unique_ptr<GlobalVariable>>& GetGlobals() const;
const std::vector<std::unique_ptr<Function>>& GetFunctions() const;
private:
Context context_;
std::vector<std::unique_ptr<GlobalVariable>> globals_;
std::vector<std::unique_ptr<Function>> functions_;
};
@ -297,13 +441,31 @@ class IRBuilder {
// 构造常量、二元运算、返回指令的最小集合。
ConstantInt* CreateConstInt(int v);
ConstantFloat* CreateConstFloat(double v);
BinaryInst* CreateBinary(Opcode op, Value* lhs, Value* rhs,
const std::string& name);
BinaryInst* CreateAdd(Value* lhs, Value* rhs, const std::string& name);
AllocaInst* CreateAllocaI32(const std::string& name);
BinaryInst* CreateICmp(Opcode op, Value* lhs, Value* rhs,
const std::string& name);
CastInst* CreateSIToFP(Value* operand, const std::string& name);
CastInst* CreateFPToSI(Value* operand, const std::string& name);
AllocaInst* CreateAlloca(std::shared_ptr<Type> elem_ty, const std::string& name,
Value* count = nullptr);
AllocaInst* CreateAllocaI32(const std::string& name,
Value* count = nullptr);
AllocaInst* CreateAllocaF32(const std::string& name,
Value* count = nullptr);
LoadInst* CreateLoad(Value* ptr, const std::string& name);
StoreInst* CreateStore(Value* val, Value* ptr);
GetElementPtrInst* CreateGEP(Value* base_ptr, Value* index,
const std::string& name);
CallInst* CreateCall(Function* callee, const std::vector<Value*>& args,
const std::string& name);
BranchInst* CreateBr(BasicBlock* target);
CondBranchInst* CreateCondBr(Value* cond, BasicBlock* true_bb,
BasicBlock* false_bb);
ReturnInst* CreateRet(Value* v);
ReturnInst* CreateRetVoid();
private:
Context& ctx_;

@ -7,6 +7,7 @@
#include <memory>
#include <string>
#include <unordered_map>
#include <vector>
#include "SysYBaseVisitor.h"
#include "SysYParser.h"
@ -26,16 +27,19 @@ class IRGenImpl final : public SysYBaseVisitor {
std::any visitCompUnit(SysYParser::CompUnitContext* ctx) override;
std::any visitFuncDef(SysYParser::FuncDefContext* ctx) override;
std::any visitBlockStmt(SysYParser::BlockStmtContext* ctx) override;
std::any visitBlock(SysYParser::BlockContext* ctx) override;
std::any visitBlockItem(SysYParser::BlockItemContext* ctx) override;
std::any visitDecl(SysYParser::DeclContext* ctx) override;
std::any visitVarDecl(SysYParser::VarDeclContext* ctx) override;
std::any visitStmt(SysYParser::StmtContext* ctx) override;
std::any visitVarDef(SysYParser::VarDefContext* ctx) override;
std::any visitReturnStmt(SysYParser::ReturnStmtContext* ctx) override;
std::any visitParenExp(SysYParser::ParenExpContext* ctx) override;
std::any visitNumberExp(SysYParser::NumberExpContext* ctx) override;
std::any visitVarExp(SysYParser::VarExpContext* ctx) override;
std::any visitAdditiveExp(SysYParser::AdditiveExpContext* ctx) override;
std::any visitExp(SysYParser::ExpContext* ctx) override;
std::any visitAddExp(SysYParser::AddExpContext* ctx) override;
std::any visitMulExp(SysYParser::MulExpContext* ctx) override;
std::any visitUnaryExp(SysYParser::UnaryExpContext* ctx) override;
std::any visitPrimaryExp(SysYParser::PrimaryExpContext* ctx) override;
std::any visitLVal(SysYParser::LValContext* ctx) override;
std::any visitNumber(SysYParser::NumberContext* ctx) override;
private:
enum class BlockFlow {
@ -45,13 +49,63 @@ class IRGenImpl final : public SysYBaseVisitor {
BlockFlow VisitBlockItemResult(SysYParser::BlockItemContext& item);
ir::Value* EvalExpr(SysYParser::ExpContext& expr);
ir::Value* EvalBinaryOrFold(ir::Opcode op, ir::Value* lhs, ir::Value* rhs);
std::shared_ptr<ir::Type> ResolveBType(SysYParser::BTypeContext* btype) const;
int EvalConstIntExpr(SysYParser::ExpContext& expr);
int EvalConstIntExpr(SysYParser::ConstExpContext& expr);
int EvalConstIntAddExp(SysYParser::AddExpContext& expr);
int EvalConstIntMulExp(SysYParser::MulExpContext& expr);
int EvalConstIntUnaryExp(SysYParser::UnaryExpContext& expr);
int EvalConstIntPrimaryExp(SysYParser::PrimaryExpContext& expr);
std::vector<int> EvalArrayExtents(
const std::vector<SysYParser::ConstExpContext*>& dims);
std::vector<int> GetArrayExtentsForDecl(SysYParser::VarDefContext* decl);
std::vector<int> GetArrayExtentsForConstDecl(
SysYParser::ConstDefContext* decl);
std::vector<int> GetArrayExtentsForLVal(SysYParser::LValContext& lval,
bool& is_array);
ir::Value* BuildLinearizedIndex(
const std::vector<ir::Value*>& indices,
const std::vector<int>& extents_with_first_dim) ;
ir::Value* CastValueTo(ir::Value* value,
const std::shared_ptr<ir::Type>& target_type);
ir::Value* GetLValAddress(SysYParser::LValContext& lval);
std::string NextBlockName(const std::string& prefix);
void EmitCondBranch(SysYParser::CondContext& cond, ir::BasicBlock* true_bb,
ir::BasicBlock* false_bb);
void EmitLOrBranch(SysYParser::LOrExpContext& expr, ir::BasicBlock* true_bb,
ir::BasicBlock* false_bb);
void EmitLAndBranch(SysYParser::LAndExpContext& expr, ir::BasicBlock* true_bb,
ir::BasicBlock* false_bb);
void EmitEqBranch(SysYParser::EqExpContext& expr, ir::BasicBlock* true_bb,
ir::BasicBlock* false_bb);
void EmitRelBranch(SysYParser::RelExpContext& expr, ir::BasicBlock* true_bb,
ir::BasicBlock* false_bb);
ir::Value* EvalEqValue(SysYParser::EqExpContext& expr);
ir::Value* EvalRelValue(SysYParser::RelExpContext& expr);
ir::Module& module_;
const SemanticContext& sema_;
ir::Function* func_;
ir::IRBuilder builder_;
std::unordered_map<std::string, ir::Function*> function_map_;
std::unordered_map<std::string, int> const_value_map_;
std::unordered_map<SysYParser::VarDefContext*, std::vector<int>>
array_extents_map_;
std::unordered_map<SysYParser::ConstDefContext*, std::vector<int>>
const_array_extents_map_;
std::unordered_map<std::string, std::vector<int>> param_array_extents_map_;
std::unordered_map<std::string, ir::Value*> param_storage_map_;
std::unordered_map<std::string, ir::Value*> param_pointer_map_;
std::unordered_map<SysYParser::VarDefContext*, ir::Value*> global_storage_map_;
std::unordered_map<SysYParser::ConstDefContext*, ir::Value*>
const_global_storage_map_;
// 名称绑定由 Sema 负责IRGen 只维护“声明 -> 存储槽位”的代码生成状态。
std::unordered_map<SysYParser::VarDefContext*, ir::Value*> storage_map_;
std::unordered_map<SysYParser::ConstDefContext*, ir::Value*>
const_storage_map_;
std::vector<std::pair<ir::BasicBlock*, ir::BasicBlock*>> loop_stack_;
int block_index_ = 0;
};
std::unique_ptr<ir::Module> GenerateIR(SysYParser::CompUnitContext& tree,

@ -7,21 +7,69 @@
class SemanticContext {
public:
void BindVarUse(SysYParser::VarContext* use,
void BindVarUse(SysYParser::LValContext* use,
SysYParser::VarDefContext* decl) {
var_uses_[use] = decl;
}
SysYParser::VarDefContext* ResolveVarUse(
const SysYParser::VarContext* use) const {
const SysYParser::LValContext* use) const {
auto it = var_uses_.find(use);
return it == var_uses_.end() ? nullptr : it->second;
}
void BindConstArrayUse(SysYParser::LValContext* use,
SysYParser::ConstDefContext* decl) {
const_array_uses_[use] = decl;
}
SysYParser::ConstDefContext* ResolveConstArrayUse(
const SysYParser::LValContext* use) const {
auto it = const_array_uses_.find(use);
return it == const_array_uses_.end() ? nullptr : it->second;
}
void BindConstUse(SysYParser::LValContext* use, int value) {
const_uses_[use] = value;
}
const int* ResolveConstUse(const SysYParser::LValContext* use) const {
auto it = const_uses_.find(use);
return it == const_uses_.end() ? nullptr : &it->second;
}
void BindConstFloatUse(SysYParser::LValContext* use, double value) {
const_float_uses_[use] = value;
}
const double* ResolveConstFloatUse(const SysYParser::LValContext* use) const {
auto it = const_float_uses_.find(use);
return it == const_float_uses_.end() ? nullptr : &it->second;
}
void BindCallUse(SysYParser::UnaryExpContext* call,
SysYParser::FuncDefContext* decl) {
call_uses_[call] = decl;
}
SysYParser::FuncDefContext* ResolveCallUse(
const SysYParser::UnaryExpContext* call) const {
auto it = call_uses_.find(call);
return it == call_uses_.end() ? nullptr : it->second;
}
private:
std::unordered_map<const SysYParser::VarContext*,
std::unordered_map<const SysYParser::LValContext*,
SysYParser::VarDefContext*>
var_uses_;
std::unordered_map<const SysYParser::LValContext*, int> const_uses_;
std::unordered_map<const SysYParser::LValContext*, double> const_float_uses_;
std::unordered_map<const SysYParser::LValContext*,
SysYParser::ConstDefContext*>
const_array_uses_;
std::unordered_map<const SysYParser::UnaryExpContext*,
SysYParser::FuncDefContext*>
call_uses_;
};
// 目前仅检查:

@ -3,15 +3,20 @@
#include <string>
#include <unordered_map>
#include <vector>
#include "SysYParser.h"
class SymbolTable {
public:
void EnterScope();
void ExitScope();
void Add(const std::string& name, SysYParser::VarDefContext* decl);
bool ContainsInCurrent(const std::string& name) const;
bool Contains(const std::string& name) const;
SysYParser::VarDefContext* Lookup(const std::string& name) const;
private:
std::unordered_map<std::string, SysYParser::VarDefContext*> table_;
std::vector<std::unordered_map<std::string, SysYParser::VarDefContext*>>
scopes_;
};

File diff suppressed because it is too large Load Diff

@ -0,0 +1,35 @@
@a = global i32 0
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @func(i32 %arg.p) {
entry:
%t0 = alloca i32
store i32 %arg.p, i32* %t0
%t1 = load i32, i32* %t0
%t2 = sub i32 %t1, 1
store i32 %t2, i32* %t0
%t3 = load i32, i32* %t0
ret i32 %t3
}
define i32 @main() {
entry:
%t4 = alloca i32
store i32 0, i32* %t4
store i32 10, i32* @a
%t5 = load i32, i32* @a
%t6 = call i32 @func(i32 %t5)
store i32 %t6, i32* %t4
%t7 = load i32, i32* %t4
ret i32 %t7
}

@ -0,0 +1,25 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @main() {
entry:
%t0 = alloca i32
store i32 0, i32* %t0
%t1 = alloca i32
store i32 0, i32* %t1
store i32 10, i32* %t0
store i32 -1, i32* %t1
%t2 = load i32, i32* %t0
%t3 = load i32, i32* %t1
%t4 = add i32 %t2, %t3
ret i32 %t4
}

@ -0,0 +1,16 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @main() {
entry:
ret i32 3
}

@ -0,0 +1,24 @@
@a = global i32 3
@b = global i32 5
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @main() {
entry:
%t0 = alloca i32
store i32 5, i32* %t0
%t1 = load i32, i32* %t0
%t2 = load i32, i32* @b
%t3 = add i32 %t1, %t2
ret i32 %t3
}

@ -0,0 +1,28 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @main() {
entry:
%t0 = alloca i32
store i32 0, i32* %t0
%t1 = alloca i32
store i32 0, i32* %t1
%t2 = alloca i32
store i32 0, i32* %t2
store i32 1, i32* %t0
store i32 2, i32* %t1
store i32 3, i32* %t2
%t3 = load i32, i32* %t1
%t4 = load i32, i32* %t2
%t5 = add i32 %t3, %t4
ret i32 %t5
}

@ -0,0 +1,18 @@
@a = global [100 x i32] zeroinitializer
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @main() {
entry:
ret i32 0
}

@ -0,0 +1,116 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @main() {
entry:
%t0 = alloca i32, i32 8
%t1 = getelementptr inbounds i32, i32* %t0, i32 0
store i32 0, i32* %t1
%t2 = getelementptr inbounds i32, i32* %t0, i32 1
store i32 0, i32* %t2
%t3 = getelementptr inbounds i32, i32* %t0, i32 2
store i32 0, i32* %t3
%t4 = getelementptr inbounds i32, i32* %t0, i32 3
store i32 0, i32* %t4
%t5 = getelementptr inbounds i32, i32* %t0, i32 4
store i32 0, i32* %t5
%t6 = getelementptr inbounds i32, i32* %t0, i32 5
store i32 0, i32* %t6
%t7 = getelementptr inbounds i32, i32* %t0, i32 6
store i32 0, i32* %t7
%t8 = getelementptr inbounds i32, i32* %t0, i32 7
store i32 0, i32* %t8
%t9 = alloca i32, i32 8
%t10 = getelementptr inbounds i32, i32* %t9, i32 0
store i32 1, i32* %t10
%t11 = getelementptr inbounds i32, i32* %t9, i32 1
store i32 2, i32* %t11
%t12 = getelementptr inbounds i32, i32* %t9, i32 2
store i32 3, i32* %t12
%t13 = getelementptr inbounds i32, i32* %t9, i32 3
store i32 4, i32* %t13
%t14 = getelementptr inbounds i32, i32* %t9, i32 4
store i32 5, i32* %t14
%t15 = getelementptr inbounds i32, i32* %t9, i32 5
store i32 6, i32* %t15
%t16 = getelementptr inbounds i32, i32* %t9, i32 6
store i32 7, i32* %t16
%t17 = getelementptr inbounds i32, i32* %t9, i32 7
store i32 8, i32* %t17
%t18 = alloca i32, i32 8
%t19 = getelementptr inbounds i32, i32* %t18, i32 0
store i32 1, i32* %t19
%t20 = getelementptr inbounds i32, i32* %t18, i32 1
store i32 2, i32* %t20
%t21 = getelementptr inbounds i32, i32* %t18, i32 2
store i32 3, i32* %t21
%t22 = getelementptr inbounds i32, i32* %t18, i32 3
store i32 4, i32* %t22
%t23 = getelementptr inbounds i32, i32* %t18, i32 4
store i32 5, i32* %t23
%t24 = getelementptr inbounds i32, i32* %t18, i32 5
store i32 6, i32* %t24
%t25 = getelementptr inbounds i32, i32* %t18, i32 6
store i32 7, i32* %t25
%t26 = getelementptr inbounds i32, i32* %t18, i32 7
store i32 8, i32* %t26
%t27 = alloca i32, i32 8
%t28 = getelementptr inbounds i32, i32* %t27, i32 0
store i32 1, i32* %t28
%t29 = getelementptr inbounds i32, i32* %t27, i32 1
store i32 2, i32* %t29
%t30 = getelementptr inbounds i32, i32* %t27, i32 2
store i32 3, i32* %t30
%t31 = getelementptr inbounds i32, i32* %t27, i32 3
store i32 5, i32* %t31
%t32 = getelementptr inbounds i32, i32* %t27, i32 4
store i32 7, i32* %t32
%t33 = getelementptr inbounds i32, i32* %t27, i32 5
store i32 8, i32* %t33
%t34 = getelementptr inbounds i32, i32* %t27, i32 6
store i32 0, i32* %t34
%t35 = getelementptr inbounds i32, i32* %t27, i32 7
store i32 0, i32* %t35
%t36 = alloca i32, i32 8
%t37 = getelementptr inbounds i32, i32* %t36, i32 0
%t38 = getelementptr inbounds i32, i32* %t27, i32 5
%t39 = load i32, i32* %t38
store i32 %t39, i32* %t37
%t40 = getelementptr inbounds i32, i32* %t36, i32 1
%t41 = getelementptr inbounds i32, i32* %t18, i32 5
%t42 = load i32, i32* %t41
store i32 %t42, i32* %t40
%t43 = getelementptr inbounds i32, i32* %t36, i32 2
store i32 3, i32* %t43
%t44 = getelementptr inbounds i32, i32* %t36, i32 3
store i32 4, i32* %t44
%t45 = getelementptr inbounds i32, i32* %t36, i32 4
store i32 5, i32* %t45
%t46 = getelementptr inbounds i32, i32* %t36, i32 5
store i32 6, i32* %t46
%t47 = getelementptr inbounds i32, i32* %t36, i32 6
store i32 7, i32* %t47
%t48 = getelementptr inbounds i32, i32* %t36, i32 7
store i32 8, i32* %t48
%t49 = getelementptr inbounds i32, i32* %t36, i32 7
%t50 = load i32, i32* %t49
%t51 = getelementptr inbounds i32, i32* %t36, i32 0
%t52 = load i32, i32* %t51
%t53 = add i32 %t50, %t52
%t54 = getelementptr inbounds i32, i32* %t36, i32 1
%t55 = load i32, i32* %t54
%t56 = add i32 %t53, %t55
%t57 = getelementptr inbounds i32, i32* %t0, i32 4
%t58 = load i32, i32* %t57
%t59 = add i32 %t56, %t58
ret i32 %t59
}

@ -0,0 +1,118 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @main() {
entry:
%t0 = alloca i32, i32 8
%t1 = getelementptr inbounds i32, i32* %t0, i32 0
store i32 1, i32* %t1
%t2 = getelementptr inbounds i32, i32* %t0, i32 1
store i32 2, i32* %t2
%t3 = getelementptr inbounds i32, i32* %t0, i32 2
store i32 3, i32* %t3
%t4 = getelementptr inbounds i32, i32* %t0, i32 3
store i32 4, i32* %t4
%t5 = getelementptr inbounds i32, i32* %t0, i32 4
store i32 7, i32* %t5
%t6 = getelementptr inbounds i32, i32* %t0, i32 5
store i32 0, i32* %t6
%t7 = getelementptr inbounds i32, i32* %t0, i32 6
store i32 0, i32* %t7
%t8 = getelementptr inbounds i32, i32* %t0, i32 7
store i32 0, i32* %t8
%t9 = alloca i32, i32 8
%t10 = getelementptr inbounds i32, i32* %t9, i32 0
store i32 0, i32* %t10
%t11 = getelementptr inbounds i32, i32* %t9, i32 1
store i32 0, i32* %t11
%t12 = getelementptr inbounds i32, i32* %t9, i32 2
store i32 0, i32* %t12
%t13 = getelementptr inbounds i32, i32* %t9, i32 3
store i32 0, i32* %t13
%t14 = getelementptr inbounds i32, i32* %t9, i32 4
store i32 0, i32* %t14
%t15 = getelementptr inbounds i32, i32* %t9, i32 5
store i32 0, i32* %t15
%t16 = getelementptr inbounds i32, i32* %t9, i32 6
store i32 0, i32* %t16
%t17 = getelementptr inbounds i32, i32* %t9, i32 7
store i32 0, i32* %t17
%t18 = alloca i32, i32 8
%t19 = getelementptr inbounds i32, i32* %t18, i32 0
store i32 1, i32* %t19
%t20 = getelementptr inbounds i32, i32* %t18, i32 1
store i32 2, i32* %t20
%t21 = getelementptr inbounds i32, i32* %t18, i32 2
store i32 3, i32* %t21
%t22 = getelementptr inbounds i32, i32* %t18, i32 3
store i32 4, i32* %t22
%t23 = getelementptr inbounds i32, i32* %t18, i32 4
store i32 5, i32* %t23
%t24 = getelementptr inbounds i32, i32* %t18, i32 5
store i32 6, i32* %t24
%t25 = getelementptr inbounds i32, i32* %t18, i32 6
store i32 7, i32* %t25
%t26 = getelementptr inbounds i32, i32* %t18, i32 7
store i32 8, i32* %t26
%t27 = alloca i32, i32 8
%t28 = getelementptr inbounds i32, i32* %t27, i32 0
store i32 1, i32* %t28
%t29 = getelementptr inbounds i32, i32* %t27, i32 1
store i32 2, i32* %t29
%t30 = getelementptr inbounds i32, i32* %t27, i32 2
store i32 3, i32* %t30
%t31 = getelementptr inbounds i32, i32* %t27, i32 3
store i32 5, i32* %t31
%t32 = getelementptr inbounds i32, i32* %t27, i32 4
%t33 = getelementptr inbounds i32, i32* %t0, i32 6
%t34 = load i32, i32* %t33
store i32 %t34, i32* %t32
%t35 = getelementptr inbounds i32, i32* %t27, i32 5
store i32 8, i32* %t35
%t36 = getelementptr inbounds i32, i32* %t27, i32 6
store i32 0, i32* %t36
%t37 = getelementptr inbounds i32, i32* %t27, i32 7
store i32 0, i32* %t37
%t38 = alloca i32, i32 8
%t39 = getelementptr inbounds i32, i32* %t38, i32 0
%t40 = getelementptr inbounds i32, i32* %t27, i32 5
%t41 = load i32, i32* %t40
store i32 %t41, i32* %t39
%t42 = getelementptr inbounds i32, i32* %t38, i32 1
%t43 = getelementptr inbounds i32, i32* %t18, i32 5
%t44 = load i32, i32* %t43
store i32 %t44, i32* %t42
%t45 = getelementptr inbounds i32, i32* %t38, i32 2
store i32 3, i32* %t45
%t46 = getelementptr inbounds i32, i32* %t38, i32 3
store i32 4, i32* %t46
%t47 = getelementptr inbounds i32, i32* %t38, i32 4
store i32 5, i32* %t47
%t48 = getelementptr inbounds i32, i32* %t38, i32 5
store i32 6, i32* %t48
%t49 = getelementptr inbounds i32, i32* %t38, i32 6
store i32 7, i32* %t49
%t50 = getelementptr inbounds i32, i32* %t38, i32 7
store i32 8, i32* %t50
%t51 = getelementptr inbounds i32, i32* %t38, i32 7
%t52 = load i32, i32* %t51
%t53 = getelementptr inbounds i32, i32* %t38, i32 0
%t54 = load i32, i32* %t53
%t55 = add i32 %t52, %t54
%t56 = getelementptr inbounds i32, i32* %t38, i32 1
%t57 = load i32, i32* %t56
%t58 = add i32 %t55, %t57
%t59 = getelementptr inbounds i32, i32* %t27, i32 6
%t60 = load i32, i32* %t59
%t61 = add i32 %t58, %t60
ret i32 %t61
}

@ -0,0 +1,16 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @main() {
entry:
ret i32 5
}

@ -0,0 +1,16 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @main() {
entry:
ret i32 5
}

@ -0,0 +1,20 @@
@a = global [5 x i32] zeroinitializer
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @main() {
entry:
%t0 = getelementptr inbounds [5 x i32], [5 x i32]* @a, i32 0, i32 4
%t1 = load i32, i32* %t0
ret i32 %t1
}

@ -0,0 +1,35 @@
@a = global i32 0
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @func(i32 %arg.p) {
entry:
%t0 = alloca i32
store i32 %arg.p, i32* %t0
%t1 = load i32, i32* %t0
%t2 = sub i32 %t1, 1
store i32 %t2, i32* %t0
%t3 = load i32, i32* %t0
ret i32 %t3
}
define i32 @main() {
entry:
%t4 = alloca i32
store i32 0, i32* %t4
store i32 10, i32* @a
%t5 = load i32, i32* @a
%t6 = call i32 @func(i32 %t5)
store i32 %t6, i32* %t4
%t7 = load i32, i32* %t4
ret i32 %t7
}

@ -0,0 +1,24 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @defn() {
entry:
ret i32 4
}
define i32 @main() {
entry:
%t0 = alloca i32
%t1 = call i32 @defn()
store i32 %t1, i32* %t0
%t2 = load i32, i32* %t0
ret i32 %t2
}

@ -0,0 +1,25 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @main() {
entry:
%t0 = alloca i32
store i32 0, i32* %t0
%t1 = alloca i32
store i32 0, i32* %t1
store i32 10, i32* %t0
store i32 -1, i32* %t1
%t2 = load i32, i32* %t0
%t3 = load i32, i32* %t1
%t4 = add i32 %t2, %t3
ret i32 %t4
}

@ -0,0 +1,16 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @main() {
entry:
ret i32 15
}

@ -0,0 +1,21 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @main() {
entry:
%t0 = alloca i32
store i32 0, i32* %t0
store i32 2, i32* %t0
%t1 = load i32, i32* %t0
%t2 = sub i32 %t1, 10
ret i32 %t2
}

@ -0,0 +1,21 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @main() {
entry:
%t0 = alloca i32
store i32 0, i32* %t0
store i32 10, i32* %t0
%t1 = load i32, i32* %t0
%t2 = sub i32 %t1, 2
ret i32 %t2
}

@ -0,0 +1,25 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @main() {
entry:
%t0 = alloca i32
store i32 0, i32* %t0
%t1 = alloca i32
store i32 0, i32* %t1
store i32 10, i32* %t0
store i32 5, i32* %t1
%t2 = load i32, i32* %t0
%t3 = load i32, i32* %t1
%t4 = mul i32 %t2, %t3
ret i32 %t4
}

@ -0,0 +1,16 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @main() {
entry:
ret i32 25
}

@ -0,0 +1,25 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @main() {
entry:
%t0 = alloca i32
store i32 0, i32* %t0
%t1 = alloca i32
store i32 0, i32* %t1
store i32 10, i32* %t0
store i32 5, i32* %t1
%t2 = load i32, i32* %t0
%t3 = load i32, i32* %t1
%t4 = sdiv i32 %t2, %t3
ret i32 %t4
}

@ -0,0 +1,16 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @main() {
entry:
ret i32 2
}

@ -0,0 +1,21 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @main() {
entry:
%t0 = alloca i32
store i32 0, i32* %t0
store i32 10, i32* %t0
%t1 = load i32, i32* %t0
%t2 = sdiv i32 %t1, 3
ret i32 %t2
}

@ -0,0 +1,21 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @main() {
entry:
%t0 = alloca i32
store i32 0, i32* %t0
store i32 10, i32* %t0
%t1 = load i32, i32* %t0
%t2 = srem i32 %t1, 3
ret i32 %t2
}

@ -0,0 +1,79 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @ifElseIf() {
entry:
%t0 = alloca i32
store i32 0, i32* %t0
store i32 5, i32* %t0
%t1 = alloca i32
store i32 0, i32* %t1
store i32 10, i32* %t1
%t2 = load i32, i32* %t0
%t3 = icmp eq i32 %t2, 6
%t4 = icmp ne i32 %t3, 0
br i1 %t4, label %if.then.1, label %lor.rhs.4
if.then.1:
%t8 = load i32, i32* %t0
ret i32 %t8
if.end.2:
%t25 = load i32, i32* %t0
ret i32 %t25
if.else.3:
%t9 = load i32, i32* %t1
%t10 = icmp eq i32 %t9, 10
%t11 = icmp ne i32 %t10, 0
br i1 %t11, label %land.rhs.8, label %if.else.7
lor.rhs.4:
%t5 = load i32, i32* %t1
%t6 = icmp eq i32 %t5, 11
%t7 = icmp ne i32 %t6, 0
br i1 %t7, label %if.then.1, label %if.else.3
if.then.5:
store i32 25, i32* %t0
br label %if.end.6
if.end.6:
br label %if.end.2
if.else.7:
%t15 = load i32, i32* %t1
%t16 = icmp eq i32 %t15, 10
%t17 = icmp ne i32 %t16, 0
br i1 %t17, label %land.rhs.12, label %if.else.11
land.rhs.8:
%t12 = load i32, i32* %t0
%t13 = icmp eq i32 %t12, 1
%t14 = icmp ne i32 %t13, 0
br i1 %t14, label %if.then.5, label %if.else.7
if.then.9:
%t21 = load i32, i32* %t0
%t22 = add i32 %t21, 15
store i32 %t22, i32* %t0
br label %if.end.10
if.end.10:
br label %if.end.6
if.else.11:
%t23 = load i32, i32* %t0
%t24 = sub i32 0, %t23
store i32 %t24, i32* %t0
br label %if.end.10
land.rhs.12:
%t18 = load i32, i32* %t0
%t19 = icmp eq i32 %t18, -5
%t20 = icmp ne i32 %t19, 0
br i1 %t20, label %if.then.9, label %if.else.11
}
define i32 @main() {
entry:
%t26 = call i32 @ifElseIf()
call void @putint(i32 %t26)
ret i32 0
}

@ -0,0 +1,48 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @ififElse() {
entry:
%t0 = alloca i32
store i32 0, i32* %t0
store i32 5, i32* %t0
%t1 = alloca i32
store i32 0, i32* %t1
store i32 10, i32* %t1
%t2 = load i32, i32* %t0
%t3 = icmp eq i32 %t2, 5
%t4 = icmp ne i32 %t3, 0
br i1 %t4, label %if.then.1, label %if.end.2
if.then.1:
%t5 = load i32, i32* %t1
%t6 = icmp eq i32 %t5, 10
%t7 = icmp ne i32 %t6, 0
br i1 %t7, label %if.then.3, label %if.else.5
if.end.2:
%t10 = load i32, i32* %t0
ret i32 %t10
if.then.3:
store i32 25, i32* %t0
br label %if.end.4
if.end.4:
br label %if.end.2
if.else.5:
%t8 = load i32, i32* %t0
%t9 = add i32 %t8, 15
store i32 %t9, i32* %t0
br label %if.end.4
}
define i32 @main() {
entry:
%t11 = call i32 @ififElse()
ret i32 %t11
}

@ -0,0 +1,48 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @if_ifElse_() {
entry:
%t0 = alloca i32
store i32 0, i32* %t0
store i32 5, i32* %t0
%t1 = alloca i32
store i32 0, i32* %t1
store i32 10, i32* %t1
%t2 = load i32, i32* %t0
%t3 = icmp eq i32 %t2, 5
%t4 = icmp ne i32 %t3, 0
br i1 %t4, label %if.then.1, label %if.end.2
if.then.1:
%t5 = load i32, i32* %t1
%t6 = icmp eq i32 %t5, 10
%t7 = icmp ne i32 %t6, 0
br i1 %t7, label %if.then.3, label %if.else.5
if.end.2:
%t10 = load i32, i32* %t0
ret i32 %t10
if.then.3:
store i32 25, i32* %t0
br label %if.end.4
if.end.4:
br label %if.end.2
if.else.5:
%t8 = load i32, i32* %t0
%t9 = add i32 %t8, 15
store i32 %t9, i32* %t0
br label %if.end.4
}
define i32 @main() {
entry:
%t11 = call i32 @if_ifElse_()
ret i32 %t11
}

@ -0,0 +1,48 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @if_if_Else() {
entry:
%t0 = alloca i32
store i32 0, i32* %t0
store i32 5, i32* %t0
%t1 = alloca i32
store i32 0, i32* %t1
store i32 10, i32* %t1
%t2 = load i32, i32* %t0
%t3 = icmp eq i32 %t2, 5
%t4 = icmp ne i32 %t3, 0
br i1 %t4, label %if.then.1, label %if.else.3
if.then.1:
%t5 = load i32, i32* %t1
%t6 = icmp eq i32 %t5, 10
%t7 = icmp ne i32 %t6, 0
br i1 %t7, label %if.then.4, label %if.end.5
if.end.2:
%t10 = load i32, i32* %t0
ret i32 %t10
if.else.3:
%t8 = load i32, i32* %t0
%t9 = add i32 %t8, 15
store i32 %t9, i32* %t0
br label %if.end.2
if.then.4:
store i32 25, i32* %t0
br label %if.end.5
if.end.5:
br label %if.end.2
}
define i32 @main() {
entry:
%t11 = call i32 @if_if_Else()
ret i32 %t11
}

@ -0,0 +1,91 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @get_one(i32 %arg.a) {
entry:
%t0 = alloca i32
store i32 %arg.a, i32* %t0
ret i32 1
}
define i32 @deepWhileBr(i32 %arg.a, i32 %arg.b) {
entry:
%t1 = alloca i32
store i32 %arg.a, i32* %t1
%t2 = alloca i32
store i32 %arg.b, i32* %t2
%t3 = alloca i32
store i32 0, i32* %t3
%t4 = load i32, i32* %t1
%t5 = load i32, i32* %t2
%t6 = add i32 %t4, %t5
store i32 %t6, i32* %t3
br label %while.cond.1
while.cond.1:
%t7 = load i32, i32* %t3
%t8 = icmp slt i32 %t7, 75
%t9 = icmp ne i32 %t8, 0
br i1 %t9, label %while.body.2, label %while.end.3
while.body.2:
%t10 = alloca i32
store i32 0, i32* %t10
store i32 42, i32* %t10
%t11 = load i32, i32* %t3
%t12 = icmp slt i32 %t11, 100
%t13 = icmp ne i32 %t12, 0
br i1 %t13, label %if.then.4, label %if.end.5
while.end.3:
%t28 = load i32, i32* %t3
ret i32 %t28
if.then.4:
%t14 = load i32, i32* %t3
%t15 = load i32, i32* %t10
%t16 = add i32 %t14, %t15
store i32 %t16, i32* %t3
%t17 = load i32, i32* %t3
%t18 = icmp sgt i32 %t17, 99
%t19 = icmp ne i32 %t18, 0
br i1 %t19, label %if.then.6, label %if.end.7
if.end.5:
br label %while.cond.1
if.then.6:
%t20 = alloca i32
store i32 0, i32* %t20
%t21 = load i32, i32* %t10
%t22 = mul i32 %t21, 2
store i32 %t22, i32* %t20
%t23 = call i32 @get_one(i32 0)
%t24 = icmp eq i32 %t23, 1
%t25 = icmp ne i32 %t24, 0
br i1 %t25, label %if.then.8, label %if.end.9
if.end.7:
br label %if.end.5
if.then.8:
%t26 = load i32, i32* %t20
%t27 = mul i32 %t26, 2
store i32 %t27, i32* %t3
br label %if.end.9
if.end.9:
br label %if.end.7
}
define i32 @main() {
entry:
%t29 = alloca i32
store i32 0, i32* %t29
store i32 2, i32* %t29
%t30 = load i32, i32* %t29
%t31 = load i32, i32* %t29
%t32 = call i32 @deepWhileBr(i32 %t30, i32 %t31)
store i32 %t32, i32* %t29
%t33 = load i32, i32* %t29
call void @putint(i32 %t33)
ret i32 0
}

@ -0,0 +1,55 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @doubleWhile() {
entry:
%t0 = alloca i32
store i32 0, i32* %t0
store i32 5, i32* %t0
%t1 = alloca i32
store i32 0, i32* %t1
store i32 7, i32* %t1
br label %while.cond.1
while.cond.1:
%t2 = load i32, i32* %t0
%t3 = icmp slt i32 %t2, 100
%t4 = icmp ne i32 %t3, 0
br i1 %t4, label %while.body.2, label %while.end.3
while.body.2:
%t5 = load i32, i32* %t0
%t6 = add i32 %t5, 30
store i32 %t6, i32* %t0
br label %while.cond.4
while.end.3:
%t14 = load i32, i32* %t1
ret i32 %t14
while.cond.4:
%t7 = load i32, i32* %t1
%t8 = icmp slt i32 %t7, 100
%t9 = icmp ne i32 %t8, 0
br i1 %t9, label %while.body.5, label %while.end.6
while.body.5:
%t10 = load i32, i32* %t1
%t11 = add i32 %t10, 6
store i32 %t11, i32* %t1
br label %while.cond.4
while.end.6:
%t12 = load i32, i32* %t1
%t13 = sub i32 %t12, 100
store i32 %t13, i32* %t1
br label %while.cond.1
}
define i32 @main() {
entry:
%t15 = call i32 @doubleWhile()
ret i32 %t15
}

@ -0,0 +1,97 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @FourWhile() {
entry:
%t0 = alloca i32
store i32 0, i32* %t0
store i32 5, i32* %t0
%t1 = alloca i32
store i32 0, i32* %t1
%t2 = alloca i32
store i32 0, i32* %t2
store i32 6, i32* %t1
store i32 7, i32* %t2
%t3 = alloca i32
store i32 0, i32* %t3
store i32 10, i32* %t3
br label %while.cond.1
while.cond.1:
%t4 = load i32, i32* %t0
%t5 = icmp slt i32 %t4, 20
%t6 = icmp ne i32 %t5, 0
br i1 %t6, label %while.body.2, label %while.end.3
while.body.2:
%t7 = load i32, i32* %t0
%t8 = add i32 %t7, 3
store i32 %t8, i32* %t0
br label %while.cond.4
while.end.3:
%t30 = load i32, i32* %t0
%t31 = load i32, i32* %t1
%t32 = load i32, i32* %t3
%t33 = add i32 %t31, %t32
%t34 = add i32 %t30, %t33
%t35 = load i32, i32* %t2
%t36 = add i32 %t34, %t35
ret i32 %t36
while.cond.4:
%t9 = load i32, i32* %t1
%t10 = icmp slt i32 %t9, 10
%t11 = icmp ne i32 %t10, 0
br i1 %t11, label %while.body.5, label %while.end.6
while.body.5:
%t12 = load i32, i32* %t1
%t13 = add i32 %t12, 1
store i32 %t13, i32* %t1
br label %while.cond.7
while.end.6:
%t28 = load i32, i32* %t1
%t29 = sub i32 %t28, 2
store i32 %t29, i32* %t1
br label %while.cond.1
while.cond.7:
%t14 = load i32, i32* %t2
%t15 = icmp eq i32 %t14, 7
%t16 = icmp ne i32 %t15, 0
br i1 %t16, label %while.body.8, label %while.end.9
while.body.8:
%t17 = load i32, i32* %t2
%t18 = sub i32 %t17, 1
store i32 %t18, i32* %t2
br label %while.cond.10
while.end.9:
%t26 = load i32, i32* %t2
%t27 = add i32 %t26, 1
store i32 %t27, i32* %t2
br label %while.cond.4
while.cond.10:
%t19 = load i32, i32* %t3
%t20 = icmp slt i32 %t19, 20
%t21 = icmp ne i32 %t20, 0
br i1 %t21, label %while.body.11, label %while.end.12
while.body.11:
%t22 = load i32, i32* %t3
%t23 = add i32 %t22, 3
store i32 %t23, i32* %t3
br label %while.cond.10
while.end.12:
%t24 = load i32, i32* %t3
%t25 = sub i32 %t24, 1
store i32 %t25, i32* %t3
br label %while.cond.7
}
define i32 @main() {
entry:
%t37 = call i32 @FourWhile()
ret i32 %t37
}

@ -0,0 +1,174 @@
@g = global i32 0
@h = global i32 0
@f = global i32 0
@e = global i32 0
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @EightWhile() {
entry:
%t0 = alloca i32
store i32 0, i32* %t0
store i32 5, i32* %t0
%t1 = alloca i32
store i32 0, i32* %t1
%t2 = alloca i32
store i32 0, i32* %t2
store i32 6, i32* %t1
store i32 7, i32* %t2
%t3 = alloca i32
store i32 0, i32* %t3
store i32 10, i32* %t3
br label %while.cond.1
while.cond.1:
%t4 = load i32, i32* %t0
%t5 = icmp slt i32 %t4, 20
%t6 = icmp ne i32 %t5, 0
br i1 %t6, label %while.body.2, label %while.end.3
while.body.2:
%t7 = load i32, i32* %t0
%t8 = add i32 %t7, 3
store i32 %t8, i32* %t0
br label %while.cond.4
while.end.3:
%t58 = load i32, i32* %t0
%t59 = load i32, i32* %t1
%t60 = load i32, i32* %t3
%t61 = add i32 %t59, %t60
%t62 = add i32 %t58, %t61
%t63 = load i32, i32* %t2
%t64 = add i32 %t62, %t63
%t65 = load i32, i32* @e
%t66 = load i32, i32* %t3
%t67 = add i32 %t65, %t66
%t68 = load i32, i32* @g
%t69 = sub i32 %t67, %t68
%t70 = load i32, i32* @h
%t71 = add i32 %t69, %t70
%t72 = sub i32 %t64, %t71
ret i32 %t72
while.cond.4:
%t9 = load i32, i32* %t1
%t10 = icmp slt i32 %t9, 10
%t11 = icmp ne i32 %t10, 0
br i1 %t11, label %while.body.5, label %while.end.6
while.body.5:
%t12 = load i32, i32* %t1
%t13 = add i32 %t12, 1
store i32 %t13, i32* %t1
br label %while.cond.7
while.end.6:
%t56 = load i32, i32* %t1
%t57 = sub i32 %t56, 2
store i32 %t57, i32* %t1
br label %while.cond.1
while.cond.7:
%t14 = load i32, i32* %t2
%t15 = icmp eq i32 %t14, 7
%t16 = icmp ne i32 %t15, 0
br i1 %t16, label %while.body.8, label %while.end.9
while.body.8:
%t17 = load i32, i32* %t2
%t18 = sub i32 %t17, 1
store i32 %t18, i32* %t2
br label %while.cond.10
while.end.9:
%t54 = load i32, i32* %t2
%t55 = add i32 %t54, 1
store i32 %t55, i32* %t2
br label %while.cond.4
while.cond.10:
%t19 = load i32, i32* %t3
%t20 = icmp slt i32 %t19, 20
%t21 = icmp ne i32 %t20, 0
br i1 %t21, label %while.body.11, label %while.end.12
while.body.11:
%t22 = load i32, i32* %t3
%t23 = add i32 %t22, 3
store i32 %t23, i32* %t3
br label %while.cond.13
while.end.12:
%t52 = load i32, i32* %t3
%t53 = sub i32 %t52, 1
store i32 %t53, i32* %t3
br label %while.cond.7
while.cond.13:
%t24 = load i32, i32* @e
%t25 = icmp sgt i32 %t24, 1
%t26 = icmp ne i32 %t25, 0
br i1 %t26, label %while.body.14, label %while.end.15
while.body.14:
%t27 = load i32, i32* @e
%t28 = sub i32 %t27, 1
store i32 %t28, i32* @e
br label %while.cond.16
while.end.15:
%t50 = load i32, i32* @e
%t51 = add i32 %t50, 1
store i32 %t51, i32* @e
br label %while.cond.10
while.cond.16:
%t29 = load i32, i32* @f
%t30 = icmp sgt i32 %t29, 2
%t31 = icmp ne i32 %t30, 0
br i1 %t31, label %while.body.17, label %while.end.18
while.body.17:
%t32 = load i32, i32* @f
%t33 = sub i32 %t32, 2
store i32 %t33, i32* @f
br label %while.cond.19
while.end.18:
%t48 = load i32, i32* @f
%t49 = add i32 %t48, 1
store i32 %t49, i32* @f
br label %while.cond.13
while.cond.19:
%t34 = load i32, i32* @g
%t35 = icmp slt i32 %t34, 3
%t36 = icmp ne i32 %t35, 0
br i1 %t36, label %while.body.20, label %while.end.21
while.body.20:
%t37 = load i32, i32* @g
%t38 = add i32 %t37, 10
store i32 %t38, i32* @g
br label %while.cond.22
while.end.21:
%t46 = load i32, i32* @g
%t47 = sub i32 %t46, 8
store i32 %t47, i32* @g
br label %while.cond.16
while.cond.22:
%t39 = load i32, i32* @h
%t40 = icmp slt i32 %t39, 10
%t41 = icmp ne i32 %t40, 0
br i1 %t41, label %while.body.23, label %while.end.24
while.body.23:
%t42 = load i32, i32* @h
%t43 = add i32 %t42, 8
store i32 %t43, i32* @h
br label %while.cond.22
while.end.24:
%t44 = load i32, i32* @h
%t45 = sub i32 %t44, 1
store i32 %t45, i32* @h
br label %while.cond.19
}
define i32 @main() {
entry:
store i32 1, i32* @g
store i32 2, i32* @h
store i32 4, i32* @e
store i32 6, i32* @f
%t73 = call i32 @EightWhile()
ret i32 %t73
}

@ -0,0 +1,46 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @main() {
entry:
%t0 = alloca i32
store i32 0, i32* %t0
store i32 0, i32* %t0
%t1 = alloca i32
store i32 0, i32* %t1
store i32 0, i32* %t1
br label %while.cond.1
while.cond.1:
%t2 = load i32, i32* %t0
%t3 = icmp slt i32 %t2, 100
%t4 = icmp ne i32 %t3, 0
br i1 %t4, label %while.body.2, label %while.end.3
while.body.2:
%t5 = load i32, i32* %t0
%t6 = icmp eq i32 %t5, 50
%t7 = icmp ne i32 %t6, 0
br i1 %t7, label %if.then.4, label %if.end.5
while.end.3:
%t13 = load i32, i32* %t1
ret i32 %t13
if.then.4:
br label %while.end.3
if.end.5:
%t8 = load i32, i32* %t1
%t9 = load i32, i32* %t0
%t10 = add i32 %t8, %t9
store i32 %t10, i32* %t1
%t11 = load i32, i32* %t0
%t12 = add i32 %t11, 1
store i32 %t12, i32* %t0
br label %while.cond.1
}

@ -0,0 +1,49 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @main() {
entry:
%t0 = alloca i32
store i32 0, i32* %t0
store i32 0, i32* %t0
%t1 = alloca i32
store i32 0, i32* %t1
store i32 0, i32* %t1
br label %while.cond.1
while.cond.1:
%t2 = load i32, i32* %t0
%t3 = icmp slt i32 %t2, 100
%t4 = icmp ne i32 %t3, 0
br i1 %t4, label %while.body.2, label %while.end.3
while.body.2:
%t5 = load i32, i32* %t0
%t6 = icmp eq i32 %t5, 50
%t7 = icmp ne i32 %t6, 0
br i1 %t7, label %if.then.4, label %if.end.5
while.end.3:
%t15 = load i32, i32* %t1
ret i32 %t15
if.then.4:
%t8 = load i32, i32* %t0
%t9 = add i32 %t8, 1
store i32 %t9, i32* %t0
br label %while.cond.1
if.end.5:
%t10 = load i32, i32* %t1
%t11 = load i32, i32* %t0
%t12 = add i32 %t10, %t11
store i32 %t12, i32* %t1
%t13 = load i32, i32* %t0
%t14 = add i32 %t13, 1
store i32 %t14, i32* %t0
br label %while.cond.1
}

@ -0,0 +1,63 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @whileIf() {
entry:
%t0 = alloca i32
store i32 0, i32* %t0
store i32 0, i32* %t0
%t1 = alloca i32
store i32 0, i32* %t1
store i32 0, i32* %t1
br label %while.cond.1
while.cond.1:
%t2 = load i32, i32* %t0
%t3 = icmp slt i32 %t2, 100
%t4 = icmp ne i32 %t3, 0
br i1 %t4, label %while.body.2, label %while.end.3
while.body.2:
%t5 = load i32, i32* %t0
%t6 = icmp eq i32 %t5, 5
%t7 = icmp ne i32 %t6, 0
br i1 %t7, label %if.then.4, label %if.else.6
while.end.3:
%t15 = load i32, i32* %t1
ret i32 %t15
if.then.4:
store i32 25, i32* %t1
br label %if.end.5
if.end.5:
%t13 = load i32, i32* %t0
%t14 = add i32 %t13, 1
store i32 %t14, i32* %t0
br label %while.cond.1
if.else.6:
%t8 = load i32, i32* %t0
%t9 = icmp eq i32 %t8, 10
%t10 = icmp ne i32 %t9, 0
br i1 %t10, label %if.then.7, label %if.else.9
if.then.7:
store i32 42, i32* %t1
br label %if.end.8
if.end.8:
br label %if.end.5
if.else.9:
%t11 = load i32, i32* %t0
%t12 = mul i32 %t11, 2
store i32 %t12, i32* %t1
br label %if.end.8
}
define i32 @main() {
entry:
%t16 = call i32 @whileIf()
ret i32 %t16
}

@ -0,0 +1,67 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @ifWhile() {
entry:
%t0 = alloca i32
store i32 0, i32* %t0
store i32 0, i32* %t0
%t1 = alloca i32
store i32 0, i32* %t1
store i32 3, i32* %t1
%t2 = load i32, i32* %t0
%t3 = icmp eq i32 %t2, 5
%t4 = icmp ne i32 %t3, 0
br i1 %t4, label %if.then.1, label %if.else.3
if.then.1:
br label %while.cond.4
if.end.2:
%t19 = load i32, i32* %t1
ret i32 %t19
if.else.3:
br label %while.cond.7
while.cond.4:
%t5 = load i32, i32* %t1
%t6 = icmp eq i32 %t5, 2
%t7 = icmp ne i32 %t6, 0
br i1 %t7, label %while.body.5, label %while.end.6
while.body.5:
%t8 = load i32, i32* %t1
%t9 = add i32 %t8, 2
store i32 %t9, i32* %t1
br label %while.cond.4
while.end.6:
%t10 = load i32, i32* %t1
%t11 = add i32 %t10, 25
store i32 %t11, i32* %t1
br label %if.end.2
while.cond.7:
%t12 = load i32, i32* %t0
%t13 = icmp slt i32 %t12, 5
%t14 = icmp ne i32 %t13, 0
br i1 %t14, label %while.body.8, label %while.end.9
while.body.8:
%t15 = load i32, i32* %t1
%t16 = mul i32 %t15, 2
store i32 %t16, i32* %t1
%t17 = load i32, i32* %t0
%t18 = add i32 %t17, 1
store i32 %t18, i32* %t0
br label %while.cond.7
while.end.9:
br label %if.end.2
}
define i32 @main() {
entry:
%t20 = call i32 @ifWhile()
ret i32 %t20
}

@ -0,0 +1,79 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @deepWhileBr(i32 %arg.a, i32 %arg.b) {
entry:
%t0 = alloca i32
store i32 %arg.a, i32* %t0
%t1 = alloca i32
store i32 %arg.b, i32* %t1
%t2 = alloca i32
store i32 0, i32* %t2
%t3 = load i32, i32* %t0
%t4 = load i32, i32* %t1
%t5 = add i32 %t3, %t4
store i32 %t5, i32* %t2
br label %while.cond.1
while.cond.1:
%t6 = load i32, i32* %t2
%t7 = icmp slt i32 %t6, 75
%t8 = icmp ne i32 %t7, 0
br i1 %t8, label %while.body.2, label %while.end.3
while.body.2:
%t9 = alloca i32
store i32 0, i32* %t9
store i32 42, i32* %t9
%t10 = load i32, i32* %t2
%t11 = icmp slt i32 %t10, 100
%t12 = icmp ne i32 %t11, 0
br i1 %t12, label %if.then.4, label %if.end.5
while.end.3:
%t24 = load i32, i32* %t2
ret i32 %t24
if.then.4:
%t13 = load i32, i32* %t2
%t14 = load i32, i32* %t9
%t15 = add i32 %t13, %t14
store i32 %t15, i32* %t2
%t16 = load i32, i32* %t2
%t17 = icmp sgt i32 %t16, 99
%t18 = icmp ne i32 %t17, 0
br i1 %t18, label %if.then.6, label %if.end.7
if.end.5:
br label %while.cond.1
if.then.6:
%t19 = alloca i32
store i32 0, i32* %t19
%t20 = load i32, i32* %t9
%t21 = mul i32 %t20, 2
store i32 %t21, i32* %t19
br i1 1, label %if.then.8, label %if.end.9
if.end.7:
br label %if.end.5
if.then.8:
%t22 = load i32, i32* %t19
%t23 = mul i32 %t22, 2
store i32 %t23, i32* %t2
br label %if.end.9
if.end.9:
br label %if.end.7
}
define i32 @main() {
entry:
%t25 = alloca i32
store i32 0, i32* %t25
store i32 2, i32* %t25
%t26 = load i32, i32* %t25
%t27 = load i32, i32* %t25
%t28 = call i32 @deepWhileBr(i32 %t26, i32 %t27)
ret i32 %t28
}

@ -0,0 +1,41 @@
@arr = global [6 x i32] zeroinitializer
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @main() {
entry:
%t0 = alloca i32
store i32 0, i32* %t0
%t1 = alloca i32
store i32 0, i32* %t1
br label %while.cond.1
while.cond.1:
%t2 = load i32, i32* %t0
%t3 = icmp slt i32 %t2, 6
%t4 = icmp ne i32 %t3, 0
br i1 %t4, label %while.body.2, label %while.end.3
while.body.2:
%t5 = load i32, i32* %t1
%t6 = load i32, i32* %t0
%t7 = getelementptr inbounds [6 x i32], [6 x i32]* @arr, i32 0, i32 %t6
%t8 = load i32, i32* %t7
%t9 = add i32 %t5, %t8
store i32 %t9, i32* %t1
%t10 = load i32, i32* %t0
%t11 = add i32 %t10, 1
store i32 %t11, i32* %t0
br label %while.cond.1
while.end.3:
%t12 = load i32, i32* %t1
ret i32 %t12
}

@ -0,0 +1,35 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @main() {
entry:
%t0 = alloca i32
store i32 0, i32* %t0
%t1 = alloca i32
store i32 0, i32* %t1
%t2 = alloca i32
store i32 0, i32* %t2
%t3 = alloca i32
store i32 0, i32* %t3
store i32 10, i32* %t0
store i32 4, i32* %t1
store i32 2, i32* %t2
store i32 2, i32* %t3
%t4 = load i32, i32* %t2
%t5 = load i32, i32* %t0
%t6 = load i32, i32* %t1
%t7 = mul i32 %t5, %t6
%t8 = add i32 %t4, %t7
%t9 = load i32, i32* %t3
%t10 = sub i32 %t8, %t9
ret i32 %t10
}

@ -0,0 +1,35 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @main() {
entry:
%t0 = alloca i32
store i32 0, i32* %t0
%t1 = alloca i32
store i32 0, i32* %t1
%t2 = alloca i32
store i32 0, i32* %t2
%t3 = alloca i32
store i32 0, i32* %t3
store i32 10, i32* %t0
store i32 4, i32* %t1
store i32 2, i32* %t2
store i32 2, i32* %t3
%t4 = load i32, i32* %t2
%t5 = load i32, i32* %t0
%t6 = add i32 %t4, %t5
%t7 = load i32, i32* %t1
%t8 = load i32, i32* %t3
%t9 = sub i32 %t7, %t8
%t10 = mul i32 %t6, %t9
ret i32 %t10
}

@ -0,0 +1,27 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @main() {
entry:
%t0 = alloca i32
store i32 0, i32* %t0
%t1 = alloca i32
store i32 0, i32* %t1
store i32 10, i32* %t0
store i32 30, i32* %t1
%t2 = load i32, i32* %t0
%t3 = sub i32 %t2, -5
%t4 = load i32, i32* %t1
%t5 = add i32 %t3, %t4
%t6 = add i32 %t5, -5
ret i32 %t6
}

@ -0,0 +1,76 @@
@a = global i32 0
@b = global i32 0
@c = global i32 0
@d = global i32 0
@e = global i32 0
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @main() {
entry:
%t0 = call i32 @getint()
store i32 %t0, i32* @a
%t1 = call i32 @getint()
store i32 %t1, i32* @b
%t2 = call i32 @getint()
store i32 %t2, i32* @c
%t3 = call i32 @getint()
store i32 %t3, i32* @d
%t4 = call i32 @getint()
store i32 %t4, i32* @e
%t5 = alloca i32
store i32 0, i32* %t5
%t6 = load i32, i32* @a
%t7 = load i32, i32* @b
%t8 = load i32, i32* @c
%t9 = mul i32 %t7, %t8
%t10 = sub i32 %t6, %t9
%t11 = load i32, i32* @d
%t12 = load i32, i32* @a
%t13 = load i32, i32* @c
%t14 = sdiv i32 %t12, %t13
%t15 = sub i32 %t11, %t14
%t16 = icmp ne i32 %t10, %t15
%t17 = icmp ne i32 %t16, 0
br i1 %t17, label %if.then.1, label %lor.rhs.4
if.then.1:
store i32 1, i32* %t5
br label %if.end.2
if.end.2:
%t38 = load i32, i32* %t5
ret i32 %t38
lor.rhs.3:
%t28 = load i32, i32* @a
%t29 = load i32, i32* @b
%t30 = add i32 %t28, %t29
%t31 = load i32, i32* @c
%t32 = add i32 %t30, %t31
%t33 = load i32, i32* @d
%t34 = load i32, i32* @e
%t35 = add i32 %t33, %t34
%t36 = icmp eq i32 %t32, %t35
%t37 = icmp ne i32 %t36, 0
br i1 %t37, label %if.then.1, label %if.end.2
lor.rhs.4:
%t18 = load i32, i32* @a
%t19 = load i32, i32* @b
%t20 = mul i32 %t18, %t19
%t21 = load i32, i32* @c
%t22 = sdiv i32 %t20, %t21
%t23 = load i32, i32* @e
%t24 = load i32, i32* @d
%t25 = add i32 %t23, %t24
%t26 = icmp eq i32 %t22, %t25
%t27 = icmp ne i32 %t26, 0
br i1 %t27, label %if.then.1, label %lor.rhs.3
}

@ -0,0 +1,70 @@
@a = global i32 1
@b = global i32 0
@c = global i32 1
@d = global i32 2
@e = global i32 4
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @main() {
entry:
%t0 = alloca i32
store i32 0, i32* %t0
%t1 = load i32, i32* @a
%t2 = load i32, i32* @b
%t3 = mul i32 %t1, %t2
%t4 = load i32, i32* @c
%t5 = sdiv i32 %t3, %t4
%t6 = load i32, i32* @e
%t7 = load i32, i32* @d
%t8 = add i32 %t6, %t7
%t9 = icmp eq i32 %t5, %t8
%t10 = icmp ne i32 %t9, 0
br i1 %t10, label %land.rhs.4, label %lor.rhs.3
if.then.1:
store i32 1, i32* %t0
br label %if.end.2
if.end.2:
%t35 = load i32, i32* %t0
call void @putint(i32 %t35)
%t37 = load i32, i32* %t0
ret i32 %t37
lor.rhs.3:
%t23 = load i32, i32* @a
%t24 = load i32, i32* @b
%t25 = load i32, i32* @c
%t26 = mul i32 %t24, %t25
%t27 = sub i32 %t23, %t26
%t28 = load i32, i32* @d
%t29 = load i32, i32* @a
%t30 = load i32, i32* @c
%t31 = sdiv i32 %t29, %t30
%t32 = sub i32 %t28, %t31
%t33 = icmp eq i32 %t27, %t32
%t34 = icmp ne i32 %t33, 0
br i1 %t34, label %if.then.1, label %if.end.2
land.rhs.4:
%t11 = load i32, i32* @a
%t12 = load i32, i32* @a
%t13 = load i32, i32* @b
%t14 = add i32 %t12, %t13
%t15 = mul i32 %t11, %t14
%t16 = load i32, i32* @c
%t17 = add i32 %t15, %t16
%t18 = load i32, i32* @d
%t19 = load i32, i32* @e
%t20 = add i32 %t18, %t19
%t21 = icmp sle i32 %t17, %t20
%t22 = icmp ne i32 %t21, 0
br i1 %t22, label %if.then.1, label %lor.rhs.3
}

@ -0,0 +1,34 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @main() {
entry:
%t0 = alloca i32
store i32 0, i32* %t0
store i32 10, i32* %t0
%t1 = load i32, i32* %t0
%t2 = icmp eq i32 %t1, 0
%t3 = icmp eq i32 %t2, 0
%t4 = icmp eq i32 %t3, 0
%t5 = sub i32 0, %t4
%t6 = icmp ne i32 %t5, 0
br i1 %t6, label %if.then.1, label %if.else.3
if.then.1:
store i32 -1, i32* %t0
br label %if.end.2
if.end.2:
%t7 = load i32, i32* %t0
ret i32 %t7
if.else.3:
store i32 0, i32* %t0
br label %if.end.2
}

@ -0,0 +1,44 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @main() {
entry:
%t0 = alloca i32
store i32 0, i32* %t0
%t1 = alloca i32
store i32 0, i32* %t1
store i32 56, i32* %t0
store i32 4, i32* %t1
%t2 = load i32, i32* %t0
%t3 = sub i32 %t2, -4
%t4 = load i32, i32* %t1
%t5 = add i32 %t3, %t4
store i32 %t5, i32* %t0
%t6 = load i32, i32* %t0
%t7 = icmp eq i32 %t6, 0
%t8 = icmp eq i32 %t7, 0
%t9 = icmp eq i32 %t8, 0
%t10 = sub i32 0, %t9
%t11 = icmp ne i32 %t10, 0
br i1 %t11, label %if.then.1, label %if.else.3
if.then.1:
store i32 -1, i32* %t0
br label %if.end.2
if.end.2:
%t13 = load i32, i32* %t0
call void @putint(i32 %t13)
ret i32 0
if.else.3:
%t12 = load i32, i32* %t1
store i32 %t12, i32* %t0
br label %if.end.2
}

@ -0,0 +1,21 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @main() {
entry:
%t0 = alloca i32
store i32 10, i32* %t0
%t1 = load i32, i32* %t0
%t2 = mul i32 %t1, 2
%t3 = add i32 %t2, 1
ret i32 %t3
}

@ -0,0 +1,43 @@
@a = global i32 0
@b = global i32 0
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @main() {
entry:
%t0 = call i32 @getint()
store i32 %t0, i32* @a
%t1 = call i32 @getint()
store i32 %t1, i32* @b
%t2 = alloca i32
store i32 0, i32* %t2
%t3 = load i32, i32* @a
%t4 = load i32, i32* @b
%t5 = icmp eq i32 %t3, %t4
%t6 = icmp ne i32 %t5, 0
br i1 %t6, label %land.rhs.4, label %if.else.3
if.then.1:
store i32 1, i32* %t2
br label %if.end.2
if.end.2:
%t10 = load i32, i32* %t2
ret i32 %t10
if.else.3:
store i32 0, i32* %t2
br label %if.end.2
land.rhs.4:
%t7 = load i32, i32* @a
%t8 = icmp ne i32 %t7, 3
%t9 = icmp ne i32 %t8, 0
br i1 %t9, label %if.then.1, label %if.else.3
}

@ -0,0 +1,42 @@
@k = global i32 0
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @main() {
entry:
%t0 = alloca i32
store i32 0, i32* %t0
store i32 1, i32* @k
br label %while.cond.1
while.cond.1:
%t1 = load i32, i32* %t0
%t2 = icmp sle i32 %t1, 9
%t3 = icmp ne i32 %t2, 0
br i1 %t3, label %while.body.2, label %while.end.3
while.body.2:
%t4 = load i32, i32* %t0
%t5 = add i32 %t4, 1
store i32 %t5, i32* %t0
%t6 = load i32, i32* @k
%t7 = add i32 %t6, 1
%t8 = load i32, i32* @k
%t9 = load i32, i32* @k
%t10 = add i32 %t8, %t9
store i32 %t10, i32* @k
br label %while.cond.1
while.end.3:
%t11 = load i32, i32* @k
call void @putint(i32 %t11)
%t13 = load i32, i32* @k
ret i32 %t13
}

@ -0,0 +1,20 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @main() {
entry:
%t0 = alloca i32
store i32 0, i32* %t0
store i32 5, i32* %t0
%t1 = load i32, i32* %t0
ret i32 %t1
}

@ -0,0 +1,20 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @main() {
entry:
%t0 = alloca i32
store i32 0, i32* %t0
store i32 15, i32* %t0
%t1 = load i32, i32* %t0
ret i32 %t1
}

@ -0,0 +1,26 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @main() {
entry:
%t0 = alloca i32
store i32 0, i32* %t0
%t1 = alloca i32
store i32 0, i32* %t1
store i32 15, i32* %t0
store i32 12, i32* %t1
%t2 = load i32, i32* %t0
%t3 = load i32, i32* %t1
%t4 = add i32 %t2, %t3
%t5 = add i32 %t4, 61
ret i32 %t5
}

@ -0,0 +1,63 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @main() {
entry:
%t0 = alloca i32
store i32 0, i32* %t0
%t1 = alloca i32
store i32 0, i32* %t1
%t2 = alloca i32
store i32 0, i32* %t2
%t3 = alloca i32
store i32 0, i32* %t3
%t4 = alloca i32
store i32 0, i32* %t4
store i32 5, i32* %t0
store i32 5, i32* %t1
store i32 1, i32* %t2
store i32 -2, i32* %t3
%t5 = load i32, i32* %t3
%t6 = sdiv i32 %t5, 2
%t7 = load i32, i32* %t0
%t8 = load i32, i32* %t1
%t9 = sub i32 %t7, %t8
%t10 = add i32 %t6, %t9
%t11 = load i32, i32* %t2
%t12 = add i32 %t11, 3
%t13 = sub i32 0, %t12
%t14 = srem i32 %t13, 2
%t15 = sub i32 %t10, %t14
store i32 %t15, i32* %t4
%t16 = load i32, i32* %t4
call void @putint(i32 %t16)
%t18 = load i32, i32* %t3
%t19 = srem i32 %t18, 2
%t20 = add i32 %t19, 67
%t21 = load i32, i32* %t0
%t22 = load i32, i32* %t1
%t23 = sub i32 %t21, %t22
%t24 = sub i32 0, %t23
%t25 = add i32 %t20, %t24
%t26 = load i32, i32* %t2
%t27 = add i32 %t26, 2
%t28 = srem i32 %t27, 2
%t29 = sub i32 0, %t28
%t30 = sub i32 %t25, %t29
store i32 %t30, i32* %t4
%t31 = load i32, i32* %t4
%t32 = add i32 %t31, 3
store i32 %t32, i32* %t4
%t33 = load i32, i32* %t4
call void @putint(i32 %t33)
ret i32 0
}

@ -0,0 +1,81 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @main() {
entry:
%t0 = alloca i32
store i32 0, i32* %t0
%t1 = alloca i32
store i32 0, i32* %t1
%t2 = alloca i32
store i32 0, i32* %t2
%t3 = alloca i32
store i32 0, i32* %t3
%t4 = alloca i32
store i32 0, i32* %t4
store i32 5, i32* %t0
store i32 5, i32* %t1
store i32 1, i32* %t2
store i32 -2, i32* %t3
store i32 2, i32* %t4
%t5 = load i32, i32* %t3
%t6 = sdiv i32 %t5, 2
%t7 = icmp slt i32 %t6, 0
%t8 = icmp ne i32 %t7, 0
br i1 %t8, label %if.then.1, label %lor.rhs.3
if.then.1:
%t19 = load i32, i32* %t4
call void @putint(i32 %t19)
br label %if.end.2
if.end.2:
%t21 = load i32, i32* %t3
%t22 = srem i32 %t21, 2
%t23 = add i32 %t22, 67
%t24 = icmp slt i32 %t23, 0
%t25 = icmp ne i32 %t24, 0
br i1 %t25, label %if.then.5, label %lor.rhs.7
lor.rhs.3:
%t9 = load i32, i32* %t0
%t10 = load i32, i32* %t1
%t11 = sub i32 %t9, %t10
%t12 = icmp ne i32 %t11, 0
%t13 = icmp ne i32 %t12, 0
br i1 %t13, label %land.rhs.4, label %if.end.2
land.rhs.4:
%t14 = load i32, i32* %t2
%t15 = add i32 %t14, 3
%t16 = srem i32 %t15, 2
%t17 = icmp ne i32 %t16, 0
%t18 = icmp ne i32 %t17, 0
br i1 %t18, label %if.then.1, label %if.end.2
if.then.5:
store i32 4, i32* %t4
%t36 = load i32, i32* %t4
call void @putint(i32 %t36)
br label %if.end.6
if.end.6:
ret i32 0
lor.rhs.7:
%t26 = load i32, i32* %t0
%t27 = load i32, i32* %t1
%t28 = sub i32 %t26, %t27
%t29 = icmp ne i32 %t28, 0
%t30 = icmp ne i32 %t29, 0
br i1 %t30, label %land.rhs.8, label %if.end.6
land.rhs.8:
%t31 = load i32, i32* %t2
%t32 = add i32 %t31, 2
%t33 = srem i32 %t32, 2
%t34 = icmp ne i32 %t33, 0
%t35 = icmp ne i32 %t34, 0
br i1 %t35, label %if.then.5, label %if.end.6
}

@ -0,0 +1,120 @@
@g = global i32 0
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @func(i32 %arg.n) {
entry:
%t0 = alloca i32
store i32 %arg.n, i32* %t0
%t1 = load i32, i32* @g
%t2 = load i32, i32* %t0
%t3 = add i32 %t1, %t2
store i32 %t3, i32* @g
%t4 = load i32, i32* @g
call void @putint(i32 %t4)
%t6 = load i32, i32* @g
ret i32 %t6
}
define i32 @main() {
entry:
%t7 = alloca i32
store i32 0, i32* %t7
%t8 = call i32 @getint()
store i32 %t8, i32* %t7
%t9 = load i32, i32* %t7
%t10 = icmp sgt i32 %t9, 10
%t11 = icmp ne i32 %t10, 0
br i1 %t11, label %land.rhs.4, label %if.else.3
if.then.1:
store i32 1, i32* %t7
br label %if.end.2
if.end.2:
%t15 = call i32 @getint()
store i32 %t15, i32* %t7
%t16 = load i32, i32* %t7
%t17 = icmp sgt i32 %t16, 11
%t18 = icmp ne i32 %t17, 0
br i1 %t18, label %land.rhs.8, label %if.else.7
if.else.3:
store i32 0, i32* %t7
br label %if.end.2
land.rhs.4:
%t12 = load i32, i32* %t7
%t13 = call i32 @func(i32 %t12)
%t14 = icmp ne i32 %t13, 0
br i1 %t14, label %if.then.1, label %if.else.3
if.then.5:
store i32 1, i32* %t7
br label %if.end.6
if.end.6:
%t22 = call i32 @getint()
store i32 %t22, i32* %t7
%t23 = load i32, i32* %t7
%t24 = icmp sle i32 %t23, 99
%t25 = icmp ne i32 %t24, 0
br i1 %t25, label %if.then.9, label %lor.rhs.12
if.else.7:
store i32 0, i32* %t7
br label %if.end.6
land.rhs.8:
%t19 = load i32, i32* %t7
%t20 = call i32 @func(i32 %t19)
%t21 = icmp ne i32 %t20, 0
br i1 %t21, label %if.then.5, label %if.else.7
if.then.9:
store i32 1, i32* %t7
br label %if.end.10
if.end.10:
%t29 = call i32 @getint()
store i32 %t29, i32* %t7
%t30 = load i32, i32* %t7
%t31 = icmp sle i32 %t30, 100
%t32 = icmp ne i32 %t31, 0
br i1 %t32, label %if.then.13, label %lor.rhs.16
if.else.11:
store i32 0, i32* %t7
br label %if.end.10
lor.rhs.12:
%t26 = load i32, i32* %t7
%t27 = call i32 @func(i32 %t26)
%t28 = icmp ne i32 %t27, 0
br i1 %t28, label %if.then.9, label %if.else.11
if.then.13:
store i32 1, i32* %t7
br label %if.end.14
if.end.14:
%t36 = call i32 @func(i32 99)
%t37 = icmp eq i32 %t36, 0
%t38 = icmp ne i32 %t37, 0
br i1 %t38, label %land.rhs.20, label %if.else.19
if.else.15:
store i32 0, i32* %t7
br label %if.end.14
lor.rhs.16:
%t33 = load i32, i32* %t7
%t34 = call i32 @func(i32 %t33)
%t35 = icmp ne i32 %t34, 0
br i1 %t35, label %if.then.13, label %if.else.15
if.then.17:
store i32 1, i32* %t7
br label %if.end.18
if.end.18:
ret i32 0
if.else.19:
store i32 0, i32* %t7
br label %if.end.18
land.rhs.20:
%t39 = call i32 @func(i32 100)
%t40 = icmp ne i32 %t39, 0
br i1 %t40, label %if.then.17, label %if.else.19
}

@ -0,0 +1,246 @@
@a = global i32 0
@b = global i32 0
@d = global i32 0
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @set_a(i32 %arg.val) {
entry:
%t0 = alloca i32
store i32 %arg.val, i32* %t0
%t1 = load i32, i32* %t0
store i32 %t1, i32* @a
%t2 = load i32, i32* @a
ret i32 %t2
}
define i32 @set_b(i32 %arg.val) {
entry:
%t3 = alloca i32
store i32 %arg.val, i32* %t3
%t4 = load i32, i32* %t3
store i32 %t4, i32* @b
%t5 = load i32, i32* @b
ret i32 %t5
}
define i32 @set_d(i32 %arg.val) {
entry:
%t6 = alloca i32
store i32 %arg.val, i32* %t6
%t7 = load i32, i32* %t6
store i32 %t7, i32* @d
%t8 = load i32, i32* @d
ret i32 %t8
}
define i32 @main() {
entry:
store i32 2, i32* @a
store i32 3, i32* @b
%t9 = call i32 @set_a(i32 0)
%t10 = icmp ne i32 %t9, 0
br i1 %t10, label %land.rhs.3, label %if.end.2
if.then.1:
br label %if.end.2
if.end.2:
%t13 = load i32, i32* @a
call void @putint(i32 %t13)
call void @putch(i32 32)
%t16 = load i32, i32* @b
call void @putint(i32 %t16)
call void @putch(i32 32)
store i32 2, i32* @a
store i32 3, i32* @b
%t19 = call i32 @set_a(i32 0)
%t20 = icmp ne i32 %t19, 0
br i1 %t20, label %land.rhs.6, label %if.end.5
land.rhs.3:
%t11 = call i32 @set_b(i32 1)
%t12 = icmp ne i32 %t11, 0
br i1 %t12, label %if.then.1, label %if.end.2
if.then.4:
br label %if.end.5
if.end.5:
%t23 = load i32, i32* @a
call void @putint(i32 %t23)
call void @putch(i32 32)
%t26 = load i32, i32* @b
call void @putint(i32 %t26)
call void @putch(i32 10)
store i32 2, i32* @d
br i1 1, label %land.rhs.9, label %if.end.8
land.rhs.6:
%t21 = call i32 @set_b(i32 1)
%t22 = icmp ne i32 %t21, 0
br i1 %t22, label %if.then.4, label %if.end.5
if.then.7:
br label %if.end.8
if.end.8:
%t31 = load i32, i32* @d
call void @putint(i32 %t31)
call void @putch(i32 32)
br i1 1, label %if.then.10, label %lor.rhs.12
land.rhs.9:
%t29 = call i32 @set_d(i32 3)
%t30 = icmp ne i32 %t29, 0
br i1 %t30, label %if.then.7, label %if.end.8
if.then.10:
br label %if.end.11
if.end.11:
%t36 = load i32, i32* @d
call void @putint(i32 %t36)
call void @putch(i32 10)
br i1 1, label %if.then.13, label %if.end.14
lor.rhs.12:
%t34 = call i32 @set_d(i32 4)
%t35 = icmp ne i32 %t34, 0
br i1 %t35, label %if.then.10, label %if.end.11
if.then.13:
call void @putch(i32 65)
br label %if.end.14
if.end.14:
br i1 0, label %if.then.15, label %if.end.16
if.then.15:
call void @putch(i32 66)
br label %if.end.16
if.end.16:
br i1 0, label %if.then.17, label %if.end.18
if.then.17:
call void @putch(i32 67)
br label %if.end.18
if.end.18:
br i1 1, label %if.then.19, label %if.end.20
if.then.19:
call void @putch(i32 68)
br label %if.end.20
if.end.20:
br i1 0, label %if.then.21, label %if.end.22
if.then.21:
call void @putch(i32 69)
br label %if.end.22
if.end.22:
br i1 1, label %if.then.23, label %if.end.24
if.then.23:
call void @putch(i32 70)
br label %if.end.24
if.end.24:
call void @putch(i32 10)
%t46 = alloca i32
store i32 0, i32* %t46
%t47 = alloca i32
store i32 1, i32* %t47
%t48 = alloca i32
store i32 2, i32* %t48
%t49 = alloca i32
store i32 3, i32* %t49
%t50 = alloca i32
store i32 4, i32* %t50
br label %while.cond.25
while.cond.25:
%t51 = load i32, i32* %t46
%t52 = icmp ne i32 %t51, 0
br i1 %t52, label %land.rhs.28, label %while.end.27
while.body.26:
call void @putch(i32 32)
br label %while.cond.25
while.end.27:
%t56 = load i32, i32* %t46
%t57 = icmp ne i32 %t56, 0
br i1 %t57, label %if.then.29, label %lor.rhs.31
land.rhs.28:
%t53 = load i32, i32* %t47
%t54 = icmp ne i32 %t53, 0
br i1 %t54, label %while.body.26, label %while.end.27
if.then.29:
call void @putch(i32 67)
br label %if.end.30
if.end.30:
%t61 = load i32, i32* %t46
%t62 = load i32, i32* %t47
%t63 = icmp sge i32 %t61, %t62
%t64 = icmp ne i32 %t63, 0
br i1 %t64, label %if.then.32, label %lor.rhs.34
lor.rhs.31:
%t58 = load i32, i32* %t47
%t59 = icmp ne i32 %t58, 0
br i1 %t59, label %if.then.29, label %if.end.30
if.then.32:
call void @putch(i32 72)
br label %if.end.33
if.end.33:
%t70 = load i32, i32* %t48
%t71 = load i32, i32* %t47
%t72 = icmp sge i32 %t70, %t71
%t73 = icmp ne i32 %t72, 0
br i1 %t73, label %land.rhs.37, label %if.end.36
lor.rhs.34:
%t65 = load i32, i32* %t47
%t66 = load i32, i32* %t46
%t67 = icmp sle i32 %t65, %t66
%t68 = icmp ne i32 %t67, 0
br i1 %t68, label %if.then.32, label %if.end.33
if.then.35:
call void @putch(i32 73)
br label %if.end.36
if.end.36:
%t79 = load i32, i32* %t46
%t80 = load i32, i32* %t47
%t81 = icmp eq i32 %t80, 0
%t82 = icmp eq i32 %t79, %t81
%t83 = icmp ne i32 %t82, 0
br i1 %t83, label %land.rhs.41, label %lor.rhs.40
land.rhs.37:
%t74 = load i32, i32* %t50
%t75 = load i32, i32* %t49
%t76 = icmp ne i32 %t74, %t75
%t77 = icmp ne i32 %t76, 0
br i1 %t77, label %if.then.35, label %if.end.36
if.then.38:
call void @putch(i32 74)
br label %if.end.39
if.end.39:
%t93 = load i32, i32* %t46
%t94 = load i32, i32* %t47
%t95 = icmp eq i32 %t94, 0
%t96 = icmp eq i32 %t93, %t95
%t97 = icmp ne i32 %t96, 0
br i1 %t97, label %if.then.42, label %lor.rhs.44
lor.rhs.40:
%t88 = load i32, i32* %t50
%t89 = load i32, i32* %t50
%t90 = icmp sge i32 %t88, %t89
%t91 = icmp ne i32 %t90, 0
br i1 %t91, label %if.then.38, label %if.end.39
land.rhs.41:
%t84 = load i32, i32* %t49
%t85 = load i32, i32* %t49
%t86 = icmp slt i32 %t84, %t85
%t87 = icmp ne i32 %t86, 0
br i1 %t87, label %if.then.38, label %lor.rhs.40
if.then.42:
call void @putch(i32 75)
br label %if.end.43
if.end.43:
call void @putch(i32 10)
ret i32 0
lor.rhs.44:
%t98 = load i32, i32* %t49
%t99 = load i32, i32* %t49
%t100 = icmp slt i32 %t98, %t99
%t101 = icmp ne i32 %t100, 0
br i1 %t101, label %land.rhs.45, label %if.end.43
land.rhs.45:
%t102 = load i32, i32* %t50
%t103 = load i32, i32* %t50
%t104 = icmp sge i32 %t102, %t103
%t105 = icmp ne i32 %t104, 0
br i1 %t105, label %if.then.42, label %if.end.43
}

@ -0,0 +1,77 @@
@a = global i32 7
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @func() {
entry:
%t0 = alloca i32
%t1 = load i32, i32* @a
store i32 %t1, i32* %t0
%t2 = alloca i32
store i32 1, i32* %t2
%t3 = load i32, i32* %t2
%t4 = load i32, i32* %t0
%t5 = icmp eq i32 %t3, %t4
%t6 = icmp ne i32 %t5, 0
br i1 %t6, label %if.then.1, label %if.else.3
if.then.1:
%t7 = load i32, i32* %t2
%t8 = add i32 %t7, 1
store i32 %t8, i32* %t2
ret i32 1
if.end.2:
ret i32 0
if.else.3:
ret i32 0
}
define i32 @main() {
entry:
%t9 = alloca i32
store i32 0, i32* %t9
%t10 = alloca i32
store i32 0, i32* %t10
br label %while.cond.4
while.cond.4:
%t11 = load i32, i32* %t10
%t12 = icmp slt i32 %t11, 100
%t13 = icmp ne i32 %t12, 0
br i1 %t13, label %while.body.5, label %while.end.6
while.body.5:
%t14 = call i32 @func()
%t15 = icmp eq i32 %t14, 1
%t16 = icmp ne i32 %t15, 0
br i1 %t16, label %if.then.7, label %if.end.8
while.end.6:
%t21 = load i32, i32* %t9
%t22 = icmp slt i32 %t21, 100
%t23 = icmp ne i32 %t22, 0
br i1 %t23, label %if.then.9, label %if.else.11
if.then.7:
%t17 = load i32, i32* %t9
%t18 = add i32 %t17, 1
store i32 %t18, i32* %t9
br label %if.end.8
if.end.8:
%t19 = load i32, i32* %t10
%t20 = add i32 %t19, 1
store i32 %t20, i32* %t10
br label %while.cond.4
if.then.9:
call void @putint(i32 1)
br label %if.end.10
if.end.10:
ret i32 0
if.else.11:
call void @putint(i32 0)
br label %if.end.10
}

@ -0,0 +1,70 @@
@k = global i32 0
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @main() {
entry:
store i32 3389, i32* @k
%t0 = load i32, i32* @k
%t1 = icmp slt i32 %t0, 10000
%t2 = icmp ne i32 %t1, 0
br i1 %t2, label %if.then.1, label %if.end.2
if.then.1:
%t3 = load i32, i32* @k
%t4 = add i32 %t3, 1
store i32 %t4, i32* @k
%t5 = alloca i32
store i32 112, i32* %t5
br label %while.cond.3
if.end.2:
%t27 = load i32, i32* @k
ret i32 %t27
while.cond.3:
%t6 = load i32, i32* %t5
%t7 = icmp sgt i32 %t6, 10
%t8 = icmp ne i32 %t7, 0
br i1 %t8, label %while.body.4, label %while.end.5
while.body.4:
%t9 = load i32, i32* %t5
%t10 = sub i32 %t9, 88
store i32 %t10, i32* %t5
%t11 = load i32, i32* %t5
%t12 = icmp slt i32 %t11, 1000
%t13 = icmp ne i32 %t12, 0
br i1 %t13, label %if.then.6, label %if.end.7
while.end.5:
%t25 = load i32, i32* %t5
call void @putint(i32 %t25)
br label %if.end.2
if.then.6:
%t14 = alloca i32
store i32 9, i32* %t14
%t15 = alloca i32
store i32 11, i32* %t15
store i32 10, i32* %t14
%t16 = load i32, i32* %t5
%t17 = load i32, i32* %t14
%t18 = sub i32 %t16, %t17
store i32 %t18, i32* %t5
%t19 = alloca i32
store i32 11, i32* %t19
%t20 = load i32, i32* %t5
%t21 = load i32, i32* %t19
%t22 = add i32 %t20, %t21
%t23 = load i32, i32* %t15
%t24 = add i32 %t22, %t23
store i32 %t24, i32* %t5
br label %if.end.7
if.end.7:
br label %while.cond.3
}

@ -0,0 +1,205 @@
@b = global i32 5
@c = global [4 x i32] zeroinitializer
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @main() {
entry:
%t0 = alloca i32
store i32 0, i32* %t0
store i32 1, i32* %t0
%t1 = alloca i32
store i32 0, i32* %t1
store i32 2, i32* %t1
store i32 3, i32* %t1
%t2 = load i32, i32* %t1
call void @putint(i32 %t2)
%t4 = load i32, i32* %t1
call void @putint(i32 %t4)
%t6 = load i32, i32* %t0
call void @putint(i32 %t6)
call void @putch(i32 10)
br label %while.cond.1
while.cond.1:
%t9 = load i32, i32* %t0
%t10 = icmp slt i32 %t9, 5
%t11 = icmp ne i32 %t10, 0
br i1 %t11, label %while.body.2, label %while.end.3
while.body.2:
%t12 = alloca i32
store i32 0, i32* %t12
%t13 = load i32, i32* %t12
%t14 = add i32 %t13, 1
store i32 %t14, i32* %t12
%t15 = load i32, i32* %t12
%t16 = icmp ne i32 %t15, 0
br i1 %t16, label %if.then.4, label %if.end.5
while.end.3:
%t17 = load i32, i32* %t0
call void @putint(i32 %t17)
call void @putch(i32 10)
%t20 = getelementptr inbounds [4 x i32], [4 x i32]* @c, i32 0, i32 2
store i32 1, i32* %t20
%t21 = alloca i32, i32 16
%t22 = getelementptr inbounds i32, i32* %t21, i32 0
store i32 0, i32* %t22
%t23 = getelementptr inbounds i32, i32* %t21, i32 1
store i32 9, i32* %t23
%t24 = getelementptr inbounds i32, i32* %t21, i32 2
store i32 8, i32* %t24
%t25 = getelementptr inbounds i32, i32* %t21, i32 3
store i32 3, i32* %t25
%t26 = getelementptr inbounds i32, i32* %t21, i32 4
store i32 0, i32* %t26
%t27 = getelementptr inbounds i32, i32* %t21, i32 5
store i32 0, i32* %t27
%t28 = getelementptr inbounds i32, i32* %t21, i32 6
store i32 0, i32* %t28
%t29 = getelementptr inbounds i32, i32* %t21, i32 7
store i32 0, i32* %t29
%t30 = getelementptr inbounds i32, i32* %t21, i32 8
store i32 0, i32* %t30
%t31 = getelementptr inbounds i32, i32* %t21, i32 9
store i32 0, i32* %t31
%t32 = getelementptr inbounds i32, i32* %t21, i32 10
store i32 0, i32* %t32
%t33 = getelementptr inbounds i32, i32* %t21, i32 11
store i32 0, i32* %t33
%t34 = getelementptr inbounds i32, i32* %t21, i32 12
store i32 0, i32* %t34
%t35 = getelementptr inbounds i32, i32* %t21, i32 13
store i32 0, i32* %t35
%t36 = getelementptr inbounds i32, i32* %t21, i32 14
store i32 0, i32* %t36
%t37 = getelementptr inbounds i32, i32* %t21, i32 15
store i32 0, i32* %t37
%t38 = alloca i32
store i32 2, i32* %t38
%t39 = getelementptr inbounds [4 x i32], [4 x i32]* @c, i32 0, i32 2
%t40 = load i32, i32* %t39
%t41 = icmp ne i32 %t40, 0
br i1 %t41, label %if.then.6, label %if.end.7
if.then.4:
br label %while.end.3
if.end.5:
br label %while.cond.1
if.then.6:
%t42 = alloca i32, i32 35
%t43 = getelementptr inbounds i32, i32* %t42, i32 0
store i32 2, i32* %t43
%t44 = getelementptr inbounds i32, i32* %t42, i32 1
store i32 1, i32* %t44
%t45 = getelementptr inbounds i32, i32* %t42, i32 2
store i32 8, i32* %t45
%t46 = getelementptr inbounds i32, i32* %t42, i32 3
store i32 0, i32* %t46
%t47 = getelementptr inbounds i32, i32* %t42, i32 4
store i32 0, i32* %t47
%t48 = getelementptr inbounds i32, i32* %t42, i32 5
store i32 0, i32* %t48
%t49 = getelementptr inbounds i32, i32* %t42, i32 6
store i32 0, i32* %t49
%t50 = getelementptr inbounds i32, i32* %t42, i32 7
store i32 0, i32* %t50
%t51 = getelementptr inbounds i32, i32* %t42, i32 8
store i32 0, i32* %t51
%t52 = getelementptr inbounds i32, i32* %t42, i32 9
store i32 0, i32* %t52
%t53 = getelementptr inbounds i32, i32* %t42, i32 10
store i32 0, i32* %t53
%t54 = getelementptr inbounds i32, i32* %t42, i32 11
store i32 0, i32* %t54
%t55 = getelementptr inbounds i32, i32* %t42, i32 12
store i32 0, i32* %t55
%t56 = getelementptr inbounds i32, i32* %t42, i32 13
store i32 0, i32* %t56
%t57 = getelementptr inbounds i32, i32* %t42, i32 14
store i32 0, i32* %t57
%t58 = getelementptr inbounds i32, i32* %t42, i32 15
store i32 0, i32* %t58
%t59 = getelementptr inbounds i32, i32* %t42, i32 16
store i32 0, i32* %t59
%t60 = getelementptr inbounds i32, i32* %t42, i32 17
store i32 0, i32* %t60
%t61 = getelementptr inbounds i32, i32* %t42, i32 18
store i32 0, i32* %t61
%t62 = getelementptr inbounds i32, i32* %t42, i32 19
store i32 0, i32* %t62
%t63 = getelementptr inbounds i32, i32* %t42, i32 20
store i32 0, i32* %t63
%t64 = getelementptr inbounds i32, i32* %t42, i32 21
store i32 0, i32* %t64
%t65 = getelementptr inbounds i32, i32* %t42, i32 22
store i32 0, i32* %t65
%t66 = getelementptr inbounds i32, i32* %t42, i32 23
store i32 0, i32* %t66
%t67 = getelementptr inbounds i32, i32* %t42, i32 24
store i32 0, i32* %t67
%t68 = getelementptr inbounds i32, i32* %t42, i32 25
store i32 0, i32* %t68
%t69 = getelementptr inbounds i32, i32* %t42, i32 26
store i32 0, i32* %t69
%t70 = getelementptr inbounds i32, i32* %t42, i32 27
store i32 0, i32* %t70
%t71 = getelementptr inbounds i32, i32* %t42, i32 28
store i32 0, i32* %t71
%t72 = getelementptr inbounds i32, i32* %t42, i32 29
store i32 0, i32* %t72
%t73 = getelementptr inbounds i32, i32* %t42, i32 30
store i32 0, i32* %t73
%t74 = getelementptr inbounds i32, i32* %t42, i32 31
store i32 0, i32* %t74
%t75 = getelementptr inbounds i32, i32* %t42, i32 32
store i32 0, i32* %t75
%t76 = getelementptr inbounds i32, i32* %t42, i32 33
store i32 0, i32* %t76
%t77 = getelementptr inbounds i32, i32* %t42, i32 34
store i32 0, i32* %t77
%t78 = load i32, i32* %t38
%t79 = mul i32 %t78, 5
%t80 = getelementptr inbounds i32, i32* %t42, i32 %t79
%t81 = load i32, i32* %t80
call void @putint(i32 %t81)
%t83 = load i32, i32* %t38
%t84 = mul i32 %t83, 5
%t85 = add i32 %t84, 1
%t86 = getelementptr inbounds i32, i32* %t42, i32 %t85
%t87 = load i32, i32* %t86
call void @putint(i32 %t87)
%t89 = load i32, i32* %t38
%t90 = mul i32 %t89, 5
%t91 = add i32 %t90, 2
%t92 = getelementptr inbounds i32, i32* %t42, i32 %t91
%t93 = load i32, i32* %t92
call void @putint(i32 %t93)
br label %if.end.7
if.end.7:
call void @putch(i32 10)
%t96 = load i32, i32* @b
call void @putint(i32 %t96)
call void @putch(i32 10)
%t99 = getelementptr inbounds [4 x i32], [4 x i32]* @c, i32 0, i32 0
%t100 = load i32, i32* %t99
call void @putint(i32 %t100)
%t102 = getelementptr inbounds [4 x i32], [4 x i32]* @c, i32 0, i32 1
%t103 = load i32, i32* %t102
call void @putint(i32 %t103)
%t105 = getelementptr inbounds [4 x i32], [4 x i32]* @c, i32 0, i32 2
%t106 = load i32, i32* %t105
call void @putint(i32 %t106)
%t108 = getelementptr inbounds [4 x i32], [4 x i32]* @c, i32 0, i32 3
%t109 = load i32, i32* %t108
call void @putint(i32 %t109)
call void @putch(i32 10)
ret i32 0
}

@ -0,0 +1,159 @@
@n = global i32 0
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @bubblesort(i32* %arg.arr) {
entry:
%t0 = alloca i32
store i32 0, i32* %t0
%t1 = alloca i32
store i32 0, i32* %t1
store i32 0, i32* %t0
br label %while.cond.1
while.cond.1:
%t2 = load i32, i32* %t0
%t3 = load i32, i32* @n
%t4 = sub i32 %t3, 1
%t5 = icmp slt i32 %t2, %t4
%t6 = icmp ne i32 %t5, 0
br i1 %t6, label %while.body.2, label %while.end.3
while.body.2:
store i32 0, i32* %t1
br label %while.cond.4
while.end.3:
ret i32 0
while.cond.4:
%t7 = load i32, i32* %t1
%t8 = load i32, i32* @n
%t9 = load i32, i32* %t0
%t10 = sub i32 %t8, %t9
%t11 = sub i32 %t10, 1
%t12 = icmp slt i32 %t7, %t11
%t13 = icmp ne i32 %t12, 0
br i1 %t13, label %while.body.5, label %while.end.6
while.body.5:
%t14 = load i32, i32* %t1
%t15 = getelementptr inbounds i32, i32* %arg.arr, i32 %t14
%t16 = load i32, i32* %t15
%t17 = load i32, i32* %t1
%t18 = add i32 %t17, 1
%t19 = getelementptr inbounds i32, i32* %arg.arr, i32 %t18
%t20 = load i32, i32* %t19
%t21 = icmp sgt i32 %t16, %t20
%t22 = icmp ne i32 %t21, 0
br i1 %t22, label %if.then.7, label %if.end.8
while.end.6:
%t39 = load i32, i32* %t0
%t40 = add i32 %t39, 1
store i32 %t40, i32* %t0
br label %while.cond.1
if.then.7:
%t23 = alloca i32
store i32 0, i32* %t23
%t24 = load i32, i32* %t1
%t25 = add i32 %t24, 1
%t26 = getelementptr inbounds i32, i32* %arg.arr, i32 %t25
%t27 = load i32, i32* %t26
store i32 %t27, i32* %t23
%t28 = load i32, i32* %t1
%t29 = add i32 %t28, 1
%t30 = getelementptr inbounds i32, i32* %arg.arr, i32 %t29
%t31 = load i32, i32* %t1
%t32 = getelementptr inbounds i32, i32* %arg.arr, i32 %t31
%t33 = load i32, i32* %t32
store i32 %t33, i32* %t30
%t34 = load i32, i32* %t1
%t35 = getelementptr inbounds i32, i32* %arg.arr, i32 %t34
%t36 = load i32, i32* %t23
store i32 %t36, i32* %t35
br label %if.end.8
if.end.8:
%t37 = load i32, i32* %t1
%t38 = add i32 %t37, 1
store i32 %t38, i32* %t1
br label %while.cond.4
}
define i32 @main() {
entry:
store i32 10, i32* @n
%t41 = alloca i32, i32 10
%t42 = getelementptr inbounds i32, i32* %t41, i32 0
store i32 0, i32* %t42
%t43 = getelementptr inbounds i32, i32* %t41, i32 1
store i32 0, i32* %t43
%t44 = getelementptr inbounds i32, i32* %t41, i32 2
store i32 0, i32* %t44
%t45 = getelementptr inbounds i32, i32* %t41, i32 3
store i32 0, i32* %t45
%t46 = getelementptr inbounds i32, i32* %t41, i32 4
store i32 0, i32* %t46
%t47 = getelementptr inbounds i32, i32* %t41, i32 5
store i32 0, i32* %t47
%t48 = getelementptr inbounds i32, i32* %t41, i32 6
store i32 0, i32* %t48
%t49 = getelementptr inbounds i32, i32* %t41, i32 7
store i32 0, i32* %t49
%t50 = getelementptr inbounds i32, i32* %t41, i32 8
store i32 0, i32* %t50
%t51 = getelementptr inbounds i32, i32* %t41, i32 9
store i32 0, i32* %t51
%t52 = getelementptr inbounds i32, i32* %t41, i32 0
store i32 4, i32* %t52
%t53 = getelementptr inbounds i32, i32* %t41, i32 1
store i32 3, i32* %t53
%t54 = getelementptr inbounds i32, i32* %t41, i32 2
store i32 9, i32* %t54
%t55 = getelementptr inbounds i32, i32* %t41, i32 3
store i32 2, i32* %t55
%t56 = getelementptr inbounds i32, i32* %t41, i32 4
store i32 0, i32* %t56
%t57 = getelementptr inbounds i32, i32* %t41, i32 5
store i32 1, i32* %t57
%t58 = getelementptr inbounds i32, i32* %t41, i32 6
store i32 6, i32* %t58
%t59 = getelementptr inbounds i32, i32* %t41, i32 7
store i32 5, i32* %t59
%t60 = getelementptr inbounds i32, i32* %t41, i32 8
store i32 7, i32* %t60
%t61 = getelementptr inbounds i32, i32* %t41, i32 9
store i32 8, i32* %t61
%t62 = alloca i32
store i32 0, i32* %t62
%t63 = call i32 @bubblesort(i32* %t41)
store i32 %t63, i32* %t62
br label %while.cond.9
while.cond.9:
%t64 = load i32, i32* %t62
%t65 = load i32, i32* @n
%t66 = icmp slt i32 %t64, %t65
%t67 = icmp ne i32 %t66, 0
br i1 %t67, label %while.body.10, label %while.end.11
while.body.10:
%t68 = alloca i32
store i32 0, i32* %t68
%t69 = load i32, i32* %t62
%t70 = getelementptr inbounds i32, i32* %t41, i32 %t69
%t71 = load i32, i32* %t70
store i32 %t71, i32* %t68
%t72 = load i32, i32* %t68
call void @putint(i32 %t72)
store i32 10, i32* %t68
%t74 = load i32, i32* %t68
call void @putch(i32 %t74)
%t76 = load i32, i32* %t62
%t77 = add i32 %t76, 1
store i32 %t77, i32* %t62
br label %while.cond.9
while.end.11:
ret i32 0
}

@ -0,0 +1,151 @@
@n = global i32 0
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @insertsort(i32* %arg.a) {
entry:
%t0 = alloca i32
store i32 0, i32* %t0
store i32 1, i32* %t0
br label %while.cond.1
while.cond.1:
%t1 = load i32, i32* %t0
%t2 = load i32, i32* @n
%t3 = icmp slt i32 %t1, %t2
%t4 = icmp ne i32 %t3, 0
br i1 %t4, label %while.body.2, label %while.end.3
while.body.2:
%t5 = alloca i32
store i32 0, i32* %t5
%t6 = load i32, i32* %t0
%t7 = getelementptr inbounds i32, i32* %arg.a, i32 %t6
%t8 = load i32, i32* %t7
store i32 %t8, i32* %t5
%t9 = alloca i32
store i32 0, i32* %t9
%t10 = load i32, i32* %t0
%t11 = sub i32 %t10, 1
store i32 %t11, i32* %t9
br label %while.cond.4
while.end.3:
ret i32 0
while.cond.4:
%t12 = load i32, i32* %t9
%t13 = icmp sgt i32 %t12, -1
%t14 = icmp ne i32 %t13, 0
br i1 %t14, label %land.rhs.7, label %while.end.6
while.body.5:
%t21 = load i32, i32* %t9
%t22 = add i32 %t21, 1
%t23 = getelementptr inbounds i32, i32* %arg.a, i32 %t22
%t24 = load i32, i32* %t9
%t25 = getelementptr inbounds i32, i32* %arg.a, i32 %t24
%t26 = load i32, i32* %t25
store i32 %t26, i32* %t23
%t27 = load i32, i32* %t9
%t28 = sub i32 %t27, 1
store i32 %t28, i32* %t9
br label %while.cond.4
while.end.6:
%t29 = load i32, i32* %t9
%t30 = add i32 %t29, 1
%t31 = getelementptr inbounds i32, i32* %arg.a, i32 %t30
%t32 = load i32, i32* %t5
store i32 %t32, i32* %t31
%t33 = load i32, i32* %t0
%t34 = add i32 %t33, 1
store i32 %t34, i32* %t0
br label %while.cond.1
land.rhs.7:
%t15 = load i32, i32* %t5
%t16 = load i32, i32* %t9
%t17 = getelementptr inbounds i32, i32* %arg.a, i32 %t16
%t18 = load i32, i32* %t17
%t19 = icmp slt i32 %t15, %t18
%t20 = icmp ne i32 %t19, 0
br i1 %t20, label %while.body.5, label %while.end.6
}
define i32 @main() {
entry:
store i32 10, i32* @n
%t35 = alloca i32, i32 10
%t36 = getelementptr inbounds i32, i32* %t35, i32 0
store i32 0, i32* %t36
%t37 = getelementptr inbounds i32, i32* %t35, i32 1
store i32 0, i32* %t37
%t38 = getelementptr inbounds i32, i32* %t35, i32 2
store i32 0, i32* %t38
%t39 = getelementptr inbounds i32, i32* %t35, i32 3
store i32 0, i32* %t39
%t40 = getelementptr inbounds i32, i32* %t35, i32 4
store i32 0, i32* %t40
%t41 = getelementptr inbounds i32, i32* %t35, i32 5
store i32 0, i32* %t41
%t42 = getelementptr inbounds i32, i32* %t35, i32 6
store i32 0, i32* %t42
%t43 = getelementptr inbounds i32, i32* %t35, i32 7
store i32 0, i32* %t43
%t44 = getelementptr inbounds i32, i32* %t35, i32 8
store i32 0, i32* %t44
%t45 = getelementptr inbounds i32, i32* %t35, i32 9
store i32 0, i32* %t45
%t46 = getelementptr inbounds i32, i32* %t35, i32 0
store i32 4, i32* %t46
%t47 = getelementptr inbounds i32, i32* %t35, i32 1
store i32 3, i32* %t47
%t48 = getelementptr inbounds i32, i32* %t35, i32 2
store i32 9, i32* %t48
%t49 = getelementptr inbounds i32, i32* %t35, i32 3
store i32 2, i32* %t49
%t50 = getelementptr inbounds i32, i32* %t35, i32 4
store i32 0, i32* %t50
%t51 = getelementptr inbounds i32, i32* %t35, i32 5
store i32 1, i32* %t51
%t52 = getelementptr inbounds i32, i32* %t35, i32 6
store i32 6, i32* %t52
%t53 = getelementptr inbounds i32, i32* %t35, i32 7
store i32 5, i32* %t53
%t54 = getelementptr inbounds i32, i32* %t35, i32 8
store i32 7, i32* %t54
%t55 = getelementptr inbounds i32, i32* %t35, i32 9
store i32 8, i32* %t55
%t56 = alloca i32
store i32 0, i32* %t56
%t57 = call i32 @insertsort(i32* %t35)
store i32 %t57, i32* %t56
br label %while.cond.8
while.cond.8:
%t58 = load i32, i32* %t56
%t59 = load i32, i32* @n
%t60 = icmp slt i32 %t58, %t59
%t61 = icmp ne i32 %t60, 0
br i1 %t61, label %while.body.9, label %while.end.10
while.body.9:
%t62 = alloca i32
store i32 0, i32* %t62
%t63 = load i32, i32* %t56
%t64 = getelementptr inbounds i32, i32* %t35, i32 %t63
%t65 = load i32, i32* %t64
store i32 %t65, i32* %t62
%t66 = load i32, i32* %t62
call void @putint(i32 %t66)
store i32 10, i32* %t62
%t68 = load i32, i32* %t62
call void @putch(i32 %t68)
%t70 = load i32, i32* %t56
%t71 = add i32 %t70, 1
store i32 %t71, i32* %t56
br label %while.cond.8
while.end.10:
ret i32 0
}

@ -0,0 +1,231 @@
@n = global i32 0
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @QuickSort(i32* %arg.arr, i32 %arg.low, i32 %arg.high) {
entry:
%t0 = alloca i32
store i32 %arg.low, i32* %t0
%t1 = alloca i32
store i32 %arg.high, i32* %t1
%t2 = load i32, i32* %t0
%t3 = load i32, i32* %t1
%t4 = icmp slt i32 %t2, %t3
%t5 = icmp ne i32 %t4, 0
br i1 %t5, label %if.then.1, label %if.end.2
if.then.1:
%t6 = alloca i32
store i32 0, i32* %t6
%t7 = load i32, i32* %t0
store i32 %t7, i32* %t6
%t8 = alloca i32
store i32 0, i32* %t8
%t9 = load i32, i32* %t1
store i32 %t9, i32* %t8
%t10 = alloca i32
store i32 0, i32* %t10
%t11 = load i32, i32* %t0
%t12 = getelementptr inbounds i32, i32* %arg.arr, i32 %t11
%t13 = load i32, i32* %t12
store i32 %t13, i32* %t10
br label %while.cond.3
if.end.2:
ret i32 0
while.cond.3:
%t14 = load i32, i32* %t6
%t15 = load i32, i32* %t8
%t16 = icmp slt i32 %t14, %t15
%t17 = icmp ne i32 %t16, 0
br i1 %t17, label %while.body.4, label %while.end.5
while.body.4:
br label %while.cond.6
while.end.5:
%t65 = load i32, i32* %t6
%t66 = getelementptr inbounds i32, i32* %arg.arr, i32 %t65
%t67 = load i32, i32* %t10
store i32 %t67, i32* %t66
%t68 = alloca i32
store i32 0, i32* %t68
%t69 = load i32, i32* %t6
%t70 = sub i32 %t69, 1
store i32 %t70, i32* %t68
%t71 = load i32, i32* %t0
%t72 = load i32, i32* %t68
%t73 = call i32 @QuickSort(i32* %arg.arr, i32 %t71, i32 %t72)
store i32 %t73, i32* %t68
%t74 = load i32, i32* %t6
%t75 = add i32 %t74, 1
store i32 %t75, i32* %t68
%t76 = load i32, i32* %t68
%t77 = load i32, i32* %t1
%t78 = call i32 @QuickSort(i32* %arg.arr, i32 %t76, i32 %t77)
store i32 %t78, i32* %t68
br label %if.end.2
while.cond.6:
%t18 = load i32, i32* %t6
%t19 = load i32, i32* %t8
%t20 = icmp slt i32 %t18, %t19
%t21 = icmp ne i32 %t20, 0
br i1 %t21, label %land.rhs.9, label %while.end.8
while.body.7:
%t29 = load i32, i32* %t8
%t30 = sub i32 %t29, 1
store i32 %t30, i32* %t8
br label %while.cond.6
while.end.8:
%t31 = load i32, i32* %t6
%t32 = load i32, i32* %t8
%t33 = icmp slt i32 %t31, %t32
%t34 = icmp ne i32 %t33, 0
br i1 %t34, label %if.then.10, label %if.end.11
land.rhs.9:
%t22 = load i32, i32* %t8
%t23 = getelementptr inbounds i32, i32* %arg.arr, i32 %t22
%t24 = load i32, i32* %t23
%t25 = load i32, i32* %t10
%t26 = sub i32 %t25, 1
%t27 = icmp sgt i32 %t24, %t26
%t28 = icmp ne i32 %t27, 0
br i1 %t28, label %while.body.7, label %while.end.8
if.then.10:
%t35 = load i32, i32* %t6
%t36 = getelementptr inbounds i32, i32* %arg.arr, i32 %t35
%t37 = load i32, i32* %t8
%t38 = getelementptr inbounds i32, i32* %arg.arr, i32 %t37
%t39 = load i32, i32* %t38
store i32 %t39, i32* %t36
%t40 = load i32, i32* %t6
%t41 = add i32 %t40, 1
store i32 %t41, i32* %t6
br label %if.end.11
if.end.11:
br label %while.cond.12
while.cond.12:
%t42 = load i32, i32* %t6
%t43 = load i32, i32* %t8
%t44 = icmp slt i32 %t42, %t43
%t45 = icmp ne i32 %t44, 0
br i1 %t45, label %land.rhs.15, label %while.end.14
while.body.13:
%t52 = load i32, i32* %t6
%t53 = add i32 %t52, 1
store i32 %t53, i32* %t6
br label %while.cond.12
while.end.14:
%t54 = load i32, i32* %t6
%t55 = load i32, i32* %t8
%t56 = icmp slt i32 %t54, %t55
%t57 = icmp ne i32 %t56, 0
br i1 %t57, label %if.then.16, label %if.end.17
land.rhs.15:
%t46 = load i32, i32* %t6
%t47 = getelementptr inbounds i32, i32* %arg.arr, i32 %t46
%t48 = load i32, i32* %t47
%t49 = load i32, i32* %t10
%t50 = icmp slt i32 %t48, %t49
%t51 = icmp ne i32 %t50, 0
br i1 %t51, label %while.body.13, label %while.end.14
if.then.16:
%t58 = load i32, i32* %t8
%t59 = getelementptr inbounds i32, i32* %arg.arr, i32 %t58
%t60 = load i32, i32* %t6
%t61 = getelementptr inbounds i32, i32* %arg.arr, i32 %t60
%t62 = load i32, i32* %t61
store i32 %t62, i32* %t59
%t63 = load i32, i32* %t8
%t64 = sub i32 %t63, 1
store i32 %t64, i32* %t8
br label %if.end.17
if.end.17:
br label %while.cond.3
}
define i32 @main() {
entry:
store i32 10, i32* @n
%t79 = alloca i32, i32 10
%t80 = getelementptr inbounds i32, i32* %t79, i32 0
store i32 0, i32* %t80
%t81 = getelementptr inbounds i32, i32* %t79, i32 1
store i32 0, i32* %t81
%t82 = getelementptr inbounds i32, i32* %t79, i32 2
store i32 0, i32* %t82
%t83 = getelementptr inbounds i32, i32* %t79, i32 3
store i32 0, i32* %t83
%t84 = getelementptr inbounds i32, i32* %t79, i32 4
store i32 0, i32* %t84
%t85 = getelementptr inbounds i32, i32* %t79, i32 5
store i32 0, i32* %t85
%t86 = getelementptr inbounds i32, i32* %t79, i32 6
store i32 0, i32* %t86
%t87 = getelementptr inbounds i32, i32* %t79, i32 7
store i32 0, i32* %t87
%t88 = getelementptr inbounds i32, i32* %t79, i32 8
store i32 0, i32* %t88
%t89 = getelementptr inbounds i32, i32* %t79, i32 9
store i32 0, i32* %t89
%t90 = getelementptr inbounds i32, i32* %t79, i32 0
store i32 4, i32* %t90
%t91 = getelementptr inbounds i32, i32* %t79, i32 1
store i32 3, i32* %t91
%t92 = getelementptr inbounds i32, i32* %t79, i32 2
store i32 9, i32* %t92
%t93 = getelementptr inbounds i32, i32* %t79, i32 3
store i32 2, i32* %t93
%t94 = getelementptr inbounds i32, i32* %t79, i32 4
store i32 0, i32* %t94
%t95 = getelementptr inbounds i32, i32* %t79, i32 5
store i32 1, i32* %t95
%t96 = getelementptr inbounds i32, i32* %t79, i32 6
store i32 6, i32* %t96
%t97 = getelementptr inbounds i32, i32* %t79, i32 7
store i32 5, i32* %t97
%t98 = getelementptr inbounds i32, i32* %t79, i32 8
store i32 7, i32* %t98
%t99 = getelementptr inbounds i32, i32* %t79, i32 9
store i32 8, i32* %t99
%t100 = alloca i32
store i32 0, i32* %t100
store i32 0, i32* %t100
%t101 = alloca i32
store i32 0, i32* %t101
store i32 9, i32* %t101
%t102 = load i32, i32* %t100
%t103 = load i32, i32* %t101
%t104 = call i32 @QuickSort(i32* %t79, i32 %t102, i32 %t103)
store i32 %t104, i32* %t100
br label %while.cond.18
while.cond.18:
%t105 = load i32, i32* %t100
%t106 = load i32, i32* @n
%t107 = icmp slt i32 %t105, %t106
%t108 = icmp ne i32 %t107, 0
br i1 %t108, label %while.body.19, label %while.end.20
while.body.19:
%t109 = alloca i32
store i32 0, i32* %t109
%t110 = load i32, i32* %t100
%t111 = getelementptr inbounds i32, i32* %t79, i32 %t110
%t112 = load i32, i32* %t111
store i32 %t112, i32* %t109
%t113 = load i32, i32* %t109
call void @putint(i32 %t113)
store i32 10, i32* %t109
%t115 = load i32, i32* %t109
call void @putch(i32 %t115)
%t117 = load i32, i32* %t100
%t118 = add i32 %t117, 1
store i32 %t118, i32* %t100
br label %while.cond.18
while.end.20:
ret i32 0
}

@ -0,0 +1,173 @@
@n = global i32 0
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @select_sort(i32* %arg.A, i32 %arg.n) {
entry:
%t0 = alloca i32
store i32 %arg.n, i32* %t0
%t1 = alloca i32
store i32 0, i32* %t1
%t2 = alloca i32
store i32 0, i32* %t2
%t3 = alloca i32
store i32 0, i32* %t3
store i32 0, i32* %t1
br label %while.cond.1
while.cond.1:
%t4 = load i32, i32* %t1
%t5 = load i32, i32* %t0
%t6 = sub i32 %t5, 1
%t7 = icmp slt i32 %t4, %t6
%t8 = icmp ne i32 %t7, 0
br i1 %t8, label %while.body.2, label %while.end.3
while.body.2:
%t9 = load i32, i32* %t1
store i32 %t9, i32* %t3
%t10 = load i32, i32* %t1
%t11 = add i32 %t10, 1
store i32 %t11, i32* %t2
br label %while.cond.4
while.end.3:
ret i32 0
while.cond.4:
%t12 = load i32, i32* %t2
%t13 = load i32, i32* %t0
%t14 = icmp slt i32 %t12, %t13
%t15 = icmp ne i32 %t14, 0
br i1 %t15, label %while.body.5, label %while.end.6
while.body.5:
%t16 = load i32, i32* %t3
%t17 = getelementptr inbounds i32, i32* %arg.A, i32 %t16
%t18 = load i32, i32* %t17
%t19 = load i32, i32* %t2
%t20 = getelementptr inbounds i32, i32* %arg.A, i32 %t19
%t21 = load i32, i32* %t20
%t22 = icmp sgt i32 %t18, %t21
%t23 = icmp ne i32 %t22, 0
br i1 %t23, label %if.then.7, label %if.end.8
while.end.6:
%t27 = load i32, i32* %t3
%t28 = load i32, i32* %t1
%t29 = icmp ne i32 %t27, %t28
%t30 = icmp ne i32 %t29, 0
br i1 %t30, label %if.then.9, label %if.end.10
if.then.7:
%t24 = load i32, i32* %t2
store i32 %t24, i32* %t3
br label %if.end.8
if.end.8:
%t25 = load i32, i32* %t2
%t26 = add i32 %t25, 1
store i32 %t26, i32* %t2
br label %while.cond.4
if.then.9:
%t31 = alloca i32
store i32 0, i32* %t31
%t32 = load i32, i32* %t3
%t33 = getelementptr inbounds i32, i32* %arg.A, i32 %t32
%t34 = load i32, i32* %t33
store i32 %t34, i32* %t31
%t35 = load i32, i32* %t3
%t36 = getelementptr inbounds i32, i32* %arg.A, i32 %t35
%t37 = load i32, i32* %t1
%t38 = getelementptr inbounds i32, i32* %arg.A, i32 %t37
%t39 = load i32, i32* %t38
store i32 %t39, i32* %t36
%t40 = load i32, i32* %t1
%t41 = getelementptr inbounds i32, i32* %arg.A, i32 %t40
%t42 = load i32, i32* %t31
store i32 %t42, i32* %t41
br label %if.end.10
if.end.10:
%t43 = load i32, i32* %t1
%t44 = add i32 %t43, 1
store i32 %t44, i32* %t1
br label %while.cond.1
}
define i32 @main() {
entry:
store i32 10, i32* @n
%t45 = alloca i32, i32 10
%t46 = getelementptr inbounds i32, i32* %t45, i32 0
store i32 0, i32* %t46
%t47 = getelementptr inbounds i32, i32* %t45, i32 1
store i32 0, i32* %t47
%t48 = getelementptr inbounds i32, i32* %t45, i32 2
store i32 0, i32* %t48
%t49 = getelementptr inbounds i32, i32* %t45, i32 3
store i32 0, i32* %t49
%t50 = getelementptr inbounds i32, i32* %t45, i32 4
store i32 0, i32* %t50
%t51 = getelementptr inbounds i32, i32* %t45, i32 5
store i32 0, i32* %t51
%t52 = getelementptr inbounds i32, i32* %t45, i32 6
store i32 0, i32* %t52
%t53 = getelementptr inbounds i32, i32* %t45, i32 7
store i32 0, i32* %t53
%t54 = getelementptr inbounds i32, i32* %t45, i32 8
store i32 0, i32* %t54
%t55 = getelementptr inbounds i32, i32* %t45, i32 9
store i32 0, i32* %t55
%t56 = getelementptr inbounds i32, i32* %t45, i32 0
store i32 4, i32* %t56
%t57 = getelementptr inbounds i32, i32* %t45, i32 1
store i32 3, i32* %t57
%t58 = getelementptr inbounds i32, i32* %t45, i32 2
store i32 9, i32* %t58
%t59 = getelementptr inbounds i32, i32* %t45, i32 3
store i32 2, i32* %t59
%t60 = getelementptr inbounds i32, i32* %t45, i32 4
store i32 0, i32* %t60
%t61 = getelementptr inbounds i32, i32* %t45, i32 5
store i32 1, i32* %t61
%t62 = getelementptr inbounds i32, i32* %t45, i32 6
store i32 6, i32* %t62
%t63 = getelementptr inbounds i32, i32* %t45, i32 7
store i32 5, i32* %t63
%t64 = getelementptr inbounds i32, i32* %t45, i32 8
store i32 7, i32* %t64
%t65 = getelementptr inbounds i32, i32* %t45, i32 9
store i32 8, i32* %t65
%t66 = alloca i32
store i32 0, i32* %t66
store i32 0, i32* %t66
%t67 = load i32, i32* @n
%t68 = call i32 @select_sort(i32* %t45, i32 %t67)
store i32 %t68, i32* %t66
br label %while.cond.11
while.cond.11:
%t69 = load i32, i32* %t66
%t70 = load i32, i32* @n
%t71 = icmp slt i32 %t69, %t70
%t72 = icmp ne i32 %t71, 0
br i1 %t72, label %while.body.12, label %while.end.13
while.body.12:
%t73 = alloca i32
store i32 0, i32* %t73
%t74 = load i32, i32* %t66
%t75 = getelementptr inbounds i32, i32* %t45, i32 %t74
%t76 = load i32, i32* %t75
store i32 %t76, i32* %t73
%t77 = load i32, i32* %t73
call void @putint(i32 %t77)
store i32 10, i32* %t73
%t79 = load i32, i32* %t73
call void @putch(i32 %t79)
%t81 = load i32, i32* %t66
%t82 = add i32 %t81, 1
store i32 %t82, i32* %t66
br label %while.cond.11
while.end.13:
ret i32 0
}

@ -0,0 +1,251 @@
@n = global i32 0
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @swap(i32* %arg.array, i32 %arg.i, i32 %arg.j) {
entry:
%t0 = alloca i32
store i32 %arg.i, i32* %t0
%t1 = alloca i32
store i32 %arg.j, i32* %t1
%t2 = alloca i32
store i32 0, i32* %t2
%t3 = load i32, i32* %t0
%t4 = getelementptr inbounds i32, i32* %arg.array, i32 %t3
%t5 = load i32, i32* %t4
store i32 %t5, i32* %t2
%t6 = load i32, i32* %t0
%t7 = getelementptr inbounds i32, i32* %arg.array, i32 %t6
%t8 = load i32, i32* %t1
%t9 = getelementptr inbounds i32, i32* %arg.array, i32 %t8
%t10 = load i32, i32* %t9
store i32 %t10, i32* %t7
%t11 = load i32, i32* %t1
%t12 = getelementptr inbounds i32, i32* %arg.array, i32 %t11
%t13 = load i32, i32* %t2
store i32 %t13, i32* %t12
ret i32 0
}
define i32 @heap_ajust(i32* %arg.arr, i32 %arg.start, i32 %arg.end) {
entry:
%t14 = alloca i32
store i32 %arg.start, i32* %t14
%t15 = alloca i32
store i32 %arg.end, i32* %t15
%t16 = alloca i32
store i32 0, i32* %t16
%t17 = load i32, i32* %t14
store i32 %t17, i32* %t16
%t18 = alloca i32
store i32 0, i32* %t18
%t19 = load i32, i32* %t16
%t20 = mul i32 %t19, 2
%t21 = add i32 %t20, 1
store i32 %t21, i32* %t18
br label %while.cond.1
while.cond.1:
%t22 = load i32, i32* %t18
%t23 = load i32, i32* %t15
%t24 = add i32 %t23, 1
%t25 = icmp slt i32 %t22, %t24
%t26 = icmp ne i32 %t25, 0
br i1 %t26, label %while.body.2, label %while.end.3
while.body.2:
%t27 = load i32, i32* %t18
%t28 = load i32, i32* %t15
%t29 = icmp slt i32 %t27, %t28
%t30 = icmp ne i32 %t29, 0
br i1 %t30, label %land.rhs.6, label %if.end.5
while.end.3:
ret i32 0
if.then.4:
%t40 = load i32, i32* %t18
%t41 = add i32 %t40, 1
store i32 %t41, i32* %t18
br label %if.end.5
if.end.5:
%t42 = load i32, i32* %t16
%t43 = getelementptr inbounds i32, i32* %arg.arr, i32 %t42
%t44 = load i32, i32* %t43
%t45 = load i32, i32* %t18
%t46 = getelementptr inbounds i32, i32* %arg.arr, i32 %t45
%t47 = load i32, i32* %t46
%t48 = icmp sgt i32 %t44, %t47
%t49 = icmp ne i32 %t48, 0
br i1 %t49, label %if.then.7, label %if.else.9
land.rhs.6:
%t31 = load i32, i32* %t18
%t32 = getelementptr inbounds i32, i32* %arg.arr, i32 %t31
%t33 = load i32, i32* %t32
%t34 = load i32, i32* %t18
%t35 = add i32 %t34, 1
%t36 = getelementptr inbounds i32, i32* %arg.arr, i32 %t35
%t37 = load i32, i32* %t36
%t38 = icmp slt i32 %t33, %t37
%t39 = icmp ne i32 %t38, 0
br i1 %t39, label %if.then.4, label %if.end.5
if.then.7:
ret i32 0
if.end.8:
br label %while.cond.1
if.else.9:
%t50 = load i32, i32* %t16
%t51 = load i32, i32* %t18
%t52 = call i32 @swap(i32* %arg.arr, i32 %t50, i32 %t51)
store i32 %t52, i32* %t16
%t53 = load i32, i32* %t18
store i32 %t53, i32* %t16
%t54 = load i32, i32* %t16
%t55 = mul i32 %t54, 2
%t56 = add i32 %t55, 1
store i32 %t56, i32* %t18
br label %if.end.8
}
define i32 @heap_sort(i32* %arg.arr, i32 %arg.len) {
entry:
%t57 = alloca i32
store i32 %arg.len, i32* %t57
%t58 = alloca i32
store i32 0, i32* %t58
%t59 = alloca i32
store i32 0, i32* %t59
%t60 = load i32, i32* %t57
%t61 = sdiv i32 %t60, 2
%t62 = sub i32 %t61, 1
store i32 %t62, i32* %t58
br label %while.cond.10
while.cond.10:
%t63 = load i32, i32* %t58
%t64 = icmp sgt i32 %t63, -1
%t65 = icmp ne i32 %t64, 0
br i1 %t65, label %while.body.11, label %while.end.12
while.body.11:
%t66 = load i32, i32* %t57
%t67 = sub i32 %t66, 1
store i32 %t67, i32* %t59
%t68 = load i32, i32* %t58
%t69 = load i32, i32* %t59
%t70 = call i32 @heap_ajust(i32* %arg.arr, i32 %t68, i32 %t69)
store i32 %t70, i32* %t59
%t71 = load i32, i32* %t58
%t72 = sub i32 %t71, 1
store i32 %t72, i32* %t58
br label %while.cond.10
while.end.12:
%t73 = load i32, i32* %t57
%t74 = sub i32 %t73, 1
store i32 %t74, i32* %t58
br label %while.cond.13
while.cond.13:
%t75 = load i32, i32* %t58
%t76 = icmp sgt i32 %t75, 0
%t77 = icmp ne i32 %t76, 0
br i1 %t77, label %while.body.14, label %while.end.15
while.body.14:
%t78 = alloca i32
store i32 0, i32* %t78
store i32 0, i32* %t78
%t79 = load i32, i32* %t78
%t80 = load i32, i32* %t58
%t81 = call i32 @swap(i32* %arg.arr, i32 %t79, i32 %t80)
store i32 %t81, i32* %t59
%t82 = load i32, i32* %t58
%t83 = sub i32 %t82, 1
store i32 %t83, i32* %t59
%t84 = load i32, i32* %t78
%t85 = load i32, i32* %t59
%t86 = call i32 @heap_ajust(i32* %arg.arr, i32 %t84, i32 %t85)
store i32 %t86, i32* %t59
%t87 = load i32, i32* %t58
%t88 = sub i32 %t87, 1
store i32 %t88, i32* %t58
br label %while.cond.13
while.end.15:
ret i32 0
}
define i32 @main() {
entry:
store i32 10, i32* @n
%t89 = alloca i32, i32 10
%t90 = getelementptr inbounds i32, i32* %t89, i32 0
store i32 0, i32* %t90
%t91 = getelementptr inbounds i32, i32* %t89, i32 1
store i32 0, i32* %t91
%t92 = getelementptr inbounds i32, i32* %t89, i32 2
store i32 0, i32* %t92
%t93 = getelementptr inbounds i32, i32* %t89, i32 3
store i32 0, i32* %t93
%t94 = getelementptr inbounds i32, i32* %t89, i32 4
store i32 0, i32* %t94
%t95 = getelementptr inbounds i32, i32* %t89, i32 5
store i32 0, i32* %t95
%t96 = getelementptr inbounds i32, i32* %t89, i32 6
store i32 0, i32* %t96
%t97 = getelementptr inbounds i32, i32* %t89, i32 7
store i32 0, i32* %t97
%t98 = getelementptr inbounds i32, i32* %t89, i32 8
store i32 0, i32* %t98
%t99 = getelementptr inbounds i32, i32* %t89, i32 9
store i32 0, i32* %t99
%t100 = getelementptr inbounds i32, i32* %t89, i32 0
store i32 4, i32* %t100
%t101 = getelementptr inbounds i32, i32* %t89, i32 1
store i32 3, i32* %t101
%t102 = getelementptr inbounds i32, i32* %t89, i32 2
store i32 9, i32* %t102
%t103 = getelementptr inbounds i32, i32* %t89, i32 3
store i32 2, i32* %t103
%t104 = getelementptr inbounds i32, i32* %t89, i32 4
store i32 0, i32* %t104
%t105 = getelementptr inbounds i32, i32* %t89, i32 5
store i32 1, i32* %t105
%t106 = getelementptr inbounds i32, i32* %t89, i32 6
store i32 6, i32* %t106
%t107 = getelementptr inbounds i32, i32* %t89, i32 7
store i32 5, i32* %t107
%t108 = getelementptr inbounds i32, i32* %t89, i32 8
store i32 7, i32* %t108
%t109 = getelementptr inbounds i32, i32* %t89, i32 9
store i32 8, i32* %t109
%t110 = alloca i32
store i32 0, i32* %t110
store i32 0, i32* %t110
%t111 = load i32, i32* @n
%t112 = call i32 @heap_sort(i32* %t89, i32 %t111)
store i32 %t112, i32* %t110
br label %while.cond.16
while.cond.16:
%t113 = load i32, i32* %t110
%t114 = load i32, i32* @n
%t115 = icmp slt i32 %t113, %t114
%t116 = icmp ne i32 %t115, 0
br i1 %t116, label %while.body.17, label %while.end.18
while.body.17:
%t117 = alloca i32
store i32 0, i32* %t117
%t118 = load i32, i32* %t110
%t119 = getelementptr inbounds i32, i32* %t89, i32 %t118
%t120 = load i32, i32* %t119
store i32 %t120, i32* %t117
%t121 = load i32, i32* %t117
call void @putint(i32 %t121)
store i32 10, i32* %t117
%t123 = load i32, i32* %t117
call void @putch(i32 %t123)
%t125 = load i32, i32* %t110
%t126 = add i32 %t125, 1
store i32 %t126, i32* %t110
br label %while.cond.16
while.end.18:
ret i32 0
}

@ -0,0 +1,249 @@
@n = global i32 0
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @counting_sort(i32* %arg.ini_arr, i32* %arg.sorted_arr, i32 %arg.n) {
entry:
%t0 = alloca i32
store i32 %arg.n, i32* %t0
%t1 = alloca i32, i32 10
%t2 = getelementptr inbounds i32, i32* %t1, i32 0
store i32 0, i32* %t2
%t3 = getelementptr inbounds i32, i32* %t1, i32 1
store i32 0, i32* %t3
%t4 = getelementptr inbounds i32, i32* %t1, i32 2
store i32 0, i32* %t4
%t5 = getelementptr inbounds i32, i32* %t1, i32 3
store i32 0, i32* %t5
%t6 = getelementptr inbounds i32, i32* %t1, i32 4
store i32 0, i32* %t6
%t7 = getelementptr inbounds i32, i32* %t1, i32 5
store i32 0, i32* %t7
%t8 = getelementptr inbounds i32, i32* %t1, i32 6
store i32 0, i32* %t8
%t9 = getelementptr inbounds i32, i32* %t1, i32 7
store i32 0, i32* %t9
%t10 = getelementptr inbounds i32, i32* %t1, i32 8
store i32 0, i32* %t10
%t11 = getelementptr inbounds i32, i32* %t1, i32 9
store i32 0, i32* %t11
%t12 = alloca i32
store i32 0, i32* %t12
%t13 = alloca i32
store i32 0, i32* %t13
%t14 = alloca i32
store i32 0, i32* %t14
store i32 0, i32* %t14
store i32 0, i32* %t12
store i32 0, i32* %t13
br label %while.cond.1
while.cond.1:
%t15 = load i32, i32* %t14
%t16 = icmp slt i32 %t15, 10
%t17 = icmp ne i32 %t16, 0
br i1 %t17, label %while.body.2, label %while.end.3
while.body.2:
%t18 = load i32, i32* %t14
%t19 = getelementptr inbounds i32, i32* %t1, i32 %t18
store i32 0, i32* %t19
%t20 = load i32, i32* %t14
%t21 = add i32 %t20, 1
store i32 %t21, i32* %t14
br label %while.cond.1
while.end.3:
br label %while.cond.4
while.cond.4:
%t22 = load i32, i32* %t12
%t23 = load i32, i32* %t0
%t24 = icmp slt i32 %t22, %t23
%t25 = icmp ne i32 %t24, 0
br i1 %t25, label %while.body.5, label %while.end.6
while.body.5:
%t26 = load i32, i32* %t12
%t27 = getelementptr inbounds i32, i32* %arg.ini_arr, i32 %t26
%t28 = load i32, i32* %t27
%t29 = getelementptr inbounds i32, i32* %t1, i32 %t28
%t30 = load i32, i32* %t12
%t31 = getelementptr inbounds i32, i32* %arg.ini_arr, i32 %t30
%t32 = load i32, i32* %t31
%t33 = getelementptr inbounds i32, i32* %t1, i32 %t32
%t34 = load i32, i32* %t33
%t35 = add i32 %t34, 1
store i32 %t35, i32* %t29
%t36 = load i32, i32* %t12
%t37 = add i32 %t36, 1
store i32 %t37, i32* %t12
br label %while.cond.4
while.end.6:
store i32 1, i32* %t14
br label %while.cond.7
while.cond.7:
%t38 = load i32, i32* %t14
%t39 = icmp slt i32 %t38, 10
%t40 = icmp ne i32 %t39, 0
br i1 %t40, label %while.body.8, label %while.end.9
while.body.8:
%t41 = load i32, i32* %t14
%t42 = getelementptr inbounds i32, i32* %t1, i32 %t41
%t43 = load i32, i32* %t14
%t44 = getelementptr inbounds i32, i32* %t1, i32 %t43
%t45 = load i32, i32* %t44
%t46 = load i32, i32* %t14
%t47 = sub i32 %t46, 1
%t48 = getelementptr inbounds i32, i32* %t1, i32 %t47
%t49 = load i32, i32* %t48
%t50 = add i32 %t45, %t49
store i32 %t50, i32* %t42
%t51 = load i32, i32* %t14
%t52 = add i32 %t51, 1
store i32 %t52, i32* %t14
br label %while.cond.7
while.end.9:
%t53 = load i32, i32* %t0
store i32 %t53, i32* %t13
br label %while.cond.10
while.cond.10:
%t54 = load i32, i32* %t13
%t55 = icmp sgt i32 %t54, 0
%t56 = icmp ne i32 %t55, 0
br i1 %t56, label %while.body.11, label %while.end.12
while.body.11:
%t57 = load i32, i32* %t13
%t58 = sub i32 %t57, 1
%t59 = getelementptr inbounds i32, i32* %arg.ini_arr, i32 %t58
%t60 = load i32, i32* %t59
%t61 = getelementptr inbounds i32, i32* %t1, i32 %t60
%t62 = load i32, i32* %t13
%t63 = sub i32 %t62, 1
%t64 = getelementptr inbounds i32, i32* %arg.ini_arr, i32 %t63
%t65 = load i32, i32* %t64
%t66 = getelementptr inbounds i32, i32* %t1, i32 %t65
%t67 = load i32, i32* %t66
%t68 = sub i32 %t67, 1
store i32 %t68, i32* %t61
%t69 = load i32, i32* %t13
%t70 = sub i32 %t69, 1
%t71 = getelementptr inbounds i32, i32* %arg.ini_arr, i32 %t70
%t72 = load i32, i32* %t71
%t73 = getelementptr inbounds i32, i32* %t1, i32 %t72
%t74 = load i32, i32* %t73
%t75 = getelementptr inbounds i32, i32* %arg.sorted_arr, i32 %t74
%t76 = load i32, i32* %t13
%t77 = sub i32 %t76, 1
%t78 = getelementptr inbounds i32, i32* %arg.ini_arr, i32 %t77
%t79 = load i32, i32* %t78
store i32 %t79, i32* %t75
%t80 = load i32, i32* %t13
%t81 = sub i32 %t80, 1
store i32 %t81, i32* %t13
br label %while.cond.10
while.end.12:
ret i32 0
}
define i32 @main() {
entry:
store i32 10, i32* @n
%t82 = alloca i32, i32 10
%t83 = getelementptr inbounds i32, i32* %t82, i32 0
store i32 0, i32* %t83
%t84 = getelementptr inbounds i32, i32* %t82, i32 1
store i32 0, i32* %t84
%t85 = getelementptr inbounds i32, i32* %t82, i32 2
store i32 0, i32* %t85
%t86 = getelementptr inbounds i32, i32* %t82, i32 3
store i32 0, i32* %t86
%t87 = getelementptr inbounds i32, i32* %t82, i32 4
store i32 0, i32* %t87
%t88 = getelementptr inbounds i32, i32* %t82, i32 5
store i32 0, i32* %t88
%t89 = getelementptr inbounds i32, i32* %t82, i32 6
store i32 0, i32* %t89
%t90 = getelementptr inbounds i32, i32* %t82, i32 7
store i32 0, i32* %t90
%t91 = getelementptr inbounds i32, i32* %t82, i32 8
store i32 0, i32* %t91
%t92 = getelementptr inbounds i32, i32* %t82, i32 9
store i32 0, i32* %t92
%t93 = getelementptr inbounds i32, i32* %t82, i32 0
store i32 4, i32* %t93
%t94 = getelementptr inbounds i32, i32* %t82, i32 1
store i32 3, i32* %t94
%t95 = getelementptr inbounds i32, i32* %t82, i32 2
store i32 9, i32* %t95
%t96 = getelementptr inbounds i32, i32* %t82, i32 3
store i32 2, i32* %t96
%t97 = getelementptr inbounds i32, i32* %t82, i32 4
store i32 0, i32* %t97
%t98 = getelementptr inbounds i32, i32* %t82, i32 5
store i32 1, i32* %t98
%t99 = getelementptr inbounds i32, i32* %t82, i32 6
store i32 6, i32* %t99
%t100 = getelementptr inbounds i32, i32* %t82, i32 7
store i32 5, i32* %t100
%t101 = getelementptr inbounds i32, i32* %t82, i32 8
store i32 7, i32* %t101
%t102 = getelementptr inbounds i32, i32* %t82, i32 9
store i32 8, i32* %t102
%t103 = alloca i32
store i32 0, i32* %t103
store i32 0, i32* %t103
%t104 = alloca i32, i32 10
%t105 = getelementptr inbounds i32, i32* %t104, i32 0
store i32 0, i32* %t105
%t106 = getelementptr inbounds i32, i32* %t104, i32 1
store i32 0, i32* %t106
%t107 = getelementptr inbounds i32, i32* %t104, i32 2
store i32 0, i32* %t107
%t108 = getelementptr inbounds i32, i32* %t104, i32 3
store i32 0, i32* %t108
%t109 = getelementptr inbounds i32, i32* %t104, i32 4
store i32 0, i32* %t109
%t110 = getelementptr inbounds i32, i32* %t104, i32 5
store i32 0, i32* %t110
%t111 = getelementptr inbounds i32, i32* %t104, i32 6
store i32 0, i32* %t111
%t112 = getelementptr inbounds i32, i32* %t104, i32 7
store i32 0, i32* %t112
%t113 = getelementptr inbounds i32, i32* %t104, i32 8
store i32 0, i32* %t113
%t114 = getelementptr inbounds i32, i32* %t104, i32 9
store i32 0, i32* %t114
%t115 = load i32, i32* @n
%t116 = call i32 @counting_sort(i32* %t82, i32* %t104, i32 %t115)
store i32 %t116, i32* %t103
br label %while.cond.13
while.cond.13:
%t117 = load i32, i32* %t103
%t118 = load i32, i32* @n
%t119 = icmp slt i32 %t117, %t118
%t120 = icmp ne i32 %t119, 0
br i1 %t120, label %while.body.14, label %while.end.15
while.body.14:
%t121 = alloca i32
store i32 0, i32* %t121
%t122 = load i32, i32* %t103
%t123 = getelementptr inbounds i32, i32* %t104, i32 %t122
%t124 = load i32, i32* %t123
store i32 %t124, i32* %t121
%t125 = load i32, i32* %t121
call void @putint(i32 %t125)
store i32 10, i32* %t121
%t127 = load i32, i32* %t121
call void @putch(i32 %t127)
%t129 = load i32, i32* %t103
%t130 = add i32 %t129, 1
store i32 %t130, i32* %t103
br label %while.cond.13
while.end.15:
ret i32 0
}

@ -0,0 +1,184 @@
@buf = global [200 x i32] zeroinitializer
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define void @merge_sort(i32 %arg.l, i32 %arg.r) {
entry:
%t0 = alloca i32
store i32 %arg.l, i32* %t0
%t1 = alloca i32
store i32 %arg.r, i32* %t1
%t2 = load i32, i32* %t0
%t3 = add i32 %t2, 1
%t4 = load i32, i32* %t1
%t5 = icmp sge i32 %t3, %t4
%t6 = icmp ne i32 %t5, 0
br i1 %t6, label %if.then.1, label %if.end.2
if.then.1:
ret void
if.end.2:
%t7 = alloca i32
%t8 = load i32, i32* %t0
%t9 = load i32, i32* %t1
%t10 = add i32 %t8, %t9
%t11 = sdiv i32 %t10, 2
store i32 %t11, i32* %t7
%t12 = load i32, i32* %t0
%t13 = load i32, i32* %t7
call void @merge_sort(i32 %t12, i32 %t13)
%t15 = load i32, i32* %t7
%t16 = load i32, i32* %t1
call void @merge_sort(i32 %t15, i32 %t16)
%t18 = alloca i32
%t19 = load i32, i32* %t0
store i32 %t19, i32* %t18
%t20 = alloca i32
%t21 = load i32, i32* %t7
store i32 %t21, i32* %t20
%t22 = alloca i32
%t23 = load i32, i32* %t0
store i32 %t23, i32* %t22
br label %while.cond.3
while.cond.3:
%t24 = load i32, i32* %t18
%t25 = load i32, i32* %t7
%t26 = icmp slt i32 %t24, %t25
%t27 = icmp ne i32 %t26, 0
br i1 %t27, label %land.rhs.6, label %while.end.5
while.body.4:
%t32 = load i32, i32* %t18
%t33 = getelementptr inbounds [200 x i32], [200 x i32]* @buf, i32 0, i32 %t32
%t34 = load i32, i32* %t33
%t35 = load i32, i32* %t20
%t36 = getelementptr inbounds [200 x i32], [200 x i32]* @buf, i32 0, i32 %t35
%t37 = load i32, i32* %t36
%t38 = icmp slt i32 %t34, %t37
%t39 = icmp ne i32 %t38, 0
br i1 %t39, label %if.then.7, label %if.else.9
while.end.5:
br label %while.cond.10
land.rhs.6:
%t28 = load i32, i32* %t20
%t29 = load i32, i32* %t1
%t30 = icmp slt i32 %t28, %t29
%t31 = icmp ne i32 %t30, 0
br i1 %t31, label %while.body.4, label %while.end.5
if.then.7:
%t40 = load i32, i32* %t22
%t41 = add i32 100, %t40
%t42 = getelementptr inbounds [200 x i32], [200 x i32]* @buf, i32 0, i32 %t41
%t43 = load i32, i32* %t18
%t44 = getelementptr inbounds [200 x i32], [200 x i32]* @buf, i32 0, i32 %t43
%t45 = load i32, i32* %t44
store i32 %t45, i32* %t42
%t46 = load i32, i32* %t18
%t47 = add i32 %t46, 1
store i32 %t47, i32* %t18
br label %if.end.8
if.end.8:
%t56 = load i32, i32* %t22
%t57 = add i32 %t56, 1
store i32 %t57, i32* %t22
br label %while.cond.3
if.else.9:
%t48 = load i32, i32* %t22
%t49 = add i32 100, %t48
%t50 = getelementptr inbounds [200 x i32], [200 x i32]* @buf, i32 0, i32 %t49
%t51 = load i32, i32* %t20
%t52 = getelementptr inbounds [200 x i32], [200 x i32]* @buf, i32 0, i32 %t51
%t53 = load i32, i32* %t52
store i32 %t53, i32* %t50
%t54 = load i32, i32* %t20
%t55 = add i32 %t54, 1
store i32 %t55, i32* %t20
br label %if.end.8
while.cond.10:
%t58 = load i32, i32* %t18
%t59 = load i32, i32* %t7
%t60 = icmp slt i32 %t58, %t59
%t61 = icmp ne i32 %t60, 0
br i1 %t61, label %while.body.11, label %while.end.12
while.body.11:
%t62 = load i32, i32* %t22
%t63 = add i32 100, %t62
%t64 = getelementptr inbounds [200 x i32], [200 x i32]* @buf, i32 0, i32 %t63
%t65 = load i32, i32* %t18
%t66 = getelementptr inbounds [200 x i32], [200 x i32]* @buf, i32 0, i32 %t65
%t67 = load i32, i32* %t66
store i32 %t67, i32* %t64
%t68 = load i32, i32* %t18
%t69 = add i32 %t68, 1
store i32 %t69, i32* %t18
%t70 = load i32, i32* %t22
%t71 = add i32 %t70, 1
store i32 %t71, i32* %t22
br label %while.cond.10
while.end.12:
br label %while.cond.13
while.cond.13:
%t72 = load i32, i32* %t20
%t73 = load i32, i32* %t1
%t74 = icmp slt i32 %t72, %t73
%t75 = icmp ne i32 %t74, 0
br i1 %t75, label %while.body.14, label %while.end.15
while.body.14:
%t76 = load i32, i32* %t22
%t77 = add i32 100, %t76
%t78 = getelementptr inbounds [200 x i32], [200 x i32]* @buf, i32 0, i32 %t77
%t79 = load i32, i32* %t20
%t80 = getelementptr inbounds [200 x i32], [200 x i32]* @buf, i32 0, i32 %t79
%t81 = load i32, i32* %t80
store i32 %t81, i32* %t78
%t82 = load i32, i32* %t20
%t83 = add i32 %t82, 1
store i32 %t83, i32* %t20
%t84 = load i32, i32* %t22
%t85 = add i32 %t84, 1
store i32 %t85, i32* %t22
br label %while.cond.13
while.end.15:
br label %while.cond.16
while.cond.16:
%t86 = load i32, i32* %t0
%t87 = load i32, i32* %t1
%t88 = icmp slt i32 %t86, %t87
%t89 = icmp ne i32 %t88, 0
br i1 %t89, label %while.body.17, label %while.end.18
while.body.17:
%t90 = load i32, i32* %t0
%t91 = getelementptr inbounds [200 x i32], [200 x i32]* @buf, i32 0, i32 %t90
%t92 = load i32, i32* %t0
%t93 = add i32 100, %t92
%t94 = getelementptr inbounds [200 x i32], [200 x i32]* @buf, i32 0, i32 %t93
%t95 = load i32, i32* %t94
store i32 %t95, i32* %t91
%t96 = load i32, i32* %t0
%t97 = add i32 %t96, 1
store i32 %t97, i32* %t0
br label %while.cond.16
while.end.18:
ret void
}
define i32 @main() {
entry:
%t98 = alloca i32
%t99 = getelementptr inbounds [200 x i32], [200 x i32]* @buf, i32 0, i32 0
%t100 = call i32 @getarray(i32* %t99)
store i32 %t100, i32* %t98
%t101 = load i32, i32* %t98
call void @merge_sort(i32 0, i32 %t101)
%t103 = load i32, i32* %t98
%t104 = getelementptr inbounds [200 x i32], [200 x i32]* @buf, i32 0, i32 0
call void @putarray(i32 %t103, i32* %t104)
ret i32 0
}

@ -0,0 +1,320 @@
@array = global [110 x i32] zeroinitializer
@n = global i32 0
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define void @init(i32 %arg.n) {
entry:
%t0 = alloca i32
store i32 %arg.n, i32* %t0
%t1 = alloca i32
store i32 1, i32* %t1
br label %while.cond.1
while.cond.1:
%t2 = load i32, i32* %t1
%t3 = load i32, i32* %t0
%t4 = load i32, i32* %t0
%t5 = mul i32 %t3, %t4
%t6 = add i32 %t5, 1
%t7 = icmp sle i32 %t2, %t6
%t8 = icmp ne i32 %t7, 0
br i1 %t8, label %while.body.2, label %while.end.3
while.body.2:
%t9 = load i32, i32* %t1
%t10 = getelementptr inbounds [110 x i32], [110 x i32]* @array, i32 0, i32 %t9
store i32 -1, i32* %t10
%t11 = load i32, i32* %t1
%t12 = add i32 %t11, 1
store i32 %t12, i32* %t1
br label %while.cond.1
while.end.3:
ret void
}
define i32 @findfa(i32 %arg.a) {
entry:
%t13 = alloca i32
store i32 %arg.a, i32* %t13
%t14 = load i32, i32* %t13
%t15 = getelementptr inbounds [110 x i32], [110 x i32]* @array, i32 0, i32 %t14
%t16 = load i32, i32* %t15
%t17 = load i32, i32* %t13
%t18 = icmp eq i32 %t16, %t17
%t19 = icmp ne i32 %t18, 0
br i1 %t19, label %if.then.4, label %if.else.6
if.then.4:
%t20 = load i32, i32* %t13
ret i32 %t20
if.end.5:
ret i32 0
if.else.6:
%t21 = load i32, i32* %t13
%t22 = getelementptr inbounds [110 x i32], [110 x i32]* @array, i32 0, i32 %t21
%t23 = load i32, i32* %t13
%t24 = getelementptr inbounds [110 x i32], [110 x i32]* @array, i32 0, i32 %t23
%t25 = load i32, i32* %t24
%t26 = call i32 @findfa(i32 %t25)
store i32 %t26, i32* %t22
%t27 = load i32, i32* %t13
%t28 = getelementptr inbounds [110 x i32], [110 x i32]* @array, i32 0, i32 %t27
%t29 = load i32, i32* %t28
ret i32 %t29
}
define void @mmerge(i32 %arg.a, i32 %arg.b) {
entry:
%t30 = alloca i32
store i32 %arg.a, i32* %t30
%t31 = alloca i32
store i32 %arg.b, i32* %t31
%t32 = alloca i32
%t33 = load i32, i32* %t30
%t34 = call i32 @findfa(i32 %t33)
store i32 %t34, i32* %t32
%t35 = alloca i32
%t36 = load i32, i32* %t31
%t37 = call i32 @findfa(i32 %t36)
store i32 %t37, i32* %t35
%t38 = load i32, i32* %t32
%t39 = load i32, i32* %t35
%t40 = icmp ne i32 %t38, %t39
%t41 = icmp ne i32 %t40, 0
br i1 %t41, label %if.then.7, label %if.end.8
if.then.7:
%t42 = load i32, i32* %t32
%t43 = getelementptr inbounds [110 x i32], [110 x i32]* @array, i32 0, i32 %t42
%t44 = load i32, i32* %t35
store i32 %t44, i32* %t43
br label %if.end.8
if.end.8:
ret void
}
define i32 @main() {
entry:
%t45 = alloca i32
store i32 0, i32* %t45
%t46 = alloca i32
store i32 0, i32* %t46
%t47 = alloca i32
store i32 0, i32* %t47
%t48 = alloca i32
store i32 0, i32* %t48
store i32 1, i32* %t45
br label %while.cond.9
while.cond.9:
%t49 = load i32, i32* %t45
%t50 = icmp ne i32 %t49, 0
br i1 %t50, label %while.body.10, label %while.end.11
while.body.10:
%t51 = load i32, i32* %t45
%t52 = sub i32 %t51, 1
store i32 %t52, i32* %t45
store i32 4, i32* @n
store i32 10, i32* %t46
%t53 = alloca i32
store i32 0, i32* %t53
%t54 = alloca i32
store i32 0, i32* %t54
%t55 = load i32, i32* @n
call void @init(i32 %t55)
%t57 = alloca i32
%t58 = load i32, i32* @n
%t59 = load i32, i32* @n
%t60 = mul i32 %t58, %t59
%t61 = add i32 %t60, 1
store i32 %t61, i32* %t57
br label %while.cond.12
while.end.11:
ret i32 0
while.cond.12:
%t62 = load i32, i32* %t53
%t63 = load i32, i32* %t46
%t64 = icmp slt i32 %t62, %t63
%t65 = icmp ne i32 %t64, 0
br i1 %t65, label %while.body.13, label %while.end.14
while.body.13:
%t66 = call i32 @getint()
store i32 %t66, i32* %t47
%t67 = call i32 @getint()
store i32 %t67, i32* %t48
%t68 = load i32, i32* %t54
%t69 = icmp eq i32 %t68, 0
%t70 = icmp ne i32 %t69, 0
br i1 %t70, label %if.then.15, label %if.end.16
while.end.14:
%t177 = load i32, i32* %t54
%t178 = icmp eq i32 %t177, 0
%t179 = icmp ne i32 %t178, 0
br i1 %t179, label %if.then.37, label %if.end.38
if.then.15:
%t71 = alloca i32
%t72 = load i32, i32* @n
%t73 = load i32, i32* %t47
%t74 = sub i32 %t73, 1
%t75 = mul i32 %t72, %t74
%t76 = load i32, i32* %t48
%t77 = add i32 %t75, %t76
store i32 %t77, i32* %t71
%t78 = load i32, i32* %t71
%t79 = getelementptr inbounds [110 x i32], [110 x i32]* @array, i32 0, i32 %t78
%t80 = load i32, i32* %t71
store i32 %t80, i32* %t79
%t81 = load i32, i32* %t47
%t82 = icmp eq i32 %t81, 1
%t83 = icmp ne i32 %t82, 0
br i1 %t83, label %if.then.17, label %if.end.18
if.end.16:
%t175 = load i32, i32* %t53
%t176 = add i32 %t175, 1
store i32 %t176, i32* %t53
br label %while.cond.12
if.then.17:
%t84 = getelementptr inbounds [110 x i32], [110 x i32]* @array, i32 0, i32 0
store i32 0, i32* %t84
%t85 = load i32, i32* %t71
call void @mmerge(i32 %t85, i32 0)
br label %if.end.18
if.end.18:
%t87 = load i32, i32* %t47
%t88 = load i32, i32* @n
%t89 = icmp eq i32 %t87, %t88
%t90 = icmp ne i32 %t89, 0
br i1 %t90, label %if.then.19, label %if.end.20
if.then.19:
%t91 = load i32, i32* %t57
%t92 = getelementptr inbounds [110 x i32], [110 x i32]* @array, i32 0, i32 %t91
%t93 = load i32, i32* %t57
store i32 %t93, i32* %t92
%t94 = load i32, i32* %t71
%t95 = load i32, i32* %t57
call void @mmerge(i32 %t94, i32 %t95)
br label %if.end.20
if.end.20:
%t97 = load i32, i32* %t48
%t98 = load i32, i32* @n
%t99 = icmp slt i32 %t97, %t98
%t100 = icmp ne i32 %t99, 0
br i1 %t100, label %land.rhs.23, label %if.end.22
if.then.21:
%t107 = load i32, i32* %t71
%t108 = load i32, i32* %t71
%t109 = add i32 %t108, 1
call void @mmerge(i32 %t107, i32 %t109)
br label %if.end.22
if.end.22:
%t111 = load i32, i32* %t48
%t112 = icmp sgt i32 %t111, 1
%t113 = icmp ne i32 %t112, 0
br i1 %t113, label %land.rhs.26, label %if.end.25
land.rhs.23:
%t101 = load i32, i32* %t71
%t102 = add i32 %t101, 1
%t103 = getelementptr inbounds [110 x i32], [110 x i32]* @array, i32 0, i32 %t102
%t104 = load i32, i32* %t103
%t105 = icmp ne i32 %t104, -1
%t106 = icmp ne i32 %t105, 0
br i1 %t106, label %if.then.21, label %if.end.22
if.then.24:
%t120 = load i32, i32* %t71
%t121 = load i32, i32* %t71
%t122 = sub i32 %t121, 1
call void @mmerge(i32 %t120, i32 %t122)
br label %if.end.25
if.end.25:
%t124 = load i32, i32* %t47
%t125 = load i32, i32* @n
%t126 = icmp slt i32 %t124, %t125
%t127 = icmp ne i32 %t126, 0
br i1 %t127, label %land.rhs.29, label %if.end.28
land.rhs.26:
%t114 = load i32, i32* %t71
%t115 = sub i32 %t114, 1
%t116 = getelementptr inbounds [110 x i32], [110 x i32]* @array, i32 0, i32 %t115
%t117 = load i32, i32* %t116
%t118 = icmp ne i32 %t117, -1
%t119 = icmp ne i32 %t118, 0
br i1 %t119, label %if.then.24, label %if.end.25
if.then.27:
%t135 = load i32, i32* %t71
%t136 = load i32, i32* %t71
%t137 = load i32, i32* @n
%t138 = add i32 %t136, %t137
call void @mmerge(i32 %t135, i32 %t138)
br label %if.end.28
if.end.28:
%t140 = load i32, i32* %t47
%t141 = icmp sgt i32 %t140, 1
%t142 = icmp ne i32 %t141, 0
br i1 %t142, label %land.rhs.32, label %if.end.31
land.rhs.29:
%t128 = load i32, i32* %t71
%t129 = load i32, i32* @n
%t130 = add i32 %t128, %t129
%t131 = getelementptr inbounds [110 x i32], [110 x i32]* @array, i32 0, i32 %t130
%t132 = load i32, i32* %t131
%t133 = icmp ne i32 %t132, -1
%t134 = icmp ne i32 %t133, 0
br i1 %t134, label %if.then.27, label %if.end.28
if.then.30:
%t150 = load i32, i32* %t71
%t151 = load i32, i32* %t71
%t152 = load i32, i32* @n
%t153 = sub i32 %t151, %t152
call void @mmerge(i32 %t150, i32 %t153)
br label %if.end.31
if.end.31:
%t155 = getelementptr inbounds [110 x i32], [110 x i32]* @array, i32 0, i32 0
%t156 = load i32, i32* %t155
%t157 = icmp ne i32 %t156, -1
%t158 = icmp ne i32 %t157, 0
br i1 %t158, label %land.rhs.36, label %if.end.34
land.rhs.32:
%t143 = load i32, i32* %t71
%t144 = load i32, i32* @n
%t145 = sub i32 %t143, %t144
%t146 = getelementptr inbounds [110 x i32], [110 x i32]* @array, i32 0, i32 %t145
%t147 = load i32, i32* %t146
%t148 = icmp ne i32 %t147, -1
%t149 = icmp ne i32 %t148, 0
br i1 %t149, label %if.then.30, label %if.end.31
if.then.33:
store i32 1, i32* %t54
%t169 = alloca i32
%t170 = load i32, i32* %t53
%t171 = add i32 %t170, 1
store i32 %t171, i32* %t169
%t172 = load i32, i32* %t169
call void @putint(i32 %t172)
call void @putch(i32 10)
br label %if.end.34
if.end.34:
br label %if.end.16
land.rhs.35:
%t164 = call i32 @findfa(i32 0)
%t165 = load i32, i32* %t57
%t166 = call i32 @findfa(i32 %t165)
%t167 = icmp eq i32 %t164, %t166
%t168 = icmp ne i32 %t167, 0
br i1 %t168, label %if.then.33, label %if.end.34
land.rhs.36:
%t159 = load i32, i32* %t57
%t160 = getelementptr inbounds [110 x i32], [110 x i32]* @array, i32 0, i32 %t159
%t161 = load i32, i32* %t160
%t162 = icmp ne i32 %t161, -1
%t163 = icmp ne i32 %t162, 0
br i1 %t163, label %land.rhs.35, label %if.end.34
if.then.37:
call void @putint(i32 -1)
call void @putch(i32 10)
br label %if.end.38
if.end.38:
br label %while.cond.9
}

@ -0,0 +1,470 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @main() {
entry:
%t0 = alloca i32
store i32 0, i32* %t0
%t1 = alloca i32
store i32 0, i32* %t1
%t2 = alloca i32
store i32 0, i32* %t2
%t3 = alloca i32
store i32 0, i32* %t3
%t4 = alloca i32
store i32 0, i32* %t4
%t5 = alloca i32, i32 20
%t6 = getelementptr inbounds i32, i32* %t5, i32 0
store i32 1, i32* %t6
%t7 = getelementptr inbounds i32, i32* %t5, i32 1
store i32 2, i32* %t7
%t8 = getelementptr inbounds i32, i32* %t5, i32 2
store i32 3, i32* %t8
%t9 = getelementptr inbounds i32, i32* %t5, i32 3
store i32 4, i32* %t9
%t10 = getelementptr inbounds i32, i32* %t5, i32 4
store i32 5, i32* %t10
%t11 = getelementptr inbounds i32, i32* %t5, i32 5
store i32 6, i32* %t11
%t12 = getelementptr inbounds i32, i32* %t5, i32 6
store i32 7, i32* %t12
%t13 = getelementptr inbounds i32, i32* %t5, i32 7
store i32 8, i32* %t13
%t14 = getelementptr inbounds i32, i32* %t5, i32 8
store i32 9, i32* %t14
%t15 = getelementptr inbounds i32, i32* %t5, i32 9
store i32 0, i32* %t15
%t16 = getelementptr inbounds i32, i32* %t5, i32 10
store i32 1, i32* %t16
%t17 = getelementptr inbounds i32, i32* %t5, i32 11
store i32 2, i32* %t17
%t18 = getelementptr inbounds i32, i32* %t5, i32 12
store i32 3, i32* %t18
%t19 = getelementptr inbounds i32, i32* %t5, i32 13
store i32 4, i32* %t19
%t20 = getelementptr inbounds i32, i32* %t5, i32 14
store i32 5, i32* %t20
%t21 = getelementptr inbounds i32, i32* %t5, i32 15
store i32 6, i32* %t21
%t22 = getelementptr inbounds i32, i32* %t5, i32 16
store i32 7, i32* %t22
%t23 = getelementptr inbounds i32, i32* %t5, i32 17
store i32 8, i32* %t23
%t24 = getelementptr inbounds i32, i32* %t5, i32 18
store i32 9, i32* %t24
%t25 = getelementptr inbounds i32, i32* %t5, i32 19
store i32 0, i32* %t25
%t26 = alloca i32, i32 20
%t27 = getelementptr inbounds i32, i32* %t26, i32 0
store i32 2, i32* %t27
%t28 = getelementptr inbounds i32, i32* %t26, i32 1
store i32 3, i32* %t28
%t29 = getelementptr inbounds i32, i32* %t26, i32 2
store i32 4, i32* %t29
%t30 = getelementptr inbounds i32, i32* %t26, i32 3
store i32 2, i32* %t30
%t31 = getelementptr inbounds i32, i32* %t26, i32 4
store i32 5, i32* %t31
%t32 = getelementptr inbounds i32, i32* %t26, i32 5
store i32 7, i32* %t32
%t33 = getelementptr inbounds i32, i32* %t26, i32 6
store i32 9, i32* %t33
%t34 = getelementptr inbounds i32, i32* %t26, i32 7
store i32 9, i32* %t34
%t35 = getelementptr inbounds i32, i32* %t26, i32 8
store i32 0, i32* %t35
%t36 = getelementptr inbounds i32, i32* %t26, i32 9
store i32 1, i32* %t36
%t37 = getelementptr inbounds i32, i32* %t26, i32 10
store i32 9, i32* %t37
%t38 = getelementptr inbounds i32, i32* %t26, i32 11
store i32 8, i32* %t38
%t39 = getelementptr inbounds i32, i32* %t26, i32 12
store i32 7, i32* %t39
%t40 = getelementptr inbounds i32, i32* %t26, i32 13
store i32 6, i32* %t40
%t41 = getelementptr inbounds i32, i32* %t26, i32 14
store i32 4, i32* %t41
%t42 = getelementptr inbounds i32, i32* %t26, i32 15
store i32 3, i32* %t42
%t43 = getelementptr inbounds i32, i32* %t26, i32 16
store i32 2, i32* %t43
%t44 = getelementptr inbounds i32, i32* %t26, i32 17
store i32 1, i32* %t44
%t45 = getelementptr inbounds i32, i32* %t26, i32 18
store i32 2, i32* %t45
%t46 = getelementptr inbounds i32, i32* %t26, i32 19
store i32 2, i32* %t46
%t47 = alloca i32
store i32 20, i32* %t47
%t48 = alloca i32
store i32 20, i32* %t48
%t49 = alloca i32, i32 25
%t50 = getelementptr inbounds i32, i32* %t49, i32 0
store i32 0, i32* %t50
%t51 = getelementptr inbounds i32, i32* %t49, i32 1
store i32 0, i32* %t51
%t52 = getelementptr inbounds i32, i32* %t49, i32 2
store i32 0, i32* %t52
%t53 = getelementptr inbounds i32, i32* %t49, i32 3
store i32 0, i32* %t53
%t54 = getelementptr inbounds i32, i32* %t49, i32 4
store i32 0, i32* %t54
%t55 = getelementptr inbounds i32, i32* %t49, i32 5
store i32 0, i32* %t55
%t56 = getelementptr inbounds i32, i32* %t49, i32 6
store i32 0, i32* %t56
%t57 = getelementptr inbounds i32, i32* %t49, i32 7
store i32 0, i32* %t57
%t58 = getelementptr inbounds i32, i32* %t49, i32 8
store i32 0, i32* %t58
%t59 = getelementptr inbounds i32, i32* %t49, i32 9
store i32 0, i32* %t59
%t60 = getelementptr inbounds i32, i32* %t49, i32 10
store i32 0, i32* %t60
%t61 = getelementptr inbounds i32, i32* %t49, i32 11
store i32 0, i32* %t61
%t62 = getelementptr inbounds i32, i32* %t49, i32 12
store i32 0, i32* %t62
%t63 = getelementptr inbounds i32, i32* %t49, i32 13
store i32 0, i32* %t63
%t64 = getelementptr inbounds i32, i32* %t49, i32 14
store i32 0, i32* %t64
%t65 = getelementptr inbounds i32, i32* %t49, i32 15
store i32 0, i32* %t65
%t66 = getelementptr inbounds i32, i32* %t49, i32 16
store i32 0, i32* %t66
%t67 = getelementptr inbounds i32, i32* %t49, i32 17
store i32 0, i32* %t67
%t68 = getelementptr inbounds i32, i32* %t49, i32 18
store i32 0, i32* %t68
%t69 = getelementptr inbounds i32, i32* %t49, i32 19
store i32 0, i32* %t69
%t70 = getelementptr inbounds i32, i32* %t49, i32 20
store i32 0, i32* %t70
%t71 = getelementptr inbounds i32, i32* %t49, i32 21
store i32 0, i32* %t71
%t72 = getelementptr inbounds i32, i32* %t49, i32 22
store i32 0, i32* %t72
%t73 = getelementptr inbounds i32, i32* %t49, i32 23
store i32 0, i32* %t73
%t74 = getelementptr inbounds i32, i32* %t49, i32 24
store i32 0, i32* %t74
%t75 = alloca i32, i32 25
%t76 = getelementptr inbounds i32, i32* %t75, i32 0
store i32 0, i32* %t76
%t77 = getelementptr inbounds i32, i32* %t75, i32 1
store i32 0, i32* %t77
%t78 = getelementptr inbounds i32, i32* %t75, i32 2
store i32 0, i32* %t78
%t79 = getelementptr inbounds i32, i32* %t75, i32 3
store i32 0, i32* %t79
%t80 = getelementptr inbounds i32, i32* %t75, i32 4
store i32 0, i32* %t80
%t81 = getelementptr inbounds i32, i32* %t75, i32 5
store i32 0, i32* %t81
%t82 = getelementptr inbounds i32, i32* %t75, i32 6
store i32 0, i32* %t82
%t83 = getelementptr inbounds i32, i32* %t75, i32 7
store i32 0, i32* %t83
%t84 = getelementptr inbounds i32, i32* %t75, i32 8
store i32 0, i32* %t84
%t85 = getelementptr inbounds i32, i32* %t75, i32 9
store i32 0, i32* %t85
%t86 = getelementptr inbounds i32, i32* %t75, i32 10
store i32 0, i32* %t86
%t87 = getelementptr inbounds i32, i32* %t75, i32 11
store i32 0, i32* %t87
%t88 = getelementptr inbounds i32, i32* %t75, i32 12
store i32 0, i32* %t88
%t89 = getelementptr inbounds i32, i32* %t75, i32 13
store i32 0, i32* %t89
%t90 = getelementptr inbounds i32, i32* %t75, i32 14
store i32 0, i32* %t90
%t91 = getelementptr inbounds i32, i32* %t75, i32 15
store i32 0, i32* %t91
%t92 = getelementptr inbounds i32, i32* %t75, i32 16
store i32 0, i32* %t92
%t93 = getelementptr inbounds i32, i32* %t75, i32 17
store i32 0, i32* %t93
%t94 = getelementptr inbounds i32, i32* %t75, i32 18
store i32 0, i32* %t94
%t95 = getelementptr inbounds i32, i32* %t75, i32 19
store i32 0, i32* %t95
%t96 = getelementptr inbounds i32, i32* %t75, i32 20
store i32 0, i32* %t96
%t97 = getelementptr inbounds i32, i32* %t75, i32 21
store i32 0, i32* %t97
%t98 = getelementptr inbounds i32, i32* %t75, i32 22
store i32 0, i32* %t98
%t99 = getelementptr inbounds i32, i32* %t75, i32 23
store i32 0, i32* %t99
%t100 = getelementptr inbounds i32, i32* %t75, i32 24
store i32 0, i32* %t100
%t101 = alloca i32, i32 40
%t102 = getelementptr inbounds i32, i32* %t101, i32 0
store i32 0, i32* %t102
%t103 = getelementptr inbounds i32, i32* %t101, i32 1
store i32 0, i32* %t103
%t104 = getelementptr inbounds i32, i32* %t101, i32 2
store i32 0, i32* %t104
%t105 = getelementptr inbounds i32, i32* %t101, i32 3
store i32 0, i32* %t105
%t106 = getelementptr inbounds i32, i32* %t101, i32 4
store i32 0, i32* %t106
%t107 = getelementptr inbounds i32, i32* %t101, i32 5
store i32 0, i32* %t107
%t108 = getelementptr inbounds i32, i32* %t101, i32 6
store i32 0, i32* %t108
%t109 = getelementptr inbounds i32, i32* %t101, i32 7
store i32 0, i32* %t109
%t110 = getelementptr inbounds i32, i32* %t101, i32 8
store i32 0, i32* %t110
%t111 = getelementptr inbounds i32, i32* %t101, i32 9
store i32 0, i32* %t111
%t112 = getelementptr inbounds i32, i32* %t101, i32 10
store i32 0, i32* %t112
%t113 = getelementptr inbounds i32, i32* %t101, i32 11
store i32 0, i32* %t113
%t114 = getelementptr inbounds i32, i32* %t101, i32 12
store i32 0, i32* %t114
%t115 = getelementptr inbounds i32, i32* %t101, i32 13
store i32 0, i32* %t115
%t116 = getelementptr inbounds i32, i32* %t101, i32 14
store i32 0, i32* %t116
%t117 = getelementptr inbounds i32, i32* %t101, i32 15
store i32 0, i32* %t117
%t118 = getelementptr inbounds i32, i32* %t101, i32 16
store i32 0, i32* %t118
%t119 = getelementptr inbounds i32, i32* %t101, i32 17
store i32 0, i32* %t119
%t120 = getelementptr inbounds i32, i32* %t101, i32 18
store i32 0, i32* %t120
%t121 = getelementptr inbounds i32, i32* %t101, i32 19
store i32 0, i32* %t121
%t122 = getelementptr inbounds i32, i32* %t101, i32 20
store i32 0, i32* %t122
%t123 = getelementptr inbounds i32, i32* %t101, i32 21
store i32 0, i32* %t123
%t124 = getelementptr inbounds i32, i32* %t101, i32 22
store i32 0, i32* %t124
%t125 = getelementptr inbounds i32, i32* %t101, i32 23
store i32 0, i32* %t125
%t126 = getelementptr inbounds i32, i32* %t101, i32 24
store i32 0, i32* %t126
%t127 = getelementptr inbounds i32, i32* %t101, i32 25
store i32 0, i32* %t127
%t128 = getelementptr inbounds i32, i32* %t101, i32 26
store i32 0, i32* %t128
%t129 = getelementptr inbounds i32, i32* %t101, i32 27
store i32 0, i32* %t129
%t130 = getelementptr inbounds i32, i32* %t101, i32 28
store i32 0, i32* %t130
%t131 = getelementptr inbounds i32, i32* %t101, i32 29
store i32 0, i32* %t131
%t132 = getelementptr inbounds i32, i32* %t101, i32 30
store i32 0, i32* %t132
%t133 = getelementptr inbounds i32, i32* %t101, i32 31
store i32 0, i32* %t133
%t134 = getelementptr inbounds i32, i32* %t101, i32 32
store i32 0, i32* %t134
%t135 = getelementptr inbounds i32, i32* %t101, i32 33
store i32 0, i32* %t135
%t136 = getelementptr inbounds i32, i32* %t101, i32 34
store i32 0, i32* %t136
%t137 = getelementptr inbounds i32, i32* %t101, i32 35
store i32 0, i32* %t137
%t138 = getelementptr inbounds i32, i32* %t101, i32 36
store i32 0, i32* %t138
%t139 = getelementptr inbounds i32, i32* %t101, i32 37
store i32 0, i32* %t139
%t140 = getelementptr inbounds i32, i32* %t101, i32 38
store i32 0, i32* %t140
%t141 = getelementptr inbounds i32, i32* %t101, i32 39
store i32 0, i32* %t141
store i32 0, i32* %t0
br label %while.cond.1
while.cond.1:
%t142 = load i32, i32* %t0
%t143 = load i32, i32* %t47
%t144 = icmp slt i32 %t142, %t143
%t145 = icmp ne i32 %t144, 0
br i1 %t145, label %while.body.2, label %while.end.3
while.body.2:
%t146 = load i32, i32* %t0
%t147 = getelementptr inbounds i32, i32* %t49, i32 %t146
%t148 = load i32, i32* %t0
%t149 = getelementptr inbounds i32, i32* %t5, i32 %t148
%t150 = load i32, i32* %t149
store i32 %t150, i32* %t147
%t151 = load i32, i32* %t0
%t152 = add i32 %t151, 1
store i32 %t152, i32* %t0
br label %while.cond.1
while.end.3:
store i32 0, i32* %t0
br label %while.cond.4
while.cond.4:
%t153 = load i32, i32* %t0
%t154 = load i32, i32* %t48
%t155 = icmp slt i32 %t153, %t154
%t156 = icmp ne i32 %t155, 0
br i1 %t156, label %while.body.5, label %while.end.6
while.body.5:
%t157 = load i32, i32* %t0
%t158 = getelementptr inbounds i32, i32* %t75, i32 %t157
%t159 = load i32, i32* %t0
%t160 = getelementptr inbounds i32, i32* %t26, i32 %t159
%t161 = load i32, i32* %t160
store i32 %t161, i32* %t158
%t162 = load i32, i32* %t0
%t163 = add i32 %t162, 1
store i32 %t163, i32* %t0
br label %while.cond.4
while.end.6:
%t164 = load i32, i32* %t47
%t165 = load i32, i32* %t48
%t166 = add i32 %t164, %t165
%t167 = sub i32 %t166, 1
store i32 %t167, i32* %t3
store i32 0, i32* %t0
br label %while.cond.7
while.cond.7:
%t168 = load i32, i32* %t0
%t169 = load i32, i32* %t3
%t170 = icmp sle i32 %t168, %t169
%t171 = icmp ne i32 %t170, 0
br i1 %t171, label %while.body.8, label %while.end.9
while.body.8:
%t172 = load i32, i32* %t0
%t173 = getelementptr inbounds i32, i32* %t101, i32 %t172
store i32 0, i32* %t173
%t174 = load i32, i32* %t0
%t175 = add i32 %t174, 1
store i32 %t175, i32* %t0
br label %while.cond.7
while.end.9:
store i32 0, i32* %t4
%t176 = load i32, i32* %t48
%t177 = sub i32 %t176, 1
store i32 %t177, i32* %t0
br label %while.cond.10
while.cond.10:
%t178 = load i32, i32* %t0
%t179 = icmp sgt i32 %t178, -1
%t180 = icmp ne i32 %t179, 0
br i1 %t180, label %while.body.11, label %while.end.12
while.body.11:
%t181 = load i32, i32* %t0
%t182 = getelementptr inbounds i32, i32* %t75, i32 %t181
%t183 = load i32, i32* %t182
store i32 %t183, i32* %t2
%t184 = load i32, i32* %t47
%t185 = sub i32 %t184, 1
store i32 %t185, i32* %t1
br label %while.cond.13
while.end.12:
%t227 = getelementptr inbounds i32, i32* %t101, i32 0
%t228 = load i32, i32* %t227
%t229 = icmp ne i32 %t228, 0
%t230 = icmp ne i32 %t229, 0
br i1 %t230, label %if.then.19, label %if.end.20
while.cond.13:
%t186 = load i32, i32* %t1
%t187 = icmp sgt i32 %t186, -1
%t188 = icmp ne i32 %t187, 0
br i1 %t188, label %while.body.14, label %while.end.15
while.body.14:
%t189 = load i32, i32* %t3
%t190 = getelementptr inbounds i32, i32* %t101, i32 %t189
%t191 = load i32, i32* %t190
%t192 = load i32, i32* %t2
%t193 = load i32, i32* %t1
%t194 = getelementptr inbounds i32, i32* %t49, i32 %t193
%t195 = load i32, i32* %t194
%t196 = mul i32 %t192, %t195
%t197 = add i32 %t191, %t196
store i32 %t197, i32* %t4
%t198 = load i32, i32* %t4
%t199 = icmp sge i32 %t198, 10
%t200 = icmp ne i32 %t199, 0
br i1 %t200, label %if.then.16, label %if.else.18
while.end.15:
%t221 = load i32, i32* %t3
%t222 = load i32, i32* %t47
%t223 = add i32 %t221, %t222
%t224 = sub i32 %t223, 1
store i32 %t224, i32* %t3
%t225 = load i32, i32* %t0
%t226 = sub i32 %t225, 1
store i32 %t226, i32* %t0
br label %while.cond.10
if.then.16:
%t201 = load i32, i32* %t3
%t202 = getelementptr inbounds i32, i32* %t101, i32 %t201
%t203 = load i32, i32* %t4
store i32 %t203, i32* %t202
%t204 = load i32, i32* %t3
%t205 = sub i32 %t204, 1
%t206 = getelementptr inbounds i32, i32* %t101, i32 %t205
%t207 = load i32, i32* %t3
%t208 = sub i32 %t207, 1
%t209 = getelementptr inbounds i32, i32* %t101, i32 %t208
%t210 = load i32, i32* %t209
%t211 = load i32, i32* %t4
%t212 = sdiv i32 %t211, 10
%t213 = add i32 %t210, %t212
store i32 %t213, i32* %t206
br label %if.end.17
if.end.17:
%t217 = load i32, i32* %t1
%t218 = sub i32 %t217, 1
store i32 %t218, i32* %t1
%t219 = load i32, i32* %t3
%t220 = sub i32 %t219, 1
store i32 %t220, i32* %t3
br label %while.cond.13
if.else.18:
%t214 = load i32, i32* %t3
%t215 = getelementptr inbounds i32, i32* %t101, i32 %t214
%t216 = load i32, i32* %t4
store i32 %t216, i32* %t215
br label %if.end.17
if.then.19:
%t231 = getelementptr inbounds i32, i32* %t101, i32 0
%t232 = load i32, i32* %t231
call void @putint(i32 %t232)
br label %if.end.20
if.end.20:
store i32 1, i32* %t0
br label %while.cond.21
while.cond.21:
%t234 = load i32, i32* %t0
%t235 = load i32, i32* %t47
%t236 = load i32, i32* %t48
%t237 = add i32 %t235, %t236
%t238 = sub i32 %t237, 1
%t239 = icmp sle i32 %t234, %t238
%t240 = icmp ne i32 %t239, 0
br i1 %t240, label %while.body.22, label %while.end.23
while.body.22:
%t241 = load i32, i32* %t0
%t242 = getelementptr inbounds i32, i32* %t101, i32 %t241
%t243 = load i32, i32* %t242
call void @putint(i32 %t243)
%t245 = load i32, i32* %t0
%t246 = add i32 %t245, 1
store i32 %t246, i32* %t0
br label %while.cond.21
while.end.23:
ret i32 0
}

@ -0,0 +1,789 @@
@ints = global [10000 x i32] zeroinitializer
@intt = global i32 0
@chas = global [10000 x i32] zeroinitializer
@chat = global i32 0
@i = global i32 0
@ii = global i32 1
@c = global i32 0
@get = global [10000 x i32] zeroinitializer
@get2 = global [10000 x i32] zeroinitializer
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @isdigit(i32 %arg.x) {
entry:
%t0 = alloca i32
store i32 %arg.x, i32* %t0
%t1 = load i32, i32* %t0
%t2 = icmp sge i32 %t1, 48
%t3 = icmp ne i32 %t2, 0
br i1 %t3, label %land.rhs.3, label %if.end.2
if.then.1:
ret i32 1
if.end.2:
ret i32 0
land.rhs.3:
%t4 = load i32, i32* %t0
%t5 = icmp sle i32 %t4, 57
%t6 = icmp ne i32 %t5, 0
br i1 %t6, label %if.then.1, label %if.end.2
}
define i32 @power(i32 %arg.b, i32 %arg.a) {
entry:
%t7 = alloca i32
store i32 %arg.b, i32* %t7
%t8 = alloca i32
store i32 %arg.a, i32* %t8
%t9 = alloca i32
store i32 1, i32* %t9
br label %while.cond.4
while.cond.4:
%t10 = load i32, i32* %t8
%t11 = icmp ne i32 %t10, 0
%t12 = icmp ne i32 %t11, 0
br i1 %t12, label %while.body.5, label %while.end.6
while.body.5:
%t13 = load i32, i32* %t9
%t14 = load i32, i32* %t7
%t15 = mul i32 %t13, %t14
store i32 %t15, i32* %t9
%t16 = load i32, i32* %t8
%t17 = sub i32 %t16, 1
store i32 %t17, i32* %t8
br label %while.cond.4
while.end.6:
%t18 = load i32, i32* %t9
ret i32 %t18
}
define i32 @getstr(i32* %arg.get) {
entry:
%t19 = alloca i32
%t20 = call i32 @getch()
store i32 %t20, i32* %t19
%t21 = alloca i32
store i32 0, i32* %t21
br label %while.cond.7
while.cond.7:
%t22 = load i32, i32* %t19
%t23 = icmp ne i32 %t22, 13
%t24 = icmp ne i32 %t23, 0
br i1 %t24, label %land.rhs.10, label %while.end.9
while.body.8:
%t28 = load i32, i32* %t21
%t29 = getelementptr inbounds i32, i32* %arg.get, i32 %t28
%t30 = load i32, i32* %t19
store i32 %t30, i32* %t29
%t31 = load i32, i32* %t21
%t32 = add i32 %t31, 1
store i32 %t32, i32* %t21
%t33 = call i32 @getch()
store i32 %t33, i32* %t19
br label %while.cond.7
while.end.9:
%t34 = load i32, i32* %t21
ret i32 %t34
land.rhs.10:
%t25 = load i32, i32* %t19
%t26 = icmp ne i32 %t25, 10
%t27 = icmp ne i32 %t26, 0
br i1 %t27, label %while.body.8, label %while.end.9
}
define void @intpush(i32 %arg.x) {
entry:
%t35 = alloca i32
store i32 %arg.x, i32* %t35
%t36 = load i32, i32* @intt
%t37 = add i32 %t36, 1
store i32 %t37, i32* @intt
%t38 = load i32, i32* @intt
%t39 = getelementptr inbounds [10000 x i32], [10000 x i32]* @ints, i32 0, i32 %t38
%t40 = load i32, i32* %t35
store i32 %t40, i32* %t39
ret void
}
define void @chapush(i32 %arg.x) {
entry:
%t41 = alloca i32
store i32 %arg.x, i32* %t41
%t42 = load i32, i32* @chat
%t43 = add i32 %t42, 1
store i32 %t43, i32* @chat
%t44 = load i32, i32* @chat
%t45 = getelementptr inbounds [10000 x i32], [10000 x i32]* @chas, i32 0, i32 %t44
%t46 = load i32, i32* %t41
store i32 %t46, i32* %t45
ret void
}
define i32 @intpop() {
entry:
%t47 = load i32, i32* @intt
%t48 = sub i32 %t47, 1
store i32 %t48, i32* @intt
%t49 = load i32, i32* @intt
%t50 = add i32 %t49, 1
%t51 = getelementptr inbounds [10000 x i32], [10000 x i32]* @ints, i32 0, i32 %t50
%t52 = load i32, i32* %t51
ret i32 %t52
}
define i32 @chapop() {
entry:
%t53 = load i32, i32* @chat
%t54 = sub i32 %t53, 1
store i32 %t54, i32* @chat
%t55 = load i32, i32* @chat
%t56 = add i32 %t55, 1
%t57 = getelementptr inbounds [10000 x i32], [10000 x i32]* @chas, i32 0, i32 %t56
%t58 = load i32, i32* %t57
ret i32 %t58
}
define void @intadd(i32 %arg.x) {
entry:
%t59 = alloca i32
store i32 %arg.x, i32* %t59
%t60 = load i32, i32* @intt
%t61 = getelementptr inbounds [10000 x i32], [10000 x i32]* @ints, i32 0, i32 %t60
%t62 = load i32, i32* @intt
%t63 = getelementptr inbounds [10000 x i32], [10000 x i32]* @ints, i32 0, i32 %t62
%t64 = load i32, i32* %t63
%t65 = mul i32 %t64, 10
store i32 %t65, i32* %t61
%t66 = load i32, i32* @intt
%t67 = getelementptr inbounds [10000 x i32], [10000 x i32]* @ints, i32 0, i32 %t66
%t68 = load i32, i32* @intt
%t69 = getelementptr inbounds [10000 x i32], [10000 x i32]* @ints, i32 0, i32 %t68
%t70 = load i32, i32* %t69
%t71 = load i32, i32* %t59
%t72 = add i32 %t70, %t71
store i32 %t72, i32* %t67
ret void
}
define i32 @find() {
entry:
%t73 = call i32 @chapop()
store i32 %t73, i32* @c
%t74 = load i32, i32* @ii
%t75 = getelementptr inbounds [10000 x i32], [10000 x i32]* @get2, i32 0, i32 %t74
store i32 32, i32* %t75
%t76 = load i32, i32* @ii
%t77 = add i32 %t76, 1
%t78 = getelementptr inbounds [10000 x i32], [10000 x i32]* @get2, i32 0, i32 %t77
%t79 = load i32, i32* @c
store i32 %t79, i32* %t78
%t80 = load i32, i32* @ii
%t81 = add i32 %t80, 2
store i32 %t81, i32* @ii
%t82 = load i32, i32* @chat
%t83 = icmp eq i32 %t82, 0
%t84 = icmp ne i32 %t83, 0
br i1 %t84, label %if.then.11, label %if.end.12
if.then.11:
ret i32 0
if.end.12:
ret i32 1
}
define i32 @main() {
entry:
store i32 0, i32* @intt
store i32 0, i32* @chat
%t85 = alloca i32
%t86 = call i32 @getstr(i32* @get)
store i32 %t86, i32* %t85
br label %while.cond.13
while.cond.13:
%t87 = load i32, i32* @i
%t88 = load i32, i32* %t85
%t89 = icmp slt i32 %t87, %t88
%t90 = icmp ne i32 %t89, 0
br i1 %t90, label %while.body.14, label %while.end.15
while.body.14:
%t91 = load i32, i32* @i
%t92 = getelementptr inbounds [10000 x i32], [10000 x i32]* @get, i32 0, i32 %t91
%t93 = load i32, i32* %t92
%t94 = call i32 @isdigit(i32 %t93)
%t95 = icmp eq i32 %t94, 1
%t96 = icmp ne i32 %t95, 0
br i1 %t96, label %if.then.16, label %if.else.18
while.end.15:
br label %while.cond.82
if.then.16:
%t97 = load i32, i32* @ii
%t98 = getelementptr inbounds [10000 x i32], [10000 x i32]* @get2, i32 0, i32 %t97
%t99 = load i32, i32* @i
%t100 = getelementptr inbounds [10000 x i32], [10000 x i32]* @get, i32 0, i32 %t99
%t101 = load i32, i32* %t100
store i32 %t101, i32* %t98
%t102 = load i32, i32* @ii
%t103 = add i32 %t102, 1
store i32 %t103, i32* @ii
br label %if.end.17
if.end.17:
%t303 = load i32, i32* @i
%t304 = add i32 %t303, 1
store i32 %t304, i32* @i
br label %while.cond.13
if.else.18:
%t104 = load i32, i32* @i
%t105 = getelementptr inbounds [10000 x i32], [10000 x i32]* @get, i32 0, i32 %t104
%t106 = load i32, i32* %t105
%t107 = icmp eq i32 %t106, 40
%t108 = icmp ne i32 %t107, 0
br i1 %t108, label %if.then.19, label %if.end.20
if.then.19:
call void @chapush(i32 40)
br label %if.end.20
if.end.20:
%t110 = load i32, i32* @i
%t111 = getelementptr inbounds [10000 x i32], [10000 x i32]* @get, i32 0, i32 %t110
%t112 = load i32, i32* %t111
%t113 = icmp eq i32 %t112, 94
%t114 = icmp ne i32 %t113, 0
br i1 %t114, label %if.then.21, label %if.end.22
if.then.21:
call void @chapush(i32 94)
br label %if.end.22
if.end.22:
%t116 = load i32, i32* @i
%t117 = getelementptr inbounds [10000 x i32], [10000 x i32]* @get, i32 0, i32 %t116
%t118 = load i32, i32* %t117
%t119 = icmp eq i32 %t118, 41
%t120 = icmp ne i32 %t119, 0
br i1 %t120, label %if.then.23, label %if.end.24
if.then.23:
%t121 = call i32 @chapop()
store i32 %t121, i32* @c
br label %while.cond.25
if.end.24:
%t134 = load i32, i32* @i
%t135 = getelementptr inbounds [10000 x i32], [10000 x i32]* @get, i32 0, i32 %t134
%t136 = load i32, i32* %t135
%t137 = icmp eq i32 %t136, 43
%t138 = icmp ne i32 %t137, 0
br i1 %t138, label %if.then.28, label %if.end.29
while.cond.25:
%t122 = load i32, i32* @c
%t123 = icmp ne i32 %t122, 40
%t124 = icmp ne i32 %t123, 0
br i1 %t124, label %while.body.26, label %while.end.27
while.body.26:
%t125 = load i32, i32* @ii
%t126 = getelementptr inbounds [10000 x i32], [10000 x i32]* @get2, i32 0, i32 %t125
store i32 32, i32* %t126
%t127 = load i32, i32* @ii
%t128 = add i32 %t127, 1
%t129 = getelementptr inbounds [10000 x i32], [10000 x i32]* @get2, i32 0, i32 %t128
%t130 = load i32, i32* @c
store i32 %t130, i32* %t129
%t131 = load i32, i32* @ii
%t132 = add i32 %t131, 2
store i32 %t132, i32* @ii
%t133 = call i32 @chapop()
store i32 %t133, i32* @c
br label %while.cond.25
while.end.27:
br label %if.end.24
if.then.28:
br label %while.cond.30
if.end.29:
%t173 = load i32, i32* @i
%t174 = getelementptr inbounds [10000 x i32], [10000 x i32]* @get, i32 0, i32 %t173
%t175 = load i32, i32* %t174
%t176 = icmp eq i32 %t175, 45
%t177 = icmp ne i32 %t176, 0
br i1 %t177, label %if.then.40, label %if.end.41
while.cond.30:
%t139 = load i32, i32* @chat
%t140 = getelementptr inbounds [10000 x i32], [10000 x i32]* @chas, i32 0, i32 %t139
%t141 = load i32, i32* %t140
%t142 = icmp eq i32 %t141, 43
%t143 = icmp ne i32 %t142, 0
br i1 %t143, label %while.body.31, label %lor.rhs.37
while.body.31:
%t169 = call i32 @find()
%t170 = icmp eq i32 %t169, 0
%t171 = icmp ne i32 %t170, 0
br i1 %t171, label %if.then.38, label %if.end.39
while.end.32:
call void @chapush(i32 43)
br label %if.end.29
lor.rhs.33:
%t164 = load i32, i32* @chat
%t165 = getelementptr inbounds [10000 x i32], [10000 x i32]* @chas, i32 0, i32 %t164
%t166 = load i32, i32* %t165
%t167 = icmp eq i32 %t166, 94
%t168 = icmp ne i32 %t167, 0
br i1 %t168, label %while.body.31, label %while.end.32
lor.rhs.34:
%t159 = load i32, i32* @chat
%t160 = getelementptr inbounds [10000 x i32], [10000 x i32]* @chas, i32 0, i32 %t159
%t161 = load i32, i32* %t160
%t162 = icmp eq i32 %t161, 37
%t163 = icmp ne i32 %t162, 0
br i1 %t163, label %while.body.31, label %lor.rhs.33
lor.rhs.35:
%t154 = load i32, i32* @chat
%t155 = getelementptr inbounds [10000 x i32], [10000 x i32]* @chas, i32 0, i32 %t154
%t156 = load i32, i32* %t155
%t157 = icmp eq i32 %t156, 47
%t158 = icmp ne i32 %t157, 0
br i1 %t158, label %while.body.31, label %lor.rhs.34
lor.rhs.36:
%t149 = load i32, i32* @chat
%t150 = getelementptr inbounds [10000 x i32], [10000 x i32]* @chas, i32 0, i32 %t149
%t151 = load i32, i32* %t150
%t152 = icmp eq i32 %t151, 42
%t153 = icmp ne i32 %t152, 0
br i1 %t153, label %while.body.31, label %lor.rhs.35
lor.rhs.37:
%t144 = load i32, i32* @chat
%t145 = getelementptr inbounds [10000 x i32], [10000 x i32]* @chas, i32 0, i32 %t144
%t146 = load i32, i32* %t145
%t147 = icmp eq i32 %t146, 45
%t148 = icmp ne i32 %t147, 0
br i1 %t148, label %while.body.31, label %lor.rhs.36
if.then.38:
br label %while.end.32
if.end.39:
br label %while.cond.30
if.then.40:
br label %while.cond.42
if.end.41:
%t212 = load i32, i32* @i
%t213 = getelementptr inbounds [10000 x i32], [10000 x i32]* @get, i32 0, i32 %t212
%t214 = load i32, i32* %t213
%t215 = icmp eq i32 %t214, 42
%t216 = icmp ne i32 %t215, 0
br i1 %t216, label %if.then.52, label %if.end.53
while.cond.42:
%t178 = load i32, i32* @chat
%t179 = getelementptr inbounds [10000 x i32], [10000 x i32]* @chas, i32 0, i32 %t178
%t180 = load i32, i32* %t179
%t181 = icmp eq i32 %t180, 43
%t182 = icmp ne i32 %t181, 0
br i1 %t182, label %while.body.43, label %lor.rhs.49
while.body.43:
%t208 = call i32 @find()
%t209 = icmp eq i32 %t208, 0
%t210 = icmp ne i32 %t209, 0
br i1 %t210, label %if.then.50, label %if.end.51
while.end.44:
call void @chapush(i32 45)
br label %if.end.41
lor.rhs.45:
%t203 = load i32, i32* @chat
%t204 = getelementptr inbounds [10000 x i32], [10000 x i32]* @chas, i32 0, i32 %t203
%t205 = load i32, i32* %t204
%t206 = icmp eq i32 %t205, 94
%t207 = icmp ne i32 %t206, 0
br i1 %t207, label %while.body.43, label %while.end.44
lor.rhs.46:
%t198 = load i32, i32* @chat
%t199 = getelementptr inbounds [10000 x i32], [10000 x i32]* @chas, i32 0, i32 %t198
%t200 = load i32, i32* %t199
%t201 = icmp eq i32 %t200, 37
%t202 = icmp ne i32 %t201, 0
br i1 %t202, label %while.body.43, label %lor.rhs.45
lor.rhs.47:
%t193 = load i32, i32* @chat
%t194 = getelementptr inbounds [10000 x i32], [10000 x i32]* @chas, i32 0, i32 %t193
%t195 = load i32, i32* %t194
%t196 = icmp eq i32 %t195, 47
%t197 = icmp ne i32 %t196, 0
br i1 %t197, label %while.body.43, label %lor.rhs.46
lor.rhs.48:
%t188 = load i32, i32* @chat
%t189 = getelementptr inbounds [10000 x i32], [10000 x i32]* @chas, i32 0, i32 %t188
%t190 = load i32, i32* %t189
%t191 = icmp eq i32 %t190, 42
%t192 = icmp ne i32 %t191, 0
br i1 %t192, label %while.body.43, label %lor.rhs.47
lor.rhs.49:
%t183 = load i32, i32* @chat
%t184 = getelementptr inbounds [10000 x i32], [10000 x i32]* @chas, i32 0, i32 %t183
%t185 = load i32, i32* %t184
%t186 = icmp eq i32 %t185, 45
%t187 = icmp ne i32 %t186, 0
br i1 %t187, label %while.body.43, label %lor.rhs.48
if.then.50:
br label %while.end.44
if.end.51:
br label %while.cond.42
if.then.52:
br label %while.cond.54
if.end.53:
%t241 = load i32, i32* @i
%t242 = getelementptr inbounds [10000 x i32], [10000 x i32]* @get, i32 0, i32 %t241
%t243 = load i32, i32* %t242
%t244 = icmp eq i32 %t243, 47
%t245 = icmp ne i32 %t244, 0
br i1 %t245, label %if.then.62, label %if.end.63
while.cond.54:
%t217 = load i32, i32* @chat
%t218 = getelementptr inbounds [10000 x i32], [10000 x i32]* @chas, i32 0, i32 %t217
%t219 = load i32, i32* %t218
%t220 = icmp eq i32 %t219, 42
%t221 = icmp ne i32 %t220, 0
br i1 %t221, label %while.body.55, label %lor.rhs.59
while.body.55:
%t237 = call i32 @find()
%t238 = icmp eq i32 %t237, 0
%t239 = icmp ne i32 %t238, 0
br i1 %t239, label %if.then.60, label %if.end.61
while.end.56:
call void @chapush(i32 42)
br label %if.end.53
lor.rhs.57:
%t232 = load i32, i32* @chat
%t233 = getelementptr inbounds [10000 x i32], [10000 x i32]* @chas, i32 0, i32 %t232
%t234 = load i32, i32* %t233
%t235 = icmp eq i32 %t234, 94
%t236 = icmp ne i32 %t235, 0
br i1 %t236, label %while.body.55, label %while.end.56
lor.rhs.58:
%t227 = load i32, i32* @chat
%t228 = getelementptr inbounds [10000 x i32], [10000 x i32]* @chas, i32 0, i32 %t227
%t229 = load i32, i32* %t228
%t230 = icmp eq i32 %t229, 37
%t231 = icmp ne i32 %t230, 0
br i1 %t231, label %while.body.55, label %lor.rhs.57
lor.rhs.59:
%t222 = load i32, i32* @chat
%t223 = getelementptr inbounds [10000 x i32], [10000 x i32]* @chas, i32 0, i32 %t222
%t224 = load i32, i32* %t223
%t225 = icmp eq i32 %t224, 47
%t226 = icmp ne i32 %t225, 0
br i1 %t226, label %while.body.55, label %lor.rhs.58
if.then.60:
br label %while.end.56
if.end.61:
br label %while.cond.54
if.then.62:
br label %while.cond.64
if.end.63:
%t270 = load i32, i32* @i
%t271 = getelementptr inbounds [10000 x i32], [10000 x i32]* @get, i32 0, i32 %t270
%t272 = load i32, i32* %t271
%t273 = icmp eq i32 %t272, 37
%t274 = icmp ne i32 %t273, 0
br i1 %t274, label %if.then.72, label %if.end.73
while.cond.64:
%t246 = load i32, i32* @chat
%t247 = getelementptr inbounds [10000 x i32], [10000 x i32]* @chas, i32 0, i32 %t246
%t248 = load i32, i32* %t247
%t249 = icmp eq i32 %t248, 42
%t250 = icmp ne i32 %t249, 0
br i1 %t250, label %while.body.65, label %lor.rhs.69
while.body.65:
%t266 = call i32 @find()
%t267 = icmp eq i32 %t266, 0
%t268 = icmp ne i32 %t267, 0
br i1 %t268, label %if.then.70, label %if.end.71
while.end.66:
call void @chapush(i32 47)
br label %if.end.63
lor.rhs.67:
%t261 = load i32, i32* @chat
%t262 = getelementptr inbounds [10000 x i32], [10000 x i32]* @chas, i32 0, i32 %t261
%t263 = load i32, i32* %t262
%t264 = icmp eq i32 %t263, 94
%t265 = icmp ne i32 %t264, 0
br i1 %t265, label %while.body.65, label %while.end.66
lor.rhs.68:
%t256 = load i32, i32* @chat
%t257 = getelementptr inbounds [10000 x i32], [10000 x i32]* @chas, i32 0, i32 %t256
%t258 = load i32, i32* %t257
%t259 = icmp eq i32 %t258, 37
%t260 = icmp ne i32 %t259, 0
br i1 %t260, label %while.body.65, label %lor.rhs.67
lor.rhs.69:
%t251 = load i32, i32* @chat
%t252 = getelementptr inbounds [10000 x i32], [10000 x i32]* @chas, i32 0, i32 %t251
%t253 = load i32, i32* %t252
%t254 = icmp eq i32 %t253, 47
%t255 = icmp ne i32 %t254, 0
br i1 %t255, label %while.body.65, label %lor.rhs.68
if.then.70:
br label %while.end.66
if.end.71:
br label %while.cond.64
if.then.72:
br label %while.cond.74
if.end.73:
%t299 = load i32, i32* @ii
%t300 = getelementptr inbounds [10000 x i32], [10000 x i32]* @get2, i32 0, i32 %t299
store i32 32, i32* %t300
%t301 = load i32, i32* @ii
%t302 = add i32 %t301, 1
store i32 %t302, i32* @ii
br label %if.end.17
while.cond.74:
%t275 = load i32, i32* @chat
%t276 = getelementptr inbounds [10000 x i32], [10000 x i32]* @chas, i32 0, i32 %t275
%t277 = load i32, i32* %t276
%t278 = icmp eq i32 %t277, 42
%t279 = icmp ne i32 %t278, 0
br i1 %t279, label %while.body.75, label %lor.rhs.79
while.body.75:
%t295 = call i32 @find()
%t296 = icmp eq i32 %t295, 0
%t297 = icmp ne i32 %t296, 0
br i1 %t297, label %if.then.80, label %if.end.81
while.end.76:
call void @chapush(i32 37)
br label %if.end.73
lor.rhs.77:
%t290 = load i32, i32* @chat
%t291 = getelementptr inbounds [10000 x i32], [10000 x i32]* @chas, i32 0, i32 %t290
%t292 = load i32, i32* %t291
%t293 = icmp eq i32 %t292, 94
%t294 = icmp ne i32 %t293, 0
br i1 %t294, label %while.body.75, label %while.end.76
lor.rhs.78:
%t285 = load i32, i32* @chat
%t286 = getelementptr inbounds [10000 x i32], [10000 x i32]* @chas, i32 0, i32 %t285
%t287 = load i32, i32* %t286
%t288 = icmp eq i32 %t287, 37
%t289 = icmp ne i32 %t288, 0
br i1 %t289, label %while.body.75, label %lor.rhs.77
lor.rhs.79:
%t280 = load i32, i32* @chat
%t281 = getelementptr inbounds [10000 x i32], [10000 x i32]* @chas, i32 0, i32 %t280
%t282 = load i32, i32* %t281
%t283 = icmp eq i32 %t282, 47
%t284 = icmp ne i32 %t283, 0
br i1 %t284, label %while.body.75, label %lor.rhs.78
if.then.80:
br label %while.end.76
if.end.81:
br label %while.cond.74
while.cond.82:
%t305 = load i32, i32* @chat
%t306 = icmp sgt i32 %t305, 0
%t307 = icmp ne i32 %t306, 0
br i1 %t307, label %while.body.83, label %while.end.84
while.body.83:
%t308 = alloca i32
%t309 = call i32 @chapop()
store i32 %t309, i32* %t308
%t310 = load i32, i32* @ii
%t311 = getelementptr inbounds [10000 x i32], [10000 x i32]* @get2, i32 0, i32 %t310
store i32 32, i32* %t311
%t312 = load i32, i32* @ii
%t313 = add i32 %t312, 1
%t314 = getelementptr inbounds [10000 x i32], [10000 x i32]* @get2, i32 0, i32 %t313
%t315 = load i32, i32* %t308
store i32 %t315, i32* %t314
%t316 = load i32, i32* @ii
%t317 = add i32 %t316, 2
store i32 %t317, i32* @ii
br label %while.cond.82
while.end.84:
%t318 = load i32, i32* @ii
%t319 = getelementptr inbounds [10000 x i32], [10000 x i32]* @get2, i32 0, i32 %t318
store i32 64, i32* %t319
store i32 1, i32* @i
br label %while.cond.85
while.cond.85:
%t320 = load i32, i32* @i
%t321 = getelementptr inbounds [10000 x i32], [10000 x i32]* @get2, i32 0, i32 %t320
%t322 = load i32, i32* %t321
%t323 = icmp ne i32 %t322, 64
%t324 = icmp ne i32 %t323, 0
br i1 %t324, label %while.body.86, label %while.end.87
while.body.86:
%t325 = load i32, i32* @i
%t326 = getelementptr inbounds [10000 x i32], [10000 x i32]* @get2, i32 0, i32 %t325
%t327 = load i32, i32* %t326
%t328 = icmp eq i32 %t327, 43
%t329 = icmp ne i32 %t328, 0
br i1 %t329, label %if.then.88, label %lor.rhs.95
while.end.87:
%t442 = getelementptr inbounds [10000 x i32], [10000 x i32]* @ints, i32 0, i32 1
%t443 = load i32, i32* %t442
call void @putint(i32 %t443)
ret i32 0
if.then.88:
%t355 = alloca i32
%t356 = call i32 @intpop()
store i32 %t356, i32* %t355
%t357 = alloca i32
%t358 = call i32 @intpop()
store i32 %t358, i32* %t357
%t359 = alloca i32
store i32 0, i32* %t359
%t360 = load i32, i32* @i
%t361 = getelementptr inbounds [10000 x i32], [10000 x i32]* @get2, i32 0, i32 %t360
%t362 = load i32, i32* %t361
%t363 = icmp eq i32 %t362, 43
%t364 = icmp ne i32 %t363, 0
br i1 %t364, label %if.then.96, label %if.end.97
if.end.89:
%t440 = load i32, i32* @i
%t441 = add i32 %t440, 1
store i32 %t441, i32* @i
br label %while.cond.85
if.else.90:
%t410 = load i32, i32* @i
%t411 = getelementptr inbounds [10000 x i32], [10000 x i32]* @get2, i32 0, i32 %t410
%t412 = load i32, i32* %t411
%t413 = icmp ne i32 %t412, 32
%t414 = icmp ne i32 %t413, 0
br i1 %t414, label %if.then.108, label %if.end.109
lor.rhs.91:
%t350 = load i32, i32* @i
%t351 = getelementptr inbounds [10000 x i32], [10000 x i32]* @get2, i32 0, i32 %t350
%t352 = load i32, i32* %t351
%t353 = icmp eq i32 %t352, 94
%t354 = icmp ne i32 %t353, 0
br i1 %t354, label %if.then.88, label %if.else.90
lor.rhs.92:
%t345 = load i32, i32* @i
%t346 = getelementptr inbounds [10000 x i32], [10000 x i32]* @get2, i32 0, i32 %t345
%t347 = load i32, i32* %t346
%t348 = icmp eq i32 %t347, 37
%t349 = icmp ne i32 %t348, 0
br i1 %t349, label %if.then.88, label %lor.rhs.91
lor.rhs.93:
%t340 = load i32, i32* @i
%t341 = getelementptr inbounds [10000 x i32], [10000 x i32]* @get2, i32 0, i32 %t340
%t342 = load i32, i32* %t341
%t343 = icmp eq i32 %t342, 47
%t344 = icmp ne i32 %t343, 0
br i1 %t344, label %if.then.88, label %lor.rhs.92
lor.rhs.94:
%t335 = load i32, i32* @i
%t336 = getelementptr inbounds [10000 x i32], [10000 x i32]* @get2, i32 0, i32 %t335
%t337 = load i32, i32* %t336
%t338 = icmp eq i32 %t337, 42
%t339 = icmp ne i32 %t338, 0
br i1 %t339, label %if.then.88, label %lor.rhs.93
lor.rhs.95:
%t330 = load i32, i32* @i
%t331 = getelementptr inbounds [10000 x i32], [10000 x i32]* @get2, i32 0, i32 %t330
%t332 = load i32, i32* %t331
%t333 = icmp eq i32 %t332, 45
%t334 = icmp ne i32 %t333, 0
br i1 %t334, label %if.then.88, label %lor.rhs.94
if.then.96:
%t365 = load i32, i32* %t355
%t366 = load i32, i32* %t357
%t367 = add i32 %t365, %t366
store i32 %t367, i32* %t359
br label %if.end.97
if.end.97:
%t368 = load i32, i32* @i
%t369 = getelementptr inbounds [10000 x i32], [10000 x i32]* @get2, i32 0, i32 %t368
%t370 = load i32, i32* %t369
%t371 = icmp eq i32 %t370, 45
%t372 = icmp ne i32 %t371, 0
br i1 %t372, label %if.then.98, label %if.end.99
if.then.98:
%t373 = load i32, i32* %t357
%t374 = load i32, i32* %t355
%t375 = sub i32 %t373, %t374
store i32 %t375, i32* %t359
br label %if.end.99
if.end.99:
%t376 = load i32, i32* @i
%t377 = getelementptr inbounds [10000 x i32], [10000 x i32]* @get2, i32 0, i32 %t376
%t378 = load i32, i32* %t377
%t379 = icmp eq i32 %t378, 42
%t380 = icmp ne i32 %t379, 0
br i1 %t380, label %if.then.100, label %if.end.101
if.then.100:
%t381 = load i32, i32* %t355
%t382 = load i32, i32* %t357
%t383 = mul i32 %t381, %t382
store i32 %t383, i32* %t359
br label %if.end.101
if.end.101:
%t384 = load i32, i32* @i
%t385 = getelementptr inbounds [10000 x i32], [10000 x i32]* @get2, i32 0, i32 %t384
%t386 = load i32, i32* %t385
%t387 = icmp eq i32 %t386, 47
%t388 = icmp ne i32 %t387, 0
br i1 %t388, label %if.then.102, label %if.end.103
if.then.102:
%t389 = load i32, i32* %t357
%t390 = load i32, i32* %t355
%t391 = sdiv i32 %t389, %t390
store i32 %t391, i32* %t359
br label %if.end.103
if.end.103:
%t392 = load i32, i32* @i
%t393 = getelementptr inbounds [10000 x i32], [10000 x i32]* @get2, i32 0, i32 %t392
%t394 = load i32, i32* %t393
%t395 = icmp eq i32 %t394, 37
%t396 = icmp ne i32 %t395, 0
br i1 %t396, label %if.then.104, label %if.end.105
if.then.104:
%t397 = load i32, i32* %t357
%t398 = load i32, i32* %t355
%t399 = srem i32 %t397, %t398
store i32 %t399, i32* %t359
br label %if.end.105
if.end.105:
%t400 = load i32, i32* @i
%t401 = getelementptr inbounds [10000 x i32], [10000 x i32]* @get2, i32 0, i32 %t400
%t402 = load i32, i32* %t401
%t403 = icmp eq i32 %t402, 94
%t404 = icmp ne i32 %t403, 0
br i1 %t404, label %if.then.106, label %if.end.107
if.then.106:
%t405 = load i32, i32* %t357
%t406 = load i32, i32* %t355
%t407 = call i32 @power(i32 %t405, i32 %t406)
store i32 %t407, i32* %t359
br label %if.end.107
if.end.107:
%t408 = load i32, i32* %t359
call void @intpush(i32 %t408)
br label %if.end.89
if.then.108:
%t415 = load i32, i32* @i
%t416 = getelementptr inbounds [10000 x i32], [10000 x i32]* @get2, i32 0, i32 %t415
%t417 = load i32, i32* %t416
%t418 = sub i32 %t417, 48
call void @intpush(i32 %t418)
store i32 1, i32* @ii
br label %while.cond.110
if.end.109:
br label %if.end.89
while.cond.110:
%t420 = load i32, i32* @i
%t421 = load i32, i32* @ii
%t422 = add i32 %t420, %t421
%t423 = getelementptr inbounds [10000 x i32], [10000 x i32]* @get2, i32 0, i32 %t422
%t424 = load i32, i32* %t423
%t425 = icmp ne i32 %t424, 32
%t426 = icmp ne i32 %t425, 0
br i1 %t426, label %while.body.111, label %while.end.112
while.body.111:
%t427 = load i32, i32* @i
%t428 = load i32, i32* @ii
%t429 = add i32 %t427, %t428
%t430 = getelementptr inbounds [10000 x i32], [10000 x i32]* @get2, i32 0, i32 %t429
%t431 = load i32, i32* %t430
%t432 = sub i32 %t431, 48
call void @intadd(i32 %t432)
%t434 = load i32, i32* @ii
%t435 = add i32 %t434, 1
store i32 %t435, i32* @ii
br label %while.cond.110
while.end.112:
%t436 = load i32, i32* @i
%t437 = load i32, i32* @ii
%t438 = add i32 %t436, %t437
%t439 = sub i32 %t438, 1
store i32 %t439, i32* @i
br label %if.end.109
}

@ -0,0 +1,410 @@
@dp = global [13226976 x i32] zeroinitializer
@list = global [200 x i32] zeroinitializer
@cns = global [20 x i32] zeroinitializer
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @equal(i32 %arg.a, i32 %arg.b) {
entry:
%t0 = alloca i32
store i32 %arg.a, i32* %t0
%t1 = alloca i32
store i32 %arg.b, i32* %t1
%t2 = load i32, i32* %t0
%t3 = load i32, i32* %t1
%t4 = icmp eq i32 %t2, %t3
%t5 = icmp ne i32 %t4, 0
br i1 %t5, label %if.then.1, label %if.end.2
if.then.1:
ret i32 1
if.end.2:
ret i32 0
}
define i32 @dfs(i32 %arg.a, i32 %arg.b, i32 %arg.c, i32 %arg.d, i32 %arg.e, i32 %arg.last) {
entry:
%t6 = alloca i32
store i32 %arg.a, i32* %t6
%t7 = alloca i32
store i32 %arg.b, i32* %t7
%t8 = alloca i32
store i32 %arg.c, i32* %t8
%t9 = alloca i32
store i32 %arg.d, i32* %t9
%t10 = alloca i32
store i32 %arg.e, i32* %t10
%t11 = alloca i32
store i32 %arg.last, i32* %t11
%t12 = load i32, i32* %t6
%t13 = load i32, i32* %t7
%t14 = load i32, i32* %t8
%t15 = load i32, i32* %t9
%t16 = load i32, i32* %t10
%t17 = load i32, i32* %t11
%t18 = mul i32 %t12, 734832
%t19 = mul i32 %t13, 40824
%t20 = add i32 %t18, %t19
%t21 = mul i32 %t14, 2268
%t22 = add i32 %t20, %t21
%t23 = mul i32 %t15, 126
%t24 = add i32 %t22, %t23
%t25 = mul i32 %t16, 7
%t26 = add i32 %t24, %t25
%t27 = add i32 %t26, %t17
%t28 = getelementptr inbounds [13226976 x i32], [13226976 x i32]* @dp, i32 0, i32 %t27
%t29 = load i32, i32* %t28
%t30 = icmp ne i32 %t29, -1
%t31 = icmp ne i32 %t30, 0
br i1 %t31, label %if.then.3, label %if.end.4
if.then.3:
%t32 = load i32, i32* %t6
%t33 = load i32, i32* %t7
%t34 = load i32, i32* %t8
%t35 = load i32, i32* %t9
%t36 = load i32, i32* %t10
%t37 = load i32, i32* %t11
%t38 = mul i32 %t32, 734832
%t39 = mul i32 %t33, 40824
%t40 = add i32 %t38, %t39
%t41 = mul i32 %t34, 2268
%t42 = add i32 %t40, %t41
%t43 = mul i32 %t35, 126
%t44 = add i32 %t42, %t43
%t45 = mul i32 %t36, 7
%t46 = add i32 %t44, %t45
%t47 = add i32 %t46, %t37
%t48 = getelementptr inbounds [13226976 x i32], [13226976 x i32]* @dp, i32 0, i32 %t47
%t49 = load i32, i32* %t48
ret i32 %t49
if.end.4:
%t50 = load i32, i32* %t6
%t51 = load i32, i32* %t7
%t52 = add i32 %t50, %t51
%t53 = load i32, i32* %t8
%t54 = add i32 %t52, %t53
%t55 = load i32, i32* %t9
%t56 = add i32 %t54, %t55
%t57 = load i32, i32* %t10
%t58 = add i32 %t56, %t57
%t59 = icmp eq i32 %t58, 0
%t60 = icmp ne i32 %t59, 0
br i1 %t60, label %if.then.5, label %if.end.6
if.then.5:
ret i32 1
if.end.6:
%t61 = alloca i32
store i32 0, i32* %t61
%t62 = load i32, i32* %t6
%t63 = icmp ne i32 %t62, 0
br i1 %t63, label %if.then.7, label %if.end.8
if.then.7:
%t64 = load i32, i32* %t61
%t65 = load i32, i32* %t6
%t66 = load i32, i32* %t11
%t67 = call i32 @equal(i32 %t66, i32 2)
%t68 = sub i32 %t65, %t67
%t69 = load i32, i32* %t6
%t70 = sub i32 %t69, 1
%t71 = load i32, i32* %t7
%t72 = load i32, i32* %t8
%t73 = load i32, i32* %t9
%t74 = load i32, i32* %t10
%t75 = call i32 @dfs(i32 %t70, i32 %t71, i32 %t72, i32 %t73, i32 %t74, i32 1)
%t76 = mul i32 %t68, %t75
%t77 = add i32 %t64, %t76
%t78 = srem i32 %t77, 1000000007
store i32 %t78, i32* %t61
br label %if.end.8
if.end.8:
%t79 = load i32, i32* %t7
%t80 = icmp ne i32 %t79, 0
br i1 %t80, label %if.then.9, label %if.end.10
if.then.9:
%t81 = load i32, i32* %t61
%t82 = load i32, i32* %t7
%t83 = load i32, i32* %t11
%t84 = call i32 @equal(i32 %t83, i32 3)
%t85 = sub i32 %t82, %t84
%t86 = load i32, i32* %t6
%t87 = add i32 %t86, 1
%t88 = load i32, i32* %t7
%t89 = sub i32 %t88, 1
%t90 = load i32, i32* %t8
%t91 = load i32, i32* %t9
%t92 = load i32, i32* %t10
%t93 = call i32 @dfs(i32 %t87, i32 %t89, i32 %t90, i32 %t91, i32 %t92, i32 2)
%t94 = mul i32 %t85, %t93
%t95 = add i32 %t81, %t94
%t96 = srem i32 %t95, 1000000007
store i32 %t96, i32* %t61
br label %if.end.10
if.end.10:
%t97 = load i32, i32* %t8
%t98 = icmp ne i32 %t97, 0
br i1 %t98, label %if.then.11, label %if.end.12
if.then.11:
%t99 = load i32, i32* %t61
%t100 = load i32, i32* %t8
%t101 = load i32, i32* %t11
%t102 = call i32 @equal(i32 %t101, i32 4)
%t103 = sub i32 %t100, %t102
%t104 = load i32, i32* %t6
%t105 = load i32, i32* %t7
%t106 = add i32 %t105, 1
%t107 = load i32, i32* %t8
%t108 = sub i32 %t107, 1
%t109 = load i32, i32* %t9
%t110 = load i32, i32* %t10
%t111 = call i32 @dfs(i32 %t104, i32 %t106, i32 %t108, i32 %t109, i32 %t110, i32 3)
%t112 = mul i32 %t103, %t111
%t113 = add i32 %t99, %t112
%t114 = srem i32 %t113, 1000000007
store i32 %t114, i32* %t61
br label %if.end.12
if.end.12:
%t115 = load i32, i32* %t9
%t116 = icmp ne i32 %t115, 0
br i1 %t116, label %if.then.13, label %if.end.14
if.then.13:
%t117 = load i32, i32* %t61
%t118 = load i32, i32* %t9
%t119 = load i32, i32* %t11
%t120 = call i32 @equal(i32 %t119, i32 5)
%t121 = sub i32 %t118, %t120
%t122 = load i32, i32* %t6
%t123 = load i32, i32* %t7
%t124 = load i32, i32* %t8
%t125 = add i32 %t124, 1
%t126 = load i32, i32* %t9
%t127 = sub i32 %t126, 1
%t128 = load i32, i32* %t10
%t129 = call i32 @dfs(i32 %t122, i32 %t123, i32 %t125, i32 %t127, i32 %t128, i32 4)
%t130 = mul i32 %t121, %t129
%t131 = add i32 %t117, %t130
%t132 = srem i32 %t131, 1000000007
store i32 %t132, i32* %t61
br label %if.end.14
if.end.14:
%t133 = load i32, i32* %t10
%t134 = icmp ne i32 %t133, 0
br i1 %t134, label %if.then.15, label %if.end.16
if.then.15:
%t135 = load i32, i32* %t61
%t136 = load i32, i32* %t10
%t137 = load i32, i32* %t6
%t138 = load i32, i32* %t7
%t139 = load i32, i32* %t8
%t140 = load i32, i32* %t9
%t141 = add i32 %t140, 1
%t142 = load i32, i32* %t10
%t143 = sub i32 %t142, 1
%t144 = call i32 @dfs(i32 %t137, i32 %t138, i32 %t139, i32 %t141, i32 %t143, i32 5)
%t145 = mul i32 %t136, %t144
%t146 = add i32 %t135, %t145
%t147 = srem i32 %t146, 1000000007
store i32 %t147, i32* %t61
br label %if.end.16
if.end.16:
%t148 = load i32, i32* %t6
%t149 = load i32, i32* %t7
%t150 = load i32, i32* %t8
%t151 = load i32, i32* %t9
%t152 = load i32, i32* %t10
%t153 = load i32, i32* %t11
%t154 = mul i32 %t148, 734832
%t155 = mul i32 %t149, 40824
%t156 = add i32 %t154, %t155
%t157 = mul i32 %t150, 2268
%t158 = add i32 %t156, %t157
%t159 = mul i32 %t151, 126
%t160 = add i32 %t158, %t159
%t161 = mul i32 %t152, 7
%t162 = add i32 %t160, %t161
%t163 = add i32 %t162, %t153
%t164 = getelementptr inbounds [13226976 x i32], [13226976 x i32]* @dp, i32 0, i32 %t163
%t165 = load i32, i32* %t61
%t166 = srem i32 %t165, 1000000007
store i32 %t166, i32* %t164
%t167 = load i32, i32* %t6
%t168 = load i32, i32* %t7
%t169 = load i32, i32* %t8
%t170 = load i32, i32* %t9
%t171 = load i32, i32* %t10
%t172 = load i32, i32* %t11
%t173 = mul i32 %t167, 734832
%t174 = mul i32 %t168, 40824
%t175 = add i32 %t173, %t174
%t176 = mul i32 %t169, 2268
%t177 = add i32 %t175, %t176
%t178 = mul i32 %t170, 126
%t179 = add i32 %t177, %t178
%t180 = mul i32 %t171, 7
%t181 = add i32 %t179, %t180
%t182 = add i32 %t181, %t172
%t183 = getelementptr inbounds [13226976 x i32], [13226976 x i32]* @dp, i32 0, i32 %t182
%t184 = load i32, i32* %t183
ret i32 %t184
}
define i32 @main() {
entry:
%t185 = alloca i32
%t186 = call i32 @getint()
store i32 %t186, i32* %t185
%t187 = alloca i32
store i32 0, i32* %t187
br label %while.cond.17
while.cond.17:
%t188 = load i32, i32* %t187
%t189 = icmp slt i32 %t188, 18
%t190 = icmp ne i32 %t189, 0
br i1 %t190, label %while.body.18, label %while.end.19
while.body.18:
%t191 = alloca i32
store i32 0, i32* %t191
br label %while.cond.20
while.end.19:
store i32 0, i32* %t187
br label %while.cond.35
while.cond.20:
%t192 = load i32, i32* %t191
%t193 = icmp slt i32 %t192, 18
%t194 = icmp ne i32 %t193, 0
br i1 %t194, label %while.body.21, label %while.end.22
while.body.21:
%t195 = alloca i32
store i32 0, i32* %t195
br label %while.cond.23
while.end.22:
%t238 = load i32, i32* %t187
%t239 = add i32 %t238, 1
store i32 %t239, i32* %t187
br label %while.cond.17
while.cond.23:
%t196 = load i32, i32* %t195
%t197 = icmp slt i32 %t196, 18
%t198 = icmp ne i32 %t197, 0
br i1 %t198, label %while.body.24, label %while.end.25
while.body.24:
%t199 = alloca i32
store i32 0, i32* %t199
br label %while.cond.26
while.end.25:
%t236 = load i32, i32* %t191
%t237 = add i32 %t236, 1
store i32 %t237, i32* %t191
br label %while.cond.20
while.cond.26:
%t200 = load i32, i32* %t199
%t201 = icmp slt i32 %t200, 18
%t202 = icmp ne i32 %t201, 0
br i1 %t202, label %while.body.27, label %while.end.28
while.body.27:
%t203 = alloca i32
store i32 0, i32* %t203
br label %while.cond.29
while.end.28:
%t234 = load i32, i32* %t195
%t235 = add i32 %t234, 1
store i32 %t235, i32* %t195
br label %while.cond.23
while.cond.29:
%t204 = load i32, i32* %t203
%t205 = icmp slt i32 %t204, 18
%t206 = icmp ne i32 %t205, 0
br i1 %t206, label %while.body.30, label %while.end.31
while.body.30:
%t207 = alloca i32
store i32 0, i32* %t207
br label %while.cond.32
while.end.31:
%t232 = load i32, i32* %t199
%t233 = add i32 %t232, 1
store i32 %t233, i32* %t199
br label %while.cond.26
while.cond.32:
%t208 = load i32, i32* %t207
%t209 = icmp slt i32 %t208, 7
%t210 = icmp ne i32 %t209, 0
br i1 %t210, label %while.body.33, label %while.end.34
while.body.33:
%t211 = load i32, i32* %t187
%t212 = load i32, i32* %t191
%t213 = load i32, i32* %t195
%t214 = load i32, i32* %t199
%t215 = load i32, i32* %t203
%t216 = load i32, i32* %t207
%t217 = mul i32 %t211, 734832
%t218 = mul i32 %t212, 40824
%t219 = add i32 %t217, %t218
%t220 = mul i32 %t213, 2268
%t221 = add i32 %t219, %t220
%t222 = mul i32 %t214, 126
%t223 = add i32 %t221, %t222
%t224 = mul i32 %t215, 7
%t225 = add i32 %t223, %t224
%t226 = add i32 %t225, %t216
%t227 = getelementptr inbounds [13226976 x i32], [13226976 x i32]* @dp, i32 0, i32 %t226
store i32 -1, i32* %t227
%t228 = load i32, i32* %t207
%t229 = add i32 %t228, 1
store i32 %t229, i32* %t207
br label %while.cond.32
while.end.34:
%t230 = load i32, i32* %t203
%t231 = add i32 %t230, 1
store i32 %t231, i32* %t203
br label %while.cond.29
while.cond.35:
%t240 = load i32, i32* %t187
%t241 = load i32, i32* %t185
%t242 = icmp slt i32 %t240, %t241
%t243 = icmp ne i32 %t242, 0
br i1 %t243, label %while.body.36, label %while.end.37
while.body.36:
%t244 = load i32, i32* %t187
%t245 = getelementptr inbounds [200 x i32], [200 x i32]* @list, i32 0, i32 %t244
%t246 = call i32 @getint()
store i32 %t246, i32* %t245
%t247 = load i32, i32* %t187
%t248 = getelementptr inbounds [200 x i32], [200 x i32]* @list, i32 0, i32 %t247
%t249 = load i32, i32* %t248
%t250 = getelementptr inbounds [20 x i32], [20 x i32]* @cns, i32 0, i32 %t249
%t251 = load i32, i32* %t187
%t252 = getelementptr inbounds [200 x i32], [200 x i32]* @list, i32 0, i32 %t251
%t253 = load i32, i32* %t252
%t254 = getelementptr inbounds [20 x i32], [20 x i32]* @cns, i32 0, i32 %t253
%t255 = load i32, i32* %t254
%t256 = add i32 %t255, 1
store i32 %t256, i32* %t250
%t257 = load i32, i32* %t187
%t258 = add i32 %t257, 1
store i32 %t258, i32* %t187
br label %while.cond.35
while.end.37:
%t259 = alloca i32
%t260 = getelementptr inbounds [20 x i32], [20 x i32]* @cns, i32 0, i32 1
%t261 = load i32, i32* %t260
%t262 = getelementptr inbounds [20 x i32], [20 x i32]* @cns, i32 0, i32 2
%t263 = load i32, i32* %t262
%t264 = getelementptr inbounds [20 x i32], [20 x i32]* @cns, i32 0, i32 3
%t265 = load i32, i32* %t264
%t266 = getelementptr inbounds [20 x i32], [20 x i32]* @cns, i32 0, i32 4
%t267 = load i32, i32* %t266
%t268 = getelementptr inbounds [20 x i32], [20 x i32]* @cns, i32 0, i32 5
%t269 = load i32, i32* %t268
%t270 = call i32 @dfs(i32 %t261, i32 %t263, i32 %t265, i32 %t267, i32 %t269, i32 0)
store i32 %t270, i32* %t259
%t271 = load i32, i32* %t259
call void @putint(i32 %t271)
%t273 = load i32, i32* %t259
ret i32 %t273
}

@ -0,0 +1,90 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @exgcd(i32 %arg.a, i32 %arg.b, i32* %arg.x, i32* %arg.y) {
entry:
%t0 = alloca i32
store i32 %arg.a, i32* %t0
%t1 = alloca i32
store i32 %arg.b, i32* %t1
%t2 = load i32, i32* %t1
%t3 = icmp eq i32 %t2, 0
%t4 = icmp ne i32 %t3, 0
br i1 %t4, label %if.then.1, label %if.else.3
if.then.1:
%t5 = getelementptr inbounds i32, i32* %arg.x, i32 0
store i32 1, i32* %t5
%t6 = getelementptr inbounds i32, i32* %arg.y, i32 0
store i32 0, i32* %t6
%t7 = load i32, i32* %t0
ret i32 %t7
if.end.2:
ret i32 0
if.else.3:
%t8 = alloca i32
%t9 = load i32, i32* %t1
%t10 = load i32, i32* %t0
%t11 = load i32, i32* %t1
%t12 = srem i32 %t10, %t11
%t13 = call i32 @exgcd(i32 %t9, i32 %t12, i32* %arg.x, i32* %arg.y)
store i32 %t13, i32* %t8
%t14 = alloca i32
%t15 = getelementptr inbounds i32, i32* %arg.x, i32 0
%t16 = load i32, i32* %t15
store i32 %t16, i32* %t14
%t17 = getelementptr inbounds i32, i32* %arg.x, i32 0
%t18 = getelementptr inbounds i32, i32* %arg.y, i32 0
%t19 = load i32, i32* %t18
store i32 %t19, i32* %t17
%t20 = getelementptr inbounds i32, i32* %arg.y, i32 0
%t21 = load i32, i32* %t14
%t22 = load i32, i32* %t0
%t23 = load i32, i32* %t1
%t24 = sdiv i32 %t22, %t23
%t25 = getelementptr inbounds i32, i32* %arg.y, i32 0
%t26 = load i32, i32* %t25
%t27 = mul i32 %t24, %t26
%t28 = sub i32 %t21, %t27
store i32 %t28, i32* %t20
%t29 = load i32, i32* %t8
ret i32 %t29
}
define i32 @main() {
entry:
%t30 = alloca i32
store i32 7, i32* %t30
%t31 = alloca i32
store i32 15, i32* %t31
%t32 = alloca i32, i32 1
%t33 = getelementptr inbounds i32, i32* %t32, i32 0
store i32 1, i32* %t33
%t34 = alloca i32, i32 1
%t35 = getelementptr inbounds i32, i32* %t34, i32 0
store i32 1, i32* %t35
%t36 = load i32, i32* %t30
%t37 = load i32, i32* %t31
%t38 = call i32 @exgcd(i32 %t36, i32 %t37, i32* %t32, i32* %t34)
%t39 = getelementptr inbounds i32, i32* %t32, i32 0
%t40 = getelementptr inbounds i32, i32* %t32, i32 0
%t41 = load i32, i32* %t40
%t42 = load i32, i32* %t31
%t43 = srem i32 %t41, %t42
%t44 = load i32, i32* %t31
%t45 = add i32 %t43, %t44
%t46 = load i32, i32* %t31
%t47 = srem i32 %t45, %t46
store i32 %t47, i32* %t39
%t48 = getelementptr inbounds i32, i32* %t32, i32 0
%t49 = load i32, i32* %t48
call void @putint(i32 %t49)
ret i32 0
}

@ -0,0 +1,48 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define void @reverse(i32 %arg.n) {
entry:
%t0 = alloca i32
store i32 %arg.n, i32* %t0
%t1 = alloca i32
store i32 0, i32* %t1
%t2 = load i32, i32* %t0
%t3 = icmp sle i32 %t2, 1
%t4 = icmp ne i32 %t3, 0
br i1 %t4, label %if.then.1, label %if.else.3
if.then.1:
%t5 = call i32 @getint()
store i32 %t5, i32* %t1
%t6 = load i32, i32* %t1
call void @putint(i32 %t6)
br label %if.end.2
if.end.2:
ret void
if.else.3:
%t8 = call i32 @getint()
store i32 %t8, i32* %t1
%t9 = load i32, i32* %t0
%t10 = sub i32 %t9, 1
call void @reverse(i32 %t10)
%t12 = load i32, i32* %t1
call void @putint(i32 %t12)
br label %if.end.2
}
define i32 @main() {
entry:
%t14 = alloca i32
store i32 200, i32* %t14
%t15 = load i32, i32* %t14
call void @reverse(i32 %t15)
ret i32 0
}

@ -0,0 +1,212 @@
@tape = global [65536 x i32] zeroinitializer
@program = global [32768 x i32] zeroinitializer
@ptr11 = global i32 0
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define void @read_program() {
entry:
%t0 = alloca i32
store i32 0, i32* %t0
%t1 = alloca i32
%t2 = call i32 @getint()
store i32 %t2, i32* %t1
br label %while.cond.1
while.cond.1:
%t3 = load i32, i32* %t0
%t4 = load i32, i32* %t1
%t5 = icmp slt i32 %t3, %t4
%t6 = icmp ne i32 %t5, 0
br i1 %t6, label %while.body.2, label %while.end.3
while.body.2:
%t7 = load i32, i32* %t0
%t8 = getelementptr inbounds [32768 x i32], [32768 x i32]* @program, i32 0, i32 %t7
%t9 = call i32 @getch()
store i32 %t9, i32* %t8
%t10 = load i32, i32* %t0
%t11 = add i32 %t10, 1
store i32 %t11, i32* %t0
br label %while.cond.1
while.end.3:
%t12 = load i32, i32* %t0
%t13 = getelementptr inbounds [32768 x i32], [32768 x i32]* @program, i32 0, i32 %t12
store i32 0, i32* %t13
ret void
}
define void @interpret(i32* %arg.input) {
entry:
%t14 = alloca i32
store i32 0, i32* %t14
%t15 = alloca i32
store i32 0, i32* %t15
%t16 = alloca i32
store i32 0, i32* %t16
br label %while.cond.4
while.cond.4:
%t17 = load i32, i32* %t16
%t18 = getelementptr inbounds i32, i32* %arg.input, i32 %t17
%t19 = load i32, i32* %t18
%t20 = icmp ne i32 %t19, 0
br i1 %t20, label %while.body.5, label %while.end.6
while.body.5:
%t21 = load i32, i32* %t16
%t22 = getelementptr inbounds i32, i32* %arg.input, i32 %t21
%t23 = load i32, i32* %t22
store i32 %t23, i32* %t14
%t24 = load i32, i32* %t14
%t25 = icmp eq i32 %t24, 62
%t26 = icmp ne i32 %t25, 0
br i1 %t26, label %if.then.7, label %if.else.9
while.end.6:
ret void
if.then.7:
%t27 = load i32, i32* @ptr11
%t28 = add i32 %t27, 1
store i32 %t28, i32* @ptr11
br label %if.end.8
if.end.8:
%t90 = load i32, i32* %t16
%t91 = add i32 %t90, 1
store i32 %t91, i32* %t16
br label %while.cond.4
if.else.9:
%t29 = load i32, i32* %t14
%t30 = icmp eq i32 %t29, 60
%t31 = icmp ne i32 %t30, 0
br i1 %t31, label %if.then.10, label %if.else.12
if.then.10:
%t32 = load i32, i32* @ptr11
%t33 = sub i32 %t32, 1
store i32 %t33, i32* @ptr11
br label %if.end.11
if.end.11:
br label %if.end.8
if.else.12:
%t34 = load i32, i32* %t14
%t35 = icmp eq i32 %t34, 43
%t36 = icmp ne i32 %t35, 0
br i1 %t36, label %if.then.13, label %if.else.15
if.then.13:
%t37 = load i32, i32* @ptr11
%t38 = getelementptr inbounds [65536 x i32], [65536 x i32]* @tape, i32 0, i32 %t37
%t39 = load i32, i32* @ptr11
%t40 = getelementptr inbounds [65536 x i32], [65536 x i32]* @tape, i32 0, i32 %t39
%t41 = load i32, i32* %t40
%t42 = add i32 %t41, 1
store i32 %t42, i32* %t38
br label %if.end.14
if.end.14:
br label %if.end.11
if.else.15:
%t43 = load i32, i32* %t14
%t44 = icmp eq i32 %t43, 45
%t45 = icmp ne i32 %t44, 0
br i1 %t45, label %if.then.16, label %if.else.18
if.then.16:
%t46 = load i32, i32* @ptr11
%t47 = getelementptr inbounds [65536 x i32], [65536 x i32]* @tape, i32 0, i32 %t46
%t48 = load i32, i32* @ptr11
%t49 = getelementptr inbounds [65536 x i32], [65536 x i32]* @tape, i32 0, i32 %t48
%t50 = load i32, i32* %t49
%t51 = sub i32 %t50, 1
store i32 %t51, i32* %t47
br label %if.end.17
if.end.17:
br label %if.end.14
if.else.18:
%t52 = load i32, i32* %t14
%t53 = icmp eq i32 %t52, 46
%t54 = icmp ne i32 %t53, 0
br i1 %t54, label %if.then.19, label %if.else.21
if.then.19:
%t55 = load i32, i32* @ptr11
%t56 = getelementptr inbounds [65536 x i32], [65536 x i32]* @tape, i32 0, i32 %t55
%t57 = load i32, i32* %t56
call void @putch(i32 %t57)
br label %if.end.20
if.end.20:
br label %if.end.17
if.else.21:
%t59 = load i32, i32* %t14
%t60 = icmp eq i32 %t59, 44
%t61 = icmp ne i32 %t60, 0
br i1 %t61, label %if.then.22, label %if.else.24
if.then.22:
%t62 = load i32, i32* @ptr11
%t63 = getelementptr inbounds [65536 x i32], [65536 x i32]* @tape, i32 0, i32 %t62
%t64 = call i32 @getch()
store i32 %t64, i32* %t63
br label %if.end.23
if.end.23:
br label %if.end.20
if.else.24:
%t65 = load i32, i32* %t14
%t66 = icmp eq i32 %t65, 93
%t67 = icmp ne i32 %t66, 0
br i1 %t67, label %land.rhs.27, label %if.end.26
if.then.25:
store i32 1, i32* %t15
br label %while.cond.28
if.end.26:
br label %if.end.23
land.rhs.27:
%t68 = load i32, i32* @ptr11
%t69 = getelementptr inbounds [65536 x i32], [65536 x i32]* @tape, i32 0, i32 %t68
%t70 = load i32, i32* %t69
%t71 = icmp ne i32 %t70, 0
br i1 %t71, label %if.then.25, label %if.end.26
while.cond.28:
%t72 = load i32, i32* %t15
%t73 = icmp sgt i32 %t72, 0
%t74 = icmp ne i32 %t73, 0
br i1 %t74, label %while.body.29, label %while.end.30
while.body.29:
%t75 = load i32, i32* %t16
%t76 = sub i32 %t75, 1
store i32 %t76, i32* %t16
%t77 = load i32, i32* %t16
%t78 = getelementptr inbounds i32, i32* %arg.input, i32 %t77
%t79 = load i32, i32* %t78
store i32 %t79, i32* %t14
%t80 = load i32, i32* %t14
%t81 = icmp eq i32 %t80, 91
%t82 = icmp ne i32 %t81, 0
br i1 %t82, label %if.then.31, label %if.else.33
while.end.30:
br label %if.end.26
if.then.31:
%t83 = load i32, i32* %t15
%t84 = sub i32 %t83, 1
store i32 %t84, i32* %t15
br label %if.end.32
if.end.32:
br label %while.cond.28
if.else.33:
%t85 = load i32, i32* %t14
%t86 = icmp eq i32 %t85, 93
%t87 = icmp ne i32 %t86, 0
br i1 %t87, label %if.then.34, label %if.end.35
if.then.34:
%t88 = load i32, i32* %t15
%t89 = add i32 %t88, 1
store i32 %t89, i32* %t15
br label %if.end.35
if.end.35:
br label %if.end.32
}
define i32 @main() {
entry:
call void @read_program()
call void @interpret(i32* @program)
ret i32 0
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,283 @@
@e = global [256 x i32] zeroinitializer
@book = global [16 x i32] zeroinitializer
@dis = global [16 x i32] zeroinitializer
@n = global i32 0
@m = global i32 0
@v1 = global i32 0
@v2 = global i32 0
@w = global i32 0
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define void @Dijkstra() {
entry:
%t0 = alloca i32
store i32 0, i32* %t0
%t1 = alloca i32
store i32 0, i32* %t1
store i32 1, i32* %t0
br label %while.cond.1
while.cond.1:
%t2 = load i32, i32* %t0
%t3 = load i32, i32* @n
%t4 = icmp sle i32 %t2, %t3
%t5 = icmp ne i32 %t4, 0
br i1 %t5, label %while.body.2, label %while.end.3
while.body.2:
%t6 = load i32, i32* %t0
%t7 = getelementptr inbounds [16 x i32], [16 x i32]* @dis, i32 0, i32 %t6
%t8 = load i32, i32* %t0
%t9 = add i32 16, %t8
%t10 = getelementptr inbounds [256 x i32], [256 x i32]* @e, i32 0, i32 %t9
%t11 = load i32, i32* %t10
store i32 %t11, i32* %t7
%t12 = load i32, i32* %t0
%t13 = getelementptr inbounds [16 x i32], [16 x i32]* @book, i32 0, i32 %t12
store i32 0, i32* %t13
%t14 = load i32, i32* %t0
%t15 = add i32 %t14, 1
store i32 %t15, i32* %t0
br label %while.cond.1
while.end.3:
%t16 = getelementptr inbounds [16 x i32], [16 x i32]* @book, i32 0, i32 1
store i32 1, i32* %t16
store i32 1, i32* %t0
br label %while.cond.4
while.cond.4:
%t17 = load i32, i32* %t0
%t18 = load i32, i32* @n
%t19 = sub i32 %t18, 1
%t20 = icmp sle i32 %t17, %t19
%t21 = icmp ne i32 %t20, 0
br i1 %t21, label %while.body.5, label %while.end.6
while.body.5:
%t22 = alloca i32
store i32 65535, i32* %t22
%t23 = alloca i32
store i32 0, i32* %t23
%t24 = alloca i32
store i32 1, i32* %t24
br label %while.cond.7
while.end.6:
ret void
while.cond.7:
%t25 = load i32, i32* %t24
%t26 = load i32, i32* @n
%t27 = icmp sle i32 %t25, %t26
%t28 = icmp ne i32 %t27, 0
br i1 %t28, label %while.body.8, label %while.end.9
while.body.8:
%t29 = load i32, i32* %t22
%t30 = load i32, i32* %t24
%t31 = getelementptr inbounds [16 x i32], [16 x i32]* @dis, i32 0, i32 %t30
%t32 = load i32, i32* %t31
%t33 = icmp sgt i32 %t29, %t32
%t34 = icmp ne i32 %t33, 0
br i1 %t34, label %land.rhs.12, label %if.end.11
while.end.9:
%t46 = load i32, i32* %t23
%t47 = getelementptr inbounds [16 x i32], [16 x i32]* @book, i32 0, i32 %t46
store i32 1, i32* %t47
%t48 = alloca i32
store i32 1, i32* %t48
br label %while.cond.13
if.then.10:
%t40 = load i32, i32* %t24
%t41 = getelementptr inbounds [16 x i32], [16 x i32]* @dis, i32 0, i32 %t40
%t42 = load i32, i32* %t41
store i32 %t42, i32* %t22
%t43 = load i32, i32* %t24
store i32 %t43, i32* %t23
br label %if.end.11
if.end.11:
%t44 = load i32, i32* %t24
%t45 = add i32 %t44, 1
store i32 %t45, i32* %t24
br label %while.cond.7
land.rhs.12:
%t35 = load i32, i32* %t24
%t36 = getelementptr inbounds [16 x i32], [16 x i32]* @book, i32 0, i32 %t35
%t37 = load i32, i32* %t36
%t38 = icmp eq i32 %t37, 0
%t39 = icmp ne i32 %t38, 0
br i1 %t39, label %if.then.10, label %if.end.11
while.cond.13:
%t49 = load i32, i32* %t48
%t50 = load i32, i32* @n
%t51 = icmp sle i32 %t49, %t50
%t52 = icmp ne i32 %t51, 0
br i1 %t52, label %while.body.14, label %while.end.15
while.body.14:
%t53 = load i32, i32* %t23
%t54 = load i32, i32* %t48
%t55 = mul i32 %t53, 16
%t56 = add i32 %t55, %t54
%t57 = getelementptr inbounds [256 x i32], [256 x i32]* @e, i32 0, i32 %t56
%t58 = load i32, i32* %t57
%t59 = icmp slt i32 %t58, 65535
%t60 = icmp ne i32 %t59, 0
br i1 %t60, label %if.then.16, label %if.end.17
while.end.15:
%t90 = load i32, i32* %t0
%t91 = add i32 %t90, 1
store i32 %t91, i32* %t0
br label %while.cond.4
if.then.16:
%t61 = load i32, i32* %t48
%t62 = getelementptr inbounds [16 x i32], [16 x i32]* @dis, i32 0, i32 %t61
%t63 = load i32, i32* %t62
%t64 = load i32, i32* %t23
%t65 = getelementptr inbounds [16 x i32], [16 x i32]* @dis, i32 0, i32 %t64
%t66 = load i32, i32* %t65
%t67 = load i32, i32* %t23
%t68 = load i32, i32* %t48
%t69 = mul i32 %t67, 16
%t70 = add i32 %t69, %t68
%t71 = getelementptr inbounds [256 x i32], [256 x i32]* @e, i32 0, i32 %t70
%t72 = load i32, i32* %t71
%t73 = add i32 %t66, %t72
%t74 = icmp sgt i32 %t63, %t73
%t75 = icmp ne i32 %t74, 0
br i1 %t75, label %if.then.18, label %if.end.19
if.end.17:
%t88 = load i32, i32* %t48
%t89 = add i32 %t88, 1
store i32 %t89, i32* %t48
br label %while.cond.13
if.then.18:
%t76 = load i32, i32* %t48
%t77 = getelementptr inbounds [16 x i32], [16 x i32]* @dis, i32 0, i32 %t76
%t78 = load i32, i32* %t23
%t79 = getelementptr inbounds [16 x i32], [16 x i32]* @dis, i32 0, i32 %t78
%t80 = load i32, i32* %t79
%t81 = load i32, i32* %t23
%t82 = load i32, i32* %t48
%t83 = mul i32 %t81, 16
%t84 = add i32 %t83, %t82
%t85 = getelementptr inbounds [256 x i32], [256 x i32]* @e, i32 0, i32 %t84
%t86 = load i32, i32* %t85
%t87 = add i32 %t80, %t86
store i32 %t87, i32* %t77
br label %if.end.19
if.end.19:
br label %if.end.17
}
define i32 @main() {
entry:
%t92 = alloca i32
store i32 0, i32* %t92
%t93 = call i32 @getint()
store i32 %t93, i32* @n
%t94 = call i32 @getint()
store i32 %t94, i32* @m
store i32 1, i32* %t92
br label %while.cond.20
while.cond.20:
%t95 = load i32, i32* %t92
%t96 = load i32, i32* @n
%t97 = icmp sle i32 %t95, %t96
%t98 = icmp ne i32 %t97, 0
br i1 %t98, label %while.body.21, label %while.end.22
while.body.21:
%t99 = alloca i32
store i32 1, i32* %t99
br label %while.cond.23
while.end.22:
store i32 1, i32* %t92
br label %while.cond.29
while.cond.23:
%t100 = load i32, i32* %t99
%t101 = load i32, i32* @n
%t102 = icmp sle i32 %t100, %t101
%t103 = icmp ne i32 %t102, 0
br i1 %t103, label %while.body.24, label %while.end.25
while.body.24:
%t104 = load i32, i32* %t92
%t105 = load i32, i32* %t99
%t106 = icmp eq i32 %t104, %t105
%t107 = icmp ne i32 %t106, 0
br i1 %t107, label %if.then.26, label %if.else.28
while.end.25:
%t120 = load i32, i32* %t92
%t121 = add i32 %t120, 1
store i32 %t121, i32* %t92
br label %while.cond.20
if.then.26:
%t108 = load i32, i32* %t92
%t109 = load i32, i32* %t99
%t110 = mul i32 %t108, 16
%t111 = add i32 %t110, %t109
%t112 = getelementptr inbounds [256 x i32], [256 x i32]* @e, i32 0, i32 %t111
store i32 0, i32* %t112
br label %if.end.27
if.end.27:
%t118 = load i32, i32* %t99
%t119 = add i32 %t118, 1
store i32 %t119, i32* %t99
br label %while.cond.23
if.else.28:
%t113 = load i32, i32* %t92
%t114 = load i32, i32* %t99
%t115 = mul i32 %t113, 16
%t116 = add i32 %t115, %t114
%t117 = getelementptr inbounds [256 x i32], [256 x i32]* @e, i32 0, i32 %t116
store i32 65535, i32* %t117
br label %if.end.27
while.cond.29:
%t122 = load i32, i32* %t92
%t123 = load i32, i32* @m
%t124 = icmp sle i32 %t122, %t123
%t125 = icmp ne i32 %t124, 0
br i1 %t125, label %while.body.30, label %while.end.31
while.body.30:
%t126 = alloca i32
%t127 = call i32 @getint()
store i32 %t127, i32* %t126
%t128 = alloca i32
%t129 = call i32 @getint()
store i32 %t129, i32* %t128
%t130 = load i32, i32* %t126
%t131 = load i32, i32* %t128
%t132 = mul i32 %t130, 16
%t133 = add i32 %t132, %t131
%t134 = getelementptr inbounds [256 x i32], [256 x i32]* @e, i32 0, i32 %t133
%t135 = call i32 @getint()
store i32 %t135, i32* %t134
%t136 = load i32, i32* %t92
%t137 = add i32 %t136, 1
store i32 %t137, i32* %t92
br label %while.cond.29
while.end.31:
call void @Dijkstra()
store i32 1, i32* %t92
br label %while.cond.32
while.cond.32:
%t139 = load i32, i32* %t92
%t140 = load i32, i32* @n
%t141 = icmp sle i32 %t139, %t140
%t142 = icmp ne i32 %t141, 0
br i1 %t142, label %while.body.33, label %while.end.34
while.body.33:
%t143 = load i32, i32* %t92
%t144 = getelementptr inbounds [16 x i32], [16 x i32]* @dis, i32 0, i32 %t143
%t145 = load i32, i32* %t144
call void @putint(i32 %t145)
call void @putch(i32 32)
%t148 = load i32, i32* %t92
%t149 = add i32 %t148, 1
store i32 %t149, i32* %t92
br label %while.cond.32
while.end.34:
call void @putch(i32 10)
ret i32 0
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,88 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define void @move(i32 %arg.x, i32 %arg.y) {
entry:
%t0 = alloca i32
store i32 %arg.x, i32* %t0
%t1 = alloca i32
store i32 %arg.y, i32* %t1
%t2 = load i32, i32* %t0
call void @putint(i32 %t2)
call void @putch(i32 32)
%t5 = load i32, i32* %t1
call void @putint(i32 %t5)
call void @putch(i32 44)
call void @putch(i32 32)
ret void
}
define void @hanoi(i32 %arg.n, i32 %arg.one, i32 %arg.two, i32 %arg.three) {
entry:
%t9 = alloca i32
store i32 %arg.n, i32* %t9
%t10 = alloca i32
store i32 %arg.one, i32* %t10
%t11 = alloca i32
store i32 %arg.two, i32* %t11
%t12 = alloca i32
store i32 %arg.three, i32* %t12
%t13 = load i32, i32* %t9
%t14 = icmp eq i32 %t13, 1
%t15 = icmp ne i32 %t14, 0
br i1 %t15, label %if.then.1, label %if.else.3
if.then.1:
%t16 = load i32, i32* %t10
%t17 = load i32, i32* %t12
call void @move(i32 %t16, i32 %t17)
br label %if.end.2
if.end.2:
ret void
if.else.3:
%t19 = load i32, i32* %t9
%t20 = sub i32 %t19, 1
%t21 = load i32, i32* %t10
%t22 = load i32, i32* %t12
%t23 = load i32, i32* %t11
call void @hanoi(i32 %t20, i32 %t21, i32 %t22, i32 %t23)
%t25 = load i32, i32* %t10
%t26 = load i32, i32* %t12
call void @move(i32 %t25, i32 %t26)
%t28 = load i32, i32* %t9
%t29 = sub i32 %t28, 1
%t30 = load i32, i32* %t11
%t31 = load i32, i32* %t10
%t32 = load i32, i32* %t12
call void @hanoi(i32 %t29, i32 %t30, i32 %t31, i32 %t32)
br label %if.end.2
}
define i32 @main() {
entry:
%t34 = alloca i32
%t35 = call i32 @getint()
store i32 %t35, i32* %t34
br label %while.cond.4
while.cond.4:
%t36 = load i32, i32* %t34
%t37 = icmp sgt i32 %t36, 0
%t38 = icmp ne i32 %t37, 0
br i1 %t38, label %while.body.5, label %while.end.6
while.body.5:
%t39 = call i32 @getint()
call void @hanoi(i32 %t39, i32 1, i32 2, i32 3)
call void @putch(i32 10)
%t42 = load i32, i32* %t34
%t43 = sub i32 %t42, 1
store i32 %t43, i32* %t34
br label %while.cond.4
while.end.6:
ret i32 0
}

@ -0,0 +1,177 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @my_getint() {
entry:
%t0 = alloca i32
store i32 0, i32* %t0
%t1 = alloca i32
store i32 0, i32* %t1
br label %while.cond.1
while.cond.1:
br i1 1, label %while.body.2, label %while.end.3
while.body.2:
%t2 = call i32 @getch()
%t3 = sub i32 %t2, 48
store i32 %t3, i32* %t1
%t4 = load i32, i32* %t1
%t5 = icmp slt i32 %t4, 0
%t6 = icmp ne i32 %t5, 0
br i1 %t6, label %if.then.4, label %lor.rhs.7
while.end.3:
%t10 = load i32, i32* %t1
store i32 %t10, i32* %t0
br label %while.cond.8
if.then.4:
br label %while.cond.1
if.end.5:
ret i32 0
if.else.6:
br label %while.end.3
lor.rhs.7:
%t7 = load i32, i32* %t1
%t8 = icmp sgt i32 %t7, 9
%t9 = icmp ne i32 %t8, 0
br i1 %t9, label %if.then.4, label %if.else.6
while.cond.8:
br i1 1, label %while.body.9, label %while.end.10
while.body.9:
%t11 = call i32 @getch()
%t12 = sub i32 %t11, 48
store i32 %t12, i32* %t1
%t13 = load i32, i32* %t1
%t14 = icmp sge i32 %t13, 0
%t15 = icmp ne i32 %t14, 0
br i1 %t15, label %land.rhs.14, label %if.else.13
while.end.10:
%t23 = load i32, i32* %t0
ret i32 %t23
if.then.11:
%t19 = load i32, i32* %t0
%t20 = mul i32 %t19, 10
%t21 = load i32, i32* %t1
%t22 = add i32 %t20, %t21
store i32 %t22, i32* %t0
br label %if.end.12
if.end.12:
br label %while.cond.8
if.else.13:
br label %while.end.10
land.rhs.14:
%t16 = load i32, i32* %t1
%t17 = icmp sle i32 %t16, 9
%t18 = icmp ne i32 %t17, 0
br i1 %t18, label %if.then.11, label %if.else.13
}
define void @my_putint(i32 %arg.a) {
entry:
%t24 = alloca i32
store i32 %arg.a, i32* %t24
%t25 = alloca i32, i32 16
%t26 = getelementptr inbounds i32, i32* %t25, i32 0
store i32 0, i32* %t26
%t27 = getelementptr inbounds i32, i32* %t25, i32 1
store i32 0, i32* %t27
%t28 = getelementptr inbounds i32, i32* %t25, i32 2
store i32 0, i32* %t28
%t29 = getelementptr inbounds i32, i32* %t25, i32 3
store i32 0, i32* %t29
%t30 = getelementptr inbounds i32, i32* %t25, i32 4
store i32 0, i32* %t30
%t31 = getelementptr inbounds i32, i32* %t25, i32 5
store i32 0, i32* %t31
%t32 = getelementptr inbounds i32, i32* %t25, i32 6
store i32 0, i32* %t32
%t33 = getelementptr inbounds i32, i32* %t25, i32 7
store i32 0, i32* %t33
%t34 = getelementptr inbounds i32, i32* %t25, i32 8
store i32 0, i32* %t34
%t35 = getelementptr inbounds i32, i32* %t25, i32 9
store i32 0, i32* %t35
%t36 = getelementptr inbounds i32, i32* %t25, i32 10
store i32 0, i32* %t36
%t37 = getelementptr inbounds i32, i32* %t25, i32 11
store i32 0, i32* %t37
%t38 = getelementptr inbounds i32, i32* %t25, i32 12
store i32 0, i32* %t38
%t39 = getelementptr inbounds i32, i32* %t25, i32 13
store i32 0, i32* %t39
%t40 = getelementptr inbounds i32, i32* %t25, i32 14
store i32 0, i32* %t40
%t41 = getelementptr inbounds i32, i32* %t25, i32 15
store i32 0, i32* %t41
%t42 = alloca i32
store i32 0, i32* %t42
br label %while.cond.15
while.cond.15:
%t43 = load i32, i32* %t24
%t44 = icmp sgt i32 %t43, 0
%t45 = icmp ne i32 %t44, 0
br i1 %t45, label %while.body.16, label %while.end.17
while.body.16:
%t46 = load i32, i32* %t42
%t47 = getelementptr inbounds i32, i32* %t25, i32 %t46
%t48 = load i32, i32* %t24
%t49 = srem i32 %t48, 10
%t50 = add i32 %t49, 48
store i32 %t50, i32* %t47
%t51 = load i32, i32* %t24
%t52 = sdiv i32 %t51, 10
store i32 %t52, i32* %t24
%t53 = load i32, i32* %t42
%t54 = add i32 %t53, 1
store i32 %t54, i32* %t42
br label %while.cond.15
while.end.17:
br label %while.cond.18
while.cond.18:
%t55 = load i32, i32* %t42
%t56 = icmp sgt i32 %t55, 0
%t57 = icmp ne i32 %t56, 0
br i1 %t57, label %while.body.19, label %while.end.20
while.body.19:
%t58 = load i32, i32* %t42
%t59 = sub i32 %t58, 1
store i32 %t59, i32* %t42
%t60 = load i32, i32* %t42
%t61 = getelementptr inbounds i32, i32* %t25, i32 %t60
%t62 = load i32, i32* %t61
call void @putch(i32 %t62)
br label %while.cond.18
while.end.20:
ret void
}
define i32 @main() {
entry:
%t64 = alloca i32
%t65 = call i32 @my_getint()
store i32 %t65, i32* %t64
br label %while.cond.21
while.cond.21:
%t66 = load i32, i32* %t64
%t67 = icmp sgt i32 %t66, 0
%t68 = icmp ne i32 %t67, 0
br i1 %t68, label %while.body.22, label %while.end.23
while.body.22:
%t69 = alloca i32
%t70 = call i32 @my_getint()
store i32 %t70, i32* %t69
%t71 = load i32, i32* %t69
call void @my_putint(i32 %t71)
call void @putch(i32 10)
%t74 = load i32, i32* %t64
%t75 = sub i32 %t74, 1
store i32 %t75, i32* %t64
br label %while.cond.21
while.end.23:
ret i32 0
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,367 @@
@size = global [10 x i32] zeroinitializer
@to = global [100 x i32] zeroinitializer
@cap = global [100 x i32] zeroinitializer
@rev = global [100 x i32] zeroinitializer
@used = global [10 x i32] zeroinitializer
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define void @my_memset(i32* %arg.arr, i32 %arg.val, i32 %arg.n) {
entry:
%t0 = alloca i32
store i32 %arg.val, i32* %t0
%t1 = alloca i32
store i32 %arg.n, i32* %t1
%t2 = alloca i32
store i32 0, i32* %t2
br label %while.cond.1
while.cond.1:
%t3 = load i32, i32* %t2
%t4 = load i32, i32* %t1
%t5 = icmp slt i32 %t3, %t4
%t6 = icmp ne i32 %t5, 0
br i1 %t6, label %while.body.2, label %while.end.3
while.body.2:
%t7 = load i32, i32* %t2
%t8 = getelementptr inbounds i32, i32* %arg.arr, i32 %t7
%t9 = load i32, i32* %t0
store i32 %t9, i32* %t8
%t10 = load i32, i32* %t2
%t11 = add i32 %t10, 1
store i32 %t11, i32* %t2
br label %while.cond.1
while.end.3:
ret void
}
define void @add_node(i32 %arg.u, i32 %arg.v, i32 %arg.c) {
entry:
%t12 = alloca i32
store i32 %arg.u, i32* %t12
%t13 = alloca i32
store i32 %arg.v, i32* %t13
%t14 = alloca i32
store i32 %arg.c, i32* %t14
%t15 = load i32, i32* %t12
%t16 = load i32, i32* %t12
%t17 = getelementptr inbounds [10 x i32], [10 x i32]* @size, i32 0, i32 %t16
%t18 = load i32, i32* %t17
%t19 = mul i32 %t15, 10
%t20 = add i32 %t19, %t18
%t21 = getelementptr inbounds [100 x i32], [100 x i32]* @to, i32 0, i32 %t20
%t22 = load i32, i32* %t13
store i32 %t22, i32* %t21
%t23 = load i32, i32* %t12
%t24 = load i32, i32* %t12
%t25 = getelementptr inbounds [10 x i32], [10 x i32]* @size, i32 0, i32 %t24
%t26 = load i32, i32* %t25
%t27 = mul i32 %t23, 10
%t28 = add i32 %t27, %t26
%t29 = getelementptr inbounds [100 x i32], [100 x i32]* @cap, i32 0, i32 %t28
%t30 = load i32, i32* %t14
store i32 %t30, i32* %t29
%t31 = load i32, i32* %t12
%t32 = load i32, i32* %t12
%t33 = getelementptr inbounds [10 x i32], [10 x i32]* @size, i32 0, i32 %t32
%t34 = load i32, i32* %t33
%t35 = mul i32 %t31, 10
%t36 = add i32 %t35, %t34
%t37 = getelementptr inbounds [100 x i32], [100 x i32]* @rev, i32 0, i32 %t36
%t38 = load i32, i32* %t13
%t39 = getelementptr inbounds [10 x i32], [10 x i32]* @size, i32 0, i32 %t38
%t40 = load i32, i32* %t39
store i32 %t40, i32* %t37
%t41 = load i32, i32* %t13
%t42 = load i32, i32* %t13
%t43 = getelementptr inbounds [10 x i32], [10 x i32]* @size, i32 0, i32 %t42
%t44 = load i32, i32* %t43
%t45 = mul i32 %t41, 10
%t46 = add i32 %t45, %t44
%t47 = getelementptr inbounds [100 x i32], [100 x i32]* @to, i32 0, i32 %t46
%t48 = load i32, i32* %t12
store i32 %t48, i32* %t47
%t49 = load i32, i32* %t13
%t50 = load i32, i32* %t13
%t51 = getelementptr inbounds [10 x i32], [10 x i32]* @size, i32 0, i32 %t50
%t52 = load i32, i32* %t51
%t53 = mul i32 %t49, 10
%t54 = add i32 %t53, %t52
%t55 = getelementptr inbounds [100 x i32], [100 x i32]* @cap, i32 0, i32 %t54
store i32 0, i32* %t55
%t56 = load i32, i32* %t13
%t57 = load i32, i32* %t13
%t58 = getelementptr inbounds [10 x i32], [10 x i32]* @size, i32 0, i32 %t57
%t59 = load i32, i32* %t58
%t60 = mul i32 %t56, 10
%t61 = add i32 %t60, %t59
%t62 = getelementptr inbounds [100 x i32], [100 x i32]* @rev, i32 0, i32 %t61
%t63 = load i32, i32* %t12
%t64 = getelementptr inbounds [10 x i32], [10 x i32]* @size, i32 0, i32 %t63
%t65 = load i32, i32* %t64
store i32 %t65, i32* %t62
%t66 = load i32, i32* %t12
%t67 = getelementptr inbounds [10 x i32], [10 x i32]* @size, i32 0, i32 %t66
%t68 = load i32, i32* %t12
%t69 = getelementptr inbounds [10 x i32], [10 x i32]* @size, i32 0, i32 %t68
%t70 = load i32, i32* %t69
%t71 = add i32 %t70, 1
store i32 %t71, i32* %t67
%t72 = load i32, i32* %t13
%t73 = getelementptr inbounds [10 x i32], [10 x i32]* @size, i32 0, i32 %t72
%t74 = load i32, i32* %t13
%t75 = getelementptr inbounds [10 x i32], [10 x i32]* @size, i32 0, i32 %t74
%t76 = load i32, i32* %t75
%t77 = add i32 %t76, 1
store i32 %t77, i32* %t73
ret void
}
define i32 @dfs(i32 %arg.s, i32 %arg.t, i32 %arg.f) {
entry:
%t78 = alloca i32
store i32 %arg.s, i32* %t78
%t79 = alloca i32
store i32 %arg.t, i32* %t79
%t80 = alloca i32
store i32 %arg.f, i32* %t80
%t81 = load i32, i32* %t78
%t82 = load i32, i32* %t79
%t83 = icmp eq i32 %t81, %t82
%t84 = icmp ne i32 %t83, 0
br i1 %t84, label %if.then.4, label %if.end.5
if.then.4:
%t85 = load i32, i32* %t80
ret i32 %t85
if.end.5:
%t86 = load i32, i32* %t78
%t87 = getelementptr inbounds [10 x i32], [10 x i32]* @used, i32 0, i32 %t86
store i32 1, i32* %t87
%t88 = alloca i32
store i32 0, i32* %t88
br label %while.cond.6
while.cond.6:
%t89 = load i32, i32* %t88
%t90 = load i32, i32* %t78
%t91 = getelementptr inbounds [10 x i32], [10 x i32]* @size, i32 0, i32 %t90
%t92 = load i32, i32* %t91
%t93 = icmp slt i32 %t89, %t92
%t94 = icmp ne i32 %t93, 0
br i1 %t94, label %while.body.7, label %while.end.8
while.body.7:
%t95 = load i32, i32* %t78
%t96 = load i32, i32* %t88
%t97 = mul i32 %t95, 10
%t98 = add i32 %t97, %t96
%t99 = getelementptr inbounds [100 x i32], [100 x i32]* @to, i32 0, i32 %t98
%t100 = load i32, i32* %t99
%t101 = getelementptr inbounds [10 x i32], [10 x i32]* @used, i32 0, i32 %t100
%t102 = load i32, i32* %t101
%t103 = icmp ne i32 %t102, 0
br i1 %t103, label %if.then.9, label %if.end.10
while.end.8:
ret i32 0
if.then.9:
%t104 = load i32, i32* %t88
%t105 = add i32 %t104, 1
store i32 %t105, i32* %t88
br label %while.cond.6
if.end.10:
%t106 = load i32, i32* %t78
%t107 = load i32, i32* %t88
%t108 = mul i32 %t106, 10
%t109 = add i32 %t108, %t107
%t110 = getelementptr inbounds [100 x i32], [100 x i32]* @cap, i32 0, i32 %t109
%t111 = load i32, i32* %t110
%t112 = icmp sle i32 %t111, 0
%t113 = icmp ne i32 %t112, 0
br i1 %t113, label %if.then.11, label %if.end.12
if.then.11:
%t114 = load i32, i32* %t88
%t115 = add i32 %t114, 1
store i32 %t115, i32* %t88
br label %while.cond.6
if.end.12:
%t116 = alloca i32
store i32 0, i32* %t116
%t117 = load i32, i32* %t80
%t118 = load i32, i32* %t78
%t119 = load i32, i32* %t88
%t120 = mul i32 %t118, 10
%t121 = add i32 %t120, %t119
%t122 = getelementptr inbounds [100 x i32], [100 x i32]* @cap, i32 0, i32 %t121
%t123 = load i32, i32* %t122
%t124 = icmp slt i32 %t117, %t123
%t125 = icmp ne i32 %t124, 0
br i1 %t125, label %if.then.13, label %if.else.15
if.then.13:
%t126 = load i32, i32* %t80
store i32 %t126, i32* %t116
br label %if.end.14
if.end.14:
%t133 = alloca i32
%t134 = load i32, i32* %t78
%t135 = load i32, i32* %t88
%t136 = mul i32 %t134, 10
%t137 = add i32 %t136, %t135
%t138 = getelementptr inbounds [100 x i32], [100 x i32]* @to, i32 0, i32 %t137
%t139 = load i32, i32* %t138
%t140 = load i32, i32* %t79
%t141 = load i32, i32* %t116
%t142 = call i32 @dfs(i32 %t139, i32 %t140, i32 %t141)
store i32 %t142, i32* %t133
%t143 = load i32, i32* %t133
%t144 = icmp sgt i32 %t143, 0
%t145 = icmp ne i32 %t144, 0
br i1 %t145, label %if.then.16, label %if.end.17
if.else.15:
%t127 = load i32, i32* %t78
%t128 = load i32, i32* %t88
%t129 = mul i32 %t127, 10
%t130 = add i32 %t129, %t128
%t131 = getelementptr inbounds [100 x i32], [100 x i32]* @cap, i32 0, i32 %t130
%t132 = load i32, i32* %t131
store i32 %t132, i32* %t116
br label %if.end.14
if.then.16:
%t146 = load i32, i32* %t78
%t147 = load i32, i32* %t88
%t148 = mul i32 %t146, 10
%t149 = add i32 %t148, %t147
%t150 = getelementptr inbounds [100 x i32], [100 x i32]* @cap, i32 0, i32 %t149
%t151 = load i32, i32* %t78
%t152 = load i32, i32* %t88
%t153 = mul i32 %t151, 10
%t154 = add i32 %t153, %t152
%t155 = getelementptr inbounds [100 x i32], [100 x i32]* @cap, i32 0, i32 %t154
%t156 = load i32, i32* %t155
%t157 = load i32, i32* %t133
%t158 = sub i32 %t156, %t157
store i32 %t158, i32* %t150
%t159 = load i32, i32* %t78
%t160 = load i32, i32* %t88
%t161 = mul i32 %t159, 10
%t162 = add i32 %t161, %t160
%t163 = getelementptr inbounds [100 x i32], [100 x i32]* @to, i32 0, i32 %t162
%t164 = load i32, i32* %t163
%t165 = load i32, i32* %t78
%t166 = load i32, i32* %t88
%t167 = mul i32 %t165, 10
%t168 = add i32 %t167, %t166
%t169 = getelementptr inbounds [100 x i32], [100 x i32]* @rev, i32 0, i32 %t168
%t170 = load i32, i32* %t169
%t171 = mul i32 %t164, 10
%t172 = add i32 %t171, %t170
%t173 = getelementptr inbounds [100 x i32], [100 x i32]* @cap, i32 0, i32 %t172
%t174 = load i32, i32* %t78
%t175 = load i32, i32* %t88
%t176 = mul i32 %t174, 10
%t177 = add i32 %t176, %t175
%t178 = getelementptr inbounds [100 x i32], [100 x i32]* @to, i32 0, i32 %t177
%t179 = load i32, i32* %t178
%t180 = load i32, i32* %t78
%t181 = load i32, i32* %t88
%t182 = mul i32 %t180, 10
%t183 = add i32 %t182, %t181
%t184 = getelementptr inbounds [100 x i32], [100 x i32]* @rev, i32 0, i32 %t183
%t185 = load i32, i32* %t184
%t186 = mul i32 %t179, 10
%t187 = add i32 %t186, %t185
%t188 = getelementptr inbounds [100 x i32], [100 x i32]* @cap, i32 0, i32 %t187
%t189 = load i32, i32* %t188
%t190 = load i32, i32* %t133
%t191 = add i32 %t189, %t190
store i32 %t191, i32* %t173
%t192 = load i32, i32* %t133
ret i32 %t192
if.end.17:
%t193 = load i32, i32* %t88
%t194 = add i32 %t193, 1
store i32 %t194, i32* %t88
br label %while.cond.6
}
define i32 @max_flow(i32 %arg.s, i32 %arg.t) {
entry:
%t195 = alloca i32
store i32 %arg.s, i32* %t195
%t196 = alloca i32
store i32 %arg.t, i32* %t196
%t197 = alloca i32
store i32 0, i32* %t197
br label %while.cond.18
while.cond.18:
br i1 1, label %while.body.19, label %while.end.20
while.body.19:
call void @my_memset(i32* @used, i32 0, i32 10)
%t199 = alloca i32
%t200 = load i32, i32* %t195
%t201 = load i32, i32* %t196
%t202 = call i32 @dfs(i32 %t200, i32 %t201, i32 1879048192)
store i32 %t202, i32* %t199
%t203 = load i32, i32* %t199
%t204 = icmp eq i32 %t203, 0
%t205 = icmp ne i32 %t204, 0
br i1 %t205, label %if.then.21, label %if.end.22
while.end.20:
ret i32 0
if.then.21:
%t206 = load i32, i32* %t197
ret i32 %t206
if.end.22:
%t207 = load i32, i32* %t197
%t208 = load i32, i32* %t199
%t209 = add i32 %t207, %t208
store i32 %t209, i32* %t197
br label %while.cond.18
}
define i32 @main() {
entry:
%t210 = alloca i32
store i32 0, i32* %t210
%t211 = alloca i32
store i32 0, i32* %t211
%t212 = call i32 @getint()
store i32 %t212, i32* %t210
%t213 = call i32 @getint()
store i32 %t213, i32* %t211
call void @my_memset(i32* @size, i32 0, i32 10)
br label %while.cond.23
while.cond.23:
%t215 = load i32, i32* %t211
%t216 = icmp sgt i32 %t215, 0
%t217 = icmp ne i32 %t216, 0
br i1 %t217, label %while.body.24, label %while.end.25
while.body.24:
%t218 = alloca i32
store i32 0, i32* %t218
%t219 = alloca i32
store i32 0, i32* %t219
%t220 = call i32 @getint()
store i32 %t220, i32* %t218
%t221 = call i32 @getint()
store i32 %t221, i32* %t219
%t222 = alloca i32
%t223 = call i32 @getint()
store i32 %t223, i32* %t222
%t224 = load i32, i32* %t218
%t225 = load i32, i32* %t219
%t226 = load i32, i32* %t222
call void @add_node(i32 %t224, i32 %t225, i32 %t226)
%t228 = load i32, i32* %t211
%t229 = sub i32 %t228, 1
store i32 %t229, i32* %t211
br label %while.cond.23
while.end.25:
%t230 = load i32, i32* %t210
%t231 = call i32 @max_flow(i32 1, i32 %t230)
call void @putint(i32 %t231)
call void @putch(i32 10)
ret i32 0
}

@ -0,0 +1,176 @@
@ans = global [50 x i32] zeroinitializer
@sum = global i32 0
@n = global i32 0
@row = global [50 x i32] zeroinitializer
@line1 = global [50 x i32] zeroinitializer
@line2 = global [100 x i32] zeroinitializer
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define void @printans() {
entry:
%t0 = load i32, i32* @sum
%t1 = add i32 %t0, 1
store i32 %t1, i32* @sum
%t2 = alloca i32
store i32 1, i32* %t2
br label %while.cond.1
while.cond.1:
%t3 = load i32, i32* %t2
%t4 = load i32, i32* @n
%t5 = icmp sle i32 %t3, %t4
%t6 = icmp ne i32 %t5, 0
br i1 %t6, label %while.body.2, label %while.end.3
while.body.2:
%t7 = load i32, i32* %t2
%t8 = getelementptr inbounds [50 x i32], [50 x i32]* @ans, i32 0, i32 %t7
%t9 = load i32, i32* %t8
call void @putint(i32 %t9)
%t11 = load i32, i32* %t2
%t12 = load i32, i32* @n
%t13 = icmp eq i32 %t11, %t12
%t14 = icmp ne i32 %t13, 0
br i1 %t14, label %if.then.4, label %if.else.6
while.end.3:
ret void
if.then.4:
call void @putch(i32 10)
ret void
if.end.5:
%t17 = load i32, i32* %t2
%t18 = add i32 %t17, 1
store i32 %t18, i32* %t2
br label %while.cond.1
if.else.6:
call void @putch(i32 32)
br label %if.end.5
}
define void @f(i32 %arg.step) {
entry:
%t19 = alloca i32
store i32 %arg.step, i32* %t19
%t20 = alloca i32
store i32 1, i32* %t20
br label %while.cond.7
while.cond.7:
%t21 = load i32, i32* %t20
%t22 = load i32, i32* @n
%t23 = icmp sle i32 %t21, %t22
%t24 = icmp ne i32 %t23, 0
br i1 %t24, label %while.body.8, label %while.end.9
while.body.8:
%t25 = load i32, i32* %t20
%t26 = getelementptr inbounds [50 x i32], [50 x i32]* @row, i32 0, i32 %t25
%t27 = load i32, i32* %t26
%t28 = icmp ne i32 %t27, 1
%t29 = icmp ne i32 %t28, 0
br i1 %t29, label %land.rhs.13, label %if.end.11
while.end.9:
ret void
if.then.10:
%t46 = load i32, i32* %t19
%t47 = getelementptr inbounds [50 x i32], [50 x i32]* @ans, i32 0, i32 %t46
%t48 = load i32, i32* %t20
store i32 %t48, i32* %t47
%t49 = load i32, i32* %t19
%t50 = load i32, i32* @n
%t51 = icmp eq i32 %t49, %t50
%t52 = icmp ne i32 %t51, 0
br i1 %t52, label %if.then.14, label %if.end.15
if.end.11:
%t81 = load i32, i32* %t20
%t82 = add i32 %t81, 1
store i32 %t82, i32* %t20
br label %while.cond.7
land.rhs.12:
%t37 = load i32, i32* @n
%t38 = load i32, i32* %t19
%t39 = add i32 %t37, %t38
%t40 = load i32, i32* %t20
%t41 = sub i32 %t39, %t40
%t42 = getelementptr inbounds [100 x i32], [100 x i32]* @line2, i32 0, i32 %t41
%t43 = load i32, i32* %t42
%t44 = icmp eq i32 %t43, 0
%t45 = icmp ne i32 %t44, 0
br i1 %t45, label %if.then.10, label %if.end.11
land.rhs.13:
%t30 = load i32, i32* %t19
%t31 = load i32, i32* %t20
%t32 = add i32 %t30, %t31
%t33 = getelementptr inbounds [50 x i32], [50 x i32]* @line1, i32 0, i32 %t32
%t34 = load i32, i32* %t33
%t35 = icmp eq i32 %t34, 0
%t36 = icmp ne i32 %t35, 0
br i1 %t36, label %land.rhs.12, label %if.end.11
if.then.14:
call void @printans()
br label %if.end.15
if.end.15:
%t54 = load i32, i32* %t20
%t55 = getelementptr inbounds [50 x i32], [50 x i32]* @row, i32 0, i32 %t54
store i32 1, i32* %t55
%t56 = load i32, i32* %t19
%t57 = load i32, i32* %t20
%t58 = add i32 %t56, %t57
%t59 = getelementptr inbounds [50 x i32], [50 x i32]* @line1, i32 0, i32 %t58
store i32 1, i32* %t59
%t60 = load i32, i32* @n
%t61 = load i32, i32* %t19
%t62 = add i32 %t60, %t61
%t63 = load i32, i32* %t20
%t64 = sub i32 %t62, %t63
%t65 = getelementptr inbounds [100 x i32], [100 x i32]* @line2, i32 0, i32 %t64
store i32 1, i32* %t65
%t66 = load i32, i32* %t19
%t67 = add i32 %t66, 1
call void @f(i32 %t67)
%t69 = load i32, i32* %t20
%t70 = getelementptr inbounds [50 x i32], [50 x i32]* @row, i32 0, i32 %t69
store i32 0, i32* %t70
%t71 = load i32, i32* %t19
%t72 = load i32, i32* %t20
%t73 = add i32 %t71, %t72
%t74 = getelementptr inbounds [50 x i32], [50 x i32]* @line1, i32 0, i32 %t73
store i32 0, i32* %t74
%t75 = load i32, i32* @n
%t76 = load i32, i32* %t19
%t77 = add i32 %t75, %t76
%t78 = load i32, i32* %t20
%t79 = sub i32 %t77, %t78
%t80 = getelementptr inbounds [100 x i32], [100 x i32]* @line2, i32 0, i32 %t79
store i32 0, i32* %t80
br label %if.end.11
}
define i32 @main() {
entry:
%t83 = alloca i32
%t84 = call i32 @getint()
store i32 %t84, i32* %t83
br label %while.cond.16
while.cond.16:
%t85 = load i32, i32* %t83
%t86 = icmp sgt i32 %t85, 0
%t87 = icmp ne i32 %t86, 0
br i1 %t87, label %while.body.17, label %while.end.18
while.body.17:
%t88 = call i32 @getint()
store i32 %t88, i32* @n
call void @f(i32 1)
%t90 = load i32, i32* %t83
%t91 = sub i32 %t90, 1
store i32 %t91, i32* %t83
br label %while.cond.16
while.end.18:
%t92 = load i32, i32* @sum
ret i32 %t92
}

@ -0,0 +1,811 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @MAX(i32 %arg.a, i32 %arg.b) {
entry:
%t0 = alloca i32
store i32 %arg.a, i32* %t0
%t1 = alloca i32
store i32 %arg.b, i32* %t1
%t2 = load i32, i32* %t0
%t3 = load i32, i32* %t1
%t4 = icmp eq i32 %t2, %t3
%t5 = icmp ne i32 %t4, 0
br i1 %t5, label %if.then.1, label %if.else.3
if.then.1:
%t6 = load i32, i32* %t0
ret i32 %t6
if.end.2:
ret i32 0
if.else.3:
%t7 = load i32, i32* %t0
%t8 = load i32, i32* %t1
%t9 = icmp sgt i32 %t7, %t8
%t10 = icmp ne i32 %t9, 0
br i1 %t10, label %if.then.4, label %if.else.6
if.then.4:
%t11 = load i32, i32* %t0
ret i32 %t11
if.end.5:
ret i32 0
if.else.6:
%t12 = load i32, i32* %t1
ret i32 %t12
}
define i32 @max_sum_nonadjacent(i32* %arg.arr, i32 %arg.n) {
entry:
%t13 = alloca i32
store i32 %arg.n, i32* %t13
%t14 = alloca i32, i32 16
%t15 = getelementptr inbounds i32, i32* %t14, i32 0
store i32 0, i32* %t15
%t16 = getelementptr inbounds i32, i32* %t14, i32 1
store i32 0, i32* %t16
%t17 = getelementptr inbounds i32, i32* %t14, i32 2
store i32 0, i32* %t17
%t18 = getelementptr inbounds i32, i32* %t14, i32 3
store i32 0, i32* %t18
%t19 = getelementptr inbounds i32, i32* %t14, i32 4
store i32 0, i32* %t19
%t20 = getelementptr inbounds i32, i32* %t14, i32 5
store i32 0, i32* %t20
%t21 = getelementptr inbounds i32, i32* %t14, i32 6
store i32 0, i32* %t21
%t22 = getelementptr inbounds i32, i32* %t14, i32 7
store i32 0, i32* %t22
%t23 = getelementptr inbounds i32, i32* %t14, i32 8
store i32 0, i32* %t23
%t24 = getelementptr inbounds i32, i32* %t14, i32 9
store i32 0, i32* %t24
%t25 = getelementptr inbounds i32, i32* %t14, i32 10
store i32 0, i32* %t25
%t26 = getelementptr inbounds i32, i32* %t14, i32 11
store i32 0, i32* %t26
%t27 = getelementptr inbounds i32, i32* %t14, i32 12
store i32 0, i32* %t27
%t28 = getelementptr inbounds i32, i32* %t14, i32 13
store i32 0, i32* %t28
%t29 = getelementptr inbounds i32, i32* %t14, i32 14
store i32 0, i32* %t29
%t30 = getelementptr inbounds i32, i32* %t14, i32 15
store i32 0, i32* %t30
%t31 = getelementptr inbounds i32, i32* %t14, i32 0
%t32 = getelementptr inbounds i32, i32* %arg.arr, i32 0
%t33 = load i32, i32* %t32
store i32 %t33, i32* %t31
%t34 = getelementptr inbounds i32, i32* %t14, i32 1
%t35 = getelementptr inbounds i32, i32* %arg.arr, i32 0
%t36 = load i32, i32* %t35
%t37 = getelementptr inbounds i32, i32* %arg.arr, i32 1
%t38 = load i32, i32* %t37
%t39 = call i32 @MAX(i32 %t36, i32 %t38)
store i32 %t39, i32* %t34
%t40 = alloca i32
store i32 2, i32* %t40
br label %while.cond.7
while.cond.7:
%t41 = load i32, i32* %t40
%t42 = load i32, i32* %t13
%t43 = icmp slt i32 %t41, %t42
%t44 = icmp ne i32 %t43, 0
br i1 %t44, label %while.body.8, label %while.end.9
while.body.8:
%t45 = load i32, i32* %t40
%t46 = getelementptr inbounds i32, i32* %t14, i32 %t45
%t47 = load i32, i32* %t40
%t48 = sub i32 %t47, 2
%t49 = getelementptr inbounds i32, i32* %t14, i32 %t48
%t50 = load i32, i32* %t49
%t51 = load i32, i32* %t40
%t52 = getelementptr inbounds i32, i32* %arg.arr, i32 %t51
%t53 = load i32, i32* %t52
%t54 = add i32 %t50, %t53
%t55 = load i32, i32* %t40
%t56 = sub i32 %t55, 1
%t57 = getelementptr inbounds i32, i32* %t14, i32 %t56
%t58 = load i32, i32* %t57
%t59 = call i32 @MAX(i32 %t54, i32 %t58)
store i32 %t59, i32* %t46
%t60 = load i32, i32* %t40
%t61 = add i32 %t60, 1
store i32 %t61, i32* %t40
br label %while.cond.7
while.end.9:
%t62 = load i32, i32* %t13
%t63 = sub i32 %t62, 1
%t64 = getelementptr inbounds i32, i32* %t14, i32 %t63
%t65 = load i32, i32* %t64
ret i32 %t65
}
define i32 @longest_common_subseq(i32* %arg.arr1, i32 %arg.len1, i32* %arg.arr2, i32 %arg.len2) {
entry:
%t66 = alloca i32
store i32 %arg.len1, i32* %t66
%t67 = alloca i32
store i32 %arg.len2, i32* %t67
%t68 = alloca i32, i32 256
%t69 = getelementptr inbounds i32, i32* %t68, i32 0
store i32 0, i32* %t69
%t70 = getelementptr inbounds i32, i32* %t68, i32 1
store i32 0, i32* %t70
%t71 = getelementptr inbounds i32, i32* %t68, i32 2
store i32 0, i32* %t71
%t72 = getelementptr inbounds i32, i32* %t68, i32 3
store i32 0, i32* %t72
%t73 = getelementptr inbounds i32, i32* %t68, i32 4
store i32 0, i32* %t73
%t74 = getelementptr inbounds i32, i32* %t68, i32 5
store i32 0, i32* %t74
%t75 = getelementptr inbounds i32, i32* %t68, i32 6
store i32 0, i32* %t75
%t76 = getelementptr inbounds i32, i32* %t68, i32 7
store i32 0, i32* %t76
%t77 = getelementptr inbounds i32, i32* %t68, i32 8
store i32 0, i32* %t77
%t78 = getelementptr inbounds i32, i32* %t68, i32 9
store i32 0, i32* %t78
%t79 = getelementptr inbounds i32, i32* %t68, i32 10
store i32 0, i32* %t79
%t80 = getelementptr inbounds i32, i32* %t68, i32 11
store i32 0, i32* %t80
%t81 = getelementptr inbounds i32, i32* %t68, i32 12
store i32 0, i32* %t81
%t82 = getelementptr inbounds i32, i32* %t68, i32 13
store i32 0, i32* %t82
%t83 = getelementptr inbounds i32, i32* %t68, i32 14
store i32 0, i32* %t83
%t84 = getelementptr inbounds i32, i32* %t68, i32 15
store i32 0, i32* %t84
%t85 = getelementptr inbounds i32, i32* %t68, i32 16
store i32 0, i32* %t85
%t86 = getelementptr inbounds i32, i32* %t68, i32 17
store i32 0, i32* %t86
%t87 = getelementptr inbounds i32, i32* %t68, i32 18
store i32 0, i32* %t87
%t88 = getelementptr inbounds i32, i32* %t68, i32 19
store i32 0, i32* %t88
%t89 = getelementptr inbounds i32, i32* %t68, i32 20
store i32 0, i32* %t89
%t90 = getelementptr inbounds i32, i32* %t68, i32 21
store i32 0, i32* %t90
%t91 = getelementptr inbounds i32, i32* %t68, i32 22
store i32 0, i32* %t91
%t92 = getelementptr inbounds i32, i32* %t68, i32 23
store i32 0, i32* %t92
%t93 = getelementptr inbounds i32, i32* %t68, i32 24
store i32 0, i32* %t93
%t94 = getelementptr inbounds i32, i32* %t68, i32 25
store i32 0, i32* %t94
%t95 = getelementptr inbounds i32, i32* %t68, i32 26
store i32 0, i32* %t95
%t96 = getelementptr inbounds i32, i32* %t68, i32 27
store i32 0, i32* %t96
%t97 = getelementptr inbounds i32, i32* %t68, i32 28
store i32 0, i32* %t97
%t98 = getelementptr inbounds i32, i32* %t68, i32 29
store i32 0, i32* %t98
%t99 = getelementptr inbounds i32, i32* %t68, i32 30
store i32 0, i32* %t99
%t100 = getelementptr inbounds i32, i32* %t68, i32 31
store i32 0, i32* %t100
%t101 = getelementptr inbounds i32, i32* %t68, i32 32
store i32 0, i32* %t101
%t102 = getelementptr inbounds i32, i32* %t68, i32 33
store i32 0, i32* %t102
%t103 = getelementptr inbounds i32, i32* %t68, i32 34
store i32 0, i32* %t103
%t104 = getelementptr inbounds i32, i32* %t68, i32 35
store i32 0, i32* %t104
%t105 = getelementptr inbounds i32, i32* %t68, i32 36
store i32 0, i32* %t105
%t106 = getelementptr inbounds i32, i32* %t68, i32 37
store i32 0, i32* %t106
%t107 = getelementptr inbounds i32, i32* %t68, i32 38
store i32 0, i32* %t107
%t108 = getelementptr inbounds i32, i32* %t68, i32 39
store i32 0, i32* %t108
%t109 = getelementptr inbounds i32, i32* %t68, i32 40
store i32 0, i32* %t109
%t110 = getelementptr inbounds i32, i32* %t68, i32 41
store i32 0, i32* %t110
%t111 = getelementptr inbounds i32, i32* %t68, i32 42
store i32 0, i32* %t111
%t112 = getelementptr inbounds i32, i32* %t68, i32 43
store i32 0, i32* %t112
%t113 = getelementptr inbounds i32, i32* %t68, i32 44
store i32 0, i32* %t113
%t114 = getelementptr inbounds i32, i32* %t68, i32 45
store i32 0, i32* %t114
%t115 = getelementptr inbounds i32, i32* %t68, i32 46
store i32 0, i32* %t115
%t116 = getelementptr inbounds i32, i32* %t68, i32 47
store i32 0, i32* %t116
%t117 = getelementptr inbounds i32, i32* %t68, i32 48
store i32 0, i32* %t117
%t118 = getelementptr inbounds i32, i32* %t68, i32 49
store i32 0, i32* %t118
%t119 = getelementptr inbounds i32, i32* %t68, i32 50
store i32 0, i32* %t119
%t120 = getelementptr inbounds i32, i32* %t68, i32 51
store i32 0, i32* %t120
%t121 = getelementptr inbounds i32, i32* %t68, i32 52
store i32 0, i32* %t121
%t122 = getelementptr inbounds i32, i32* %t68, i32 53
store i32 0, i32* %t122
%t123 = getelementptr inbounds i32, i32* %t68, i32 54
store i32 0, i32* %t123
%t124 = getelementptr inbounds i32, i32* %t68, i32 55
store i32 0, i32* %t124
%t125 = getelementptr inbounds i32, i32* %t68, i32 56
store i32 0, i32* %t125
%t126 = getelementptr inbounds i32, i32* %t68, i32 57
store i32 0, i32* %t126
%t127 = getelementptr inbounds i32, i32* %t68, i32 58
store i32 0, i32* %t127
%t128 = getelementptr inbounds i32, i32* %t68, i32 59
store i32 0, i32* %t128
%t129 = getelementptr inbounds i32, i32* %t68, i32 60
store i32 0, i32* %t129
%t130 = getelementptr inbounds i32, i32* %t68, i32 61
store i32 0, i32* %t130
%t131 = getelementptr inbounds i32, i32* %t68, i32 62
store i32 0, i32* %t131
%t132 = getelementptr inbounds i32, i32* %t68, i32 63
store i32 0, i32* %t132
%t133 = getelementptr inbounds i32, i32* %t68, i32 64
store i32 0, i32* %t133
%t134 = getelementptr inbounds i32, i32* %t68, i32 65
store i32 0, i32* %t134
%t135 = getelementptr inbounds i32, i32* %t68, i32 66
store i32 0, i32* %t135
%t136 = getelementptr inbounds i32, i32* %t68, i32 67
store i32 0, i32* %t136
%t137 = getelementptr inbounds i32, i32* %t68, i32 68
store i32 0, i32* %t137
%t138 = getelementptr inbounds i32, i32* %t68, i32 69
store i32 0, i32* %t138
%t139 = getelementptr inbounds i32, i32* %t68, i32 70
store i32 0, i32* %t139
%t140 = getelementptr inbounds i32, i32* %t68, i32 71
store i32 0, i32* %t140
%t141 = getelementptr inbounds i32, i32* %t68, i32 72
store i32 0, i32* %t141
%t142 = getelementptr inbounds i32, i32* %t68, i32 73
store i32 0, i32* %t142
%t143 = getelementptr inbounds i32, i32* %t68, i32 74
store i32 0, i32* %t143
%t144 = getelementptr inbounds i32, i32* %t68, i32 75
store i32 0, i32* %t144
%t145 = getelementptr inbounds i32, i32* %t68, i32 76
store i32 0, i32* %t145
%t146 = getelementptr inbounds i32, i32* %t68, i32 77
store i32 0, i32* %t146
%t147 = getelementptr inbounds i32, i32* %t68, i32 78
store i32 0, i32* %t147
%t148 = getelementptr inbounds i32, i32* %t68, i32 79
store i32 0, i32* %t148
%t149 = getelementptr inbounds i32, i32* %t68, i32 80
store i32 0, i32* %t149
%t150 = getelementptr inbounds i32, i32* %t68, i32 81
store i32 0, i32* %t150
%t151 = getelementptr inbounds i32, i32* %t68, i32 82
store i32 0, i32* %t151
%t152 = getelementptr inbounds i32, i32* %t68, i32 83
store i32 0, i32* %t152
%t153 = getelementptr inbounds i32, i32* %t68, i32 84
store i32 0, i32* %t153
%t154 = getelementptr inbounds i32, i32* %t68, i32 85
store i32 0, i32* %t154
%t155 = getelementptr inbounds i32, i32* %t68, i32 86
store i32 0, i32* %t155
%t156 = getelementptr inbounds i32, i32* %t68, i32 87
store i32 0, i32* %t156
%t157 = getelementptr inbounds i32, i32* %t68, i32 88
store i32 0, i32* %t157
%t158 = getelementptr inbounds i32, i32* %t68, i32 89
store i32 0, i32* %t158
%t159 = getelementptr inbounds i32, i32* %t68, i32 90
store i32 0, i32* %t159
%t160 = getelementptr inbounds i32, i32* %t68, i32 91
store i32 0, i32* %t160
%t161 = getelementptr inbounds i32, i32* %t68, i32 92
store i32 0, i32* %t161
%t162 = getelementptr inbounds i32, i32* %t68, i32 93
store i32 0, i32* %t162
%t163 = getelementptr inbounds i32, i32* %t68, i32 94
store i32 0, i32* %t163
%t164 = getelementptr inbounds i32, i32* %t68, i32 95
store i32 0, i32* %t164
%t165 = getelementptr inbounds i32, i32* %t68, i32 96
store i32 0, i32* %t165
%t166 = getelementptr inbounds i32, i32* %t68, i32 97
store i32 0, i32* %t166
%t167 = getelementptr inbounds i32, i32* %t68, i32 98
store i32 0, i32* %t167
%t168 = getelementptr inbounds i32, i32* %t68, i32 99
store i32 0, i32* %t168
%t169 = getelementptr inbounds i32, i32* %t68, i32 100
store i32 0, i32* %t169
%t170 = getelementptr inbounds i32, i32* %t68, i32 101
store i32 0, i32* %t170
%t171 = getelementptr inbounds i32, i32* %t68, i32 102
store i32 0, i32* %t171
%t172 = getelementptr inbounds i32, i32* %t68, i32 103
store i32 0, i32* %t172
%t173 = getelementptr inbounds i32, i32* %t68, i32 104
store i32 0, i32* %t173
%t174 = getelementptr inbounds i32, i32* %t68, i32 105
store i32 0, i32* %t174
%t175 = getelementptr inbounds i32, i32* %t68, i32 106
store i32 0, i32* %t175
%t176 = getelementptr inbounds i32, i32* %t68, i32 107
store i32 0, i32* %t176
%t177 = getelementptr inbounds i32, i32* %t68, i32 108
store i32 0, i32* %t177
%t178 = getelementptr inbounds i32, i32* %t68, i32 109
store i32 0, i32* %t178
%t179 = getelementptr inbounds i32, i32* %t68, i32 110
store i32 0, i32* %t179
%t180 = getelementptr inbounds i32, i32* %t68, i32 111
store i32 0, i32* %t180
%t181 = getelementptr inbounds i32, i32* %t68, i32 112
store i32 0, i32* %t181
%t182 = getelementptr inbounds i32, i32* %t68, i32 113
store i32 0, i32* %t182
%t183 = getelementptr inbounds i32, i32* %t68, i32 114
store i32 0, i32* %t183
%t184 = getelementptr inbounds i32, i32* %t68, i32 115
store i32 0, i32* %t184
%t185 = getelementptr inbounds i32, i32* %t68, i32 116
store i32 0, i32* %t185
%t186 = getelementptr inbounds i32, i32* %t68, i32 117
store i32 0, i32* %t186
%t187 = getelementptr inbounds i32, i32* %t68, i32 118
store i32 0, i32* %t187
%t188 = getelementptr inbounds i32, i32* %t68, i32 119
store i32 0, i32* %t188
%t189 = getelementptr inbounds i32, i32* %t68, i32 120
store i32 0, i32* %t189
%t190 = getelementptr inbounds i32, i32* %t68, i32 121
store i32 0, i32* %t190
%t191 = getelementptr inbounds i32, i32* %t68, i32 122
store i32 0, i32* %t191
%t192 = getelementptr inbounds i32, i32* %t68, i32 123
store i32 0, i32* %t192
%t193 = getelementptr inbounds i32, i32* %t68, i32 124
store i32 0, i32* %t193
%t194 = getelementptr inbounds i32, i32* %t68, i32 125
store i32 0, i32* %t194
%t195 = getelementptr inbounds i32, i32* %t68, i32 126
store i32 0, i32* %t195
%t196 = getelementptr inbounds i32, i32* %t68, i32 127
store i32 0, i32* %t196
%t197 = getelementptr inbounds i32, i32* %t68, i32 128
store i32 0, i32* %t197
%t198 = getelementptr inbounds i32, i32* %t68, i32 129
store i32 0, i32* %t198
%t199 = getelementptr inbounds i32, i32* %t68, i32 130
store i32 0, i32* %t199
%t200 = getelementptr inbounds i32, i32* %t68, i32 131
store i32 0, i32* %t200
%t201 = getelementptr inbounds i32, i32* %t68, i32 132
store i32 0, i32* %t201
%t202 = getelementptr inbounds i32, i32* %t68, i32 133
store i32 0, i32* %t202
%t203 = getelementptr inbounds i32, i32* %t68, i32 134
store i32 0, i32* %t203
%t204 = getelementptr inbounds i32, i32* %t68, i32 135
store i32 0, i32* %t204
%t205 = getelementptr inbounds i32, i32* %t68, i32 136
store i32 0, i32* %t205
%t206 = getelementptr inbounds i32, i32* %t68, i32 137
store i32 0, i32* %t206
%t207 = getelementptr inbounds i32, i32* %t68, i32 138
store i32 0, i32* %t207
%t208 = getelementptr inbounds i32, i32* %t68, i32 139
store i32 0, i32* %t208
%t209 = getelementptr inbounds i32, i32* %t68, i32 140
store i32 0, i32* %t209
%t210 = getelementptr inbounds i32, i32* %t68, i32 141
store i32 0, i32* %t210
%t211 = getelementptr inbounds i32, i32* %t68, i32 142
store i32 0, i32* %t211
%t212 = getelementptr inbounds i32, i32* %t68, i32 143
store i32 0, i32* %t212
%t213 = getelementptr inbounds i32, i32* %t68, i32 144
store i32 0, i32* %t213
%t214 = getelementptr inbounds i32, i32* %t68, i32 145
store i32 0, i32* %t214
%t215 = getelementptr inbounds i32, i32* %t68, i32 146
store i32 0, i32* %t215
%t216 = getelementptr inbounds i32, i32* %t68, i32 147
store i32 0, i32* %t216
%t217 = getelementptr inbounds i32, i32* %t68, i32 148
store i32 0, i32* %t217
%t218 = getelementptr inbounds i32, i32* %t68, i32 149
store i32 0, i32* %t218
%t219 = getelementptr inbounds i32, i32* %t68, i32 150
store i32 0, i32* %t219
%t220 = getelementptr inbounds i32, i32* %t68, i32 151
store i32 0, i32* %t220
%t221 = getelementptr inbounds i32, i32* %t68, i32 152
store i32 0, i32* %t221
%t222 = getelementptr inbounds i32, i32* %t68, i32 153
store i32 0, i32* %t222
%t223 = getelementptr inbounds i32, i32* %t68, i32 154
store i32 0, i32* %t223
%t224 = getelementptr inbounds i32, i32* %t68, i32 155
store i32 0, i32* %t224
%t225 = getelementptr inbounds i32, i32* %t68, i32 156
store i32 0, i32* %t225
%t226 = getelementptr inbounds i32, i32* %t68, i32 157
store i32 0, i32* %t226
%t227 = getelementptr inbounds i32, i32* %t68, i32 158
store i32 0, i32* %t227
%t228 = getelementptr inbounds i32, i32* %t68, i32 159
store i32 0, i32* %t228
%t229 = getelementptr inbounds i32, i32* %t68, i32 160
store i32 0, i32* %t229
%t230 = getelementptr inbounds i32, i32* %t68, i32 161
store i32 0, i32* %t230
%t231 = getelementptr inbounds i32, i32* %t68, i32 162
store i32 0, i32* %t231
%t232 = getelementptr inbounds i32, i32* %t68, i32 163
store i32 0, i32* %t232
%t233 = getelementptr inbounds i32, i32* %t68, i32 164
store i32 0, i32* %t233
%t234 = getelementptr inbounds i32, i32* %t68, i32 165
store i32 0, i32* %t234
%t235 = getelementptr inbounds i32, i32* %t68, i32 166
store i32 0, i32* %t235
%t236 = getelementptr inbounds i32, i32* %t68, i32 167
store i32 0, i32* %t236
%t237 = getelementptr inbounds i32, i32* %t68, i32 168
store i32 0, i32* %t237
%t238 = getelementptr inbounds i32, i32* %t68, i32 169
store i32 0, i32* %t238
%t239 = getelementptr inbounds i32, i32* %t68, i32 170
store i32 0, i32* %t239
%t240 = getelementptr inbounds i32, i32* %t68, i32 171
store i32 0, i32* %t240
%t241 = getelementptr inbounds i32, i32* %t68, i32 172
store i32 0, i32* %t241
%t242 = getelementptr inbounds i32, i32* %t68, i32 173
store i32 0, i32* %t242
%t243 = getelementptr inbounds i32, i32* %t68, i32 174
store i32 0, i32* %t243
%t244 = getelementptr inbounds i32, i32* %t68, i32 175
store i32 0, i32* %t244
%t245 = getelementptr inbounds i32, i32* %t68, i32 176
store i32 0, i32* %t245
%t246 = getelementptr inbounds i32, i32* %t68, i32 177
store i32 0, i32* %t246
%t247 = getelementptr inbounds i32, i32* %t68, i32 178
store i32 0, i32* %t247
%t248 = getelementptr inbounds i32, i32* %t68, i32 179
store i32 0, i32* %t248
%t249 = getelementptr inbounds i32, i32* %t68, i32 180
store i32 0, i32* %t249
%t250 = getelementptr inbounds i32, i32* %t68, i32 181
store i32 0, i32* %t250
%t251 = getelementptr inbounds i32, i32* %t68, i32 182
store i32 0, i32* %t251
%t252 = getelementptr inbounds i32, i32* %t68, i32 183
store i32 0, i32* %t252
%t253 = getelementptr inbounds i32, i32* %t68, i32 184
store i32 0, i32* %t253
%t254 = getelementptr inbounds i32, i32* %t68, i32 185
store i32 0, i32* %t254
%t255 = getelementptr inbounds i32, i32* %t68, i32 186
store i32 0, i32* %t255
%t256 = getelementptr inbounds i32, i32* %t68, i32 187
store i32 0, i32* %t256
%t257 = getelementptr inbounds i32, i32* %t68, i32 188
store i32 0, i32* %t257
%t258 = getelementptr inbounds i32, i32* %t68, i32 189
store i32 0, i32* %t258
%t259 = getelementptr inbounds i32, i32* %t68, i32 190
store i32 0, i32* %t259
%t260 = getelementptr inbounds i32, i32* %t68, i32 191
store i32 0, i32* %t260
%t261 = getelementptr inbounds i32, i32* %t68, i32 192
store i32 0, i32* %t261
%t262 = getelementptr inbounds i32, i32* %t68, i32 193
store i32 0, i32* %t262
%t263 = getelementptr inbounds i32, i32* %t68, i32 194
store i32 0, i32* %t263
%t264 = getelementptr inbounds i32, i32* %t68, i32 195
store i32 0, i32* %t264
%t265 = getelementptr inbounds i32, i32* %t68, i32 196
store i32 0, i32* %t265
%t266 = getelementptr inbounds i32, i32* %t68, i32 197
store i32 0, i32* %t266
%t267 = getelementptr inbounds i32, i32* %t68, i32 198
store i32 0, i32* %t267
%t268 = getelementptr inbounds i32, i32* %t68, i32 199
store i32 0, i32* %t268
%t269 = getelementptr inbounds i32, i32* %t68, i32 200
store i32 0, i32* %t269
%t270 = getelementptr inbounds i32, i32* %t68, i32 201
store i32 0, i32* %t270
%t271 = getelementptr inbounds i32, i32* %t68, i32 202
store i32 0, i32* %t271
%t272 = getelementptr inbounds i32, i32* %t68, i32 203
store i32 0, i32* %t272
%t273 = getelementptr inbounds i32, i32* %t68, i32 204
store i32 0, i32* %t273
%t274 = getelementptr inbounds i32, i32* %t68, i32 205
store i32 0, i32* %t274
%t275 = getelementptr inbounds i32, i32* %t68, i32 206
store i32 0, i32* %t275
%t276 = getelementptr inbounds i32, i32* %t68, i32 207
store i32 0, i32* %t276
%t277 = getelementptr inbounds i32, i32* %t68, i32 208
store i32 0, i32* %t277
%t278 = getelementptr inbounds i32, i32* %t68, i32 209
store i32 0, i32* %t278
%t279 = getelementptr inbounds i32, i32* %t68, i32 210
store i32 0, i32* %t279
%t280 = getelementptr inbounds i32, i32* %t68, i32 211
store i32 0, i32* %t280
%t281 = getelementptr inbounds i32, i32* %t68, i32 212
store i32 0, i32* %t281
%t282 = getelementptr inbounds i32, i32* %t68, i32 213
store i32 0, i32* %t282
%t283 = getelementptr inbounds i32, i32* %t68, i32 214
store i32 0, i32* %t283
%t284 = getelementptr inbounds i32, i32* %t68, i32 215
store i32 0, i32* %t284
%t285 = getelementptr inbounds i32, i32* %t68, i32 216
store i32 0, i32* %t285
%t286 = getelementptr inbounds i32, i32* %t68, i32 217
store i32 0, i32* %t286
%t287 = getelementptr inbounds i32, i32* %t68, i32 218
store i32 0, i32* %t287
%t288 = getelementptr inbounds i32, i32* %t68, i32 219
store i32 0, i32* %t288
%t289 = getelementptr inbounds i32, i32* %t68, i32 220
store i32 0, i32* %t289
%t290 = getelementptr inbounds i32, i32* %t68, i32 221
store i32 0, i32* %t290
%t291 = getelementptr inbounds i32, i32* %t68, i32 222
store i32 0, i32* %t291
%t292 = getelementptr inbounds i32, i32* %t68, i32 223
store i32 0, i32* %t292
%t293 = getelementptr inbounds i32, i32* %t68, i32 224
store i32 0, i32* %t293
%t294 = getelementptr inbounds i32, i32* %t68, i32 225
store i32 0, i32* %t294
%t295 = getelementptr inbounds i32, i32* %t68, i32 226
store i32 0, i32* %t295
%t296 = getelementptr inbounds i32, i32* %t68, i32 227
store i32 0, i32* %t296
%t297 = getelementptr inbounds i32, i32* %t68, i32 228
store i32 0, i32* %t297
%t298 = getelementptr inbounds i32, i32* %t68, i32 229
store i32 0, i32* %t298
%t299 = getelementptr inbounds i32, i32* %t68, i32 230
store i32 0, i32* %t299
%t300 = getelementptr inbounds i32, i32* %t68, i32 231
store i32 0, i32* %t300
%t301 = getelementptr inbounds i32, i32* %t68, i32 232
store i32 0, i32* %t301
%t302 = getelementptr inbounds i32, i32* %t68, i32 233
store i32 0, i32* %t302
%t303 = getelementptr inbounds i32, i32* %t68, i32 234
store i32 0, i32* %t303
%t304 = getelementptr inbounds i32, i32* %t68, i32 235
store i32 0, i32* %t304
%t305 = getelementptr inbounds i32, i32* %t68, i32 236
store i32 0, i32* %t305
%t306 = getelementptr inbounds i32, i32* %t68, i32 237
store i32 0, i32* %t306
%t307 = getelementptr inbounds i32, i32* %t68, i32 238
store i32 0, i32* %t307
%t308 = getelementptr inbounds i32, i32* %t68, i32 239
store i32 0, i32* %t308
%t309 = getelementptr inbounds i32, i32* %t68, i32 240
store i32 0, i32* %t309
%t310 = getelementptr inbounds i32, i32* %t68, i32 241
store i32 0, i32* %t310
%t311 = getelementptr inbounds i32, i32* %t68, i32 242
store i32 0, i32* %t311
%t312 = getelementptr inbounds i32, i32* %t68, i32 243
store i32 0, i32* %t312
%t313 = getelementptr inbounds i32, i32* %t68, i32 244
store i32 0, i32* %t313
%t314 = getelementptr inbounds i32, i32* %t68, i32 245
store i32 0, i32* %t314
%t315 = getelementptr inbounds i32, i32* %t68, i32 246
store i32 0, i32* %t315
%t316 = getelementptr inbounds i32, i32* %t68, i32 247
store i32 0, i32* %t316
%t317 = getelementptr inbounds i32, i32* %t68, i32 248
store i32 0, i32* %t317
%t318 = getelementptr inbounds i32, i32* %t68, i32 249
store i32 0, i32* %t318
%t319 = getelementptr inbounds i32, i32* %t68, i32 250
store i32 0, i32* %t319
%t320 = getelementptr inbounds i32, i32* %t68, i32 251
store i32 0, i32* %t320
%t321 = getelementptr inbounds i32, i32* %t68, i32 252
store i32 0, i32* %t321
%t322 = getelementptr inbounds i32, i32* %t68, i32 253
store i32 0, i32* %t322
%t323 = getelementptr inbounds i32, i32* %t68, i32 254
store i32 0, i32* %t323
%t324 = getelementptr inbounds i32, i32* %t68, i32 255
store i32 0, i32* %t324
%t325 = alloca i32
store i32 0, i32* %t325
%t326 = alloca i32
store i32 0, i32* %t326
store i32 1, i32* %t325
br label %while.cond.10
while.cond.10:
%t327 = load i32, i32* %t325
%t328 = load i32, i32* %t66
%t329 = icmp sle i32 %t327, %t328
%t330 = icmp ne i32 %t329, 0
br i1 %t330, label %while.body.11, label %while.end.12
while.body.11:
store i32 1, i32* %t326
br label %while.cond.13
while.end.12:
%t383 = load i32, i32* %t66
%t384 = load i32, i32* %t67
%t385 = mul i32 %t383, 16
%t386 = add i32 %t385, %t384
%t387 = getelementptr inbounds i32, i32* %t68, i32 %t386
%t388 = load i32, i32* %t387
ret i32 %t388
while.cond.13:
%t331 = load i32, i32* %t326
%t332 = load i32, i32* %t67
%t333 = icmp sle i32 %t331, %t332
%t334 = icmp ne i32 %t333, 0
br i1 %t334, label %while.body.14, label %while.end.15
while.body.14:
%t335 = load i32, i32* %t325
%t336 = sub i32 %t335, 1
%t337 = getelementptr inbounds i32, i32* %arg.arr1, i32 %t336
%t338 = load i32, i32* %t337
%t339 = load i32, i32* %t326
%t340 = sub i32 %t339, 1
%t341 = getelementptr inbounds i32, i32* %arg.arr2, i32 %t340
%t342 = load i32, i32* %t341
%t343 = icmp eq i32 %t338, %t342
%t344 = icmp ne i32 %t343, 0
br i1 %t344, label %if.then.16, label %if.else.18
while.end.15:
%t381 = load i32, i32* %t325
%t382 = add i32 %t381, 1
store i32 %t382, i32* %t325
br label %while.cond.10
if.then.16:
%t345 = load i32, i32* %t325
%t346 = load i32, i32* %t326
%t347 = mul i32 %t345, 16
%t348 = add i32 %t347, %t346
%t349 = getelementptr inbounds i32, i32* %t68, i32 %t348
%t350 = load i32, i32* %t325
%t351 = sub i32 %t350, 1
%t352 = load i32, i32* %t326
%t353 = sub i32 %t352, 1
%t354 = mul i32 %t351, 16
%t355 = add i32 %t354, %t353
%t356 = getelementptr inbounds i32, i32* %t68, i32 %t355
%t357 = load i32, i32* %t356
%t358 = add i32 %t357, 1
store i32 %t358, i32* %t349
br label %if.end.17
if.end.17:
%t379 = load i32, i32* %t326
%t380 = add i32 %t379, 1
store i32 %t380, i32* %t326
br label %while.cond.13
if.else.18:
%t359 = load i32, i32* %t325
%t360 = load i32, i32* %t326
%t361 = mul i32 %t359, 16
%t362 = add i32 %t361, %t360
%t363 = getelementptr inbounds i32, i32* %t68, i32 %t362
%t364 = load i32, i32* %t325
%t365 = sub i32 %t364, 1
%t366 = load i32, i32* %t326
%t367 = mul i32 %t365, 16
%t368 = add i32 %t367, %t366
%t369 = getelementptr inbounds i32, i32* %t68, i32 %t368
%t370 = load i32, i32* %t369
%t371 = load i32, i32* %t325
%t372 = load i32, i32* %t326
%t373 = sub i32 %t372, 1
%t374 = mul i32 %t371, 16
%t375 = add i32 %t374, %t373
%t376 = getelementptr inbounds i32, i32* %t68, i32 %t375
%t377 = load i32, i32* %t376
%t378 = call i32 @MAX(i32 %t370, i32 %t377)
store i32 %t378, i32* %t363
br label %if.end.17
}
define i32 @main() {
entry:
%t389 = alloca i32, i32 15
%t390 = getelementptr inbounds i32, i32* %t389, i32 0
store i32 8, i32* %t390
%t391 = getelementptr inbounds i32, i32* %t389, i32 1
store i32 7, i32* %t391
%t392 = getelementptr inbounds i32, i32* %t389, i32 2
store i32 4, i32* %t392
%t393 = getelementptr inbounds i32, i32* %t389, i32 3
store i32 1, i32* %t393
%t394 = getelementptr inbounds i32, i32* %t389, i32 4
store i32 2, i32* %t394
%t395 = getelementptr inbounds i32, i32* %t389, i32 5
store i32 7, i32* %t395
%t396 = getelementptr inbounds i32, i32* %t389, i32 6
store i32 0, i32* %t396
%t397 = getelementptr inbounds i32, i32* %t389, i32 7
store i32 1, i32* %t397
%t398 = getelementptr inbounds i32, i32* %t389, i32 8
store i32 9, i32* %t398
%t399 = getelementptr inbounds i32, i32* %t389, i32 9
store i32 3, i32* %t399
%t400 = getelementptr inbounds i32, i32* %t389, i32 10
store i32 4, i32* %t400
%t401 = getelementptr inbounds i32, i32* %t389, i32 11
store i32 8, i32* %t401
%t402 = getelementptr inbounds i32, i32* %t389, i32 12
store i32 3, i32* %t402
%t403 = getelementptr inbounds i32, i32* %t389, i32 13
store i32 7, i32* %t403
%t404 = getelementptr inbounds i32, i32* %t389, i32 14
store i32 0, i32* %t404
%t405 = alloca i32, i32 13
%t406 = getelementptr inbounds i32, i32* %t405, i32 0
store i32 3, i32* %t406
%t407 = getelementptr inbounds i32, i32* %t405, i32 1
store i32 9, i32* %t407
%t408 = getelementptr inbounds i32, i32* %t405, i32 2
store i32 7, i32* %t408
%t409 = getelementptr inbounds i32, i32* %t405, i32 3
store i32 1, i32* %t409
%t410 = getelementptr inbounds i32, i32* %t405, i32 4
store i32 4, i32* %t410
%t411 = getelementptr inbounds i32, i32* %t405, i32 5
store i32 2, i32* %t411
%t412 = getelementptr inbounds i32, i32* %t405, i32 6
store i32 4, i32* %t412
%t413 = getelementptr inbounds i32, i32* %t405, i32 7
store i32 3, i32* %t413
%t414 = getelementptr inbounds i32, i32* %t405, i32 8
store i32 6, i32* %t414
%t415 = getelementptr inbounds i32, i32* %t405, i32 9
store i32 8, i32* %t415
%t416 = getelementptr inbounds i32, i32* %t405, i32 10
store i32 0, i32* %t416
%t417 = getelementptr inbounds i32, i32* %t405, i32 11
store i32 1, i32* %t417
%t418 = getelementptr inbounds i32, i32* %t405, i32 12
store i32 5, i32* %t418
%t419 = alloca i32
store i32 0, i32* %t419
%t420 = alloca i32
store i32 0, i32* %t420
%t421 = call i32 @max_sum_nonadjacent(i32* %t389, i32 15)
call void @putint(i32 %t421)
call void @putch(i32 10)
%t424 = call i32 @longest_common_subseq(i32* %t389, i32 15, i32* %t405, i32 13)
call void @putint(i32 %t424)
call void @putch(i32 10)
ret i32 0
}

@ -0,0 +1,100 @@
@a = global i32 -1
@b = global i32 1
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @inc_a() {
entry:
%t0 = alloca i32
%t1 = load i32, i32* @a
store i32 %t1, i32* %t0
%t2 = load i32, i32* %t0
%t3 = add i32 %t2, 1
store i32 %t3, i32* %t0
%t4 = load i32, i32* %t0
store i32 %t4, i32* @a
%t5 = load i32, i32* @a
ret i32 %t5
}
define i32 @main() {
entry:
%t6 = alloca i32
store i32 5, i32* %t6
br label %while.cond.1
while.cond.1:
%t7 = load i32, i32* %t6
%t8 = icmp sge i32 %t7, 0
%t9 = icmp ne i32 %t8, 0
br i1 %t9, label %while.body.2, label %while.end.3
while.body.2:
%t10 = call i32 @inc_a()
%t11 = icmp ne i32 %t10, 0
br i1 %t11, label %land.rhs.7, label %if.end.5
while.end.3:
%t40 = load i32, i32* @a
call void @putint(i32 %t40)
call void @putch(i32 32)
%t43 = load i32, i32* @b
call void @putint(i32 %t43)
call void @putch(i32 10)
%t46 = load i32, i32* @a
ret i32 %t46
if.then.4:
%t16 = load i32, i32* @a
call void @putint(i32 %t16)
call void @putch(i32 32)
%t19 = load i32, i32* @b
call void @putint(i32 %t19)
call void @putch(i32 10)
br label %if.end.5
if.end.5:
%t22 = call i32 @inc_a()
%t23 = icmp slt i32 %t22, 14
%t24 = icmp ne i32 %t23, 0
br i1 %t24, label %if.then.8, label %lor.rhs.11
land.rhs.6:
%t14 = call i32 @inc_a()
%t15 = icmp ne i32 %t14, 0
br i1 %t15, label %if.then.4, label %if.end.5
land.rhs.7:
%t12 = call i32 @inc_a()
%t13 = icmp ne i32 %t12, 0
br i1 %t13, label %land.rhs.6, label %if.end.5
if.then.8:
%t32 = load i32, i32* @a
call void @putint(i32 %t32)
call void @putch(i32 10)
%t35 = load i32, i32* @b
%t36 = mul i32 %t35, 2
store i32 %t36, i32* @b
br label %if.end.9
if.end.9:
%t38 = load i32, i32* %t6
%t39 = sub i32 %t38, 1
store i32 %t39, i32* %t6
br label %while.cond.1
if.else.10:
%t37 = call i32 @inc_a()
br label %if.end.9
lor.rhs.11:
%t25 = call i32 @inc_a()
%t26 = icmp ne i32 %t25, 0
br i1 %t26, label %land.rhs.12, label %if.else.10
land.rhs.12:
%t27 = call i32 @inc_a()
%t28 = call i32 @inc_a()
%t29 = sub i32 %t27, %t28
%t30 = add i32 %t29, 1
%t31 = icmp ne i32 %t30, 0
br i1 %t31, label %if.then.8, label %if.else.10
}

@ -0,0 +1,101 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @main() {
entry:
%t0 = alloca i32
store i32 2, i32* %t0
%t1 = alloca i32, i32 20
%t2 = getelementptr inbounds i32, i32* %t1, i32 0
store i32 1, i32* %t2
%t3 = getelementptr inbounds i32, i32* %t1, i32 1
store i32 2, i32* %t3
%t4 = getelementptr inbounds i32, i32* %t1, i32 2
store i32 0, i32* %t4
%t5 = getelementptr inbounds i32, i32* %t1, i32 3
store i32 0, i32* %t5
%t6 = getelementptr inbounds i32, i32* %t1, i32 4
store i32 0, i32* %t6
%t7 = getelementptr inbounds i32, i32* %t1, i32 5
store i32 0, i32* %t7
%t8 = getelementptr inbounds i32, i32* %t1, i32 6
store i32 0, i32* %t8
%t9 = getelementptr inbounds i32, i32* %t1, i32 7
store i32 0, i32* %t9
%t10 = getelementptr inbounds i32, i32* %t1, i32 8
store i32 0, i32* %t10
%t11 = getelementptr inbounds i32, i32* %t1, i32 9
store i32 0, i32* %t11
%t12 = getelementptr inbounds i32, i32* %t1, i32 10
store i32 0, i32* %t12
%t13 = getelementptr inbounds i32, i32* %t1, i32 11
store i32 0, i32* %t13
%t14 = getelementptr inbounds i32, i32* %t1, i32 12
store i32 0, i32* %t14
%t15 = getelementptr inbounds i32, i32* %t1, i32 13
store i32 0, i32* %t15
%t16 = getelementptr inbounds i32, i32* %t1, i32 14
store i32 0, i32* %t16
%t17 = getelementptr inbounds i32, i32* %t1, i32 15
store i32 0, i32* %t17
%t18 = getelementptr inbounds i32, i32* %t1, i32 16
store i32 0, i32* %t18
%t19 = getelementptr inbounds i32, i32* %t1, i32 17
store i32 0, i32* %t19
%t20 = getelementptr inbounds i32, i32* %t1, i32 18
store i32 0, i32* %t20
%t21 = getelementptr inbounds i32, i32* %t1, i32 19
store i32 0, i32* %t21
%t22 = alloca i32
store i32 0, i32* %t22
br label %while.cond.1
while.cond.1:
%t23 = load i32, i32* %t0
%t24 = icmp slt i32 %t23, 20
%t25 = icmp ne i32 %t24, 0
br i1 %t25, label %while.body.2, label %while.end.3
while.body.2:
%t26 = load i32, i32* %t0
%t27 = getelementptr inbounds i32, i32* %t1, i32 %t26
%t28 = load i32, i32* %t0
%t29 = getelementptr inbounds i32, i32* %t1, i32 %t28
%t30 = load i32, i32* %t29
%t31 = load i32, i32* %t0
%t32 = sub i32 %t31, 1
%t33 = getelementptr inbounds i32, i32* %t1, i32 %t32
%t34 = load i32, i32* %t33
%t35 = add i32 %t30, %t34
%t36 = load i32, i32* %t0
%t37 = sub i32 %t36, 2
%t38 = getelementptr inbounds i32, i32* %t1, i32 %t37
%t39 = load i32, i32* %t38
%t40 = add i32 %t35, %t39
store i32 %t40, i32* %t27
%t41 = load i32, i32* %t22
%t42 = load i32, i32* %t0
%t43 = getelementptr inbounds i32, i32* %t1, i32 %t42
%t44 = load i32, i32* %t43
%t45 = add i32 %t41, %t44
store i32 %t45, i32* %t22
%t46 = load i32, i32* %t0
%t47 = getelementptr inbounds i32, i32* %t1, i32 %t46
%t48 = load i32, i32* %t47
call void @putint(i32 %t48)
call void @putch(i32 10)
%t51 = load i32, i32* %t0
%t52 = add i32 %t51, 1
store i32 %t52, i32* %t0
br label %while.cond.1
while.end.3:
%t53 = load i32, i32* %t22
ret i32 %t53
}

@ -0,0 +1,93 @@
@__HELLO = global [100 x i32] zeroinitializer
@N4__mE___ = global [300 x i32] zeroinitializer
@saY_HeI10_To = global [40 x i32] zeroinitializer
@RET = global [5 x i32] zeroinitializer
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @putstr(i32* %arg.str) {
entry:
%t0 = alloca i32
store i32 0, i32* %t0
store i32 0, i32* %t0
br label %while.cond.1
while.cond.1:
%t1 = load i32, i32* %t0
%t2 = getelementptr inbounds i32, i32* %arg.str, i32 %t1
%t3 = load i32, i32* %t2
%t4 = icmp ne i32 %t3, 0
br i1 %t4, label %while.body.2, label %while.end.3
while.body.2:
%t5 = load i32, i32* %t0
%t6 = getelementptr inbounds i32, i32* %arg.str, i32 %t5
%t7 = load i32, i32* %t6
call void @putch(i32 %t7)
%t9 = load i32, i32* %t0
%t10 = add i32 %t9, 1
store i32 %t10, i32* %t0
br label %while.cond.1
while.end.3:
%t11 = load i32, i32* %t0
ret i32 %t11
}
define i32 @main() {
entry:
%t12 = call i32 @putstr(i32* @__HELLO)
%t13 = alloca i32
store i32 0, i32* %t13
br label %while.cond.4
while.cond.4:
br i1 1, label %while.body.5, label %while.end.6
while.body.5:
%t14 = alloca i32
%t15 = load i32, i32* %t13
%t16 = sdiv i32 %t15, 6
store i32 %t16, i32* %t14
%t17 = alloca i32
%t18 = load i32, i32* %t13
%t19 = srem i32 %t18, 6
store i32 %t19, i32* %t17
%t20 = load i32, i32* %t14
%t21 = load i32, i32* %t17
%t22 = icmp ne i32 %t20, %t21
%t23 = icmp ne i32 %t22, 0
br i1 %t23, label %if.then.7, label %if.end.8
while.end.6:
ret i32 0
if.then.7:
%t24 = load i32, i32* %t14
%t25 = mul i32 %t24, 50
%t26 = getelementptr inbounds [300 x i32], [300 x i32]* @N4__mE___, i32 0, i32 %t25
%t27 = call i32 @putstr(i32* %t26)
%t28 = call i32 @putstr(i32* @saY_HeI10_To)
%t29 = load i32, i32* %t17
%t30 = mul i32 %t29, 50
%t31 = getelementptr inbounds [300 x i32], [300 x i32]* @N4__mE___, i32 0, i32 %t30
%t32 = call i32 @putstr(i32* %t31)
%t33 = call i32 @putstr(i32* @RET)
br label %if.end.8
if.end.8:
%t34 = load i32, i32* %t13
%t35 = mul i32 %t34, 17
%t36 = add i32 %t35, 23
%t37 = srem i32 %t36, 32
store i32 %t37, i32* %t13
%t38 = load i32, i32* %t13
%t39 = icmp eq i32 %t38, 0
%t40 = icmp ne i32 %t39, 0
br i1 %t40, label %if.then.9, label %if.end.10
if.then.9:
br label %while.end.6
if.end.10:
br label %while.cond.4
}

@ -0,0 +1,255 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @main() {
entry:
%t0 = alloca i32, i32 100
%t1 = getelementptr inbounds i32, i32* %t0, i32 0
store i32 0, i32* %t1
%t2 = getelementptr inbounds i32, i32* %t0, i32 1
store i32 0, i32* %t2
%t3 = getelementptr inbounds i32, i32* %t0, i32 2
store i32 0, i32* %t3
%t4 = getelementptr inbounds i32, i32* %t0, i32 3
store i32 0, i32* %t4
%t5 = getelementptr inbounds i32, i32* %t0, i32 4
store i32 0, i32* %t5
%t6 = getelementptr inbounds i32, i32* %t0, i32 5
store i32 0, i32* %t6
%t7 = getelementptr inbounds i32, i32* %t0, i32 6
store i32 0, i32* %t7
%t8 = getelementptr inbounds i32, i32* %t0, i32 7
store i32 0, i32* %t8
%t9 = getelementptr inbounds i32, i32* %t0, i32 8
store i32 0, i32* %t9
%t10 = getelementptr inbounds i32, i32* %t0, i32 9
store i32 0, i32* %t10
%t11 = getelementptr inbounds i32, i32* %t0, i32 10
store i32 0, i32* %t11
%t12 = getelementptr inbounds i32, i32* %t0, i32 11
store i32 0, i32* %t12
%t13 = getelementptr inbounds i32, i32* %t0, i32 12
store i32 0, i32* %t13
%t14 = getelementptr inbounds i32, i32* %t0, i32 13
store i32 0, i32* %t14
%t15 = getelementptr inbounds i32, i32* %t0, i32 14
store i32 0, i32* %t15
%t16 = getelementptr inbounds i32, i32* %t0, i32 15
store i32 0, i32* %t16
%t17 = getelementptr inbounds i32, i32* %t0, i32 16
store i32 0, i32* %t17
%t18 = getelementptr inbounds i32, i32* %t0, i32 17
store i32 0, i32* %t18
%t19 = getelementptr inbounds i32, i32* %t0, i32 18
store i32 0, i32* %t19
%t20 = getelementptr inbounds i32, i32* %t0, i32 19
store i32 0, i32* %t20
%t21 = getelementptr inbounds i32, i32* %t0, i32 20
store i32 0, i32* %t21
%t22 = getelementptr inbounds i32, i32* %t0, i32 21
store i32 0, i32* %t22
%t23 = getelementptr inbounds i32, i32* %t0, i32 22
store i32 0, i32* %t23
%t24 = getelementptr inbounds i32, i32* %t0, i32 23
store i32 0, i32* %t24
%t25 = getelementptr inbounds i32, i32* %t0, i32 24
store i32 0, i32* %t25
%t26 = getelementptr inbounds i32, i32* %t0, i32 25
store i32 0, i32* %t26
%t27 = getelementptr inbounds i32, i32* %t0, i32 26
store i32 0, i32* %t27
%t28 = getelementptr inbounds i32, i32* %t0, i32 27
store i32 0, i32* %t28
%t29 = getelementptr inbounds i32, i32* %t0, i32 28
store i32 0, i32* %t29
%t30 = getelementptr inbounds i32, i32* %t0, i32 29
store i32 0, i32* %t30
%t31 = getelementptr inbounds i32, i32* %t0, i32 30
store i32 0, i32* %t31
%t32 = getelementptr inbounds i32, i32* %t0, i32 31
store i32 0, i32* %t32
%t33 = getelementptr inbounds i32, i32* %t0, i32 32
store i32 0, i32* %t33
%t34 = getelementptr inbounds i32, i32* %t0, i32 33
store i32 0, i32* %t34
%t35 = getelementptr inbounds i32, i32* %t0, i32 34
store i32 0, i32* %t35
%t36 = getelementptr inbounds i32, i32* %t0, i32 35
store i32 0, i32* %t36
%t37 = getelementptr inbounds i32, i32* %t0, i32 36
store i32 0, i32* %t37
%t38 = getelementptr inbounds i32, i32* %t0, i32 37
store i32 0, i32* %t38
%t39 = getelementptr inbounds i32, i32* %t0, i32 38
store i32 0, i32* %t39
%t40 = getelementptr inbounds i32, i32* %t0, i32 39
store i32 0, i32* %t40
%t41 = getelementptr inbounds i32, i32* %t0, i32 40
store i32 0, i32* %t41
%t42 = getelementptr inbounds i32, i32* %t0, i32 41
store i32 0, i32* %t42
%t43 = getelementptr inbounds i32, i32* %t0, i32 42
store i32 0, i32* %t43
%t44 = getelementptr inbounds i32, i32* %t0, i32 43
store i32 0, i32* %t44
%t45 = getelementptr inbounds i32, i32* %t0, i32 44
store i32 0, i32* %t45
%t46 = getelementptr inbounds i32, i32* %t0, i32 45
store i32 0, i32* %t46
%t47 = getelementptr inbounds i32, i32* %t0, i32 46
store i32 0, i32* %t47
%t48 = getelementptr inbounds i32, i32* %t0, i32 47
store i32 0, i32* %t48
%t49 = getelementptr inbounds i32, i32* %t0, i32 48
store i32 0, i32* %t49
%t50 = getelementptr inbounds i32, i32* %t0, i32 49
store i32 0, i32* %t50
%t51 = getelementptr inbounds i32, i32* %t0, i32 50
store i32 0, i32* %t51
%t52 = getelementptr inbounds i32, i32* %t0, i32 51
store i32 0, i32* %t52
%t53 = getelementptr inbounds i32, i32* %t0, i32 52
store i32 0, i32* %t53
%t54 = getelementptr inbounds i32, i32* %t0, i32 53
store i32 0, i32* %t54
%t55 = getelementptr inbounds i32, i32* %t0, i32 54
store i32 0, i32* %t55
%t56 = getelementptr inbounds i32, i32* %t0, i32 55
store i32 0, i32* %t56
%t57 = getelementptr inbounds i32, i32* %t0, i32 56
store i32 0, i32* %t57
%t58 = getelementptr inbounds i32, i32* %t0, i32 57
store i32 0, i32* %t58
%t59 = getelementptr inbounds i32, i32* %t0, i32 58
store i32 0, i32* %t59
%t60 = getelementptr inbounds i32, i32* %t0, i32 59
store i32 0, i32* %t60
%t61 = getelementptr inbounds i32, i32* %t0, i32 60
store i32 0, i32* %t61
%t62 = getelementptr inbounds i32, i32* %t0, i32 61
store i32 0, i32* %t62
%t63 = getelementptr inbounds i32, i32* %t0, i32 62
store i32 0, i32* %t63
%t64 = getelementptr inbounds i32, i32* %t0, i32 63
store i32 0, i32* %t64
%t65 = getelementptr inbounds i32, i32* %t0, i32 64
store i32 0, i32* %t65
%t66 = getelementptr inbounds i32, i32* %t0, i32 65
store i32 0, i32* %t66
%t67 = getelementptr inbounds i32, i32* %t0, i32 66
store i32 0, i32* %t67
%t68 = getelementptr inbounds i32, i32* %t0, i32 67
store i32 0, i32* %t68
%t69 = getelementptr inbounds i32, i32* %t0, i32 68
store i32 0, i32* %t69
%t70 = getelementptr inbounds i32, i32* %t0, i32 69
store i32 0, i32* %t70
%t71 = getelementptr inbounds i32, i32* %t0, i32 70
store i32 0, i32* %t71
%t72 = getelementptr inbounds i32, i32* %t0, i32 71
store i32 0, i32* %t72
%t73 = getelementptr inbounds i32, i32* %t0, i32 72
store i32 0, i32* %t73
%t74 = getelementptr inbounds i32, i32* %t0, i32 73
store i32 0, i32* %t74
%t75 = getelementptr inbounds i32, i32* %t0, i32 74
store i32 0, i32* %t75
%t76 = getelementptr inbounds i32, i32* %t0, i32 75
store i32 0, i32* %t76
%t77 = getelementptr inbounds i32, i32* %t0, i32 76
store i32 0, i32* %t77
%t78 = getelementptr inbounds i32, i32* %t0, i32 77
store i32 0, i32* %t78
%t79 = getelementptr inbounds i32, i32* %t0, i32 78
store i32 0, i32* %t79
%t80 = getelementptr inbounds i32, i32* %t0, i32 79
store i32 0, i32* %t80
%t81 = getelementptr inbounds i32, i32* %t0, i32 80
store i32 0, i32* %t81
%t82 = getelementptr inbounds i32, i32* %t0, i32 81
store i32 0, i32* %t82
%t83 = getelementptr inbounds i32, i32* %t0, i32 82
store i32 0, i32* %t83
%t84 = getelementptr inbounds i32, i32* %t0, i32 83
store i32 0, i32* %t84
%t85 = getelementptr inbounds i32, i32* %t0, i32 84
store i32 0, i32* %t85
%t86 = getelementptr inbounds i32, i32* %t0, i32 85
store i32 0, i32* %t86
%t87 = getelementptr inbounds i32, i32* %t0, i32 86
store i32 0, i32* %t87
%t88 = getelementptr inbounds i32, i32* %t0, i32 87
store i32 0, i32* %t88
%t89 = getelementptr inbounds i32, i32* %t0, i32 88
store i32 0, i32* %t89
%t90 = getelementptr inbounds i32, i32* %t0, i32 89
store i32 0, i32* %t90
%t91 = getelementptr inbounds i32, i32* %t0, i32 90
store i32 0, i32* %t91
%t92 = getelementptr inbounds i32, i32* %t0, i32 91
store i32 0, i32* %t92
%t93 = getelementptr inbounds i32, i32* %t0, i32 92
store i32 0, i32* %t93
%t94 = getelementptr inbounds i32, i32* %t0, i32 93
store i32 0, i32* %t94
%t95 = getelementptr inbounds i32, i32* %t0, i32 94
store i32 0, i32* %t95
%t96 = getelementptr inbounds i32, i32* %t0, i32 95
store i32 0, i32* %t96
%t97 = getelementptr inbounds i32, i32* %t0, i32 96
store i32 0, i32* %t97
%t98 = getelementptr inbounds i32, i32* %t0, i32 97
store i32 0, i32* %t98
%t99 = getelementptr inbounds i32, i32* %t0, i32 98
store i32 0, i32* %t99
%t100 = getelementptr inbounds i32, i32* %t0, i32 99
store i32 0, i32* %t100
%t101 = alloca i32
store i32 0, i32* %t101
%t102 = alloca i32
store i32 0, i32* %t102
br label %while.cond.1
while.cond.1:
%t103 = call i32 @getint()
%t104 = icmp ne i32 %t103, 0
br i1 %t104, label %while.body.2, label %while.end.3
while.body.2:
%t105 = load i32, i32* %t101
%t106 = getelementptr inbounds i32, i32* %t0, i32 %t105
%t107 = call i32 @getint()
store i32 %t107, i32* %t106
%t108 = load i32, i32* %t101
%t109 = add i32 %t108, 1
store i32 %t109, i32* %t101
br label %while.cond.1
while.end.3:
br label %while.cond.4
while.cond.4:
%t110 = load i32, i32* %t101
%t111 = icmp ne i32 %t110, 0
br i1 %t111, label %while.body.5, label %while.end.6
while.body.5:
%t112 = load i32, i32* %t101
%t113 = sub i32 %t112, 1
store i32 %t113, i32* %t101
%t114 = load i32, i32* %t102
%t115 = load i32, i32* %t101
%t116 = getelementptr inbounds i32, i32* %t0, i32 %t115
%t117 = load i32, i32* %t116
%t118 = add i32 %t114, %t117
store i32 %t118, i32* %t102
br label %while.cond.4
while.end.6:
%t119 = load i32, i32* %t102
%t120 = srem i32 %t119, 79
ret i32 %t120
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -0,0 +1,856 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define void @sort(i32* %arg.arr, i32 %arg.len) {
entry:
%t0 = alloca i32
store i32 %arg.len, i32* %t0
%t1 = alloca i32
store i32 0, i32* %t1
br label %while.cond.1
while.cond.1:
%t2 = load i32, i32* %t1
%t3 = load i32, i32* %t0
%t4 = sub i32 %t3, 1
%t5 = icmp slt i32 %t2, %t4
%t6 = icmp ne i32 %t5, 0
br i1 %t6, label %while.body.2, label %while.end.3
while.body.2:
%t7 = alloca i32
%t8 = load i32, i32* %t1
%t9 = add i32 %t8, 1
store i32 %t9, i32* %t7
br label %while.cond.4
while.end.3:
ret void
while.cond.4:
%t10 = load i32, i32* %t7
%t11 = load i32, i32* %t0
%t12 = icmp slt i32 %t10, %t11
%t13 = icmp ne i32 %t12, 0
br i1 %t13, label %while.body.5, label %while.end.6
while.body.5:
%t14 = load i32, i32* %t1
%t15 = getelementptr inbounds i32, i32* %arg.arr, i32 %t14
%t16 = load i32, i32* %t15
%t17 = load i32, i32* %t7
%t18 = getelementptr inbounds i32, i32* %arg.arr, i32 %t17
%t19 = load i32, i32* %t18
%t20 = icmp slt i32 %t16, %t19
%t21 = icmp ne i32 %t20, 0
br i1 %t21, label %if.then.7, label %if.end.8
while.end.6:
%t36 = load i32, i32* %t1
%t37 = add i32 %t36, 1
store i32 %t37, i32* %t1
br label %while.cond.1
if.then.7:
%t22 = alloca i32
%t23 = load i32, i32* %t1
%t24 = getelementptr inbounds i32, i32* %arg.arr, i32 %t23
%t25 = load i32, i32* %t24
store i32 %t25, i32* %t22
%t26 = load i32, i32* %t1
%t27 = getelementptr inbounds i32, i32* %arg.arr, i32 %t26
%t28 = load i32, i32* %t7
%t29 = getelementptr inbounds i32, i32* %arg.arr, i32 %t28
%t30 = load i32, i32* %t29
store i32 %t30, i32* %t27
%t31 = load i32, i32* %t7
%t32 = getelementptr inbounds i32, i32* %arg.arr, i32 %t31
%t33 = load i32, i32* %t22
store i32 %t33, i32* %t32
br label %if.end.8
if.end.8:
%t34 = load i32, i32* %t7
%t35 = add i32 %t34, 1
store i32 %t35, i32* %t7
br label %while.cond.4
}
define i32 @param32_rec(i32 %arg.a1, i32 %arg.a2, i32 %arg.a3, i32 %arg.a4, i32 %arg.a5, i32 %arg.a6, i32 %arg.a7, i32 %arg.a8, i32 %arg.a9, i32 %arg.a10, i32 %arg.a11, i32 %arg.a12, i32 %arg.a13, i32 %arg.a14, i32 %arg.a15, i32 %arg.a16, i32 %arg.a17, i32 %arg.a18, i32 %arg.a19, i32 %arg.a20, i32 %arg.a21, i32 %arg.a22, i32 %arg.a23, i32 %arg.a24, i32 %arg.a25, i32 %arg.a26, i32 %arg.a27, i32 %arg.a28, i32 %arg.a29, i32 %arg.a30, i32 %arg.a31, i32 %arg.a32) {
entry:
%t38 = alloca i32
store i32 %arg.a1, i32* %t38
%t39 = alloca i32
store i32 %arg.a2, i32* %t39
%t40 = alloca i32
store i32 %arg.a3, i32* %t40
%t41 = alloca i32
store i32 %arg.a4, i32* %t41
%t42 = alloca i32
store i32 %arg.a5, i32* %t42
%t43 = alloca i32
store i32 %arg.a6, i32* %t43
%t44 = alloca i32
store i32 %arg.a7, i32* %t44
%t45 = alloca i32
store i32 %arg.a8, i32* %t45
%t46 = alloca i32
store i32 %arg.a9, i32* %t46
%t47 = alloca i32
store i32 %arg.a10, i32* %t47
%t48 = alloca i32
store i32 %arg.a11, i32* %t48
%t49 = alloca i32
store i32 %arg.a12, i32* %t49
%t50 = alloca i32
store i32 %arg.a13, i32* %t50
%t51 = alloca i32
store i32 %arg.a14, i32* %t51
%t52 = alloca i32
store i32 %arg.a15, i32* %t52
%t53 = alloca i32
store i32 %arg.a16, i32* %t53
%t54 = alloca i32
store i32 %arg.a17, i32* %t54
%t55 = alloca i32
store i32 %arg.a18, i32* %t55
%t56 = alloca i32
store i32 %arg.a19, i32* %t56
%t57 = alloca i32
store i32 %arg.a20, i32* %t57
%t58 = alloca i32
store i32 %arg.a21, i32* %t58
%t59 = alloca i32
store i32 %arg.a22, i32* %t59
%t60 = alloca i32
store i32 %arg.a23, i32* %t60
%t61 = alloca i32
store i32 %arg.a24, i32* %t61
%t62 = alloca i32
store i32 %arg.a25, i32* %t62
%t63 = alloca i32
store i32 %arg.a26, i32* %t63
%t64 = alloca i32
store i32 %arg.a27, i32* %t64
%t65 = alloca i32
store i32 %arg.a28, i32* %t65
%t66 = alloca i32
store i32 %arg.a29, i32* %t66
%t67 = alloca i32
store i32 %arg.a30, i32* %t67
%t68 = alloca i32
store i32 %arg.a31, i32* %t68
%t69 = alloca i32
store i32 %arg.a32, i32* %t69
%t70 = load i32, i32* %t38
%t71 = icmp eq i32 %t70, 0
%t72 = icmp ne i32 %t71, 0
br i1 %t72, label %if.then.9, label %if.else.11
if.then.9:
%t73 = load i32, i32* %t39
ret i32 %t73
if.end.10:
ret i32 0
if.else.11:
%t74 = load i32, i32* %t38
%t75 = sub i32 %t74, 1
%t76 = load i32, i32* %t39
%t77 = load i32, i32* %t40
%t78 = add i32 %t76, %t77
%t79 = srem i32 %t78, 998244353
%t80 = load i32, i32* %t41
%t81 = load i32, i32* %t42
%t82 = load i32, i32* %t43
%t83 = load i32, i32* %t44
%t84 = load i32, i32* %t45
%t85 = load i32, i32* %t46
%t86 = load i32, i32* %t47
%t87 = load i32, i32* %t48
%t88 = load i32, i32* %t49
%t89 = load i32, i32* %t50
%t90 = load i32, i32* %t51
%t91 = load i32, i32* %t52
%t92 = load i32, i32* %t53
%t93 = load i32, i32* %t54
%t94 = load i32, i32* %t55
%t95 = load i32, i32* %t56
%t96 = load i32, i32* %t57
%t97 = load i32, i32* %t58
%t98 = load i32, i32* %t59
%t99 = load i32, i32* %t60
%t100 = load i32, i32* %t61
%t101 = load i32, i32* %t62
%t102 = load i32, i32* %t63
%t103 = load i32, i32* %t64
%t104 = load i32, i32* %t65
%t105 = load i32, i32* %t66
%t106 = load i32, i32* %t67
%t107 = load i32, i32* %t68
%t108 = load i32, i32* %t69
%t109 = call i32 @param32_rec(i32 %t75, i32 %t79, i32 %t80, i32 %t81, i32 %t82, i32 %t83, i32 %t84, i32 %t85, i32 %t86, i32 %t87, i32 %t88, i32 %t89, i32 %t90, i32 %t91, i32 %t92, i32 %t93, i32 %t94, i32 %t95, i32 %t96, i32 %t97, i32 %t98, i32 %t99, i32 %t100, i32 %t101, i32 %t102, i32 %t103, i32 %t104, i32 %t105, i32 %t106, i32 %t107, i32 %t108, i32 0)
ret i32 %t109
}
define i32 @param32_arr(i32* %arg.a1, i32* %arg.a2, i32* %arg.a3, i32* %arg.a4, i32* %arg.a5, i32* %arg.a6, i32* %arg.a7, i32* %arg.a8, i32* %arg.a9, i32* %arg.a10, i32* %arg.a11, i32* %arg.a12, i32* %arg.a13, i32* %arg.a14, i32* %arg.a15, i32* %arg.a16, i32* %arg.a17, i32* %arg.a18, i32* %arg.a19, i32* %arg.a20, i32* %arg.a21, i32* %arg.a22, i32* %arg.a23, i32* %arg.a24, i32* %arg.a25, i32* %arg.a26, i32* %arg.a27, i32* %arg.a28, i32* %arg.a29, i32* %arg.a30, i32* %arg.a31, i32* %arg.a32) {
entry:
%t110 = alloca i32
%t111 = getelementptr inbounds i32, i32* %arg.a1, i32 0
%t112 = load i32, i32* %t111
%t113 = getelementptr inbounds i32, i32* %arg.a1, i32 1
%t114 = load i32, i32* %t113
%t115 = add i32 %t112, %t114
store i32 %t115, i32* %t110
%t116 = load i32, i32* %t110
%t117 = getelementptr inbounds i32, i32* %arg.a2, i32 0
%t118 = load i32, i32* %t117
%t119 = add i32 %t116, %t118
%t120 = getelementptr inbounds i32, i32* %arg.a2, i32 1
%t121 = load i32, i32* %t120
%t122 = add i32 %t119, %t121
store i32 %t122, i32* %t110
%t123 = load i32, i32* %t110
%t124 = getelementptr inbounds i32, i32* %arg.a3, i32 0
%t125 = load i32, i32* %t124
%t126 = add i32 %t123, %t125
%t127 = getelementptr inbounds i32, i32* %arg.a3, i32 1
%t128 = load i32, i32* %t127
%t129 = add i32 %t126, %t128
store i32 %t129, i32* %t110
%t130 = load i32, i32* %t110
%t131 = getelementptr inbounds i32, i32* %arg.a4, i32 0
%t132 = load i32, i32* %t131
%t133 = add i32 %t130, %t132
%t134 = getelementptr inbounds i32, i32* %arg.a4, i32 1
%t135 = load i32, i32* %t134
%t136 = add i32 %t133, %t135
store i32 %t136, i32* %t110
%t137 = load i32, i32* %t110
%t138 = getelementptr inbounds i32, i32* %arg.a5, i32 0
%t139 = load i32, i32* %t138
%t140 = add i32 %t137, %t139
%t141 = getelementptr inbounds i32, i32* %arg.a5, i32 1
%t142 = load i32, i32* %t141
%t143 = add i32 %t140, %t142
store i32 %t143, i32* %t110
%t144 = load i32, i32* %t110
%t145 = getelementptr inbounds i32, i32* %arg.a6, i32 0
%t146 = load i32, i32* %t145
%t147 = add i32 %t144, %t146
%t148 = getelementptr inbounds i32, i32* %arg.a6, i32 1
%t149 = load i32, i32* %t148
%t150 = add i32 %t147, %t149
store i32 %t150, i32* %t110
%t151 = load i32, i32* %t110
%t152 = getelementptr inbounds i32, i32* %arg.a7, i32 0
%t153 = load i32, i32* %t152
%t154 = add i32 %t151, %t153
%t155 = getelementptr inbounds i32, i32* %arg.a7, i32 1
%t156 = load i32, i32* %t155
%t157 = add i32 %t154, %t156
store i32 %t157, i32* %t110
%t158 = load i32, i32* %t110
%t159 = getelementptr inbounds i32, i32* %arg.a8, i32 0
%t160 = load i32, i32* %t159
%t161 = add i32 %t158, %t160
%t162 = getelementptr inbounds i32, i32* %arg.a8, i32 1
%t163 = load i32, i32* %t162
%t164 = add i32 %t161, %t163
store i32 %t164, i32* %t110
%t165 = load i32, i32* %t110
%t166 = getelementptr inbounds i32, i32* %arg.a9, i32 0
%t167 = load i32, i32* %t166
%t168 = add i32 %t165, %t167
%t169 = getelementptr inbounds i32, i32* %arg.a9, i32 1
%t170 = load i32, i32* %t169
%t171 = add i32 %t168, %t170
store i32 %t171, i32* %t110
%t172 = load i32, i32* %t110
%t173 = getelementptr inbounds i32, i32* %arg.a10, i32 0
%t174 = load i32, i32* %t173
%t175 = add i32 %t172, %t174
%t176 = getelementptr inbounds i32, i32* %arg.a10, i32 1
%t177 = load i32, i32* %t176
%t178 = add i32 %t175, %t177
store i32 %t178, i32* %t110
%t179 = load i32, i32* %t110
%t180 = getelementptr inbounds i32, i32* %arg.a11, i32 0
%t181 = load i32, i32* %t180
%t182 = add i32 %t179, %t181
%t183 = getelementptr inbounds i32, i32* %arg.a11, i32 1
%t184 = load i32, i32* %t183
%t185 = add i32 %t182, %t184
store i32 %t185, i32* %t110
%t186 = load i32, i32* %t110
%t187 = getelementptr inbounds i32, i32* %arg.a12, i32 0
%t188 = load i32, i32* %t187
%t189 = add i32 %t186, %t188
%t190 = getelementptr inbounds i32, i32* %arg.a12, i32 1
%t191 = load i32, i32* %t190
%t192 = add i32 %t189, %t191
store i32 %t192, i32* %t110
%t193 = load i32, i32* %t110
%t194 = getelementptr inbounds i32, i32* %arg.a13, i32 0
%t195 = load i32, i32* %t194
%t196 = add i32 %t193, %t195
%t197 = getelementptr inbounds i32, i32* %arg.a13, i32 1
%t198 = load i32, i32* %t197
%t199 = add i32 %t196, %t198
store i32 %t199, i32* %t110
%t200 = load i32, i32* %t110
%t201 = getelementptr inbounds i32, i32* %arg.a14, i32 0
%t202 = load i32, i32* %t201
%t203 = add i32 %t200, %t202
%t204 = getelementptr inbounds i32, i32* %arg.a14, i32 1
%t205 = load i32, i32* %t204
%t206 = add i32 %t203, %t205
store i32 %t206, i32* %t110
%t207 = load i32, i32* %t110
%t208 = getelementptr inbounds i32, i32* %arg.a15, i32 0
%t209 = load i32, i32* %t208
%t210 = add i32 %t207, %t209
%t211 = getelementptr inbounds i32, i32* %arg.a15, i32 1
%t212 = load i32, i32* %t211
%t213 = add i32 %t210, %t212
store i32 %t213, i32* %t110
%t214 = load i32, i32* %t110
%t215 = getelementptr inbounds i32, i32* %arg.a16, i32 0
%t216 = load i32, i32* %t215
%t217 = add i32 %t214, %t216
%t218 = getelementptr inbounds i32, i32* %arg.a16, i32 1
%t219 = load i32, i32* %t218
%t220 = add i32 %t217, %t219
store i32 %t220, i32* %t110
%t221 = load i32, i32* %t110
%t222 = getelementptr inbounds i32, i32* %arg.a17, i32 0
%t223 = load i32, i32* %t222
%t224 = add i32 %t221, %t223
%t225 = getelementptr inbounds i32, i32* %arg.a17, i32 1
%t226 = load i32, i32* %t225
%t227 = add i32 %t224, %t226
store i32 %t227, i32* %t110
%t228 = load i32, i32* %t110
%t229 = getelementptr inbounds i32, i32* %arg.a18, i32 0
%t230 = load i32, i32* %t229
%t231 = add i32 %t228, %t230
%t232 = getelementptr inbounds i32, i32* %arg.a18, i32 1
%t233 = load i32, i32* %t232
%t234 = add i32 %t231, %t233
store i32 %t234, i32* %t110
%t235 = load i32, i32* %t110
%t236 = getelementptr inbounds i32, i32* %arg.a19, i32 0
%t237 = load i32, i32* %t236
%t238 = add i32 %t235, %t237
%t239 = getelementptr inbounds i32, i32* %arg.a19, i32 1
%t240 = load i32, i32* %t239
%t241 = add i32 %t238, %t240
store i32 %t241, i32* %t110
%t242 = load i32, i32* %t110
%t243 = getelementptr inbounds i32, i32* %arg.a20, i32 0
%t244 = load i32, i32* %t243
%t245 = add i32 %t242, %t244
%t246 = getelementptr inbounds i32, i32* %arg.a20, i32 1
%t247 = load i32, i32* %t246
%t248 = add i32 %t245, %t247
store i32 %t248, i32* %t110
%t249 = load i32, i32* %t110
%t250 = getelementptr inbounds i32, i32* %arg.a21, i32 0
%t251 = load i32, i32* %t250
%t252 = add i32 %t249, %t251
%t253 = getelementptr inbounds i32, i32* %arg.a21, i32 1
%t254 = load i32, i32* %t253
%t255 = add i32 %t252, %t254
store i32 %t255, i32* %t110
%t256 = load i32, i32* %t110
%t257 = getelementptr inbounds i32, i32* %arg.a22, i32 0
%t258 = load i32, i32* %t257
%t259 = add i32 %t256, %t258
%t260 = getelementptr inbounds i32, i32* %arg.a22, i32 1
%t261 = load i32, i32* %t260
%t262 = add i32 %t259, %t261
store i32 %t262, i32* %t110
%t263 = load i32, i32* %t110
%t264 = getelementptr inbounds i32, i32* %arg.a23, i32 0
%t265 = load i32, i32* %t264
%t266 = add i32 %t263, %t265
%t267 = getelementptr inbounds i32, i32* %arg.a23, i32 1
%t268 = load i32, i32* %t267
%t269 = add i32 %t266, %t268
store i32 %t269, i32* %t110
%t270 = load i32, i32* %t110
%t271 = getelementptr inbounds i32, i32* %arg.a24, i32 0
%t272 = load i32, i32* %t271
%t273 = add i32 %t270, %t272
%t274 = getelementptr inbounds i32, i32* %arg.a24, i32 1
%t275 = load i32, i32* %t274
%t276 = add i32 %t273, %t275
store i32 %t276, i32* %t110
%t277 = load i32, i32* %t110
%t278 = getelementptr inbounds i32, i32* %arg.a25, i32 0
%t279 = load i32, i32* %t278
%t280 = add i32 %t277, %t279
%t281 = getelementptr inbounds i32, i32* %arg.a25, i32 1
%t282 = load i32, i32* %t281
%t283 = add i32 %t280, %t282
store i32 %t283, i32* %t110
%t284 = load i32, i32* %t110
%t285 = getelementptr inbounds i32, i32* %arg.a26, i32 0
%t286 = load i32, i32* %t285
%t287 = add i32 %t284, %t286
%t288 = getelementptr inbounds i32, i32* %arg.a26, i32 1
%t289 = load i32, i32* %t288
%t290 = add i32 %t287, %t289
store i32 %t290, i32* %t110
%t291 = load i32, i32* %t110
%t292 = getelementptr inbounds i32, i32* %arg.a27, i32 0
%t293 = load i32, i32* %t292
%t294 = add i32 %t291, %t293
%t295 = getelementptr inbounds i32, i32* %arg.a27, i32 1
%t296 = load i32, i32* %t295
%t297 = add i32 %t294, %t296
store i32 %t297, i32* %t110
%t298 = load i32, i32* %t110
%t299 = getelementptr inbounds i32, i32* %arg.a28, i32 0
%t300 = load i32, i32* %t299
%t301 = add i32 %t298, %t300
%t302 = getelementptr inbounds i32, i32* %arg.a28, i32 1
%t303 = load i32, i32* %t302
%t304 = add i32 %t301, %t303
store i32 %t304, i32* %t110
%t305 = load i32, i32* %t110
%t306 = getelementptr inbounds i32, i32* %arg.a29, i32 0
%t307 = load i32, i32* %t306
%t308 = add i32 %t305, %t307
%t309 = getelementptr inbounds i32, i32* %arg.a29, i32 1
%t310 = load i32, i32* %t309
%t311 = add i32 %t308, %t310
store i32 %t311, i32* %t110
%t312 = load i32, i32* %t110
%t313 = getelementptr inbounds i32, i32* %arg.a30, i32 0
%t314 = load i32, i32* %t313
%t315 = add i32 %t312, %t314
%t316 = getelementptr inbounds i32, i32* %arg.a30, i32 1
%t317 = load i32, i32* %t316
%t318 = add i32 %t315, %t317
store i32 %t318, i32* %t110
%t319 = load i32, i32* %t110
%t320 = getelementptr inbounds i32, i32* %arg.a31, i32 0
%t321 = load i32, i32* %t320
%t322 = add i32 %t319, %t321
%t323 = getelementptr inbounds i32, i32* %arg.a31, i32 1
%t324 = load i32, i32* %t323
%t325 = add i32 %t322, %t324
store i32 %t325, i32* %t110
%t326 = load i32, i32* %t110
%t327 = getelementptr inbounds i32, i32* %arg.a32, i32 0
%t328 = load i32, i32* %t327
%t329 = add i32 %t326, %t328
%t330 = getelementptr inbounds i32, i32* %arg.a32, i32 1
%t331 = load i32, i32* %t330
%t332 = add i32 %t329, %t331
store i32 %t332, i32* %t110
%t333 = load i32, i32* %t110
ret i32 %t333
}
define i32 @param16(i32 %arg.a1, i32 %arg.a2, i32 %arg.a3, i32 %arg.a4, i32 %arg.a5, i32 %arg.a6, i32 %arg.a7, i32 %arg.a8, i32 %arg.a9, i32 %arg.a10, i32 %arg.a11, i32 %arg.a12, i32 %arg.a13, i32 %arg.a14, i32 %arg.a15, i32 %arg.a16) {
entry:
%t334 = alloca i32
store i32 %arg.a1, i32* %t334
%t335 = alloca i32
store i32 %arg.a2, i32* %t335
%t336 = alloca i32
store i32 %arg.a3, i32* %t336
%t337 = alloca i32
store i32 %arg.a4, i32* %t337
%t338 = alloca i32
store i32 %arg.a5, i32* %t338
%t339 = alloca i32
store i32 %arg.a6, i32* %t339
%t340 = alloca i32
store i32 %arg.a7, i32* %t340
%t341 = alloca i32
store i32 %arg.a8, i32* %t341
%t342 = alloca i32
store i32 %arg.a9, i32* %t342
%t343 = alloca i32
store i32 %arg.a10, i32* %t343
%t344 = alloca i32
store i32 %arg.a11, i32* %t344
%t345 = alloca i32
store i32 %arg.a12, i32* %t345
%t346 = alloca i32
store i32 %arg.a13, i32* %t346
%t347 = alloca i32
store i32 %arg.a14, i32* %t347
%t348 = alloca i32
store i32 %arg.a15, i32* %t348
%t349 = alloca i32
store i32 %arg.a16, i32* %t349
%t350 = alloca i32, i32 16
%t351 = getelementptr inbounds i32, i32* %t350, i32 0
%t352 = load i32, i32* %t334
store i32 %t352, i32* %t351
%t353 = getelementptr inbounds i32, i32* %t350, i32 1
%t354 = load i32, i32* %t335
store i32 %t354, i32* %t353
%t355 = getelementptr inbounds i32, i32* %t350, i32 2
%t356 = load i32, i32* %t336
store i32 %t356, i32* %t355
%t357 = getelementptr inbounds i32, i32* %t350, i32 3
%t358 = load i32, i32* %t337
store i32 %t358, i32* %t357
%t359 = getelementptr inbounds i32, i32* %t350, i32 4
%t360 = load i32, i32* %t338
store i32 %t360, i32* %t359
%t361 = getelementptr inbounds i32, i32* %t350, i32 5
%t362 = load i32, i32* %t339
store i32 %t362, i32* %t361
%t363 = getelementptr inbounds i32, i32* %t350, i32 6
%t364 = load i32, i32* %t340
store i32 %t364, i32* %t363
%t365 = getelementptr inbounds i32, i32* %t350, i32 7
%t366 = load i32, i32* %t341
store i32 %t366, i32* %t365
%t367 = getelementptr inbounds i32, i32* %t350, i32 8
%t368 = load i32, i32* %t342
store i32 %t368, i32* %t367
%t369 = getelementptr inbounds i32, i32* %t350, i32 9
%t370 = load i32, i32* %t343
store i32 %t370, i32* %t369
%t371 = getelementptr inbounds i32, i32* %t350, i32 10
%t372 = load i32, i32* %t344
store i32 %t372, i32* %t371
%t373 = getelementptr inbounds i32, i32* %t350, i32 11
%t374 = load i32, i32* %t345
store i32 %t374, i32* %t373
%t375 = getelementptr inbounds i32, i32* %t350, i32 12
%t376 = load i32, i32* %t346
store i32 %t376, i32* %t375
%t377 = getelementptr inbounds i32, i32* %t350, i32 13
%t378 = load i32, i32* %t347
store i32 %t378, i32* %t377
%t379 = getelementptr inbounds i32, i32* %t350, i32 14
%t380 = load i32, i32* %t348
store i32 %t380, i32* %t379
%t381 = getelementptr inbounds i32, i32* %t350, i32 15
%t382 = load i32, i32* %t349
store i32 %t382, i32* %t381
call void @sort(i32* %t350, i32 16)
%t384 = getelementptr inbounds i32, i32* %t350, i32 0
%t385 = load i32, i32* %t384
%t386 = getelementptr inbounds i32, i32* %t350, i32 1
%t387 = load i32, i32* %t386
%t388 = getelementptr inbounds i32, i32* %t350, i32 2
%t389 = load i32, i32* %t388
%t390 = getelementptr inbounds i32, i32* %t350, i32 3
%t391 = load i32, i32* %t390
%t392 = getelementptr inbounds i32, i32* %t350, i32 4
%t393 = load i32, i32* %t392
%t394 = getelementptr inbounds i32, i32* %t350, i32 5
%t395 = load i32, i32* %t394
%t396 = getelementptr inbounds i32, i32* %t350, i32 6
%t397 = load i32, i32* %t396
%t398 = getelementptr inbounds i32, i32* %t350, i32 7
%t399 = load i32, i32* %t398
%t400 = getelementptr inbounds i32, i32* %t350, i32 8
%t401 = load i32, i32* %t400
%t402 = getelementptr inbounds i32, i32* %t350, i32 9
%t403 = load i32, i32* %t402
%t404 = getelementptr inbounds i32, i32* %t350, i32 10
%t405 = load i32, i32* %t404
%t406 = getelementptr inbounds i32, i32* %t350, i32 11
%t407 = load i32, i32* %t406
%t408 = getelementptr inbounds i32, i32* %t350, i32 12
%t409 = load i32, i32* %t408
%t410 = getelementptr inbounds i32, i32* %t350, i32 13
%t411 = load i32, i32* %t410
%t412 = getelementptr inbounds i32, i32* %t350, i32 14
%t413 = load i32, i32* %t412
%t414 = getelementptr inbounds i32, i32* %t350, i32 15
%t415 = load i32, i32* %t414
%t416 = load i32, i32* %t334
%t417 = load i32, i32* %t335
%t418 = load i32, i32* %t336
%t419 = load i32, i32* %t337
%t420 = load i32, i32* %t338
%t421 = load i32, i32* %t339
%t422 = load i32, i32* %t340
%t423 = load i32, i32* %t341
%t424 = load i32, i32* %t342
%t425 = load i32, i32* %t343
%t426 = load i32, i32* %t344
%t427 = load i32, i32* %t345
%t428 = load i32, i32* %t346
%t429 = load i32, i32* %t347
%t430 = load i32, i32* %t348
%t431 = load i32, i32* %t349
%t432 = call i32 @param32_rec(i32 %t385, i32 %t387, i32 %t389, i32 %t391, i32 %t393, i32 %t395, i32 %t397, i32 %t399, i32 %t401, i32 %t403, i32 %t405, i32 %t407, i32 %t409, i32 %t411, i32 %t413, i32 %t415, i32 %t416, i32 %t417, i32 %t418, i32 %t419, i32 %t420, i32 %t421, i32 %t422, i32 %t423, i32 %t424, i32 %t425, i32 %t426, i32 %t427, i32 %t428, i32 %t429, i32 %t430, i32 %t431)
ret i32 %t432
}
define i32 @main() {
entry:
%t433 = alloca i32
%t434 = call i32 @getint()
store i32 %t434, i32* %t433
%t435 = alloca i32
%t436 = call i32 @getint()
store i32 %t436, i32* %t435
%t437 = alloca i32
%t438 = call i32 @getint()
store i32 %t438, i32* %t437
%t439 = alloca i32
%t440 = call i32 @getint()
store i32 %t440, i32* %t439
%t441 = alloca i32
%t442 = call i32 @getint()
store i32 %t442, i32* %t441
%t443 = alloca i32
%t444 = call i32 @getint()
store i32 %t444, i32* %t443
%t445 = alloca i32
%t446 = call i32 @getint()
store i32 %t446, i32* %t445
%t447 = alloca i32
%t448 = call i32 @getint()
store i32 %t448, i32* %t447
%t449 = alloca i32
%t450 = call i32 @getint()
store i32 %t450, i32* %t449
%t451 = alloca i32
%t452 = call i32 @getint()
store i32 %t452, i32* %t451
%t453 = alloca i32
%t454 = call i32 @getint()
store i32 %t454, i32* %t453
%t455 = alloca i32
%t456 = call i32 @getint()
store i32 %t456, i32* %t455
%t457 = alloca i32
%t458 = call i32 @getint()
store i32 %t458, i32* %t457
%t459 = alloca i32
%t460 = call i32 @getint()
store i32 %t460, i32* %t459
%t461 = alloca i32
%t462 = call i32 @getint()
store i32 %t462, i32* %t461
%t463 = alloca i32
%t464 = call i32 @getint()
store i32 %t464, i32* %t463
%t465 = alloca i32, i32 64
%t466 = getelementptr inbounds i32, i32* %t465, i32 0
%t467 = load i32, i32* %t433
%t468 = load i32, i32* %t435
%t469 = load i32, i32* %t437
%t470 = load i32, i32* %t439
%t471 = load i32, i32* %t441
%t472 = load i32, i32* %t443
%t473 = load i32, i32* %t445
%t474 = load i32, i32* %t447
%t475 = load i32, i32* %t449
%t476 = load i32, i32* %t451
%t477 = load i32, i32* %t453
%t478 = load i32, i32* %t455
%t479 = load i32, i32* %t457
%t480 = load i32, i32* %t459
%t481 = load i32, i32* %t461
%t482 = load i32, i32* %t463
%t483 = call i32 @param16(i32 %t467, i32 %t468, i32 %t469, i32 %t470, i32 %t471, i32 %t472, i32 %t473, i32 %t474, i32 %t475, i32 %t476, i32 %t477, i32 %t478, i32 %t479, i32 %t480, i32 %t481, i32 %t482)
store i32 %t483, i32* %t466
%t484 = getelementptr inbounds i32, i32* %t465, i32 1
store i32 8848, i32* %t484
%t485 = getelementptr inbounds i32, i32* %t465, i32 2
store i32 0, i32* %t485
%t486 = getelementptr inbounds i32, i32* %t465, i32 3
store i32 0, i32* %t486
%t487 = getelementptr inbounds i32, i32* %t465, i32 4
store i32 0, i32* %t487
%t488 = getelementptr inbounds i32, i32* %t465, i32 5
store i32 0, i32* %t488
%t489 = getelementptr inbounds i32, i32* %t465, i32 6
store i32 0, i32* %t489
%t490 = getelementptr inbounds i32, i32* %t465, i32 7
store i32 0, i32* %t490
%t491 = getelementptr inbounds i32, i32* %t465, i32 8
store i32 0, i32* %t491
%t492 = getelementptr inbounds i32, i32* %t465, i32 9
store i32 0, i32* %t492
%t493 = getelementptr inbounds i32, i32* %t465, i32 10
store i32 0, i32* %t493
%t494 = getelementptr inbounds i32, i32* %t465, i32 11
store i32 0, i32* %t494
%t495 = getelementptr inbounds i32, i32* %t465, i32 12
store i32 0, i32* %t495
%t496 = getelementptr inbounds i32, i32* %t465, i32 13
store i32 0, i32* %t496
%t497 = getelementptr inbounds i32, i32* %t465, i32 14
store i32 0, i32* %t497
%t498 = getelementptr inbounds i32, i32* %t465, i32 15
store i32 0, i32* %t498
%t499 = getelementptr inbounds i32, i32* %t465, i32 16
store i32 0, i32* %t499
%t500 = getelementptr inbounds i32, i32* %t465, i32 17
store i32 0, i32* %t500
%t501 = getelementptr inbounds i32, i32* %t465, i32 18
store i32 0, i32* %t501
%t502 = getelementptr inbounds i32, i32* %t465, i32 19
store i32 0, i32* %t502
%t503 = getelementptr inbounds i32, i32* %t465, i32 20
store i32 0, i32* %t503
%t504 = getelementptr inbounds i32, i32* %t465, i32 21
store i32 0, i32* %t504
%t505 = getelementptr inbounds i32, i32* %t465, i32 22
store i32 0, i32* %t505
%t506 = getelementptr inbounds i32, i32* %t465, i32 23
store i32 0, i32* %t506
%t507 = getelementptr inbounds i32, i32* %t465, i32 24
store i32 0, i32* %t507
%t508 = getelementptr inbounds i32, i32* %t465, i32 25
store i32 0, i32* %t508
%t509 = getelementptr inbounds i32, i32* %t465, i32 26
store i32 0, i32* %t509
%t510 = getelementptr inbounds i32, i32* %t465, i32 27
store i32 0, i32* %t510
%t511 = getelementptr inbounds i32, i32* %t465, i32 28
store i32 0, i32* %t511
%t512 = getelementptr inbounds i32, i32* %t465, i32 29
store i32 0, i32* %t512
%t513 = getelementptr inbounds i32, i32* %t465, i32 30
store i32 0, i32* %t513
%t514 = getelementptr inbounds i32, i32* %t465, i32 31
store i32 0, i32* %t514
%t515 = getelementptr inbounds i32, i32* %t465, i32 32
store i32 0, i32* %t515
%t516 = getelementptr inbounds i32, i32* %t465, i32 33
store i32 0, i32* %t516
%t517 = getelementptr inbounds i32, i32* %t465, i32 34
store i32 0, i32* %t517
%t518 = getelementptr inbounds i32, i32* %t465, i32 35
store i32 0, i32* %t518
%t519 = getelementptr inbounds i32, i32* %t465, i32 36
store i32 0, i32* %t519
%t520 = getelementptr inbounds i32, i32* %t465, i32 37
store i32 0, i32* %t520
%t521 = getelementptr inbounds i32, i32* %t465, i32 38
store i32 0, i32* %t521
%t522 = getelementptr inbounds i32, i32* %t465, i32 39
store i32 0, i32* %t522
%t523 = getelementptr inbounds i32, i32* %t465, i32 40
store i32 0, i32* %t523
%t524 = getelementptr inbounds i32, i32* %t465, i32 41
store i32 0, i32* %t524
%t525 = getelementptr inbounds i32, i32* %t465, i32 42
store i32 0, i32* %t525
%t526 = getelementptr inbounds i32, i32* %t465, i32 43
store i32 0, i32* %t526
%t527 = getelementptr inbounds i32, i32* %t465, i32 44
store i32 0, i32* %t527
%t528 = getelementptr inbounds i32, i32* %t465, i32 45
store i32 0, i32* %t528
%t529 = getelementptr inbounds i32, i32* %t465, i32 46
store i32 0, i32* %t529
%t530 = getelementptr inbounds i32, i32* %t465, i32 47
store i32 0, i32* %t530
%t531 = getelementptr inbounds i32, i32* %t465, i32 48
store i32 0, i32* %t531
%t532 = getelementptr inbounds i32, i32* %t465, i32 49
store i32 0, i32* %t532
%t533 = getelementptr inbounds i32, i32* %t465, i32 50
store i32 0, i32* %t533
%t534 = getelementptr inbounds i32, i32* %t465, i32 51
store i32 0, i32* %t534
%t535 = getelementptr inbounds i32, i32* %t465, i32 52
store i32 0, i32* %t535
%t536 = getelementptr inbounds i32, i32* %t465, i32 53
store i32 0, i32* %t536
%t537 = getelementptr inbounds i32, i32* %t465, i32 54
store i32 0, i32* %t537
%t538 = getelementptr inbounds i32, i32* %t465, i32 55
store i32 0, i32* %t538
%t539 = getelementptr inbounds i32, i32* %t465, i32 56
store i32 0, i32* %t539
%t540 = getelementptr inbounds i32, i32* %t465, i32 57
store i32 0, i32* %t540
%t541 = getelementptr inbounds i32, i32* %t465, i32 58
store i32 0, i32* %t541
%t542 = getelementptr inbounds i32, i32* %t465, i32 59
store i32 0, i32* %t542
%t543 = getelementptr inbounds i32, i32* %t465, i32 60
store i32 0, i32* %t543
%t544 = getelementptr inbounds i32, i32* %t465, i32 61
store i32 0, i32* %t544
%t545 = getelementptr inbounds i32, i32* %t465, i32 62
store i32 0, i32* %t545
%t546 = getelementptr inbounds i32, i32* %t465, i32 63
store i32 0, i32* %t546
%t547 = alloca i32
store i32 1, i32* %t547
br label %while.cond.12
while.cond.12:
%t548 = load i32, i32* %t547
%t549 = icmp slt i32 %t548, 32
%t550 = icmp ne i32 %t549, 0
br i1 %t550, label %while.body.13, label %while.end.14
while.body.13:
%t551 = load i32, i32* %t547
%t552 = mul i32 %t551, 2
%t553 = getelementptr inbounds i32, i32* %t465, i32 %t552
%t554 = load i32, i32* %t547
%t555 = sub i32 %t554, 1
%t556 = mul i32 %t555, 2
%t557 = add i32 %t556, 1
%t558 = getelementptr inbounds i32, i32* %t465, i32 %t557
%t559 = load i32, i32* %t558
%t560 = sub i32 %t559, 1
store i32 %t560, i32* %t553
%t561 = load i32, i32* %t547
%t562 = mul i32 %t561, 2
%t563 = add i32 %t562, 1
%t564 = getelementptr inbounds i32, i32* %t465, i32 %t563
%t565 = load i32, i32* %t547
%t566 = sub i32 %t565, 1
%t567 = mul i32 %t566, 2
%t568 = getelementptr inbounds i32, i32* %t465, i32 %t567
%t569 = load i32, i32* %t568
%t570 = sub i32 %t569, 2
store i32 %t570, i32* %t564
%t571 = load i32, i32* %t547
%t572 = add i32 %t571, 1
store i32 %t572, i32* %t547
br label %while.cond.12
while.end.14:
%t573 = getelementptr inbounds i32, i32* %t465, i32 0
%t574 = getelementptr inbounds i32, i32* %t465, i32 2
%t575 = getelementptr inbounds i32, i32* %t465, i32 4
%t576 = getelementptr inbounds i32, i32* %t465, i32 6
%t577 = getelementptr inbounds i32, i32* %t465, i32 8
%t578 = getelementptr inbounds i32, i32* %t465, i32 10
%t579 = getelementptr inbounds i32, i32* %t465, i32 12
%t580 = getelementptr inbounds i32, i32* %t465, i32 14
%t581 = getelementptr inbounds i32, i32* %t465, i32 16
%t582 = getelementptr inbounds i32, i32* %t465, i32 18
%t583 = getelementptr inbounds i32, i32* %t465, i32 20
%t584 = getelementptr inbounds i32, i32* %t465, i32 22
%t585 = getelementptr inbounds i32, i32* %t465, i32 24
%t586 = getelementptr inbounds i32, i32* %t465, i32 26
%t587 = getelementptr inbounds i32, i32* %t465, i32 28
%t588 = getelementptr inbounds i32, i32* %t465, i32 30
%t589 = getelementptr inbounds i32, i32* %t465, i32 32
%t590 = getelementptr inbounds i32, i32* %t465, i32 34
%t591 = getelementptr inbounds i32, i32* %t465, i32 36
%t592 = getelementptr inbounds i32, i32* %t465, i32 38
%t593 = getelementptr inbounds i32, i32* %t465, i32 40
%t594 = getelementptr inbounds i32, i32* %t465, i32 42
%t595 = getelementptr inbounds i32, i32* %t465, i32 44
%t596 = getelementptr inbounds i32, i32* %t465, i32 46
%t597 = getelementptr inbounds i32, i32* %t465, i32 48
%t598 = getelementptr inbounds i32, i32* %t465, i32 50
%t599 = getelementptr inbounds i32, i32* %t465, i32 52
%t600 = getelementptr inbounds i32, i32* %t465, i32 54
%t601 = getelementptr inbounds i32, i32* %t465, i32 56
%t602 = getelementptr inbounds i32, i32* %t465, i32 58
%t603 = getelementptr inbounds i32, i32* %t465, i32 60
%t604 = getelementptr inbounds i32, i32* %t465, i32 62
%t605 = call i32 @param32_arr(i32* %t573, i32* %t574, i32* %t575, i32* %t576, i32* %t577, i32* %t578, i32* %t579, i32* %t580, i32* %t581, i32* %t582, i32* %t583, i32* %t584, i32* %t585, i32* %t586, i32* %t587, i32* %t588, i32* %t589, i32* %t590, i32* %t591, i32* %t592, i32* %t593, i32* %t594, i32* %t595, i32* %t596, i32* %t597, i32* %t598, i32* %t599, i32* %t600, i32* %t601, i32* %t602, i32* %t603, i32* %t604)
call void @putint(i32 %t605)
call void @putch(i32 10)
ret i32 0
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,398 @@
@a0 = global i32 0
@a1 = global i32 0
@a2 = global i32 0
@a3 = global i32 0
@a4 = global i32 0
@a5 = global i32 0
@a6 = global i32 0
@a7 = global i32 0
@a8 = global i32 0
@a9 = global i32 0
@a10 = global i32 0
@a11 = global i32 0
@a12 = global i32 0
@a13 = global i32 0
@a14 = global i32 0
@a15 = global i32 0
@a16 = global i32 0
@a17 = global i32 0
@a18 = global i32 0
@a19 = global i32 0
@a20 = global i32 0
@a21 = global i32 0
@a22 = global i32 0
@a23 = global i32 0
@a24 = global i32 0
@a25 = global i32 0
@a26 = global i32 0
@a27 = global i32 0
@a28 = global i32 0
@a29 = global i32 0
@a30 = global i32 0
@a31 = global i32 0
@a32 = global i32 0
@a33 = global i32 0
@a34 = global i32 0
@a35 = global i32 0
@a36 = global i32 0
@a37 = global i32 0
@a38 = global i32 0
@a39 = global i32 0
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @testParam8(i32 %arg.a0, i32 %arg.a1, i32 %arg.a2, i32 %arg.a3, i32 %arg.a4, i32 %arg.a5, i32 %arg.a6, i32 %arg.a7) {
entry:
%t0 = alloca i32
store i32 %arg.a0, i32* %t0
%t1 = alloca i32
store i32 %arg.a1, i32* %t1
%t2 = alloca i32
store i32 %arg.a2, i32* %t2
%t3 = alloca i32
store i32 %arg.a3, i32* %t3
%t4 = alloca i32
store i32 %arg.a4, i32* %t4
%t5 = alloca i32
store i32 %arg.a5, i32* %t5
%t6 = alloca i32
store i32 %arg.a6, i32* %t6
%t7 = alloca i32
store i32 %arg.a7, i32* %t7
%t8 = load i32, i32* %t0
%t9 = load i32, i32* %t1
%t10 = add i32 %t8, %t9
%t11 = load i32, i32* %t2
%t12 = add i32 %t10, %t11
%t13 = load i32, i32* %t3
%t14 = add i32 %t12, %t13
%t15 = load i32, i32* %t4
%t16 = add i32 %t14, %t15
%t17 = load i32, i32* %t5
%t18 = add i32 %t16, %t17
%t19 = load i32, i32* %t6
%t20 = add i32 %t18, %t19
%t21 = load i32, i32* %t7
%t22 = add i32 %t20, %t21
ret i32 %t22
}
define i32 @testParam16(i32 %arg.a0, i32 %arg.a1, i32 %arg.a2, i32 %arg.a3, i32 %arg.a4, i32 %arg.a5, i32 %arg.a6, i32 %arg.a7, i32 %arg.a8, i32 %arg.a9, i32 %arg.a10, i32 %arg.a11, i32 %arg.a12, i32 %arg.a13, i32 %arg.a14, i32 %arg.a15) {
entry:
%t23 = alloca i32
store i32 %arg.a0, i32* %t23
%t24 = alloca i32
store i32 %arg.a1, i32* %t24
%t25 = alloca i32
store i32 %arg.a2, i32* %t25
%t26 = alloca i32
store i32 %arg.a3, i32* %t26
%t27 = alloca i32
store i32 %arg.a4, i32* %t27
%t28 = alloca i32
store i32 %arg.a5, i32* %t28
%t29 = alloca i32
store i32 %arg.a6, i32* %t29
%t30 = alloca i32
store i32 %arg.a7, i32* %t30
%t31 = alloca i32
store i32 %arg.a8, i32* %t31
%t32 = alloca i32
store i32 %arg.a9, i32* %t32
%t33 = alloca i32
store i32 %arg.a10, i32* %t33
%t34 = alloca i32
store i32 %arg.a11, i32* %t34
%t35 = alloca i32
store i32 %arg.a12, i32* %t35
%t36 = alloca i32
store i32 %arg.a13, i32* %t36
%t37 = alloca i32
store i32 %arg.a14, i32* %t37
%t38 = alloca i32
store i32 %arg.a15, i32* %t38
%t39 = load i32, i32* %t23
%t40 = load i32, i32* %t24
%t41 = add i32 %t39, %t40
%t42 = load i32, i32* %t25
%t43 = add i32 %t41, %t42
%t44 = load i32, i32* %t26
%t45 = sub i32 %t43, %t44
%t46 = load i32, i32* %t27
%t47 = sub i32 %t45, %t46
%t48 = load i32, i32* %t28
%t49 = sub i32 %t47, %t48
%t50 = load i32, i32* %t29
%t51 = sub i32 %t49, %t50
%t52 = load i32, i32* %t30
%t53 = sub i32 %t51, %t52
%t54 = load i32, i32* %t31
%t55 = add i32 %t53, %t54
%t56 = load i32, i32* %t32
%t57 = add i32 %t55, %t56
%t58 = load i32, i32* %t33
%t59 = add i32 %t57, %t58
%t60 = load i32, i32* %t34
%t61 = add i32 %t59, %t60
%t62 = load i32, i32* %t35
%t63 = add i32 %t61, %t62
%t64 = load i32, i32* %t36
%t65 = add i32 %t63, %t64
%t66 = load i32, i32* %t37
%t67 = add i32 %t65, %t66
%t68 = load i32, i32* %t38
%t69 = add i32 %t67, %t68
ret i32 %t69
}
define i32 @testParam32(i32 %arg.a0, i32 %arg.a1, i32 %arg.a2, i32 %arg.a3, i32 %arg.a4, i32 %arg.a5, i32 %arg.a6, i32 %arg.a7, i32 %arg.a8, i32 %arg.a9, i32 %arg.a10, i32 %arg.a11, i32 %arg.a12, i32 %arg.a13, i32 %arg.a14, i32 %arg.a15, i32 %arg.a16, i32 %arg.a17, i32 %arg.a18, i32 %arg.a19, i32 %arg.a20, i32 %arg.a21, i32 %arg.a22, i32 %arg.a23, i32 %arg.a24, i32 %arg.a25, i32 %arg.a26, i32 %arg.a27, i32 %arg.a28, i32 %arg.a29, i32 %arg.a30, i32 %arg.a31) {
entry:
%t70 = alloca i32
store i32 %arg.a0, i32* %t70
%t71 = alloca i32
store i32 %arg.a1, i32* %t71
%t72 = alloca i32
store i32 %arg.a2, i32* %t72
%t73 = alloca i32
store i32 %arg.a3, i32* %t73
%t74 = alloca i32
store i32 %arg.a4, i32* %t74
%t75 = alloca i32
store i32 %arg.a5, i32* %t75
%t76 = alloca i32
store i32 %arg.a6, i32* %t76
%t77 = alloca i32
store i32 %arg.a7, i32* %t77
%t78 = alloca i32
store i32 %arg.a8, i32* %t78
%t79 = alloca i32
store i32 %arg.a9, i32* %t79
%t80 = alloca i32
store i32 %arg.a10, i32* %t80
%t81 = alloca i32
store i32 %arg.a11, i32* %t81
%t82 = alloca i32
store i32 %arg.a12, i32* %t82
%t83 = alloca i32
store i32 %arg.a13, i32* %t83
%t84 = alloca i32
store i32 %arg.a14, i32* %t84
%t85 = alloca i32
store i32 %arg.a15, i32* %t85
%t86 = alloca i32
store i32 %arg.a16, i32* %t86
%t87 = alloca i32
store i32 %arg.a17, i32* %t87
%t88 = alloca i32
store i32 %arg.a18, i32* %t88
%t89 = alloca i32
store i32 %arg.a19, i32* %t89
%t90 = alloca i32
store i32 %arg.a20, i32* %t90
%t91 = alloca i32
store i32 %arg.a21, i32* %t91
%t92 = alloca i32
store i32 %arg.a22, i32* %t92
%t93 = alloca i32
store i32 %arg.a23, i32* %t93
%t94 = alloca i32
store i32 %arg.a24, i32* %t94
%t95 = alloca i32
store i32 %arg.a25, i32* %t95
%t96 = alloca i32
store i32 %arg.a26, i32* %t96
%t97 = alloca i32
store i32 %arg.a27, i32* %t97
%t98 = alloca i32
store i32 %arg.a28, i32* %t98
%t99 = alloca i32
store i32 %arg.a29, i32* %t99
%t100 = alloca i32
store i32 %arg.a30, i32* %t100
%t101 = alloca i32
store i32 %arg.a31, i32* %t101
%t102 = load i32, i32* %t70
%t103 = load i32, i32* %t71
%t104 = add i32 %t102, %t103
%t105 = load i32, i32* %t72
%t106 = add i32 %t104, %t105
%t107 = load i32, i32* %t73
%t108 = add i32 %t106, %t107
%t109 = load i32, i32* %t74
%t110 = add i32 %t108, %t109
%t111 = load i32, i32* %t75
%t112 = add i32 %t110, %t111
%t113 = load i32, i32* %t76
%t114 = add i32 %t112, %t113
%t115 = load i32, i32* %t77
%t116 = add i32 %t114, %t115
%t117 = load i32, i32* %t78
%t118 = add i32 %t116, %t117
%t119 = load i32, i32* %t79
%t120 = add i32 %t118, %t119
%t121 = load i32, i32* %t80
%t122 = add i32 %t120, %t121
%t123 = load i32, i32* %t81
%t124 = add i32 %t122, %t123
%t125 = load i32, i32* %t82
%t126 = add i32 %t124, %t125
%t127 = load i32, i32* %t83
%t128 = add i32 %t126, %t127
%t129 = load i32, i32* %t84
%t130 = add i32 %t128, %t129
%t131 = load i32, i32* %t85
%t132 = add i32 %t130, %t131
%t133 = load i32, i32* %t86
%t134 = add i32 %t132, %t133
%t135 = load i32, i32* %t87
%t136 = add i32 %t134, %t135
%t137 = load i32, i32* %t88
%t138 = sub i32 %t136, %t137
%t139 = load i32, i32* %t89
%t140 = sub i32 %t138, %t139
%t141 = load i32, i32* %t90
%t142 = sub i32 %t140, %t141
%t143 = load i32, i32* %t91
%t144 = sub i32 %t142, %t143
%t145 = load i32, i32* %t92
%t146 = sub i32 %t144, %t145
%t147 = load i32, i32* %t93
%t148 = add i32 %t146, %t147
%t149 = load i32, i32* %t94
%t150 = add i32 %t148, %t149
%t151 = load i32, i32* %t95
%t152 = add i32 %t150, %t151
%t153 = load i32, i32* %t96
%t154 = add i32 %t152, %t153
%t155 = load i32, i32* %t97
%t156 = add i32 %t154, %t155
%t157 = load i32, i32* %t98
%t158 = add i32 %t156, %t157
%t159 = load i32, i32* %t99
%t160 = add i32 %t158, %t159
%t161 = load i32, i32* %t100
%t162 = add i32 %t160, %t161
%t163 = load i32, i32* %t101
%t164 = add i32 %t162, %t163
ret i32 %t164
}
define i32 @main() {
entry:
store i32 0, i32* @a0
store i32 1, i32* @a1
store i32 2, i32* @a2
store i32 3, i32* @a3
store i32 4, i32* @a4
store i32 5, i32* @a5
store i32 6, i32* @a6
store i32 7, i32* @a7
store i32 8, i32* @a8
store i32 9, i32* @a9
store i32 0, i32* @a10
store i32 1, i32* @a11
store i32 2, i32* @a12
store i32 3, i32* @a13
store i32 4, i32* @a14
store i32 5, i32* @a15
store i32 6, i32* @a16
store i32 7, i32* @a17
store i32 8, i32* @a18
store i32 9, i32* @a19
store i32 0, i32* @a20
store i32 1, i32* @a21
store i32 2, i32* @a22
store i32 3, i32* @a23
store i32 4, i32* @a24
store i32 5, i32* @a25
store i32 6, i32* @a26
store i32 7, i32* @a27
store i32 8, i32* @a28
store i32 9, i32* @a29
store i32 0, i32* @a30
store i32 1, i32* @a31
store i32 4, i32* @a32
store i32 5, i32* @a33
store i32 6, i32* @a34
store i32 7, i32* @a35
store i32 8, i32* @a36
store i32 9, i32* @a37
store i32 0, i32* @a38
store i32 1, i32* @a39
%t165 = load i32, i32* @a0
%t166 = load i32, i32* @a1
%t167 = load i32, i32* @a2
%t168 = load i32, i32* @a3
%t169 = load i32, i32* @a4
%t170 = load i32, i32* @a5
%t171 = load i32, i32* @a6
%t172 = load i32, i32* @a7
%t173 = call i32 @testParam8(i32 %t165, i32 %t166, i32 %t167, i32 %t168, i32 %t169, i32 %t170, i32 %t171, i32 %t172)
store i32 %t173, i32* @a0
%t174 = load i32, i32* @a0
call void @putint(i32 %t174)
%t176 = load i32, i32* @a32
%t177 = load i32, i32* @a33
%t178 = load i32, i32* @a34
%t179 = load i32, i32* @a35
%t180 = load i32, i32* @a36
%t181 = load i32, i32* @a37
%t182 = load i32, i32* @a38
%t183 = load i32, i32* @a39
%t184 = load i32, i32* @a8
%t185 = load i32, i32* @a9
%t186 = load i32, i32* @a10
%t187 = load i32, i32* @a11
%t188 = load i32, i32* @a12
%t189 = load i32, i32* @a13
%t190 = load i32, i32* @a14
%t191 = load i32, i32* @a15
%t192 = call i32 @testParam16(i32 %t176, i32 %t177, i32 %t178, i32 %t179, i32 %t180, i32 %t181, i32 %t182, i32 %t183, i32 %t184, i32 %t185, i32 %t186, i32 %t187, i32 %t188, i32 %t189, i32 %t190, i32 %t191)
store i32 %t192, i32* @a0
%t193 = load i32, i32* @a0
call void @putint(i32 %t193)
%t195 = load i32, i32* @a0
%t196 = load i32, i32* @a1
%t197 = load i32, i32* @a2
%t198 = load i32, i32* @a3
%t199 = load i32, i32* @a4
%t200 = load i32, i32* @a5
%t201 = load i32, i32* @a6
%t202 = load i32, i32* @a7
%t203 = load i32, i32* @a8
%t204 = load i32, i32* @a9
%t205 = load i32, i32* @a10
%t206 = load i32, i32* @a11
%t207 = load i32, i32* @a12
%t208 = load i32, i32* @a13
%t209 = load i32, i32* @a14
%t210 = load i32, i32* @a15
%t211 = load i32, i32* @a16
%t212 = load i32, i32* @a17
%t213 = load i32, i32* @a18
%t214 = load i32, i32* @a19
%t215 = load i32, i32* @a20
%t216 = load i32, i32* @a21
%t217 = load i32, i32* @a22
%t218 = load i32, i32* @a23
%t219 = load i32, i32* @a24
%t220 = load i32, i32* @a25
%t221 = load i32, i32* @a26
%t222 = load i32, i32* @a27
%t223 = load i32, i32* @a28
%t224 = load i32, i32* @a29
%t225 = load i32, i32* @a30
%t226 = load i32, i32* @a31
%t227 = call i32 @testParam32(i32 %t195, i32 %t196, i32 %t197, i32 %t198, i32 %t199, i32 %t200, i32 %t201, i32 %t202, i32 %t203, i32 %t204, i32 %t205, i32 %t206, i32 %t207, i32 %t208, i32 %t209, i32 %t210, i32 %t211, i32 %t212, i32 %t213, i32 %t214, i32 %t215, i32 %t216, i32 %t217, i32 %t218, i32 %t219, i32 %t220, i32 %t221, i32 %t222, i32 %t223, i32 %t224, i32 %t225, i32 %t226)
store i32 %t227, i32* @a0
%t228 = load i32, i32* @a0
call void @putint(i32 %t228)
ret i32 0
}

@ -0,0 +1,259 @@
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @foo() {
entry:
%t0 = alloca i32, i32 16
%t1 = getelementptr inbounds i32, i32* %t0, i32 0
store i32 0, i32* %t1
%t2 = getelementptr inbounds i32, i32* %t0, i32 1
store i32 1, i32* %t2
%t3 = getelementptr inbounds i32, i32* %t0, i32 2
store i32 2, i32* %t3
%t4 = getelementptr inbounds i32, i32* %t0, i32 3
store i32 3, i32* %t4
%t5 = getelementptr inbounds i32, i32* %t0, i32 4
store i32 0, i32* %t5
%t6 = getelementptr inbounds i32, i32* %t0, i32 5
store i32 1, i32* %t6
%t7 = getelementptr inbounds i32, i32* %t0, i32 6
store i32 2, i32* %t7
%t8 = getelementptr inbounds i32, i32* %t0, i32 7
store i32 3, i32* %t8
%t9 = getelementptr inbounds i32, i32* %t0, i32 8
store i32 0, i32* %t9
%t10 = getelementptr inbounds i32, i32* %t0, i32 9
store i32 1, i32* %t10
%t11 = getelementptr inbounds i32, i32* %t0, i32 10
store i32 2, i32* %t11
%t12 = getelementptr inbounds i32, i32* %t0, i32 11
store i32 3, i32* %t12
%t13 = getelementptr inbounds i32, i32* %t0, i32 12
store i32 0, i32* %t13
%t14 = getelementptr inbounds i32, i32* %t0, i32 13
store i32 1, i32* %t14
%t15 = getelementptr inbounds i32, i32* %t0, i32 14
store i32 2, i32* %t15
%t16 = getelementptr inbounds i32, i32* %t0, i32 15
store i32 3, i32* %t16
%t17 = alloca i32
store i32 3, i32* %t17
%t18 = alloca i32
store i32 7, i32* %t18
%t19 = alloca i32
store i32 5, i32* %t19
%t20 = alloca i32
store i32 6, i32* %t20
%t21 = alloca i32
store i32 1, i32* %t21
%t22 = alloca i32
store i32 0, i32* %t22
%t23 = alloca i32
store i32 3, i32* %t23
%t24 = alloca i32
store i32 5, i32* %t24
%t25 = alloca i32
store i32 4, i32* %t25
%t26 = alloca i32
store i32 2, i32* %t26
%t27 = alloca i32
store i32 7, i32* %t27
%t28 = alloca i32
store i32 9, i32* %t28
%t29 = alloca i32
store i32 8, i32* %t29
%t30 = alloca i32
store i32 1, i32* %t30
%t31 = alloca i32
store i32 4, i32* %t31
%t32 = alloca i32
store i32 6, i32* %t32
%t33 = alloca i32
%t34 = load i32, i32* %t17
%t35 = load i32, i32* %t18
%t36 = add i32 %t34, %t35
%t37 = load i32, i32* %t19
%t38 = add i32 %t36, %t37
%t39 = load i32, i32* %t20
%t40 = add i32 %t38, %t39
%t41 = load i32, i32* %t21
%t42 = add i32 %t40, %t41
%t43 = load i32, i32* %t22
%t44 = add i32 %t42, %t43
%t45 = load i32, i32* %t23
%t46 = add i32 %t44, %t45
%t47 = load i32, i32* %t24
%t48 = add i32 %t46, %t47
store i32 %t48, i32* %t33
%t49 = alloca i32
%t50 = load i32, i32* %t25
%t51 = load i32, i32* %t26
%t52 = add i32 %t50, %t51
%t53 = load i32, i32* %t27
%t54 = add i32 %t52, %t53
%t55 = load i32, i32* %t28
%t56 = add i32 %t54, %t55
%t57 = load i32, i32* %t29
%t58 = add i32 %t56, %t57
%t59 = load i32, i32* %t30
%t60 = add i32 %t58, %t59
%t61 = load i32, i32* %t31
%t62 = add i32 %t60, %t61
%t63 = load i32, i32* %t32
%t64 = add i32 %t62, %t63
store i32 %t64, i32* %t49
%t65 = load i32, i32* %t33
%t66 = load i32, i32* %t49
%t67 = add i32 %t65, %t66
%t68 = load i32, i32* %t17
%t69 = getelementptr inbounds i32, i32* %t0, i32 %t68
%t70 = load i32, i32* %t69
%t71 = add i32 %t67, %t70
ret i32 %t71
}
define i32 @main() {
entry:
%t72 = alloca i32
store i32 3, i32* %t72
%t73 = alloca i32
store i32 7, i32* %t73
%t74 = alloca i32
store i32 5, i32* %t74
%t75 = alloca i32
store i32 6, i32* %t75
%t76 = alloca i32
store i32 1, i32* %t76
%t77 = alloca i32
store i32 0, i32* %t77
%t78 = alloca i32
store i32 3, i32* %t78
%t79 = alloca i32
store i32 5, i32* %t79
%t80 = alloca i32
store i32 4, i32* %t80
%t81 = alloca i32
store i32 2, i32* %t81
%t82 = alloca i32
store i32 7, i32* %t82
%t83 = alloca i32
store i32 9, i32* %t83
%t84 = alloca i32
store i32 8, i32* %t84
%t85 = alloca i32
store i32 1, i32* %t85
%t86 = alloca i32
store i32 4, i32* %t86
%t87 = alloca i32
store i32 6, i32* %t87
%t88 = alloca i32
%t89 = load i32, i32* %t72
%t90 = load i32, i32* %t73
%t91 = add i32 %t89, %t90
%t92 = load i32, i32* %t74
%t93 = add i32 %t91, %t92
%t94 = load i32, i32* %t75
%t95 = add i32 %t93, %t94
%t96 = load i32, i32* %t76
%t97 = add i32 %t95, %t96
%t98 = load i32, i32* %t77
%t99 = add i32 %t97, %t98
%t100 = load i32, i32* %t78
%t101 = add i32 %t99, %t100
%t102 = load i32, i32* %t79
%t103 = add i32 %t101, %t102
store i32 %t103, i32* %t88
%t104 = alloca i32
%t105 = load i32, i32* %t80
%t106 = load i32, i32* %t81
%t107 = add i32 %t105, %t106
%t108 = load i32, i32* %t82
%t109 = add i32 %t107, %t108
%t110 = load i32, i32* %t83
%t111 = add i32 %t109, %t110
%t112 = load i32, i32* %t84
%t113 = add i32 %t111, %t112
%t114 = load i32, i32* %t85
%t115 = add i32 %t113, %t114
%t116 = load i32, i32* %t86
%t117 = add i32 %t115, %t116
%t118 = load i32, i32* %t87
%t119 = add i32 %t117, %t118
store i32 %t119, i32* %t104
%t120 = load i32, i32* %t88
%t121 = call i32 @foo()
%t122 = add i32 %t120, %t121
store i32 %t122, i32* %t88
%t123 = alloca i32
store i32 4, i32* %t123
%t124 = alloca i32
store i32 7, i32* %t124
%t125 = alloca i32
store i32 2, i32* %t125
%t126 = alloca i32
store i32 5, i32* %t126
%t127 = alloca i32
store i32 8, i32* %t127
%t128 = alloca i32
store i32 0, i32* %t128
%t129 = alloca i32
store i32 6, i32* %t129
%t130 = alloca i32
store i32 3, i32* %t130
%t131 = load i32, i32* %t104
%t132 = call i32 @foo()
%t133 = add i32 %t131, %t132
store i32 %t133, i32* %t104
%t134 = load i32, i32* %t80
store i32 %t134, i32* %t72
%t135 = load i32, i32* %t81
store i32 %t135, i32* %t73
%t136 = load i32, i32* %t82
store i32 %t136, i32* %t74
%t137 = load i32, i32* %t83
store i32 %t137, i32* %t75
%t138 = load i32, i32* %t84
store i32 %t138, i32* %t76
%t139 = load i32, i32* %t85
store i32 %t139, i32* %t77
%t140 = load i32, i32* %t86
store i32 %t140, i32* %t78
%t141 = load i32, i32* %t87
store i32 %t141, i32* %t79
%t142 = alloca i32
%t143 = load i32, i32* %t123
%t144 = load i32, i32* %t124
%t145 = add i32 %t143, %t144
%t146 = load i32, i32* %t125
%t147 = add i32 %t145, %t146
%t148 = load i32, i32* %t126
%t149 = add i32 %t147, %t148
%t150 = load i32, i32* %t127
%t151 = add i32 %t149, %t150
%t152 = load i32, i32* %t128
%t153 = add i32 %t151, %t152
%t154 = load i32, i32* %t129
%t155 = add i32 %t153, %t154
%t156 = load i32, i32* %t130
%t157 = add i32 %t155, %t156
store i32 %t157, i32* %t142
%t158 = alloca i32
%t159 = load i32, i32* %t88
%t160 = load i32, i32* %t104
%t161 = add i32 %t159, %t160
%t162 = load i32, i32* %t142
%t163 = add i32 %t161, %t162
store i32 %t163, i32* %t158
%t164 = load i32, i32* %t158
call void @putint(i32 %t164)
call void @putch(i32 10)
ret i32 0
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save