; 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_info = type { ptr, ptr, ptr, ptr, ptr, ptr, i32 }
%struct.mln_pg_rule_s = type { ptr, ptr, ptr, i32 }
%struct.mln_pg_token_s = type { ptr, ptr, ptr, ptr, ptr, i32, i8 }

; 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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @mln_pg_calc_follow(ptr noundef %0, ptr noundef %1, i32 noundef %2) #2 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca %struct.mln_pg_info, align 8
  %17 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  store i32 1, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 56, ptr %16) #3
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %18

18:                                               ; preds = %27, %3
  %19 = load i32, ptr %8, align 4, !tbaa !9
  %20 = load i32, ptr %7, align 4, !tbaa !9
  %21 = icmp ult i32 %19, %20
  br i1 %21, label %22, label %30

22:                                               ; preds = %18
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = load i32, ptr %8, align 4, !tbaa !9
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds i32, ptr %23, i64 %25
  store volatile i32 1, ptr %26, align 4, !tbaa !9
  br label %27

27:                                               ; preds = %22
  %28 = load i32, ptr %8, align 4, !tbaa !9
  %29 = add nsw i32 %28, 1
  store i32 %29, ptr %8, align 4, !tbaa !9
  br label %18, !llvm.loop !11

30:                                               ; preds = %18
  br label %31

31:                                               ; preds = %192, %30
  %32 = load i32, ptr %11, align 4, !tbaa !9
  %33 = icmp ne i32 %32, 0
  br i1 %33, label %34, label %193

34:                                               ; preds = %31
  store i32 0, ptr %11, align 4, !tbaa !9
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %35

35:                                               ; preds = %189, %34
  %36 = load i32, ptr %8, align 4, !tbaa !9
  %37 = load i32, ptr %7, align 4, !tbaa !9
  %38 = icmp ult i32 %36, %37
  br i1 %38, label %39, label %192

39:                                               ; preds = %35
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  %41 = load i32, ptr %8, align 4, !tbaa !9
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds i32, ptr %40, i64 %42
  %44 = load volatile i32, ptr %43, align 4, !tbaa !9
  %45 = icmp eq i32 %44, 0
  br i1 %45, label %46, label %47

46:                                               ; preds = %39
  br label %189

47:                                               ; preds = %39
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = load i32, ptr %8, align 4, !tbaa !9
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds i32, ptr %48, i64 %50
  store volatile i32 0, ptr %51, align 4, !tbaa !9
  %52 = load ptr, ptr %6, align 8, !tbaa !5
  %53 = load i32, ptr %8, align 4, !tbaa !9
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds %struct.mln_pg_rule_s, ptr %52, i64 %54
  store ptr %55, ptr %13, align 8, !tbaa !5
  store i32 1, ptr %12, align 4, !tbaa !9
  %56 = load ptr, ptr %13, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.mln_pg_rule_s, ptr %56, i32 0, i32 3
  %58 = load i32, ptr %57, align 8, !tbaa !13
  %59 = sub i32 %58, 1
  store i32 %59, ptr %9, align 4, !tbaa !9
  br label %60

60:                                               ; preds = %185, %47
  %61 = load i32, ptr %9, align 4, !tbaa !9
  %62 = icmp sge i32 %61, 0
  br i1 %62, label %63, label %188

63:                                               ; preds = %60
  %64 = load ptr, ptr %13, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.mln_pg_rule_s, ptr %64, i32 0, i32 2
  %66 = load ptr, ptr %65, align 8, !tbaa !15
  %67 = load i32, ptr %9, align 4, !tbaa !9
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds ptr, ptr %66, i64 %68
  %70 = load ptr, ptr %69, align 8, !tbaa !5
  store ptr %70, ptr %14, align 8, !tbaa !5
  %71 = load i32, ptr %12, align 4, !tbaa !9
  %72 = icmp ne i32 %71, 0
  br i1 %72, label %73, label %135

73:                                               ; preds = %63
  %74 = load i32, ptr %12, align 4, !tbaa !9
  %75 = load ptr, ptr %13, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.mln_pg_rule_s, ptr %75, i32 0, i32 3
  %77 = load i32, ptr %76, align 8, !tbaa !13
  %78 = load i32, ptr %9, align 4, !tbaa !9
  %79 = sub i32 %77, %78
  %80 = icmp eq i32 %74, %79
  br i1 %80, label %81, label %135

81:                                               ; preds = %73
  %82 = getelementptr inbounds %struct.mln_pg_info, ptr %16, i32 0, i32 0
  store ptr %11, ptr %82, align 8, !tbaa !16
  %83 = load ptr, ptr %5, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.mln_pg_info, ptr %16, i32 0, i32 1
  store ptr %83, ptr %84, align 8, !tbaa !18
  %85 = load ptr, ptr %13, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.mln_pg_info, ptr %16, i32 0, i32 2
  store ptr %85, ptr %86, align 8, !tbaa !19
  %87 = load ptr, ptr %14, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.mln_pg_info, ptr %16, i32 0, i32 3
  store ptr %87, ptr %88, align 8, !tbaa !20
  %89 = load i32, ptr %7, align 4, !tbaa !9
  %90 = getelementptr inbounds %struct.mln_pg_info, ptr %16, i32 0, i32 6
  store i32 %89, ptr %90, align 8, !tbaa !21
  %91 = load ptr, ptr %13, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.mln_pg_rule_s, ptr %91, i32 0, i32 1
  %93 = load ptr, ptr %92, align 8, !tbaa !22
  %94 = getelementptr inbounds %struct.mln_pg_token_s, ptr %93, i32 0, i32 2
  %95 = load ptr, ptr %94, align 8, !tbaa !23
  %96 = call i32 @mln_rbtree_iterate(ptr noundef %95, ptr noundef @mln_pg_calc_follow_rbtree_iterate_handler, ptr noundef %16)
  %97 = icmp slt i32 %96, 0
  br i1 %97, label %98, label %99

98:                                               ; preds = %81
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %194

99:                                               ; preds = %81
  store i32 1, ptr %10, align 4, !tbaa !9
  br label %100

100:                                              ; preds = %131, %99
  %101 = load i32, ptr %10, align 4, !tbaa !9
  %102 = load i32, ptr %12, align 4, !tbaa !9
  %103 = sub nsw i32 %102, 1
  %104 = icmp sle i32 %101, %103
  br i1 %104, label %105, label %134

105:                                              ; preds = %100
  %106 = load ptr, ptr %13, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.mln_pg_rule_s, ptr %106, i32 0, i32 2
  %108 = load ptr, ptr %107, align 8, !tbaa !15
  %109 = load i32, ptr %9, align 4, !tbaa !9
  %110 = load i32, ptr %10, align 4, !tbaa !9
  %111 = add nsw i32 %109, %110
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds ptr, ptr %108, i64 %112
  %114 = load ptr, ptr %113, align 8, !tbaa !5
  store ptr %114, ptr %15, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.mln_pg_info, ptr %16, i32 0, i32 0
  store ptr %11, ptr %115, align 8, !tbaa !16
  %116 = load ptr, ptr %5, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.mln_pg_info, ptr %16, i32 0, i32 1
  store ptr %116, ptr %117, align 8, !tbaa !18
  %118 = load ptr, ptr %13, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.mln_pg_info, ptr %16, i32 0, i32 2
  store ptr %118, ptr %119, align 8, !tbaa !19
  %120 = load ptr, ptr %14, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.mln_pg_info, ptr %16, i32 0, i32 3
  store ptr %120, ptr %121, align 8, !tbaa !20
  %122 = load i32, ptr %7, align 4, !tbaa !9
  %123 = getelementptr inbounds %struct.mln_pg_info, ptr %16, i32 0, i32 6
  store i32 %122, ptr %123, align 8, !tbaa !21
  %124 = load ptr, ptr %15, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.mln_pg_token_s, ptr %124, i32 0, i32 1
  %126 = load ptr, ptr %125, align 8, !tbaa !25
  %127 = call i32 @mln_rbtree_iterate(ptr noundef %126, ptr noundef @mln_pg_calc_follow_rbtree_iterate_handler, ptr noundef %16)
  %128 = icmp slt i32 %127, 0
  br i1 %128, label %129, label %130

129:                                              ; preds = %105
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %194

130:                                              ; preds = %105
  br label %131

131:                                              ; preds = %130
  %132 = load i32, ptr %10, align 4, !tbaa !9
  %133 = add nsw i32 %132, 1
  store i32 %133, ptr %10, align 4, !tbaa !9
  br label %100, !llvm.loop !26

134:                                              ; preds = %100
  br label %171

135:                                              ; preds = %73, %63
  store i32 1, ptr %10, align 4, !tbaa !9
  br label %136

136:                                              ; preds = %167, %135
  %137 = load i32, ptr %10, align 4, !tbaa !9
  %138 = load i32, ptr %12, align 4, !tbaa !9
  %139 = add nsw i32 %138, 1
  %140 = icmp sle i32 %137, %139
  br i1 %140, label %141, label %170

141:                                              ; preds = %136
  %142 = load ptr, ptr %13, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.mln_pg_rule_s, ptr %142, i32 0, i32 2
  %144 = load ptr, ptr %143, align 8, !tbaa !15
  %145 = load i32, ptr %9, align 4, !tbaa !9
  %146 = load i32, ptr %10, align 4, !tbaa !9
  %147 = add nsw i32 %145, %146
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds ptr, ptr %144, i64 %148
  %150 = load ptr, ptr %149, align 8, !tbaa !5
  store ptr %150, ptr %15, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.mln_pg_info, ptr %16, i32 0, i32 0
  store ptr %11, ptr %151, align 8, !tbaa !16
  %152 = load ptr, ptr %5, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.mln_pg_info, ptr %16, i32 0, i32 1
  store ptr %152, ptr %153, align 8, !tbaa !18
  %154 = load ptr, ptr %13, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.mln_pg_info, ptr %16, i32 0, i32 2
  store ptr %154, ptr %155, align 8, !tbaa !19
  %156 = load ptr, ptr %14, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.mln_pg_info, ptr %16, i32 0, i32 3
  store ptr %156, ptr %157, align 8, !tbaa !20
  %158 = load i32, ptr %7, align 4, !tbaa !9
  %159 = getelementptr inbounds %struct.mln_pg_info, ptr %16, i32 0, i32 6
  store i32 %158, ptr %159, align 8, !tbaa !21
  %160 = load ptr, ptr %15, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.mln_pg_token_s, ptr %160, i32 0, i32 1
  %162 = load ptr, ptr %161, align 8, !tbaa !25
  %163 = call i32 @mln_rbtree_iterate(ptr noundef %162, ptr noundef @mln_pg_calc_follow_rbtree_iterate_handler, ptr noundef %16)
  %164 = icmp slt i32 %163, 0
  br i1 %164, label %165, label %166

165:                                              ; preds = %141
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %194

166:                                              ; preds = %141
  br label %167

167:                                              ; preds = %166
  %168 = load i32, ptr %10, align 4, !tbaa !9
  %169 = add nsw i32 %168, 1
  store i32 %169, ptr %10, align 4, !tbaa !9
  br label %136, !llvm.loop !27

170:                                              ; preds = %136
  br label %171

171:                                              ; preds = %170, %134
  %172 = load ptr, ptr %14, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.mln_pg_token_s, ptr %172, i32 0, i32 6
  %174 = load i8, ptr %173, align 4
  %175 = lshr i8 %174, 1
  %176 = and i8 %175, 1
  %177 = zext i8 %176 to i32
  %178 = icmp ne i32 %177, 0
  br i1 %178, label %179, label %182

179:                                              ; preds = %171
  %180 = load i32, ptr %12, align 4, !tbaa !9
  %181 = add nsw i32 %180, 1
  br label %183

182:                                              ; preds = %171
  br label %183

183:                                              ; preds = %182, %179
  %184 = phi i32 [ %181, %179 ], [ 0, %182 ]
  store i32 %184, ptr %12, align 4, !tbaa !9
  br label %185

185:                                              ; preds = %183
  %186 = load i32, ptr %9, align 4, !tbaa !9
  %187 = add nsw i32 %186, -1
  store i32 %187, ptr %9, align 4, !tbaa !9
  br label %60, !llvm.loop !28

188:                                              ; preds = %60
  br label %189

189:                                              ; preds = %188, %46
  %190 = load i32, ptr %8, align 4, !tbaa !9
  %191 = add nsw i32 %190, 1
  store i32 %191, ptr %8, align 4, !tbaa !9
  br label %35, !llvm.loop !29

192:                                              ; preds = %35
  br label %31, !llvm.loop !30

193:                                              ; preds = %31
  store i32 0, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %194

194:                                              ; preds = %193, %165, %129, %98
  call void @llvm.lifetime.end.p0(i64 56, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  %195 = load i32, ptr %4, align 4
  ret i32 %195
}

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

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 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 }

!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 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !10, i64 24}
!14 = !{!"mln_pg_rule_s", !6, i64 0, !6, i64 8, !6, i64 16, !10, i64 24}
!15 = !{!14, !6, i64 16}
!16 = !{!17, !6, i64 0}
!17 = !{!"mln_pg_info", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !10, i64 48}
!18 = !{!17, !6, i64 8}
!19 = !{!17, !6, i64 16}
!20 = !{!17, !6, i64 24}
!21 = !{!17, !10, i64 48}
!22 = !{!14, !6, i64 8}
!23 = !{!24, !6, i64 16}
!24 = !{!"mln_pg_token_s", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !10, i64 40, !10, i64 44, !10, i64 44}
!25 = !{!24, !6, i64 8}
!26 = distinct !{!26, !12}
!27 = distinct !{!27, !12}
!28 = distinct !{!28, !12}
!29 = distinct !{!29, !12}
!30 = distinct !{!30, !12}


; 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.mln_pg_info = type { ptr, ptr, ptr, ptr, ptr, ptr, i32 }
%struct.mln_pg_rule_s = type { ptr, ptr, ptr, i32 }

; 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

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @mln_pg_calc_follow(ptr noundef %0, ptr noundef %1, i32 noundef %2) local_unnamed_addr #2 {
  %4 = alloca i32, align 4
  %5 = alloca %struct.mln_pg_info, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %5) #3
  %.not = icmp eq i32 %2, 0
  br i1 %.not, label %.loopexit62, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %3
  %wide.trip.count = zext i32 %2 to i64
  %xtraiter = and i64 %wide.trip.count, 7
  %6 = icmp ult i32 %2, 8
  br i1 %6, label %.lr.ph85.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %wide.trip.count, 4294967288
  br label %.lr.ph

.lr.ph85.unr-lcssa:                               ; preds = %.lr.ph, %.lr.ph.preheader
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next.7, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph85, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %.lr.ph85.unr-lcssa, %.lr.ph.epil
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.lr.ph.epil ], [ %indvars.iv.unr, %.lr.ph85.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph.epil ], [ 0, %.lr.ph85.unr-lcssa ]
  %7 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv.epil
  store volatile i32 1, ptr %7, align 4, !tbaa !5
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.lr.ph85, label %.lr.ph.epil, !llvm.loop !9

.lr.ph85:                                         ; preds = %.lr.ph.epil, %.lr.ph85.unr-lcssa
  %8 = getelementptr inbounds i8, ptr %5, i64 8
  %9 = getelementptr inbounds i8, ptr %5, i64 16
  %10 = getelementptr inbounds i8, ptr %5, i64 24
  %11 = getelementptr inbounds i8, ptr %5, i64 48
  br i1 %.not, label %.loopexit62, label %.lr.ph83.us.preheader

.lr.ph83.us.preheader:                            ; preds = %.lr.ph85
  %wide.trip.count108 = zext i32 %2 to i64
  br label %.lr.ph83.us

.lr.ph83.us:                                      ; preds = %.lr.ph83.us.preheader, %..loopexit67_crit_edge.us
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %12

12:                                               ; preds = %.lr.ph83.us, %.loopexit65.us
  %indvars.iv105 = phi i64 [ 0, %.lr.ph83.us ], [ %indvars.iv.next106, %.loopexit65.us ]
  %13 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv105
  %14 = load volatile i32, ptr %13, align 4, !tbaa !5
  %15 = icmp eq i32 %14, 0
  br i1 %15, label %.loopexit65.us, label %16

16:                                               ; preds = %12
  store volatile i32 0, ptr %13, align 4, !tbaa !5
  %17 = getelementptr inbounds %struct.mln_pg_rule_s, ptr %1, i64 %indvars.iv105
  %18 = getelementptr inbounds i8, ptr %17, i64 24
  %19 = load i32, ptr %18, align 8, !tbaa !11
  %.05677.us = add i32 %19, -1
  %20 = icmp sgt i32 %.05677.us, -1
  br i1 %20, label %.lr.ph81.us, label %.loopexit65.us

21:                                               ; preds = %.lr.ph81.us, %.loopexit.us
  %indvars.iv102 = phi i64 [ %63, %.lr.ph81.us ], [ %indvars.iv.next103, %.loopexit.us ]
  %.05378.us = phi i32 [ 1, %.lr.ph81.us ], [ %59, %.loopexit.us ]
  %22 = load ptr, ptr %61, align 8, !tbaa !14
  %23 = getelementptr inbounds ptr, ptr %22, i64 %indvars.iv102
  %24 = load ptr, ptr %23, align 8, !tbaa !15
  %.not58.us = icmp eq i32 %.05378.us, 0
  br i1 %.not58.us, label %.lr.ph76.us.preheader, label %25

25:                                               ; preds = %21
  %indvars104 = trunc i64 %indvars.iv102 to i32
  %26 = load i32, ptr %18, align 8, !tbaa !11
  %27 = sub i32 %26, %indvars104
  %28 = icmp eq i32 %.05378.us, %27
  br i1 %28, label %29, label %44

29:                                               ; preds = %25
  store ptr %4, ptr %5, align 8, !tbaa !16
  store ptr %0, ptr %8, align 8, !tbaa !18
  store ptr %17, ptr %9, align 8, !tbaa !19
  store ptr %24, ptr %10, align 8, !tbaa !20
  store i32 %2, ptr %11, align 8, !tbaa !21
  %30 = load ptr, ptr %62, align 8, !tbaa !22
  %31 = getelementptr inbounds i8, ptr %30, i64 16
  %32 = load ptr, ptr %31, align 8, !tbaa !23
  %33 = call i32 @mln_rbtree_iterate(ptr noundef %32, ptr noundef nonnull @mln_pg_calc_follow_rbtree_iterate_handler, ptr noundef nonnull %5) #3
  %34 = icmp slt i32 %33, 0
  br i1 %34, label %.loopexit62, label %.preheader.us

35:                                               ; preds = %.lr.ph73.us
  %indvars.iv.next93 = add nuw nsw i64 %indvars.iv92, 1
  %exitcond96.not = icmp eq i64 %indvars.iv.next93, %wide.trip.count95
  br i1 %exitcond96.not, label %.loopexit.us, label %.lr.ph73.us, !llvm.loop !25

.lr.ph73.us:                                      ; preds = %.lr.ph73.us.preheader, %35
  %indvars.iv92 = phi i64 [ 1, %.lr.ph73.us.preheader ], [ %indvars.iv.next93, %35 ]
  %36 = load ptr, ptr %61, align 8, !tbaa !14
  %37 = getelementptr ptr, ptr %36, i64 %indvars.iv92
  %38 = getelementptr ptr, ptr %37, i64 %indvars.iv102
  %39 = load ptr, ptr %38, align 8, !tbaa !15
  store ptr %4, ptr %5, align 8, !tbaa !16
  store ptr %0, ptr %8, align 8, !tbaa !18
  store ptr %17, ptr %9, align 8, !tbaa !19
  store ptr %24, ptr %10, align 8, !tbaa !20
  store i32 %2, ptr %11, align 8, !tbaa !21
  %40 = getelementptr inbounds i8, ptr %39, i64 8
  %41 = load ptr, ptr %40, align 8, !tbaa !27
  %42 = call i32 @mln_rbtree_iterate(ptr noundef %41, ptr noundef nonnull @mln_pg_calc_follow_rbtree_iterate_handler, ptr noundef nonnull %5) #3
  %43 = icmp slt i32 %42, 0
  br i1 %43, label %.loopexit62, label %35

44:                                               ; preds = %25
  %.not5974.us = icmp slt i32 %.05378.us, 0
  br i1 %.not5974.us, label %.loopexit.us, label %.lr.ph76.us.preheader

.lr.ph76.us.preheader:                            ; preds = %21, %44
  %45 = add nuw i32 %.05378.us, 2
  %wide.trip.count100 = zext i32 %45 to i64
  br label %.lr.ph76.us

46:                                               ; preds = %.lr.ph76.us
  %indvars.iv.next98 = add nuw nsw i64 %indvars.iv97, 1
  %exitcond101 = icmp eq i64 %indvars.iv.next98, %wide.trip.count100
  br i1 %exitcond101, label %.loopexit.us, label %.lr.ph76.us, !llvm.loop !28

.lr.ph76.us:                                      ; preds = %.lr.ph76.us.preheader, %46
  %indvars.iv97 = phi i64 [ 1, %.lr.ph76.us.preheader ], [ %indvars.iv.next98, %46 ]
  %47 = load ptr, ptr %61, align 8, !tbaa !14
  %48 = getelementptr ptr, ptr %47, i64 %indvars.iv97
  %49 = getelementptr ptr, ptr %48, i64 %indvars.iv102
  %50 = load ptr, ptr %49, align 8, !tbaa !15
  store ptr %4, ptr %5, align 8, !tbaa !16
  store ptr %0, ptr %8, align 8, !tbaa !18
  store ptr %17, ptr %9, align 8, !tbaa !19
  store ptr %24, ptr %10, align 8, !tbaa !20
  store i32 %2, ptr %11, align 8, !tbaa !21
  %51 = getelementptr inbounds i8, ptr %50, i64 8
  %52 = load ptr, ptr %51, align 8, !tbaa !27
  %53 = call i32 @mln_rbtree_iterate(ptr noundef %52, ptr noundef nonnull @mln_pg_calc_follow_rbtree_iterate_handler, ptr noundef nonnull %5) #3
  %54 = icmp slt i32 %53, 0
  br i1 %54, label %.loopexit62, label %46

.loopexit.us:                                     ; preds = %35, %46, %.preheader.us, %44
  %55 = getelementptr inbounds i8, ptr %24, i64 44
  %56 = load i8, ptr %55, align 4
  %57 = and i8 %56, 2
  %.not61.us = icmp eq i8 %57, 0
  %58 = add nsw i32 %.05378.us, 1
  %59 = select i1 %.not61.us, i32 0, i32 %58
  %indvars.iv.next103 = add nsw i64 %indvars.iv102, -1
  %60 = icmp sgt i64 %indvars.iv102, 0
  br i1 %60, label %21, label %.loopexit65.us, !llvm.loop !29

.loopexit65.us:                                   ; preds = %.loopexit.us, %16, %12
  %indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1
  %exitcond109.not = icmp eq i64 %indvars.iv.next106, %wide.trip.count108
  br i1 %exitcond109.not, label %..loopexit67_crit_edge.us, label %12, !llvm.loop !30

.preheader.us:                                    ; preds = %29
  %.not60.not71.us = icmp sgt i32 %.05378.us, 1
  br i1 %.not60.not71.us, label %.lr.ph73.us.preheader, label %.loopexit.us

.lr.ph73.us.preheader:                            ; preds = %.preheader.us
  %wide.trip.count95 = zext nneg i32 %.05378.us to i64
  br label %.lr.ph73.us

.lr.ph81.us:                                      ; preds = %16
  %61 = getelementptr inbounds i8, ptr %17, i64 16
  %62 = getelementptr inbounds i8, ptr %17, i64 8
  %63 = zext nneg i32 %.05677.us to i64
  br label %21

..loopexit67_crit_edge.us:                        ; preds = %.loopexit65.us
  %64 = load i32, ptr %4, align 4, !tbaa !5
  %.not.us = icmp eq i32 %64, 0
  br i1 %.not.us, label %.loopexit62, label %.lr.ph83.us, !llvm.loop !31

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader.new ], [ %indvars.iv.next.7, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.7, %.lr.ph ]
  %65 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv
  store volatile i32 1, ptr %65, align 4, !tbaa !5
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %66 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv.next
  store volatile i32 1, ptr %66, align 4, !tbaa !5
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %67 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv.next.1
  store volatile i32 1, ptr %67, align 4, !tbaa !5
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %68 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv.next.2
  store volatile i32 1, ptr %68, align 4, !tbaa !5
  %indvars.iv.next.3 = or disjoint i64 %indvars.iv, 4
  %69 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv.next.3
  store volatile i32 1, ptr %69, align 4, !tbaa !5
  %indvars.iv.next.4 = or disjoint i64 %indvars.iv, 5
  %70 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv.next.4
  store volatile i32 1, ptr %70, align 4, !tbaa !5
  %indvars.iv.next.5 = or disjoint i64 %indvars.iv, 6
  %71 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv.next.5
  store volatile i32 1, ptr %71, align 4, !tbaa !5
  %indvars.iv.next.6 = or disjoint i64 %indvars.iv, 7
  %72 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv.next.6
  store volatile i32 1, ptr %72, align 4, !tbaa !5
  %indvars.iv.next.7 = add nuw nsw i64 %indvars.iv, 8
  %niter.next.7 = add i64 %niter, 8
  %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
  br i1 %niter.ncmp.7, label %.lr.ph85.unr-lcssa, label %.lr.ph, !llvm.loop !32

.loopexit62:                                      ; preds = %..loopexit67_crit_edge.us, %29, %.lr.ph73.us, %.lr.ph76.us, %.lr.ph85, %3
  %.0 = phi i32 [ 0, %3 ], [ 0, %.lr.ph85 ], [ -1, %.lr.ph76.us ], [ -1, %.lr.ph73.us ], [ -1, %29 ], [ 0, %..loopexit67_crit_edge.us ]
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #3
  ret i32 %.0
}

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

attributes #0 = { mustprogress 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 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 }

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.unroll.disable"}
!11 = !{!12, !6, i64 24}
!12 = !{!"mln_pg_rule_s", !13, i64 0, !13, i64 8, !13, i64 16, !6, i64 24}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!12, !13, i64 16}
!15 = !{!13, !13, i64 0}
!16 = !{!17, !13, i64 0}
!17 = !{!"mln_pg_info", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !6, i64 48}
!18 = !{!17, !13, i64 8}
!19 = !{!17, !13, i64 16}
!20 = !{!17, !13, i64 24}
!21 = !{!17, !6, i64 48}
!22 = !{!12, !13, i64 8}
!23 = !{!24, !13, i64 16}
!24 = !{!"mln_pg_token_s", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !6, i64 40, !6, i64 44, !6, i64 44}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!24, !13, i64 8}
!28 = distinct !{!28, !26}
!29 = distinct !{!29, !26}
!30 = distinct !{!30, !26}
!31 = distinct !{!31, !26}
!32 = distinct !{!32, !26}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass