2024-05-01 07:37:38 +08:00
|
|
|
; ModuleID = 'main'
|
|
|
|
|
source_filename = "main"
|
|
|
|
|
|
2025-01-08 15:19:38 +08:00
|
|
|
%"github.com/goplus/llgo/runtime/abi.StructField" = type { %"github.com/goplus/llgo/runtime/internal/runtime.String", ptr, i64, %"github.com/goplus/llgo/runtime/internal/runtime.String", i1 }
|
|
|
|
|
%"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i64 }
|
|
|
|
|
%"github.com/goplus/llgo/runtime/internal/runtime.Slice" = type { ptr, i64, i64 }
|
2024-06-28 22:01:58 +08:00
|
|
|
|
2024-06-14 09:57:23 +08:00
|
|
|
@"main.init$guard" = global i1 false, align 1
|
|
|
|
|
@__llgo_argc = global i32 0, align 4
|
|
|
|
|
@__llgo_argv = global ptr null, align 8
|
2024-08-06 22:24:21 +08:00
|
|
|
@_llgo_int = linkonce global ptr null, align 8
|
2024-06-28 22:01:58 +08:00
|
|
|
@"map[_llgo_int]_llgo_int" = linkonce global ptr null, align 8
|
|
|
|
|
@0 = private unnamed_addr constant [7 x i8] c"topbits", align 1
|
|
|
|
|
@1 = private unnamed_addr constant [4 x i8] c"keys", align 1
|
|
|
|
|
@2 = private unnamed_addr constant [5 x i8] c"elems", align 1
|
|
|
|
|
@3 = private unnamed_addr constant [8 x i8] c"overflow", align 1
|
|
|
|
|
@4 = private unnamed_addr constant [4 x i8] c"main", align 1
|
|
|
|
|
@5 = private unnamed_addr constant [10 x i8] c"Hello %d\0A\00", align 1
|
2024-05-01 07:37:38 +08:00
|
|
|
|
|
|
|
|
define void @main.init() {
|
|
|
|
|
_llgo_0:
|
|
|
|
|
%0 = load i1, ptr @"main.init$guard", align 1
|
|
|
|
|
br i1 %0, label %_llgo_2, label %_llgo_1
|
|
|
|
|
|
|
|
|
|
_llgo_1: ; preds = %_llgo_0
|
|
|
|
|
store i1 true, ptr @"main.init$guard", align 1
|
2024-06-28 22:01:58 +08:00
|
|
|
call void @"main.init$after"()
|
2024-05-01 07:37:38 +08:00
|
|
|
br label %_llgo_2
|
|
|
|
|
|
|
|
|
|
_llgo_2: ; preds = %_llgo_1, %_llgo_0
|
|
|
|
|
ret void
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-17 09:48:21 +08:00
|
|
|
define i32 @main(i32 %0, ptr %1) {
|
2024-05-01 07:37:38 +08:00
|
|
|
_llgo_0:
|
2024-05-07 10:16:03 +08:00
|
|
|
store i32 %0, ptr @__llgo_argc, align 4
|
|
|
|
|
store ptr %1, ptr @__llgo_argv, align 8
|
2025-01-08 15:19:38 +08:00
|
|
|
call void @"github.com/goplus/llgo/runtime/internal/runtime.init"()
|
2024-05-01 07:37:38 +08:00
|
|
|
call void @main.init()
|
2024-08-06 22:24:21 +08:00
|
|
|
%2 = load ptr, ptr @_llgo_int, align 8
|
2024-10-10 16:07:52 +08:00
|
|
|
%3 = load ptr, ptr @"map[_llgo_int]_llgo_int", align 8
|
2025-01-08 15:19:38 +08:00
|
|
|
%4 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.MakeMap"(ptr %3, i64 2)
|
2024-10-10 16:07:52 +08:00
|
|
|
%5 = load ptr, ptr @"map[_llgo_int]_llgo_int", align 8
|
2025-01-08 15:19:38 +08:00
|
|
|
%6 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8)
|
2024-10-10 16:07:52 +08:00
|
|
|
store i64 23, ptr %6, align 4
|
2025-01-08 15:19:38 +08:00
|
|
|
%7 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.MapAssign"(ptr %5, ptr %4, ptr %6)
|
2024-10-10 16:07:52 +08:00
|
|
|
store i64 100, ptr %7, align 4
|
2024-08-06 22:24:21 +08:00
|
|
|
%8 = load ptr, ptr @"map[_llgo_int]_llgo_int", align 8
|
2025-01-08 15:19:38 +08:00
|
|
|
%9 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8)
|
2024-10-10 16:07:52 +08:00
|
|
|
store i64 7, ptr %9, align 4
|
2025-01-08 15:19:38 +08:00
|
|
|
%10 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.MapAssign"(ptr %8, ptr %4, ptr %9)
|
2024-10-10 16:07:52 +08:00
|
|
|
store i64 29, ptr %10, align 4
|
|
|
|
|
%11 = load ptr, ptr @"map[_llgo_int]_llgo_int", align 8
|
2025-01-08 15:19:38 +08:00
|
|
|
%12 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8)
|
2024-10-10 16:07:52 +08:00
|
|
|
store i64 23, ptr %12, align 4
|
2025-01-08 15:19:38 +08:00
|
|
|
%13 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.MapAccess1"(ptr %11, ptr %4, ptr %12)
|
2024-10-10 16:07:52 +08:00
|
|
|
%14 = load i64, ptr %13, align 4
|
|
|
|
|
%15 = call i32 (ptr, ...) @printf(ptr @5, i64 %14)
|
2024-05-17 09:48:21 +08:00
|
|
|
ret i32 0
|
2024-05-01 07:37:38 +08:00
|
|
|
}
|
|
|
|
|
|
2025-01-08 15:19:38 +08:00
|
|
|
declare void @"github.com/goplus/llgo/runtime/internal/runtime.init"()
|
2024-05-01 11:03:52 +08:00
|
|
|
|
2024-06-28 22:01:58 +08:00
|
|
|
define void @"main.init$after"() {
|
|
|
|
|
_llgo_0:
|
2024-08-06 22:24:21 +08:00
|
|
|
%0 = load ptr, ptr @_llgo_int, align 8
|
2024-06-28 22:01:58 +08:00
|
|
|
%1 = icmp eq ptr %0, null
|
|
|
|
|
br i1 %1, label %_llgo_1, label %_llgo_2
|
|
|
|
|
|
|
|
|
|
_llgo_1: ; preds = %_llgo_0
|
2025-01-08 15:19:38 +08:00
|
|
|
%2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64 34)
|
2024-08-06 22:24:21 +08:00
|
|
|
store ptr %2, ptr @_llgo_int, align 8
|
2024-06-28 22:01:58 +08:00
|
|
|
br label %_llgo_2
|
|
|
|
|
|
|
|
|
|
_llgo_2: ; preds = %_llgo_1, %_llgo_0
|
2024-08-06 22:24:21 +08:00
|
|
|
%3 = load ptr, ptr @"map[_llgo_int]_llgo_int", align 8
|
|
|
|
|
%4 = icmp eq ptr %3, null
|
|
|
|
|
br i1 %4, label %_llgo_3, label %_llgo_4
|
|
|
|
|
|
|
|
|
|
_llgo_3: ; preds = %_llgo_2
|
2025-01-08 15:19:38 +08:00
|
|
|
%5 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64 34)
|
|
|
|
|
%6 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64 34)
|
|
|
|
|
%7 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64 40)
|
|
|
|
|
%8 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.ArrayOf"(i64 8, ptr %7)
|
|
|
|
|
%9 = call %"github.com/goplus/llgo/runtime/abi.StructField" @"github.com/goplus/llgo/runtime/internal/runtime.StructField"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i64 7 }, ptr %8, i64 0, %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, i1 false)
|
|
|
|
|
%10 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64 34)
|
|
|
|
|
%11 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.ArrayOf"(i64 8, ptr %10)
|
|
|
|
|
%12 = call %"github.com/goplus/llgo/runtime/abi.StructField" @"github.com/goplus/llgo/runtime/internal/runtime.StructField"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @1, i64 4 }, ptr %11, i64 8, %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, i1 false)
|
|
|
|
|
%13 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64 34)
|
|
|
|
|
%14 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.ArrayOf"(i64 8, ptr %13)
|
|
|
|
|
%15 = call %"github.com/goplus/llgo/runtime/abi.StructField" @"github.com/goplus/llgo/runtime/internal/runtime.StructField"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @2, i64 5 }, ptr %14, i64 72, %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, i1 false)
|
|
|
|
|
%16 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64 44)
|
|
|
|
|
%17 = call %"github.com/goplus/llgo/runtime/abi.StructField" @"github.com/goplus/llgo/runtime/internal/runtime.StructField"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @3, i64 8 }, ptr %16, i64 136, %"github.com/goplus/llgo/runtime/internal/runtime.String" zeroinitializer, i1 false)
|
|
|
|
|
%18 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 224)
|
|
|
|
|
%19 = getelementptr %"github.com/goplus/llgo/runtime/abi.StructField", ptr %18, i64 0
|
|
|
|
|
store %"github.com/goplus/llgo/runtime/abi.StructField" %9, ptr %19, align 8
|
|
|
|
|
%20 = getelementptr %"github.com/goplus/llgo/runtime/abi.StructField", ptr %18, i64 1
|
|
|
|
|
store %"github.com/goplus/llgo/runtime/abi.StructField" %12, ptr %20, align 8
|
|
|
|
|
%21 = getelementptr %"github.com/goplus/llgo/runtime/abi.StructField", ptr %18, i64 2
|
|
|
|
|
store %"github.com/goplus/llgo/runtime/abi.StructField" %15, ptr %21, align 8
|
|
|
|
|
%22 = getelementptr %"github.com/goplus/llgo/runtime/abi.StructField", ptr %18, i64 3
|
|
|
|
|
store %"github.com/goplus/llgo/runtime/abi.StructField" %17, ptr %22, align 8
|
|
|
|
|
%23 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" undef, ptr %18, 0
|
|
|
|
|
%24 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %23, i64 4, 1
|
|
|
|
|
%25 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %24, i64 4, 2
|
|
|
|
|
%26 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @4, i64 4 }, i64 144, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %25)
|
|
|
|
|
%27 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.MapOf"(ptr %5, ptr %6, ptr %26, i64 4)
|
|
|
|
|
call void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr %27)
|
2024-11-24 15:19:16 +08:00
|
|
|
store ptr %27, ptr @"map[_llgo_int]_llgo_int", align 8
|
2024-08-06 22:24:21 +08:00
|
|
|
br label %_llgo_4
|
|
|
|
|
|
|
|
|
|
_llgo_4: ; preds = %_llgo_3, %_llgo_2
|
2024-06-28 22:01:58 +08:00
|
|
|
ret void
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-08 15:19:38 +08:00
|
|
|
declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i64)
|
2024-06-28 22:01:58 +08:00
|
|
|
|
2025-01-08 15:19:38 +08:00
|
|
|
declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.MapOf"(ptr, ptr, ptr, i64)
|
2024-08-06 22:24:21 +08:00
|
|
|
|
2025-01-08 15:19:38 +08:00
|
|
|
declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.Struct"(%"github.com/goplus/llgo/runtime/internal/runtime.String", i64, %"github.com/goplus/llgo/runtime/internal/runtime.Slice")
|
2024-06-28 22:01:58 +08:00
|
|
|
|
2025-01-08 15:19:38 +08:00
|
|
|
declare %"github.com/goplus/llgo/runtime/abi.StructField" @"github.com/goplus/llgo/runtime/internal/runtime.StructField"(%"github.com/goplus/llgo/runtime/internal/runtime.String", ptr, i64, %"github.com/goplus/llgo/runtime/internal/runtime.String", i1)
|
2024-06-28 22:01:58 +08:00
|
|
|
|
2025-01-08 15:19:38 +08:00
|
|
|
declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.ArrayOf"(i64, ptr)
|
2024-06-28 22:01:58 +08:00
|
|
|
|
2025-01-08 15:19:38 +08:00
|
|
|
declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64)
|
2024-06-28 22:01:58 +08:00
|
|
|
|
2025-01-08 15:19:38 +08:00
|
|
|
declare void @"github.com/goplus/llgo/runtime/internal/runtime.SetDirectIface"(ptr)
|
2024-07-08 20:19:25 +08:00
|
|
|
|
2025-01-08 15:19:38 +08:00
|
|
|
declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.MakeMap"(ptr, i64)
|
2024-06-28 22:01:58 +08:00
|
|
|
|
2025-01-08 15:19:38 +08:00
|
|
|
declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.MapAssign"(ptr, ptr, ptr)
|
2024-06-28 22:01:58 +08:00
|
|
|
|
2025-01-08 15:19:38 +08:00
|
|
|
declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.MapAccess1"(ptr, ptr, ptr)
|
2024-05-06 01:17:37 +08:00
|
|
|
|
|
|
|
|
declare i32 @printf(ptr, ...)
|