; LLVM IR from sbshah97/DS-Algo-Handbook :: labs/lab9/code (interval_bottom)

; 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.interval = type { i32, i32, i32 }

@in = external dso_local global [4 x %struct.interval], align 16
@order = external dso_local global [4 x %struct.interval], align 16
@prev = external dso_local global [4 x i32], align 16
@m = external dso_local global [4 x i32], align 16
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z4copyii(i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3maxii(i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5printi(i32 noundef) #1

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 10, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !5
  store i32 2, ptr @in, align 16, !tbaa !9
  store i32 4, ptr getelementptr inbounds (%struct.interval, ptr @in, i32 0, i32 1), align 4, !tbaa !11
  store i32 8, ptr getelementptr inbounds (%struct.interval, ptr @in, i32 0, i32 2), align 8, !tbaa !12
  store i32 0, ptr getelementptr inbounds ([4 x %struct.interval], ptr @in, i64 0, i64 1), align 4, !tbaa !9
  store i32 3, ptr getelementptr inbounds (%struct.interval, ptr getelementptr inbounds ([4 x %struct.interval], ptr @in, i64 0, i64 1), i32 0, i32 1), align 4, !tbaa !11
  store i32 10, ptr getelementptr inbounds (%struct.interval, ptr getelementptr inbounds ([4 x %struct.interval], ptr @in, i64 0, i64 1), i32 0, i32 2), align 4, !tbaa !12
  store i32 1, ptr getelementptr inbounds ([4 x %struct.interval], ptr @in, i64 0, i64 2), align 8, !tbaa !9
  store i32 5, ptr getelementptr inbounds (%struct.interval, ptr getelementptr inbounds ([4 x %struct.interval], ptr @in, i64 0, i64 2), i32 0, i32 1), align 4, !tbaa !11
  store i32 6, ptr getelementptr inbounds (%struct.interval, ptr getelementptr inbounds ([4 x %struct.interval], ptr @in, i64 0, i64 2), i32 0, i32 2), align 8, !tbaa !12
  store i32 3, ptr getelementptr inbounds ([4 x %struct.interval], ptr @in, i64 0, i64 3), align 4, !tbaa !9
  store i32 6, ptr getelementptr inbounds (%struct.interval, ptr getelementptr inbounds ([4 x %struct.interval], ptr @in, i64 0, i64 3), i32 0, i32 1), align 4, !tbaa !11
  store i32 4, ptr getelementptr inbounds (%struct.interval, ptr getelementptr inbounds ([4 x %struct.interval], ptr @in, i64 0, i64 3), i32 0, i32 2), align 4, !tbaa !12
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %7

7:                                                ; preds = %49, %0
  %8 = load i32, ptr %4, align 4, !tbaa !5
  %9 = icmp slt i32 %8, 4
  br i1 %9, label %10, label %52

10:                                               ; preds = %7
  store i32 10, ptr %5, align 4, !tbaa !5
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %11

11:                                               ; preds = %38, %10
  %12 = load i32, ptr %2, align 4, !tbaa !5
  %13 = icmp slt i32 %12, 4
  br i1 %13, label %14, label %41

14:                                               ; preds = %11
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds [4 x %struct.interval], ptr @in, i64 0, i64 %16
  %18 = getelementptr inbounds %struct.interval, ptr %17, i32 0, i32 1
  %19 = load i32, ptr %18, align 4, !tbaa !11
  %20 = load i32, ptr %5, align 4, !tbaa !5
  %21 = icmp slt i32 %19, %20
  br i1 %21, label %22, label %37

22:                                               ; preds = %14
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [4 x %struct.interval], ptr @in, i64 0, i64 %24
  %26 = getelementptr inbounds %struct.interval, ptr %25, i32 0, i32 1
  %27 = load i32, ptr %26, align 4, !tbaa !11
  %28 = load i32, ptr %6, align 4, !tbaa !5
  %29 = icmp sgt i32 %27, %28
  br i1 %29, label %30, label %37

30:                                               ; preds = %22
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [4 x %struct.interval], ptr @in, i64 0, i64 %32
  %34 = getelementptr inbounds %struct.interval, ptr %33, i32 0, i32 1
  %35 = load i32, ptr %34, align 4, !tbaa !11
  store i32 %35, ptr %5, align 4, !tbaa !5
  %36 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %36, ptr %3, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %30, %22, %14
  br label %38

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

41:                                               ; preds = %11
  %42 = load i32, ptr %3, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [4 x %struct.interval], ptr @in, i64 0, i64 %43
  %45 = getelementptr inbounds %struct.interval, ptr %44, i32 0, i32 1
  %46 = load i32, ptr %45, align 4, !tbaa !11
  store i32 %46, ptr %6, align 4, !tbaa !5
  %47 = load i32, ptr %3, align 4, !tbaa !5
  %48 = load i32, ptr %4, align 4, !tbaa !5
  call void @_Z4copyii(i32 noundef %47, i32 noundef %48)
  br label %49

49:                                               ; preds = %41
  %50 = load i32, ptr %4, align 4, !tbaa !5
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %4, align 4, !tbaa !5
  br label %7, !llvm.loop !15

52:                                               ; preds = %7
  %53 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %64, %52
  %55 = load i32, ptr %4, align 4, !tbaa !5
  %56 = icmp slt i32 %55, 4
  br i1 %56, label %57, label %67

57:                                               ; preds = %54
  %58 = load i32, ptr %4, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [4 x %struct.interval], ptr @order, i64 0, i64 %59
  %61 = getelementptr inbounds %struct.interval, ptr %60, i32 0, i32 1
  %62 = load i32, ptr %61, align 4, !tbaa !11
  %63 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %62)
  br label %64

64:                                               ; preds = %57
  %65 = load i32, ptr %4, align 4, !tbaa !5
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %4, align 4, !tbaa !5
  br label %54, !llvm.loop !16

67:                                               ; preds = %54
  store i32 3, ptr %4, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %98, %67
  %69 = load i32, ptr %4, align 4, !tbaa !5
  %70 = icmp sge i32 %69, 0
  br i1 %70, label %71, label %101

71:                                               ; preds = %68
  %72 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %72, ptr %2, align 4, !tbaa !5
  br label %73

73:                                               ; preds = %94, %71
  %74 = load i32, ptr %2, align 4, !tbaa !5
  %75 = icmp sge i32 %74, 0
  br i1 %75, label %76, label %97

76:                                               ; preds = %73
  %77 = load i32, ptr %4, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [4 x %struct.interval], ptr @order, i64 0, i64 %78
  %80 = getelementptr inbounds %struct.interval, ptr %79, i32 0, i32 0
  %81 = load i32, ptr %80, align 4, !tbaa !9
  %82 = load i32, ptr %2, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [4 x %struct.interval], ptr @order, i64 0, i64 %83
  %85 = getelementptr inbounds %struct.interval, ptr %84, i32 0, i32 1
  %86 = load i32, ptr %85, align 4, !tbaa !11
  %87 = icmp sge i32 %81, %86
  br i1 %87, label %88, label %93

88:                                               ; preds = %76
  %89 = load i32, ptr %2, align 4, !tbaa !5
  %90 = load i32, ptr %4, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [4 x i32], ptr @prev, i64 0, i64 %91
  store i32 %89, ptr %92, align 4, !tbaa !5
  br label %97

93:                                               ; preds = %76
  br label %94

94:                                               ; preds = %93
  %95 = load i32, ptr %2, align 4, !tbaa !5
  %96 = add nsw i32 %95, -1
  store i32 %96, ptr %2, align 4, !tbaa !5
  br label %73, !llvm.loop !17

97:                                               ; preds = %88, %73
  br label %98

98:                                               ; preds = %97
  %99 = load i32, ptr %4, align 4, !tbaa !5
  %100 = add nsw i32 %99, -1
  store i32 %100, ptr %4, align 4, !tbaa !5
  br label %68, !llvm.loop !18

101:                                              ; preds = %68
  %102 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %103

103:                                              ; preds = %112, %101
  %104 = load i32, ptr %4, align 4, !tbaa !5
  %105 = icmp slt i32 %104, 4
  br i1 %105, label %106, label %115

106:                                              ; preds = %103
  %107 = load i32, ptr %4, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [4 x i32], ptr @prev, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %110)
  br label %112

112:                                              ; preds = %106
  %113 = load i32, ptr %4, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %4, align 4, !tbaa !5
  br label %103, !llvm.loop !19

115:                                              ; preds = %103
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %116

116:                                              ; preds = %155, %115
  %117 = load i32, ptr %4, align 4, !tbaa !5
  %118 = icmp slt i32 %117, 4
  br i1 %118, label %119, label %158

119:                                              ; preds = %116
  %120 = load i32, ptr %4, align 4, !tbaa !5
  %121 = icmp eq i32 %120, 0
  br i1 %121, label %122, label %131

122:                                              ; preds = %119
  %123 = load i32, ptr %4, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [4 x %struct.interval], ptr @order, i64 0, i64 %124
  %126 = getelementptr inbounds %struct.interval, ptr %125, i32 0, i32 2
  %127 = load i32, ptr %126, align 4, !tbaa !12
  %128 = load i32, ptr %4, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [4 x i32], ptr @m, i64 0, i64 %129
  store i32 %127, ptr %130, align 4, !tbaa !5
  br label %154

131:                                              ; preds = %119
  %132 = load i32, ptr %4, align 4, !tbaa !5
  %133 = sub nsw i32 %132, 1
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [4 x i32], ptr @m, i64 0, i64 %134
  %136 = load i32, ptr %135, align 4, !tbaa !5
  %137 = load i32, ptr %4, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [4 x %struct.interval], ptr @order, i64 0, i64 %138
  %140 = getelementptr inbounds %struct.interval, ptr %139, i32 0, i32 2
  %141 = load i32, ptr %140, align 4, !tbaa !12
  %142 = load i32, ptr %4, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [4 x i32], ptr @prev, i64 0, i64 %143
  %145 = load i32, ptr %144, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [4 x i32], ptr @m, i64 0, i64 %146
  %148 = load i32, ptr %147, align 4, !tbaa !5
  %149 = add nsw i32 %141, %148
  %150 = call noundef i32 @_Z3maxii(i32 noundef %136, i32 noundef %149)
  %151 = load i32, ptr %4, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [4 x i32], ptr @m, i64 0, i64 %152
  store i32 %150, ptr %153, align 4, !tbaa !5
  br label %154

154:                                              ; preds = %131, %122
  br label %155

155:                                              ; preds = %154
  %156 = load i32, ptr %4, align 4, !tbaa !5
  %157 = add nsw i32 %156, 1
  store i32 %157, ptr %4, align 4, !tbaa !5
  br label %116, !llvm.loop !20

158:                                              ; preds = %116
  %159 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @m, i64 0, i64 3), align 4, !tbaa !5
  %160 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %159)
  %161 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  call void @_Z5printi(i32 noundef 3)
  %162 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  ret i32 0
}

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

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

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" }
attributes #1 = { 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 #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 = { mustprogress norecurse 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 #4 = { nocallback nofree nosync 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++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"_ZTS8interval", !6, i64 0, !6, i64 4, !6, i64 8}
!11 = !{!10, !6, i64 4}
!12 = !{!10, !6, i64 8}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}


; 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.interval = type { i32, i32, i32 }

@in = external dso_local local_unnamed_addr global [4 x %struct.interval], align 16
@order = external dso_local local_unnamed_addr global [4 x %struct.interval], align 16
@prev = external dso_local local_unnamed_addr global [4 x i32], align 16
@m = external dso_local local_unnamed_addr global [4 x i32], align 16
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z4copyii(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3maxii(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5printi(i32 noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
.preheader48:
  store <4 x i32> <i32 2, i32 4, i32 8, i32 0>, ptr @in, align 16, !tbaa !5
  store <4 x i32> <i32 3, i32 10, i32 1, i32 5>, ptr getelementptr inbounds (i8, ptr @in, i64 16), align 16, !tbaa !5
  store <4 x i32> <i32 6, i32 3, i32 6, i32 4>, ptr getelementptr inbounds (i8, ptr @in, i64 32), align 16, !tbaa !5
  tail call void @_Z4copyii(i32 noundef 1, i32 noundef 0)
  %0 = load i32, ptr getelementptr inbounds (i8, ptr @in, i64 4), align 4, !tbaa !9
  %1 = add i32 %0, -10
  %or.cond.163 = icmp ult i32 %1, -6
  %.1.165 = select i1 %or.cond.163, i32 10, i32 %0
  %2 = load i32, ptr getelementptr inbounds (i8, ptr @in, i64 16), align 16, !tbaa !9
  %3 = icmp slt i32 %2, %.1.165
  %4 = icmp sgt i32 %2, 3
  %or.cond.1.1 = and i1 %3, %4
  %narrow = or i1 %or.cond.1.1, %or.cond.163
  %.242.1.1 = zext i1 %narrow to i32
  %.1.1.1 = select i1 %or.cond.1.1, i32 %2, i32 %.1.165
  %5 = load i32, ptr getelementptr inbounds (i8, ptr @in, i64 28), align 4, !tbaa !9
  %6 = icmp slt i32 %5, %.1.1.1
  %7 = icmp sgt i32 %5, 3
  %or.cond.2.1 = and i1 %6, %7
  %.242.2.1 = select i1 %or.cond.2.1, i32 2, i32 %.242.1.1
  %.1.2.1 = select i1 %or.cond.2.1, i32 %5, i32 %.1.1.1
  %8 = load i32, ptr getelementptr inbounds (i8, ptr @in, i64 40), align 8, !tbaa !9
  %9 = icmp slt i32 %8, %.1.2.1
  %10 = icmp sgt i32 %8, 3
  %or.cond.3.1 = and i1 %9, %10
  %.242.3.1 = select i1 %or.cond.3.1, i32 3, i32 %.242.2.1
  %11 = zext nneg i32 %.242.3.1 to i64
  %12 = getelementptr inbounds [4 x %struct.interval], ptr @in, i64 0, i64 %11, i32 1
  %13 = load i32, ptr %12, align 4, !tbaa !9
  tail call void @_Z4copyii(i32 noundef %.242.3.1, i32 noundef 1)
  %14 = load i32, ptr getelementptr inbounds (i8, ptr @in, i64 4), align 4, !tbaa !9
  %15 = icmp slt i32 %14, 10
  %16 = icmp sgt i32 %14, %13
  %or.cond.266 = select i1 %15, i1 %16, i1 false
  %.242.267 = select i1 %or.cond.266, i32 0, i32 %.242.3.1
  %.1.268 = select i1 %or.cond.266, i32 %14, i32 10
  %17 = load i32, ptr getelementptr inbounds (i8, ptr @in, i64 16), align 16, !tbaa !9
  %18 = icmp slt i32 %17, %.1.268
  %19 = icmp sgt i32 %17, %13
  %or.cond.1.2 = select i1 %18, i1 %19, i1 false
  %.242.1.2 = select i1 %or.cond.1.2, i32 1, i32 %.242.267
  %.1.1.2 = select i1 %or.cond.1.2, i32 %17, i32 %.1.268
  %20 = load i32, ptr getelementptr inbounds (i8, ptr @in, i64 28), align 4, !tbaa !9
  %21 = icmp slt i32 %20, %.1.1.2
  %22 = icmp sgt i32 %20, %13
  %or.cond.2.2 = select i1 %21, i1 %22, i1 false
  %.242.2.2 = select i1 %or.cond.2.2, i32 2, i32 %.242.1.2
  %.1.2.2 = select i1 %or.cond.2.2, i32 %20, i32 %.1.1.2
  %23 = load i32, ptr getelementptr inbounds (i8, ptr @in, i64 40), align 8, !tbaa !9
  %24 = icmp slt i32 %23, %.1.2.2
  %25 = icmp sgt i32 %23, %13
  %or.cond.3.2 = select i1 %24, i1 %25, i1 false
  %.242.3.2 = select i1 %or.cond.3.2, i32 3, i32 %.242.2.2
  %26 = zext nneg i32 %.242.3.2 to i64
  %27 = getelementptr inbounds [4 x %struct.interval], ptr @in, i64 0, i64 %26, i32 1
  %28 = load i32, ptr %27, align 4, !tbaa !9
  tail call void @_Z4copyii(i32 noundef %.242.3.2, i32 noundef 2)
  %29 = load i32, ptr getelementptr inbounds (i8, ptr @in, i64 4), align 4, !tbaa !9
  %30 = icmp slt i32 %29, 10
  %31 = icmp sgt i32 %29, %28
  %or.cond.369 = select i1 %30, i1 %31, i1 false
  %.242.370 = select i1 %or.cond.369, i32 0, i32 %.242.3.2
  %.1.3 = select i1 %or.cond.369, i32 %29, i32 10
  %32 = load i32, ptr getelementptr inbounds (i8, ptr @in, i64 16), align 16, !tbaa !9
  %33 = icmp slt i32 %32, %.1.3
  %34 = icmp sgt i32 %32, %28
  %or.cond.1.3 = select i1 %33, i1 %34, i1 false
  %.242.1.3 = select i1 %or.cond.1.3, i32 1, i32 %.242.370
  %.1.1.3 = select i1 %or.cond.1.3, i32 %32, i32 %.1.3
  %35 = load i32, ptr getelementptr inbounds (i8, ptr @in, i64 28), align 4, !tbaa !9
  %36 = icmp slt i32 %35, %.1.1.3
  %37 = icmp sgt i32 %35, %28
  %or.cond.2.3 = select i1 %36, i1 %37, i1 false
  %.242.2.3 = select i1 %or.cond.2.3, i32 2, i32 %.242.1.3
  %.1.2.3 = select i1 %or.cond.2.3, i32 %35, i32 %.1.1.3
  %38 = load i32, ptr getelementptr inbounds (i8, ptr @in, i64 40), align 8, !tbaa !9
  %39 = icmp slt i32 %38, %.1.2.3
  %40 = icmp sgt i32 %38, %28
  %or.cond.3.3 = select i1 %39, i1 %40, i1 false
  %.242.3.3 = select i1 %or.cond.3.3, i32 3, i32 %.242.2.3
  tail call void @_Z4copyii(i32 noundef %.242.3.3, i32 noundef 3)
  %41 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %42 = load i32, ptr getelementptr inbounds (i8, ptr @order, i64 4), align 4, !tbaa !9
  %43 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %42)
  %44 = load i32, ptr getelementptr inbounds (i8, ptr @order, i64 16), align 16, !tbaa !9
  %45 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %44)
  %46 = load i32, ptr getelementptr inbounds (i8, ptr @order, i64 28), align 4, !tbaa !9
  %47 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %46)
  %48 = load i32, ptr getelementptr inbounds (i8, ptr @order, i64 40), align 8, !tbaa !9
  %49 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %48)
  %50 = load i32, ptr getelementptr inbounds (i8, ptr @order, i64 36), align 4, !tbaa !11
  %51 = load i32, ptr getelementptr inbounds (i8, ptr @order, i64 40), align 8, !tbaa !9
  %.not = icmp slt i32 %50, %51
  %.pre.pre = load i32, ptr getelementptr inbounds (i8, ptr @order, i64 28), align 4, !tbaa !9
  br i1 %.not, label %53, label %.preheader48._crit_edge

.preheader48._crit_edge:                          ; preds = %.preheader48
  %.pre78.pre.pre.pre = load i32, ptr getelementptr inbounds (i8, ptr @order, i64 16), align 16, !tbaa !9
  br label %52

52:                                               ; preds = %.preheader48._crit_edge, %55, %54, %53
  %.pre78.pre.pre = phi i32 [ %.pre78.pre.pre.pre, %.preheader48._crit_edge ], [ %.pre78.pre.pre.pre83, %53 ], [ %.pre78.pre.pre.pre83, %54 ], [ %.pre78.pre.pre.pre83, %55 ]
  %.14457.lcssa = phi i32 [ 3, %.preheader48._crit_edge ], [ 2, %53 ], [ 1, %54 ], [ 0, %55 ]
  store i32 %.14457.lcssa, ptr getelementptr inbounds (i8, ptr @prev, i64 12), align 4, !tbaa !5
  br label %.loopexit

53:                                               ; preds = %.preheader48
  %.not.173 = icmp slt i32 %50, %.pre.pre
  %.pre78.pre.pre.pre83 = load i32, ptr getelementptr inbounds (i8, ptr @order, i64 16), align 16, !tbaa !9
  br i1 %.not.173, label %54, label %52

54:                                               ; preds = %53
  %.not.274 = icmp slt i32 %50, %.pre78.pre.pre.pre83
  br i1 %.not.274, label %55, label %52

55:                                               ; preds = %54
  %56 = load i32, ptr getelementptr inbounds (i8, ptr @order, i64 4), align 4, !tbaa !9
  %.not.375 = icmp slt i32 %50, %56
  br i1 %.not.375, label %.loopexit, label %52

.loopexit:                                        ; preds = %55, %52
  %.pre78.pre = phi i32 [ %.pre78.pre.pre, %52 ], [ %.pre78.pre.pre.pre83, %55 ]
  %57 = load i32, ptr getelementptr inbounds (i8, ptr @order, i64 24), align 8, !tbaa !11
  %.not.1 = icmp slt i32 %57, %.pre.pre
  br i1 %.not.1, label %59, label %.loopexit._crit_edge

.loopexit._crit_edge:                             ; preds = %.loopexit
  %.pre79.pre.pre.pre = load i32, ptr getelementptr inbounds (i8, ptr @order, i64 4), align 4, !tbaa !9
  br label %58

58:                                               ; preds = %.loopexit._crit_edge, %60, %59
  %.pre79.pre.pre = phi i32 [ %.pre79.pre.pre.pre, %.loopexit._crit_edge ], [ %.pre79.pre.pre.pre85, %59 ], [ %.pre79.pre.pre.pre85, %60 ]
  %.14457.lcssa.1 = phi i32 [ 2, %.loopexit._crit_edge ], [ 1, %59 ], [ 0, %60 ]
  store i32 %.14457.lcssa.1, ptr getelementptr inbounds (i8, ptr @prev, i64 8), align 8, !tbaa !5
  br label %.loopexit.1

59:                                               ; preds = %.loopexit
  %.not.1.1 = icmp slt i32 %57, %.pre78.pre
  %.pre79.pre.pre.pre85 = load i32, ptr getelementptr inbounds (i8, ptr @order, i64 4), align 4, !tbaa !9
  br i1 %.not.1.1, label %60, label %58

60:                                               ; preds = %59
  %.not.1.2 = icmp slt i32 %57, %.pre79.pre.pre.pre85
  br i1 %.not.1.2, label %.loopexit.1, label %58

.loopexit.1:                                      ; preds = %60, %58
  %.pre79.pre = phi i32 [ %.pre79.pre.pre, %58 ], [ %.pre79.pre.pre.pre85, %60 ]
  %61 = load i32, ptr getelementptr inbounds (i8, ptr @order, i64 12), align 4, !tbaa !11
  %.not.2 = icmp slt i32 %61, %.pre78.pre
  br i1 %.not.2, label %63, label %62

62:                                               ; preds = %63, %.loopexit.1
  %.14457.lcssa.2 = phi i32 [ 1, %.loopexit.1 ], [ 0, %63 ]
  store i32 %.14457.lcssa.2, ptr getelementptr inbounds (i8, ptr @prev, i64 4), align 4, !tbaa !5
  br label %.loopexit.2

63:                                               ; preds = %.loopexit.1
  %.not.2.1 = icmp slt i32 %61, %.pre79.pre
  br i1 %.not.2.1, label %.loopexit.2, label %62

.loopexit.2:                                      ; preds = %63, %62
  %64 = load i32, ptr @order, align 16, !tbaa !11
  %.not.3 = icmp slt i32 %64, %.pre79.pre
  br i1 %.not.3, label %66, label %65

65:                                               ; preds = %.loopexit.2
  store i32 0, ptr @prev, align 16, !tbaa !5
  br label %66

66:                                               ; preds = %.loopexit.2, %65
  %67 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  %68 = load i32, ptr @prev, align 16, !tbaa !5
  %69 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %68)
  %70 = load i32, ptr getelementptr inbounds (i8, ptr @prev, i64 4), align 4, !tbaa !5
  %71 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %70)
  %72 = load i32, ptr getelementptr inbounds (i8, ptr @prev, i64 8), align 8, !tbaa !5
  %73 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %72)
  %74 = load i32, ptr getelementptr inbounds (i8, ptr @prev, i64 12), align 4, !tbaa !5
  %75 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %74)
  %76 = load i32, ptr getelementptr inbounds (i8, ptr @order, i64 8), align 8, !tbaa !12
  store i32 %76, ptr @m, align 16
  %77 = load i32, ptr getelementptr inbounds (i8, ptr @order, i64 20), align 4, !tbaa !12
  %78 = load i32, ptr getelementptr inbounds (i8, ptr @prev, i64 4), align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [4 x i32], ptr @m, i64 0, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = add nsw i32 %81, %77
  %83 = tail call noundef i32 @_Z3maxii(i32 noundef %76, i32 noundef %82)
  store i32 %83, ptr getelementptr inbounds (i8, ptr @m, i64 4), align 4, !tbaa !5
  %84 = load i32, ptr getelementptr inbounds (i8, ptr @order, i64 32), align 16, !tbaa !12
  %85 = load i32, ptr getelementptr inbounds (i8, ptr @prev, i64 8), align 8, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [4 x i32], ptr @m, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = add nsw i32 %88, %84
  %90 = tail call noundef i32 @_Z3maxii(i32 noundef %83, i32 noundef %89)
  store i32 %90, ptr getelementptr inbounds (i8, ptr @m, i64 8), align 8, !tbaa !5
  %91 = load i32, ptr getelementptr inbounds (i8, ptr @order, i64 44), align 4, !tbaa !12
  %92 = load i32, ptr getelementptr inbounds (i8, ptr @prev, i64 12), align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [4 x i32], ptr @m, i64 0, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %96 = add nsw i32 %95, %91
  %97 = tail call noundef i32 @_Z3maxii(i32 noundef %90, i32 noundef %96)
  store i32 %97, ptr getelementptr inbounds (i8, ptr @m, i64 12), align 4, !tbaa !5
  %98 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %97)
  %99 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  tail call void @_Z5printi(i32 noundef 3)
  %100 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  ret i32 0
}

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" }
attributes #1 = { 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 #2 = { 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 #3 = { mustprogress norecurse 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 = !{!10, !6, i64 4}
!10 = !{!"_ZTS8interval", !6, i64 0, !6, i64 4, !6, i64 8}
!11 = !{!10, !6, i64 0}
!12 = !{!10, !6, i64 8}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyPass,MergedLoadStoreMotionPass,ReassociatePass,SCCPPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass