; LLVM IR from Water-Melon/Melon :: src (mln_parser_generator)

; 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.mln_pg_calc_info_s = type { ptr, ptr, ptr, i64, ptr, ptr, i32 }
%struct.mln_pg_state_s = type { i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i64 }
%struct.mln_pg_rule_s = type { ptr, ptr, ptr, i32 }
%struct.mln_pg_item_s = type { ptr, ptr, ptr, ptr, i64, ptr, i32 }
%struct.rbtree_s = type { ptr, ptr, ptr, ptr, ptr, %struct.mln_rbtree_node_s, ptr, ptr, ptr, ptr, ptr, i64, i8 }
%struct.mln_rbtree_node_s = type { ptr, ptr, ptr, ptr, ptr, ptr, i32 }

@.str = external hidden unnamed_addr constant [78 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [12 x i8], align 1
@__FUNCTION__.mln_pg_goto = external hidden unnamed_addr constant [12 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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @mln_pg_item_new() #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @mln_pg_state_new() #1

; Function Attrs: nounwind uwtable
declare dso_local void @mln_pg_state_free(ptr noundef) #1

declare ptr @mln_rbtree_search(ptr noundef, ptr noundef) #2

declare ptr @mln_rbtree_node_new(ptr noundef, ptr noundef) #2

declare void @_mln_sys_log(i32 noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, ...) #2

declare void @mln_rbtree_insert(ptr noundef, ptr noundef) #2

declare i32 @mln_rbtree_iterate(ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @mln_pg_closure(ptr noundef, ptr noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare hidden void @mln_item_chain_add(ptr noundef, ptr noundef, ptr noundef) #1

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

24:                                               ; preds = %1
  call void (i32, ptr, ptr, i32, ptr, ...) @_mln_sys_log(i32 noundef 4, ptr noundef @.str, ptr noundef @__FUNCTION__.mln_pg_goto, i32 noundef 638, ptr noundef @.str.1)
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %17, align 4
  br label %358

25:                                               ; preds = %1
  %26 = load ptr, ptr %3, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.mln_pg_calc_info_s, ptr %26, i32 0, i32 3
  %28 = load i64, ptr %27, align 8, !tbaa !13
  %29 = add nsw i64 %28, 1
  store i64 %29, ptr %27, align 8, !tbaa !13
  %30 = load ptr, ptr %16, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.mln_pg_state_s, ptr %30, i32 0, i32 0
  store i64 %28, ptr %31, align 8, !tbaa !14
  %32 = load ptr, ptr %3, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.mln_pg_calc_info_s, ptr %32, i32 0, i32 4
  %34 = load ptr, ptr %33, align 8, !tbaa !16
  %35 = load ptr, ptr %16, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.mln_pg_state_s, ptr %35, i32 0, i32 1
  store ptr %34, ptr %36, align 8, !tbaa !17
  %37 = call ptr @mln_pg_item_new()
  store ptr %37, ptr %13, align 8, !tbaa !5
  %38 = load ptr, ptr %13, align 8, !tbaa !5
  %39 = icmp eq ptr %38, null
  br i1 %39, label %40, label %42

40:                                               ; preds = %25
  call void (i32, ptr, ptr, i32, ptr, ...) @_mln_sys_log(i32 noundef 4, ptr noundef @.str, ptr noundef @__FUNCTION__.mln_pg_goto, i32 noundef 645, ptr noundef @.str.1)
  %41 = load ptr, ptr %16, align 8, !tbaa !5
  call void @mln_pg_state_free(ptr noundef %41)
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %17, align 4
  br label %358

42:                                               ; preds = %25
  %43 = load ptr, ptr %3, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.mln_pg_calc_info_s, ptr %43, i32 0, i32 5
  %45 = load ptr, ptr %44, align 8, !tbaa !18
  %46 = getelementptr inbounds %struct.mln_pg_rule_s, ptr %45, i64 0
  %47 = load ptr, ptr %13, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.mln_pg_item_s, ptr %47, i32 0, i32 5
  store ptr %46, ptr %48, align 8, !tbaa !19
  %49 = load ptr, ptr %16, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.mln_pg_state_s, ptr %49, i32 0, i32 2
  %51 = load ptr, ptr %16, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.mln_pg_state_s, ptr %51, i32 0, i32 3
  %53 = load ptr, ptr %13, align 8, !tbaa !5
  call void @mln_item_chain_add(ptr noundef %50, ptr noundef %52, ptr noundef %53)
  %54 = load ptr, ptr %16, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.mln_pg_state_s, ptr %54, i32 0, i32 8
  %56 = load i64, ptr %55, align 8, !tbaa !21
  %57 = add i64 %56, 1
  store i64 %57, ptr %55, align 8, !tbaa !21
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  %59 = load ptr, ptr %16, align 8, !tbaa !5
  %60 = call ptr @mln_rbtree_node_new(ptr noundef %58, ptr noundef %59)
  store ptr %60, ptr %5, align 8, !tbaa !5
  %61 = icmp eq ptr %60, null
  br i1 %61, label %62, label %64

62:                                               ; preds = %42
  call void (i32, ptr, ptr, i32, ptr, ...) @_mln_sys_log(i32 noundef 4, ptr noundef @.str, ptr noundef @__FUNCTION__.mln_pg_goto, i32 noundef 653, ptr noundef @.str.1)
  %63 = load ptr, ptr %16, align 8, !tbaa !5
  call void @mln_pg_state_free(ptr noundef %63)
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %17, align 4
  br label %358

64:                                               ; preds = %42
  %65 = load ptr, ptr %4, align 8, !tbaa !5
  %66 = load ptr, ptr %5, align 8, !tbaa !5
  call void @mln_rbtree_insert(ptr noundef %65, ptr noundef %66)
  %67 = load ptr, ptr %3, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.mln_pg_calc_info_s, ptr %67, i32 0, i32 1
  %69 = load ptr, ptr %3, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.mln_pg_calc_info_s, ptr %69, i32 0, i32 2
  %71 = load ptr, ptr %16, align 8, !tbaa !5
  call void @mln_state_chain_add(ptr noundef %68, ptr noundef %70, ptr noundef %71)
  %72 = load ptr, ptr %16, align 8, !tbaa !5
  call void @mln_pg_state_enqueue(ptr noundef %14, ptr noundef %15, ptr noundef %72)
  %73 = load ptr, ptr %16, align 8, !tbaa !5
  %74 = load ptr, ptr %3, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.mln_pg_calc_info_s, ptr %74, i32 0, i32 5
  %76 = load ptr, ptr %75, align 8, !tbaa !18
  %77 = load ptr, ptr %3, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.mln_pg_calc_info_s, ptr %77, i32 0, i32 6
  %79 = load i32, ptr %78, align 8, !tbaa !22
  %80 = call i32 @mln_pg_closure(ptr noundef %73, ptr noundef %76, i32 noundef %79)
  %81 = icmp slt i32 %80, 0
  br i1 %81, label %82, label %83

82:                                               ; preds = %64
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %17, align 4
  br label %358

83:                                               ; preds = %64
  br label %84

84:                                               ; preds = %352, %83
  %85 = call ptr @mln_pg_state_dequeue(ptr noundef %14, ptr noundef %15)
  store ptr %85, ptr %16, align 8, !tbaa !5
  %86 = icmp ne ptr %85, null
  br i1 %86, label %87, label %353

87:                                               ; preds = %84
  %88 = load ptr, ptr %16, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.mln_pg_state_s, ptr %88, i32 0, i32 2
  %90 = load ptr, ptr %89, align 8, !tbaa !23
  store ptr %90, ptr %11, align 8, !tbaa !5
  br label %91

91:                                               ; preds = %348, %87
  %92 = load ptr, ptr %11, align 8, !tbaa !5
  %93 = icmp ne ptr %92, null
  br i1 %93, label %94, label %352

94:                                               ; preds = %91
  %95 = load ptr, ptr %11, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.mln_pg_item_s, ptr %95, i32 0, i32 5
  %97 = load ptr, ptr %96, align 8, !tbaa !19
  %98 = getelementptr inbounds %struct.mln_pg_rule_s, ptr %97, i32 0, i32 3
  %99 = load i32, ptr %98, align 8, !tbaa !24
  %100 = load ptr, ptr %11, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.mln_pg_item_s, ptr %100, i32 0, i32 6
  %102 = load i32, ptr %101, align 8, !tbaa !26
  %103 = icmp eq i32 %99, %102
  br i1 %103, label %104, label %105

104:                                              ; preds = %94
  br label %348

105:                                              ; preds = %94
  store i32 0, ptr %7, align 4, !tbaa !27
  store i32 0, ptr %6, align 4, !tbaa !27
  %106 = load ptr, ptr %11, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.mln_pg_item_s, ptr %106, i32 0, i32 5
  %108 = load ptr, ptr %107, align 8, !tbaa !19
  %109 = getelementptr inbounds %struct.mln_pg_rule_s, ptr %108, i32 0, i32 2
  %110 = load ptr, ptr %109, align 8, !tbaa !28
  %111 = load ptr, ptr %11, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.mln_pg_item_s, ptr %111, i32 0, i32 6
  %113 = load i32, ptr %112, align 8, !tbaa !26
  %114 = zext i32 %113 to i64
  %115 = getelementptr inbounds ptr, ptr %110, i64 %114
  %116 = load ptr, ptr %115, align 8, !tbaa !5
  store ptr %116, ptr %8, align 8, !tbaa !5
  %117 = load ptr, ptr %11, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.mln_pg_item_s, ptr %117, i32 0, i32 0
  %119 = load ptr, ptr %118, align 8, !tbaa !29
  store ptr %119, ptr %12, align 8, !tbaa !5
  br label %120

120:                                              ; preds = %154, %105
  %121 = load ptr, ptr %12, align 8, !tbaa !5
  %122 = icmp ne ptr %121, null
  br i1 %122, label %123, label %158

123:                                              ; preds = %120
  %124 = load i32, ptr %7, align 4, !tbaa !27
  %125 = add i32 %124, 1
  store i32 %125, ptr %7, align 4, !tbaa !27
  %126 = load ptr, ptr %12, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.mln_pg_item_s, ptr %126, i32 0, i32 5
  %128 = load ptr, ptr %127, align 8, !tbaa !19
  %129 = getelementptr inbounds %struct.mln_pg_rule_s, ptr %128, i32 0, i32 3
  %130 = load i32, ptr %129, align 8, !tbaa !24
  %131 = load ptr, ptr %12, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.mln_pg_item_s, ptr %131, i32 0, i32 6
  %133 = load i32, ptr %132, align 8, !tbaa !26
  %134 = icmp eq i32 %130, %133
  br i1 %134, label %135, label %138

135:                                              ; preds = %123
  %136 = load i32, ptr %6, align 4, !tbaa !27
  %137 = add i32 %136, 1
  store i32 %137, ptr %6, align 4, !tbaa !27
  br label %154

138:                                              ; preds = %123
  %139 = load ptr, ptr %12, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.mln_pg_item_s, ptr %139, i32 0, i32 5
  %141 = load ptr, ptr %140, align 8, !tbaa !19
  %142 = getelementptr inbounds %struct.mln_pg_rule_s, ptr %141, i32 0, i32 2
  %143 = load ptr, ptr %142, align 8, !tbaa !28
  %144 = load ptr, ptr %12, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.mln_pg_item_s, ptr %144, i32 0, i32 6
  %146 = load i32, ptr %145, align 8, !tbaa !26
  %147 = zext i32 %146 to i64
  %148 = getelementptr inbounds ptr, ptr %143, i64 %147
  %149 = load ptr, ptr %148, align 8, !tbaa !5
  %150 = load ptr, ptr %8, align 8, !tbaa !5
  %151 = icmp eq ptr %149, %150
  br i1 %151, label %152, label %153

152:                                              ; preds = %138
  br label %158

153:                                              ; preds = %138
  br label %154

154:                                              ; preds = %153, %135
  %155 = load ptr, ptr %12, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.mln_pg_item_s, ptr %155, i32 0, i32 0
  %157 = load ptr, ptr %156, align 8, !tbaa !29
  store ptr %157, ptr %12, align 8, !tbaa !5
  br label %120, !llvm.loop !30

158:                                              ; preds = %152, %120
  %159 = load ptr, ptr %12, align 8, !tbaa !5
  %160 = icmp ne ptr %159, null
  br i1 %160, label %168, label %161

161:                                              ; preds = %158
  %162 = load i32, ptr %6, align 4, !tbaa !27
  %163 = load i32, ptr %7, align 4, !tbaa !27
  %164 = icmp eq i32 %162, %163
  br i1 %164, label %165, label %169

165:                                              ; preds = %161
  %166 = load i32, ptr %6, align 4, !tbaa !27
  %167 = icmp ne i32 %166, 0
  br i1 %167, label %168, label %169

168:                                              ; preds = %165, %158
  br label %348

169:                                              ; preds = %165, %161
  %170 = call ptr @mln_pg_state_new()
  store ptr %170, ptr %9, align 8, !tbaa !5
  %171 = load ptr, ptr %9, align 8, !tbaa !5
  %172 = icmp eq ptr %171, null
  br i1 %172, label %173, label %174

173:                                              ; preds = %169
  call void (i32, ptr, ptr, i32, ptr, ...) @_mln_sys_log(i32 noundef 4, ptr noundef @.str, ptr noundef @__FUNCTION__.mln_pg_goto, i32 noundef 685, ptr noundef @.str.1)
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %17, align 4
  br label %358

174:                                              ; preds = %169
  %175 = load ptr, ptr %8, align 8, !tbaa !5
  %176 = load ptr, ptr %9, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.mln_pg_state_s, ptr %176, i32 0, i32 1
  store ptr %175, ptr %177, align 8, !tbaa !17
  %178 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %178, ptr %12, align 8, !tbaa !5
  br label %179

179:                                              ; preds = %247, %174
  %180 = load ptr, ptr %12, align 8, !tbaa !5
  %181 = icmp ne ptr %180, null
  br i1 %181, label %182, label %251

182:                                              ; preds = %179
  %183 = load ptr, ptr %12, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.mln_pg_item_s, ptr %183, i32 0, i32 5
  %185 = load ptr, ptr %184, align 8, !tbaa !19
  %186 = getelementptr inbounds %struct.mln_pg_rule_s, ptr %185, i32 0, i32 3
  %187 = load i32, ptr %186, align 8, !tbaa !24
  %188 = load ptr, ptr %12, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.mln_pg_item_s, ptr %188, i32 0, i32 6
  %190 = load i32, ptr %189, align 8, !tbaa !26
  %191 = icmp eq i32 %187, %190
  br i1 %191, label %192, label %193

192:                                              ; preds = %182
  br label %247

193:                                              ; preds = %182
  %194 = load ptr, ptr %12, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.mln_pg_item_s, ptr %194, i32 0, i32 5
  %196 = load ptr, ptr %195, align 8, !tbaa !19
  %197 = getelementptr inbounds %struct.mln_pg_rule_s, ptr %196, i32 0, i32 2
  %198 = load ptr, ptr %197, align 8, !tbaa !28
  %199 = load ptr, ptr %12, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.mln_pg_item_s, ptr %199, i32 0, i32 6
  %201 = load i32, ptr %200, align 8, !tbaa !26
  %202 = zext i32 %201 to i64
  %203 = getelementptr inbounds ptr, ptr %198, i64 %202
  %204 = load ptr, ptr %203, align 8, !tbaa !5
  %205 = load ptr, ptr %8, align 8, !tbaa !5
  %206 = icmp ne ptr %204, %205
  br i1 %206, label %207, label %208

207:                                              ; preds = %193
  br label %247

208:                                              ; preds = %193
  %209 = call ptr @mln_pg_item_new()
  store ptr %209, ptr %13, align 8, !tbaa !5
  %210 = load ptr, ptr %13, align 8, !tbaa !5
  %211 = icmp eq ptr %210, null
  br i1 %211, label %212, label %214

212:                                              ; preds = %208
  call void (i32, ptr, ptr, i32, ptr, ...) @_mln_sys_log(i32 noundef 4, ptr noundef @.str, ptr noundef @__FUNCTION__.mln_pg_goto, i32 noundef 694, ptr noundef @.str.1)
  %213 = load ptr, ptr %9, align 8, !tbaa !5
  call void @mln_pg_state_free(ptr noundef %213)
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %17, align 4
  br label %358

214:                                              ; preds = %208
  %215 = load ptr, ptr %9, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct.mln_pg_state_s, ptr %215, i32 0, i32 8
  %217 = load i64, ptr %216, align 8, !tbaa !21
  %218 = add i64 %217, 1
  store i64 %218, ptr %216, align 8, !tbaa !21
  %219 = load ptr, ptr %9, align 8, !tbaa !5
  %220 = getelementptr inbounds %struct.mln_pg_state_s, ptr %219, i32 0, i32 2
  %221 = load ptr, ptr %9, align 8, !tbaa !5
  %222 = getelementptr inbounds %struct.mln_pg_state_s, ptr %221, i32 0, i32 3
  %223 = load ptr, ptr %13, align 8, !tbaa !5
  call void @mln_item_chain_add(ptr noundef %220, ptr noundef %222, ptr noundef %223)
  %224 = load ptr, ptr %8, align 8, !tbaa !5
  %225 = load ptr, ptr %12, align 8, !tbaa !5
  %226 = getelementptr inbounds %struct.mln_pg_item_s, ptr %225, i32 0, i32 3
  store ptr %224, ptr %226, align 8, !tbaa !32
  %227 = load ptr, ptr %12, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct.mln_pg_item_s, ptr %227, i32 0, i32 5
  %229 = load ptr, ptr %228, align 8, !tbaa !19
  %230 = load ptr, ptr %13, align 8, !tbaa !5
  %231 = getelementptr inbounds %struct.mln_pg_item_s, ptr %230, i32 0, i32 5
  store ptr %229, ptr %231, align 8, !tbaa !19
  %232 = load ptr, ptr %12, align 8, !tbaa !5
  %233 = getelementptr inbounds %struct.mln_pg_item_s, ptr %232, i32 0, i32 6
  %234 = load i32, ptr %233, align 8, !tbaa !26
  %235 = add i32 %234, 1
  %236 = load ptr, ptr %13, align 8, !tbaa !5
  %237 = getelementptr inbounds %struct.mln_pg_item_s, ptr %236, i32 0, i32 6
  store i32 %235, ptr %237, align 8, !tbaa !26
  %238 = load ptr, ptr %12, align 8, !tbaa !5
  %239 = getelementptr inbounds %struct.mln_pg_item_s, ptr %238, i32 0, i32 2
  %240 = load ptr, ptr %239, align 8, !tbaa !33
  %241 = load ptr, ptr %13, align 8, !tbaa !5
  %242 = call i32 @mln_rbtree_iterate(ptr noundef %240, ptr noundef @mln_pg_goto_iterate_handler, ptr noundef %241)
  %243 = icmp slt i32 %242, 0
  br i1 %243, label %244, label %246

244:                                              ; preds = %214
  %245 = load ptr, ptr %9, align 8, !tbaa !5
  call void @mln_pg_state_free(ptr noundef %245)
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %17, align 4
  br label %358

246:                                              ; preds = %214
  br label %247

247:                                              ; preds = %246, %207, %192
  %248 = load ptr, ptr %12, align 8, !tbaa !5
  %249 = getelementptr inbounds %struct.mln_pg_item_s, ptr %248, i32 0, i32 1
  %250 = load ptr, ptr %249, align 8, !tbaa !34
  store ptr %250, ptr %12, align 8, !tbaa !5
  br label %179, !llvm.loop !35

251:                                              ; preds = %179
  %252 = load ptr, ptr %9, align 8, !tbaa !5
  %253 = load ptr, ptr %3, align 8, !tbaa !5
  %254 = getelementptr inbounds %struct.mln_pg_calc_info_s, ptr %253, i32 0, i32 5
  %255 = load ptr, ptr %254, align 8, !tbaa !18
  %256 = load ptr, ptr %3, align 8, !tbaa !5
  %257 = getelementptr inbounds %struct.mln_pg_calc_info_s, ptr %256, i32 0, i32 6
  %258 = load i32, ptr %257, align 8, !tbaa !22
  %259 = call i32 @mln_pg_closure(ptr noundef %252, ptr noundef %255, i32 noundef %258)
  %260 = icmp slt i32 %259, 0
  br i1 %260, label %261, label %263

261:                                              ; preds = %251
  %262 = load ptr, ptr %9, align 8, !tbaa !5
  call void @mln_pg_state_free(ptr noundef %262)
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %17, align 4
  br label %358

263:                                              ; preds = %251
  %264 = load ptr, ptr %4, align 8, !tbaa !5
  %265 = load ptr, ptr %9, align 8, !tbaa !5
  %266 = call ptr @mln_rbtree_search(ptr noundef %264, ptr noundef %265)
  store ptr %266, ptr %5, align 8, !tbaa !5
  %267 = load ptr, ptr %5, align 8, !tbaa !5
  %268 = load ptr, ptr %4, align 8, !tbaa !5
  %269 = getelementptr inbounds %struct.rbtree_s, ptr %268, i32 0, i32 5
  %270 = icmp eq ptr %267, %269
  br i1 %270, label %284, label %271

271:                                              ; preds = %263
  %272 = load ptr, ptr %5, align 8, !tbaa !5
  %273 = getelementptr inbounds %struct.mln_rbtree_node_s, ptr %272, i32 0, i32 0
  %274 = load ptr, ptr %273, align 8, !tbaa !36
  store ptr %274, ptr %10, align 8, !tbaa !5
  %275 = load ptr, ptr %10, align 8, !tbaa !5
  %276 = load ptr, ptr %9, align 8, !tbaa !5
  %277 = call i32 @mln_pg_state_duplicate(ptr noundef %14, ptr noundef %15, ptr noundef %275, ptr noundef %276)
  %278 = icmp slt i32 %277, 0
  br i1 %278, label %279, label %281

279:                                              ; preds = %271
  %280 = load ptr, ptr %9, align 8, !tbaa !5
  call void @mln_pg_state_free(ptr noundef %280)
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %17, align 4
  br label %358

281:                                              ; preds = %271
  %282 = load ptr, ptr %9, align 8, !tbaa !5
  call void @mln_pg_state_free(ptr noundef %282)
  %283 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %283, ptr %9, align 8, !tbaa !5
  br label %306

284:                                              ; preds = %263
  %285 = load ptr, ptr %3, align 8, !tbaa !5
  %286 = getelementptr inbounds %struct.mln_pg_calc_info_s, ptr %285, i32 0, i32 3
  %287 = load i64, ptr %286, align 8, !tbaa !13
  %288 = add nsw i64 %287, 1
  store i64 %288, ptr %286, align 8, !tbaa !13
  %289 = load ptr, ptr %9, align 8, !tbaa !5
  %290 = getelementptr inbounds %struct.mln_pg_state_s, ptr %289, i32 0, i32 0
  store i64 %287, ptr %290, align 8, !tbaa !14
  %291 = load ptr, ptr %4, align 8, !tbaa !5
  %292 = load ptr, ptr %9, align 8, !tbaa !5
  %293 = call ptr @mln_rbtree_node_new(ptr noundef %291, ptr noundef %292)
  store ptr %293, ptr %5, align 8, !tbaa !5
  %294 = icmp eq ptr %293, null
  br i1 %294, label %295, label %297

295:                                              ; preds = %284
  call void (i32, ptr, ptr, i32, ptr, ...) @_mln_sys_log(i32 noundef 4, ptr noundef @.str, ptr noundef @__FUNCTION__.mln_pg_goto, i32 noundef 729, ptr noundef @.str.1)
  %296 = load ptr, ptr %9, align 8, !tbaa !5
  call void @mln_pg_state_free(ptr noundef %296)
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %17, align 4
  br label %358

297:                                              ; preds = %284
  %298 = load ptr, ptr %4, align 8, !tbaa !5
  %299 = load ptr, ptr %5, align 8, !tbaa !5
  call void @mln_rbtree_insert(ptr noundef %298, ptr noundef %299)
  %300 = load ptr, ptr %3, align 8, !tbaa !5
  %301 = getelementptr inbounds %struct.mln_pg_calc_info_s, ptr %300, i32 0, i32 1
  %302 = load ptr, ptr %3, align 8, !tbaa !5
  %303 = getelementptr inbounds %struct.mln_pg_calc_info_s, ptr %302, i32 0, i32 2
  %304 = load ptr, ptr %9, align 8, !tbaa !5
  call void @mln_state_chain_add(ptr noundef %301, ptr noundef %303, ptr noundef %304)
  %305 = load ptr, ptr %9, align 8, !tbaa !5
  call void @mln_pg_state_enqueue(ptr noundef %14, ptr noundef %15, ptr noundef %305)
  br label %306

306:                                              ; preds = %297, %281
  %307 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %307, ptr %12, align 8, !tbaa !5
  br label %308

308:                                              ; preds = %343, %306
  %309 = load ptr, ptr %12, align 8, !tbaa !5
  %310 = icmp ne ptr %309, null
  br i1 %310, label %311, label %347

311:                                              ; preds = %308
  %312 = load ptr, ptr %12, align 8, !tbaa !5
  %313 = getelementptr inbounds %struct.mln_pg_item_s, ptr %312, i32 0, i32 5
  %314 = load ptr, ptr %313, align 8, !tbaa !19
  %315 = getelementptr inbounds %struct.mln_pg_rule_s, ptr %314, i32 0, i32 3
  %316 = load i32, ptr %315, align 8, !tbaa !24
  %317 = load ptr, ptr %12, align 8, !tbaa !5
  %318 = getelementptr inbounds %struct.mln_pg_item_s, ptr %317, i32 0, i32 6
  %319 = load i32, ptr %318, align 8, !tbaa !26
  %320 = icmp eq i32 %316, %319
  br i1 %320, label %321, label %322

321:                                              ; preds = %311
  br label %343

322:                                              ; preds = %311
  %323 = load ptr, ptr %12, align 8, !tbaa !5
  %324 = getelementptr inbounds %struct.mln_pg_item_s, ptr %323, i32 0, i32 5
  %325 = load ptr, ptr %324, align 8, !tbaa !19
  %326 = getelementptr inbounds %struct.mln_pg_rule_s, ptr %325, i32 0, i32 2
  %327 = load ptr, ptr %326, align 8, !tbaa !28
  %328 = load ptr, ptr %12, align 8, !tbaa !5
  %329 = getelementptr inbounds %struct.mln_pg_item_s, ptr %328, i32 0, i32 6
  %330 = load i32, ptr %329, align 8, !tbaa !26
  %331 = zext i32 %330 to i64
  %332 = getelementptr inbounds ptr, ptr %327, i64 %331
  %333 = load ptr, ptr %332, align 8, !tbaa !5
  %334 = load ptr, ptr %8, align 8, !tbaa !5
  %335 = icmp eq ptr %333, %334
  br i1 %335, label %336, label %342

336:                                              ; preds = %322
  %337 = load ptr, ptr %9, align 8, !tbaa !5
  %338 = getelementptr inbounds %struct.mln_pg_state_s, ptr %337, i32 0, i32 0
  %339 = load i64, ptr %338, align 8, !tbaa !14
  %340 = load ptr, ptr %12, align 8, !tbaa !5
  %341 = getelementptr inbounds %struct.mln_pg_item_s, ptr %340, i32 0, i32 4
  store i64 %339, ptr %341, align 8, !tbaa !38
  br label %342

342:                                              ; preds = %336, %322
  br label %343

343:                                              ; preds = %342, %321
  %344 = load ptr, ptr %12, align 8, !tbaa !5
  %345 = getelementptr inbounds %struct.mln_pg_item_s, ptr %344, i32 0, i32 1
  %346 = load ptr, ptr %345, align 8, !tbaa !34
  store ptr %346, ptr %12, align 8, !tbaa !5
  br label %308, !llvm.loop !39

347:                                              ; preds = %308
  br label %348

348:                                              ; preds = %347, %168, %104
  %349 = load ptr, ptr %11, align 8, !tbaa !5
  %350 = getelementptr inbounds %struct.mln_pg_item_s, ptr %349, i32 0, i32 1
  %351 = load ptr, ptr %350, align 8, !tbaa !34
  store ptr %351, ptr %11, align 8, !tbaa !5
  br label %91, !llvm.loop !40

352:                                              ; preds = %91
  br label %84, !llvm.loop !41

353:                                              ; preds = %84
  %354 = load ptr, ptr %3, align 8, !tbaa !5
  %355 = getelementptr inbounds %struct.mln_pg_calc_info_s, ptr %354, i32 0, i32 1
  %356 = load ptr, ptr %355, align 8, !tbaa !42
  %357 = getelementptr inbounds %struct.mln_pg_state_s, ptr %356, i32 0, i32 1
  store ptr null, ptr %357, align 8, !tbaa !17
  store i32 0, ptr %2, align 4
  store i32 1, ptr %17, align 4
  br label %358

358:                                              ; preds = %353, %295, %279, %261, %244, %212, %173, %82, %62, %40, %24
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  %359 = load i32, ptr %2, align 4
  ret i32 %359
}

; Function Attrs: nounwind uwtable
declare hidden void @mln_state_chain_add(ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @mln_pg_state_enqueue(ptr noundef, ptr noundef, ptr noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @mln_pg_state_dequeue(ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden i32 @mln_pg_goto_iterate_handler(ptr noundef, ptr noundef) #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @mln_pg_state_duplicate(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #4 = { 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, !6, i64 0}
!10 = !{!"mln_pg_calc_info_s", !6, i64 0, !6, i64 8, !6, i64 16, !11, i64 24, !6, i64 32, !6, i64 40, !12, i64 48}
!11 = !{!"long", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!10, !11, i64 24}
!14 = !{!15, !11, i64 0}
!15 = !{!"mln_pg_state_s", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !11, i64 64}
!16 = !{!10, !6, i64 32}
!17 = !{!15, !6, i64 8}
!18 = !{!10, !6, i64 40}
!19 = !{!20, !6, i64 40}
!20 = !{!"mln_pg_item_s", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !11, i64 32, !6, i64 40, !12, i64 48}
!21 = !{!15, !11, i64 64}
!22 = !{!10, !12, i64 48}
!23 = !{!15, !6, i64 16}
!24 = !{!25, !12, i64 24}
!25 = !{!"mln_pg_rule_s", !6, i64 0, !6, i64 8, !6, i64 16, !12, i64 24}
!26 = !{!20, !12, i64 48}
!27 = !{!12, !12, i64 0}
!28 = !{!25, !6, i64 16}
!29 = !{!20, !6, i64 0}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}
!32 = !{!20, !6, i64 24}
!33 = !{!20, !6, i64 16}
!34 = !{!20, !6, i64 8}
!35 = distinct !{!35, !31}
!36 = !{!37, !6, i64 0}
!37 = !{!"mln_rbtree_node_s", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !12, i64 48, !12, i64 48}
!38 = !{!20, !11, i64 32}
!39 = distinct !{!39, !31}
!40 = distinct !{!40, !31}
!41 = distinct !{!41, !31}
!42 = !{!10, !6, i64 8}


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

@.str = external hidden unnamed_addr constant [78 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [12 x i8], align 1
@__FUNCTION__.mln_pg_goto = external hidden unnamed_addr constant [12 x i8], align 1

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

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @mln_pg_item_new() local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @mln_pg_state_new() local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @mln_pg_state_free(ptr noundef) local_unnamed_addr #1

declare ptr @mln_rbtree_search(ptr noundef, ptr noundef) local_unnamed_addr #2

declare ptr @mln_rbtree_node_new(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @_mln_sys_log(i32 noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #2

declare void @mln_rbtree_insert(ptr noundef, ptr noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @mln_pg_closure(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @mln_item_chain_add(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @mln_pg_goto(ptr noundef %0) local_unnamed_addr #1 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = load ptr, ptr %0, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #4
  store ptr null, ptr %2, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  store ptr null, ptr %3, align 8, !tbaa !12
  %5 = tail call ptr @mln_pg_state_new()
  %6 = icmp eq ptr %5, null
  br i1 %6, label %7, label %8

7:                                                ; preds = %1
  tail call void (i32, ptr, ptr, i32, ptr, ...) @_mln_sys_log(i32 noundef 4, ptr noundef nonnull @.str, ptr noundef nonnull @__FUNCTION__.mln_pg_goto, i32 noundef 638, ptr noundef nonnull @.str.1) #4
  br label %.loopexit187

8:                                                ; preds = %1
  %9 = getelementptr inbounds i8, ptr %0, i64 24
  %10 = load i64, ptr %9, align 8, !tbaa !13
  %11 = add nsw i64 %10, 1
  store i64 %11, ptr %9, align 8, !tbaa !13
  store i64 %10, ptr %5, align 8, !tbaa !14
  %12 = getelementptr inbounds i8, ptr %0, i64 32
  %13 = load ptr, ptr %12, align 8, !tbaa !16
  %14 = getelementptr inbounds i8, ptr %5, i64 8
  store ptr %13, ptr %14, align 8, !tbaa !17
  %15 = tail call ptr @mln_pg_item_new()
  %16 = icmp eq ptr %15, null
  br i1 %16, label %17, label %18

17:                                               ; preds = %8
  tail call void (i32, ptr, ptr, i32, ptr, ...) @_mln_sys_log(i32 noundef 4, ptr noundef nonnull @.str, ptr noundef nonnull @__FUNCTION__.mln_pg_goto, i32 noundef 645, ptr noundef nonnull @.str.1) #4
  tail call void @mln_pg_state_free(ptr noundef nonnull %5)
  br label %.loopexit187

18:                                               ; preds = %8
  %19 = getelementptr inbounds i8, ptr %0, i64 40
  %20 = load ptr, ptr %19, align 8, !tbaa !18
  %21 = getelementptr inbounds i8, ptr %15, i64 40
  store ptr %20, ptr %21, align 8, !tbaa !19
  %22 = getelementptr inbounds i8, ptr %5, i64 16
  %23 = getelementptr inbounds i8, ptr %5, i64 24
  tail call void @mln_item_chain_add(ptr noundef nonnull %22, ptr noundef nonnull %23, ptr noundef nonnull %15)
  %24 = getelementptr inbounds i8, ptr %5, i64 64
  %25 = load i64, ptr %24, align 8, !tbaa !21
  %26 = add i64 %25, 1
  store i64 %26, ptr %24, align 8, !tbaa !21
  %27 = tail call ptr @mln_rbtree_node_new(ptr noundef %4, ptr noundef nonnull %5) #4
  %28 = icmp eq ptr %27, null
  br i1 %28, label %29, label %30

29:                                               ; preds = %18
  tail call void (i32, ptr, ptr, i32, ptr, ...) @_mln_sys_log(i32 noundef 4, ptr noundef nonnull @.str, ptr noundef nonnull @__FUNCTION__.mln_pg_goto, i32 noundef 653, ptr noundef nonnull @.str.1) #4
  tail call void @mln_pg_state_free(ptr noundef nonnull %5)
  br label %.loopexit187

30:                                               ; preds = %18
  tail call void @mln_rbtree_insert(ptr noundef %4, ptr noundef nonnull %27) #4
  %31 = getelementptr inbounds i8, ptr %0, i64 8
  %32 = getelementptr inbounds i8, ptr %0, i64 16
  tail call void @mln_state_chain_add(ptr noundef nonnull %31, ptr noundef nonnull %32, ptr noundef nonnull %5)
  call void @mln_pg_state_enqueue(ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %5)
  %33 = load ptr, ptr %19, align 8, !tbaa !18
  %34 = getelementptr inbounds i8, ptr %0, i64 48
  %35 = load i32, ptr %34, align 8, !tbaa !22
  %36 = call i32 @mln_pg_closure(ptr noundef nonnull %5, ptr noundef %33, i32 noundef %35)
  %37 = icmp slt i32 %36, 0
  br i1 %37, label %.loopexit187, label %.preheader

.preheader:                                       ; preds = %30
  %38 = call ptr @mln_pg_state_dequeue(ptr noundef nonnull %2, ptr noundef nonnull %3)
  %.not159 = icmp eq ptr %38, null
  br i1 %.not159, label %._crit_edge161, label %.lr.ph160

.lr.ph160:                                        ; preds = %.preheader
  %39 = getelementptr inbounds i8, ptr %4, i64 40
  br label %41

.loopexit138:                                     ; preds = %.loopexit, %41
  %40 = call ptr @mln_pg_state_dequeue(ptr noundef nonnull %2, ptr noundef nonnull %3)
  %.not = icmp eq ptr %40, null
  br i1 %.not, label %._crit_edge161, label %41, !llvm.loop !23

41:                                               ; preds = %.lr.ph160, %.loopexit138
  %42 = phi ptr [ %38, %.lr.ph160 ], [ %40, %.loopexit138 ]
  %43 = getelementptr inbounds i8, ptr %42, i64 16
  %.0110154 = load ptr, ptr %43, align 8, !tbaa !12
  %.not130155 = icmp eq ptr %.0110154, null
  br i1 %.not130155, label %.loopexit138, label %.lr.ph158

.lr.ph158:                                        ; preds = %41, %.loopexit
  %.0110156 = phi ptr [ %.0110, %.loopexit ], [ %.0110154, %41 ]
  %44 = getelementptr inbounds i8, ptr %.0110156, i64 40
  %45 = load ptr, ptr %44, align 8, !tbaa !19
  %46 = getelementptr inbounds i8, ptr %45, i64 24
  %47 = load i32, ptr %46, align 8, !tbaa !25
  %48 = getelementptr inbounds i8, ptr %.0110156, i64 48
  %49 = load i32, ptr %48, align 8, !tbaa !27
  %50 = icmp eq i32 %47, %49
  br i1 %50, label %.loopexit, label %51

51:                                               ; preds = %.lr.ph158
  %52 = getelementptr inbounds i8, ptr %45, i64 16
  %53 = load ptr, ptr %52, align 8, !tbaa !28
  %54 = zext i32 %49 to i64
  %55 = getelementptr inbounds ptr, ptr %53, i64 %54
  %56 = load ptr, ptr %55, align 8, !tbaa !12
  %.0146 = load ptr, ptr %.0110156, align 8, !tbaa !29
  %.not131147 = icmp eq ptr %.0146, null
  br i1 %.not131147, label %._crit_edge.thread, label %.lr.ph

.lr.ph:                                           ; preds = %51, %74
  %.0150 = phi ptr [ %.0, %74 ], [ %.0146, %51 ]
  %.0113149 = phi i32 [ %57, %74 ], [ 0, %51 ]
  %.0115148 = phi i32 [ %.1116, %74 ], [ 0, %51 ]
  %57 = add i32 %.0113149, 1
  %58 = getelementptr inbounds i8, ptr %.0150, i64 40
  %59 = load ptr, ptr %58, align 8, !tbaa !19
  %60 = getelementptr inbounds i8, ptr %59, i64 24
  %61 = load i32, ptr %60, align 8, !tbaa !25
  %62 = getelementptr inbounds i8, ptr %.0150, i64 48
  %63 = load i32, ptr %62, align 8, !tbaa !27
  %64 = icmp eq i32 %61, %63
  br i1 %64, label %65, label %67

65:                                               ; preds = %.lr.ph
  %66 = add i32 %.0115148, 1
  br label %74

67:                                               ; preds = %.lr.ph
  %68 = getelementptr inbounds i8, ptr %59, i64 16
  %69 = load ptr, ptr %68, align 8, !tbaa !28
  %70 = zext i32 %63 to i64
  %71 = getelementptr inbounds ptr, ptr %69, i64 %70
  %72 = load ptr, ptr %71, align 8, !tbaa !12
  %73 = icmp eq ptr %72, %56
  br i1 %73, label %.loopexit, label %74

74:                                               ; preds = %67, %65
  %.1116 = phi i32 [ %66, %65 ], [ %.0115148, %67 ]
  %.0 = load ptr, ptr %.0150, align 8, !tbaa !29
  %.not131 = icmp eq ptr %.0, null
  br i1 %.not131, label %._crit_edge, label %.lr.ph, !llvm.loop !30

._crit_edge:                                      ; preds = %74
  %75 = icmp eq i32 %.1116, %57
  %76 = icmp ne i32 %.1116, 0
  %or.cond = and i1 %76, %75
  br i1 %or.cond, label %.loopexit, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %51, %._crit_edge
  %77 = call ptr @mln_pg_state_new()
  %78 = icmp eq ptr %77, null
  br i1 %78, label %79, label %80

79:                                               ; preds = %._crit_edge.thread
  call void (i32, ptr, ptr, i32, ptr, ...) @_mln_sys_log(i32 noundef 4, ptr noundef nonnull @.str, ptr noundef nonnull @__FUNCTION__.mln_pg_goto, i32 noundef 685, ptr noundef nonnull @.str.1) #4
  br label %.loopexit187

80:                                               ; preds = %._crit_edge.thread
  %81 = getelementptr inbounds i8, ptr %77, i64 8
  store ptr %56, ptr %81, align 8, !tbaa !17
  %82 = getelementptr inbounds i8, ptr %77, i64 64
  %83 = getelementptr inbounds i8, ptr %77, i64 16
  %84 = getelementptr inbounds i8, ptr %77, i64 24
  br label %85

85:                                               ; preds = %80, %117
  %.1152 = phi ptr [ %.0110156, %80 ], [ %119, %117 ]
  %86 = getelementptr inbounds i8, ptr %.1152, i64 40
  %87 = load ptr, ptr %86, align 8, !tbaa !19
  %88 = getelementptr inbounds i8, ptr %87, i64 24
  %89 = load i32, ptr %88, align 8, !tbaa !25
  %90 = getelementptr inbounds i8, ptr %.1152, i64 48
  %91 = load i32, ptr %90, align 8, !tbaa !27
  %92 = icmp eq i32 %89, %91
  br i1 %92, label %117, label %93

93:                                               ; preds = %85
  %94 = getelementptr inbounds i8, ptr %87, i64 16
  %95 = load ptr, ptr %94, align 8, !tbaa !28
  %96 = zext i32 %91 to i64
  %97 = getelementptr inbounds ptr, ptr %95, i64 %96
  %98 = load ptr, ptr %97, align 8, !tbaa !12
  %.not134 = icmp eq ptr %98, %56
  br i1 %.not134, label %99, label %117

99:                                               ; preds = %93
  %100 = call ptr @mln_pg_item_new()
  %101 = icmp eq ptr %100, null
  br i1 %101, label %102, label %103

102:                                              ; preds = %99
  call void (i32, ptr, ptr, i32, ptr, ...) @_mln_sys_log(i32 noundef 4, ptr noundef nonnull @.str, ptr noundef nonnull @__FUNCTION__.mln_pg_goto, i32 noundef 694, ptr noundef nonnull @.str.1) #4
  call void @mln_pg_state_free(ptr noundef nonnull %77)
  br label %.loopexit187

103:                                              ; preds = %99
  %104 = load i64, ptr %82, align 8, !tbaa !21
  %105 = add i64 %104, 1
  store i64 %105, ptr %82, align 8, !tbaa !21
  call void @mln_item_chain_add(ptr noundef nonnull %83, ptr noundef nonnull %84, ptr noundef nonnull %100)
  %106 = getelementptr inbounds i8, ptr %.1152, i64 24
  store ptr %56, ptr %106, align 8, !tbaa !31
  %107 = load ptr, ptr %86, align 8, !tbaa !19
  %108 = getelementptr inbounds i8, ptr %100, i64 40
  store ptr %107, ptr %108, align 8, !tbaa !19
  %109 = load i32, ptr %90, align 8, !tbaa !27
  %110 = add i32 %109, 1
  %111 = getelementptr inbounds i8, ptr %100, i64 48
  store i32 %110, ptr %111, align 8, !tbaa !27
  %112 = getelementptr inbounds i8, ptr %.1152, i64 16
  %113 = load ptr, ptr %112, align 8, !tbaa !32
  %114 = call i32 @mln_rbtree_iterate(ptr noundef %113, ptr noundef nonnull @mln_pg_goto_iterate_handler, ptr noundef nonnull %100) #4
  %115 = icmp slt i32 %114, 0
  br i1 %115, label %116, label %117

116:                                              ; preds = %103
  call void @mln_pg_state_free(ptr noundef nonnull %77)
  br label %.loopexit187

117:                                              ; preds = %103, %93, %85
  %118 = getelementptr inbounds i8, ptr %.1152, i64 8
  %119 = load ptr, ptr %118, align 8, !tbaa !33
  %.not132 = icmp eq ptr %119, null
  br i1 %.not132, label %120, label %85, !llvm.loop !34

120:                                              ; preds = %117
  %121 = load ptr, ptr %19, align 8, !tbaa !18
  %122 = load i32, ptr %34, align 8, !tbaa !22
  %123 = call i32 @mln_pg_closure(ptr noundef nonnull %77, ptr noundef %121, i32 noundef %122)
  %124 = icmp slt i32 %123, 0
  br i1 %124, label %125, label %126

125:                                              ; preds = %120
  call void @mln_pg_state_free(ptr noundef nonnull %77)
  br label %.loopexit187

126:                                              ; preds = %120
  %127 = call ptr @mln_rbtree_search(ptr noundef %4, ptr noundef nonnull %77) #4
  %128 = icmp eq ptr %127, %39
  br i1 %128, label %133, label %129

129:                                              ; preds = %126
  %130 = load ptr, ptr %127, align 8, !tbaa !35
  %131 = call i32 @mln_pg_state_duplicate(ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef %130, ptr noundef nonnull %77)
  %132 = icmp slt i32 %131, 0
  call void @mln_pg_state_free(ptr noundef nonnull %77)
  br i1 %132, label %.loopexit187, label %140

133:                                              ; preds = %126
  %134 = load i64, ptr %9, align 8, !tbaa !13
  %135 = add nsw i64 %134, 1
  store i64 %135, ptr %9, align 8, !tbaa !13
  store i64 %134, ptr %77, align 8, !tbaa !14
  %136 = call ptr @mln_rbtree_node_new(ptr noundef %4, ptr noundef nonnull %77) #4
  %137 = icmp eq ptr %136, null
  br i1 %137, label %138, label %139

138:                                              ; preds = %133
  call void (i32, ptr, ptr, i32, ptr, ...) @_mln_sys_log(i32 noundef 4, ptr noundef nonnull @.str, ptr noundef nonnull @__FUNCTION__.mln_pg_goto, i32 noundef 729, ptr noundef nonnull @.str.1) #4
  call void @mln_pg_state_free(ptr noundef nonnull %77)
  br label %.loopexit187

139:                                              ; preds = %133
  call void @mln_rbtree_insert(ptr noundef %4, ptr noundef nonnull %136) #4
  call void @mln_state_chain_add(ptr noundef nonnull %31, ptr noundef nonnull %32, ptr noundef nonnull %77)
  call void @mln_pg_state_enqueue(ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %77)
  br label %140

140:                                              ; preds = %129, %139
  %.0112 = phi ptr [ %77, %139 ], [ %130, %129 ]
  br label %141

141:                                              ; preds = %140, %159
  %.2153 = phi ptr [ %.0110156, %140 ], [ %161, %159 ]
  %142 = getelementptr inbounds i8, ptr %.2153, i64 40
  %143 = load ptr, ptr %142, align 8, !tbaa !19
  %144 = getelementptr inbounds i8, ptr %143, i64 24
  %145 = load i32, ptr %144, align 8, !tbaa !25
  %146 = getelementptr inbounds i8, ptr %.2153, i64 48
  %147 = load i32, ptr %146, align 8, !tbaa !27
  %148 = icmp eq i32 %145, %147
  br i1 %148, label %159, label %149

149:                                              ; preds = %141
  %150 = getelementptr inbounds i8, ptr %143, i64 16
  %151 = load ptr, ptr %150, align 8, !tbaa !28
  %152 = zext i32 %147 to i64
  %153 = getelementptr inbounds ptr, ptr %151, i64 %152
  %154 = load ptr, ptr %153, align 8, !tbaa !12
  %155 = icmp eq ptr %154, %56
  br i1 %155, label %156, label %159

156:                                              ; preds = %149
  %157 = load i64, ptr %.0112, align 8, !tbaa !14
  %158 = getelementptr inbounds i8, ptr %.2153, i64 32
  store i64 %157, ptr %158, align 8, !tbaa !37
  br label %159

159:                                              ; preds = %149, %156, %141
  %160 = getelementptr inbounds i8, ptr %.2153, i64 8
  %161 = load ptr, ptr %160, align 8, !tbaa !33
  %.not133 = icmp eq ptr %161, null
  br i1 %.not133, label %.loopexit, label %141, !llvm.loop !38

.loopexit:                                        ; preds = %67, %159, %._crit_edge, %.lr.ph158
  %162 = getelementptr inbounds i8, ptr %.0110156, i64 8
  %.0110 = load ptr, ptr %162, align 8, !tbaa !12
  %.not130 = icmp eq ptr %.0110, null
  br i1 %.not130, label %.loopexit138, label %.lr.ph158, !llvm.loop !39

._crit_edge161:                                   ; preds = %.loopexit138, %.preheader
  %163 = load ptr, ptr %31, align 8, !tbaa !40
  %164 = getelementptr inbounds i8, ptr %163, i64 8
  store ptr null, ptr %164, align 8, !tbaa !17
  br label %.loopexit187

.loopexit187:                                     ; preds = %129, %30, %._crit_edge161, %138, %125, %116, %102, %79, %29, %17, %7
  %.0111 = phi i32 [ -1, %7 ], [ -1, %17 ], [ -1, %29 ], [ -1, %79 ], [ -1, %102 ], [ -1, %116 ], [ -1, %125 ], [ -1, %138 ], [ 0, %._crit_edge161 ], [ -1, %30 ], [ -1, %129 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  ret i32 %.0111
}

; Function Attrs: nounwind uwtable
declare hidden void @mln_state_chain_add(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @mln_pg_state_enqueue(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @mln_pg_state_dequeue(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden i32 @mln_pg_goto_iterate_handler(ptr noundef, ptr noundef) #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @mln_pg_state_duplicate(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #4 = { 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, !7, i64 0}
!6 = !{!"mln_pg_calc_info_s", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24, !7, i64 32, !7, i64 40, !11, i64 48}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!7, !7, i64 0}
!13 = !{!6, !10, i64 24}
!14 = !{!15, !10, i64 0}
!15 = !{!"mln_pg_state_s", !10, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !10, i64 64}
!16 = !{!6, !7, i64 32}
!17 = !{!15, !7, i64 8}
!18 = !{!6, !7, i64 40}
!19 = !{!20, !7, i64 40}
!20 = !{!"mln_pg_item_s", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !7, i64 40, !11, i64 48}
!21 = !{!15, !10, i64 64}
!22 = !{!6, !11, i64 48}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!26, !11, i64 24}
!26 = !{!"mln_pg_rule_s", !7, i64 0, !7, i64 8, !7, i64 16, !11, i64 24}
!27 = !{!20, !11, i64 48}
!28 = !{!26, !7, i64 16}
!29 = !{!20, !7, i64 0}
!30 = distinct !{!30, !24}
!31 = !{!20, !7, i64 24}
!32 = !{!20, !7, i64 16}
!33 = !{!20, !7, i64 8}
!34 = distinct !{!34, !24}
!35 = !{!36, !7, i64 0}
!36 = !{!"mln_rbtree_node_s", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !11, i64 48, !11, i64 48}
!37 = !{!20, !10, i64 32}
!38 = distinct !{!38, !24}
!39 = distinct !{!39, !24}
!40 = !{!6, !7, i64 8}


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