; LLVM IR from robinrodricks/InspiritImage :: Inspirit.Assurf/clib/rpp (rpp)

; 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.options_t = type { %struct.mat33_t, double, double, i32 }
%struct.mat33_t = type { [9 x double] }
%struct.vec3_t = type { [3 x double] }
%struct.pose_t = type { %struct.mat33_t, %struct.vec3_t, double, %struct.mat33_t, %struct.vec3_t, double }

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

declare void @vec3_copy(ptr noundef, ptr noundef) #1

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

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

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

declare void @vec3_clear(ptr noundef) #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) #3

declare void @mat33_clear(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @objpose(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef byval(%struct.options_t) align 8, i32 noundef) #4

declare void @mat33_copy(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @get2ndPose_Exact(ptr noundef, ptr noundef, ptr noundef, ptr noundef byval(%struct.mat33_t) align 8, ptr noundef byval(%struct.vec3_t) align 8, double noundef, i32 noundef, ptr noundef) #4

; Function Attrs: nounwind uwtable
define dso_local void @robust_pose(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef byval(%struct.options_t) align 8 %8, i32 noundef %9) #4 {
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca %struct.mat33_t, align 8
  %21 = alloca %struct.vec3_t, align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca double, align 8
  %25 = alloca double, align 8
  %26 = alloca ptr, align 8
  %27 = alloca i64, align 8
  %28 = alloca i64, align 8
  %29 = alloca %struct.options_t, align 8
  %30 = alloca [10 x %struct.pose_t], align 16
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca double, align 8
  %34 = alloca i32, align 4
  store ptr %0, ptr %11, align 8, !tbaa !5
  store ptr %1, ptr %12, align 8, !tbaa !5
  store ptr %2, ptr %13, align 8, !tbaa !5
  store ptr %3, ptr %14, align 8, !tbaa !5
  store ptr %4, ptr %15, align 8, !tbaa !5
  store ptr %5, ptr %16, align 8, !tbaa !5
  store ptr %6, ptr %17, align 8, !tbaa !5
  store ptr %7, ptr %18, align 8, !tbaa !5
  store i32 %9, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 72, ptr %20) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %21) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  %35 = load i32, ptr %19, align 4, !tbaa !9
  %36 = zext i32 %35 to i64
  %37 = call ptr @llvm.stacksave.p0()
  store ptr %37, ptr %26, align 8
  %38 = alloca %struct.vec3_t, i64 %36, align 16
  store i64 %36, ptr %27, align 8
  %39 = load i32, ptr %19, align 4, !tbaa !9
  %40 = zext i32 %39 to i64
  %41 = alloca %struct.vec3_t, i64 %40, align 16
  store i64 %40, ptr %28, align 8
  %42 = load ptr, ptr %17, align 8, !tbaa !5
  %43 = load i32, ptr %19, align 4, !tbaa !9
  %44 = sext i32 %43 to i64
  %45 = mul i64 %44, 24
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %38, ptr align 8 %42, i64 %45, i1 false)
  %46 = load ptr, ptr %18, align 8, !tbaa !5
  %47 = load i32, ptr %19, align 4, !tbaa !9
  %48 = sext i32 %47 to i64
  %49 = mul i64 %48, 24
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %41, ptr align 8 %46, i64 %49, i1 false)
  call void @llvm.lifetime.start.p0(i64 96, ptr %29) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %29, ptr align 8 %8, i64 96, i1 false)
  call void @mat33_clear(ptr noundef %20)
  call void @vec3_clear(ptr noundef %21)
  store i32 0, ptr %22, align 4, !tbaa !9
  store double 0.000000e+00, ptr %24, align 8, !tbaa !11
  store double 0.000000e+00, ptr %25, align 8, !tbaa !11
  %50 = load i32, ptr %19, align 4, !tbaa !9
  call void @objpose(ptr noundef %20, ptr noundef %21, ptr noundef %22, ptr noundef %24, ptr noundef %25, i32 noundef 0, ptr noundef %38, ptr noundef %41, ptr noundef byval(%struct.options_t) align 8 %29, i32 noundef %50)
  call void @llvm.lifetime.start.p0(i64 2080, ptr %30) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #5
  store i32 0, ptr %31, align 4, !tbaa !9
  %51 = getelementptr inbounds [10 x %struct.pose_t], ptr %30, i64 0, i64 0
  %52 = load i32, ptr %19, align 4, !tbaa !9
  call void @get2ndPose_Exact(ptr noundef %51, ptr noundef %41, ptr noundef %38, ptr noundef byval(%struct.mat33_t) align 8 %20, ptr noundef byval(%struct.vec3_t) align 8 %21, double noundef 0.000000e+00, i32 noundef %52, ptr noundef %31)
  store i32 0, ptr %23, align 4, !tbaa !9
  br label %53

53:                                               ; preds = %77, %10
  %54 = load i32, ptr %23, align 4, !tbaa !9
  %55 = load i32, ptr %31, align 4, !tbaa !9
  %56 = icmp slt i32 %54, %55
  br i1 %56, label %57, label %80

57:                                               ; preds = %53
  %58 = getelementptr inbounds %struct.options_t, ptr %29, i32 0, i32 0
  %59 = load i32, ptr %23, align 4, !tbaa !9
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [10 x %struct.pose_t], ptr %30, i64 0, i64 %60
  %62 = getelementptr inbounds %struct.pose_t, ptr %61, i32 0, i32 0
  call void @mat33_copy(ptr noundef %58, ptr noundef %62)
  %63 = load i32, ptr %19, align 4, !tbaa !9
  call void @objpose(ptr noundef %20, ptr noundef %21, ptr noundef %22, ptr noundef %24, ptr noundef %25, i32 noundef 0, ptr noundef %38, ptr noundef %41, ptr noundef byval(%struct.options_t) align 8 %29, i32 noundef %63)
  %64 = load i32, ptr %23, align 4, !tbaa !9
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [10 x %struct.pose_t], ptr %30, i64 0, i64 %65
  %67 = getelementptr inbounds %struct.pose_t, ptr %66, i32 0, i32 3
  call void @mat33_copy(ptr noundef %67, ptr noundef %20)
  %68 = load i32, ptr %23, align 4, !tbaa !9
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [10 x %struct.pose_t], ptr %30, i64 0, i64 %69
  %71 = getelementptr inbounds %struct.pose_t, ptr %70, i32 0, i32 4
  call void @vec3_copy(ptr noundef %71, ptr noundef %21)
  %72 = load double, ptr %24, align 8, !tbaa !11
  %73 = load i32, ptr %23, align 4, !tbaa !9
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [10 x %struct.pose_t], ptr %30, i64 0, i64 %74
  %76 = getelementptr inbounds %struct.pose_t, ptr %75, i32 0, i32 5
  store double %72, ptr %76, align 8, !tbaa !13
  br label %77

77:                                               ; preds = %57
  %78 = load i32, ptr %23, align 4, !tbaa !9
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %23, align 4, !tbaa !9
  br label %53, !llvm.loop !16

80:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #5
  store i32 -1, ptr %32, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #5
  store double 1.000000e+10, ptr %33, align 8, !tbaa !11
  store i32 0, ptr %23, align 4, !tbaa !9
  br label %81

81:                                               ; preds = %101, %80
  %82 = load i32, ptr %23, align 4, !tbaa !9
  %83 = load i32, ptr %31, align 4, !tbaa !9
  %84 = icmp slt i32 %82, %83
  br i1 %84, label %85, label %104

85:                                               ; preds = %81
  %86 = load i32, ptr %23, align 4, !tbaa !9
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [10 x %struct.pose_t], ptr %30, i64 0, i64 %87
  %89 = getelementptr inbounds %struct.pose_t, ptr %88, i32 0, i32 5
  %90 = load double, ptr %89, align 8, !tbaa !13
  %91 = load double, ptr %33, align 8, !tbaa !11
  %92 = fcmp olt double %90, %91
  br i1 %92, label %93, label %100

93:                                               ; preds = %85
  %94 = load i32, ptr %23, align 4, !tbaa !9
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [10 x %struct.pose_t], ptr %30, i64 0, i64 %95
  %97 = getelementptr inbounds %struct.pose_t, ptr %96, i32 0, i32 5
  %98 = load double, ptr %97, align 8, !tbaa !13
  store double %98, ptr %33, align 8, !tbaa !11
  %99 = load i32, ptr %23, align 4, !tbaa !9
  store i32 %99, ptr %32, align 4, !tbaa !9
  br label %100

100:                                              ; preds = %93, %85
  br label %101

101:                                              ; preds = %100
  %102 = load i32, ptr %23, align 4, !tbaa !9
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %23, align 4, !tbaa !9
  br label %81, !llvm.loop !18

104:                                              ; preds = %81
  %105 = load i32, ptr %32, align 4, !tbaa !9
  %106 = icmp sge i32 %105, 0
  br i1 %106, label %107, label %124

107:                                              ; preds = %104
  %108 = load ptr, ptr %12, align 8, !tbaa !5
  %109 = load i32, ptr %32, align 4, !tbaa !9
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [10 x %struct.pose_t], ptr %30, i64 0, i64 %110
  %112 = getelementptr inbounds %struct.pose_t, ptr %111, i32 0, i32 3
  call void @mat33_copy(ptr noundef %108, ptr noundef %112)
  %113 = load ptr, ptr %13, align 8, !tbaa !5
  %114 = load i32, ptr %32, align 4, !tbaa !9
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [10 x %struct.pose_t], ptr %30, i64 0, i64 %115
  %117 = getelementptr inbounds %struct.pose_t, ptr %116, i32 0, i32 4
  call void @vec3_copy(ptr noundef %113, ptr noundef %117)
  %118 = load i32, ptr %32, align 4, !tbaa !9
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [10 x %struct.pose_t], ptr %30, i64 0, i64 %119
  %121 = getelementptr inbounds %struct.pose_t, ptr %120, i32 0, i32 5
  %122 = load double, ptr %121, align 8, !tbaa !13
  %123 = load ptr, ptr %11, align 8, !tbaa !5
  store double %122, ptr %123, align 8, !tbaa !11
  br label %128

124:                                              ; preds = %104
  %125 = load ptr, ptr %12, align 8, !tbaa !5
  call void @mat33_clear(ptr noundef %125)
  %126 = load ptr, ptr %13, align 8, !tbaa !5
  call void @vec3_clear(ptr noundef %126)
  %127 = load ptr, ptr %11, align 8, !tbaa !5
  store double 1.000000e+10, ptr %127, align 8, !tbaa !11
  br label %128

128:                                              ; preds = %124, %107
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #5
  %129 = load i32, ptr %32, align 4, !tbaa !9
  store i32 %129, ptr %34, align 4, !tbaa !9
  store double 1.000000e+10, ptr %33, align 8, !tbaa !11
  store i32 0, ptr %23, align 4, !tbaa !9
  br label %130

130:                                              ; preds = %154, %128
  %131 = load i32, ptr %23, align 4, !tbaa !9
  %132 = load i32, ptr %31, align 4, !tbaa !9
  %133 = icmp slt i32 %131, %132
  br i1 %133, label %134, label %157

134:                                              ; preds = %130
  %135 = load i32, ptr %23, align 4, !tbaa !9
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [10 x %struct.pose_t], ptr %30, i64 0, i64 %136
  %138 = getelementptr inbounds %struct.pose_t, ptr %137, i32 0, i32 5
  %139 = load double, ptr %138, align 8, !tbaa !13
  %140 = load double, ptr %33, align 8, !tbaa !11
  %141 = fcmp olt double %139, %140
  br i1 %141, label %142, label %153

142:                                              ; preds = %134
  %143 = load i32, ptr %34, align 4, !tbaa !9
  %144 = load i32, ptr %23, align 4, !tbaa !9
  %145 = icmp ne i32 %143, %144
  br i1 %145, label %146, label %153

146:                                              ; preds = %142
  %147 = load i32, ptr %23, align 4, !tbaa !9
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [10 x %struct.pose_t], ptr %30, i64 0, i64 %148
  %150 = getelementptr inbounds %struct.pose_t, ptr %149, i32 0, i32 5
  %151 = load double, ptr %150, align 8, !tbaa !13
  store double %151, ptr %33, align 8, !tbaa !11
  %152 = load i32, ptr %23, align 4, !tbaa !9
  store i32 %152, ptr %32, align 4, !tbaa !9
  br label %153

153:                                              ; preds = %146, %142, %134
  br label %154

154:                                              ; preds = %153
  %155 = load i32, ptr %23, align 4, !tbaa !9
  %156 = add nsw i32 %155, 1
  store i32 %156, ptr %23, align 4, !tbaa !9
  br label %130, !llvm.loop !19

157:                                              ; preds = %130
  %158 = load i32, ptr %32, align 4, !tbaa !9
  %159 = icmp sge i32 %158, 0
  br i1 %159, label %160, label %177

160:                                              ; preds = %157
  %161 = load ptr, ptr %15, align 8, !tbaa !5
  %162 = load i32, ptr %32, align 4, !tbaa !9
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [10 x %struct.pose_t], ptr %30, i64 0, i64 %163
  %165 = getelementptr inbounds %struct.pose_t, ptr %164, i32 0, i32 3
  call void @mat33_copy(ptr noundef %161, ptr noundef %165)
  %166 = load ptr, ptr %16, align 8, !tbaa !5
  %167 = load i32, ptr %32, align 4, !tbaa !9
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [10 x %struct.pose_t], ptr %30, i64 0, i64 %168
  %170 = getelementptr inbounds %struct.pose_t, ptr %169, i32 0, i32 4
  call void @vec3_copy(ptr noundef %166, ptr noundef %170)
  %171 = load i32, ptr %32, align 4, !tbaa !9
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [10 x %struct.pose_t], ptr %30, i64 0, i64 %172
  %174 = getelementptr inbounds %struct.pose_t, ptr %173, i32 0, i32 5
  %175 = load double, ptr %174, align 8, !tbaa !13
  %176 = load ptr, ptr %14, align 8, !tbaa !5
  store double %175, ptr %176, align 8, !tbaa !11
  br label %181

177:                                              ; preds = %157
  %178 = load ptr, ptr %12, align 8, !tbaa !5
  call void @mat33_clear(ptr noundef %178)
  %179 = load ptr, ptr %13, align 8, !tbaa !5
  call void @vec3_clear(ptr noundef %179)
  %180 = load ptr, ptr %11, align 8, !tbaa !5
  store double 1.000000e+10, ptr %180, align 8, !tbaa !11
  br label %181

181:                                              ; preds = %177, %160
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #5
  call void @llvm.lifetime.end.p0(i64 2080, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 96, ptr %29) #5
  %182 = load ptr, ptr %26, align 8
  call void @llvm.stackrestore.p0(ptr %182)
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr %20) #5
  ret void
}

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


; 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.options_t = type { %struct.mat33_t, double, double, i32 }
%struct.mat33_t = type { [9 x double] }
%struct.vec3_t = type { [3 x double] }
%struct.pose_t = type { %struct.mat33_t, %struct.vec3_t, double, %struct.mat33_t, %struct.vec3_t, double }

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

declare void @vec3_copy(ptr noundef, ptr noundef) local_unnamed_addr #1

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

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

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

declare void @vec3_clear(ptr noundef) local_unnamed_addr #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) #3

declare void @mat33_clear(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @objpose(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef byval(%struct.options_t) align 8, i32 noundef) local_unnamed_addr #4

declare void @mat33_copy(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @get2ndPose_Exact(ptr noundef, ptr noundef, ptr noundef, ptr noundef byval(%struct.mat33_t) align 8, ptr noundef byval(%struct.vec3_t) align 8, double noundef, i32 noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
define dso_local void @robust_pose(ptr nocapture noundef writeonly %0, ptr noundef %1, ptr noundef %2, ptr nocapture noundef writeonly %3, ptr noundef %4, ptr noundef %5, ptr nocapture noundef readonly %6, ptr nocapture noundef readonly %7, ptr nocapture noundef readonly byval(%struct.options_t) align 8 %8, i32 noundef %9) local_unnamed_addr #4 {
  %11 = alloca %struct.mat33_t, align 8
  %12 = alloca %struct.vec3_t, align 8
  %13 = alloca i32, align 4
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca %struct.options_t, align 8
  %17 = alloca [10 x %struct.pose_t], align 16
  %18 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %11) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %12) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #5
  %19 = zext i32 %9 to i64
  %20 = tail call ptr @llvm.stacksave.p0()
  %21 = alloca %struct.vec3_t, i64 %19, align 16
  %22 = alloca %struct.vec3_t, i64 %19, align 16
  %23 = sext i32 %9 to i64
  %24 = mul nsw i64 %23, 24
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %21, ptr align 8 %6, i64 %24, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %22, ptr align 8 %7, i64 %24, i1 false)
  call void @llvm.lifetime.start.p0(i64 96, ptr nonnull %16) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(96) %16, ptr noundef nonnull align 8 dereferenceable(96) %8, i64 96, i1 false)
  call void @mat33_clear(ptr noundef nonnull %11) #5
  call void @vec3_clear(ptr noundef nonnull %12) #5
  store i32 0, ptr %13, align 4, !tbaa !5
  store double 0.000000e+00, ptr %14, align 8, !tbaa !9
  store double 0.000000e+00, ptr %15, align 8, !tbaa !9
  call void @objpose(ptr noundef nonnull %11, ptr noundef nonnull %12, ptr noundef nonnull %13, ptr noundef nonnull %14, ptr noundef nonnull %15, i32 noundef 0, ptr noundef nonnull %21, ptr noundef nonnull %22, ptr noundef nonnull byval(%struct.options_t) align 8 %16, i32 noundef %9)
  call void @llvm.lifetime.start.p0(i64 2080, ptr nonnull %17) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %18) #5
  store i32 0, ptr %18, align 4, !tbaa !5
  call void @get2ndPose_Exact(ptr noundef nonnull %17, ptr noundef nonnull %22, ptr noundef nonnull %21, ptr noundef nonnull byval(%struct.mat33_t) align 8 %11, ptr noundef nonnull byval(%struct.vec3_t) align 8 %12, double noundef 0.000000e+00, i32 noundef %9, ptr noundef nonnull %18)
  %25 = load i32, ptr %18, align 4, !tbaa !5
  %26 = icmp sgt i32 %25, 0
  br i1 %26, label %.lr.ph, label %._crit_edge.thread

.preheader:                                       ; preds = %.lr.ph
  %27 = icmp sgt i32 %34, 0
  br i1 %27, label %.lr.ph63.preheader, label %._crit_edge.thread

.lr.ph63.preheader:                               ; preds = %.preheader
  %wide.trip.count = zext nneg i32 %34 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %28 = icmp eq i32 %34, 1
  br i1 %28, label %._crit_edge.unr-lcssa, label %.lr.ph63.preheader.new

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

.lr.ph:                                           ; preds = %10, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %10 ]
  %29 = getelementptr inbounds [10 x %struct.pose_t], ptr %17, i64 0, i64 %indvars.iv
  call void @mat33_copy(ptr noundef nonnull %16, ptr noundef nonnull %29) #5
  call void @objpose(ptr noundef nonnull %11, ptr noundef nonnull %12, ptr noundef nonnull %13, ptr noundef nonnull %14, ptr noundef nonnull %15, i32 noundef 0, ptr noundef nonnull %21, ptr noundef nonnull %22, ptr noundef nonnull byval(%struct.options_t) align 8 %16, i32 noundef %9)
  %30 = getelementptr inbounds i8, ptr %29, i64 104
  call void @mat33_copy(ptr noundef nonnull %30, ptr noundef nonnull %11) #5
  %31 = getelementptr inbounds i8, ptr %29, i64 176
  call void @vec3_copy(ptr noundef nonnull %31, ptr noundef nonnull %12) #5
  %32 = load double, ptr %14, align 8, !tbaa !9
  %33 = getelementptr inbounds i8, ptr %29, i64 200
  store double %32, ptr %33, align 8, !tbaa !11
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %34 = load i32, ptr %18, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = icmp slt i64 %indvars.iv.next, %35
  br i1 %36, label %.lr.ph, label %.preheader, !llvm.loop !14

.lr.ph63:                                         ; preds = %.lr.ph63, %.lr.ph63.preheader.new
  %indvars.iv74 = phi i64 [ 0, %.lr.ph63.preheader.new ], [ %indvars.iv.next75.1, %.lr.ph63 ]
  %.05061 = phi double [ 1.000000e+10, %.lr.ph63.preheader.new ], [ %.151.1, %.lr.ph63 ]
  %.05360 = phi i32 [ -1, %.lr.ph63.preheader.new ], [ %.154.1, %.lr.ph63 ]
  %niter = phi i64 [ 0, %.lr.ph63.preheader.new ], [ %niter.next.1, %.lr.ph63 ]
  %37 = getelementptr inbounds [10 x %struct.pose_t], ptr %17, i64 0, i64 %indvars.iv74, i32 5
  %38 = load double, ptr %37, align 8, !tbaa !11
  %39 = fcmp olt double %38, %.05061
  %40 = trunc nuw nsw i64 %indvars.iv74 to i32
  %.154 = select i1 %39, i32 %40, i32 %.05360
  %.151 = select i1 %39, double %38, double %.05061
  %indvars.iv.next75 = or disjoint i64 %indvars.iv74, 1
  %41 = getelementptr inbounds [10 x %struct.pose_t], ptr %17, i64 0, i64 %indvars.iv.next75, i32 5
  %42 = load double, ptr %41, align 8, !tbaa !11
  %43 = fcmp olt double %42, %.151
  %44 = trunc nuw nsw i64 %indvars.iv.next75 to i32
  %.154.1 = select i1 %43, i32 %44, i32 %.154
  %.151.1 = select i1 %43, double %42, double %.151
  %indvars.iv.next75.1 = add nuw nsw i64 %indvars.iv74, 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 %._crit_edge.unr-lcssa, label %.lr.ph63, !llvm.loop !16

._crit_edge.unr-lcssa:                            ; preds = %.lr.ph63, %.lr.ph63.preheader
  %.154.lcssa.ph = phi i32 [ poison, %.lr.ph63.preheader ], [ %.154.1, %.lr.ph63 ]
  %indvars.iv74.unr = phi i64 [ 0, %.lr.ph63.preheader ], [ %indvars.iv.next75.1, %.lr.ph63 ]
  %.05061.unr = phi double [ 1.000000e+10, %.lr.ph63.preheader ], [ %.151.1, %.lr.ph63 ]
  %.05360.unr = phi i32 [ -1, %.lr.ph63.preheader ], [ %.154.1, %.lr.ph63 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph63.epil

.lr.ph63.epil:                                    ; preds = %._crit_edge.unr-lcssa
  %45 = getelementptr inbounds [10 x %struct.pose_t], ptr %17, i64 0, i64 %indvars.iv74.unr, i32 5
  %46 = load double, ptr %45, align 8, !tbaa !11
  %47 = fcmp olt double %46, %.05061.unr
  %48 = trunc nuw nsw i64 %indvars.iv74.unr to i32
  %.154.epil = select i1 %47, i32 %48, i32 %.05360.unr
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.unr-lcssa, %.lr.ph63.epil
  %.154.lcssa = phi i32 [ %.154.lcssa.ph, %._crit_edge.unr-lcssa ], [ %.154.epil, %.lr.ph63.epil ]
  %49 = icmp sgt i32 %.154.lcssa, -1
  br i1 %49, label %50, label %._crit_edge.thread

50:                                               ; preds = %._crit_edge
  %51 = zext nneg i32 %.154.lcssa to i64
  %52 = getelementptr inbounds [10 x %struct.pose_t], ptr %17, i64 0, i64 %51
  %53 = getelementptr inbounds i8, ptr %52, i64 104
  call void @mat33_copy(ptr noundef %1, ptr noundef nonnull %53) #5
  %54 = getelementptr inbounds i8, ptr %52, i64 176
  call void @vec3_copy(ptr noundef %2, ptr noundef nonnull %54) #5
  %55 = getelementptr inbounds i8, ptr %52, i64 200
  %56 = load double, ptr %55, align 8, !tbaa !11
  br label %57

._crit_edge.thread:                               ; preds = %10, %.preheader, %._crit_edge
  %.053.lcssa85 = phi i32 [ %.154.lcssa, %._crit_edge ], [ -1, %.preheader ], [ -1, %10 ]
  call void @mat33_clear(ptr noundef %1) #5
  call void @vec3_clear(ptr noundef %2) #5
  br label %57

57:                                               ; preds = %._crit_edge.thread, %50
  %.053.lcssa84 = phi i32 [ %.053.lcssa85, %._crit_edge.thread ], [ %.154.lcssa, %50 ]
  %storemerge = phi double [ 1.000000e+10, %._crit_edge.thread ], [ %56, %50 ]
  store double %storemerge, ptr %0, align 8, !tbaa !9
  %58 = load i32, ptr %18, align 4, !tbaa !5
  %59 = icmp sgt i32 %58, 0
  br i1 %59, label %.lr.ph69.preheader, label %._crit_edge70

.lr.ph69.preheader:                               ; preds = %57
  %60 = zext i32 %.053.lcssa84 to i64
  %wide.trip.count80 = zext nneg i32 %58 to i64
  %xtraiter87 = and i64 %wide.trip.count80, 1
  %61 = icmp eq i32 %58, 1
  br i1 %61, label %._crit_edge70.loopexit.unr-lcssa, label %.lr.ph69.preheader.new

.lr.ph69.preheader.new:                           ; preds = %.lr.ph69.preheader
  %unroll_iter90 = and i64 %wide.trip.count80, 2147483646
  br label %.lr.ph69

.lr.ph69:                                         ; preds = %.lr.ph69, %.lr.ph69.preheader.new
  %indvars.iv77 = phi i64 [ 0, %.lr.ph69.preheader.new ], [ %indvars.iv.next78.1, %.lr.ph69 ]
  %.25266 = phi double [ 1.000000e+10, %.lr.ph69.preheader.new ], [ %.3.1, %.lr.ph69 ]
  %.25565 = phi i32 [ %.053.lcssa84, %.lr.ph69.preheader.new ], [ %.356.1, %.lr.ph69 ]
  %niter91 = phi i64 [ 0, %.lr.ph69.preheader.new ], [ %niter91.next.1, %.lr.ph69 ]
  %62 = getelementptr inbounds [10 x %struct.pose_t], ptr %17, i64 0, i64 %indvars.iv77, i32 5
  %63 = load double, ptr %62, align 8, !tbaa !11
  %64 = fcmp uge double %63, %.25266
  %.not = icmp eq i64 %indvars.iv77, %60
  %or.cond = or i1 %64, %.not
  %65 = trunc nuw nsw i64 %indvars.iv77 to i32
  %.356 = select i1 %or.cond, i32 %.25565, i32 %65
  %.3 = select i1 %or.cond, double %.25266, double %63
  %indvars.iv.next78 = or disjoint i64 %indvars.iv77, 1
  %66 = getelementptr inbounds [10 x %struct.pose_t], ptr %17, i64 0, i64 %indvars.iv.next78, i32 5
  %67 = load double, ptr %66, align 8, !tbaa !11
  %68 = fcmp uge double %67, %.3
  %.not.1 = icmp eq i64 %indvars.iv.next78, %60
  %or.cond.1 = or i1 %68, %.not.1
  %69 = trunc nuw nsw i64 %indvars.iv.next78 to i32
  %.356.1 = select i1 %or.cond.1, i32 %.356, i32 %69
  %.3.1 = select i1 %or.cond.1, double %.3, double %67
  %indvars.iv.next78.1 = add nuw nsw i64 %indvars.iv77, 2
  %niter91.next.1 = add i64 %niter91, 2
  %niter91.ncmp.1 = icmp eq i64 %niter91.next.1, %unroll_iter90
  br i1 %niter91.ncmp.1, label %._crit_edge70.loopexit.unr-lcssa, label %.lr.ph69, !llvm.loop !17

._crit_edge70.loopexit.unr-lcssa:                 ; preds = %.lr.ph69, %.lr.ph69.preheader
  %.356.lcssa.ph = phi i32 [ poison, %.lr.ph69.preheader ], [ %.356.1, %.lr.ph69 ]
  %indvars.iv77.unr = phi i64 [ 0, %.lr.ph69.preheader ], [ %indvars.iv.next78.1, %.lr.ph69 ]
  %.25266.unr = phi double [ 1.000000e+10, %.lr.ph69.preheader ], [ %.3.1, %.lr.ph69 ]
  %.25565.unr = phi i32 [ %.053.lcssa84, %.lr.ph69.preheader ], [ %.356.1, %.lr.ph69 ]
  %lcmp.mod88.not = icmp eq i64 %xtraiter87, 0
  br i1 %lcmp.mod88.not, label %._crit_edge70, label %.lr.ph69.epil

.lr.ph69.epil:                                    ; preds = %._crit_edge70.loopexit.unr-lcssa
  %70 = getelementptr inbounds [10 x %struct.pose_t], ptr %17, i64 0, i64 %indvars.iv77.unr, i32 5
  %71 = load double, ptr %70, align 8, !tbaa !11
  %72 = fcmp uge double %71, %.25266.unr
  %.not.epil = icmp eq i64 %indvars.iv77.unr, %60
  %or.cond.epil = or i1 %72, %.not.epil
  %73 = trunc nuw nsw i64 %indvars.iv77.unr to i32
  %.356.epil = select i1 %or.cond.epil, i32 %.25565.unr, i32 %73
  br label %._crit_edge70

._crit_edge70:                                    ; preds = %.lr.ph69.epil, %._crit_edge70.loopexit.unr-lcssa, %57
  %.255.lcssa = phi i32 [ %.053.lcssa84, %57 ], [ %.356.lcssa.ph, %._crit_edge70.loopexit.unr-lcssa ], [ %.356.epil, %.lr.ph69.epil ]
  %74 = icmp sgt i32 %.255.lcssa, -1
  br i1 %74, label %75, label %82

75:                                               ; preds = %._crit_edge70
  %76 = zext nneg i32 %.255.lcssa to i64
  %77 = getelementptr inbounds [10 x %struct.pose_t], ptr %17, i64 0, i64 %76
  %78 = getelementptr inbounds i8, ptr %77, i64 104
  call void @mat33_copy(ptr noundef %4, ptr noundef nonnull %78) #5
  %79 = getelementptr inbounds i8, ptr %77, i64 176
  call void @vec3_copy(ptr noundef %5, ptr noundef nonnull %79) #5
  %80 = getelementptr inbounds i8, ptr %77, i64 200
  %81 = load double, ptr %80, align 8, !tbaa !11
  store double %81, ptr %3, align 8, !tbaa !9
  br label %83

82:                                               ; preds = %._crit_edge70
  call void @mat33_clear(ptr noundef %1) #5
  call void @vec3_clear(ptr noundef %2) #5
  store double 1.000000e+10, ptr %0, align 8, !tbaa !9
  br label %83

83:                                               ; preds = %82, %75
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %18) #5
  call void @llvm.lifetime.end.p0(i64 2080, ptr nonnull %17) #5
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %16) #5
  call void @llvm.stackrestore.p0(ptr %20)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %11) #5
  ret void
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !10, i64 200}
!12 = !{!"", !13, i64 0, !13, i64 72, !10, i64 96, !13, i64 104, !13, i64 176, !10, i64 200}
!13 = !{!"", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !15}


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