Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; MINI ENVIRONMENT
- declare i8* @malloc(i64)
- declare void @free(i8*)
- declare i32 @printf(i8*, ...)
- declare i32 @scanf(i8*, ...)
- @.println = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1
- @.print = private unnamed_addr constant [5 x i8] c"%ld \00", align 1
- @.read = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
- @.read_scratch = common global i64 0, align 8
- ; PROGRAM STRUCTS
- %struct.A = type {i64, i64, i64, %struct.A*}
- %struct.B = type {%struct.A*}
- ; PROGRAM GLOBALS
- @i = common global i64 0, align 8
- @j = common global i64 0, align 8
- @k = common global i64 0, align 8
- @b = common global %struct.B* null, align 8
- @bb = common global %struct.B* null, align 8
- @bbb = common global %struct.B* null, align 8
- @bob = common global i64 0, align 8
- ; FUNCTION DEFINITIONS
- define %struct.A* @f(i64 %i, %struct.B* %j)
- {
- %.f = alloca i64
- %.k = alloca i64
- %.l = alloca i64
- L4:
- %u1 = load i64, i64* %.f
- ret i64 %u1
- }
- define %struct.A* @f(i64 %i, %struct.B* %j)
- {
- %.f = alloca i64
- %.k = alloca i64
- %.l = alloca i64
- L4:
- %u1 = load i64, i64* %.f
- ret i64 %u1
- }
- define i64 @main()
- {
- %.a = alloca i64
- %.b = alloca i64
- %.h = alloca i64
- %.i = alloca i64
- %.j = alloca i64
- %.k = alloca i64
- L15:
- br L14
- L14:
- br L13
- L13:
- %u2 = load i64, i64* %.k
- %u3 = icmp sgt i64 %u2, 0
- br i1 %u3, label L11, label L12
- L11:
- ret i64 0
- br L9
- L9:
- %u4 = add i64 1, 1
- store i64 %u4, i64* %.a
- br L7
- L7:
- ret i64 0
- L12:
- br L9
- L9:
- %u5 = add i64 1, 1
- store i64 %u5, i64* %.a
- br L7
- L7:
- ret i64 0
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement