; LLVM IR from AlgoGenesis/C :: Deadlock avoidance algorithm (Banker's Algorithm)

; 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 [32 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [43 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 zeroext i1 @isSafe(i32 noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) #0 {
  %6 = alloca i1, align 1
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca [10 x i32], align 16
  %13 = alloca [10 x i8], align 1
  %14 = alloca [10 x i32], align 16
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i8, align 1
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i8, align 1
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  store i32 %0, ptr %7, align 4, !tbaa !5
  store i32 %1, ptr %8, align 4, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !9
  store ptr %3, ptr %10, align 8, !tbaa !9
  store ptr %4, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 40, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 10, ptr %13) #4
  call void @llvm.memset.p0.i64(ptr align 1 %13, i8 0, i64 10, i1 false)
  call void @llvm.lifetime.start.p0(i64 40, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  store i32 0, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %24

24:                                               ; preds = %38, %5
  %25 = load i32, ptr %16, align 4, !tbaa !5
  %26 = load i32, ptr %8, align 4, !tbaa !5
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  br label %41

29:                                               ; preds = %24
  %30 = load ptr, ptr %11, align 8, !tbaa !9
  %31 = load i32, ptr %16, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds i32, ptr %30, i64 %32
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = load i32, ptr %16, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [10 x i32], ptr %12, i64 0, i64 %36
  store i32 %34, ptr %37, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %29
  %39 = load i32, ptr %16, align 4, !tbaa !5
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %16, align 4, !tbaa !5
  br label %24, !llvm.loop !11

41:                                               ; preds = %28
  br label %42

42:                                               ; preds = %141, %41
  %43 = load i32, ptr %15, align 4, !tbaa !5
  %44 = load i32, ptr %7, align 4, !tbaa !5
  %45 = icmp slt i32 %43, %44
  br i1 %45, label %46, label %142

46:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #4
  store i8 0, ptr %17, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %47

47:                                               ; preds = %130, %46
  %48 = load i32, ptr %18, align 4, !tbaa !5
  %49 = load i32, ptr %7, align 4, !tbaa !5
  %50 = icmp slt i32 %48, %49
  br i1 %50, label %52, label %51

51:                                               ; preds = %47
  store i32 7, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  br label %133

52:                                               ; preds = %47
  %53 = load i32, ptr %18, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [10 x i8], ptr %13, i64 0, i64 %54
  %56 = load i8, ptr %55, align 1, !tbaa !13, !range !15, !noundef !16
  %57 = trunc i8 %56 to i1
  br i1 %57, label %129, label %58

58:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 1, ptr %20) #4
  store i8 1, ptr %20, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #4
  store i32 0, ptr %21, align 4, !tbaa !5
  br label %59

59:                                               ; preds = %89, %58
  %60 = load i32, ptr %21, align 4, !tbaa !5
  %61 = load i32, ptr %8, align 4, !tbaa !5
  %62 = icmp slt i32 %60, %61
  br i1 %62, label %64, label %63

63:                                               ; preds = %59
  store i32 10, ptr %19, align 4
  br label %92

64:                                               ; preds = %59
  %65 = load ptr, ptr %9, align 8, !tbaa !9
  %66 = load i32, ptr %18, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [10 x i32], ptr %65, i64 %67
  %69 = load i32, ptr %21, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [10 x i32], ptr %68, i64 0, i64 %70
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = load ptr, ptr %10, align 8, !tbaa !9
  %74 = load i32, ptr %18, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [10 x i32], ptr %73, i64 %75
  %77 = load i32, ptr %21, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [10 x i32], ptr %76, i64 0, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = sub nsw i32 %72, %80
  %82 = load i32, ptr %21, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [10 x i32], ptr %12, i64 0, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = icmp sgt i32 %81, %85
  br i1 %86, label %87, label %88

87:                                               ; preds = %64
  store i8 0, ptr %20, align 1, !tbaa !13
  store i32 10, ptr %19, align 4
  br label %92

88:                                               ; preds = %64
  br label %89

89:                                               ; preds = %88
  %90 = load i32, ptr %21, align 4, !tbaa !5
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %21, align 4, !tbaa !5
  br label %59, !llvm.loop !17

92:                                               ; preds = %87, %63
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #4
  br label %93

93:                                               ; preds = %92
  %94 = load i8, ptr %20, align 1, !tbaa !13, !range !15, !noundef !16
  %95 = trunc i8 %94 to i1
  br i1 %95, label %96, label %128

96:                                               ; preds = %93
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #4
  store i32 0, ptr %22, align 4, !tbaa !5
  br label %97

97:                                               ; preds = %116, %96
  %98 = load i32, ptr %22, align 4, !tbaa !5
  %99 = load i32, ptr %8, align 4, !tbaa !5
  %100 = icmp slt i32 %98, %99
  br i1 %100, label %102, label %101

101:                                              ; preds = %97
  store i32 13, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  br label %119

102:                                              ; preds = %97
  %103 = load ptr, ptr %10, align 8, !tbaa !9
  %104 = load i32, ptr %18, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [10 x i32], ptr %103, i64 %105
  %107 = load i32, ptr %22, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [10 x i32], ptr %106, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = load i32, ptr %22, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [10 x i32], ptr %12, i64 0, i64 %112
  %114 = load i32, ptr %113, align 4, !tbaa !5
  %115 = add nsw i32 %114, %110
  store i32 %115, ptr %113, align 4, !tbaa !5
  br label %116

116:                                              ; preds = %102
  %117 = load i32, ptr %22, align 4, !tbaa !5
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %22, align 4, !tbaa !5
  br label %97, !llvm.loop !18

119:                                              ; preds = %101
  %120 = load i32, ptr %18, align 4, !tbaa !5
  %121 = load i32, ptr %15, align 4, !tbaa !5
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr %15, align 4, !tbaa !5
  %123 = sext i32 %121 to i64
  %124 = getelementptr inbounds [10 x i32], ptr %14, i64 0, i64 %123
  store i32 %120, ptr %124, align 4, !tbaa !5
  %125 = load i32, ptr %18, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [10 x i8], ptr %13, i64 0, i64 %126
  store i8 1, ptr %127, align 1, !tbaa !13
  store i8 1, ptr %17, align 1, !tbaa !13
  br label %128

128:                                              ; preds = %119, %93
  call void @llvm.lifetime.end.p0(i64 1, ptr %20) #4
  br label %129

129:                                              ; preds = %128, %52
  br label %130

130:                                              ; preds = %129
  %131 = load i32, ptr %18, align 4, !tbaa !5
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %18, align 4, !tbaa !5
  br label %47, !llvm.loop !19

133:                                              ; preds = %51
  %134 = load i8, ptr %17, align 1, !tbaa !13, !range !15, !noundef !16
  %135 = trunc i8 %134 to i1
  br i1 %135, label %138, label %136

136:                                              ; preds = %133
  %137 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  store i1 false, ptr %6, align 1
  store i32 1, ptr %19, align 4
  br label %139

138:                                              ; preds = %133
  store i32 0, ptr %19, align 4
  br label %139

139:                                              ; preds = %138, %136
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #4
  %140 = load i32, ptr %19, align 4
  switch i32 %140, label %160 [
    i32 0, label %141
  ]

141:                                              ; preds = %139
  br label %42, !llvm.loop !20

142:                                              ; preds = %42
  %143 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #4
  store i32 0, ptr %23, align 4, !tbaa !5
  br label %144

144:                                              ; preds = %155, %142
  %145 = load i32, ptr %23, align 4, !tbaa !5
  %146 = load i32, ptr %7, align 4, !tbaa !5
  %147 = icmp slt i32 %145, %146
  br i1 %147, label %149, label %148

148:                                              ; preds = %144
  store i32 16, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #4
  br label %158

149:                                              ; preds = %144
  %150 = load i32, ptr %23, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [10 x i32], ptr %14, i64 0, i64 %151
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %153)
  br label %155

155:                                              ; preds = %149
  %156 = load i32, ptr %23, align 4, !tbaa !5
  %157 = add nsw i32 %156, 1
  store i32 %157, ptr %23, align 4, !tbaa !5
  br label %144, !llvm.loop !21

158:                                              ; preds = %148
  %159 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  store i1 true, ptr %6, align 1
  store i32 1, ptr %19, align 4
  br label %160

160:                                              ; preds = %158, %139
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 10, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %12) #4
  %161 = load i1, ptr %6, align 1
  ret i1 %161
}

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

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

