; LLVM IR from pmla/polyhedral-template-matching :: ptm_index (ptm_undo_conventional_orientation)

; 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.ptm::refdata_t" = type { i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, ptr, i32, ptr, ptr, ptr, ptr }

@_ZN3ptmL7refdataE = external hidden constant [9 x ptr], align 16
@.str = external hidden unnamed_addr constant [20 x i8], align 1
@.str.89 = external hidden unnamed_addr constant [81 x i8], align 1
@__PRETTY_FUNCTION__.ptm_undo_conventional_orientation = external hidden unnamed_addr constant [68 x i8], align 1

; 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) #0

; Function Attrs: mustprogress uwtable
define dso_local i32 @ptm_undo_conventional_orientation(i32 noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3) #1 {
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca [4 x double], align 16
  %15 = alloca [17 x i8], align 16
  %16 = alloca i32, align 4
  store i32 %0, ptr %6, align 4, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !9
  %17 = load i32, ptr %7, align 4, !tbaa !5
  %18 = icmp eq i32 %17, 0
  br i1 %18, label %19, label %20

19:                                               ; preds = %4
  store i32 0, ptr %5, align 4
  br label %113

20:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %21 = load i32, ptr %6, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [9 x ptr], ptr @_ZN3ptmL7refdataE, i64 0, i64 %22
  %24 = load ptr, ptr %23, align 8, !tbaa !9
  store ptr %24, ptr %10, align 8, !tbaa !9
  %25 = load ptr, ptr %10, align 8, !tbaa !9
  %26 = getelementptr inbounds %"struct.ptm::refdata_t", ptr %25, i32 0, i32 19
  %27 = load ptr, ptr %26, align 8, !tbaa !11
  %28 = icmp eq ptr %27, null
  br i1 %28, label %29, label %30

29:                                               ; preds = %20
  store i32 -1, ptr %5, align 4
  store i32 1, ptr %11, align 4
  br label %112

30:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 -1, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %52, %30
  %32 = load i32, ptr %13, align 4, !tbaa !5
  %33 = load ptr, ptr %10, align 8, !tbaa !9
  %34 = getelementptr inbounds %"struct.ptm::refdata_t", ptr %33, i32 0, i32 16
  %35 = load i32, ptr %34, align 8, !tbaa !13
  %36 = icmp slt i32 %32, %35
  br i1 %36, label %38, label %37

37:                                               ; preds = %31
  store i32 2, ptr %11, align 4
  br label %55

38:                                               ; preds = %31
  %39 = load ptr, ptr %10, align 8, !tbaa !9
  %40 = getelementptr inbounds %"struct.ptm::refdata_t", ptr %39, i32 0, i32 19
  %41 = load ptr, ptr %40, align 8, !tbaa !11
  %42 = load i32, ptr %13, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds i8, ptr %41, i64 %43
  %45 = load i8, ptr %44, align 1, !tbaa !14
  %46 = sext i8 %45 to i32
  %47 = load i32, ptr %7, align 4, !tbaa !5
  %48 = icmp eq i32 %46, %47
  br i1 %48, label %49, label %51

49:                                               ; preds = %38
  %50 = load i32, ptr %13, align 4, !tbaa !5
  store i32 %50, ptr %12, align 4, !tbaa !5
  store i32 2, ptr %11, align 4
  br label %55

51:                                               ; preds = %38
  br label %52

52:                                               ; preds = %51
  %53 = load i32, ptr %13, align 4, !tbaa !5
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %13, align 4, !tbaa !5
  br label %31, !llvm.loop !15

55:                                               ; preds = %49, %37
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %56

56:                                               ; preds = %55
  %57 = load i32, ptr %12, align 4, !tbaa !5
  %58 = icmp ne i32 %57, -1
  br i1 %58, label %59, label %60

59:                                               ; preds = %56
  br label %62

60:                                               ; preds = %56
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.89, i32 noundef 157, ptr noundef @__PRETTY_FUNCTION__.ptm_undo_conventional_orientation) #6
  unreachable

61:                                               ; No predecessors!
  br label %62

62:                                               ; preds = %61, %59
  call void @llvm.lifetime.start.p0(i64 32, ptr %14) #5
  %63 = load ptr, ptr %8, align 8, !tbaa !9
  %64 = load ptr, ptr %10, align 8, !tbaa !9
  %65 = getelementptr inbounds %"struct.ptm::refdata_t", ptr %64, i32 0, i32 20
  %66 = load ptr, ptr %65, align 8, !tbaa !17
  %67 = load i32, ptr %12, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [4 x double], ptr %66, i64 %68
  %70 = getelementptr inbounds [4 x double], ptr %69, i64 0, i64 0
  %71 = getelementptr inbounds [4 x double], ptr %14, i64 0, i64 0
  call void @_ZN3ptm8quat_rotEPdS0_S0_(ptr noundef %63, ptr noundef %70, ptr noundef %71)
  %72 = load ptr, ptr %8, align 8, !tbaa !9
  %73 = getelementptr inbounds [4 x double], ptr %14, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %72, ptr align 16 %73, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 17, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %74

74:                                               ; preds = %100, %62
  %75 = load i32, ptr %16, align 4, !tbaa !5
  %76 = load ptr, ptr %10, align 8, !tbaa !9
  %77 = getelementptr inbounds %"struct.ptm::refdata_t", ptr %76, i32 0, i32 1
  %78 = load i32, ptr %77, align 4, !tbaa !18
  %79 = add nsw i32 %78, 1
  %80 = icmp slt i32 %75, %79
  br i1 %80, label %82, label %81

81:                                               ; preds = %74
  store i32 5, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %103

82:                                               ; preds = %74
  %83 = load ptr, ptr %9, align 8, !tbaa !9
  %84 = load i32, ptr %16, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds i8, ptr %83, i64 %85
  %87 = load i8, ptr %86, align 1, !tbaa !14
  %88 = load ptr, ptr %10, align 8, !tbaa !9
  %89 = getelementptr inbounds %"struct.ptm::refdata_t", ptr %88, i32 0, i32 18
  %90 = load ptr, ptr %89, align 8, !tbaa !19
  %91 = load i32, ptr %12, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [17 x i8], ptr %90, i64 %92
  %94 = load i32, ptr %16, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [17 x i8], ptr %93, i64 0, i64 %95
  %97 = load i8, ptr %96, align 1, !tbaa !14
  %98 = sext i8 %97 to i64
  %99 = getelementptr inbounds [17 x i8], ptr %15, i64 0, i64 %98
  store i8 %87, ptr %99, align 1, !tbaa !14
  br label %100

100:                                              ; preds = %82
  %101 = load i32, ptr %16, align 4, !tbaa !5
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %16, align 4, !tbaa !5
  br label %74, !llvm.loop !20

103:                                              ; preds = %81
  %104 = load ptr, ptr %9, align 8, !tbaa !9
  %105 = getelementptr inbounds [17 x i8], ptr %15, i64 0, i64 0
  %106 = load ptr, ptr %10, align 8, !tbaa !9
  %107 = getelementptr inbounds %"struct.ptm::refdata_t", ptr %106, i32 0, i32 1
  %108 = load i32, ptr %107, align 4, !tbaa !18
  %109 = add nsw i32 %108, 1
  %110 = sext i32 %109 to i64
  %111 = mul i64 %110, 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %104, ptr align 16 %105, i64 %111, i1 false)
  store i32 0, ptr %5, align 4
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 17, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %112

112:                                              ; preds = %103, %29
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %113

113:                                              ; preds = %112, %19
  %114 = load i32, ptr %5, align 4
  ret i32 %114
}

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

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

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

declare void @_ZN3ptm8quat_rotEPdS0_S0_(ptr noundef, ptr noundef, ptr noundef) #4

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !10, i64 136}
!12 = !{!"_ZTSN3ptm9refdata_tE", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !6, i64 96, !10, i64 104, !6, i64 112, !10, i64 120, !10, i64 128, !10, i64 136, !10, i64 144}
!13 = !{!12, !6, i64 112}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!12, !10, i64 144}
!18 = !{!12, !6, i64 4}
!19 = !{!12, !10, i64 128}
!20 = distinct !{!20, !16}


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

@_ZN3ptmL7refdataE = external hidden local_unnamed_addr constant [9 x ptr], align 16
@.str = external hidden unnamed_addr constant [20 x i8], align 1
@.str.89 = external hidden unnamed_addr constant [81 x i8], align 1
@__PRETTY_FUNCTION__.ptm_undo_conventional_orientation = external hidden unnamed_addr constant [68 x i8], align 1

; Function Attrs: mustprogress 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) #0

; Function Attrs: mustprogress uwtable
define dso_local range(i32 -1, 1) i32 @ptm_undo_conventional_orientation(i32 noundef %0, i32 noundef %1, ptr noundef %2, ptr nocapture noundef %3) local_unnamed_addr #1 {
  %5 = alloca [4 x double], align 16
  %6 = alloca [17 x i8], align 16
  %7 = icmp eq i32 %1, 0
  br i1 %7, label %66, label %8

8:                                                ; preds = %4
  %9 = sext i32 %0 to i64
  %10 = getelementptr inbounds [9 x ptr], ptr @_ZN3ptmL7refdataE, i64 0, i64 %9
  %11 = load ptr, ptr %10, align 8, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %11, i64 136
  %13 = load ptr, ptr %12, align 8, !tbaa !9
  %14 = icmp eq ptr %13, null
  br i1 %14, label %66, label %.preheader

.preheader:                                       ; preds = %8
  %15 = getelementptr inbounds i8, ptr %11, i64 112
  %16 = load i32, ptr %15, align 8, !tbaa !12
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %.preheader
  %wide.trip.count = zext nneg i32 %16 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %22
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %22 ]
  %18 = getelementptr inbounds i8, ptr %13, i64 %indvars.iv
  %19 = load i8, ptr %18, align 1, !tbaa !13
  %20 = sext i8 %19 to i32
  %21 = icmp eq i32 %20, %1
  br i1 %21, label %23, label %22

22:                                               ; preds = %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !14

._crit_edge:                                      ; preds = %22, %.preheader
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.89, i32 noundef 157, ptr noundef nonnull @__PRETTY_FUNCTION__.ptm_undo_conventional_orientation) #5
  unreachable

23:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #6
  %24 = getelementptr inbounds i8, ptr %11, i64 144
  %25 = load ptr, ptr %24, align 8, !tbaa !16
  %26 = and i64 %indvars.iv, 4294967295
  %27 = getelementptr inbounds [4 x double], ptr %25, i64 %26
  call void @_ZN3ptm8quat_rotEPdS0_S0_(ptr noundef %2, ptr noundef %27, ptr noundef nonnull %5)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull align 16 dereferenceable(32) %5, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 17, ptr nonnull %6) #6
  %28 = getelementptr inbounds i8, ptr %11, i64 4
  %29 = load i32, ptr %28, align 4, !tbaa !17
  %.not3035 = icmp slt i32 %29, 0
  br i1 %.not3035, label %.._crit_edge39_crit_edge, label %.lr.ph38

.._crit_edge39_crit_edge:                         ; preds = %23
  %.pre = add nsw i32 %29, 1
  br label %._crit_edge39

.lr.ph38:                                         ; preds = %23
  %30 = getelementptr inbounds i8, ptr %11, i64 128
  %31 = load ptr, ptr %30, align 8, !tbaa !18
  %32 = add nuw i32 %29, 1
  %wide.trip.count45 = zext i32 %32 to i64
  %xtraiter = and i64 %wide.trip.count45, 3
  %33 = icmp ult i32 %29, 3
  br i1 %33, label %._crit_edge39.loopexit.unr-lcssa, label %.lr.ph38.new

.lr.ph38.new:                                     ; preds = %.lr.ph38
  %unroll_iter = and i64 %wide.trip.count45, 4294967292
  br label %41

._crit_edge39.loopexit.unr-lcssa:                 ; preds = %41, %.lr.ph38
  %indvars.iv42.unr = phi i64 [ 0, %.lr.ph38 ], [ %indvars.iv.next43.3, %41 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge39, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge39.loopexit.unr-lcssa, %.epil.preheader
  %indvars.iv42.epil = phi i64 [ %indvars.iv.next43.epil, %.epil.preheader ], [ %indvars.iv42.unr, %._crit_edge39.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge39.loopexit.unr-lcssa ]
  %34 = getelementptr inbounds i8, ptr %3, i64 %indvars.iv42.epil
  %35 = load i8, ptr %34, align 1, !tbaa !13
  %36 = getelementptr inbounds [17 x i8], ptr %31, i64 %26, i64 %indvars.iv42.epil
  %37 = load i8, ptr %36, align 1, !tbaa !13
  %38 = sext i8 %37 to i64
  %39 = getelementptr inbounds [17 x i8], ptr %6, i64 0, i64 %38
  store i8 %35, ptr %39, align 1, !tbaa !13
  %indvars.iv.next43.epil = add nuw nsw i64 %indvars.iv42.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge39, label %.epil.preheader, !llvm.loop !19

._crit_edge39:                                    ; preds = %._crit_edge39.loopexit.unr-lcssa, %.epil.preheader, %.._crit_edge39_crit_edge
  %.pre-phi = phi i32 [ %.pre, %.._crit_edge39_crit_edge ], [ %32, %.epil.preheader ], [ %32, %._crit_edge39.loopexit.unr-lcssa ]
  %40 = sext i32 %.pre-phi to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %3, ptr nonnull align 16 %6, i64 %40, i1 false)
  call void @llvm.lifetime.end.p0(i64 17, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #6
  br label %66

41:                                               ; preds = %41, %.lr.ph38.new
  %indvars.iv42 = phi i64 [ 0, %.lr.ph38.new ], [ %indvars.iv.next43.3, %41 ]
  %niter = phi i64 [ 0, %.lr.ph38.new ], [ %niter.next.3, %41 ]
  %42 = getelementptr inbounds i8, ptr %3, i64 %indvars.iv42
  %43 = load i8, ptr %42, align 1, !tbaa !13
  %44 = getelementptr inbounds [17 x i8], ptr %31, i64 %26, i64 %indvars.iv42
  %45 = load i8, ptr %44, align 1, !tbaa !13
  %46 = sext i8 %45 to i64
  %47 = getelementptr inbounds [17 x i8], ptr %6, i64 0, i64 %46
  store i8 %43, ptr %47, align 1, !tbaa !13
  %indvars.iv.next43 = or disjoint i64 %indvars.iv42, 1
  %48 = getelementptr inbounds i8, ptr %3, i64 %indvars.iv.next43
  %49 = load i8, ptr %48, align 1, !tbaa !13
  %50 = getelementptr inbounds [17 x i8], ptr %31, i64 %26, i64 %indvars.iv.next43
  %51 = load i8, ptr %50, align 1, !tbaa !13
  %52 = sext i8 %51 to i64
  %53 = getelementptr inbounds [17 x i8], ptr %6, i64 0, i64 %52
  store i8 %49, ptr %53, align 1, !tbaa !13
  %indvars.iv.next43.1 = or disjoint i64 %indvars.iv42, 2
  %54 = getelementptr inbounds i8, ptr %3, i64 %indvars.iv.next43.1
  %55 = load i8, ptr %54, align 1, !tbaa !13
  %56 = getelementptr inbounds [17 x i8], ptr %31, i64 %26, i64 %indvars.iv.next43.1
  %57 = load i8, ptr %56, align 1, !tbaa !13
  %58 = sext i8 %57 to i64
  %59 = getelementptr inbounds [17 x i8], ptr %6, i64 0, i64 %58
  store i8 %55, ptr %59, align 1, !tbaa !13
  %indvars.iv.next43.2 = or disjoint i64 %indvars.iv42, 3
  %60 = getelementptr inbounds i8, ptr %3, i64 %indvars.iv.next43.2
  %61 = load i8, ptr %60, align 1, !tbaa !13
  %62 = getelementptr inbounds [17 x i8], ptr %31, i64 %26, i64 %indvars.iv.next43.2
  %63 = load i8, ptr %62, align 1, !tbaa !13
  %64 = sext i8 %63 to i64
  %65 = getelementptr inbounds [17 x i8], ptr %6, i64 0, i64 %64
  store i8 %61, ptr %65, align 1, !tbaa !13
  %indvars.iv.next43.3 = add nuw nsw i64 %indvars.iv42, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge39.loopexit.unr-lcssa, label %41, !llvm.loop !21

66:                                               ; preds = %._crit_edge39, %8, %4
  %.1 = phi i32 [ 0, %4 ], [ 0, %._crit_edge39 ], [ -1, %8 ]
  ret i32 %.1
}

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

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

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

declare void @_ZN3ptm8quat_rotEPdS0_S0_(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 }
attributes #6 = { 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++ TBAA"}
!9 = !{!10, !6, i64 136}
!10 = !{!"_ZTSN3ptm9refdata_tE", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !11, i64 96, !6, i64 104, !11, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !11, i64 112}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!10, !6, i64 144}
!17 = !{!10, !11, i64 4}
!18 = !{!10, !6, i64 128}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.unroll.disable"}
!21 = distinct !{!21, !15}


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