; LLVM IR from AlgoGenesis/C :: Graph Algorithms/DFA NFA conversion (Program)

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

@.str = external hidden unnamed_addr constant [21 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @convertDFAtoNFA(ptr noundef %0, i32 noundef %1, i32 noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %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 i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  store i32 %2, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %19 = load i32, ptr %5, align 4, !tbaa !9
  %20 = sext i32 %19 to i64
  %21 = mul i64 %20, 8
  %22 = call noalias ptr @malloc(i64 noundef %21) #7
  store ptr %22, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %23

23:                                               ; preds = %58, %3
  %24 = load i32, ptr %8, align 4, !tbaa !9
  %25 = load i32, ptr %5, align 4, !tbaa !9
  %26 = icmp slt i32 %24, %25
  br i1 %26, label %28, label %27

27:                                               ; preds = %23
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %61

28:                                               ; preds = %23
  %29 = load i32, ptr %6, align 4, !tbaa !9
  %30 = sext i32 %29 to i64
  %31 = mul i64 %30, 8
  %32 = call noalias ptr @malloc(i64 noundef %31) #7
  %33 = load ptr, ptr %7, align 8, !tbaa !5
  %34 = load i32, ptr %8, align 4, !tbaa !9
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds ptr, ptr %33, i64 %35
  store ptr %32, ptr %36, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %37

37:                                               ; preds = %54, %28
  %38 = load i32, ptr %10, align 4, !tbaa !9
  %39 = load i32, ptr %6, align 4, !tbaa !9
  %40 = icmp slt i32 %38, %39
  br i1 %40, label %42, label %41

41:                                               ; preds = %37
  store i32 5, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %57

42:                                               ; preds = %37
  %43 = load i32, ptr %5, align 4, !tbaa !9
  %44 = sext i32 %43 to i64
  %45 = call noalias ptr @calloc(i64 noundef %44, i64 noundef 4) #8
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  %47 = load i32, ptr %8, align 4, !tbaa !9
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds ptr, ptr %46, i64 %48
  %50 = load ptr, ptr %49, align 8, !tbaa !5
  %51 = load i32, ptr %10, align 4, !tbaa !9
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds ptr, ptr %50, i64 %52
  store ptr %45, ptr %53, align 8, !tbaa !5
  br label %54

54:                                               ; preds = %42
  %55 = load i32, ptr %10, align 4, !tbaa !9
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %10, align 4, !tbaa !9
  br label %37, !llvm.loop !11

57:                                               ; preds = %41
  br label %58

58:                                               ; preds = %57
  %59 = load i32, ptr %8, align 4, !tbaa !9
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr %8, align 4, !tbaa !9
  br label %23, !llvm.loop !13

61:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %62

62:                                               ; preds = %103, %61
  %63 = load i32, ptr %11, align 4, !tbaa !9
  %64 = load i32, ptr %5, align 4, !tbaa !9
  %65 = icmp slt i32 %63, %64
  br i1 %65, label %67, label %66

66:                                               ; preds = %62
  store i32 8, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %106

67:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %68

68:                                               ; preds = %99, %67
  %69 = load i32, ptr %12, align 4, !tbaa !9
  %70 = load i32, ptr %6, align 4, !tbaa !9
  %71 = icmp slt i32 %69, %70
  br i1 %71, label %73, label %72

72:                                               ; preds = %68
  store i32 11, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %102

73:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %74 = load ptr, ptr %4, align 8, !tbaa !5
  %75 = load i32, ptr %11, align 4, !tbaa !9
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds ptr, ptr %74, i64 %76
  %78 = load ptr, ptr %77, align 8, !tbaa !5
  %79 = load i32, ptr %12, align 4, !tbaa !9
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds i32, ptr %78, i64 %80
  %82 = load i32, ptr %81, align 4, !tbaa !9
  store i32 %82, ptr %13, align 4, !tbaa !9
  %83 = load i32, ptr %13, align 4, !tbaa !9
  %84 = icmp ne i32 %83, -1
  br i1 %84, label %85, label %98

85:                                               ; preds = %73
  %86 = load ptr, ptr %7, align 8, !tbaa !5
  %87 = load i32, ptr %11, align 4, !tbaa !9
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds ptr, ptr %86, i64 %88
  %90 = load ptr, ptr %89, align 8, !tbaa !5
  %91 = load i32, ptr %12, align 4, !tbaa !9
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds ptr, ptr %90, i64 %92
  %94 = load ptr, ptr %93, align 8, !tbaa !5
  %95 = load i32, ptr %13, align 4, !tbaa !9
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds i32, ptr %94, i64 %96
  store i32 1, ptr %97, align 4, !tbaa !9
  br label %98

98:                                               ; preds = %85, %73
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %99

99:                                               ; preds = %98
  %100 = load i32, ptr %12, align 4, !tbaa !9
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %12, align 4, !tbaa !9
  br label %68, !llvm.loop !14

102:                                              ; preds = %72
  br label %103

103:                                              ; preds = %102
  %104 = load i32, ptr %11, align 4, !tbaa !9
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %11, align 4, !tbaa !9
  br label %62, !llvm.loop !15

106:                                              ; preds = %66
  %107 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %108

108:                                              ; preds = %156, %106
  %109 = load i32, ptr %14, align 4, !tbaa !9
  %110 = load i32, ptr %5, align 4, !tbaa !9
  %111 = icmp slt i32 %109, %110
  br i1 %111, label %113, label %112

112:                                              ; preds = %108
  store i32 14, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %159

113:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %114

114:                                              ; preds = %152, %113
  %115 = load i32, ptr %15, align 4, !tbaa !9
  %116 = load i32, ptr %6, align 4, !tbaa !9
  %117 = icmp slt i32 %115, %116
  br i1 %117, label %119, label %118

118:                                              ; preds = %114
  store i32 17, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %155

119:                                              ; preds = %114
  %120 = load i32, ptr %14, align 4, !tbaa !9
  %121 = load i32, ptr %15, align 4, !tbaa !9
  %122 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %120, i32 noundef %121)
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %123

123:                                              ; preds = %147, %119
  %124 = load i32, ptr %16, align 4, !tbaa !9
  %125 = load i32, ptr %5, align 4, !tbaa !9
  %126 = icmp slt i32 %124, %125
  br i1 %126, label %128, label %127

127:                                              ; preds = %123
  store i32 20, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %150

128:                                              ; preds = %123
  %129 = load ptr, ptr %7, align 8, !tbaa !5
  %130 = load i32, ptr %14, align 4, !tbaa !9
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds ptr, ptr %129, i64 %131
  %133 = load ptr, ptr %132, align 8, !tbaa !5
  %134 = load i32, ptr %15, align 4, !tbaa !9
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds ptr, ptr %133, i64 %135
  %137 = load ptr, ptr %136, align 8, !tbaa !5
  %138 = load i32, ptr %16, align 4, !tbaa !9
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds i32, ptr %137, i64 %139
  %141 = load i32, ptr %140, align 4, !tbaa !9
  %142 = icmp eq i32 %141, 1
  br i1 %142, label %143, label %146

143:                                              ; preds = %128
  %144 = load i32, ptr %16, align 4, !tbaa !9
  %145 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %144)
  br label %146

146:                                              ; preds = %143, %128
  br label %147

147:                                              ; preds = %146
  %148 = load i32, ptr %16, align 4, !tbaa !9
  %149 = add nsw i32 %148, 1
  store i32 %149, ptr %16, align 4, !tbaa !9
  br label %123, !llvm.loop !16

150:                                              ; preds = %127
  %151 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  br label %152

152:                                              ; preds = %150
  %153 = load i32, ptr %15, align 4, !tbaa !9
  %154 = add nsw i32 %153, 1
  store i32 %154, ptr %15, align 4, !tbaa !9
  br label %114, !llvm.loop !17

155:                                              ; preds = %118
  br label %156

156:                                              ; preds = %155
  %157 = load i32, ptr %14, align 4, !tbaa !9
  %158 = add nsw i32 %157, 1
  store i32 %158, ptr %14, align 4, !tbaa !9
  br label %108, !llvm.loop !18

159:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %160

160:                                              ; preds = %190, %159
  %161 = load i32, ptr %17, align 4, !tbaa !9
  %162 = load i32, ptr %5, align 4, !tbaa !9
  %163 = icmp slt i32 %161, %162
  br i1 %163, label %165, label %164

164:                                              ; preds = %160
  store i32 23, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %193

165:                                              ; preds = %160
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %166

166:                                              ; preds = %181, %165
  %167 = load i32, ptr %18, align 4, !tbaa !9
  %168 = load i32, ptr %6, align 4, !tbaa !9
  %169 = icmp slt i32 %167, %168
  br i1 %169, label %171, label %170

170:                                              ; preds = %166
  store i32 26, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %184

171:                                              ; preds = %166
  %172 = load ptr, ptr %7, align 8, !tbaa !5
  %173 = load i32, ptr %17, align 4, !tbaa !9
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds ptr, ptr %172, i64 %174
  %176 = load ptr, ptr %175, align 8, !tbaa !5
  %177 = load i32, ptr %18, align 4, !tbaa !9
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds ptr, ptr %176, i64 %178
  %180 = load ptr, ptr %179, align 8, !tbaa !5
  call void @free(ptr noundef %180) #6
  br label %181

181:                                              ; preds = %171
  %182 = load i32, ptr %18, align 4, !tbaa !9
  %183 = add nsw i32 %182, 1
  store i32 %183, ptr %18, align 4, !tbaa !9
  br label %166, !llvm.loop !19

184:                                              ; preds = %170
  %185 = load ptr, ptr %7, align 8, !tbaa !5
  %186 = load i32, ptr %17, align 4, !tbaa !9
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds ptr, ptr %185, i64 %187
  %189 = load ptr, ptr %188, align 8, !tbaa !5
  call void @free(ptr noundef %189) #6
  br label %190

190:                                              ; preds = %184
  %191 = load i32, ptr %17, align 4, !tbaa !9
  %192 = add nsw i32 %191, 1
  store i32 %192, ptr %17, align 4, !tbaa !9
  br label %160, !llvm.loop !20

193:                                              ; preds = %164
  %194 = load ptr, ptr %7, align 8, !tbaa !5
  call void @free(ptr noundef %194) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  ret void
}

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #2

; Function Attrs: nounwind allocsize(0,1)
declare noalias ptr @calloc(i64 noundef, i64 noundef) #3

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

declare i32 @printf(ptr noundef, ...) #4

; Function Attrs: nounwind
declare void @free(ptr noundef) #5

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

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

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

@.str = external hidden unnamed_addr constant [21 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @convertDFAtoNFA(ptr nocapture noundef readonly %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #0 {
  %4 = sext i32 %1 to i64
  %5 = shl nsw i64 %4, 3
  %6 = tail call noalias ptr @malloc(i64 noundef %5) #5
  %7 = icmp sgt i32 %1, 0
  br i1 %7, label %.lr.ph72, label %._crit_edge75.thread

.lr.ph72:                                         ; preds = %3
  %8 = sext i32 %2 to i64
  %9 = shl nsw i64 %8, 3
  %10 = icmp sgt i32 %2, 0
  %wide.trip.count108 = zext nneg i32 %1 to i64
  br i1 %10, label %.lr.ph.us.preheader, label %.lr.ph72.split

.lr.ph.us.preheader:                              ; preds = %.lr.ph72
  %wide.trip.count103 = zext nneg i32 %2 to i64
  br label %.lr.ph.us

.lr.ph.us:                                        ; preds = %.lr.ph.us.preheader, %._crit_edge.us
  %indvars.iv105 = phi i64 [ 0, %.lr.ph.us.preheader ], [ %indvars.iv.next106, %._crit_edge.us ]
  %11 = tail call noalias ptr @malloc(i64 noundef %9) #5
  %12 = getelementptr inbounds ptr, ptr %6, i64 %indvars.iv105
  store ptr %11, ptr %12, align 8, !tbaa !5
  br label %13

13:                                               ; preds = %.lr.ph.us, %13
  %indvars.iv100 = phi i64 [ 0, %.lr.ph.us ], [ %indvars.iv.next101, %13 ]
  %14 = tail call noalias ptr @calloc(i64 noundef %4, i64 noundef 4) #6
  %15 = getelementptr inbounds ptr, ptr %11, i64 %indvars.iv100
  store ptr %14, ptr %15, align 8, !tbaa !5
  %indvars.iv.next101 = add nuw nsw i64 %indvars.iv100, 1
  %exitcond104.not = icmp eq i64 %indvars.iv.next101, %wide.trip.count103
  br i1 %exitcond104.not, label %._crit_edge.us, label %13, !llvm.loop !9

._crit_edge.us:                                   ; preds = %13
  %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 %.preheader68, label %.lr.ph.us, !llvm.loop !11

.preheader68:                                     ; preds = %.lr.ph72.split, %._crit_edge.us
  br i1 %7, label %.preheader67.lr.ph, label %._crit_edge75.thread

.preheader67.lr.ph:                               ; preds = %.preheader68
  %16 = icmp sgt i32 %2, 0
  br i1 %16, label %.preheader67.us.preheader, label %.preheader66.lr.ph.thread

.preheader66.lr.ph.thread:                        ; preds = %.preheader67.lr.ph
  %17 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  %wide.trip.count138 = zext nneg i32 %1 to i64
  br label %.preheader

.preheader67.us.preheader:                        ; preds = %.preheader67.lr.ph
  %wide.trip.count118 = zext nneg i32 %1 to i64
  %wide.trip.count113 = zext nneg i32 %2 to i64
  %xtraiter = and i64 %wide.trip.count113, 1
  %18 = icmp eq i32 %2, 1
  %unroll_iter = and i64 %wide.trip.count113, 2147483646
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.preheader67.us

.preheader67.us:                                  ; preds = %.preheader67.us.preheader, %._crit_edge.us77
  %indvars.iv115 = phi i64 [ 0, %.preheader67.us.preheader ], [ %indvars.iv.next116, %._crit_edge.us77 ]
  %19 = getelementptr inbounds ptr, ptr %0, i64 %indvars.iv115
  %20 = load ptr, ptr %19, align 8, !tbaa !5
  %21 = getelementptr inbounds ptr, ptr %6, i64 %indvars.iv115
  br i1 %18, label %._crit_edge.us77.unr-lcssa, label %.preheader67.us.new

.preheader67.us.new:                              ; preds = %.preheader67.us, %39
  %indvars.iv110 = phi i64 [ %indvars.iv.next111.1, %39 ], [ 0, %.preheader67.us ]
  %niter = phi i64 [ %niter.next.1, %39 ], [ 0, %.preheader67.us ]
  %22 = getelementptr inbounds i32, ptr %20, i64 %indvars.iv110
  %23 = load i32, ptr %22, align 4, !tbaa !12
  %.not.us = icmp eq i32 %23, -1
  br i1 %.not.us, label %30, label %24

24:                                               ; preds = %.preheader67.us.new
  %25 = load ptr, ptr %21, align 8, !tbaa !5
  %26 = getelementptr inbounds ptr, ptr %25, i64 %indvars.iv110
  %27 = load ptr, ptr %26, align 8, !tbaa !5
  %28 = sext i32 %23 to i64
  %29 = getelementptr inbounds i32, ptr %27, i64 %28
  store i32 1, ptr %29, align 4, !tbaa !12
  br label %30

30:                                               ; preds = %24, %.preheader67.us.new
  %indvars.iv.next111 = or disjoint i64 %indvars.iv110, 1
  %31 = getelementptr inbounds i32, ptr %20, i64 %indvars.iv.next111
  %32 = load i32, ptr %31, align 4, !tbaa !12
  %.not.us.1 = icmp eq i32 %32, -1
  br i1 %.not.us.1, label %39, label %33

33:                                               ; preds = %30
  %34 = load ptr, ptr %21, align 8, !tbaa !5
  %35 = getelementptr inbounds ptr, ptr %34, i64 %indvars.iv.next111
  %36 = load ptr, ptr %35, align 8, !tbaa !5
  %37 = sext i32 %32 to i64
  %38 = getelementptr inbounds i32, ptr %36, i64 %37
  store i32 1, ptr %38, align 4, !tbaa !12
  br label %39

39:                                               ; preds = %33, %30
  %indvars.iv.next111.1 = add nuw nsw i64 %indvars.iv110, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.us77.unr-lcssa, label %.preheader67.us.new, !llvm.loop !14

._crit_edge.us77.unr-lcssa:                       ; preds = %39, %.preheader67.us
  %indvars.iv110.unr = phi i64 [ 0, %.preheader67.us ], [ %indvars.iv.next111.1, %39 ]
  br i1 %lcmp.mod.not, label %._crit_edge.us77, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.us77.unr-lcssa
  %40 = getelementptr inbounds i32, ptr %20, i64 %indvars.iv110.unr
  %41 = load i32, ptr %40, align 4, !tbaa !12
  %.not.us.epil = icmp eq i32 %41, -1
  br i1 %.not.us.epil, label %._crit_edge.us77, label %42

42:                                               ; preds = %.epil.preheader
  %43 = load ptr, ptr %21, align 8, !tbaa !5
  %44 = getelementptr inbounds ptr, ptr %43, i64 %indvars.iv110.unr
  %45 = load ptr, ptr %44, align 8, !tbaa !5
  %46 = sext i32 %41 to i64
  %47 = getelementptr inbounds i32, ptr %45, i64 %46
  store i32 1, ptr %47, align 4, !tbaa !12
  br label %._crit_edge.us77

._crit_edge.us77:                                 ; preds = %.epil.preheader, %42, %._crit_edge.us77.unr-lcssa
  %indvars.iv.next116 = add nuw nsw i64 %indvars.iv115, 1
  %exitcond119.not = icmp eq i64 %indvars.iv.next116, %wide.trip.count118
  br i1 %exitcond119.not, label %._crit_edge75, label %.preheader67.us, !llvm.loop !15

.lr.ph72.split:                                   ; preds = %.lr.ph72, %.lr.ph72.split
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph72.split ], [ 0, %.lr.ph72 ]
  %48 = tail call noalias ptr @malloc(i64 noundef %9) #5
  %49 = getelementptr inbounds ptr, ptr %6, i64 %indvars.iv
  store ptr %48, ptr %49, align 8, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count108
  br i1 %exitcond.not, label %.preheader68, label %.lr.ph72.split, !llvm.loop !11

._crit_edge75.thread:                             ; preds = %.preheader68, %3
  %50 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  br label %._crit_edge91

._crit_edge75:                                    ; preds = %._crit_edge.us77
  %51 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  br i1 %7, label %.preheader66.us.us.preheader, label %._crit_edge91

.preheader66.us.us.preheader:                     ; preds = %._crit_edge75
  %wide.trip.count133 = zext nneg i32 %1 to i64
  %wide.trip.count128 = zext nneg i32 %2 to i64
  br label %.preheader66.us.us

.preheader66.us.us:                               ; preds = %.preheader66.us.us.preheader, %._crit_edge81.split.us.us.us
  %indvars.iv130 = phi i64 [ 0, %.preheader66.us.us.preheader ], [ %indvars.iv.next131, %._crit_edge81.split.us.us.us ]
  %52 = getelementptr inbounds ptr, ptr %6, i64 %indvars.iv130
  %53 = trunc nuw nsw i64 %indvars.iv130 to i32
  br label %.lr.ph.us82.us.us

.lr.ph.us82.us.us:                                ; preds = %._crit_edge.us83.us.us, %.preheader66.us.us
  %indvars.iv125 = phi i64 [ %indvars.iv.next126, %._crit_edge.us83.us.us ], [ 0, %.preheader66.us.us ]
  %54 = trunc nuw nsw i64 %indvars.iv125 to i32
  %55 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %53, i32 noundef %54)
  %56 = load ptr, ptr %52, align 8, !tbaa !5
  %57 = getelementptr inbounds ptr, ptr %56, i64 %indvars.iv125
  br label %58

58:                                               ; preds = %66, %.lr.ph.us82.us.us
  %indvars.iv120 = phi i64 [ %indvars.iv.next121, %66 ], [ 0, %.lr.ph.us82.us.us ]
  %59 = load ptr, ptr %57, align 8, !tbaa !5
  %60 = getelementptr inbounds i32, ptr %59, i64 %indvars.iv120
  %61 = load i32, ptr %60, align 4, !tbaa !12
  %62 = icmp eq i32 %61, 1
  br i1 %62, label %63, label %66

63:                                               ; preds = %58
  %64 = trunc nuw nsw i64 %indvars.iv120 to i32
  %65 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %64)
  br label %66

66:                                               ; preds = %63, %58
  %indvars.iv.next121 = add nuw nsw i64 %indvars.iv120, 1
  %exitcond124.not = icmp eq i64 %indvars.iv.next121, %wide.trip.count133
  br i1 %exitcond124.not, label %._crit_edge.us83.us.us, label %58, !llvm.loop !16

._crit_edge.us83.us.us:                           ; preds = %66
  %67 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %indvars.iv.next126 = add nuw nsw i64 %indvars.iv125, 1
  %exitcond129.not = icmp eq i64 %indvars.iv.next126, %wide.trip.count128
  br i1 %exitcond129.not, label %._crit_edge81.split.us.us.us, label %.lr.ph.us82.us.us, !llvm.loop !17

._crit_edge81.split.us.us.us:                     ; preds = %._crit_edge.us83.us.us
  %indvars.iv.next131 = add nuw nsw i64 %indvars.iv130, 1
  %exitcond134.not = icmp eq i64 %indvars.iv.next131, %wide.trip.count133
  br i1 %exitcond134.not, label %.preheader65, label %.preheader66.us.us, !llvm.loop !18

.preheader65:                                     ; preds = %._crit_edge81.split.us.us.us
  br i1 %7, label %.preheader.us.preheader, label %._crit_edge91

.preheader.us.preheader:                          ; preds = %.preheader65
  %wide.trip.count148 = zext nneg i32 %1 to i64
  %wide.trip.count143 = zext nneg i32 %2 to i64
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge.us93
  %indvars.iv145 = phi i64 [ 0, %.preheader.us.preheader ], [ %indvars.iv.next146, %._crit_edge.us93 ]
  %68 = getelementptr inbounds ptr, ptr %6, i64 %indvars.iv145
  %69 = load ptr, ptr %68, align 8, !tbaa !5
  br label %70

70:                                               ; preds = %.preheader.us, %70
  %indvars.iv140 = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next141, %70 ]
  %71 = getelementptr inbounds ptr, ptr %69, i64 %indvars.iv140
  %72 = load ptr, ptr %71, align 8, !tbaa !5
  tail call void @free(ptr noundef %72) #7
  %indvars.iv.next141 = add nuw nsw i64 %indvars.iv140, 1
  %exitcond144.not = icmp eq i64 %indvars.iv.next141, %wide.trip.count143
  br i1 %exitcond144.not, label %._crit_edge.us93, label %70, !llvm.loop !19

._crit_edge.us93:                                 ; preds = %70
  tail call void @free(ptr noundef nonnull %69) #7
  %indvars.iv.next146 = add nuw nsw i64 %indvars.iv145, 1
  %exitcond149.not = icmp eq i64 %indvars.iv.next146, %wide.trip.count148
  br i1 %exitcond149.not, label %._crit_edge91, label %.preheader.us, !llvm.loop !20

.preheader:                                       ; preds = %.preheader66.lr.ph.thread, %.preheader
  %indvars.iv135 = phi i64 [ 0, %.preheader66.lr.ph.thread ], [ %indvars.iv.next136, %.preheader ]
  %73 = getelementptr inbounds ptr, ptr %6, i64 %indvars.iv135
  %74 = load ptr, ptr %73, align 8, !tbaa !5
  tail call void @free(ptr noundef %74) #7
  %indvars.iv.next136 = add nuw nsw i64 %indvars.iv135, 1
  %exitcond139.not = icmp eq i64 %indvars.iv.next136, %wide.trip.count138
  br i1 %exitcond139.not, label %._crit_edge91, label %.preheader, !llvm.loop !20

._crit_edge91:                                    ; preds = %.preheader, %._crit_edge.us93, %._crit_edge75, %._crit_edge75.thread, %.preheader65
  tail call void @free(ptr noundef %6) #7
  ret void
}

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #4

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "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 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind allocsize(0) }
attributes #6 = { nounwind allocsize(0,1) }
attributes #7 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}


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