; 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, ...) #3

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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { "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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"_Bool", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !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 [32 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [43 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: nofree nounwind uwtable
define dso_local noundef zeroext i1 @isSafe(i32 noundef %0, i32 noundef %1, ptr nocapture noundef readonly %2, ptr nocapture noundef readonly %3, ptr nocapture noundef readonly %4) local_unnamed_addr #0 {
  %6 = alloca [10 x i32], align 16
  %7 = alloca [10 x i8], align 1
  %8 = alloca [10 x i32], align 16
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %7) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %7, i8 0, i64 10, i1 false)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %8) #5
  %9 = icmp sgt i32 %1, 0
  br i1 %9, label %.critedge56.preheader, label %.critedge56.preheader.thread

.critedge56.preheader:                            ; preds = %5
  %10 = zext nneg i32 %1 to i64
  %11 = shl nuw nsw i64 %10, 2
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %6, ptr align 4 %4, i64 %11, i1 false), !tbaa !5
  %12 = icmp sgt i32 %0, 0
  br i1 %12, label %.critedge56.us.us.us.preheader, label %.split.us.thread

.critedge56.preheader.thread:                     ; preds = %5
  %13 = icmp sgt i32 %0, 0
  br i1 %13, label %.critedge56.us.preheader, label %.split.us.thread

.critedge56.us.preheader:                         ; preds = %.critedge56.preheader.thread
  %wide.trip.count = zext nneg i32 %0 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %14 = icmp eq i32 %0, 1
  %unroll_iter = and i64 %wide.trip.count, 2147483646
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.critedge56.us

.critedge56.us.us.us.preheader:                   ; preds = %.critedge56.preheader
  %wide.trip.count133 = zext nneg i32 %0 to i64
  %wide.trip.count124 = zext nneg i32 %1 to i64
  %min.iters.check = icmp ult i32 %1, 8
  %n.vec = and i64 %wide.trip.count124, 2147483640
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count124
  br label %.critedge56.us.us.us

.critedge56.us.us.us:                             ; preds = %.critedge56.us.us.us.preheader, %._crit_edge.split.us.us.us.split.us.us
  %.046.us.us.us = phi i32 [ %.3.us.us.us.us.us, %._crit_edge.split.us.us.us.split.us.us ], [ 0, %.critedge56.us.us.us.preheader ]
  %.not140 = icmp slt i32 %.046.us.us.us, %0
  br i1 %.not140, label %.preheader57.us.us.us, label %.lr.ph114.preheader.critedge

.preheader57.us.us.us:                            ; preds = %.critedge56.us.us.us, %.loopexit.us.us.us.us.us
  %indvars.iv131 = phi i64 [ %indvars.iv.next132, %.loopexit.us.us.us.us.us ], [ 0, %.critedge56.us.us.us ]
  %.04466.us.us.us.us.us = phi i1 [ %.2.us.us.us.us.us, %.loopexit.us.us.us.us.us ], [ false, %.critedge56.us.us.us ]
  %.14765.us.us.us.us.us = phi i32 [ %.3.us.us.us.us.us, %.loopexit.us.us.us.us.us ], [ %.046.us.us.us, %.critedge56.us.us.us ]
  %15 = getelementptr inbounds [10 x i8], ptr %7, i64 0, i64 %indvars.iv131
  %16 = load i8, ptr %15, align 1, !tbaa !9, !range !11, !noundef !12
  %17 = trunc nuw i8 %16 to i1
  br i1 %17, label %.loopexit.us.us.us.us.us, label %.preheader.us.us.us.us.us

18:                                               ; preds = %.preheader.us.us.us.us.us
  %indvars.iv.next122 = add nuw nsw i64 %indvars.iv121, 1
  %exitcond125.not = icmp eq i64 %indvars.iv.next122, %wide.trip.count124
  br i1 %exitcond125.not, label %.critedge.us.us.us.us.us.preheader, label %.preheader.us.us.us.us.us, !llvm.loop !13

.critedge.us.us.us.us.us.preheader:               ; preds = %18
  br i1 %min.iters.check, label %.critedge.us.us.us.us.us.preheader148, label %vector.body

vector.body:                                      ; preds = %.critedge.us.us.us.us.us.preheader, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %.critedge.us.us.us.us.us.preheader ]
  %19 = getelementptr inbounds [10 x i32], ptr %3, i64 %indvars.iv131, i64 %index
  %20 = getelementptr inbounds i8, ptr %19, i64 16
  %wide.load = load <4 x i32>, ptr %19, align 4, !tbaa !5
  %wide.load145 = load <4 x i32>, ptr %20, align 4, !tbaa !5
  %21 = getelementptr inbounds [10 x i32], ptr %6, i64 0, i64 %index
  %22 = getelementptr inbounds i8, ptr %21, i64 16
  %wide.load146 = load <4 x i32>, ptr %21, align 16, !tbaa !5
  %wide.load147 = load <4 x i32>, ptr %22, align 16, !tbaa !5
  %23 = add nsw <4 x i32> %wide.load146, %wide.load
  %24 = add nsw <4 x i32> %wide.load147, %wide.load145
  store <4 x i32> %23, ptr %21, align 16, !tbaa !5
  store <4 x i32> %24, ptr %22, align 16, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %25 = icmp eq i64 %index.next, %n.vec
  br i1 %25, label %middle.block, label %vector.body, !llvm.loop !15

middle.block:                                     ; preds = %vector.body
  br i1 %cmp.n, label %.critedge._crit_edge.us.us.us.us.us, label %.critedge.us.us.us.us.us.preheader148

.critedge.us.us.us.us.us.preheader148:            ; preds = %middle.block, %.critedge.us.us.us.us.us.preheader
  %indvars.iv126.ph = phi i64 [ 0, %.critedge.us.us.us.us.us.preheader ], [ %n.vec, %middle.block ]
  br label %.critedge.us.us.us.us.us

.critedge.us.us.us.us.us:                         ; preds = %.critedge.us.us.us.us.us.preheader148, %.critedge.us.us.us.us.us
  %indvars.iv126 = phi i64 [ %indvars.iv.next127, %.critedge.us.us.us.us.us ], [ %indvars.iv126.ph, %.critedge.us.us.us.us.us.preheader148 ]
  %26 = getelementptr inbounds [10 x i32], ptr %3, i64 %indvars.iv131, i64 %indvars.iv126
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %28 = getelementptr inbounds [10 x i32], ptr %6, i64 0, i64 %indvars.iv126
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = add nsw i32 %29, %27
  store i32 %30, ptr %28, align 4, !tbaa !5
  %indvars.iv.next127 = add nuw nsw i64 %indvars.iv126, 1
  %exitcond130.not = icmp eq i64 %indvars.iv.next127, %wide.trip.count124
  br i1 %exitcond130.not, label %.critedge._crit_edge.us.us.us.us.us, label %.critedge.us.us.us.us.us, !llvm.loop !18

.preheader.us.us.us.us.us:                        ; preds = %.preheader57.us.us.us, %18
  %indvars.iv121 = phi i64 [ %indvars.iv.next122, %18 ], [ 0, %.preheader57.us.us.us ]
  %31 = getelementptr inbounds [10 x i32], ptr %2, i64 %indvars.iv131, i64 %indvars.iv121
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = getelementptr inbounds [10 x i32], ptr %3, i64 %indvars.iv131, i64 %indvars.iv121
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = sub nsw i32 %32, %34
  %36 = getelementptr inbounds [10 x i32], ptr %6, i64 0, i64 %indvars.iv121
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = icmp sgt i32 %35, %37
  br i1 %38, label %.loopexit.us.us.us.us.us, label %18

.loopexit.us.us.us.us.us:                         ; preds = %.preheader.us.us.us.us.us, %.critedge._crit_edge.us.us.us.us.us, %.preheader57.us.us.us
  %.3.us.us.us.us.us = phi i32 [ %.14765.us.us.us.us.us, %.preheader57.us.us.us ], [ %39, %.critedge._crit_edge.us.us.us.us.us ], [ %.14765.us.us.us.us.us, %.preheader.us.us.us.us.us ]
  %.2.us.us.us.us.us = phi i1 [ %.04466.us.us.us.us.us, %.preheader57.us.us.us ], [ true, %.critedge._crit_edge.us.us.us.us.us ], [ %.04466.us.us.us.us.us, %.preheader.us.us.us.us.us ]
  %indvars.iv.next132 = add nuw nsw i64 %indvars.iv131, 1
  %exitcond134.not = icmp eq i64 %indvars.iv.next132, %wide.trip.count133
  br i1 %exitcond134.not, label %._crit_edge.split.us.us.us.split.us.us, label %.preheader57.us.us.us, !llvm.loop !19

.critedge._crit_edge.us.us.us.us.us:              ; preds = %.critedge.us.us.us.us.us, %middle.block
  %39 = add nsw i32 %.14765.us.us.us.us.us, 1
  %40 = sext i32 %.14765.us.us.us.us.us to i64
  %41 = getelementptr inbounds [10 x i32], ptr %8, i64 0, i64 %40
  %42 = trunc nuw nsw i64 %indvars.iv131 to i32
  store i32 %42, ptr %41, align 4, !tbaa !5
  store i8 1, ptr %15, align 1, !tbaa !9
  br label %.loopexit.us.us.us.us.us

._crit_edge.split.us.us.us.split.us.us:           ; preds = %.loopexit.us.us.us.us.us
  br i1 %.2.us.us.us.us.us, label %.critedge56.us.us.us, label %.split99.us, !llvm.loop !20

.critedge56.us:                                   ; preds = %.critedge56.us.preheader, %._crit_edge.split.split.us91
  %.046.us = phi i32 [ %.3.us88.lcssa, %._crit_edge.split.split.us91 ], [ 0, %.critedge56.us.preheader ]
  %.not = icmp slt i32 %.046.us, %0
  br i1 %.not, label %.preheader57.us.preheader, label %.split.us

.preheader57.us.preheader:                        ; preds = %.critedge56.us
  br i1 %14, label %._crit_edge.split.split.us91.unr-lcssa, label %.preheader57.us

.preheader57.us:                                  ; preds = %.preheader57.us.preheader, %53
  %indvars.iv = phi i64 [ %indvars.iv.next.1, %53 ], [ 0, %.preheader57.us.preheader ]
  %.04466.us86 = phi i1 [ %.2.us89.1, %53 ], [ false, %.preheader57.us.preheader ]
  %.14765.us87 = phi i32 [ %.3.us88.1, %53 ], [ %.046.us, %.preheader57.us.preheader ]
  %niter = phi i64 [ %niter.next.1, %53 ], [ 0, %.preheader57.us.preheader ]
  %43 = getelementptr inbounds [10 x i8], ptr %7, i64 0, i64 %indvars.iv
  %44 = load i8, ptr %43, align 1, !tbaa !9, !range !11, !noundef !12
  %45 = trunc nuw i8 %44 to i1
  br i1 %45, label %.preheader57.us.1, label %.preheader.us90

.preheader57.us.1:                                ; preds = %.preheader.us90, %.preheader57.us
  %.3.us88 = phi i32 [ %.14765.us87, %.preheader57.us ], [ %54, %.preheader.us90 ]
  %.2.us89 = phi i1 [ %.04466.us86, %.preheader57.us ], [ true, %.preheader.us90 ]
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %46 = getelementptr inbounds [10 x i8], ptr %7, i64 0, i64 %indvars.iv.next
  %47 = load i8, ptr %46, align 1, !tbaa !9, !range !11, !noundef !12
  %48 = trunc nuw i8 %47 to i1
  br i1 %48, label %53, label %.preheader.us90.1

.preheader.us90.1:                                ; preds = %.preheader57.us.1
  %49 = add nsw i32 %.3.us88, 1
  %50 = sext i32 %.3.us88 to i64
  %51 = getelementptr inbounds [10 x i32], ptr %8, i64 0, i64 %50
  %52 = trunc nuw nsw i64 %indvars.iv.next to i32
  store i32 %52, ptr %51, align 4, !tbaa !5
  store i8 1, ptr %46, align 1, !tbaa !9
  br label %53

53:                                               ; preds = %.preheader.us90.1, %.preheader57.us.1
  %.3.us88.1 = phi i32 [ %.3.us88, %.preheader57.us.1 ], [ %49, %.preheader.us90.1 ]
  %.2.us89.1 = phi i1 [ %.2.us89, %.preheader57.us.1 ], [ true, %.preheader.us90.1 ]
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 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.split.split.us91.unr-lcssa, label %.preheader57.us, !llvm.loop !19

.preheader.us90:                                  ; preds = %.preheader57.us
  %54 = add nsw i32 %.14765.us87, 1
  %55 = sext i32 %.14765.us87 to i64
  %56 = getelementptr inbounds [10 x i32], ptr %8, i64 0, i64 %55
  %57 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %57, ptr %56, align 4, !tbaa !5
  store i8 1, ptr %43, align 1, !tbaa !9
  br label %.preheader57.us.1

._crit_edge.split.split.us91.unr-lcssa:           ; preds = %53, %.preheader57.us.preheader
  %.3.us88.lcssa.ph = phi i32 [ poison, %.preheader57.us.preheader ], [ %.3.us88.1, %53 ]
  %.2.us89.lcssa.ph = phi i1 [ poison, %.preheader57.us.preheader ], [ %.2.us89.1, %53 ]
  %indvars.iv.unr = phi i64 [ 0, %.preheader57.us.preheader ], [ %indvars.iv.next.1, %53 ]
  %.04466.us86.unr = phi i1 [ false, %.preheader57.us.preheader ], [ %.2.us89.1, %53 ]
  %.14765.us87.unr = phi i32 [ %.046.us, %.preheader57.us.preheader ], [ %.3.us88.1, %53 ]
  br i1 %lcmp.mod.not, label %._crit_edge.split.split.us91, label %.preheader57.us.epil

.preheader57.us.epil:                             ; preds = %._crit_edge.split.split.us91.unr-lcssa
  %58 = getelementptr inbounds [10 x i8], ptr %7, i64 0, i64 %indvars.iv.unr
  %59 = load i8, ptr %58, align 1, !tbaa !9, !range !11, !noundef !12
  %60 = trunc nuw i8 %59 to i1
  br i1 %60, label %._crit_edge.split.split.us91, label %.preheader.us90.epil

.preheader.us90.epil:                             ; preds = %.preheader57.us.epil
  %61 = add nsw i32 %.14765.us87.unr, 1
  %62 = sext i32 %.14765.us87.unr to i64
  %63 = getelementptr inbounds [10 x i32], ptr %8, i64 0, i64 %62
  %64 = trunc nuw nsw i64 %indvars.iv.unr to i32
  store i32 %64, ptr %63, align 4, !tbaa !5
  store i8 1, ptr %58, align 1, !tbaa !9
  br label %._crit_edge.split.split.us91

._crit_edge.split.split.us91:                     ; preds = %.preheader57.us.epil, %.preheader.us90.epil, %._crit_edge.split.split.us91.unr-lcssa
  %.3.us88.lcssa = phi i32 [ %.3.us88.lcssa.ph, %._crit_edge.split.split.us91.unr-lcssa ], [ %.14765.us87.unr, %.preheader57.us.epil ], [ %61, %.preheader.us90.epil ]
  %.2.us89.lcssa = phi i1 [ %.2.us89.lcssa.ph, %._crit_edge.split.split.us91.unr-lcssa ], [ %.04466.us86.unr, %.preheader57.us.epil ], [ true, %.preheader.us90.epil ]
  br i1 %.2.us89.lcssa, label %.critedge56.us, label %.split99.us, !llvm.loop !20

.split.us.thread:                                 ; preds = %.critedge56.preheader.thread, %.critedge56.preheader
  %65 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %.split99.us

.split.us:                                        ; preds = %.critedge56.us
  %66 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  br i1 %13, label %.lr.ph114.preheader, label %.split99.us

.lr.ph114.preheader.critedge:                     ; preds = %.critedge56.us.us.us
  %67 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %.lr.ph114.preheader

.lr.ph114.preheader:                              ; preds = %.lr.ph114.preheader.critedge, %.split.us
  %wide.trip.count138 = zext nneg i32 %0 to i64
  br label %.lr.ph114

.lr.ph114:                                        ; preds = %.lr.ph114.preheader, %.lr.ph114
  %indvars.iv135 = phi i64 [ 0, %.lr.ph114.preheader ], [ %indvars.iv.next136, %.lr.ph114 ]
  %68 = getelementptr inbounds [10 x i32], ptr %8, i64 0, i64 %indvars.iv135
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %69)
  %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 %.split99.us, label %.lr.ph114, !llvm.loop !21

.split99.us:                                      ; preds = %._crit_edge.split.split.us91, %._crit_edge.split.us.us.us.split.us.us, %.lr.ph114, %.split.us, %.split.us.thread
  %.str.sink = phi ptr [ @.str.3, %.split.us.thread ], [ @.str.3, %.split.us ], [ @.str.3, %.lr.ph114 ], [ @.str, %._crit_edge.split.us.us.us.split.us.us ], [ @.str, %._crit_edge.split.split.us91 ]
  %71 = phi i1 [ true, %.split.us.thread ], [ true, %.split.us ], [ true, %.lr.ph114 ], [ false, %._crit_edge.split.us.us.us.split.us.us ], [ false, %._crit_edge.split.split.us91 ]
  %72 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.sink)
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #5
  ret i1 %71
}

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

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

attributes #0 = { nofree 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 = !{!10, !10, i64 0}
!10 = !{!"_Bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14, !16, !17}
!16 = !{!"llvm.loop.isvectorized", i32 1}
!17 = !{!"llvm.loop.unroll.runtime.disable"}
!18 = distinct !{!18, !14, !17, !16}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}
!21 = distinct !{!21, !14}


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