; 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] }

@__const.objpose.mask_z = external hidden unnamed_addr constant [3 x i32], align 4

; 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

declare void @vec3_mult(ptr noundef, double noundef) #1

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

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

declare double @vec3_dot(ptr noundef, ptr noundef) #1

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

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

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

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

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

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

declare double @_sqrt(double noundef) #1

declare double @_abs(double noundef) #1

declare void @vec3_clear(ptr noundef) #1

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

; 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

declare void @vec3_array_sum(ptr noundef, ptr noundef, i32 noundef) #1

declare void @vec3_div(ptr noundef, double noundef) #1

declare void @vec3_array_sub(ptr noundef, ptr noundef, i32 noundef) #1

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

declare void @mat33_eye(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @objpose(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, i32 noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef byval(%struct.options_t) align 8 %8, i32 noundef %9) #2 {
  %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 i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca ptr, align 8
  %23 = alloca i64, align 8
  %24 = alloca %struct.vec3_t, align 8
  %25 = alloca i64, align 8
  %26 = alloca %struct.vec3_t, align 8
  %27 = alloca [3 x i32], align 4
  %28 = alloca i64, align 8
  %29 = alloca %struct.vec3_t, align 8
  %30 = alloca %struct.mat33_t, align 8
  %31 = alloca %struct.mat33_t, align 8
  %32 = alloca %struct.mat33_t, align 8
  %33 = alloca %struct.mat33_t, align 8
  %34 = alloca %struct.mat33_t, align 8
  %35 = alloca i32, align 4
  %36 = alloca %struct.mat33_t, align 8
  %37 = alloca %struct.vec3_t, align 8
  %38 = alloca i64, align 8
  %39 = alloca double, align 8
  %40 = alloca double, align 8
  %41 = alloca %struct.vec3_t, align 8
  %42 = alloca %struct.vec3_t, align 8
  %43 = alloca %struct.vec3_t, align 8
  %44 = alloca %struct.mat33_t, align 8
  %45 = alloca %struct.mat33_t, align 8
  %46 = alloca %struct.vec3_t, align 8
  %47 = alloca ptr, align 8
  %48 = alloca i64, align 8
  %49 = alloca %struct.vec3_t, align 8
  %50 = alloca %struct.vec3_t, align 8
  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 i32 %5, ptr %16, align 4, !tbaa !9
  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 4, ptr %20) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  %51 = load i32, ptr %19, align 4, !tbaa !9
  %52 = zext i32 %51 to i64
  %53 = call ptr @llvm.stacksave.p0()
  store ptr %53, ptr %22, align 8
  %54 = alloca %struct.vec3_t, i64 %52, align 16
  store i64 %52, ptr %23, align 8
  %55 = load ptr, ptr %17, align 8, !tbaa !5
  %56 = load i32, ptr %19, align 4, !tbaa !9
  %57 = sext i32 %56 to i64
  %58 = mul i64 %57, 24
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %54, ptr align 8 %55, i64 %58, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr %24) #5
  %59 = load i32, ptr %19, align 4, !tbaa !9
  call void @vec3_array_sum(ptr noundef %24, ptr noundef %54, i32 noundef %59)
  %60 = load i32, ptr %19, align 4, !tbaa !9
  %61 = sitofp i32 %60 to double
  call void @vec3_div(ptr noundef %24, double noundef %61)
  %62 = load i32, ptr %19, align 4, !tbaa !9
  call void @vec3_array_sub(ptr noundef %54, ptr noundef %24, i32 noundef %62)
  %63 = load i32, ptr %19, align 4, !tbaa !9
  %64 = zext i32 %63 to i64
  %65 = alloca %struct.vec3_t, i64 %64, align 16
  store i64 %64, ptr %25, align 8
  %66 = load ptr, ptr %18, align 8, !tbaa !5
  %67 = load i32, ptr %19, align 4, !tbaa !9
  %68 = sext i32 %67 to i64
  %69 = mul i64 %68, 24
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %65, ptr align 8 %66, i64 %69, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr %26) #5
  %70 = getelementptr inbounds %struct.vec3_t, ptr %26, i32 0, i32 0
  %71 = getelementptr inbounds [3 x double], ptr %70, i64 0, i64 0
  store double 1.000000e+00, ptr %71, align 8, !tbaa !11
  %72 = getelementptr inbounds %struct.vec3_t, ptr %26, i32 0, i32 0
  %73 = getelementptr inbounds [3 x double], ptr %72, i64 0, i64 1
  store double 1.000000e+00, ptr %73, align 8, !tbaa !11
  %74 = getelementptr inbounds %struct.vec3_t, ptr %26, i32 0, i32 0
  %75 = getelementptr inbounds [3 x double], ptr %74, i64 0, i64 2
  store double 1.000000e+00, ptr %75, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 12, ptr %27) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %27, ptr align 4 @__const.objpose.mask_z, i64 12, i1 false)
  %76 = getelementptr inbounds [3 x i32], ptr %27, i64 0, i64 0
  %77 = load i32, ptr %19, align 4, !tbaa !9
  call void @vec3_array_set(ptr noundef %65, ptr noundef %26, ptr noundef %76, i32 noundef %77)
  %78 = load i32, ptr %19, align 4, !tbaa !9
  %79 = zext i32 %78 to i64
  %80 = alloca %struct.mat33_t, i64 %79, align 16
  store i64 %79, ptr %28, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr %29) #5
  store i32 0, ptr %20, align 4, !tbaa !9
  br label %81

81:                                               ; preds = %122, %10
  %82 = load i32, ptr %20, align 4, !tbaa !9
  %83 = load i32, ptr %19, align 4, !tbaa !9
  %84 = icmp slt i32 %82, %83
  br i1 %84, label %85, label %125

85:                                               ; preds = %81
  %86 = load i32, ptr %20, align 4, !tbaa !9
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds %struct.vec3_t, ptr %65, i64 %87
  %89 = getelementptr inbounds %struct.vec3_t, ptr %88, i32 0, i32 0
  %90 = getelementptr inbounds [3 x double], ptr %89, i64 0, i64 0
  %91 = load double, ptr %90, align 8, !tbaa !11
  %92 = load i32, ptr %20, align 4, !tbaa !9
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds %struct.vec3_t, ptr %65, i64 %93
  %95 = getelementptr inbounds %struct.vec3_t, ptr %94, i32 0, i32 0
  %96 = getelementptr inbounds [3 x double], ptr %95, i64 0, i64 2
  %97 = load double, ptr %96, align 8, !tbaa !11
  %98 = fdiv double %91, %97
  %99 = getelementptr inbounds %struct.vec3_t, ptr %29, i32 0, i32 0
  %100 = getelementptr inbounds [3 x double], ptr %99, i64 0, i64 0
  store double %98, ptr %100, align 8, !tbaa !11
  %101 = load i32, ptr %20, align 4, !tbaa !9
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds %struct.vec3_t, ptr %65, i64 %102
  %104 = getelementptr inbounds %struct.vec3_t, ptr %103, i32 0, i32 0
  %105 = getelementptr inbounds [3 x double], ptr %104, i64 0, i64 1
  %106 = load double, ptr %105, align 8, !tbaa !11
  %107 = load i32, ptr %20, align 4, !tbaa !9
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds %struct.vec3_t, ptr %65, i64 %108
  %110 = getelementptr inbounds %struct.vec3_t, ptr %109, i32 0, i32 0
  %111 = getelementptr inbounds [3 x double], ptr %110, i64 0, i64 2
  %112 = load double, ptr %111, align 8, !tbaa !11
  %113 = fdiv double %106, %112
  %114 = getelementptr inbounds %struct.vec3_t, ptr %29, i32 0, i32 0
  %115 = getelementptr inbounds [3 x double], ptr %114, i64 0, i64 1
  store double %113, ptr %115, align 8, !tbaa !11
  %116 = getelementptr inbounds %struct.vec3_t, ptr %29, i32 0, i32 0
  %117 = getelementptr inbounds [3 x double], ptr %116, i64 0, i64 2
  store double 1.000000e+00, ptr %117, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 72, ptr %30) #5
  call void @vec3_mul_vec3trans(ptr noundef %30, ptr noundef %29, ptr noundef %29)
  %118 = call double @vec3trans_mul_vec3(ptr noundef %29, ptr noundef %29)
  call void @mat33_div(ptr noundef %30, double noundef %118)
  %119 = load i32, ptr %20, align 4, !tbaa !9
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds %struct.mat33_t, ptr %80, i64 %120
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %121, ptr align 8 %30, i64 72, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 72, ptr %30) #5
  br label %122

122:                                              ; preds = %85
  %123 = load i32, ptr %20, align 4, !tbaa !9
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %20, align 4, !tbaa !9
  br label %81, !llvm.loop !15

125:                                              ; preds = %81
  call void @llvm.lifetime.start.p0(i64 72, ptr %31) #5
  call void @llvm.lifetime.start.p0(i64 72, ptr %32) #5
  call void @llvm.lifetime.start.p0(i64 72, ptr %33) #5
  call void @llvm.lifetime.start.p0(i64 72, ptr %34) #5
  call void @mat33_eye(ptr noundef %32)
  %126 = load i32, ptr %19, align 4, !tbaa !9
  call void @mat33_array_sum(ptr noundef %33, ptr noundef %80, i32 noundef %126)
  %127 = load i32, ptr %19, align 4, !tbaa !9
  %128 = sitofp i32 %127 to double
  call void @mat33_div(ptr noundef %33, double noundef %128)
  call void @mat33_sub_mat2(ptr noundef %34, ptr noundef %32, ptr noundef %33)
  call void @mat33_inv(ptr noundef %31, ptr noundef %34)
  %129 = load i32, ptr %19, align 4, !tbaa !9
  %130 = sitofp i32 %129 to double
  call void @mat33_div(ptr noundef %31, double noundef %130)
  %131 = load ptr, ptr %13, align 8, !tbaa !5
  store i32 0, ptr %131, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #5
  %132 = getelementptr inbounds %struct.options_t, ptr %8, i32 0, i32 0
  %133 = call i32 @mat33_all_zeros(ptr noundef %132)
  store i32 %133, ptr %35, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 72, ptr %36) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %37) #5
  %134 = load i32, ptr %19, align 4, !tbaa !9
  %135 = zext i32 %134 to i64
  %136 = alloca %struct.vec3_t, i64 %135, align 16
  store i64 %135, ptr %38, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #5
  store double 0.000000e+00, ptr %39, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #5
  store double 0.000000e+00, ptr %40, align 8, !tbaa !11
  %137 = load i32, ptr %35, align 4, !tbaa !9
  %138 = icmp eq i32 %137, 0
  br i1 %138, label %139, label %175

139:                                              ; preds = %125
  %140 = getelementptr inbounds %struct.options_t, ptr %8, i32 0, i32 0
  call void @mat33_copy(ptr noundef %36, ptr noundef %140)
  call void @llvm.lifetime.start.p0(i64 24, ptr %41) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %42) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %43) #5
  call void @llvm.lifetime.start.p0(i64 72, ptr %44) #5
  call void @llvm.lifetime.start.p0(i64 72, ptr %45) #5
  call void @vec3_clear(ptr noundef %41)
  store i32 0, ptr %21, align 4, !tbaa !9
  br label %141

141:                                              ; preds = %152, %139
  %142 = load i32, ptr %21, align 4, !tbaa !9
  %143 = load i32, ptr %19, align 4, !tbaa !9
  %144 = icmp slt i32 %142, %143
  br i1 %144, label %145, label %155

145:                                              ; preds = %141
  call void @mat33_eye(ptr noundef %44)
  %146 = load i32, ptr %21, align 4, !tbaa !9
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds %struct.mat33_t, ptr %80, i64 %147
  call void @mat33_sub_mat2(ptr noundef %45, ptr noundef %148, ptr noundef %44)
  %149 = load i32, ptr %21, align 4, !tbaa !9
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds %struct.vec3_t, ptr %54, i64 %150
  call void @vec3_mult_mat(ptr noundef %42, ptr noundef %36, ptr noundef %151)
  call void @vec3_mult_mat(ptr noundef %43, ptr noundef %45, ptr noundef %42)
  call void @vec3_add_vec(ptr noundef %41, ptr noundef %43)
  br label %152

152:                                              ; preds = %145
  %153 = load i32, ptr %21, align 4, !tbaa !9
  %154 = add nsw i32 %153, 1
  store i32 %154, ptr %21, align 4, !tbaa !9
  br label %141, !llvm.loop !17

155:                                              ; preds = %141
  call void @vec3_mult_mat(ptr noundef %37, ptr noundef %31, ptr noundef %41)
  %156 = load i32, ptr %19, align 4, !tbaa !9
  call void @xform(ptr noundef %136, ptr noundef %54, ptr noundef %36, ptr noundef %37, i32 noundef %156)
  store double 0.000000e+00, ptr %39, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 24, ptr %46) #5
  store i32 0, ptr %21, align 4, !tbaa !9
  br label %157

157:                                              ; preds = %171, %155
  %158 = load i32, ptr %21, align 4, !tbaa !9
  %159 = load i32, ptr %19, align 4, !tbaa !9
  %160 = icmp slt i32 %158, %159
  br i1 %160, label %161, label %174

161:                                              ; preds = %157
  call void @mat33_eye(ptr noundef %44)
  %162 = load i32, ptr %21, align 4, !tbaa !9
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds %struct.mat33_t, ptr %80, i64 %163
  call void @mat33_sub_mat2(ptr noundef %45, ptr noundef %164, ptr noundef %44)
  %165 = load i32, ptr %21, align 4, !tbaa !9
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds %struct.vec3_t, ptr %136, i64 %166
  call void @vec3_mult_mat(ptr noundef %46, ptr noundef %45, ptr noundef %167)
  %168 = call double @vec3_dot(ptr noundef %46, ptr noundef %46)
  %169 = load double, ptr %39, align 8, !tbaa !11
  %170 = fadd double %169, %168
  store double %170, ptr %39, align 8, !tbaa !11
  br label %171

171:                                              ; preds = %161
  %172 = load i32, ptr %21, align 4, !tbaa !9
  %173 = add nsw i32 %172, 1
  store i32 %173, ptr %21, align 4, !tbaa !9
  br label %157, !llvm.loop !18

174:                                              ; preds = %157
  call void @llvm.lifetime.end.p0(i64 24, ptr %46) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr %45) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr %44) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %43) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %42) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %41) #5
  br label %178

175:                                              ; preds = %125
  %176 = load i32, ptr %19, align 4, !tbaa !9
  call void @abskernel(ptr noundef %36, ptr noundef %37, ptr noundef %136, ptr noundef %39, ptr noundef %54, ptr noundef %65, ptr noundef %80, ptr noundef %31, i32 noundef %176)
  %177 = load ptr, ptr %13, align 8, !tbaa !5
  store i32 1, ptr %177, align 4, !tbaa !9
  br label %178

178:                                              ; preds = %175, %174
  %179 = load i32, ptr %19, align 4, !tbaa !9
  call void @abskernel(ptr noundef %36, ptr noundef %37, ptr noundef %136, ptr noundef %40, ptr noundef %54, ptr noundef %136, ptr noundef %80, ptr noundef %31, i32 noundef %179)
  %180 = load ptr, ptr %13, align 8, !tbaa !5
  %181 = load i32, ptr %180, align 4, !tbaa !9
  %182 = add nsw i32 %181, 1
  %183 = load ptr, ptr %13, align 8, !tbaa !5
  store i32 %182, ptr %183, align 4, !tbaa !9
  br label %184

184:                                              ; preds = %213, %178
  %185 = load double, ptr %39, align 8, !tbaa !11
  %186 = load double, ptr %40, align 8, !tbaa !11
  %187 = fsub double %185, %186
  %188 = load double, ptr %39, align 8, !tbaa !11
  %189 = fdiv double %187, %188
  %190 = call double @_abs(double noundef %189)
  %191 = getelementptr inbounds %struct.options_t, ptr %8, i32 0, i32 1
  %192 = load double, ptr %191, align 8, !tbaa !19
  %193 = fcmp ogt double %190, %192
  br i1 %193, label %194, label %211

194:                                              ; preds = %184
  %195 = load double, ptr %40, align 8, !tbaa !11
  %196 = getelementptr inbounds %struct.options_t, ptr %8, i32 0, i32 2
  %197 = load double, ptr %196, align 8, !tbaa !22
  %198 = fcmp ogt double %195, %197
  br i1 %198, label %199, label %211

199:                                              ; preds = %194
  %200 = getelementptr inbounds %struct.options_t, ptr %8, i32 0, i32 3
  %201 = load i32, ptr %200, align 8, !tbaa !23
  %202 = icmp eq i32 %201, 0
  br i1 %202, label %209, label %203

203:                                              ; preds = %199
  %204 = load ptr, ptr %13, align 8, !tbaa !5
  %205 = load i32, ptr %204, align 4, !tbaa !9
  %206 = getelementptr inbounds %struct.options_t, ptr %8, i32 0, i32 3
  %207 = load i32, ptr %206, align 8, !tbaa !23
  %208 = icmp ult i32 %205, %207
  br label %209

209:                                              ; preds = %203, %199
  %210 = phi i1 [ true, %199 ], [ %208, %203 ]
  br label %211

211:                                              ; preds = %209, %194, %184
  %212 = phi i1 [ false, %194 ], [ false, %184 ], [ %210, %209 ]
  br i1 %212, label %213, label %220

213:                                              ; preds = %211
  %214 = load double, ptr %40, align 8, !tbaa !11
  store double %214, ptr %39, align 8, !tbaa !11
  %215 = load i32, ptr %19, align 4, !tbaa !9
  call void @abskernel(ptr noundef %36, ptr noundef %37, ptr noundef %136, ptr noundef %40, ptr noundef %54, ptr noundef %136, ptr noundef %80, ptr noundef %31, i32 noundef %215)
  %216 = load ptr, ptr %13, align 8, !tbaa !5
  %217 = load i32, ptr %216, align 4, !tbaa !9
  %218 = add nsw i32 %217, 1
  %219 = load ptr, ptr %13, align 8, !tbaa !5
  store i32 %218, ptr %219, align 4, !tbaa !9
  br label %184, !llvm.loop !24

220:                                              ; preds = %211
  %221 = load ptr, ptr %11, align 8, !tbaa !5
  call void @mat33_copy(ptr noundef %221, ptr noundef %36)
  %222 = load ptr, ptr %12, align 8, !tbaa !5
  call void @vec3_copy(ptr noundef %222, ptr noundef %37)
  %223 = load double, ptr %40, align 8, !tbaa !11
  %224 = load i32, ptr %19, align 4, !tbaa !9
  %225 = sitofp i32 %224 to double
  %226 = fdiv double %223, %225
  %227 = call double @_sqrt(double noundef %226)
  %228 = load ptr, ptr %14, align 8, !tbaa !5
  store double %227, ptr %228, align 8, !tbaa !11
  %229 = load i32, ptr %16, align 4, !tbaa !9
  %230 = icmp eq i32 %229, 1
  br i1 %230, label %231, label %266

231:                                              ; preds = %220
  %232 = load i32, ptr %19, align 4, !tbaa !9
  %233 = zext i32 %232 to i64
  %234 = call ptr @llvm.stacksave.p0()
  store ptr %234, ptr %47, align 8
  %235 = alloca %struct.vec3_t, i64 %233, align 16
  store i64 %233, ptr %48, align 8
  %236 = load i32, ptr %19, align 4, !tbaa !9
  call void @xformproj(ptr noundef %235, ptr noundef %54, ptr noundef %36, ptr noundef %37, i32 noundef %236)
  %237 = load ptr, ptr %15, align 8, !tbaa !5
  store double 0.000000e+00, ptr %237, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 24, ptr %49) #5
  store i32 0, ptr %21, align 4, !tbaa !9
  br label %238

238:                                              ; preds = %254, %231
  %239 = load i32, ptr %21, align 4, !tbaa !9
  %240 = load i32, ptr %19, align 4, !tbaa !9
  %241 = icmp slt i32 %239, %240
  br i1 %241, label %242, label %257

242:                                              ; preds = %238
  %243 = load i32, ptr %21, align 4, !tbaa !9
  %244 = sext i32 %243 to i64
  %245 = getelementptr inbounds %struct.vec3_t, ptr %235, i64 %244
  %246 = load ptr, ptr %18, align 8, !tbaa !5
  %247 = load i32, ptr %21, align 4, !tbaa !9
  %248 = sext i32 %247 to i64
  %249 = getelementptr inbounds %struct.vec3_t, ptr %246, i64 %248
  call void @vec3_sub_vec2(ptr noundef %49, ptr noundef %245, ptr noundef %249)
  %250 = call double @vec3_dot(ptr noundef %49, ptr noundef %49)
  %251 = load ptr, ptr %15, align 8, !tbaa !5
  %252 = load double, ptr %251, align 8, !tbaa !11
  %253 = fadd double %252, %250
  store double %253, ptr %251, align 8, !tbaa !11
  br label %254

254:                                              ; preds = %242
  %255 = load i32, ptr %21, align 4, !tbaa !9
  %256 = add nsw i32 %255, 1
  store i32 %256, ptr %21, align 4, !tbaa !9
  br label %238, !llvm.loop !25

257:                                              ; preds = %238
  %258 = load ptr, ptr %15, align 8, !tbaa !5
  %259 = load double, ptr %258, align 8, !tbaa !11
  %260 = load i32, ptr %19, align 4, !tbaa !9
  %261 = sitofp i32 %260 to double
  %262 = fdiv double %259, %261
  %263 = call double @_sqrt(double noundef %262)
  %264 = load ptr, ptr %15, align 8, !tbaa !5
  store double %263, ptr %264, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 24, ptr %49) #5
  %265 = load ptr, ptr %47, align 8
  call void @llvm.stackrestore.p0(ptr %265)
  br label %266

266:                                              ; preds = %257, %220
  %267 = load ptr, ptr %12, align 8, !tbaa !5
  %268 = getelementptr inbounds %struct.vec3_t, ptr %267, i32 0, i32 0
  %269 = getelementptr inbounds [3 x double], ptr %268, i64 0, i64 2
  %270 = load double, ptr %269, align 8, !tbaa !11
  %271 = fcmp olt double %270, 0.000000e+00
  br i1 %271, label %272, label %275

272:                                              ; preds = %266
  %273 = load ptr, ptr %11, align 8, !tbaa !5
  call void @mat33_mult(ptr noundef %273, double noundef -1.000000e+00)
  %274 = load ptr, ptr %12, align 8, !tbaa !5
  call void @vec3_mult(ptr noundef %274, double noundef -1.000000e+00)
  br label %275

275:                                              ; preds = %272, %266
  call void @llvm.lifetime.start.p0(i64 24, ptr %50) #5
  call void @vec3_mult_mat(ptr noundef %50, ptr noundef %36, ptr noundef %24)
  %276 = load ptr, ptr %12, align 8, !tbaa !5
  call void @vec3_sub_vec(ptr noundef %276, ptr noundef %50)
  call void @llvm.lifetime.end.p0(i64 24, ptr %50) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %37) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr %36) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr %34) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr %33) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr %32) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr %31) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %29) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %24) #5
  %277 = load ptr, ptr %22, align 8
  call void @llvm.stackrestore.p0(ptr %277)
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  ret void
}

declare void @vec3_array_set(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #1

declare void @mat33_div(ptr noundef, double noundef) #1

declare double @vec3trans_mul_vec3(ptr noundef, ptr noundef) #1

declare void @mat33_array_sum(ptr noundef, ptr noundef, i32 noundef) #1

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

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

declare i32 @mat33_all_zeros(ptr noundef) #1

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

declare void @mat33_mult(ptr noundef, double noundef) #1

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

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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 = !{i64 0, i64 72, !14}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}
!19 = !{!20, !12, i64 72}
!20 = !{!"", !21, i64 0, !12, i64 72, !12, i64 80, !10, i64 88}
!21 = !{!"", !7, i64 0}
!22 = !{!20, !12, i64 80}
!23 = !{!20, !10, i64 88}
!24 = distinct !{!24, !16}
!25 = distinct !{!25, !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"

%struct.options_t = type { %struct.mat33_t, double, double, i32 }
%struct.mat33_t = type { [9 x double] }
%struct.vec3_t = type { [3 x double] }

@__const.objpose.mask_z = external hidden unnamed_addr constant [3 x i32], align 4

; 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

declare void @vec3_mult(ptr noundef, double 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

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

declare double @vec3_dot(ptr noundef, ptr noundef) local_unnamed_addr #1

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

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

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

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

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

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

declare double @_sqrt(double noundef) local_unnamed_addr #1

declare double @_abs(double noundef) local_unnamed_addr #1

declare void @vec3_clear(ptr noundef) local_unnamed_addr #1

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

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

declare void @vec3_array_sum(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

declare void @vec3_div(ptr noundef, double noundef) local_unnamed_addr #1

declare void @vec3_array_sub(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

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

declare void @mat33_eye(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @objpose(ptr noundef %0, ptr noundef %1, ptr nocapture noundef %2, ptr nocapture noundef writeonly %3, ptr nocapture noundef %4, i32 noundef %5, ptr nocapture noundef readonly %6, ptr noundef %7, ptr noundef byval(%struct.options_t) align 8 %8, i32 noundef %9) local_unnamed_addr #2 {
  %11 = alloca %struct.vec3_t, align 8
  %12 = alloca %struct.vec3_t, align 16
  %13 = alloca [3 x i32], align 4
  %14 = alloca %struct.vec3_t, align 16
  %15 = alloca %struct.mat33_t, align 8
  %16 = alloca %struct.mat33_t, align 8
  %17 = alloca %struct.mat33_t, align 8
  %18 = alloca %struct.mat33_t, align 8
  %19 = alloca %struct.mat33_t, align 8
  %20 = alloca %struct.mat33_t, align 8
  %21 = alloca %struct.vec3_t, align 8
  %22 = alloca double, align 8
  %23 = alloca double, align 8
  %24 = alloca %struct.vec3_t, align 8
  %25 = alloca %struct.vec3_t, align 8
  %26 = alloca %struct.vec3_t, align 8
  %27 = alloca %struct.mat33_t, align 8
  %28 = alloca %struct.mat33_t, align 8
  %29 = alloca %struct.vec3_t, align 8
  %30 = alloca %struct.vec3_t, align 8
  %31 = alloca %struct.vec3_t, align 8
  %32 = zext i32 %9 to i64
  %33 = alloca %struct.vec3_t, i64 %32, align 16
  %34 = sext i32 %9 to i64
  %35 = mul nsw i64 %34, 24
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %33, ptr align 8 %6, i64 %35, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %11) #5
  call void @vec3_array_sum(ptr noundef nonnull %11, ptr noundef nonnull %33, i32 noundef %9) #5
  %36 = sitofp i32 %9 to double
  call void @vec3_div(ptr noundef nonnull %11, double noundef %36) #5
  call void @vec3_array_sub(ptr noundef nonnull %33, ptr noundef nonnull %11, i32 noundef %9) #5
  %37 = alloca %struct.vec3_t, i64 %32, align 16
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %37, ptr align 8 %7, i64 %35, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %12) #5
  store <2 x double> <double 1.000000e+00, double 1.000000e+00>, ptr %12, align 16, !tbaa !5
  %38 = getelementptr inbounds i8, ptr %12, i64 16
  store double 1.000000e+00, ptr %38, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %13) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %13, ptr noundef nonnull align 4 dereferenceable(12) @__const.objpose.mask_z, i64 12, i1 false)
  call void @vec3_array_set(ptr noundef nonnull %37, ptr noundef nonnull %12, ptr noundef nonnull %13, i32 noundef %9) #5
  %39 = alloca %struct.mat33_t, i64 %32, align 16
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %14) #5
  %40 = icmp sgt i32 %9, 0
  br i1 %40, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %10
  %41 = getelementptr inbounds i8, ptr %14, i64 16
  br label %42

42:                                               ; preds = %.lr.ph, %42
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %42 ]
  %43 = getelementptr inbounds %struct.vec3_t, ptr %37, i64 %indvars.iv
  %44 = getelementptr inbounds i8, ptr %43, i64 16
  %45 = load double, ptr %44, align 8, !tbaa !5
  %46 = load <2 x double>, ptr %43, align 8, !tbaa !5
  %47 = insertelement <2 x double> poison, double %45, i64 0
  %48 = shufflevector <2 x double> %47, <2 x double> poison, <2 x i32> zeroinitializer
  %49 = fdiv <2 x double> %46, %48
  store <2 x double> %49, ptr %14, align 16, !tbaa !5
  store double 1.000000e+00, ptr %41, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %15) #5
  call void @vec3_mul_vec3trans(ptr noundef nonnull %15, ptr noundef nonnull %14, ptr noundef nonnull %14) #5
  %50 = call double @vec3trans_mul_vec3(ptr noundef nonnull %14, ptr noundef nonnull %14) #5
  call void @mat33_div(ptr noundef nonnull %15, double noundef %50) #5
  %51 = getelementptr inbounds %struct.mat33_t, ptr %39, i64 %indvars.iv
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(72) %51, ptr noundef nonnull align 8 dereferenceable(72) %15, i64 72, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %15) #5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %32
  br i1 %exitcond.not, label %._crit_edge, label %42, !llvm.loop !11

._crit_edge:                                      ; preds = %42, %10
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %16) #5
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %17) #5
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %18) #5
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %19) #5
  call void @mat33_eye(ptr noundef nonnull %17) #5
  call void @mat33_array_sum(ptr noundef nonnull %18, ptr noundef nonnull %39, i32 noundef %9) #5
  call void @mat33_div(ptr noundef nonnull %18, double noundef %36) #5
  call void @mat33_sub_mat2(ptr noundef nonnull %19, ptr noundef nonnull %17, ptr noundef nonnull %18) #5
  call void @mat33_inv(ptr noundef nonnull %16, ptr noundef nonnull %19) #5
  call void @mat33_div(ptr noundef nonnull %16, double noundef %36) #5
  store i32 0, ptr %2, align 4, !tbaa !13
  %52 = call i32 @mat33_all_zeros(ptr noundef nonnull %8) #5
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %20) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %21) #5
  %53 = alloca %struct.vec3_t, i64 %32, align 16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %22) #5
  store double 0.000000e+00, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %23) #5
  store double 0.000000e+00, ptr %23, align 8, !tbaa !5
  %54 = icmp eq i32 %52, 0
  br i1 %54, label %55, label %63

55:                                               ; preds = %._crit_edge
  call void @mat33_copy(ptr noundef nonnull %20, ptr noundef nonnull %8) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %24) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %25) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %26) #5
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %27) #5
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %28) #5
  call void @vec3_clear(ptr noundef nonnull %24) #5
  br i1 %40, label %.lr.ph76, label %._crit_edge81.critedge

.lr.ph76:                                         ; preds = %55, %.lr.ph76
  %indvars.iv93 = phi i64 [ %indvars.iv.next94, %.lr.ph76 ], [ 0, %55 ]
  call void @mat33_eye(ptr noundef nonnull %27) #5
  %56 = getelementptr inbounds %struct.mat33_t, ptr %39, i64 %indvars.iv93
  call void @mat33_sub_mat2(ptr noundef nonnull %28, ptr noundef nonnull %56, ptr noundef nonnull %27) #5
  %57 = getelementptr inbounds %struct.vec3_t, ptr %33, i64 %indvars.iv93
  call void @vec3_mult_mat(ptr noundef nonnull %25, ptr noundef nonnull %20, ptr noundef nonnull %57) #5
  call void @vec3_mult_mat(ptr noundef nonnull %26, ptr noundef nonnull %28, ptr noundef nonnull %25) #5
  call void @vec3_add_vec(ptr noundef nonnull %24, ptr noundef nonnull %26) #5
  %indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
  %exitcond97.not = icmp eq i64 %indvars.iv.next94, %32
  br i1 %exitcond97.not, label %._crit_edge77, label %.lr.ph76, !llvm.loop !15

._crit_edge77:                                    ; preds = %.lr.ph76
  call void @vec3_mult_mat(ptr noundef nonnull %21, ptr noundef nonnull %16, ptr noundef nonnull %24) #5
  call void @xform(ptr noundef nonnull %53, ptr noundef nonnull %33, ptr noundef nonnull %20, ptr noundef nonnull %21, i32 noundef %9)
  store double 0.000000e+00, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %29) #5
  br i1 %40, label %.lr.ph80, label %._crit_edge81

.lr.ph80:                                         ; preds = %._crit_edge77, %.lr.ph80
  %58 = phi double [ %62, %.lr.ph80 ], [ 0.000000e+00, %._crit_edge77 ]
  %indvars.iv98 = phi i64 [ %indvars.iv.next99, %.lr.ph80 ], [ 0, %._crit_edge77 ]
  call void @mat33_eye(ptr noundef nonnull %27) #5
  %59 = getelementptr inbounds %struct.mat33_t, ptr %39, i64 %indvars.iv98
  call void @mat33_sub_mat2(ptr noundef nonnull %28, ptr noundef nonnull %59, ptr noundef nonnull %27) #5
  %60 = getelementptr inbounds %struct.vec3_t, ptr %53, i64 %indvars.iv98
  call void @vec3_mult_mat(ptr noundef nonnull %29, ptr noundef nonnull %28, ptr noundef nonnull %60) #5
  %61 = call double @vec3_dot(ptr noundef nonnull %29, ptr noundef nonnull %29) #5
  %62 = fadd double %61, %58
  store double %62, ptr %22, align 8, !tbaa !5
  %indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1
  %exitcond102.not = icmp eq i64 %indvars.iv.next99, %32
  br i1 %exitcond102.not, label %._crit_edge81, label %.lr.ph80, !llvm.loop !16

._crit_edge81.critedge:                           ; preds = %55
  call void @vec3_mult_mat(ptr noundef nonnull %21, ptr noundef nonnull %16, ptr noundef nonnull %24) #5
  call void @xform(ptr noundef nonnull %53, ptr noundef nonnull %33, ptr noundef nonnull %20, ptr noundef nonnull %21, i32 noundef %9)
  store double 0.000000e+00, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %29) #5
  br label %._crit_edge81

._crit_edge81:                                    ; preds = %.lr.ph80, %._crit_edge81.critedge, %._crit_edge77
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %29) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %28) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %27) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %26) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %25) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %24) #5
  br label %64

63:                                               ; preds = %._crit_edge
  call void @abskernel(ptr noundef nonnull %20, ptr noundef nonnull %21, ptr noundef nonnull %53, ptr noundef nonnull %22, ptr noundef nonnull %33, ptr noundef nonnull %37, ptr noundef nonnull %39, ptr noundef nonnull %16, i32 noundef %9)
  store i32 1, ptr %2, align 4, !tbaa !13
  br label %64

64:                                               ; preds = %63, %._crit_edge81
  call void @abskernel(ptr noundef nonnull %20, ptr noundef nonnull %21, ptr noundef nonnull %53, ptr noundef nonnull %23, ptr noundef nonnull %33, ptr noundef nonnull %53, ptr noundef nonnull %39, ptr noundef nonnull %16, i32 noundef %9)
  %storemerge.in82 = load i32, ptr %2, align 4, !tbaa !13
  %storemerge83 = add nsw i32 %storemerge.in82, 1
  store i32 %storemerge83, ptr %2, align 4, !tbaa !13
  %65 = load double, ptr %22, align 8, !tbaa !5
  %66 = load double, ptr %23, align 8, !tbaa !5
  %67 = fsub double %65, %66
  %68 = fdiv double %67, %65
  %69 = call double @_abs(double noundef %68) #5
  %70 = getelementptr inbounds i8, ptr %8, i64 72
  %71 = load double, ptr %70, align 8, !tbaa !17
  %72 = fcmp ogt double %69, %71
  br i1 %72, label %.lr.ph85, label %.critedge

.lr.ph85:                                         ; preds = %64
  %73 = getelementptr inbounds i8, ptr %8, i64 80
  %74 = getelementptr inbounds i8, ptr %8, i64 88
  br label %75

75:                                               ; preds = %.lr.ph85, %.critedge2
  %76 = load double, ptr %23, align 8, !tbaa !5
  %77 = load double, ptr %73, align 8, !tbaa !20
  %78 = fcmp ogt double %76, %77
  br i1 %78, label %79, label %.critedge

79:                                               ; preds = %75
  %80 = load i32, ptr %74, align 8, !tbaa !21
  %81 = icmp eq i32 %80, 0
  br i1 %81, label %.critedge2, label %82

82:                                               ; preds = %79
  %83 = load i32, ptr %2, align 4, !tbaa !13
  %84 = icmp ult i32 %83, %80
  br i1 %84, label %.critedge2, label %.critedge

.critedge2:                                       ; preds = %79, %82
  store double %76, ptr %22, align 8, !tbaa !5
  call void @abskernel(ptr noundef nonnull %20, ptr noundef nonnull %21, ptr noundef nonnull %53, ptr noundef nonnull %23, ptr noundef nonnull %33, ptr noundef nonnull %53, ptr noundef nonnull %39, ptr noundef nonnull %16, i32 noundef %9)
  %storemerge.in = load i32, ptr %2, align 4, !tbaa !13
  %storemerge = add nsw i32 %storemerge.in, 1
  store i32 %storemerge, ptr %2, align 4, !tbaa !13
  %85 = load double, ptr %22, align 8, !tbaa !5
  %86 = load double, ptr %23, align 8, !tbaa !5
  %87 = fsub double %85, %86
  %88 = fdiv double %87, %85
  %89 = call double @_abs(double noundef %88) #5
  %90 = load double, ptr %70, align 8, !tbaa !17
  %91 = fcmp ogt double %89, %90
  br i1 %91, label %75, label %.critedge, !llvm.loop !22

.critedge:                                        ; preds = %82, %.critedge2, %75, %64
  call void @mat33_copy(ptr noundef %0, ptr noundef nonnull %20) #5
  call void @vec3_copy(ptr noundef %1, ptr noundef nonnull %21) #5
  %92 = load double, ptr %23, align 8, !tbaa !5
  %93 = fdiv double %92, %36
  %94 = call double @_sqrt(double noundef %93) #5
  store double %94, ptr %3, align 8, !tbaa !5
  %95 = icmp eq i32 %5, 1
  br i1 %95, label %96, label %107

96:                                               ; preds = %.critedge
  %97 = call ptr @llvm.stacksave.p0()
  %98 = alloca %struct.vec3_t, i64 %32, align 16
  call void @xformproj(ptr noundef nonnull %98, ptr noundef nonnull %33, ptr noundef nonnull %20, ptr noundef nonnull %21, i32 noundef %9)
  store double 0.000000e+00, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %30) #5
  br i1 %40, label %.lr.ph90, label %._crit_edge91

.lr.ph90:                                         ; preds = %96, %.lr.ph90
  %indvars.iv103 = phi i64 [ %indvars.iv.next104, %.lr.ph90 ], [ 0, %96 ]
  %99 = getelementptr inbounds %struct.vec3_t, ptr %98, i64 %indvars.iv103
  %100 = getelementptr inbounds %struct.vec3_t, ptr %7, i64 %indvars.iv103
  call void @vec3_sub_vec2(ptr noundef nonnull %30, ptr noundef nonnull %99, ptr noundef %100) #5
  %101 = call double @vec3_dot(ptr noundef nonnull %30, ptr noundef nonnull %30) #5
  %102 = load double, ptr %4, align 8, !tbaa !5
  %103 = fadd double %101, %102
  store double %103, ptr %4, align 8, !tbaa !5
  %indvars.iv.next104 = add nuw nsw i64 %indvars.iv103, 1
  %exitcond107.not = icmp eq i64 %indvars.iv.next104, %32
  br i1 %exitcond107.not, label %._crit_edge91, label %.lr.ph90, !llvm.loop !23

._crit_edge91:                                    ; preds = %.lr.ph90, %96
  %104 = phi double [ 0.000000e+00, %96 ], [ %103, %.lr.ph90 ]
  %105 = fdiv double %104, %36
  %106 = call double @_sqrt(double noundef %105) #5
  store double %106, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %30) #5
  call void @llvm.stackrestore.p0(ptr %97)
  br label %107

107:                                              ; preds = %._crit_edge91, %.critedge
  %108 = getelementptr inbounds i8, ptr %1, i64 16
  %109 = load double, ptr %108, align 8, !tbaa !5
  %110 = fcmp olt double %109, 0.000000e+00
  br i1 %110, label %111, label %112

111:                                              ; preds = %107
  call void @mat33_mult(ptr noundef %0, double noundef -1.000000e+00) #5
  call void @vec3_mult(ptr noundef nonnull %1, double noundef -1.000000e+00) #5
  br label %112

112:                                              ; preds = %111, %107
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %31) #5
  call void @vec3_mult_mat(ptr noundef nonnull %31, ptr noundef nonnull %20, ptr noundef nonnull %11) #5
  call void @vec3_sub_vec(ptr noundef nonnull %1, ptr noundef nonnull %31) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %31) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %22) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %21) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %20) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %19) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %18) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %17) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %16) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %14) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #5
  ret void
}

declare void @vec3_array_set(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

declare void @mat33_div(ptr noundef, double noundef) local_unnamed_addr #1

declare double @vec3trans_mul_vec3(ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @mat33_array_sum(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

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

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

declare i32 @mat33_all_zeros(ptr noundef) local_unnamed_addr #1

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

declare void @mat33_mult(ptr noundef, double noundef) local_unnamed_addr #1

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

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 = { 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 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{i64 0, i64 72, !10}
!10 = !{!7, !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = !{!18, !6, i64 72}
!18 = !{!"", !19, i64 0, !6, i64 72, !6, i64 80, !14, i64 88}
!19 = !{!"", !7, i64 0}
!20 = !{!18, !6, i64 80}
!21 = !{!18, !14, i64 88}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !12}


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