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

     1  ; ModuleID = 'main'
     2  source_filename = "main"
     3  
     4  %"github.com/goplus/llgo/internal/runtime.String" = type { ptr, i64 }
     5  %"github.com/goplus/llgo/internal/runtime.Slice" = type { ptr, i64, i64 }
     6  
     7  @"main.init$guard" = global ptr null
     8  @0 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1
     9  @1 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1
    10  @2 = private unnamed_addr constant [4 x i8] c"...\00", align 1
    11  @__llgo_argc = global ptr null
    12  @__llgo_argv = global ptr null
    13  @3 = private unnamed_addr constant [6 x i8] c"Hello\00", align 1
    14  @4 = private unnamed_addr constant [2 x i8] c" \00", align 1
    15  @5 = private unnamed_addr constant [6 x i8] c"World\00", align 1
    16  @__stderrp = external global ptr
    17  @6 = private unnamed_addr constant [8 x i8] c"Hi, %s\0A\00", align 1
    18  
    19  define %"github.com/goplus/llgo/internal/runtime.String" @main.concat(%"github.com/goplus/llgo/internal/runtime.Slice" %0) {
    20  _llgo_0:
    21    %1 = extractvalue %"github.com/goplus/llgo/internal/runtime.Slice" %0, 1
    22    %2 = call %"github.com/goplus/llgo/internal/runtime.String" @"github.com/goplus/llgo/internal/runtime.NewString"(ptr @0, i64 0)
    23    %3 = extractvalue %"github.com/goplus/llgo/internal/runtime.String" %2, 0
    24    %4 = extractvalue %"github.com/goplus/llgo/internal/runtime.String" %2, 1
    25    br label %_llgo_1
    26  
    27  _llgo_1:                                          ; preds = %_llgo_2, %_llgo_0
    28    %5 = phi ptr [ %3, %_llgo_0 ], [ %19, %_llgo_2 ]
    29    %6 = phi i64 [ %4, %_llgo_0 ], [ %20, %_llgo_2 ]
    30    %7 = phi i64 [ -1, %_llgo_0 ], [ %12, %_llgo_2 ]
    31    %8 = alloca %"github.com/goplus/llgo/internal/runtime.String", align 8
    32    %9 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %8, i32 0, i32 0
    33    store ptr %5, ptr %9, align 8
    34    %10 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %8, i32 0, i32 1
    35    store i64 %6, ptr %10, align 4
    36    %11 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %8, align 8
    37    %12 = add i64 %7, 1
    38    %13 = icmp slt i64 %12, %1
    39    br i1 %13, label %_llgo_2, label %_llgo_3
    40  
    41  _llgo_2:                                          ; preds = %_llgo_1
    42    %14 = icmp slt i64 %12, 0
    43    call void @"github.com/goplus/llgo/internal/runtime.AssertIndexRange"(i1 %14)
    44    %15 = extractvalue %"github.com/goplus/llgo/internal/runtime.Slice" %0, 0
    45    %16 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %15, i64 %12
    46    %17 = load %"github.com/goplus/llgo/internal/runtime.String", ptr %16, align 8
    47    %18 = call %"github.com/goplus/llgo/internal/runtime.String" @"github.com/goplus/llgo/internal/runtime.StringCat"(%"github.com/goplus/llgo/internal/runtime.String" %11, %"github.com/goplus/llgo/internal/runtime.String" %17)
    48    %19 = extractvalue %"github.com/goplus/llgo/internal/runtime.String" %18, 0
    49    %20 = extractvalue %"github.com/goplus/llgo/internal/runtime.String" %18, 1
    50    br label %_llgo_1
    51  
    52  _llgo_3:                                          ; preds = %_llgo_1
    53    ret %"github.com/goplus/llgo/internal/runtime.String" %11
    54  }
    55  
    56  define %"github.com/goplus/llgo/internal/runtime.String" @main.info(%"github.com/goplus/llgo/internal/runtime.String" %0) {
    57  _llgo_0:
    58    %1 = call %"github.com/goplus/llgo/internal/runtime.String" @"github.com/goplus/llgo/internal/runtime.NewString"(ptr @1, i64 0)
    59    %2 = call %"github.com/goplus/llgo/internal/runtime.String" @"github.com/goplus/llgo/internal/runtime.StringCat"(%"github.com/goplus/llgo/internal/runtime.String" %1, %"github.com/goplus/llgo/internal/runtime.String" %0)
    60    %3 = call %"github.com/goplus/llgo/internal/runtime.String" @"github.com/goplus/llgo/internal/runtime.NewString"(ptr @2, i64 3)
    61    %4 = call %"github.com/goplus/llgo/internal/runtime.String" @"github.com/goplus/llgo/internal/runtime.StringCat"(%"github.com/goplus/llgo/internal/runtime.String" %2, %"github.com/goplus/llgo/internal/runtime.String" %3)
    62    ret %"github.com/goplus/llgo/internal/runtime.String" %4
    63  }
    64  
    65  define void @main.init() {
    66  _llgo_0:
    67    %0 = load i1, ptr @"main.init$guard", align 1
    68    br i1 %0, label %_llgo_2, label %_llgo_1
    69  
    70  _llgo_1:                                          ; preds = %_llgo_0
    71    store i1 true, ptr @"main.init$guard", align 1
    72    br label %_llgo_2
    73  
    74  _llgo_2:                                          ; preds = %_llgo_1, %_llgo_0
    75    ret void
    76  }
    77  
    78  define i32 @main(i32 %0, ptr %1) {
    79  _llgo_0:
    80    store i32 %0, ptr @__llgo_argc, align 4
    81    store ptr %1, ptr @__llgo_argv, align 8
    82    call void @"github.com/goplus/llgo/internal/runtime.init"()
    83    call void @main.init()
    84    %2 = call ptr @"github.com/goplus/llgo/internal/runtime.AllocZ"(i64 48)
    85    %3 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %2, i64 0
    86    %4 = call %"github.com/goplus/llgo/internal/runtime.String" @"github.com/goplus/llgo/internal/runtime.NewString"(ptr @3, i64 5)
    87    store %"github.com/goplus/llgo/internal/runtime.String" %4, ptr %3, align 8
    88    %5 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %2, i64 1
    89    %6 = call %"github.com/goplus/llgo/internal/runtime.String" @"github.com/goplus/llgo/internal/runtime.NewString"(ptr @4, i64 1)
    90    store %"github.com/goplus/llgo/internal/runtime.String" %6, ptr %5, align 8
    91    %7 = getelementptr inbounds %"github.com/goplus/llgo/internal/runtime.String", ptr %2, i64 2
    92    %8 = call %"github.com/goplus/llgo/internal/runtime.String" @"github.com/goplus/llgo/internal/runtime.NewString"(ptr @5, i64 5)
    93    store %"github.com/goplus/llgo/internal/runtime.String" %8, ptr %7, align 8
    94    %9 = call %"github.com/goplus/llgo/internal/runtime.Slice" @"github.com/goplus/llgo/internal/runtime.NewSlice3"(ptr %2, i64 16, i64 3, i64 0, i64 3, i64 3)
    95    %10 = call %"github.com/goplus/llgo/internal/runtime.String" @main.concat(%"github.com/goplus/llgo/internal/runtime.Slice" %9)
    96    %11 = load ptr, ptr @__stderrp, align 8
    97    %12 = extractvalue %"github.com/goplus/llgo/internal/runtime.String" %10, 1
    98    %13 = add i64 %12, 1
    99    %14 = alloca i8, i64 %13, align 1
   100    %15 = call ptr @"github.com/goplus/llgo/internal/runtime.CStrCopy"(ptr %14, %"github.com/goplus/llgo/internal/runtime.String" %10)
   101    %16 = call i32 (ptr, ptr, ...) @fprintf(ptr %11, ptr @6, ptr %15)
   102    ret i32 0
   103  }
   104  
   105  declare void @"github.com/goplus/llgo/internal/runtime.AssertIndexRange"(i1)
   106  
   107  declare %"github.com/goplus/llgo/internal/runtime.String" @"github.com/goplus/llgo/internal/runtime.StringCat"(%"github.com/goplus/llgo/internal/runtime.String", %"github.com/goplus/llgo/internal/runtime.String")
   108  
   109  declare %"github.com/goplus/llgo/internal/runtime.String" @"github.com/goplus/llgo/internal/runtime.NewString"(ptr, i64)
   110  
   111  declare void @"github.com/goplus/llgo/internal/runtime.init"()
   112  
   113  declare ptr @"github.com/goplus/llgo/internal/runtime.AllocZ"(i64)
   114  
   115  declare %"github.com/goplus/llgo/internal/runtime.Slice" @"github.com/goplus/llgo/internal/runtime.NewSlice3"(ptr, i64, i64, i64, i64, i64)
   116  
   117  declare ptr @"github.com/goplus/llgo/internal/runtime.CStrCopy"(ptr, %"github.com/goplus/llgo/internal/runtime.String")
   118  
   119  declare i32 @fprintf(ptr, ptr, ...)