; 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_state = type { ptr, ptr, ptr, ptr }
%struct.mln_pg_state_s = type { i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i64 }
%struct.mln_pg_item_s = type { ptr, ptr, ptr, ptr, i64, 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 }

@.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_closure = external hidden unnamed_addr constant [15 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

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @mln_pg_closure(ptr noundef %0, ptr noundef %1, i32 noundef %2) #1 {
  %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 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 %struct.mln_pg_state, align 8
  %16 = 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
  store i32 1, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 8, 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 32, ptr %15) #3
  br label %17

17:                                               ; preds = %172, %3
  %18 = load i32, ptr %9, align 4, !tbaa !9
  %19 = icmp ne i32 %18, 0
  br i1 %19, label %20, label %173

20:                                               ; preds = %17
  store i32 0, ptr %9, align 4, !tbaa !9
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.mln_pg_state_s, ptr %21, i32 0, i32 2
  %23 = load ptr, ptr %22, align 8, !tbaa !11
  store ptr %23, ptr %10, align 8, !tbaa !5
  br label %24

24:                                               ; preds = %168, %20
  %25 = load ptr, ptr %10, align 8, !tbaa !5
  %26 = icmp ne ptr %25, null
  br i1 %26, label %27, label %172

27:                                               ; preds = %24
  %28 = load ptr, ptr %10, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.mln_pg_item_s, ptr %28, i32 0, i32 5
  %30 = load ptr, ptr %29, align 8, !tbaa !14
  %31 = getelementptr inbounds %struct.mln_pg_rule_s, ptr %30, i32 0, i32 3
  %32 = load i32, ptr %31, align 8, !tbaa !16
  %33 = load ptr, ptr %10, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.mln_pg_item_s, ptr %33, i32 0, i32 6
  %35 = load i32, ptr %34, align 8, !tbaa !18
  %36 = icmp eq i32 %32, %35
  br i1 %36, label %37, label %38

37:                                               ; preds = %27
  br label %168

38:                                               ; preds = %27
  %39 = load ptr, ptr %10, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.mln_pg_item_s, ptr %39, i32 0, i32 5
  %41 = load ptr, ptr %40, align 8, !tbaa !14
  %42 = getelementptr inbounds %struct.mln_pg_rule_s, ptr %41, i32 0, i32 2
  %43 = load ptr, ptr %42, align 8, !tbaa !19
  %44 = load ptr, ptr %10, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.mln_pg_item_s, ptr %44, i32 0, i32 6
  %46 = load i32, ptr %45, align 8, !tbaa !18
  %47 = zext i32 %46 to i64
  %48 = getelementptr inbounds ptr, ptr %43, i64 %47
  %49 = load ptr, ptr %48, align 8, !tbaa !5
  store ptr %49, ptr %12, align 8, !tbaa !5
  %50 = load ptr, ptr %12, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.mln_pg_token_s, ptr %50, i32 0, i32 6
  %52 = load i8, ptr %51, align 4
  %53 = and i8 %52, 1
  %54 = zext i8 %53 to i32
  %55 = icmp ne i32 %54, 0
  br i1 %55, label %57, label %56

56:                                               ; preds = %38
  br label %168

57:                                               ; preds = %38
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %58

58:                                               ; preds = %164, %57
  %59 = load i32, ptr %8, align 4, !tbaa !9
  %60 = load i32, ptr %7, align 4, !tbaa !9
  %61 = icmp ult i32 %59, %60
  br i1 %61, label %62, label %167

62:                                               ; preds = %58
  %63 = load ptr, ptr %12, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.mln_pg_token_s, ptr %63, i32 0, i32 4
  %65 = load ptr, ptr %64, align 8, !tbaa !20
  %66 = load i32, ptr %8, align 4, !tbaa !9
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds i32, ptr %65, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !9
  %70 = icmp eq i32 %69, 0
  br i1 %70, label %71, label %72

71:                                               ; preds = %62
  br label %164

72:                                               ; preds = %62
  %73 = load ptr, ptr %6, align 8, !tbaa !5
  %74 = load i32, ptr %8, align 4, !tbaa !9
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds %struct.mln_pg_rule_s, ptr %73, i64 %75
  store ptr %76, ptr %14, align 8, !tbaa !5
  %77 = load ptr, ptr %5, align 8, !tbaa !5
  %78 = load ptr, ptr %14, align 8, !tbaa !5
  %79 = call ptr @mln_pg_rule_duplicate(ptr noundef %77, ptr noundef %78, i32 noundef 0)
  store ptr %79, ptr %11, align 8, !tbaa !5
  %80 = load ptr, ptr %11, align 8, !tbaa !5
  %81 = icmp eq ptr %80, null
  br i1 %81, label %82, label %102

82:                                               ; preds = %72
  %83 = call ptr @mln_pg_item_new()
  store ptr %83, ptr %11, align 8, !tbaa !5
  %84 = load ptr, ptr %11, align 8, !tbaa !5
  %85 = icmp eq ptr %84, null
  br i1 %85, label %86, label %87

86:                                               ; preds = %82
  call void (i32, ptr, ptr, i32, ptr, ...) @_mln_sys_log(i32 noundef 4, ptr noundef @.str, ptr noundef @__FUNCTION__.mln_pg_closure, i32 noundef 529, ptr noundef @.str.1)
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %16, align 4
  br label %174

87:                                               ; preds = %82
  %88 = load ptr, ptr %5, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.mln_pg_state_s, ptr %88, i32 0, i32 8
  %90 = load i64, ptr %89, align 8, !tbaa !22
  %91 = add i64 %90, 1
  store i64 %91, ptr %89, align 8, !tbaa !22
  %92 = load ptr, ptr %5, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.mln_pg_state_s, ptr %92, i32 0, i32 2
  %94 = load ptr, ptr %5, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.mln_pg_state_s, ptr %94, i32 0, i32 3
  %96 = load ptr, ptr %11, align 8, !tbaa !5
  call void @mln_item_chain_add(ptr noundef %93, ptr noundef %95, ptr noundef %96)
  %97 = load ptr, ptr %14, align 8, !tbaa !5
  %98 = load ptr, ptr %11, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.mln_pg_item_s, ptr %98, i32 0, i32 5
  store ptr %97, ptr %99, align 8, !tbaa !14
  %100 = load ptr, ptr %11, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.mln_pg_item_s, ptr %100, i32 0, i32 6
  store i32 0, ptr %101, align 8, !tbaa !18
  br label %102

102:                                              ; preds = %87, %72
  %103 = load ptr, ptr %10, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.mln_pg_item_s, ptr %103, i32 0, i32 6
  %105 = load i32, ptr %104, align 8, !tbaa !18
  %106 = add i32 %105, 1
  %107 = load ptr, ptr %10, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.mln_pg_item_s, ptr %107, i32 0, i32 5
  %109 = load ptr, ptr %108, align 8, !tbaa !14
  %110 = getelementptr inbounds %struct.mln_pg_rule_s, ptr %109, i32 0, i32 3
  %111 = load i32, ptr %110, align 8, !tbaa !16
  %112 = icmp ult i32 %106, %111
  br i1 %112, label %113, label %149

113:                                              ; preds = %102
  %114 = load ptr, ptr %10, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.mln_pg_item_s, ptr %114, i32 0, i32 5
  %116 = load ptr, ptr %115, align 8, !tbaa !14
  %117 = getelementptr inbounds %struct.mln_pg_rule_s, ptr %116, i32 0, i32 2
  %118 = load ptr, ptr %117, align 8, !tbaa !19
  %119 = load ptr, ptr %10, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.mln_pg_item_s, ptr %119, i32 0, i32 6
  %121 = load i32, ptr %120, align 8, !tbaa !18
  %122 = add i32 %121, 1
  %123 = zext i32 %122 to i64
  %124 = getelementptr inbounds ptr, ptr %118, i64 %123
  %125 = load ptr, ptr %124, align 8, !tbaa !5
  store ptr %125, ptr %13, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.mln_pg_state, ptr %15, i32 0, i32 0
  store ptr %9, ptr %126, align 8, !tbaa !23
  %127 = load ptr, ptr %14, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.mln_pg_state, ptr %15, i32 0, i32 1
  store ptr %127, ptr %128, align 8, !tbaa !25
  %129 = load ptr, ptr %5, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.mln_pg_state, ptr %15, i32 0, i32 2
  store ptr %129, ptr %130, align 8, !tbaa !26
  %131 = load ptr, ptr %11, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.mln_pg_state, ptr %15, i32 0, i32 3
  store ptr %131, ptr %132, align 8, !tbaa !27
  %133 = load ptr, ptr %13, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.mln_pg_token_s, ptr %133, i32 0, i32 1
  %135 = load ptr, ptr %134, align 8, !tbaa !28
  %136 = call i32 @mln_rbtree_iterate(ptr noundef %135, ptr noundef @mln_pg_closure_rbtree_iterate_handler, ptr noundef %15)
  %137 = icmp slt i32 %136, 0
  br i1 %137, label %138, label %139

138:                                              ; preds = %113
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %16, align 4
  br label %174

139:                                              ; preds = %113
  %140 = load ptr, ptr %13, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.mln_pg_token_s, ptr %140, i32 0, i32 6
  %142 = load i8, ptr %141, align 4
  %143 = lshr i8 %142, 1
  %144 = and i8 %143, 1
  %145 = zext i8 %144 to i32
  %146 = icmp ne i32 %145, 0
  br i1 %146, label %148, label %147

147:                                              ; preds = %139
  br label %164

148:                                              ; preds = %139
  br label %149

149:                                              ; preds = %148, %102
  %150 = getelementptr inbounds %struct.mln_pg_state, ptr %15, i32 0, i32 0
  store ptr %9, ptr %150, align 8, !tbaa !23
  %151 = load ptr, ptr %14, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.mln_pg_state, ptr %15, i32 0, i32 1
  store ptr %151, ptr %152, align 8, !tbaa !25
  %153 = load ptr, ptr %5, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.mln_pg_state, ptr %15, i32 0, i32 2
  store ptr %153, ptr %154, align 8, !tbaa !26
  %155 = load ptr, ptr %11, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.mln_pg_state, ptr %15, i32 0, i32 3
  store ptr %155, ptr %156, align 8, !tbaa !27
  %157 = load ptr, ptr %10, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.mln_pg_item_s, ptr %157, i32 0, i32 2
  %159 = load ptr, ptr %158, align 8, !tbaa !29
  %160 = call i32 @mln_rbtree_iterate(ptr noundef %159, ptr noundef @mln_pg_closure_rbtree_iterate_handler, ptr noundef %15)
  %161 = icmp slt i32 %160, 0
  br i1 %161, label %162, label %163

162:                                              ; preds = %149
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %16, align 4
  br label %174

163:                                              ; preds = %149
  br label %164

164:                                              ; preds = %163, %147, %71
  %165 = load i32, ptr %8, align 4, !tbaa !9
  %166 = add nsw i32 %165, 1
  store i32 %166, ptr %8, align 4, !tbaa !9
  br label %58, !llvm.loop !30

167:                                              ; preds = %58
  br label %168

168:                                              ; preds = %167, %56, %37
  %169 = load ptr, ptr %10, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.mln_pg_item_s, ptr %169, i32 0, i32 1
  %171 = load ptr, ptr %170, align 8, !tbaa !32
  store ptr %171, ptr %10, align 8, !tbaa !5
  br label %24, !llvm.loop !33

172:                                              ; preds = %24
  br label %17, !llvm.loop !34

173:                                              ; preds = %17
  store i32 0, ptr %4, align 4
  store i32 1, ptr %16, align 4
  br label %174

174:                                              ; preds = %173, %162, %138, %86
  call void @llvm.lifetime.end.p0(i64 32, 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 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, 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
  %175 = load i32, ptr %4, align 4
  ret i32 %175
}

; Function Attrs: nounwind uwtable
declare hidden ptr @mln_pg_rule_duplicate(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
declare hidden i32 @mln_pg_closure_rbtree_iterate_handler(ptr noundef, ptr noundef) #1

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 = { 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 = !{!12, !6, i64 16}
!12 = !{!"mln_pg_state_s", !13, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !13, i64 64}
!13 = !{!"long", !7, i64 0}
!14 = !{!15, !6, i64 40}
!15 = !{!"mln_pg_item_s", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !13, i64 32, !6, i64 40, !10, i64 48}
!16 = !{!17, !10, i64 24}
!17 = !{!"mln_pg_rule_s", !6, i64 0, !6, i64 8, !6, i64 16, !10, i64 24}
!18 = !{!15, !10, i64 48}
!19 = !{!17, !6, i64 16}
!20 = !{!21, !6, i64 32}
!21 = !{!"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}
!22 = !{!12, !13, i64 64}
!23 = !{!24, !6, i64 0}
!24 = !{!"mln_pg_state", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!25 = !{!24, !6, i64 8}
!26 = !{!24, !6, i64 16}
!27 = !{!24, !6, i64 24}
!28 = !{!21, !6, i64 8}
!29 = !{!15, !6, i64 16}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}
!32 = !{!15, !6, i64 8}
!33 = distinct !{!33, !31}
!34 = distinct !{!34, !31}


; 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_state = type { ptr, ptr, ptr, ptr }
%struct.mln_pg_rule_s = type { 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_closure = external hidden unnamed_addr constant [15 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

declare void @_mln_sys_log(i32 noundef, ptr noundef, ptr noundef, i32 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
define dso_local range(i32 -1, 1) i32 @mln_pg_closure(ptr noundef %0, ptr noundef %1, i32 noundef %2) local_unnamed_addr #1 {
  %4 = alloca i32, align 4
  %5 = alloca %struct.mln_pg_state, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #3
  %6 = getelementptr inbounds i8, ptr %0, i64 16
  %.not57 = icmp eq i32 %2, 0
  %7 = getelementptr inbounds i8, ptr %0, i64 64
  %8 = getelementptr inbounds i8, ptr %0, i64 24
  %9 = getelementptr inbounds i8, ptr %5, i64 8
  %10 = getelementptr inbounds i8, ptr %5, i64 16
  %11 = getelementptr inbounds i8, ptr %5, i64 24
  %12 = load ptr, ptr %6, align 8, !tbaa !5
  %13 = icmp eq ptr %12, null
  br i1 %13, label %.loopexit49, label %.split.preheader

.split.preheader:                                 ; preds = %3
  %wide.trip.count = zext i32 %2 to i64
  store i32 0, ptr %4, align 4, !tbaa !9
  br i1 %.not57, label %.loopexit49, label %.lr.ph55.split.us, !llvm.loop !11

thread-pre-split:                                 ; preds = %..loopexit_crit_edge.us
  %.pr.pre = load i32, ptr %4, align 4, !tbaa !9
  %.not = icmp eq i32 %.pr.pre, 0
  br i1 %.not, label %.loopexit49, label %.splitthread-pre-split, !llvm.loop !13

.splitthread-pre-split:                           ; preds = %thread-pre-split
  %.04052.pr = load ptr, ptr %6, align 8, !tbaa !5
  store i32 0, ptr %4, align 4, !tbaa !9
  %.not4653 = icmp eq ptr %.04052.pr, null
  %brmerge = or i1 %.not4653, %.not57
  br i1 %brmerge, label %.loopexit49, label %.lr.ph55.split.us.backedge

.lr.ph55.split.us:                                ; preds = %.split.preheader, %.lr.ph55.split.us.backedge
  %.04054.us = phi ptr [ %.04054.us.be, %.lr.ph55.split.us.backedge ], [ %12, %.split.preheader ]
  %14 = getelementptr inbounds i8, ptr %.04054.us, i64 40
  %15 = load ptr, ptr %14, align 8, !tbaa !15
  %16 = getelementptr inbounds i8, ptr %15, i64 24
  %17 = load i32, ptr %16, align 8, !tbaa !18
  %18 = getelementptr inbounds i8, ptr %.04054.us, i64 48
  %19 = load i32, ptr %18, align 8, !tbaa !20
  %20 = icmp eq i32 %17, %19
  br i1 %20, label %..loopexit_crit_edge.us, label %21

21:                                               ; preds = %.lr.ph55.split.us
  %22 = getelementptr inbounds i8, ptr %15, i64 16
  %23 = load ptr, ptr %22, align 8, !tbaa !21
  %24 = zext i32 %19 to i64
  %25 = getelementptr inbounds ptr, ptr %23, i64 %24
  %26 = load ptr, ptr %25, align 8, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %26, i64 44
  %28 = load i8, ptr %27, align 4
  %29 = and i8 %28, 1
  %.not47.us = icmp eq i8 %29, 0
  br i1 %.not47.us, label %..loopexit_crit_edge.us, label %.preheader.us

30:                                               ; preds = %.preheader.us, %72
  %indvars.iv = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next, %72 ]
  %31 = load ptr, ptr %74, align 8, !tbaa !22
  %32 = getelementptr inbounds i32, ptr %31, i64 %indvars.iv
  %33 = load i32, ptr %32, align 4, !tbaa !9
  %34 = icmp eq i32 %33, 0
  br i1 %34, label %72, label %35

35:                                               ; preds = %30
  %36 = getelementptr inbounds %struct.mln_pg_rule_s, ptr %1, i64 %indvars.iv
  %37 = call ptr @mln_pg_rule_duplicate(ptr noundef %0, ptr noundef %36, i32 noundef 0)
  %38 = icmp eq ptr %37, null
  br i1 %38, label %39, label %47

39:                                               ; preds = %35
  %40 = call ptr @mln_pg_item_new()
  %41 = icmp eq ptr %40, null
  br i1 %41, label %.split.us, label %42

42:                                               ; preds = %39
  %43 = load i64, ptr %7, align 8, !tbaa !24
  %44 = add i64 %43, 1
  store i64 %44, ptr %7, align 8, !tbaa !24
  call void @mln_item_chain_add(ptr noundef nonnull %6, ptr noundef nonnull %8, ptr noundef nonnull %40)
  %45 = getelementptr inbounds i8, ptr %40, i64 40
  store ptr %36, ptr %45, align 8, !tbaa !15
  %46 = getelementptr inbounds i8, ptr %40, i64 48
  store i32 0, ptr %46, align 8, !tbaa !20
  br label %47

47:                                               ; preds = %42, %35
  %.041.us = phi ptr [ %40, %42 ], [ %37, %35 ]
  %48 = load i32, ptr %18, align 8, !tbaa !20
  %49 = add i32 %48, 1
  %50 = load ptr, ptr %14, align 8, !tbaa !15
  %51 = getelementptr inbounds i8, ptr %50, i64 24
  %52 = load i32, ptr %51, align 8, !tbaa !18
  %53 = icmp ult i32 %49, %52
  br i1 %53, label %54, label %68

54:                                               ; preds = %47
  %55 = getelementptr inbounds i8, ptr %50, i64 16
  %56 = load ptr, ptr %55, align 8, !tbaa !21
  %57 = zext i32 %49 to i64
  %58 = getelementptr inbounds ptr, ptr %56, i64 %57
  %59 = load ptr, ptr %58, align 8, !tbaa !5
  store ptr %4, ptr %5, align 8, !tbaa !26
  store ptr %36, ptr %9, align 8, !tbaa !28
  store ptr %0, ptr %10, align 8, !tbaa !29
  store ptr %.041.us, ptr %11, align 8, !tbaa !30
  %60 = getelementptr inbounds i8, ptr %59, i64 8
  %61 = load ptr, ptr %60, align 8, !tbaa !31
  %62 = call i32 @mln_rbtree_iterate(ptr noundef %61, ptr noundef nonnull @mln_pg_closure_rbtree_iterate_handler, ptr noundef nonnull %5) #3
  %63 = icmp slt i32 %62, 0
  br i1 %63, label %.loopexit49, label %64

64:                                               ; preds = %54
  %65 = getelementptr inbounds i8, ptr %59, i64 44
  %66 = load i8, ptr %65, align 4
  %67 = and i8 %66, 2
  %.not48.us = icmp eq i8 %67, 0
  br i1 %.not48.us, label %72, label %68

68:                                               ; preds = %64, %47
  store ptr %4, ptr %5, align 8, !tbaa !26
  store ptr %36, ptr %9, align 8, !tbaa !28
  store ptr %0, ptr %10, align 8, !tbaa !29
  store ptr %.041.us, ptr %11, align 8, !tbaa !30
  %69 = load ptr, ptr %75, align 8, !tbaa !32
  %70 = call i32 @mln_rbtree_iterate(ptr noundef %69, ptr noundef nonnull @mln_pg_closure_rbtree_iterate_handler, ptr noundef nonnull %5) #3
  %71 = icmp slt i32 %70, 0
  br i1 %71, label %.loopexit49, label %72

72:                                               ; preds = %68, %64, %30
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %..loopexit_crit_edge.us, label %30, !llvm.loop !33

..loopexit_crit_edge.us:                          ; preds = %72, %21, %.lr.ph55.split.us
  %73 = getelementptr inbounds i8, ptr %.04054.us, i64 8
  %.040.us = load ptr, ptr %73, align 8, !tbaa !5
  %.not46.us = icmp eq ptr %.040.us, null
  br i1 %.not46.us, label %thread-pre-split, label %.lr.ph55.split.us.backedge

.lr.ph55.split.us.backedge:                       ; preds = %..loopexit_crit_edge.us, %.splitthread-pre-split
  %.04054.us.be = phi ptr [ %.040.us, %..loopexit_crit_edge.us ], [ %.04052.pr, %.splitthread-pre-split ]
  br label %.lr.ph55.split.us, !llvm.loop !11

.preheader.us:                                    ; preds = %21
  %74 = getelementptr inbounds i8, ptr %26, i64 32
  %75 = getelementptr inbounds i8, ptr %.04054.us, i64 16
  br label %30

.split.us:                                        ; preds = %39
  call void (i32, ptr, ptr, i32, ptr, ...) @_mln_sys_log(i32 noundef 4, ptr noundef nonnull @.str, ptr noundef nonnull @__FUNCTION__.mln_pg_closure, i32 noundef 529, ptr noundef nonnull @.str.1) #3
  br label %.loopexit49

.loopexit49:                                      ; preds = %.splitthread-pre-split, %thread-pre-split, %68, %54, %.split.preheader, %3, %.split.us
  %.0 = phi i32 [ -1, %.split.us ], [ 0, %3 ], [ 0, %.split.preheader ], [ -1, %54 ], [ -1, %68 ], [ 0, %thread-pre-split ], [ 0, %.splitthread-pre-split ]
  call void @llvm.lifetime.end.p0(i64 32, 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 ptr @mln_pg_rule_duplicate(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
declare hidden i32 @mln_pg_closure_rbtree_iterate_handler(ptr noundef, ptr noundef) #1

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 = { 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 = distinct !{!13, !14}
!14 = !{!"llvm.loop.unswitch.partial.disable"}
!15 = !{!16, !6, i64 40}
!16 = !{!"mln_pg_item_s", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !17, i64 32, !6, i64 40, !10, i64 48}
!17 = !{!"long", !7, i64 0}
!18 = !{!19, !10, i64 24}
!19 = !{!"mln_pg_rule_s", !6, i64 0, !6, i64 8, !6, i64 16, !10, i64 24}
!20 = !{!16, !10, i64 48}
!21 = !{!19, !6, i64 16}
!22 = !{!23, !6, i64 32}
!23 = !{!"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}
!24 = !{!25, !17, i64 64}
!25 = !{!"mln_pg_state_s", !17, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !17, i64 64}
!26 = !{!27, !6, i64 0}
!27 = !{!"mln_pg_state", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!28 = !{!27, !6, i64 8}
!29 = !{!27, !6, i64 16}
!30 = !{!27, !6, i64 24}
!31 = !{!23, !6, i64 8}
!32 = !{!16, !6, i64 16}
!33 = distinct !{!33, !12}


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