; LLVM IR from ShahjalalShohag/code-library :: Data Structures/MOs Online.ll (Z5queryii)

; 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.MEX = type { [200002 x i32], [200002 x i32] }

@t = external dso_local global [286 x %struct.MEX], align 16
@ds = external dso_local global %struct.MEX, align 4
@st = external dso_local global [23 x i32], align 16
@en = external dso_local global [23 x i32], align 16
@BC = external dso_local global i32, align 4
@a = external dso_local global [100001 x i32], align 16
@I = external dso_local global [100001 x i32], align 16

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z5queryii(i32 noundef %0, i32 noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  %18 = load i32, ptr %4, align 4, !tbaa !5
  %19 = sdiv i32 %18, 4500
  store i32 %19, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  %20 = load i32, ptr %5, align 4, !tbaa !5
  %21 = sdiv i32 %20, 4500
  store i32 %21, ptr %7, align 4, !tbaa !5
  %22 = load i32, ptr %5, align 4, !tbaa !5
  %23 = load i32, ptr %7, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [23 x i32], ptr @en, i64 0, i64 %24
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %27 = icmp ne i32 %22, %26
  br i1 %27, label %28, label %31

28:                                               ; preds = %2
  %29 = load i32, ptr %7, align 4, !tbaa !5
  %30 = add nsw i32 %29, -1
  store i32 %30, ptr %7, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %28, %2
  %32 = load i32, ptr %4, align 4, !tbaa !5
  %33 = load i32, ptr %6, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [23 x i32], ptr @st, i64 0, i64 %34
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = icmp ne i32 %32, %36
  br i1 %37, label %38, label %41

38:                                               ; preds = %31
  %39 = load i32, ptr %6, align 4, !tbaa !5
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %6, align 4, !tbaa !5
  br label %41

41:                                               ; preds = %38, %31
  %42 = load i32, ptr %7, align 4, !tbaa !5
  %43 = load i32, ptr %6, align 4, !tbaa !5
  %44 = icmp slt i32 %42, %43
  br i1 %44, label %45, label %78

45:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  %46 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %46, ptr %8, align 4, !tbaa !5
  br label %47

47:                                               ; preds = %57, %45
  %48 = load i32, ptr %8, align 4, !tbaa !5
  %49 = load i32, ptr %5, align 4, !tbaa !5
  %50 = icmp sle i32 %48, %49
  br i1 %50, label %52, label %51

51:                                               ; preds = %47
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  br label %60

52:                                               ; preds = %47
  %53 = load i32, ptr %8, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !5
  call void @_ZN3MEX3addEi(ptr noundef nonnull align 4 dereferenceable(1600016) @ds, i32 noundef %56)
  br label %57

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

60:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  %61 = call noundef i32 @_ZN3MEX3getEv(ptr noundef nonnull align 4 dereferenceable(1600016) @ds)
  store i32 %61, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  %62 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %62, ptr %10, align 4, !tbaa !5
  br label %63

63:                                               ; preds = %73, %60
  %64 = load i32, ptr %10, align 4, !tbaa !5
  %65 = load i32, ptr %5, align 4, !tbaa !5
  %66 = icmp sle i32 %64, %65
  br i1 %66, label %68, label %67

67:                                               ; preds = %63
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  br label %76

68:                                               ; preds = %63
  %69 = load i32, ptr %10, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %70
  %72 = load i32, ptr %71, align 4, !tbaa !5
  call void @_ZN3MEX3delEi(ptr noundef nonnull align 4 dereferenceable(1600016) @ds, i32 noundef %72)
  br label %73

73:                                               ; preds = %68
  %74 = load i32, ptr %10, align 4, !tbaa !5
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr %10, align 4, !tbaa !5
  br label %63, !llvm.loop !11

76:                                               ; preds = %67
  %77 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %77, ptr %3, align 4
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  br label %178

78:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  %79 = load i32, ptr %6, align 4, !tbaa !5
  %80 = load i32, ptr @BC, align 4, !tbaa !5
  %81 = mul nsw i32 %79, %80
  %82 = load i32, ptr %7, align 4, !tbaa !5
  %83 = add nsw i32 %81, %82
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [100001 x i32], ptr @I, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !5
  store i32 %86, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  %87 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %87, ptr %13, align 4, !tbaa !5
  br label %88

88:                                               ; preds = %104, %78
  %89 = load i32, ptr %13, align 4, !tbaa !5
  %90 = load i32, ptr %6, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [23 x i32], ptr @st, i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %94 = icmp slt i32 %89, %93
  br i1 %94, label %96, label %95

95:                                               ; preds = %88
  store i32 8, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  br label %107

96:                                               ; preds = %88
  %97 = load i32, ptr %12, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [286 x %struct.MEX], ptr @t, i64 0, i64 %98
  %100 = load i32, ptr %13, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !5
  call void @_ZN3MEX3addEi(ptr noundef nonnull align 4 dereferenceable(1600016) %99, i32 noundef %103)
  br label %104

104:                                              ; preds = %96
  %105 = load i32, ptr %13, align 4, !tbaa !5
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %13, align 4, !tbaa !5
  br label %88, !llvm.loop !12

107:                                              ; preds = %95
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  %108 = load i32, ptr %7, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [23 x i32], ptr @en, i64 0, i64 %109
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %14, align 4, !tbaa !5
  br label %113

113:                                              ; preds = %126, %107
  %114 = load i32, ptr %14, align 4, !tbaa !5
  %115 = load i32, ptr %5, align 4, !tbaa !5
  %116 = icmp sle i32 %114, %115
  br i1 %116, label %118, label %117

117:                                              ; preds = %113
  store i32 11, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  br label %129

118:                                              ; preds = %113
  %119 = load i32, ptr %12, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [286 x %struct.MEX], ptr @t, i64 0, i64 %120
  %122 = load i32, ptr %14, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !5
  call void @_ZN3MEX3addEi(ptr noundef nonnull align 4 dereferenceable(1600016) %121, i32 noundef %125)
  br label %126

126:                                              ; preds = %118
  %127 = load i32, ptr %14, align 4, !tbaa !5
  %128 = add nsw i32 %127, 1
  store i32 %128, ptr %14, align 4, !tbaa !5
  br label %113, !llvm.loop !13

129:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  %130 = load i32, ptr %12, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [286 x %struct.MEX], ptr @t, i64 0, i64 %131
  %133 = call noundef i32 @_ZN3MEX3getEv(ptr noundef nonnull align 4 dereferenceable(1600016) %132)
  store i32 %133, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  %134 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %134, ptr %16, align 4, !tbaa !5
  br label %135

135:                                              ; preds = %151, %129
  %136 = load i32, ptr %16, align 4, !tbaa !5
  %137 = load i32, ptr %6, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [23 x i32], ptr @st, i64 0, i64 %138
  %140 = load i32, ptr %139, align 4, !tbaa !5
  %141 = icmp slt i32 %136, %140
  br i1 %141, label %143, label %142

142:                                              ; preds = %135
  store i32 14, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  br label %154

143:                                              ; preds = %135
  %144 = load i32, ptr %12, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [286 x %struct.MEX], ptr @t, i64 0, i64 %145
  %147 = load i32, ptr %16, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %148
  %150 = load i32, ptr %149, align 4, !tbaa !5
  call void @_ZN3MEX3delEi(ptr noundef nonnull align 4 dereferenceable(1600016) %146, i32 noundef %150)
  br label %151

151:                                              ; preds = %143
  %152 = load i32, ptr %16, align 4, !tbaa !5
  %153 = add nsw i32 %152, 1
  store i32 %153, ptr %16, align 4, !tbaa !5
  br label %135, !llvm.loop !14

154:                                              ; preds = %142
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  %155 = load i32, ptr %7, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [23 x i32], ptr @en, i64 0, i64 %156
  %158 = load i32, ptr %157, align 4, !tbaa !5
  %159 = add nsw i32 %158, 1
  store i32 %159, ptr %17, align 4, !tbaa !5
  br label %160

160:                                              ; preds = %173, %154
  %161 = load i32, ptr %17, align 4, !tbaa !5
  %162 = load i32, ptr %5, align 4, !tbaa !5
  %163 = icmp sle i32 %161, %162
  br i1 %163, label %165, label %164

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

165:                                              ; preds = %160
  %166 = load i32, ptr %12, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [286 x %struct.MEX], ptr @t, i64 0, i64 %167
  %169 = load i32, ptr %17, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %170
  %172 = load i32, ptr %171, align 4, !tbaa !5
  call void @_ZN3MEX3delEi(ptr noundef nonnull align 4 dereferenceable(1600016) %168, i32 noundef %172)
  br label %173

173:                                              ; preds = %165
  %174 = load i32, ptr %17, align 4, !tbaa !5
  %175 = add nsw i32 %174, 1
  store i32 %175, ptr %17, align 4, !tbaa !5
  br label %160, !llvm.loop !15

176:                                              ; preds = %164
  %177 = load i32, ptr %15, align 4, !tbaa !5
  store i32 %177, ptr %3, align 4
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  br label %178

178:                                              ; preds = %176, %76
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  %179 = load i32, ptr %3, align 4
  ret i32 %179
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3MEX3addEi(ptr noundef nonnull align 4 dereferenceable(1600016), i32 noundef) #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN3MEX3getEv(ptr noundef nonnull align 4 dereferenceable(1600016)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3MEX3delEi(ptr noundef nonnull align 4 dereferenceable(1600016), i32 noundef) #2 align 2

attributes #0 = { mustprogress 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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

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

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


; 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.MEX = type { [200002 x i32], [200002 x i32] }

@t = external dso_local global [286 x %struct.MEX], align 16
@ds = external dso_local global %struct.MEX, align 4
@st = external dso_local local_unnamed_addr global [23 x i32], align 16
@en = external dso_local local_unnamed_addr global [23 x i32], align 16
@BC = external dso_local local_unnamed_addr global i32, align 4
@a = external dso_local local_unnamed_addr global [100001 x i32], align 16
@I = external dso_local local_unnamed_addr global [100001 x i32], align 16

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i32 @_Z5queryii(i32 noundef %0, i32 noundef %1) local_unnamed_addr #0 {
  %3 = sdiv i32 %0, 4500
  %4 = sdiv i32 %1, 4500
  %5 = sext i32 %4 to i64
  %6 = getelementptr inbounds [23 x i32], ptr @en, i64 0, i64 %5
  %7 = load i32, ptr %6, align 4, !tbaa !5
  %.not = icmp ne i32 %7, %1
  %8 = sext i1 %.not to i32
  %spec.select = add nsw i32 %4, %8
  %9 = sext i32 %3 to i64
  %10 = getelementptr inbounds [23 x i32], ptr @st, i64 0, i64 %9
  %11 = load i32, ptr %10, align 4, !tbaa !5
  %.not59 = icmp ne i32 %11, %0
  %12 = zext i1 %.not59 to i32
  %.054 = add nsw i32 %3, %12
  %13 = icmp slt i32 %spec.select, %.054
  br i1 %13, label %.preheader, label %24

.preheader:                                       ; preds = %2
  %.not6280 = icmp sgt i32 %0, %1
  br i1 %.not6280, label %._crit_edge83.thread, label %.lr.ph82.preheader

._crit_edge83.thread:                             ; preds = %.preheader
  %14 = tail call noundef i32 @_ZN3MEX3getEv(ptr noundef nonnull align 4 dereferenceable(1600016) @ds)
  br label %.loopexit

.lr.ph82.preheader:                               ; preds = %.preheader
  %15 = sext i32 %0 to i64
  %16 = add i32 %1, 1
  br label %.lr.ph82

._crit_edge83:                                    ; preds = %.lr.ph82
  %17 = tail call noundef i32 @_ZN3MEX3getEv(ptr noundef nonnull align 4 dereferenceable(1600016) @ds)
  br i1 %.not6280, label %.loopexit, label %.lr.ph87.preheader

.lr.ph87.preheader:                               ; preds = %._crit_edge83
  %18 = sext i32 %0 to i64
  %19 = add i32 %1, 1
  br label %.lr.ph87

.lr.ph82:                                         ; preds = %.lr.ph82.preheader, %.lr.ph82
  %indvars.iv101 = phi i64 [ %15, %.lr.ph82.preheader ], [ %indvars.iv.next102, %.lr.ph82 ]
  %20 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %indvars.iv101
  %21 = load i32, ptr %20, align 4, !tbaa !5
  tail call void @_ZN3MEX3addEi(ptr noundef nonnull align 4 dereferenceable(1600016) @ds, i32 noundef %21)
  %indvars.iv.next102 = add nsw i64 %indvars.iv101, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next102 to i32
  %exitcond104.not = icmp eq i32 %16, %lftr.wideiv
  br i1 %exitcond104.not, label %._crit_edge83, label %.lr.ph82, !llvm.loop !9

.lr.ph87:                                         ; preds = %.lr.ph87.preheader, %.lr.ph87
  %indvars.iv105 = phi i64 [ %18, %.lr.ph87.preheader ], [ %indvars.iv.next106, %.lr.ph87 ]
  %22 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %indvars.iv105
  %23 = load i32, ptr %22, align 4, !tbaa !5
  tail call void @_ZN3MEX3delEi(ptr noundef nonnull align 4 dereferenceable(1600016) @ds, i32 noundef %23)
  %indvars.iv.next106 = add nsw i64 %indvars.iv105, 1
  %lftr.wideiv108 = trunc i64 %indvars.iv.next106 to i32
  %exitcond109.not = icmp eq i32 %19, %lftr.wideiv108
  br i1 %exitcond109.not, label %.loopexit, label %.lr.ph87, !llvm.loop !11

24:                                               ; preds = %2
  %25 = load i32, ptr @BC, align 4, !tbaa !5
  %26 = mul nsw i32 %25, %.054
  %27 = add nsw i32 %26, %spec.select
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [100001 x i32], ptr @I, i64 0, i64 %28
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %31 = sext i32 %.054 to i64
  %32 = getelementptr inbounds [23 x i32], ptr @st, i64 0, i64 %31
  %33 = load i32, ptr %32, align 4, !tbaa !5
  %34 = icmp sgt i32 %33, %0
  br i1 %34, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %24
  %35 = sext i32 %30 to i64
  %36 = getelementptr inbounds [286 x %struct.MEX], ptr @t, i64 0, i64 %35
  %37 = sext i32 %0 to i64
  br label %44

._crit_edge:                                      ; preds = %44, %24
  %38 = sext i32 %spec.select to i64
  %39 = getelementptr inbounds [23 x i32], ptr @en, i64 0, i64 %38
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %.not60.not67 = icmp slt i32 %40, %1
  %41 = sext i32 %30 to i64
  br i1 %.not60.not67, label %.lr.ph70, label %._crit_edge71

.lr.ph70:                                         ; preds = %._crit_edge
  %42 = getelementptr inbounds [286 x %struct.MEX], ptr @t, i64 0, i64 %41
  %43 = sext i32 %40 to i64
  %wide.trip.count = sext i32 %1 to i64
  br label %55

44:                                               ; preds = %.lr.ph, %44
  %indvars.iv = phi i64 [ %37, %.lr.ph ], [ %indvars.iv.next, %44 ]
  %45 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %indvars.iv
  %46 = load i32, ptr %45, align 4, !tbaa !5
  tail call void @_ZN3MEX3addEi(ptr noundef nonnull align 4 dereferenceable(1600016) %36, i32 noundef %46)
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %47 = load i32, ptr %32, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = icmp slt i64 %indvars.iv.next, %48
  br i1 %49, label %44, label %._crit_edge, !llvm.loop !12

._crit_edge71:                                    ; preds = %55, %._crit_edge
  %50 = getelementptr inbounds [286 x %struct.MEX], ptr @t, i64 0, i64 %41
  %51 = tail call noundef i32 @_ZN3MEX3getEv(ptr noundef nonnull align 4 dereferenceable(1600016) %50)
  %52 = load i32, ptr %32, align 4, !tbaa !5
  %53 = icmp sgt i32 %52, %0
  br i1 %53, label %.lr.ph74.preheader, label %._crit_edge75

.lr.ph74.preheader:                               ; preds = %._crit_edge71
  %54 = sext i32 %0 to i64
  br label %.lr.ph74

55:                                               ; preds = %.lr.ph70, %55
  %indvars.iv90 = phi i64 [ %43, %.lr.ph70 ], [ %indvars.iv.next91, %55 ]
  %indvars.iv.next91 = add nsw i64 %indvars.iv90, 1
  %56 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %indvars.iv.next91
  %57 = load i32, ptr %56, align 4, !tbaa !5
  tail call void @_ZN3MEX3addEi(ptr noundef nonnull align 4 dereferenceable(1600016) %42, i32 noundef %57)
  %exitcond.not = icmp eq i64 %indvars.iv.next91, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge71, label %55, !llvm.loop !13

._crit_edge75:                                    ; preds = %.lr.ph74, %._crit_edge71
  %58 = load i32, ptr %39, align 4, !tbaa !5
  %.not61.not76 = icmp slt i32 %58, %1
  br i1 %.not61.not76, label %.lr.ph79.preheader, label %.loopexit

.lr.ph79.preheader:                               ; preds = %._crit_edge75
  %59 = sext i32 %58 to i64
  %wide.trip.count99 = sext i32 %1 to i64
  br label %.lr.ph79

.lr.ph74:                                         ; preds = %.lr.ph74.preheader, %.lr.ph74
  %indvars.iv93 = phi i64 [ %54, %.lr.ph74.preheader ], [ %indvars.iv.next94, %.lr.ph74 ]
  %60 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %indvars.iv93
  %61 = load i32, ptr %60, align 4, !tbaa !5
  tail call void @_ZN3MEX3delEi(ptr noundef nonnull align 4 dereferenceable(1600016) %50, i32 noundef %61)
  %indvars.iv.next94 = add nsw i64 %indvars.iv93, 1
  %62 = load i32, ptr %32, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = icmp slt i64 %indvars.iv.next94, %63
  br i1 %64, label %.lr.ph74, label %._crit_edge75, !llvm.loop !14

.lr.ph79:                                         ; preds = %.lr.ph79.preheader, %.lr.ph79
  %indvars.iv96 = phi i64 [ %59, %.lr.ph79.preheader ], [ %indvars.iv.next97, %.lr.ph79 ]
  %indvars.iv.next97 = add nsw i64 %indvars.iv96, 1
  %65 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %indvars.iv.next97
  %66 = load i32, ptr %65, align 4, !tbaa !5
  tail call void @_ZN3MEX3delEi(ptr noundef nonnull align 4 dereferenceable(1600016) %50, i32 noundef %66)
  %exitcond100.not = icmp eq i64 %indvars.iv.next97, %wide.trip.count99
  br i1 %exitcond100.not, label %.loopexit, label %.lr.ph79, !llvm.loop !15

.loopexit:                                        ; preds = %.lr.ph79, %.lr.ph87, %._crit_edge83.thread, %._crit_edge75, %._crit_edge83
  %.051 = phi i32 [ %17, %._crit_edge83 ], [ %51, %._crit_edge75 ], [ %14, %._crit_edge83.thread ], [ %17, %.lr.ph87 ], [ %51, %.lr.ph79 ]
  ret i32 %.051
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3MEX3addEi(ptr noundef nonnull align 4 dereferenceable(1600016), i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN3MEX3getEv(ptr noundef nonnull align 4 dereferenceable(1600016)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3MEX3delEi(ptr noundef nonnull align 4 dereferenceable(1600016), i32 noundef) local_unnamed_addr #0 align 2

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

!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++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}


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