; LLVM IR from scemama/slaterlib :: src (test)

; 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 [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [62 x i8], align 1
@__PRETTY_FUNCTION__.random_single_exc = external hidden unnamed_addr constant [75 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [20 x i8], align 1

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

; Function Attrs: nounwind
declare i32 @rand() #1

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

; Function Attrs: nounwind uwtable
define dso_local i32 @random_single_exc(i32 noundef %0, ptr noundef %1, ptr noundef %2) #2 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %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
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  store ptr %2, ptr %6, align 8, !tbaa !9
  %17 = load i32, ptr %4, align 4, !tbaa !5
  %18 = zext i32 %17 to i64
  %19 = load i32, ptr %4, align 4, !tbaa !5
  %20 = zext i32 %19 to i64
  %21 = load i32, ptr %4, align 4, !tbaa !5
  %22 = mul i32 %21, 64
  %23 = zext i32 %22 to i64
  %24 = call ptr @llvm.stacksave.p0()
  store ptr %24, ptr %7, align 8
  %25 = alloca i32, i64 %23, align 16
  store i64 %23, ptr %8, align 8
  %26 = load i32, ptr %4, align 4, !tbaa !5
  %27 = mul i32 %26, 64
  %28 = zext i32 %27 to i64
  %29 = alloca i32, i64 %28, align 16
  store i64 %28, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %45, %3
  %31 = load i32, ptr %10, align 4, !tbaa !5
  %32 = load i32, ptr %4, align 4, !tbaa !5
  %33 = icmp ult i32 %31, %32
  br i1 %33, label %34, label %48

34:                                               ; preds = %30
  %35 = load ptr, ptr %5, align 8, !tbaa !9
  %36 = load i32, ptr %10, align 4, !tbaa !5
  %37 = zext i32 %36 to i64
  %38 = getelementptr inbounds i64, ptr %35, i64 %37
  %39 = load i64, ptr %38, align 8, !tbaa !11
  %40 = xor i64 %39, -1
  %41 = load ptr, ptr %6, align 8, !tbaa !9
  %42 = load i32, ptr %10, align 4, !tbaa !5
  %43 = zext i32 %42 to i64
  %44 = getelementptr inbounds i64, ptr %41, i64 %43
  store i64 %40, ptr %44, align 8, !tbaa !11
  br label %45

45:                                               ; preds = %34
  %46 = load i32, ptr %10, align 4, !tbaa !5
  %47 = add i32 %46, 1
  store i32 %47, ptr %10, align 4, !tbaa !5
  br label %30, !llvm.loop !13

48:                                               ; preds = %30
  %49 = load i32, ptr %4, align 4, !tbaa !5
  %50 = load ptr, ptr %6, align 8, !tbaa !9
  %51 = call i32 @to_orbital_list(i32 noundef %49, ptr noundef %50, ptr noundef %29)
  store i32 %51, ptr %11, align 4, !tbaa !5
  %52 = load i32, ptr %11, align 4, !tbaa !5
  %53 = icmp ugt i32 %52, 0
  br i1 %53, label %54, label %55

54:                                               ; preds = %48
  br label %56

55:                                               ; preds = %48
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 48, ptr noundef @__PRETTY_FUNCTION__.random_single_exc) #7
  unreachable

56:                                               ; preds = %54
  %57 = call i32 @rand() #6
  %58 = load i32, ptr %11, align 4, !tbaa !5
  %59 = urem i32 %57, %58
  store i32 %59, ptr %14, align 4, !tbaa !5
  %60 = load i32, ptr %14, align 4, !tbaa !5
  %61 = zext i32 %60 to i64
  %62 = getelementptr inbounds i32, ptr %29, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !5
  store i32 %63, ptr %12, align 4, !tbaa !5
  %64 = load i32, ptr %4, align 4, !tbaa !5
  %65 = load ptr, ptr %5, align 8, !tbaa !9
  %66 = call i32 @to_orbital_list(i32 noundef %64, ptr noundef %65, ptr noundef %25)
  store i32 %66, ptr %11, align 4, !tbaa !5
  %67 = load i32, ptr %11, align 4, !tbaa !5
  %68 = icmp ugt i32 %67, 0
  br i1 %68, label %69, label %70

69:                                               ; preds = %56
  br label %71

70:                                               ; preds = %56
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 54, ptr noundef @__PRETTY_FUNCTION__.random_single_exc) #7
  unreachable

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

73:                                               ; preds = %77, %71
  %74 = load i32, ptr %13, align 4, !tbaa !5
  %75 = load i32, ptr %14, align 4, !tbaa !5
  %76 = icmp eq i32 %74, %75
  br i1 %76, label %77, label %81

77:                                               ; preds = %73
  %78 = call i32 @rand() #6
  %79 = load i32, ptr %11, align 4, !tbaa !5
  %80 = urem i32 %78, %79
  store i32 %80, ptr %13, align 4, !tbaa !5
  br label %73, !llvm.loop !15

81:                                               ; preds = %73
  %82 = load i32, ptr %13, align 4, !tbaa !5
  %83 = load i32, ptr %14, align 4, !tbaa !5
  %84 = icmp ne i32 %82, %83
  br i1 %84, label %85, label %86

85:                                               ; preds = %81
  br label %87

86:                                               ; preds = %81
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 60, ptr noundef @__PRETTY_FUNCTION__.random_single_exc) #7
  unreachable

87:                                               ; preds = %85
  %88 = load i32, ptr %13, align 4, !tbaa !5
  %89 = zext i32 %88 to i64
  %90 = getelementptr inbounds i32, ptr %25, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !5
  store i32 %91, ptr %15, align 4, !tbaa !5
  %92 = load i32, ptr %12, align 4, !tbaa !5
  %93 = load i32, ptr %13, align 4, !tbaa !5
  %94 = zext i32 %93 to i64
  %95 = getelementptr inbounds i32, ptr %25, i64 %94
  store i32 %92, ptr %95, align 4, !tbaa !5
  %96 = load i32, ptr %4, align 4, !tbaa !5
  %97 = load i32, ptr %11, align 4, !tbaa !5
  %98 = load ptr, ptr %6, align 8, !tbaa !9
  call void @of_orbital_list(i32 noundef %96, i32 noundef %97, ptr noundef %98, ptr noundef %25)
  store i32 0, ptr %16, align 4, !tbaa !5
  %99 = load i32, ptr %12, align 4, !tbaa !5
  %100 = load i32, ptr %15, align 4, !tbaa !5
  %101 = icmp ugt i32 %99, %100
  br i1 %101, label %102, label %122

102:                                              ; preds = %87
  br label %103

103:                                              ; preds = %120, %102
  %104 = load i32, ptr %13, align 4, !tbaa !5
  %105 = load i32, ptr %11, align 4, !tbaa !5
  %106 = sub i32 %105, 1
  %107 = icmp ult i32 %104, %106
  br i1 %107, label %108, label %121

108:                                              ; preds = %103
  %109 = load i32, ptr %13, align 4, !tbaa !5
  %110 = add i32 %109, 1
  store i32 %110, ptr %13, align 4, !tbaa !5
  %111 = load i32, ptr %13, align 4, !tbaa !5
  %112 = zext i32 %111 to i64
  %113 = getelementptr inbounds i32, ptr %25, i64 %112
  %114 = load i32, ptr %113, align 4, !tbaa !5
  %115 = load i32, ptr %12, align 4, !tbaa !5
  %116 = icmp ult i32 %114, %115
  br i1 %116, label %117, label %120

117:                                              ; preds = %108
  %118 = load i32, ptr %16, align 4, !tbaa !5
  %119 = add i32 %118, 1
  store i32 %119, ptr %16, align 4, !tbaa !5
  br label %120

120:                                              ; preds = %117, %108
  br label %103, !llvm.loop !16

121:                                              ; preds = %103
  br label %140

122:                                              ; preds = %87
  br label %123

123:                                              ; preds = %138, %122
  %124 = load i32, ptr %13, align 4, !tbaa !5
  %125 = icmp ugt i32 %124, 0
  br i1 %125, label %126, label %139

126:                                              ; preds = %123
  %127 = load i32, ptr %13, align 4, !tbaa !5
  %128 = add i32 %127, -1
  store i32 %128, ptr %13, align 4, !tbaa !5
  %129 = load i32, ptr %13, align 4, !tbaa !5
  %130 = zext i32 %129 to i64
  %131 = getelementptr inbounds i32, ptr %25, i64 %130
  %132 = load i32, ptr %131, align 4, !tbaa !5
  %133 = load i32, ptr %12, align 4, !tbaa !5
  %134 = icmp ugt i32 %132, %133
  br i1 %134, label %135, label %138

135:                                              ; preds = %126
  %136 = load i32, ptr %16, align 4, !tbaa !5
  %137 = add i32 %136, 1
  store i32 %137, ptr %16, align 4, !tbaa !5
  br label %138

138:                                              ; preds = %135, %126
  br label %123, !llvm.loop !17

139:                                              ; preds = %123
  br label %140

140:                                              ; preds = %139, %121
  %141 = load i32, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  %142 = load ptr, ptr %7, align 8
  call void @llvm.stackrestore.p0(ptr %142)
  ret i32 %141
}

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3

declare i32 @to_orbital_list(i32 noundef, ptr noundef, ptr noundef) #4

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #5

declare void @of_orbital_list(i32 noundef, i32 noundef, ptr noundef, ptr noundef) #4

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 = { nocallback nofree nosync nounwind willreturn }
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 = { noreturn 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 = { noreturn 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 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !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"

@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [62 x i8], align 1
@__PRETTY_FUNCTION__.random_single_exc = external hidden unnamed_addr constant [75 x i8], align 1

; Function Attrs: nounwind
declare i32 @rand() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local i32 @random_single_exc(i32 noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #1 {
  %4 = shl i32 %0, 6
  %5 = zext i32 %4 to i64
  %6 = alloca i32, i64 %5, align 16
  %7 = alloca i32, i64 %5, align 16
  %.not67 = icmp eq i32 %0, 0
  br i1 %.not67, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %3
  %8 = ptrtoint ptr %2 to i64
  %9 = ptrtoint ptr %1 to i64
  %wide.trip.count = zext i32 %0 to i64
  %min.iters.check = icmp ult i32 %0, 4
  %10 = sub i64 %8, %9
  %diff.check = icmp ult i64 %10, 32
  %or.cond = or i1 %min.iters.check, %diff.check
  br i1 %or.cond, label %.lr.ph.preheader124, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %wide.trip.count, 4294967292
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %11 = getelementptr inbounds i64, ptr %1, i64 %index
  %12 = getelementptr inbounds i8, ptr %11, i64 16
  %wide.load = load <2 x i64>, ptr %11, align 8, !tbaa !5
  %wide.load80 = load <2 x i64>, ptr %12, align 8, !tbaa !5
  %13 = xor <2 x i64> %wide.load, <i64 -1, i64 -1>
  %14 = xor <2 x i64> %wide.load80, <i64 -1, i64 -1>
  %15 = getelementptr inbounds i64, ptr %2, i64 %index
  %16 = getelementptr inbounds i8, ptr %15, i64 16
  store <2 x i64> %13, ptr %15, align 8, !tbaa !5
  store <2 x i64> %14, ptr %16, align 8, !tbaa !5
  %index.next = add nuw i64 %index, 4
  %17 = icmp eq i64 %index.next, %n.vec
  br i1 %17, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph.preheader124

.lr.ph.preheader124:                              ; preds = %middle.block, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec, %middle.block ]
  %xtraiter = and i64 %wide.trip.count, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph.prol.loopexit, label %.lr.ph.prol

.lr.ph.prol:                                      ; preds = %.lr.ph.preheader124, %.lr.ph.prol
  %indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %.lr.ph.prol ], [ %indvars.iv.ph, %.lr.ph.preheader124 ]
  %prol.iter = phi i64 [ %prol.iter.next, %.lr.ph.prol ], [ 0, %.lr.ph.preheader124 ]
  %18 = getelementptr inbounds i64, ptr %1, i64 %indvars.iv.prol
  %19 = load i64, ptr %18, align 8, !tbaa !5
  %20 = xor i64 %19, -1
  %21 = getelementptr inbounds i64, ptr %2, i64 %indvars.iv.prol
  store i64 %20, ptr %21, align 8, !tbaa !5
  %indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %.lr.ph.prol.loopexit, label %.lr.ph.prol, !llvm.loop !13

.lr.ph.prol.loopexit:                             ; preds = %.lr.ph.prol, %.lr.ph.preheader124
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %.lr.ph.preheader124 ], [ %indvars.iv.next.prol, %.lr.ph.prol ]
  %22 = sub nsw i64 %indvars.iv.ph, %wide.trip.count
  %23 = icmp ugt i64 %22, -4
  br i1 %23, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.prol.loopexit, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next.3, %.lr.ph ], [ %indvars.iv.unr, %.lr.ph.prol.loopexit ]
  %24 = getelementptr inbounds i64, ptr %1, i64 %indvars.iv
  %25 = load i64, ptr %24, align 8, !tbaa !5
  %26 = xor i64 %25, -1
  %27 = getelementptr inbounds i64, ptr %2, i64 %indvars.iv
  store i64 %26, ptr %27, align 8, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %28 = getelementptr inbounds i64, ptr %1, i64 %indvars.iv.next
  %29 = load i64, ptr %28, align 8, !tbaa !5
  %30 = xor i64 %29, -1
  %31 = getelementptr inbounds i64, ptr %2, i64 %indvars.iv.next
  store i64 %30, ptr %31, align 8, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %32 = getelementptr inbounds i64, ptr %1, i64 %indvars.iv.next.1
  %33 = load i64, ptr %32, align 8, !tbaa !5
  %34 = xor i64 %33, -1
  %35 = getelementptr inbounds i64, ptr %2, i64 %indvars.iv.next.1
  store i64 %34, ptr %35, align 8, !tbaa !5
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %36 = getelementptr inbounds i64, ptr %1, i64 %indvars.iv.next.2
  %37 = load i64, ptr %36, align 8, !tbaa !5
  %38 = xor i64 %37, -1
  %39 = getelementptr inbounds i64, ptr %2, i64 %indvars.iv.next.2
  store i64 %38, ptr %39, align 8, !tbaa !5
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
  br i1 %exitcond.not.3, label %._crit_edge, label %.lr.ph, !llvm.loop !15

._crit_edge:                                      ; preds = %.lr.ph.prol.loopexit, %.lr.ph, %middle.block, %3
  %40 = call i32 @to_orbital_list(i32 noundef %0, ptr noundef %2, ptr noundef nonnull %7) #5
  %.not = icmp eq i32 %40, 0
  br i1 %.not, label %41, label %42

41:                                               ; preds = %._crit_edge
  call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 48, ptr noundef nonnull @__PRETTY_FUNCTION__.random_single_exc) #6
  unreachable

42:                                               ; preds = %._crit_edge
  %43 = call i32 @rand() #5
  %44 = urem i32 %43, %40
  %45 = zext i32 %44 to i64
  %46 = getelementptr inbounds i32, ptr %7, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !16
  %48 = call i32 @to_orbital_list(i32 noundef %0, ptr noundef %1, ptr noundef nonnull %6) #5
  %.not52 = icmp eq i32 %48, 0
  br i1 %.not52, label %49, label %.preheader57

49:                                               ; preds = %42
  call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 54, ptr noundef nonnull @__PRETTY_FUNCTION__.random_single_exc) #6
  unreachable

.preheader57:                                     ; preds = %42, %.preheader57
  %50 = call i32 @rand() #5
  %.fr75 = freeze i32 %50
  %51 = urem i32 %.fr75, %48
  %52 = icmp eq i32 %51, %44
  br i1 %52, label %.preheader57, label %53, !llvm.loop !18

53:                                               ; preds = %.preheader57
  %54 = zext i32 %51 to i64
  %55 = getelementptr inbounds i32, ptr %6, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !16
  store i32 %47, ptr %55, align 4, !tbaa !16
  call void @of_orbital_list(i32 noundef %0, i32 noundef %48, ptr noundef %2, ptr noundef nonnull %6) #5
  %57 = icmp ugt i32 %47, %56
  br i1 %57, label %.preheader, label %.preheader55

.preheader55:                                     ; preds = %53
  %.not5359 = icmp eq i32 %51, 0
  br i1 %.not5359, label %.loopexit, label %.lr.ph62.preheader

.lr.ph62.preheader:                               ; preds = %.preheader55
  %58 = urem i32 %.fr75, %48
  %59 = zext i32 %58 to i64
  %min.iters.check83 = icmp ult i32 %58, 8
  br i1 %min.iters.check83, label %.lr.ph62.preheader119, label %vector.ph84

.lr.ph62.preheader119:                            ; preds = %middle.block81, %.lr.ph62.preheader
  %indvars.iv71.ph = phi i64 [ %59, %.lr.ph62.preheader ], [ %ind.end, %middle.block81 ]
  %.261.ph = phi i32 [ 0, %.lr.ph62.preheader ], [ %70, %middle.block81 ]
  br label %.lr.ph62

vector.ph84:                                      ; preds = %.lr.ph62.preheader
  %n.vec86 = and i64 %59, 4294967288
  %ind.end = and i64 %59, 7
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %47, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  %invariant.gep = getelementptr i32, ptr %6, i64 %59
  br label %vector.body88

vector.body88:                                    ; preds = %vector.body88, %vector.ph84
  %index89 = phi i64 [ 0, %vector.ph84 ], [ %index.next94, %vector.body88 ]
  %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph84 ], [ %67, %vector.body88 ]
  %vec.phi90 = phi <4 x i32> [ zeroinitializer, %vector.ph84 ], [ %68, %vector.body88 ]
  %60 = xor i64 %index89, -1
  %gep = getelementptr i32, ptr %invariant.gep, i64 %60
  %61 = getelementptr inbounds i8, ptr %gep, i64 -12
  %62 = getelementptr inbounds i8, ptr %gep, i64 -28
  %wide.load91 = load <4 x i32>, ptr %61, align 4, !tbaa !16
  %reverse = shufflevector <4 x i32> %wide.load91, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
  %wide.load92 = load <4 x i32>, ptr %62, align 4, !tbaa !16
  %reverse93 = shufflevector <4 x i32> %wide.load92, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
  %63 = icmp ugt <4 x i32> %reverse, %broadcast.splat
  %64 = icmp ugt <4 x i32> %reverse93, %broadcast.splat
  %65 = zext <4 x i1> %63 to <4 x i32>
  %66 = zext <4 x i1> %64 to <4 x i32>
  %67 = add <4 x i32> %vec.phi, %65
  %68 = add <4 x i32> %vec.phi90, %66
  %index.next94 = add nuw i64 %index89, 8
  %69 = icmp eq i64 %index.next94, %n.vec86
  br i1 %69, label %middle.block81, label %vector.body88, !llvm.loop !19

middle.block81:                                   ; preds = %vector.body88
  %bin.rdx = add <4 x i32> %68, %67
  %70 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n95 = icmp eq i64 %n.vec86, %59
  br i1 %cmp.n95, label %.loopexit, label %.lr.ph62.preheader119

.preheader:                                       ; preds = %53
  %71 = add i32 %48, -1
  %72 = icmp ult i32 %51, %71
  br i1 %72, label %.lr.ph65.preheader, label %.loopexit

.lr.ph65.preheader:                               ; preds = %.preheader
  %73 = urem i32 %.fr75, %48
  %74 = zext i32 %73 to i64
  %75 = zext i32 %71 to i64
  %76 = zext i32 %.fr75 to i64
  %77 = urem i32 %.fr75, %48
  %narrow = sub nuw i32 %.fr75, %77
  %78 = zext i32 %narrow to i64
  %79 = add nuw nsw i64 %75, %78
  %80 = sub nsw i64 %79, %76
  %min.iters.check98 = icmp ult i64 %80, 8
  br i1 %min.iters.check98, label %.lr.ph65.preheader117, label %vector.ph99

vector.ph99:                                      ; preds = %.lr.ph65.preheader
  %n.vec101 = and i64 %80, -8
  %ind.end102 = add nsw i64 %n.vec101, %74
  %broadcast.splatinsert111 = insertelement <4 x i32> poison, i32 %47, i64 0
  %broadcast.splat112 = shufflevector <4 x i32> %broadcast.splatinsert111, <4 x i32> poison, <4 x i32> zeroinitializer
  %invariant.gep129 = getelementptr i32, ptr %6, i64 %74
  br label %vector.body104

vector.body104:                                   ; preds = %vector.body104, %vector.ph99
  %index105 = phi i64 [ 0, %vector.ph99 ], [ %index.next113, %vector.body104 ]
  %vec.phi106 = phi <4 x i32> [ zeroinitializer, %vector.ph99 ], [ %87, %vector.body104 ]
  %vec.phi107 = phi <4 x i32> [ zeroinitializer, %vector.ph99 ], [ %88, %vector.body104 ]
  %gep130 = getelementptr i32, ptr %invariant.gep129, i64 %index105
  %81 = getelementptr i8, ptr %gep130, i64 4
  %82 = getelementptr i8, ptr %gep130, i64 20
  %wide.load109 = load <4 x i32>, ptr %81, align 4, !tbaa !16
  %wide.load110 = load <4 x i32>, ptr %82, align 4, !tbaa !16
  %83 = icmp ult <4 x i32> %wide.load109, %broadcast.splat112
  %84 = icmp ult <4 x i32> %wide.load110, %broadcast.splat112
  %85 = zext <4 x i1> %83 to <4 x i32>
  %86 = zext <4 x i1> %84 to <4 x i32>
  %87 = add <4 x i32> %vec.phi106, %85
  %88 = add <4 x i32> %vec.phi107, %86
  %index.next113 = add nuw i64 %index105, 8
  %89 = icmp eq i64 %index.next113, %n.vec101
  br i1 %89, label %middle.block96, label %vector.body104, !llvm.loop !20

middle.block96:                                   ; preds = %vector.body104
  %bin.rdx114 = add <4 x i32> %88, %87
  %90 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx114)
  %cmp.n115 = icmp eq i64 %80, %n.vec101
  br i1 %cmp.n115, label %.loopexit, label %.lr.ph65.preheader117

.lr.ph65.preheader117:                            ; preds = %middle.block96, %.lr.ph65.preheader
  %indvars.iv73.ph = phi i64 [ %74, %.lr.ph65.preheader ], [ %ind.end102, %middle.block96 ]
  %.064.ph = phi i32 [ 0, %.lr.ph65.preheader ], [ %90, %middle.block96 ]
  br label %.lr.ph65

.lr.ph65:                                         ; preds = %.lr.ph65.preheader117, %.lr.ph65
  %indvars.iv73 = phi i64 [ %indvars.iv.next74, %.lr.ph65 ], [ %indvars.iv73.ph, %.lr.ph65.preheader117 ]
  %.064 = phi i32 [ %spec.select, %.lr.ph65 ], [ %.064.ph, %.lr.ph65.preheader117 ]
  %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
  %91 = getelementptr inbounds i32, ptr %6, i64 %indvars.iv.next74
  %92 = load i32, ptr %91, align 4, !tbaa !16
  %93 = icmp ult i32 %92, %47
  %94 = zext i1 %93 to i32
  %spec.select = add i32 %.064, %94
  %95 = icmp ult i64 %indvars.iv.next74, %75
  br i1 %95, label %.lr.ph65, label %.loopexit, !llvm.loop !21

.lr.ph62:                                         ; preds = %.lr.ph62.preheader119, %.lr.ph62
  %indvars.iv71 = phi i64 [ %96, %.lr.ph62 ], [ %indvars.iv71.ph, %.lr.ph62.preheader119 ]
  %.261 = phi i32 [ %spec.select54, %.lr.ph62 ], [ %.261.ph, %.lr.ph62.preheader119 ]
  %96 = add i64 %indvars.iv71, -1
  %97 = getelementptr inbounds i32, ptr %6, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !16
  %99 = icmp ugt i32 %98, %47
  %100 = zext i1 %99 to i32
  %spec.select54 = add i32 %.261, %100
  %.not53.wide = icmp eq i64 %96, 0
  br i1 %.not53.wide, label %.loopexit, label %.lr.ph62, !llvm.loop !22

.loopexit:                                        ; preds = %.lr.ph62, %.lr.ph65, %middle.block81, %middle.block96, %.preheader55, %.preheader
  %.4 = phi i32 [ 0, %.preheader ], [ 0, %.preheader55 ], [ %90, %middle.block96 ], [ %70, %middle.block81 ], [ %spec.select, %.lr.ph65 ], [ %spec.select54, %.lr.ph62 ]
  ret i32 %.4
}

declare i32 @to_orbital_list(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

declare void @of_orbital_list(i32 noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4

attributes #0 = { 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 #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { noreturn 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 nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
attributes #6 = { noreturn 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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.unroll.disable"}
!15 = distinct !{!15, !10, !11}
!16 = !{!17, !17, i64 0}
!17 = !{!"int", !7, i64 0}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10, !11, !12}
!20 = distinct !{!20, !10, !11, !12}
!21 = distinct !{!21, !10, !12, !11}
!22 = distinct !{!22, !10, !12, !11}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SROAPass,SimplifyCFGPass