Skip to content

Instantly share code, notes, and snippets.

@bollu
Created November 8, 2017 23:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bollu/8834682e5970550afcd6a0c991777fe1 to your computer and use it in GitHub Desktop.
Save bollu/8834682e5970550afcd6a0c991777fe1 to your computer and use it in GitHub Desktop.
Looks like I need AA
; ModuleID = 'out.o3.ll'
source_filename = "Module"
%Closure_Free0 = type { void ()* }
%Closure_Free2 = type { void ()*, [2 x i64] }
%Closure_Free3 = type { void ()*, [3 x i64] }
@nodebug = local_unnamed_addr constant i1 true
@rawHeapMemory = global i8* null
@rawHeapMemoryTop = local_unnamed_addr global i64 0
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @init_rawmem_constructor, i8* bitcast (i8** @rawHeapMemory to i8*) }]
@stackInt = local_unnamed_addr global [50000 x i64] zeroinitializer
@stackIntTop = local_unnamed_addr global i64 0
@stackReturn = local_unnamed_addr global [50000 x i8*] zeroinitializer
@stackReturnTop = local_unnamed_addr global i64 0
@stackBoxed = local_unnamed_addr global [50000 x i8*] zeroinitializer
@stackBoxedTop = local_unnamed_addr global i64 0
@enteringClosureAddr = local_unnamed_addr global i64 0
@closure_primMultiply = local_unnamed_addr constant %Closure_Free0 { void ()* @primMultiply }
@closure_primSubtract = constant %Closure_Free0 { void ()* @primSubtract }
@closure_primAdd = constant %Closure_Free0 { void ()* @primAdd }
@closure_printInt = constant %Closure_Free0 { void ()* @printInt }
@ackerman_closure = constant %Closure_Free0 { void ()* @ackerman }
@main_closure = local_unnamed_addr constant %Closure_Free0 { void ()* @main }
; Function Attrs: nounwind
declare noalias i8* @malloc(i64) local_unnamed_addr #0
; Function Attrs: nounwind
define void @init_rawmem_constructor() #0 {
entry:
%rawmem = tail call i8* @malloc(i64 34359738368)
store i8* %rawmem, i8** @rawHeapMemory, align 8
store i64 0, i64* @rawHeapMemoryTop, align 8
ret void
}
; Function Attrs: noinline nounwind
define i8* @alloc(i64 %size) local_unnamed_addr #1 {
entry:
%prevTopSlot = load i64, i64* @rawHeapMemoryTop, align 8
%memBottom = load i8*, i8** @rawHeapMemory, align 8
%sizeBumped = shl i64 %size, 2
%sizeAligned = add i64 %sizeBumped, 12
%newTop = add i64 %sizeAligned, %prevTopSlot
store i64 %newTop, i64* @rawHeapMemoryTop, align 8
%outOfMemory = icmp ugt i64 %newTop, 33285996544
br i1 %outOfMemory, label %trap, label %ret
ret: ; preds = %entry
%memIndexed = getelementptr i8, i8* %memBottom, i64 %prevTopSlot
ret i8* %memIndexed
trap: ; preds = %entry
tail call void @llvm.trap()
unreachable
}
; Function Attrs: noreturn nounwind
declare void @llvm.trap() #2
; Function Attrs: noinline norecurse nounwind
define fastcc i64 @popInt() local_unnamed_addr #3 {
entry:
%idx = load i64, i64* @stackIntTop, align 8
%idx_dec = add i64 %idx, -1
%slot = getelementptr [50000 x i64], [50000 x i64]* @stackInt, i64 0, i64 %idx_dec
%val = load i64, i64* %slot, align 8
store i64 %idx_dec, i64* @stackIntTop, align 8
ret i64 %val
}
; Function Attrs: noinline norecurse nounwind
define fastcc void @pushInt(i64 %i) local_unnamed_addr #3 {
entry:
%idx = load i64, i64* @stackIntTop, align 8
%slot = getelementptr [50000 x i64], [50000 x i64]* @stackInt, i64 0, i64 %idx
store i64 %i, i64* %slot, align 8
%idx_inc = add i64 %idx, 1
store i64 %idx_inc, i64* @stackIntTop, align 8
ret void
}
; Function Attrs: noinline norecurse nounwind
define i8* @popReturn() local_unnamed_addr #3 {
entry:
%idx = load i64, i64* @stackReturnTop, align 8
%idx_dec = add i64 %idx, -1
%slot = getelementptr [50000 x i8*], [50000 x i8*]* @stackReturn, i64 0, i64 %idx_dec
%val = load i8*, i8** %slot, align 8
store i64 %idx_dec, i64* @stackReturnTop, align 8
ret i8* %val
}
; Function Attrs: noinline norecurse nounwind
define void @pushReturn(i8* %i) local_unnamed_addr #3 {
entry:
%idx = load i64, i64* @stackReturnTop, align 8
%slot = getelementptr [50000 x i8*], [50000 x i8*]* @stackReturn, i64 0, i64 %idx
store i8* %i, i8** %slot, align 8
%idx_inc = add i64 %idx, 1
store i64 %idx_inc, i64* @stackReturnTop, align 8
ret void
}
; Function Attrs: noinline norecurse nounwind
define i8* @popBoxed() local_unnamed_addr #3 {
entry:
%idx = load i64, i64* @stackBoxedTop, align 8
%idx_dec = add i64 %idx, -1
%slot = getelementptr [50000 x i8*], [50000 x i8*]* @stackBoxed, i64 0, i64 %idx_dec
%val = load i8*, i8** %slot, align 8
store i64 %idx_dec, i64* @stackBoxedTop, align 8
ret i8* %val
}
; Function Attrs: noinline norecurse nounwind
define void @pushBoxed(i8* %i) local_unnamed_addr #3 {
entry:
%idx = load i64, i64* @stackBoxedTop, align 8
%slot = getelementptr [50000 x i8*], [50000 x i8*]* @stackBoxed, i64 0, i64 %idx
store i8* %i, i8** %slot, align 8
%idx_inc = add i64 %idx, 1
store i64 %idx_inc, i64* @stackBoxedTop, align 8
ret void
}
define void @primMultiply() {
entry:
%i = tail call fastcc i64 @popInt()
%j = tail call fastcc i64 @popInt()
%result = mul i64 %j, %i
tail call fastcc void @pushInt(i64 %result)
%return_frame = tail call i8* @popReturn()
%cont_slot.i = bitcast i8* %return_frame to void ()**
%cont.i = load void ()*, void ()** %cont_slot.i, align 8
%closure_addr.i = ptrtoint i8* %return_frame to i64
store i64 %closure_addr.i, i64* @enteringClosureAddr, align 8
musttail call void %cont.i()
ret void
}
define void @primSubtract() {
entry:
%i = tail call fastcc i64 @popInt()
%j = tail call fastcc i64 @popInt()
%result = sub i64 %i, %j
tail call fastcc void @pushInt(i64 %result)
%return_frame = tail call i8* @popReturn()
%cont_slot.i = bitcast i8* %return_frame to void ()**
%cont.i = load void ()*, void ()** %cont_slot.i, align 8
%closure_addr.i = ptrtoint i8* %return_frame to i64
store i64 %closure_addr.i, i64* @enteringClosureAddr, align 8
musttail call void %cont.i()
ret void
}
define void @primAdd() {
entry:
%i = tail call fastcc i64 @popInt()
%j = tail call fastcc i64 @popInt()
%result = add i64 %j, %i
tail call fastcc void @pushInt(i64 %result)
%return_frame = tail call i8* @popReturn()
%cont_slot.i = bitcast i8* %return_frame to void ()**
%cont.i = load void ()*, void ()** %cont_slot.i, align 8
%closure_addr.i = ptrtoint i8* %return_frame to i64
store i64 %closure_addr.i, i64* @enteringClosureAddr, align 8
musttail call void %cont.i()
ret void
}
define void @printInt() {
entry:
%i = tail call fastcc i64 @popInt()
tail call void @printOnlyInt(i64 %i)
%nReturnFrames = load i64, i64* @stackReturnTop, align 8
%haveReturnFrames = icmp ugt i64 %nReturnFrames, 1
br i1 %haveReturnFrames, label %callnextfn, label %exit
exit: ; preds = %entry
ret void
callnextfn: ; preds = %entry
%next_cont = tail call i8* @popReturn()
%cont_slot.i = bitcast i8* %next_cont to void ()**
%cont.i = load void ()*, void ()** %cont_slot.i, align 8
%closure_addr.i = ptrtoint i8* %next_cont to i64
store i64 %closure_addr.i, i64* @enteringClosureAddr, align 8
musttail call void %cont.i()
ret void
}
declare void @printOnlyInt(i64) local_unnamed_addr
; Function Attrs: alwaysinline
define void @ackerman() #4 {
entry:
%param_aint = tail call fastcc i64 @popInt()
%param_bint = tail call fastcc i64 @popInt()
%closure_raw = tail call i8* @alloc(i64 24)
%fn_slot = bitcast i8* %closure_raw to void ()**
store void ()* @"case_aint()_alts", void ()** %fn_slot, align 8
%aint_free_in_case_slot = getelementptr i8, i8* %closure_raw, i64 8
%0 = bitcast i8* %aint_free_in_case_slot to i64*
store i64 %param_aint, i64* %0, align 4
%bint_free_in_case_slot = getelementptr i8, i8* %closure_raw, i64 16
%1 = bitcast i8* %bint_free_in_case_slot to i64*
store i64 %param_bint, i64* %1, align 4
tail call void @pushReturn(i8* %closure_raw)
tail call fastcc void @pushInt(i64 %param_aint)
%cont.i = load void ()*, void ()** %fn_slot, align 8
%closure_addr.i = ptrtoint i8* %closure_raw to i64
store i64 %closure_addr.i, i64* @enteringClosureAddr, align 8
musttail call void %cont.i()
ret void
}
; Function Attrs: alwaysinline
define void @main() #4 {
entry:
%closure_raw = tail call i8* @alloc(i64 8)
%fn_slot = bitcast i8* %closure_raw to void ()**
store void ()* @"case_ackerman(atom-3 atom-10)_alts", void ()** %fn_slot, align 8
tail call void @pushReturn(i8* %closure_raw)
tail call fastcc void @pushInt(i64 10)
tail call fastcc void @pushInt(i64 3)
store i64 ptrtoint (%Closure_Free0* @ackerman_closure to i64), i64* @enteringClosureAddr, align 8
%param_aint.i = tail call fastcc i64 @popInt()
%param_bint.i = tail call fastcc i64 @popInt()
%closure_raw.i = tail call i8* @alloc(i64 24)
%fn_slot.i = bitcast i8* %closure_raw.i to void ()**
store void ()* @"case_aint()_alts", void ()** %fn_slot.i, align 8
%aint_free_in_case_slot.i = getelementptr i8, i8* %closure_raw.i, i64 8
%0 = bitcast i8* %aint_free_in_case_slot.i to i64*
store i64 %param_aint.i, i64* %0, align 4
%bint_free_in_case_slot.i = getelementptr i8, i8* %closure_raw.i, i64 16
%1 = bitcast i8* %bint_free_in_case_slot.i to i64*
store i64 %param_bint.i, i64* %1, align 4
tail call void @pushReturn(i8* %closure_raw.i)
tail call fastcc void @pushInt(i64 %param_aint.i)
%cont.i.i = load void ()*, void ()** %fn_slot.i, align 8
%closure_addr.i.i = ptrtoint i8* %closure_raw.i to i64
store i64 %closure_addr.i.i, i64* @enteringClosureAddr, align 8
musttail call void %cont.i.i()
ret void
}
define void @"case_aint()_alts"() {
entry:
%closure_addr_int2 = load %Closure_Free2*, %Closure_Free2** bitcast (i64* @enteringClosureAddr to %Closure_Free2**), align 8
%free__bint__ty_PrimInt = getelementptr %Closure_Free2, %Closure_Free2* %closure_addr_int2, i64 0, i32 1, i64 1
%bint = load i64, i64* %free__bint__ty_PrimInt, align 4
%scrutinee = tail call fastcc i64 @popInt()
%cond = icmp eq i64 %scrutinee, 0
br i1 %cond, label %alt_0, label %var_aval
var_aval: ; preds = %entry
%closure_raw = tail call i8* @alloc(i64 24)
%fn_slot = bitcast i8* %closure_raw to void ()**
store void ()* @"case_bint()_alts", void ()** %fn_slot, align 8
%aval_free_in_case_slot = getelementptr i8, i8* %closure_raw, i64 8
%0 = bitcast i8* %aval_free_in_case_slot to i64*
store i64 %scrutinee, i64* %0, align 4
%bint_free_in_case_slot = getelementptr i8, i8* %closure_raw, i64 16
%1 = bitcast i8* %bint_free_in_case_slot to i64*
store i64 %bint, i64* %1, align 4
tail call void @pushReturn(i8* %closure_raw)
tail call fastcc void @pushInt(i64 %bint)
%return_cont_bint = tail call i8* @popReturn()
%cont_slot.i = bitcast i8* %return_cont_bint to void ()**
%cont.i = load void ()*, void ()** %cont_slot.i, align 8
%closure_addr.i = ptrtoint i8* %return_cont_bint to i64
store i64 %closure_addr.i, i64* @enteringClosureAddr, align 8
musttail call void %cont.i()
ret void
alt_0: ; preds = %entry
tail call fastcc void @pushInt(i64 1)
tail call fastcc void @pushInt(i64 %bint)
store i64 ptrtoint (%Closure_Free0* @closure_primAdd to i64), i64* @enteringClosureAddr, align 8
%i.i = tail call fastcc i64 @popInt()
%j.i = tail call fastcc i64 @popInt()
%result.i = add i64 %j.i, %i.i
tail call fastcc void @pushInt(i64 %result.i)
%return_frame.i = tail call i8* @popReturn()
%cont_slot.i.i = bitcast i8* %return_frame.i to void ()**
%cont.i.i = load void ()*, void ()** %cont_slot.i.i, align 8
%closure_addr.i.i = ptrtoint i8* %return_frame.i to i64
store i64 %closure_addr.i.i, i64* @enteringClosureAddr, align 8
musttail call void %cont.i.i()
ret void
}
define void @"case_bint()_alts"() {
entry:
%closure_addr_int6 = load %Closure_Free2*, %Closure_Free2** bitcast (i64* @enteringClosureAddr to %Closure_Free2**), align 8
%free__aval__ty_PrimInt = getelementptr %Closure_Free2, %Closure_Free2* %closure_addr_int6, i64 0, i32 1, i64 0
%aval = load i64, i64* %free__aval__ty_PrimInt, align 4
%scrutinee = tail call fastcc i64 @popInt()
%cond = icmp eq i64 %scrutinee, 0
br i1 %cond, label %alt_0, label %var_bval
var_bval: ; preds = %entry
%closure_raw2 = tail call i8* @alloc(i64 24)
%fn_slot4 = bitcast i8* %closure_raw2 to void ()**
store void ()* @"case_primSubtract(atom-bval atom-1)_alts", void ()** %fn_slot4, align 8
%aval_free_in_case_slot5 = getelementptr i8, i8* %closure_raw2, i64 8
%0 = bitcast i8* %aval_free_in_case_slot5 to i64*
store i64 %aval, i64* %0, align 4
%bval_free_in_case_slot = getelementptr i8, i8* %closure_raw2, i64 16
%1 = bitcast i8* %bval_free_in_case_slot to i64*
store i64 %scrutinee, i64* %1, align 4
tail call void @pushReturn(i8* %closure_raw2)
tail call fastcc void @pushInt(i64 1)
tail call fastcc void @pushInt(i64 %scrutinee)
store i64 ptrtoint (%Closure_Free0* @closure_primSubtract to i64), i64* @enteringClosureAddr, align 8
%i.i = tail call fastcc i64 @popInt()
%j.i = tail call fastcc i64 @popInt()
%result.i = sub i64 %i.i, %j.i
tail call fastcc void @pushInt(i64 %result.i)
%return_frame.i = tail call i8* @popReturn()
%cont_slot.i.i = bitcast i8* %return_frame.i to void ()**
%cont.i.i = load void ()*, void ()** %cont_slot.i.i, align 8
%closure_addr.i.i = ptrtoint i8* %return_frame.i to i64
store i64 %closure_addr.i.i, i64* @enteringClosureAddr, align 8
musttail call void %cont.i.i()
ret void
alt_0: ; preds = %entry
%closure_raw = tail call i8* @alloc(i64 16)
%fn_slot = bitcast i8* %closure_raw to void ()**
store void ()* @"case_primSubtract(atom-aval atom-1)_alts", void ()** %fn_slot, align 8
%aval_free_in_case_slot = getelementptr i8, i8* %closure_raw, i64 8
%2 = bitcast i8* %aval_free_in_case_slot to i64*
store i64 %aval, i64* %2, align 4
tail call void @pushReturn(i8* %closure_raw)
tail call fastcc void @pushInt(i64 1)
tail call fastcc void @pushInt(i64 %aval)
store i64 ptrtoint (%Closure_Free0* @closure_primSubtract to i64), i64* @enteringClosureAddr, align 8
%i.i1 = tail call fastcc i64 @popInt()
%j.i2 = tail call fastcc i64 @popInt()
%result.i3 = sub i64 %i.i1, %j.i2
tail call fastcc void @pushInt(i64 %result.i3)
%return_frame.i4 = tail call i8* @popReturn()
%cont_slot.i.i5 = bitcast i8* %return_frame.i4 to void ()**
%cont.i.i6 = load void ()*, void ()** %cont_slot.i.i5, align 8
%closure_addr.i.i7 = ptrtoint i8* %return_frame.i4 to i64
store i64 %closure_addr.i.i7, i64* @enteringClosureAddr, align 8
musttail call void %cont.i.i6()
ret void
}
define void @"case_primSubtract(atom-aval atom-1)_alts"() {
entry:
%scrutinee = tail call fastcc i64 @popInt()
tail call fastcc void @pushInt(i64 1)
tail call fastcc void @pushInt(i64 %scrutinee)
store i64 ptrtoint (%Closure_Free0* @ackerman_closure to i64), i64* @enteringClosureAddr, align 8
%param_aint.i = tail call fastcc i64 @popInt()
%param_bint.i = tail call fastcc i64 @popInt()
%closure_raw.i = tail call i8* @alloc(i64 24)
%fn_slot.i = bitcast i8* %closure_raw.i to void ()**
store void ()* @"case_aint()_alts", void ()** %fn_slot.i, align 8
%aint_free_in_case_slot.i = getelementptr i8, i8* %closure_raw.i, i64 8
%0 = bitcast i8* %aint_free_in_case_slot.i to i64*
store i64 %param_aint.i, i64* %0, align 4
%bint_free_in_case_slot.i = getelementptr i8, i8* %closure_raw.i, i64 16
%1 = bitcast i8* %bint_free_in_case_slot.i to i64*
store i64 %param_bint.i, i64* %1, align 4
tail call void @pushReturn(i8* %closure_raw.i)
tail call fastcc void @pushInt(i64 %param_aint.i)
%cont.i.i = load void ()*, void ()** %fn_slot.i, align 8
%closure_addr.i.i = ptrtoint i8* %closure_raw.i to i64
store i64 %closure_addr.i.i, i64* @enteringClosureAddr, align 8
musttail call void %cont.i.i()
ret void
}
define void @"case_primSubtract(atom-bval atom-1)_alts"() {
entry:
%closure_addr_int2 = load %Closure_Free2*, %Closure_Free2** bitcast (i64* @enteringClosureAddr to %Closure_Free2**), align 8
%free__aval__ty_PrimInt = getelementptr %Closure_Free2, %Closure_Free2* %closure_addr_int2, i64 0, i32 1, i64 0
%aval = load i64, i64* %free__aval__ty_PrimInt, align 4
%scrutinee = tail call fastcc i64 @popInt()
%closure_raw = tail call i8* @alloc(i64 24)
%fn_slot = bitcast i8* %closure_raw to void ()**
store void ()* @"case_primSubtract(atom-aval atom-1)_alts.1", void ()** %fn_slot, align 8
%aval_free_in_case_slot = getelementptr i8, i8* %closure_raw, i64 8
%0 = bitcast i8* %aval_free_in_case_slot to i64*
store i64 %aval, i64* %0, align 4
%bdec_free_in_case_slot = getelementptr i8, i8* %closure_raw, i64 16
%1 = bitcast i8* %bdec_free_in_case_slot to i64*
store i64 %scrutinee, i64* %1, align 4
tail call void @pushReturn(i8* %closure_raw)
tail call fastcc void @pushInt(i64 1)
tail call fastcc void @pushInt(i64 %aval)
store i64 ptrtoint (%Closure_Free0* @closure_primSubtract to i64), i64* @enteringClosureAddr, align 8
%i.i = tail call fastcc i64 @popInt()
%j.i = tail call fastcc i64 @popInt()
%result.i = sub i64 %i.i, %j.i
tail call fastcc void @pushInt(i64 %result.i)
%return_frame.i = tail call i8* @popReturn()
%cont_slot.i.i = bitcast i8* %return_frame.i to void ()**
%cont.i.i = load void ()*, void ()** %cont_slot.i.i, align 8
%closure_addr.i.i = ptrtoint i8* %return_frame.i to i64
store i64 %closure_addr.i.i, i64* @enteringClosureAddr, align 8
musttail call void %cont.i.i()
ret void
}
define void @"case_primSubtract(atom-aval atom-1)_alts.1"() {
entry:
%closure_addr_int2 = load %Closure_Free2*, %Closure_Free2** bitcast (i64* @enteringClosureAddr to %Closure_Free2**), align 8
%free__aval__ty_PrimInt = getelementptr %Closure_Free2, %Closure_Free2* %closure_addr_int2, i64 0, i32 1, i64 0
%aval = load i64, i64* %free__aval__ty_PrimInt, align 4
%free__bdec__ty_PrimInt = getelementptr %Closure_Free2, %Closure_Free2* %closure_addr_int2, i64 0, i32 1, i64 1
%bdec = load i64, i64* %free__bdec__ty_PrimInt, align 4
%scrutinee = tail call fastcc i64 @popInt()
%closure_raw = tail call i8* @alloc(i64 32)
%fn_slot = bitcast i8* %closure_raw to void ()**
store void ()* @"case_ackerman(atom-aval atom-bdec)_alts", void ()** %fn_slot, align 8
%adec_free_in_case_slot = getelementptr i8, i8* %closure_raw, i64 8
%0 = bitcast i8* %adec_free_in_case_slot to i64*
store i64 %scrutinee, i64* %0, align 4
%aval_free_in_case_slot = getelementptr i8, i8* %closure_raw, i64 16
%1 = bitcast i8* %aval_free_in_case_slot to i64*
store i64 %aval, i64* %1, align 4
%bdec_free_in_case_slot = getelementptr i8, i8* %closure_raw, i64 24
%2 = bitcast i8* %bdec_free_in_case_slot to i64*
store i64 %bdec, i64* %2, align 4
tail call void @pushReturn(i8* %closure_raw)
tail call fastcc void @pushInt(i64 %bdec)
tail call fastcc void @pushInt(i64 %aval)
store i64 ptrtoint (%Closure_Free0* @ackerman_closure to i64), i64* @enteringClosureAddr, align 8
%param_aint.i = tail call fastcc i64 @popInt()
%param_bint.i = tail call fastcc i64 @popInt()
%closure_raw.i = tail call i8* @alloc(i64 24)
%fn_slot.i = bitcast i8* %closure_raw.i to void ()**
store void ()* @"case_aint()_alts", void ()** %fn_slot.i, align 8
%aint_free_in_case_slot.i = getelementptr i8, i8* %closure_raw.i, i64 8
%3 = bitcast i8* %aint_free_in_case_slot.i to i64*
store i64 %param_aint.i, i64* %3, align 4
%bint_free_in_case_slot.i = getelementptr i8, i8* %closure_raw.i, i64 16
%4 = bitcast i8* %bint_free_in_case_slot.i to i64*
store i64 %param_bint.i, i64* %4, align 4
tail call void @pushReturn(i8* %closure_raw.i)
tail call fastcc void @pushInt(i64 %param_aint.i)
%cont.i.i = load void ()*, void ()** %fn_slot.i, align 8
%closure_addr.i.i = ptrtoint i8* %closure_raw.i to i64
store i64 %closure_addr.i.i, i64* @enteringClosureAddr, align 8
musttail call void %cont.i.i()
ret void
}
define void @"case_ackerman(atom-aval atom-bdec)_alts"() {
entry:
%closure_addr_int1 = load %Closure_Free3*, %Closure_Free3** bitcast (i64* @enteringClosureAddr to %Closure_Free3**), align 8
%free__adec__ty_PrimInt = getelementptr %Closure_Free3, %Closure_Free3* %closure_addr_int1, i64 0, i32 1, i64 0
%adec = load i64, i64* %free__adec__ty_PrimInt, align 4
%scrutinee = tail call fastcc i64 @popInt()
tail call fastcc void @pushInt(i64 %scrutinee)
tail call fastcc void @pushInt(i64 %adec)
store i64 ptrtoint (%Closure_Free0* @ackerman_closure to i64), i64* @enteringClosureAddr, align 8
%param_aint.i = tail call fastcc i64 @popInt()
%param_bint.i = tail call fastcc i64 @popInt()
%closure_raw.i = tail call i8* @alloc(i64 24)
%fn_slot.i = bitcast i8* %closure_raw.i to void ()**
store void ()* @"case_aint()_alts", void ()** %fn_slot.i, align 8
%aint_free_in_case_slot.i = getelementptr i8, i8* %closure_raw.i, i64 8
%0 = bitcast i8* %aint_free_in_case_slot.i to i64*
store i64 %param_aint.i, i64* %0, align 4
%bint_free_in_case_slot.i = getelementptr i8, i8* %closure_raw.i, i64 16
%1 = bitcast i8* %bint_free_in_case_slot.i to i64*
store i64 %param_bint.i, i64* %1, align 4
tail call void @pushReturn(i8* %closure_raw.i)
tail call fastcc void @pushInt(i64 %param_aint.i)
%cont.i.i = load void ()*, void ()** %fn_slot.i, align 8
%closure_addr.i.i = ptrtoint i8* %closure_raw.i to i64
store i64 %closure_addr.i.i, i64* @enteringClosureAddr, align 8
musttail call void %cont.i.i()
ret void
}
define void @"case_ackerman(atom-3 atom-10)_alts"() {
entry:
%scrutinee = tail call fastcc i64 @popInt()
tail call fastcc void @pushInt(i64 %scrutinee)
store i64 ptrtoint (%Closure_Free0* @closure_printInt to i64), i64* @enteringClosureAddr, align 8
%i.i = tail call fastcc i64 @popInt()
tail call void @printOnlyInt(i64 %i.i)
%nReturnFrames.i = load i64, i64* @stackReturnTop, align 8
%haveReturnFrames.i = icmp ugt i64 %nReturnFrames.i, 1
br i1 %haveReturnFrames.i, label %callnextfn.i, label %printInt.exit
callnextfn.i: ; preds = %entry
%next_cont.i = tail call i8* @popReturn()
%cont_slot.i.i = bitcast i8* %next_cont.i to void ()**
%cont.i.i = load void ()*, void ()** %cont_slot.i.i, align 8
%closure_addr.i.i = ptrtoint i8* %next_cont.i to i64
store i64 %closure_addr.i.i, i64* @enteringClosureAddr, align 8
musttail call void %cont.i.i()
ret void
printInt.exit: ; preds = %entry
ret void
}
attributes #0 = { nounwind }
attributes #1 = { noinline nounwind }
attributes #2 = { noreturn nounwind }
attributes #3 = { noinline norecurse nounwind }
attributes #4 = { alwaysinline }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment