; LLVM IR from CLASS-SZ/class_sz :: class-sz/tools (r8lib)

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

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.72 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.79 = external hidden unnamed_addr constant [36 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #1

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @r8vec_gt(i32 noundef, ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local void @r8vec_swap(i32 noundef, ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local i32 @r8vec_eq(i32 noundef, ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local i32 @r8vec_lt(i32 noundef, ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
define dso_local void @r83row_part_quick_a(i32 noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #3 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca [3 x double], align 16
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store i32 %0, ptr %5, align 4, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !9
  store ptr %3, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %16 = load i32, ptr %5, align 4, !tbaa !5
  %17 = icmp slt i32 %16, 1
  br i1 %17, label %18, label %25

18:                                               ; preds = %4
  %19 = load ptr, ptr @stderr, align 8, !tbaa !9
  %20 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %19, ptr noundef @.str) #4
  %21 = load ptr, ptr @stderr, align 8, !tbaa !9
  %22 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %21, ptr noundef @.str.79) #4
  %23 = load ptr, ptr @stderr, align 8, !tbaa !9
  %24 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %23, ptr noundef @.str.72) #4
  call void @exit(i32 noundef 1) #5
  unreachable

25:                                               ; preds = %4
  %26 = load i32, ptr %5, align 4, !tbaa !5
  %27 = icmp eq i32 %26, 1
  br i1 %27, label %28, label %31

28:                                               ; preds = %25
  %29 = load ptr, ptr %7, align 8, !tbaa !9
  store i32 0, ptr %29, align 4, !tbaa !5
  %30 = load ptr, ptr %8, align 8, !tbaa !9
  store i32 2, ptr %30, align 4, !tbaa !5
  store i32 1, ptr %15, align 4
  br label %191

31:                                               ; preds = %25
  %32 = load ptr, ptr %6, align 8, !tbaa !9
  %33 = getelementptr inbounds double, ptr %32, i64 0
  %34 = load double, ptr %33, align 8, !tbaa !11
  %35 = getelementptr inbounds [3 x double], ptr %11, i64 0, i64 0
  store double %34, ptr %35, align 16, !tbaa !11
  %36 = load ptr, ptr %6, align 8, !tbaa !9
  %37 = getelementptr inbounds double, ptr %36, i64 1
  %38 = load double, ptr %37, align 8, !tbaa !11
  %39 = getelementptr inbounds [3 x double], ptr %11, i64 0, i64 1
  store double %38, ptr %39, align 8, !tbaa !11
  %40 = load ptr, ptr %6, align 8, !tbaa !9
  %41 = getelementptr inbounds double, ptr %40, i64 2
  %42 = load double, ptr %41, align 8, !tbaa !11
  %43 = getelementptr inbounds [3 x double], ptr %11, i64 0, i64 2
  store double %42, ptr %43, align 16, !tbaa !11
  store i32 1, ptr %13, align 4, !tbaa !5
  store i32 1, ptr %12, align 4, !tbaa !5
  %44 = load i32, ptr %5, align 4, !tbaa !5
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %14, align 4, !tbaa !5
  store i32 2, ptr %9, align 4, !tbaa !5
  br label %46

46:                                               ; preds = %113, %31
  %47 = load i32, ptr %9, align 4, !tbaa !5
  %48 = load i32, ptr %5, align 4, !tbaa !5
  %49 = icmp sle i32 %47, %48
  br i1 %49, label %50, label %116

50:                                               ; preds = %46
  %51 = load ptr, ptr %6, align 8, !tbaa !9
  %52 = load i32, ptr %12, align 4, !tbaa !5
  %53 = mul nsw i32 3, %52
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds double, ptr %51, i64 %54
  %56 = getelementptr inbounds [3 x double], ptr %11, i64 0, i64 0
  %57 = call i32 @r8vec_gt(i32 noundef 3, ptr noundef %55, ptr noundef %56)
  %58 = icmp ne i32 %57, 0
  br i1 %58, label %59, label %73

59:                                               ; preds = %50
  %60 = load i32, ptr %14, align 4, !tbaa !5
  %61 = sub nsw i32 %60, 1
  store i32 %61, ptr %14, align 4, !tbaa !5
  %62 = load ptr, ptr %6, align 8, !tbaa !9
  %63 = load i32, ptr %14, align 4, !tbaa !5
  %64 = sub nsw i32 %63, 1
  %65 = mul nsw i32 3, %64
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds double, ptr %62, i64 %66
  %68 = load ptr, ptr %6, align 8, !tbaa !9
  %69 = load i32, ptr %12, align 4, !tbaa !5
  %70 = mul nsw i32 3, %69
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds double, ptr %68, i64 %71
  call void @r8vec_swap(i32 noundef 3, ptr noundef %67, ptr noundef %72)
  br label %112

73:                                               ; preds = %50
  %74 = load ptr, ptr %6, align 8, !tbaa !9
  %75 = load i32, ptr %12, align 4, !tbaa !5
  %76 = mul nsw i32 3, %75
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds double, ptr %74, i64 %77
  %79 = getelementptr inbounds [3 x double], ptr %11, i64 0, i64 0
  %80 = call i32 @r8vec_eq(i32 noundef 3, ptr noundef %78, ptr noundef %79)
  %81 = icmp ne i32 %80, 0
  br i1 %81, label %82, label %98

82:                                               ; preds = %73
  %83 = load i32, ptr %13, align 4, !tbaa !5
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %13, align 4, !tbaa !5
  %85 = load ptr, ptr %6, align 8, !tbaa !9
  %86 = load i32, ptr %13, align 4, !tbaa !5
  %87 = sub nsw i32 %86, 1
  %88 = mul nsw i32 3, %87
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds double, ptr %85, i64 %89
  %91 = load ptr, ptr %6, align 8, !tbaa !9
  %92 = load i32, ptr %12, align 4, !tbaa !5
  %93 = mul nsw i32 3, %92
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds double, ptr %91, i64 %94
  call void @r8vec_swap(i32 noundef 3, ptr noundef %90, ptr noundef %95)
  %96 = load i32, ptr %12, align 4, !tbaa !5
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %12, align 4, !tbaa !5
  br label %111

98:                                               ; preds = %73
  %99 = load ptr, ptr %6, align 8, !tbaa !9
  %100 = load i32, ptr %12, align 4, !tbaa !5
  %101 = mul nsw i32 3, %100
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds double, ptr %99, i64 %102
  %104 = getelementptr inbounds [3 x double], ptr %11, i64 0, i64 0
  %105 = call i32 @r8vec_lt(i32 noundef 3, ptr noundef %103, ptr noundef %104)
  %106 = icmp ne i32 %105, 0
  br i1 %106, label %107, label %110

107:                                              ; preds = %98
  %108 = load i32, ptr %12, align 4, !tbaa !5
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %12, align 4, !tbaa !5
  br label %110

110:                                              ; preds = %107, %98
  br label %111

111:                                              ; preds = %110, %82
  br label %112

112:                                              ; preds = %111, %59
  br label %113

113:                                              ; preds = %112
  %114 = load i32, ptr %9, align 4, !tbaa !5
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr %9, align 4, !tbaa !5
  br label %46, !llvm.loop !13

116:                                              ; preds = %46
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %117

117:                                              ; preds = %149, %116
  %118 = load i32, ptr %9, align 4, !tbaa !5
  %119 = load i32, ptr %12, align 4, !tbaa !5
  %120 = load i32, ptr %13, align 4, !tbaa !5
  %121 = sub nsw i32 %119, %120
  %122 = icmp slt i32 %118, %121
  br i1 %122, label %123, label %152

123:                                              ; preds = %117
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %124

124:                                              ; preds = %145, %123
  %125 = load i32, ptr %10, align 4, !tbaa !5
  %126 = icmp slt i32 %125, 3
  br i1 %126, label %127, label %148

127:                                              ; preds = %124
  %128 = load ptr, ptr %6, align 8, !tbaa !9
  %129 = load i32, ptr %9, align 4, !tbaa !5
  %130 = load i32, ptr %13, align 4, !tbaa !5
  %131 = add nsw i32 %129, %130
  %132 = mul nsw i32 3, %131
  %133 = load i32, ptr %10, align 4, !tbaa !5
  %134 = add nsw i32 %132, %133
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds double, ptr %128, i64 %135
  %137 = load double, ptr %136, align 8, !tbaa !11
  %138 = load ptr, ptr %6, align 8, !tbaa !9
  %139 = load i32, ptr %9, align 4, !tbaa !5
  %140 = mul nsw i32 3, %139
  %141 = load i32, ptr %10, align 4, !tbaa !5
  %142 = add nsw i32 %140, %141
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds double, ptr %138, i64 %143
  store double %137, ptr %144, align 8, !tbaa !11
  br label %145

145:                                              ; preds = %127
  %146 = load i32, ptr %10, align 4, !tbaa !5
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %10, align 4, !tbaa !5
  br label %124, !llvm.loop !15

148:                                              ; preds = %124
  br label %149

149:                                              ; preds = %148
  %150 = load i32, ptr %9, align 4, !tbaa !5
  %151 = add nsw i32 %150, 1
  store i32 %151, ptr %9, align 4, !tbaa !5
  br label %117, !llvm.loop !16

152:                                              ; preds = %117
  %153 = load i32, ptr %12, align 4, !tbaa !5
  %154 = load i32, ptr %13, align 4, !tbaa !5
  %155 = sub nsw i32 %153, %154
  store i32 %155, ptr %12, align 4, !tbaa !5
  %156 = load i32, ptr %12, align 4, !tbaa !5
  store i32 %156, ptr %9, align 4, !tbaa !5
  br label %157

157:                                              ; preds = %183, %152
  %158 = load i32, ptr %9, align 4, !tbaa !5
  %159 = load i32, ptr %12, align 4, !tbaa !5
  %160 = load i32, ptr %13, align 4, !tbaa !5
  %161 = add nsw i32 %159, %160
  %162 = icmp slt i32 %158, %161
  br i1 %162, label %163, label %186

163:                                              ; preds = %157
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %164

164:                                              ; preds = %179, %163
  %165 = load i32, ptr %10, align 4, !tbaa !5
  %166 = icmp slt i32 %165, 3
  br i1 %166, label %167, label %182

167:                                              ; preds = %164
  %168 = load i32, ptr %10, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [3 x double], ptr %11, i64 0, i64 %169
  %171 = load double, ptr %170, align 8, !tbaa !11
  %172 = load ptr, ptr %6, align 8, !tbaa !9
  %173 = load i32, ptr %9, align 4, !tbaa !5
  %174 = mul nsw i32 3, %173
  %175 = load i32, ptr %10, align 4, !tbaa !5
  %176 = add nsw i32 %174, %175
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds double, ptr %172, i64 %177
  store double %171, ptr %178, align 8, !tbaa !11
  br label %179

179:                                              ; preds = %167
  %180 = load i32, ptr %10, align 4, !tbaa !5
  %181 = add nsw i32 %180, 1
  store i32 %181, ptr %10, align 4, !tbaa !5
  br label %164, !llvm.loop !17

182:                                              ; preds = %164
  br label %183

183:                                              ; preds = %182
  %184 = load i32, ptr %9, align 4, !tbaa !5
  %185 = add nsw i32 %184, 1
  store i32 %185, ptr %9, align 4, !tbaa !5
  br label %157, !llvm.loop !18

186:                                              ; preds = %157
  %187 = load i32, ptr %12, align 4, !tbaa !5
  %188 = load ptr, ptr %7, align 8, !tbaa !9
  store i32 %187, ptr %188, align 4, !tbaa !5
  %189 = load i32, ptr %14, align 4, !tbaa !5
  %190 = load ptr, ptr %8, align 8, !tbaa !9
  store i32 %189, ptr %190, align 4, !tbaa !5
  store i32 1, ptr %15, align 4
  br label %191

191:                                              ; preds = %186, %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  ret void
}

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 = { 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 #3 = { 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 #4 = { nounwind }
attributes #5 = { 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 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !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"

@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.72 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.79 = external hidden unnamed_addr constant [36 x i8], align 1

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

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

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @r8vec_gt(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local void @r8vec_swap(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local i32 @r8vec_eq(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local i32 @r8vec_lt(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local void @r83row_part_quick_a(i32 noundef %0, ptr noundef %1, ptr nocapture noundef writeonly %2, ptr nocapture noundef writeonly %3) local_unnamed_addr #3 {
  %5 = alloca [3 x double], align 16
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #5
  %6 = icmp slt i32 %0, 1
  br i1 %6, label %7, label %14

7:                                                ; preds = %4
  %8 = load ptr, ptr @stderr, align 8, !tbaa !5
  %9 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %8, ptr noundef nonnull @.str) #6
  %10 = load ptr, ptr @stderr, align 8, !tbaa !5
  %11 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.79) #6
  %12 = load ptr, ptr @stderr, align 8, !tbaa !5
  %13 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %12, ptr noundef nonnull @.str.72) #6
  tail call void @exit(i32 noundef 1) #7
  unreachable

14:                                               ; preds = %4
  %15 = icmp eq i32 %0, 1
  br i1 %15, label %.loopexit, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %14
  %16 = load <2 x double>, ptr %1, align 8, !tbaa !9
  store <2 x double> %16, ptr %5, align 16, !tbaa !9
  %17 = getelementptr inbounds i8, ptr %1, i64 16
  %18 = load double, ptr %17, align 8, !tbaa !9
  %19 = getelementptr inbounds i8, ptr %5, i64 16
  store double %18, ptr %19, align 16, !tbaa !9
  %20 = add nuw i32 %0, 1
  br label %.lr.ph

.preheader74:                                     ; preds = %46
  %21 = sub nsw i32 %.161, %.159
  %22 = icmp sgt i32 %21, 0
  br i1 %22, label %.preheader73.preheader, label %.preheader72

.preheader73.preheader:                           ; preds = %.preheader74
  %23 = sext i32 %.159 to i64
  %wide.trip.count = zext nneg i32 %21 to i64
  %invariant.gep = getelementptr i8, ptr %1, i64 8
  %invariant.gep95 = getelementptr inbounds i8, ptr %1, i64 8
  %invariant.gep97 = getelementptr i8, ptr %1, i64 16
  %invariant.gep99 = getelementptr inbounds i8, ptr %1, i64 16
  %xtraiter = and i64 %wide.trip.count, 1
  %24 = icmp eq i32 %21, 1
  br i1 %24, label %.preheader72.loopexit.unr-lcssa, label %.preheader73.preheader.new

.preheader73.preheader.new:                       ; preds = %.preheader73.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483646
  br label %.preheader73

.lr.ph:                                           ; preds = %.lr.ph.preheader, %46
  %.079 = phi i32 [ %.1, %46 ], [ %20, %.lr.ph.preheader ]
  %.05878 = phi i32 [ %.159, %46 ], [ 1, %.lr.ph.preheader ]
  %.06077 = phi i32 [ %.161, %46 ], [ 1, %.lr.ph.preheader ]
  %.06476 = phi i32 [ %47, %46 ], [ 2, %.lr.ph.preheader ]
  %25 = mul nsw i32 %.06077, 3
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds double, ptr %1, i64 %26
  %28 = call i32 @r8vec_gt(i32 noundef 3, ptr noundef nonnull %27, ptr noundef nonnull %5)
  %.not69 = icmp eq i32 %28, 0
  br i1 %.not69, label %35, label %29

29:                                               ; preds = %.lr.ph
  %30 = add nsw i32 %.079, -1
  %31 = mul i32 %.079, 3
  %32 = add i32 %31, -6
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds double, ptr %1, i64 %33
  call void @r8vec_swap(i32 noundef 3, ptr noundef nonnull %34, ptr noundef nonnull %27)
  br label %46

35:                                               ; preds = %.lr.ph
  %36 = call i32 @r8vec_eq(i32 noundef 3, ptr noundef nonnull %27, ptr noundef nonnull %5)
  %.not70 = icmp eq i32 %36, 0
  br i1 %.not70, label %43, label %37

37:                                               ; preds = %35
  %38 = add nsw i32 %.05878, 1
  %39 = mul nsw i32 %.05878, 3
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds double, ptr %1, i64 %40
  call void @r8vec_swap(i32 noundef 3, ptr noundef nonnull %41, ptr noundef nonnull %27)
  %42 = add nsw i32 %.06077, 1
  br label %46

43:                                               ; preds = %35
  %44 = call i32 @r8vec_lt(i32 noundef 3, ptr noundef nonnull %27, ptr noundef nonnull %5)
  %.not71 = icmp ne i32 %44, 0
  %45 = zext i1 %.not71 to i32
  %spec.select = add nsw i32 %.06077, %45
  br label %46

46:                                               ; preds = %43, %29, %37
  %.161 = phi i32 [ %.06077, %29 ], [ %42, %37 ], [ %spec.select, %43 ]
  %.159 = phi i32 [ %.05878, %29 ], [ %38, %37 ], [ %.05878, %43 ]
  %.1 = phi i32 [ %30, %29 ], [ %.079, %37 ], [ %.079, %43 ]
  %47 = add nuw i32 %.06476, 1
  %exitcond.not = icmp eq i32 %.06476, %0
  br i1 %exitcond.not, label %.preheader74, label %.lr.ph, !llvm.loop !11

.preheader73:                                     ; preds = %.preheader73, %.preheader73.preheader.new
  %indvars.iv = phi i64 [ 0, %.preheader73.preheader.new ], [ %indvars.iv.next.1, %.preheader73 ]
  %niter = phi i64 [ 0, %.preheader73.preheader.new ], [ %niter.next.1, %.preheader73 ]
  %48 = add nsw i64 %indvars.iv, %23
  %49 = mul nsw i64 %48, 3
  %50 = mul nuw nsw i64 %indvars.iv, 3
  %51 = getelementptr inbounds double, ptr %1, i64 %49
  %52 = load double, ptr %51, align 8, !tbaa !9
  %53 = getelementptr inbounds double, ptr %1, i64 %50
  store double %52, ptr %53, align 8, !tbaa !9
  %gep = getelementptr double, ptr %invariant.gep, i64 %49
  %54 = load double, ptr %gep, align 8, !tbaa !9
  %gep96 = getelementptr inbounds double, ptr %invariant.gep95, i64 %50
  store double %54, ptr %gep96, align 8, !tbaa !9
  %gep98 = getelementptr double, ptr %invariant.gep97, i64 %49
  %55 = load double, ptr %gep98, align 8, !tbaa !9
  %gep100 = getelementptr inbounds double, ptr %invariant.gep99, i64 %50
  store double %55, ptr %gep100, align 8, !tbaa !9
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %56 = add nsw i64 %indvars.iv.next, %23
  %57 = mul nsw i64 %56, 3
  %58 = mul nuw nsw i64 %indvars.iv.next, 3
  %59 = getelementptr inbounds double, ptr %1, i64 %57
  %60 = load double, ptr %59, align 8, !tbaa !9
  %61 = getelementptr inbounds double, ptr %1, i64 %58
  store double %60, ptr %61, align 8, !tbaa !9
  %gep.1 = getelementptr double, ptr %invariant.gep, i64 %57
  %62 = load double, ptr %gep.1, align 8, !tbaa !9
  %gep96.1 = getelementptr inbounds double, ptr %invariant.gep95, i64 %58
  store double %62, ptr %gep96.1, align 8, !tbaa !9
  %gep98.1 = getelementptr double, ptr %invariant.gep97, i64 %57
  %63 = load double, ptr %gep98.1, align 8, !tbaa !9
  %gep100.1 = getelementptr inbounds double, ptr %invariant.gep99, i64 %58
  store double %63, ptr %gep100.1, align 8, !tbaa !9
  %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 %.preheader72.loopexit.unr-lcssa, label %.preheader73, !llvm.loop !13

.preheader72.loopexit.unr-lcssa:                  ; preds = %.preheader73, %.preheader73.preheader
  %indvars.iv.unr = phi i64 [ 0, %.preheader73.preheader ], [ %indvars.iv.next.1, %.preheader73 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader72, label %.preheader73.epil

.preheader73.epil:                                ; preds = %.preheader72.loopexit.unr-lcssa
  %64 = add nsw i64 %indvars.iv.unr, %23
  %65 = mul nsw i64 %64, 3
  %66 = mul nuw nsw i64 %indvars.iv.unr, 3
  %67 = getelementptr inbounds double, ptr %1, i64 %65
  %68 = load double, ptr %67, align 8, !tbaa !9
  %69 = getelementptr inbounds double, ptr %1, i64 %66
  store double %68, ptr %69, align 8, !tbaa !9
  %gep.epil = getelementptr double, ptr %invariant.gep, i64 %65
  %70 = load double, ptr %gep.epil, align 8, !tbaa !9
  %gep96.epil = getelementptr inbounds double, ptr %invariant.gep95, i64 %66
  store double %70, ptr %gep96.epil, align 8, !tbaa !9
  %gep98.epil = getelementptr double, ptr %invariant.gep97, i64 %65
  %71 = load double, ptr %gep98.epil, align 8, !tbaa !9
  %gep100.epil = getelementptr inbounds double, ptr %invariant.gep99, i64 %66
  store double %71, ptr %gep100.epil, align 8, !tbaa !9
  br label %.preheader72

.preheader72:                                     ; preds = %.preheader73.epil, %.preheader72.loopexit.unr-lcssa, %.preheader74
  %72 = icmp sgt i32 %.159, 0
  br i1 %72, label %.preheader.preheader, label %.loopexit

.preheader.preheader:                             ; preds = %.preheader72
  %73 = mul i32 %.161, 3
  %.neg = mul i32 %.159, -3
  %74 = add i32 %.neg, %73
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %.preheader
  %indvar = phi i32 [ 0, %.preheader.preheader ], [ %indvar.next, %.preheader ]
  %.286 = phi i32 [ %21, %.preheader.preheader ], [ %79, %.preheader ]
  %75 = mul i32 %indvar, 3
  %76 = add i32 %74, %75
  %77 = sext i32 %76 to i64
  %78 = shl nsw i64 %77, 3
  %scevgep = getelementptr i8, ptr %1, i64 %78
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %scevgep, ptr noundef nonnull align 16 dereferenceable(24) %5, i64 24, i1 false), !tbaa !9
  %79 = add nsw i32 %.286, 1
  %80 = icmp slt i32 %79, %.161
  %indvar.next = add i32 %indvar, 1
  br i1 %80, label %.preheader, label %.loopexit, !llvm.loop !14

.loopexit:                                        ; preds = %.preheader, %.preheader72, %14
  %storemerge68 = phi i32 [ 0, %14 ], [ %21, %.preheader72 ], [ %21, %.preheader ]
  %storemerge = phi i32 [ 2, %14 ], [ %.1, %.preheader72 ], [ %.1, %.preheader ]
  store i32 %storemerge68, ptr %2, align 4, !tbaa !15
  store i32 %storemerge, ptr %3, align 4, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  ret void
}

; 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind }
attributes #6 = { cold 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = !{!16, !16, i64 0}
!16 = !{!"int", !7, i64 0}


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