; LLVM IR from marcobambini/gravity :: src/compiler (gravity_ast)

; 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.gnode_function_decl_t = type { %struct.gnode_t, ptr, i32, i32, ptr, ptr, ptr, ptr, i16, i16, i8, i8, ptr }
%struct.gnode_t = type { i32, i32, i32, %struct.gtoken_s, i8, ptr }
%struct.gtoken_s = type { i32, i32, i32, i32, i32, i32, i32, i32, ptr }
%struct.gupvalue_r = type { i64, i64, ptr }
%struct.gupvalue_t = type { ptr, i32, i32, i8 }
%struct.gnode_var_t = type { %struct.gnode_t, ptr, ptr, ptr, ptr, i32, i16, i8, i8, ptr }

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

declare ptr @gravity_calloc(ptr noundef, i64 noundef, i64 noundef) #1

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

; Function Attrs: nounwind allocsize(1)
declare ptr @realloc(ptr noundef, i64 noundef) #2

; Function Attrs: nounwind uwtable
define dso_local ptr @gnode_function_add_upvalue(ptr noundef %0, ptr noundef %1, i16 noundef zeroext %2) #3 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i16, align 2
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i16 %2, ptr %7, align 2, !tbaa !9
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.gnode_function_decl_t, ptr %14, i32 0, i32 12
  %16 = load ptr, ptr %15, align 8, !tbaa !11
  %17 = icmp ne ptr %16, null
  br i1 %17, label %34, label %18

18:                                               ; preds = %3
  %19 = call ptr @gravity_calloc(ptr noundef null, i64 noundef 1, i64 noundef 24)
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.gnode_function_decl_t, ptr %20, i32 0, i32 12
  store ptr %19, ptr %21, align 8, !tbaa !11
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.gnode_function_decl_t, ptr %22, i32 0, i32 12
  %24 = load ptr, ptr %23, align 8, !tbaa !11
  %25 = getelementptr inbounds %struct.gupvalue_r, ptr %24, i32 0, i32 1
  store i64 0, ptr %25, align 8, !tbaa !17
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.gnode_function_decl_t, ptr %26, i32 0, i32 12
  %28 = load ptr, ptr %27, align 8, !tbaa !11
  %29 = getelementptr inbounds %struct.gupvalue_r, ptr %28, i32 0, i32 0
  store i64 0, ptr %29, align 8, !tbaa !20
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.gnode_function_decl_t, ptr %30, i32 0, i32 12
  %32 = load ptr, ptr %31, align 8, !tbaa !11
  %33 = getelementptr inbounds %struct.gupvalue_r, ptr %32, i32 0, i32 2
  store ptr null, ptr %33, align 8, !tbaa !21
  br label %34

34:                                               ; preds = %18, %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.gnode_function_decl_t, ptr %35, i32 0, i32 12
  %37 = load ptr, ptr %36, align 8, !tbaa !11
  %38 = icmp ne ptr %37, null
  br i1 %38, label %39, label %45

39:                                               ; preds = %34
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.gnode_function_decl_t, ptr %40, i32 0, i32 12
  %42 = load ptr, ptr %41, align 8, !tbaa !11
  %43 = getelementptr inbounds %struct.gupvalue_r, ptr %42, i32 0, i32 0
  %44 = load i64, ptr %43, align 8, !tbaa !20
  br label %46

45:                                               ; preds = %34
  br label %46

46:                                               ; preds = %45, %39
  %47 = phi i64 [ %44, %39 ], [ 0, %45 ]
  store i64 %47, ptr %8, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store i64 0, ptr %9, align 8, !tbaa !22
  br label %48

48:                                               ; preds = %96, %46
  %49 = load i64, ptr %9, align 8, !tbaa !22
  %50 = load i64, ptr %8, align 8, !tbaa !22
  %51 = icmp ult i64 %49, %50
  br i1 %51, label %53, label %52

52:                                               ; preds = %48
  store i32 2, ptr %10, align 4
  br label %99

53:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %54 = load i64, ptr %9, align 8, !tbaa !22
  %55 = icmp uge i64 %54, 0
  br i1 %55, label %56, label %73

56:                                               ; preds = %53
  %57 = load i64, ptr %9, align 8, !tbaa !22
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.gnode_function_decl_t, ptr %58, i32 0, i32 12
  %60 = load ptr, ptr %59, align 8, !tbaa !11
  %61 = getelementptr inbounds %struct.gupvalue_r, ptr %60, i32 0, i32 0
  %62 = load i64, ptr %61, align 8, !tbaa !20
  %63 = icmp ult i64 %57, %62
  br i1 %63, label %64, label %73

64:                                               ; preds = %56
  %65 = load ptr, ptr %5, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.gnode_function_decl_t, ptr %65, i32 0, i32 12
  %67 = load ptr, ptr %66, align 8, !tbaa !11
  %68 = getelementptr inbounds %struct.gupvalue_r, ptr %67, i32 0, i32 2
  %69 = load ptr, ptr %68, align 8, !tbaa !21
  %70 = load i64, ptr %9, align 8, !tbaa !22
  %71 = getelementptr inbounds ptr, ptr %69, i64 %70
  %72 = load ptr, ptr %71, align 8, !tbaa !5
  br label %74

73:                                               ; preds = %56, %53
  br label %74

74:                                               ; preds = %73, %64
  %75 = phi ptr [ %72, %64 ], [ null, %73 ]
  store ptr %75, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %76 = load ptr, ptr %11, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.gupvalue_t, ptr %76, i32 0, i32 0
  %78 = load ptr, ptr %77, align 8, !tbaa !23
  store ptr %78, ptr %12, align 8, !tbaa !5
  %79 = load ptr, ptr %12, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.gnode_var_t, ptr %79, i32 0, i32 2
  %81 = load ptr, ptr %80, align 8, !tbaa !25
  %82 = load ptr, ptr %6, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.gnode_var_t, ptr %82, i32 0, i32 2
  %84 = load ptr, ptr %83, align 8, !tbaa !25
  %85 = call i32 @strcmp(ptr noundef %81, ptr noundef %84) #6
  %86 = icmp eq i32 %85, 0
  br i1 %86, label %87, label %89

87:                                               ; preds = %74
  %88 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %88, ptr %4, align 8
  store i32 1, ptr %10, align 4
  br label %90

89:                                               ; preds = %74
  store i32 0, ptr %10, align 4
  br label %90

90:                                               ; preds = %89, %87
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  %91 = load i32, ptr %10, align 4
  switch i32 %91, label %93 [
    i32 0, label %92
  ]

92:                                               ; preds = %90
  store i32 0, ptr %10, align 4
  br label %93

93:                                               ; preds = %92, %90
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  %94 = load i32, ptr %10, align 4
  switch i32 %94, label %99 [
    i32 0, label %95
  ]

95:                                               ; preds = %93
  br label %96

96:                                               ; preds = %95
  %97 = load i64, ptr %9, align 8, !tbaa !22
  %98 = add i64 %97, 1
  store i64 %98, ptr %9, align 8, !tbaa !22
  br label %48, !llvm.loop !27

99:                                               ; preds = %93, %52
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  %100 = load i32, ptr %10, align 4
  switch i32 %100, label %102 [
    i32 2, label %101
  ]

101:                                              ; preds = %99
  store i32 0, ptr %10, align 4
  br label %102

102:                                              ; preds = %101, %99
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  %103 = load i32, ptr %10, align 4
  switch i32 %103, label %223 [
    i32 0, label %104
    i32 1, label %221
  ]

104:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %105 = call ptr @gravity_calloc(ptr noundef null, i64 noundef 1, i64 noundef 24)
  store ptr %105, ptr %13, align 8, !tbaa !5
  %106 = load ptr, ptr %6, align 8, !tbaa !5
  %107 = load ptr, ptr %13, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.gupvalue_t, ptr %107, i32 0, i32 0
  store ptr %106, ptr %108, align 8, !tbaa !23
  %109 = load i16, ptr %7, align 2, !tbaa !9
  %110 = zext i16 %109 to i32
  %111 = icmp eq i32 %110, 1
  br i1 %111, label %112, label %117

112:                                              ; preds = %104
  %113 = load ptr, ptr %6, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.gnode_var_t, ptr %113, i32 0, i32 6
  %115 = load i16, ptr %114, align 4, !tbaa !29
  %116 = zext i16 %115 to i32
  br label %132

117:                                              ; preds = %104
  %118 = load ptr, ptr %5, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.gnode_function_decl_t, ptr %118, i32 0, i32 12
  %120 = load ptr, ptr %119, align 8, !tbaa !11
  %121 = icmp ne ptr %120, null
  br i1 %121, label %122, label %128

122:                                              ; preds = %117
  %123 = load ptr, ptr %5, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.gnode_function_decl_t, ptr %123, i32 0, i32 12
  %125 = load ptr, ptr %124, align 8, !tbaa !11
  %126 = getelementptr inbounds %struct.gupvalue_r, ptr %125, i32 0, i32 0
  %127 = load i64, ptr %126, align 8, !tbaa !20
  br label %129

128:                                              ; preds = %117
  br label %129

129:                                              ; preds = %128, %122
  %130 = phi i64 [ %127, %122 ], [ 0, %128 ]
  %131 = trunc i64 %130 to i32
  br label %132

132:                                              ; preds = %129, %112
  %133 = phi i32 [ %116, %112 ], [ %131, %129 ]
  %134 = load ptr, ptr %13, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.gupvalue_t, ptr %134, i32 0, i32 1
  store i32 %133, ptr %135, align 8, !tbaa !30
  %136 = load ptr, ptr %5, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.gnode_function_decl_t, ptr %136, i32 0, i32 12
  %138 = load ptr, ptr %137, align 8, !tbaa !11
  %139 = icmp ne ptr %138, null
  br i1 %139, label %140, label %146

140:                                              ; preds = %132
  %141 = load ptr, ptr %5, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.gnode_function_decl_t, ptr %141, i32 0, i32 12
  %143 = load ptr, ptr %142, align 8, !tbaa !11
  %144 = getelementptr inbounds %struct.gupvalue_r, ptr %143, i32 0, i32 0
  %145 = load i64, ptr %144, align 8, !tbaa !20
  br label %147

146:                                              ; preds = %132
  br label %147

147:                                              ; preds = %146, %140
  %148 = phi i64 [ %145, %140 ], [ 0, %146 ]
  %149 = trunc i64 %148 to i32
  %150 = load ptr, ptr %13, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.gupvalue_t, ptr %150, i32 0, i32 2
  store i32 %149, ptr %151, align 4, !tbaa !31
  %152 = load i16, ptr %7, align 2, !tbaa !9
  %153 = zext i16 %152 to i32
  %154 = icmp eq i32 %153, 1
  %155 = load ptr, ptr %13, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.gupvalue_t, ptr %155, i32 0, i32 3
  %157 = zext i1 %154 to i8
  store i8 %157, ptr %156, align 8, !tbaa !32
  %158 = load ptr, ptr %5, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.gnode_function_decl_t, ptr %158, i32 0, i32 12
  %160 = load ptr, ptr %159, align 8, !tbaa !11
  %161 = getelementptr inbounds %struct.gupvalue_r, ptr %160, i32 0, i32 0
  %162 = load i64, ptr %161, align 8, !tbaa !20
  %163 = load ptr, ptr %5, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.gnode_function_decl_t, ptr %163, i32 0, i32 12
  %165 = load ptr, ptr %164, align 8, !tbaa !11
  %166 = getelementptr inbounds %struct.gupvalue_r, ptr %165, i32 0, i32 1
  %167 = load i64, ptr %166, align 8, !tbaa !17
  %168 = icmp eq i64 %162, %167
  br i1 %168, label %169, label %206

169:                                              ; preds = %147
  %170 = load ptr, ptr %5, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.gnode_function_decl_t, ptr %170, i32 0, i32 12
  %172 = load ptr, ptr %171, align 8, !tbaa !11
  %173 = getelementptr inbounds %struct.gupvalue_r, ptr %172, i32 0, i32 1
  %174 = load i64, ptr %173, align 8, !tbaa !17
  %175 = icmp ne i64 %174, 0
  br i1 %175, label %176, label %183

176:                                              ; preds = %169
  %177 = load ptr, ptr %5, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.gnode_function_decl_t, ptr %177, i32 0, i32 12
  %179 = load ptr, ptr %178, align 8, !tbaa !11
  %180 = getelementptr inbounds %struct.gupvalue_r, ptr %179, i32 0, i32 1
  %181 = load i64, ptr %180, align 8, !tbaa !17
  %182 = shl i64 %181, 1
  br label %184

183:                                              ; preds = %169
  br label %184

184:                                              ; preds = %183, %176
  %185 = phi i64 [ %182, %176 ], [ 8, %183 ]
  %186 = load ptr, ptr %5, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.gnode_function_decl_t, ptr %186, i32 0, i32 12
  %188 = load ptr, ptr %187, align 8, !tbaa !11
  %189 = getelementptr inbounds %struct.gupvalue_r, ptr %188, i32 0, i32 1
  store i64 %185, ptr %189, align 8, !tbaa !17
  %190 = load ptr, ptr %5, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.gnode_function_decl_t, ptr %190, i32 0, i32 12
  %192 = load ptr, ptr %191, align 8, !tbaa !11
  %193 = getelementptr inbounds %struct.gupvalue_r, ptr %192, i32 0, i32 2
  %194 = load ptr, ptr %193, align 8, !tbaa !21
  %195 = load ptr, ptr %5, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct.gnode_function_decl_t, ptr %195, i32 0, i32 12
  %197 = load ptr, ptr %196, align 8, !tbaa !11
  %198 = getelementptr inbounds %struct.gupvalue_r, ptr %197, i32 0, i32 1
  %199 = load i64, ptr %198, align 8, !tbaa !17
  %200 = mul i64 8, %199
  %201 = call ptr @realloc(ptr noundef %194, i64 noundef %200) #7
  %202 = load ptr, ptr %5, align 8, !tbaa !5
  %203 = getelementptr inbounds %struct.gnode_function_decl_t, ptr %202, i32 0, i32 12
  %204 = load ptr, ptr %203, align 8, !tbaa !11
  %205 = getelementptr inbounds %struct.gupvalue_r, ptr %204, i32 0, i32 2
  store ptr %201, ptr %205, align 8, !tbaa !21
  br label %206

206:                                              ; preds = %184, %147
  %207 = load ptr, ptr %13, align 8, !tbaa !5
  %208 = load ptr, ptr %5, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.gnode_function_decl_t, ptr %208, i32 0, i32 12
  %210 = load ptr, ptr %209, align 8, !tbaa !11
  %211 = getelementptr inbounds %struct.gupvalue_r, ptr %210, i32 0, i32 2
  %212 = load ptr, ptr %211, align 8, !tbaa !21
  %213 = load ptr, ptr %5, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.gnode_function_decl_t, ptr %213, i32 0, i32 12
  %215 = load ptr, ptr %214, align 8, !tbaa !11
  %216 = getelementptr inbounds %struct.gupvalue_r, ptr %215, i32 0, i32 0
  %217 = load i64, ptr %216, align 8, !tbaa !20
  %218 = add i64 %217, 1
  store i64 %218, ptr %216, align 8, !tbaa !20
  %219 = getelementptr inbounds ptr, ptr %212, i64 %217
  store ptr %207, ptr %219, align 8, !tbaa !5
  %220 = load ptr, ptr %13, align 8, !tbaa !5
  store ptr %220, ptr %4, align 8
  store i32 1, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %221

221:                                              ; preds = %206, %102
  %222 = load ptr, ptr %4, align 8
  ret ptr %222

223:                                              ; preds = %102
  unreachable
}

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { nounwind allocsize(1) "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 = { nounwind willreturn memory(read) "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 }
attributes #6 = { nounwind willreturn memory(read) }
attributes #7 = { nounwind allocsize(1) }

!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, !10, i64 0}
!10 = !{!"short", !7, i64 0}
!11 = !{!12, !6, i64 128}
!12 = !{!"", !13, i64 0, !6, i64 72, !14, i64 80, !14, i64 84, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !10, i64 120, !10, i64 122, !16, i64 124, !16, i64 125, !6, i64 128}
!13 = !{!"", !14, i64 0, !14, i64 4, !14, i64 8, !15, i64 16, !16, i64 56, !6, i64 64}
!14 = !{!"int", !7, i64 0}
!15 = !{!"gtoken_s", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20, !14, i64 24, !14, i64 28, !6, i64 32}
!16 = !{!"_Bool", !7, i64 0}
!17 = !{!18, !19, i64 8}
!18 = !{!"", !19, i64 0, !19, i64 8, !6, i64 16}
!19 = !{!"long", !7, i64 0}
!20 = !{!18, !19, i64 0}
!21 = !{!18, !6, i64 16}
!22 = !{!19, !19, i64 0}
!23 = !{!24, !6, i64 0}
!24 = !{!"", !6, i64 0, !14, i64 8, !14, i64 12, !16, i64 16}
!25 = !{!26, !6, i64 80}
!26 = !{!"", !13, i64 0, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !14, i64 104, !10, i64 108, !16, i64 110, !16, i64 111, !6, i64 112}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = !{!26, !10, i64 108}
!30 = !{!24, !14, i64 8}
!31 = !{!24, !14, i64 12}
!32 = !{!24, !16, i64 16}


; 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"

declare ptr @gravity_calloc(ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias noundef ptr @realloc(ptr allocptr nocapture noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local noundef ptr @gnode_function_add_upvalue(ptr nocapture noundef %0, ptr noundef %1, i16 noundef zeroext %2) local_unnamed_addr #2 {
  %4 = getelementptr inbounds i8, ptr %0, i64 128
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %.not = icmp eq ptr %5, null
  br i1 %.not, label %.thread.thread, label %.thread

.thread.thread:                                   ; preds = %3
  %6 = tail call ptr @gravity_calloc(ptr noundef null, i64 noundef 1, i64 noundef 24) #6
  store ptr %6, ptr %4, align 8, !tbaa !5
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %6, i8 0, i64 24, i1 false)
  br label %._crit_edge

.thread:                                          ; preds = %3
  %.pre = load i64, ptr %5, align 8, !tbaa !15
  %.not5972.not = icmp eq i64 %.pre, 0
  br i1 %.not5972.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.thread
  %7 = getelementptr inbounds i8, ptr %5, i64 16
  %8 = load ptr, ptr %7, align 8, !tbaa !18
  %9 = getelementptr inbounds i8, ptr %1, i64 80
  %10 = load ptr, ptr %9, align 8, !tbaa !19
  br label %13

11:                                               ; preds = %13
  %12 = add nuw i64 %.05073, 1
  %exitcond.not = icmp eq i64 %12, %.pre
  br i1 %exitcond.not, label %._crit_edge, label %13, !llvm.loop !21

13:                                               ; preds = %.lr.ph, %11
  %.05073 = phi i64 [ 0, %.lr.ph ], [ %12, %11 ]
  %14 = icmp ult i64 %.05073, %.pre
  tail call void @llvm.assume(i1 %14)
  %15 = getelementptr inbounds ptr, ptr %8, i64 %.05073
  %16 = load ptr, ptr %15, align 8, !tbaa !23
  %17 = load ptr, ptr %16, align 8, !tbaa !24
  %18 = getelementptr inbounds i8, ptr %17, i64 80
  %19 = load ptr, ptr %18, align 8, !tbaa !19
  %20 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %19, ptr noundef nonnull dereferenceable(1) %10) #7
  %.not58 = icmp eq i32 %20, 0
  br i1 %.not58, label %.loopexit, label %11

._crit_edge:                                      ; preds = %11, %.thread.thread, %.thread
  %21 = tail call ptr @gravity_calloc(ptr noundef null, i64 noundef 1, i64 noundef 24) #6
  store ptr %1, ptr %21, align 8, !tbaa !24
  %22 = icmp eq i16 %2, 1
  br i1 %22, label %29, label %23

23:                                               ; preds = %._crit_edge
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %.not60 = icmp eq ptr %24, null
  br i1 %.not60, label %.thread68, label %.thread70

.thread68:                                        ; preds = %23
  %25 = getelementptr inbounds i8, ptr %21, i64 8
  store i32 0, ptr %25, align 8, !tbaa !26
  br label %34

.thread70:                                        ; preds = %23
  %26 = load i64, ptr %24, align 8, !tbaa !15
  %27 = trunc i64 %26 to i32
  %28 = getelementptr inbounds i8, ptr %21, i64 8
  store i32 %27, ptr %28, align 8, !tbaa !26
  br label %34

29:                                               ; preds = %._crit_edge
  %30 = getelementptr inbounds i8, ptr %1, i64 108
  %31 = load i16, ptr %30, align 4, !tbaa !27
  %32 = zext i16 %31 to i32
  %.pr67 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = getelementptr inbounds i8, ptr %21, i64 8
  store i32 %32, ptr %33, align 8, !tbaa !26
  %.not61 = icmp eq ptr %.pr67, null
  br i1 %.not61, label %34, label %._crit_edge75

._crit_edge75:                                    ; preds = %29
  %.pre76 = load i64, ptr %.pr67, align 8, !tbaa !15
  %.pre79 = trunc i64 %.pre76 to i32
  br label %34

34:                                               ; preds = %.thread70, %._crit_edge75, %.thread68, %29
  %35 = phi ptr [ null, %29 ], [ null, %.thread68 ], [ %.pr67, %._crit_edge75 ], [ %24, %.thread70 ]
  %36 = phi i32 [ 0, %29 ], [ 0, %.thread68 ], [ %.pre79, %._crit_edge75 ], [ %27, %.thread70 ]
  %37 = getelementptr inbounds i8, ptr %21, i64 12
  store i32 %36, ptr %37, align 4, !tbaa !28
  %38 = getelementptr inbounds i8, ptr %21, i64 16
  %39 = zext i1 %22 to i8
  store i8 %39, ptr %38, align 8, !tbaa !29
  %40 = load i64, ptr %35, align 8, !tbaa !15
  %41 = getelementptr inbounds i8, ptr %35, i64 8
  %42 = load i64, ptr %41, align 8, !tbaa !30
  %43 = icmp eq i64 %40, %42
  br i1 %43, label %44, label %._crit_edge77

._crit_edge77:                                    ; preds = %34
  %.phi.trans.insert = getelementptr inbounds i8, ptr %35, i64 16
  %.pre78 = load ptr, ptr %.phi.trans.insert, align 8, !tbaa !18
  br label %52

44:                                               ; preds = %34
  %.not62 = icmp eq i64 %40, 0
  %45 = shl i64 %40, 1
  %spec.select = select i1 %.not62, i64 8, i64 %45
  store i64 %spec.select, ptr %41, align 8, !tbaa !30
  %46 = getelementptr inbounds i8, ptr %35, i64 16
  %47 = load ptr, ptr %46, align 8, !tbaa !18
  %48 = shl i64 %spec.select, 3
  %49 = tail call ptr @realloc(ptr noundef %47, i64 noundef %48) #8
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  %51 = getelementptr inbounds i8, ptr %50, i64 16
  store ptr %49, ptr %51, align 8, !tbaa !18
  br label %52

52:                                               ; preds = %._crit_edge77, %44
  %53 = phi ptr [ %49, %44 ], [ %.pre78, %._crit_edge77 ]
  %54 = phi ptr [ %50, %44 ], [ %35, %._crit_edge77 ]
  %55 = load i64, ptr %54, align 8, !tbaa !15
  %56 = add i64 %55, 1
  store i64 %56, ptr %54, align 8, !tbaa !15
  %57 = getelementptr inbounds ptr, ptr %53, i64 %55
  store ptr %21, ptr %57, align 8, !tbaa !23
  br label %.loopexit

.loopexit:                                        ; preds = %13, %52
  %.3 = phi ptr [ %21, %52 ], [ %16, %13 ]
  ret ptr %.3
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #4

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

attributes #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 = { mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { 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 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }
attributes #8 = { nounwind allocsize(1) }

!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, !12, i64 128}
!6 = !{!"", !7, i64 0, !12, i64 72, !8, i64 80, !8, i64 84, !12, i64 88, !12, i64 96, !12, i64 104, !12, i64 112, !14, i64 120, !14, i64 122, !13, i64 124, !13, i64 125, !12, i64 128}
!7 = !{!"", !8, i64 0, !8, i64 4, !8, i64 8, !11, i64 16, !13, i64 56, !12, i64 64}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"gtoken_s", !8, i64 0, !8, i64 4, !8, i64 8, !8, i64 12, !8, i64 16, !8, i64 20, !8, i64 24, !8, i64 28, !12, i64 32}
!12 = !{!"any pointer", !9, i64 0}
!13 = !{!"_Bool", !9, i64 0}
!14 = !{!"short", !9, i64 0}
!15 = !{!16, !17, i64 0}
!16 = !{!"", !17, i64 0, !17, i64 8, !12, i64 16}
!17 = !{!"long", !9, i64 0}
!18 = !{!16, !12, i64 16}
!19 = !{!20, !12, i64 80}
!20 = !{!"", !7, i64 0, !12, i64 72, !12, i64 80, !12, i64 88, !12, i64 96, !8, i64 104, !14, i64 108, !13, i64 110, !13, i64 111, !12, i64 112}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!12, !12, i64 0}
!24 = !{!25, !12, i64 0}
!25 = !{!"", !12, i64 0, !8, i64 8, !8, i64 12, !13, i64 16}
!26 = !{!25, !8, i64 8}
!27 = !{!20, !14, i64 108}
!28 = !{!25, !8, i64 12}
!29 = !{!25, !13, i64 16}
!30 = !{!16, !17, i64 8}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass