github.com/goplus/llgo@v0.8.3/cl/_testpy/gcd/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  @__llgo_py.math.gcd = linkonce global ptr null
     8  @0 = private unnamed_addr constant [22 x i8] c"gcd(60, 20, 25) = %d\0A\00", align 1
     9  @__llgo_py.math = external global ptr
    10  @1 = private unnamed_addr constant [4 x i8] c"gcd\00", align 1
    11  
    12  define void @main.init() {
    13  _llgo_0:
    14    %0 = load i1, ptr @"main.init$guard", align 1
    15    br i1 %0, label %_llgo_2, label %_llgo_1
    16  
    17  _llgo_1:                                          ; preds = %_llgo_0
    18    store i1 true, ptr @"main.init$guard", align 1
    19    call void @"github.com/goplus/llgo/py/math.init"()
    20    %1 = load ptr, ptr @__llgo_py.math, align 8
    21    call void (ptr, ...) @llgoLoadPyModSyms(ptr %1, ptr @1, ptr @__llgo_py.math.gcd, ptr null)
    22    br label %_llgo_2
    23  
    24  _llgo_2:                                          ; preds = %_llgo_1, %_llgo_0
    25    ret void
    26  }
    27  
    28  define i32 @main(i32 %0, ptr %1) {
    29  _llgo_0:
    30    call void @Py_Initialize()
    31    store i32 %0, ptr @__llgo_argc, align 4
    32    store ptr %1, ptr @__llgo_argv, align 8
    33    call void @"github.com/goplus/llgo/internal/runtime.init"()
    34    call void @main.init()
    35    %2 = call ptr @PyLong_FromLong(i32 60)
    36    %3 = call ptr @PyLong_FromLong(i32 20)
    37    %4 = call ptr @PyLong_FromLong(i32 25)
    38    %5 = load ptr, ptr @__llgo_py.math.gcd, align 8
    39    %6 = call ptr (ptr, ...) @PyObject_CallFunctionObjArgs(ptr %5, ptr %2, ptr %3, ptr %4, ptr null)
    40    %7 = call i32 @PyLong_AsLong(ptr %6)
    41    %8 = call i32 (ptr, ...) @printf(ptr @0, i32 %7)
    42    ret i32 0
    43  }
    44  
    45  declare void @"github.com/goplus/llgo/py/math.init"()
    46  
    47  declare void @"github.com/goplus/llgo/internal/runtime.init"()
    48  
    49  declare ptr @PyLong_FromLong(i32)
    50  
    51  declare ptr @PyObject_CallFunctionObjArgs(ptr, ...)
    52  
    53  declare i32 @PyLong_AsLong(ptr)
    54  
    55  declare i32 @printf(ptr, ...)
    56  
    57  declare void @llgoLoadPyModSyms(ptr, ...)
    58  
    59  declare void @Py_Initialize()