github.com/goplus/llgo@v0.8.3/cl/_testrt/closure/out.ll (about)

     1  ; ModuleID = 'main'
     2  source_filename = "main"
     3  
     4  @"main.init$guard" = global ptr null
     5  @__llgo_argc = global ptr null
     6  @__llgo_argv = global ptr null
     7  @0 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
     8  @1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
     9  
    10  define void @main.init() {
    11  _llgo_0:
    12    %0 = load i1, ptr @"main.init$guard", align 1
    13    br i1 %0, label %_llgo_2, label %_llgo_1
    14  
    15  _llgo_1:                                          ; preds = %_llgo_0
    16    store i1 true, ptr @"main.init$guard", align 1
    17    br label %_llgo_2
    18  
    19  _llgo_2:                                          ; preds = %_llgo_1, %_llgo_0
    20    ret void
    21  }
    22  
    23  define i32 @main(i32 %0, ptr %1) {
    24  _llgo_0:
    25    store i32 %0, ptr @__llgo_argc, align 4
    26    store ptr %1, ptr @__llgo_argv, align 8
    27    call void @"github.com/goplus/llgo/internal/runtime.init"()
    28    call void @main.init()
    29    call void @"main.main$1"(i64 100, i64 200)
    30    %2 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocZ"(i64 16)
    31    %3 = alloca { ptr, ptr }, align 8
    32    %4 = getelementptr inbounds { ptr, ptr }, ptr %3, i32 0, i32 0
    33    store ptr @"__llgo_stub.main.main$2", ptr %4, align 8
    34    %5 = getelementptr inbounds { ptr, ptr }, ptr %3, i32 0, i32 1
    35    store ptr null, ptr %5, align 8
    36    %6 = load { ptr, ptr }, ptr %3, align 8
    37    store { ptr, ptr } %6, ptr %2, align 8
    38    %7 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(i64 8)
    39    %8 = getelementptr inbounds { ptr }, ptr %7, i32 0, i32 0
    40    store ptr %2, ptr %8, align 8
    41    %9 = alloca { ptr, ptr }, align 8
    42    %10 = getelementptr inbounds { ptr, ptr }, ptr %9, i32 0, i32 0
    43    store ptr @"main.main$3", ptr %10, align 8
    44    %11 = getelementptr inbounds { ptr, ptr }, ptr %9, i32 0, i32 1
    45    store ptr %7, ptr %11, align 8
    46    %12 = load { ptr, ptr }, ptr %9, align 8
    47    %13 = extractvalue { ptr, ptr } %12, 1
    48    %14 = extractvalue { ptr, ptr } %12, 0
    49    call void %14(ptr %13)
    50    ret i32 0
    51  }
    52  
    53  declare void @"github.com/goplus/llgo/internal/runtime.init"()
    54  
    55  define void @"main.main$1"(i64 %0, i64 %1) {
    56  _llgo_0:
    57    %2 = call i32 (ptr, ...) @printf(ptr @0, i64 %0, i64 %1)
    58    ret void
    59  }
    60  
    61  declare ptr @"github.com/goplus/llgo/internal/runtime.AllocZ"(i64)
    62  
    63  define void @"main.main$2"(i64 %0, i64 %1) {
    64  _llgo_0:
    65    %2 = call i32 (ptr, ...) @printf(ptr @1, i64 %0, i64 %1)
    66    ret void
    67  }
    68  
    69  define linkonce void @"__llgo_stub.main.main$2"(ptr %0, i64 %1, i64 %2) {
    70  _llgo_0:
    71    tail call void @"main.main$2"(i64 %1, i64 %2)
    72    ret void
    73  }
    74  
    75  define void @"main.main$3"(ptr %0) {
    76  _llgo_0:
    77    %1 = load { ptr }, ptr %0, align 8
    78    %2 = extractvalue { ptr } %1, 0
    79    %3 = load { ptr, ptr }, ptr %2, align 8
    80    %4 = extractvalue { ptr, ptr } %3, 1
    81    %5 = extractvalue { ptr, ptr } %3, 0
    82    call void %5(ptr %4, i64 100, i64 200)
    83    ret void
    84  }
    85  
    86  declare ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(i64)
    87  
    88  declare i32 @printf(ptr, ...)