; LLVM IR from devantler/software-engineering-f22-shared :: IOT/BudgetManagementExcercise-03-28/ESP-Project/components/components/nghttp (backtrace)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.mrb_data_type = type { ptr, ptr }
%struct.mrb_value = type { %union.anon, i32 }
%union.anon = type { double }
%struct.backtrace_location = type { i32, i32, ptr }

@bt_type = external hidden constant %struct.mrb_data_type, align 8
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @mrb_gc_arena_save(ptr noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @mrb_gc_arena_restore(ptr noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
define dso_local { i64, i32 } @mrb_unpack_backtrace(ptr noundef %0, i64 %1, i32 %2) #3 {
  %4 = alloca %struct.mrb_value, align 8
  %5 = alloca %struct.mrb_value, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %struct.mrb_value, align 8
  %13 = alloca ptr, align 8
  %14 = alloca %struct.mrb_value, align 8
  %15 = alloca %struct.mrb_value, align 8
  %16 = alloca %struct.mrb_value, align 8
  %17 = alloca %struct.mrb_value, align 8
  %18 = alloca %struct.mrb_value, align 8
  %19 = alloca %struct.mrb_value, align 8
  %20 = getelementptr inbounds { i64, i32 }, ptr %5, i32 0, i32 0
  store i64 %1, ptr %20, align 8
  %21 = getelementptr inbounds { i64, i32 }, ptr %5, i32 0, i32 1
  store i32 %2, ptr %21, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %22 = getelementptr inbounds %struct.mrb_value, ptr %5, i32 0, i32 1
  %23 = load i32, ptr %22, align 8, !tbaa !9
  %24 = icmp eq i32 %23, 0
  br i1 %24, label %25, label %37

25:                                               ; preds = %3
  %26 = getelementptr inbounds %struct.mrb_value, ptr %5, i32 0, i32 0
  %27 = load i64, ptr %26, align 8, !tbaa !12
  %28 = icmp ne i64 %27, 0
  br i1 %28, label %37, label %29

29:                                               ; preds = %25
  br label %30

30:                                               ; preds = %51, %29
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = call { i64, i32 } @mrb_ary_new_capa(ptr noundef %31, i64 noundef 0)
  %33 = getelementptr inbounds { i64, i32 }, ptr %4, i32 0, i32 0
  %34 = extractvalue { i64, i32 } %32, 0
  store i64 %34, ptr %33, align 8
  %35 = getelementptr inbounds { i64, i32 }, ptr %4, i32 0, i32 1
  %36 = extractvalue { i64, i32 } %32, 1
  store i32 %36, ptr %35, align 8
  store i32 1, ptr %11, align 4
  br label %162

37:                                               ; preds = %25, %3
  %38 = getelementptr inbounds %struct.mrb_value, ptr %5, i32 0, i32 1
  %39 = load i32, ptr %38, align 8, !tbaa !9
  %40 = icmp eq i32 %39, 14
  br i1 %40, label %41, label %42

41:                                               ; preds = %37
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %4, ptr align 8 %5, i64 16, i1 false), !tbaa.struct !13
  store i32 1, ptr %11, align 4
  br label %162

42:                                               ; preds = %37
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  %44 = getelementptr inbounds { i64, i32 }, ptr %5, i32 0, i32 0
  %45 = load i64, ptr %44, align 8
  %46 = getelementptr inbounds { i64, i32 }, ptr %5, i32 0, i32 1
  %47 = load i32, ptr %46, align 8
  %48 = call ptr @mrb_data_check_get_ptr(ptr noundef %43, i64 %45, i32 %47, ptr noundef @bt_type)
  store ptr %48, ptr %7, align 8, !tbaa !5
  %49 = load ptr, ptr %7, align 8, !tbaa !5
  %50 = icmp eq ptr %49, null
  br i1 %50, label %51, label %52

51:                                               ; preds = %42
  br label %30

52:                                               ; preds = %42
  %53 = getelementptr inbounds %struct.mrb_value, ptr %5, i32 0, i32 0
  %54 = load ptr, ptr %53, align 8, !tbaa !12
  %55 = load i32, ptr %54, align 8
  %56 = lshr i32 %55, 11
  %57 = zext i32 %56 to i64
  store i64 %57, ptr %8, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #5
  %58 = load ptr, ptr %6, align 8, !tbaa !5
  %59 = load i64, ptr %8, align 8, !tbaa !15
  %60 = call { i64, i32 } @mrb_ary_new_capa(ptr noundef %58, i64 noundef %59)
  %61 = getelementptr inbounds { i64, i32 }, ptr %12, i32 0, i32 0
  %62 = extractvalue { i64, i32 } %60, 0
  store i64 %62, ptr %61, align 8
  %63 = getelementptr inbounds { i64, i32 }, ptr %12, i32 0, i32 1
  %64 = extractvalue { i64, i32 } %60, 1
  store i32 %64, ptr %63, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %5, ptr align 8 %12, i64 16, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #5
  %65 = load ptr, ptr %6, align 8, !tbaa !5
  %66 = call i32 @mrb_gc_arena_save(ptr noundef %65)
  store i32 %66, ptr %10, align 4, !tbaa !14
  store i64 0, ptr %9, align 8, !tbaa !15
  br label %67

67:                                               ; preds = %158, %52
  %68 = load i64, ptr %9, align 8, !tbaa !15
  %69 = load i64, ptr %8, align 8, !tbaa !15
  %70 = icmp slt i64 %68, %69
  br i1 %70, label %71, label %161

71:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %72 = load ptr, ptr %7, align 8, !tbaa !5
  %73 = load i64, ptr %9, align 8, !tbaa !15
  %74 = getelementptr inbounds %struct.backtrace_location, ptr %72, i64 %73
  store ptr %74, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #5
  %75 = load ptr, ptr %13, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.backtrace_location, ptr %75, i32 0, i32 2
  %77 = load ptr, ptr %76, align 8, !tbaa !17
  %78 = icmp eq ptr %77, null
  br i1 %78, label %79, label %80

79:                                               ; preds = %71
  store i32 5, ptr %11, align 4
  br label %155

80:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #5
  %81 = load ptr, ptr %6, align 8, !tbaa !5
  %82 = load ptr, ptr %6, align 8, !tbaa !5
  %83 = load ptr, ptr %13, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.backtrace_location, ptr %83, i32 0, i32 2
  %85 = load ptr, ptr %84, align 8, !tbaa !17
  %86 = call { i64, i32 } @mrb_str_new_cstr(ptr noundef %82, ptr noundef %85)
  %87 = getelementptr inbounds { i64, i32 }, ptr %16, i32 0, i32 0
  %88 = extractvalue { i64, i32 } %86, 0
  store i64 %88, ptr %87, align 8
  %89 = getelementptr inbounds { i64, i32 }, ptr %16, i32 0, i32 1
  %90 = extractvalue { i64, i32 } %86, 1
  store i32 %90, ptr %89, align 8
  %91 = load ptr, ptr %13, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.backtrace_location, ptr %91, i32 0, i32 0
  %93 = load i32, ptr %92, align 8, !tbaa !19
  %94 = sext i32 %93 to i64
  %95 = call { i64, i32 } @mrb_fixnum_value(i64 noundef %94)
  %96 = getelementptr inbounds { i64, i32 }, ptr %17, i32 0, i32 0
  %97 = extractvalue { i64, i32 } %95, 0
  store i64 %97, ptr %96, align 8
  %98 = getelementptr inbounds { i64, i32 }, ptr %17, i32 0, i32 1
  %99 = extractvalue { i64, i32 } %95, 1
  store i32 %99, ptr %98, align 8
  %100 = getelementptr inbounds { i64, i32 }, ptr %16, i32 0, i32 0
  %101 = load i64, ptr %100, align 8
  %102 = getelementptr inbounds { i64, i32 }, ptr %16, i32 0, i32 1
  %103 = load i32, ptr %102, align 8
  %104 = getelementptr inbounds { i64, i32 }, ptr %17, i32 0, i32 0
  %105 = load i64, ptr %104, align 8
  %106 = getelementptr inbounds { i64, i32 }, ptr %17, i32 0, i32 1
  %107 = load i32, ptr %106, align 8
  %108 = call { i64, i32 } (ptr, ptr, ...) @mrb_format(ptr noundef %81, ptr noundef @.str.1, i64 %101, i32 %103, i64 %105, i32 %107)
  %109 = getelementptr inbounds { i64, i32 }, ptr %15, i32 0, i32 0
  %110 = extractvalue { i64, i32 } %108, 0
  store i64 %110, ptr %109, align 8
  %111 = getelementptr inbounds { i64, i32 }, ptr %15, i32 0, i32 1
  %112 = extractvalue { i64, i32 } %108, 1
  store i32 %112, ptr %111, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %14, ptr align 8 %15, i64 16, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #5
  %113 = load ptr, ptr %13, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.backtrace_location, ptr %113, i32 0, i32 1
  %115 = load i32, ptr %114, align 4, !tbaa !20
  %116 = icmp ne i32 %115, 0
  br i1 %116, label %117, label %143

117:                                              ; preds = %80
  %118 = load ptr, ptr %6, align 8, !tbaa !5
  %119 = getelementptr inbounds { i64, i32 }, ptr %14, i32 0, i32 0
  %120 = load i64, ptr %119, align 8
  %121 = getelementptr inbounds { i64, i32 }, ptr %14, i32 0, i32 1
  %122 = load i32, ptr %121, align 8
  %123 = call { i64, i32 } @mrb_str_cat(ptr noundef %118, i64 %120, i32 %122, ptr noundef @.str.2, i64 noundef 4)
  %124 = getelementptr inbounds { i64, i32 }, ptr %18, i32 0, i32 0
  %125 = extractvalue { i64, i32 } %123, 0
  store i64 %125, ptr %124, align 8
  %126 = getelementptr inbounds { i64, i32 }, ptr %18, i32 0, i32 1
  %127 = extractvalue { i64, i32 } %123, 1
  store i32 %127, ptr %126, align 8
  %128 = load ptr, ptr %6, align 8, !tbaa !5
  %129 = load ptr, ptr %6, align 8, !tbaa !5
  %130 = load ptr, ptr %13, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.backtrace_location, ptr %130, i32 0, i32 1
  %132 = load i32, ptr %131, align 4, !tbaa !20
  %133 = call ptr @mrb_sym2name(ptr noundef %129, i32 noundef %132)
  %134 = getelementptr inbounds { i64, i32 }, ptr %14, i32 0, i32 0
  %135 = load i64, ptr %134, align 8
  %136 = getelementptr inbounds { i64, i32 }, ptr %14, i32 0, i32 1
  %137 = load i32, ptr %136, align 8
  %138 = call { i64, i32 } @mrb_str_cat_cstr(ptr noundef %128, i64 %135, i32 %137, ptr noundef %133)
  %139 = getelementptr inbounds { i64, i32 }, ptr %19, i32 0, i32 0
  %140 = extractvalue { i64, i32 } %138, 0
  store i64 %140, ptr %139, align 8
  %141 = getelementptr inbounds { i64, i32 }, ptr %19, i32 0, i32 1
  %142 = extractvalue { i64, i32 } %138, 1
  store i32 %142, ptr %141, align 8
  br label %143

143:                                              ; preds = %117, %80
  %144 = load ptr, ptr %6, align 8, !tbaa !5
  %145 = getelementptr inbounds { i64, i32 }, ptr %5, i32 0, i32 0
  %146 = load i64, ptr %145, align 8
  %147 = getelementptr inbounds { i64, i32 }, ptr %5, i32 0, i32 1
  %148 = load i32, ptr %147, align 8
  %149 = getelementptr inbounds { i64, i32 }, ptr %14, i32 0, i32 0
  %150 = load i64, ptr %149, align 8
  %151 = getelementptr inbounds { i64, i32 }, ptr %14, i32 0, i32 1
  %152 = load i32, ptr %151, align 8
  call void @mrb_ary_push(ptr noundef %144, i64 %146, i32 %148, i64 %150, i32 %152)
  %153 = load ptr, ptr %6, align 8, !tbaa !5
  %154 = load i32, ptr %10, align 4, !tbaa !14
  call void @mrb_gc_arena_restore(ptr noundef %153, i32 noundef %154)
  store i32 0, ptr %11, align 4
  br label %155

155:                                              ; preds = %143, %79
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  %156 = load i32, ptr %11, align 4
  switch i32 %156, label %164 [
    i32 0, label %157
    i32 5, label %158
  ]

157:                                              ; preds = %155
  br label %158

158:                                              ; preds = %157, %155
  %159 = load i64, ptr %9, align 8, !tbaa !15
  %160 = add nsw i64 %159, 1
  store i64 %160, ptr %9, align 8, !tbaa !15
  br label %67, !llvm.loop !21

161:                                              ; preds = %67
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %4, ptr align 8 %5, i64 16, i1 false), !tbaa.struct !13
  store i32 1, ptr %11, align 4
  br label %162

162:                                              ; preds = %161, %41, %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  %163 = load { i64, i32 }, ptr %4, align 8
  ret { i64, i32 } %163

164:                                              ; preds = %155
  unreachable
}

declare { i64, i32 } @mrb_ary_new_capa(ptr noundef, i64 noundef) #4

declare ptr @mrb_data_check_get_ptr(ptr noundef, i64, i32, ptr noundef) #4

declare { i64, i32 } @mrb_format(ptr noundef, ptr noundef, ...) #4

declare { i64, i32 } @mrb_str_new_cstr(ptr noundef, ptr noundef) #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden { i64, i32 } @mrb_fixnum_value(i64 noundef) #2

declare { i64, i32 } @mrb_str_cat(ptr noundef, i64, i32, ptr noundef, i64 noundef) #4

declare { i64, i32 } @mrb_str_cat_cstr(ptr noundef, i64, i32, ptr noundef) #4

declare ptr @mrb_sym2name(ptr noundef, i32 noundef) #4

declare void @mrb_ary_push(ptr noundef, i64, i32, i64, i32) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 8}
!10 = !{!"mrb_value", !7, i64 0, !11, i64 8}
!11 = !{!"int", !7, i64 0}
!12 = !{!7, !7, i64 0}
!13 = !{i64 0, i64 8, !12, i64 8, i64 4, !14}
!14 = !{!11, !11, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = !{!18, !6, i64 8}
!18 = !{!"backtrace_location", !11, i64 0, !11, i64 4, !6, i64 8}
!19 = !{!18, !11, i64 0}
!20 = !{!18, !11, i64 4}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.mrb_data_type = type { ptr, ptr }
%struct.backtrace_location = type { i32, i32, ptr }

@bt_type = external hidden constant %struct.mrb_data_type, align 8
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @mrb_gc_arena_save(ptr noundef) local_unnamed_addr #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @mrb_gc_arena_restore(ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local { i64, i32 } @mrb_unpack_backtrace(ptr noundef %0, i64 %1, i32 %2) local_unnamed_addr #1 {
  %4 = icmp ne i32 %2, 0
  %5 = icmp ne i64 %1, 0
  %or.cond = select i1 %4, i1 true, i1 %5
  %6 = inttoptr i64 %1 to ptr
  br i1 %or.cond, label %11, label %7

7:                                                ; preds = %13, %3
  %8 = tail call { i64, i32 } @mrb_ary_new_capa(ptr noundef %0, i64 noundef 0) #3
  %9 = extractvalue { i64, i32 } %8, 0
  %10 = extractvalue { i64, i32 } %8, 1
  br label %.loopexit

11:                                               ; preds = %3
  %12 = icmp eq i32 %2, 14
  br i1 %12, label %.loopexit, label %13

13:                                               ; preds = %11
  %14 = tail call ptr @mrb_data_check_get_ptr(ptr noundef %0, i64 %1, i32 %2, ptr noundef nonnull @bt_type) #3
  %15 = icmp eq ptr %14, null
  br i1 %15, label %7, label %16

16:                                               ; preds = %13
  %17 = load i32, ptr %6, align 8
  %18 = lshr i32 %17, 11
  %19 = zext nneg i32 %18 to i64
  %20 = tail call { i64, i32 } @mrb_ary_new_capa(ptr noundef %0, i64 noundef %19) #3
  %21 = extractvalue { i64, i32 } %20, 0
  %22 = extractvalue { i64, i32 } %20, 1
  %23 = tail call i32 @mrb_gc_arena_save(ptr noundef %0)
  %.not61 = icmp ult i32 %17, 2048
  br i1 %.not61, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %16, %48
  %.060 = phi i64 [ %49, %48 ], [ 0, %16 ]
  %24 = getelementptr inbounds %struct.backtrace_location, ptr %14, i64 %.060
  %25 = getelementptr inbounds i8, ptr %24, i64 8
  %26 = load ptr, ptr %25, align 8, !tbaa !5
  %27 = icmp eq ptr %26, null
  br i1 %27, label %48, label %28

28:                                               ; preds = %.lr.ph
  %29 = tail call { i64, i32 } @mrb_str_new_cstr(ptr noundef %0, ptr noundef nonnull %26) #3
  %30 = extractvalue { i64, i32 } %29, 0
  %31 = extractvalue { i64, i32 } %29, 1
  %32 = load i32, ptr %24, align 8, !tbaa !11
  %33 = sext i32 %32 to i64
  %34 = tail call { i64, i32 } @mrb_fixnum_value(i64 noundef %33)
  %35 = extractvalue { i64, i32 } %34, 0
  %36 = extractvalue { i64, i32 } %34, 1
  %37 = tail call { i64, i32 } (ptr, ptr, ...) @mrb_format(ptr noundef %0, ptr noundef nonnull @.str.1, i64 %30, i32 %31, i64 %35, i32 %36) #3
  %38 = extractvalue { i64, i32 } %37, 0
  %39 = extractvalue { i64, i32 } %37, 1
  %40 = getelementptr inbounds i8, ptr %24, i64 4
  %41 = load i32, ptr %40, align 4, !tbaa !12
  %.not = icmp eq i32 %41, 0
  br i1 %.not, label %47, label %42

42:                                               ; preds = %28
  %43 = tail call { i64, i32 } @mrb_str_cat(ptr noundef %0, i64 %38, i32 %39, ptr noundef nonnull @.str.2, i64 noundef 4) #3
  %44 = load i32, ptr %40, align 4, !tbaa !12
  %45 = tail call ptr @mrb_sym2name(ptr noundef %0, i32 noundef %44) #3
  %46 = tail call { i64, i32 } @mrb_str_cat_cstr(ptr noundef %0, i64 %38, i32 %39, ptr noundef %45) #3
  br label %47

47:                                               ; preds = %42, %28
  tail call void @mrb_ary_push(ptr noundef %0, i64 %21, i32 %22, i64 %38, i32 %39) #3
  tail call void @mrb_gc_arena_restore(ptr noundef %0, i32 noundef %23)
  br label %48

48:                                               ; preds = %.lr.ph, %47
  %49 = add nuw nsw i64 %.060, 1
  %exitcond.not = icmp eq i64 %49, %19
  br i1 %exitcond.not, label %.loopexit, label %.lr.ph, !llvm.loop !13

.loopexit:                                        ; preds = %48, %16, %11, %7
  %50 = phi i64 [ %9, %7 ], [ %1, %11 ], [ %21, %16 ], [ %21, %48 ]
  %.sroa.453.0 = phi i32 [ %10, %7 ], [ 14, %11 ], [ %22, %16 ], [ %22, %48 ]
  %.fca.0.insert = insertvalue { i64, i32 } poison, i64 %50, 0
  %.fca.1.insert = insertvalue { i64, i32 } %.fca.0.insert, i32 %.sroa.453.0, 1
  ret { i64, i32 } %.fca.1.insert
}

declare { i64, i32 } @mrb_ary_new_capa(ptr noundef, i64 noundef) local_unnamed_addr #2

declare ptr @mrb_data_check_get_ptr(ptr noundef, i64, i32, ptr noundef) local_unnamed_addr #2

declare { i64, i32 } @mrb_format(ptr noundef, ptr noundef, ...) local_unnamed_addr #2

declare { i64, i32 } @mrb_str_new_cstr(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden { i64, i32 } @mrb_fixnum_value(i64 noundef) local_unnamed_addr #0

declare { i64, i32 } @mrb_str_cat(ptr noundef, i64, i32, ptr noundef, i64 noundef) local_unnamed_addr #2

declare { i64, i32 } @mrb_str_cat_cstr(ptr noundef, i64, i32, ptr noundef) local_unnamed_addr #2

declare ptr @mrb_sym2name(ptr noundef, i32 noundef) local_unnamed_addr #2

declare void @mrb_ary_push(ptr noundef, i64, i32, i64, i32) local_unnamed_addr #2

attributes #0 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !10, i64 8}
!6 = !{!"backtrace_location", !7, i64 0, !7, i64 4, !10, i64 8}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 0}
!12 = !{!6, !7, i64 4}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass