; LLVM IR from ImperialCollegeLondon/pnflow :: src/pnm/pnextract/medialSurf.ll (ZN13medialSurface10moveUphillEP10medialBall)

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

%class.var3.10 = type { double, double, double }
%class.medialBall = type { ptr, float, float, float, i16, float, i16, i16, i16, i16, i16, ptr, ptr, ptr }
%class.voxel = type <{ ptr, i16, i16, i16, [2 x i8], float, [4 x i8] }>

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3absf(float noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN13medialSurface3vxlEiii(ptr noundef nonnull align 8 dereferenceable(252), i32 noundef, i32 noundef, i32 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN13medialSurface10moveUphillEP10medialBall(ptr noundef nonnull align 8 dereferenceable(252) %0, ptr noundef %1) #4 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %class.var3.10, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca float, align 4
  %17 = alloca float, align 4
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca double, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca float, align 4
  %24 = alloca float, align 4
  %25 = alloca double, align 8
  %26 = alloca double, align 8
  %27 = alloca double, align 8
  %28 = alloca %class.var3.10, align 8
  %29 = alloca %class.var3.10, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %30 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = getelementptr inbounds %class.medialBall, ptr %31, i32 0, i32 1
  %33 = load float, ptr %32, align 8, !tbaa !9
  %34 = fptosi float %33 to i32
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = getelementptr inbounds %class.medialBall, ptr %35, i32 0, i32 2
  %37 = load float, ptr %36, align 4, !tbaa !13
  %38 = fptosi float %37 to i32
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = getelementptr inbounds %class.medialBall, ptr %39, i32 0, i32 3
  %41 = load float, ptr %40, align 8, !tbaa !14
  %42 = fptosi float %41 to i32
  %43 = call noundef ptr @_ZN13medialSurface3vxlEiii(ptr noundef nonnull align 8 dereferenceable(252) %30, i32 noundef %34, i32 noundef %38, i32 noundef %42)
  store ptr %43, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %6) #6
  call void @_ZN4var3IdEC2Eddd(ptr noundef nonnull align 8 dereferenceable(24) %6, double noundef 0.000000e+00, double noundef 0.000000e+00, double noundef 0.000000e+00)
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = getelementptr inbounds %class.voxel, ptr %44, i32 0, i32 1
  %46 = load i16, ptr %45, align 8, !tbaa !15
  %47 = sext i16 %46 to i32
  %48 = sub nsw i32 %47, 1
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  %50 = getelementptr inbounds %class.voxel, ptr %49, i32 0, i32 2
  %51 = load i16, ptr %50, align 2, !tbaa !17
  %52 = sext i16 %51 to i32
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = getelementptr inbounds %class.voxel, ptr %53, i32 0, i32 3
  %55 = load i16, ptr %54, align 4, !tbaa !18
  %56 = sext i16 %55 to i32
  %57 = call noundef ptr @_ZN13medialSurface3vxlEiii(ptr noundef nonnull align 8 dereferenceable(252) %30, i32 noundef %48, i32 noundef %52, i32 noundef %56)
  store ptr %57, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  %59 = getelementptr inbounds %class.voxel, ptr %58, i32 0, i32 1
  %60 = load i16, ptr %59, align 8, !tbaa !15
  %61 = sext i16 %60 to i32
  %62 = add nsw i32 %61, 1
  %63 = load ptr, ptr %5, align 8, !tbaa !5
  %64 = getelementptr inbounds %class.voxel, ptr %63, i32 0, i32 2
  %65 = load i16, ptr %64, align 2, !tbaa !17
  %66 = sext i16 %65 to i32
  %67 = load ptr, ptr %5, align 8, !tbaa !5
  %68 = getelementptr inbounds %class.voxel, ptr %67, i32 0, i32 3
  %69 = load i16, ptr %68, align 4, !tbaa !18
  %70 = sext i16 %69 to i32
  %71 = call noundef ptr @_ZN13medialSurface3vxlEiii(ptr noundef nonnull align 8 dereferenceable(252) %30, i32 noundef %62, i32 noundef %66, i32 noundef %70)
  store ptr %71, ptr %8, align 8, !tbaa !5
  %72 = load ptr, ptr %7, align 8, !tbaa !5
  %73 = icmp ne ptr %72, null
  br i1 %73, label %74, label %114

74:                                               ; preds = %2
  %75 = load ptr, ptr %8, align 8, !tbaa !5
  %76 = icmp ne ptr %75, null
  br i1 %76, label %77, label %114

77:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %78 = load ptr, ptr %8, align 8, !tbaa !5
  %79 = getelementptr inbounds %class.voxel, ptr %78, i32 0, i32 5
  %80 = load float, ptr %79, align 8, !tbaa !19
  %81 = load ptr, ptr %5, align 8, !tbaa !5
  %82 = getelementptr inbounds %class.voxel, ptr %81, i32 0, i32 5
  %83 = load float, ptr %82, align 8, !tbaa !19
  %84 = fsub float %80, %83
  store float %84, ptr %9, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %85 = load ptr, ptr %5, align 8, !tbaa !5
  %86 = getelementptr inbounds %class.voxel, ptr %85, i32 0, i32 5
  %87 = load float, ptr %86, align 8, !tbaa !19
  %88 = load ptr, ptr %7, align 8, !tbaa !5
  %89 = getelementptr inbounds %class.voxel, ptr %88, i32 0, i32 5
  %90 = load float, ptr %89, align 8, !tbaa !19
  %91 = fsub float %87, %90
  store float %91, ptr %10, align 4, !tbaa !20
  %92 = load float, ptr %9, align 4, !tbaa !20
  %93 = load float, ptr %10, align 4, !tbaa !20
  %94 = fsub float %92, %93
  %95 = call noundef float @_ZSt3absf(float noundef %94)
  %96 = fpext float %95 to double
  %97 = fcmp ogt double %96, 1.000000e-02
  br i1 %97, label %98, label %113

98:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  store double -4.900000e-01, ptr %11, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store double 4.900000e-01, ptr %12, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %99 = load float, ptr %9, align 4, !tbaa !20
  %100 = load float, ptr %10, align 4, !tbaa !20
  %101 = fadd float %99, %100
  %102 = fpext float %101 to double
  %103 = fmul double -5.000000e-01, %102
  %104 = load float, ptr %9, align 4, !tbaa !20
  %105 = load float, ptr %10, align 4, !tbaa !20
  %106 = fsub float %104, %105
  %107 = fpext float %106 to double
  %108 = fdiv double %103, %107
  store double %108, ptr %13, align 8, !tbaa !21
  %109 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13)
  %110 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %109)
  %111 = load double, ptr %110, align 8, !tbaa !21
  %112 = getelementptr inbounds %class.var3.10, ptr %6, i32 0, i32 0
  store double %111, ptr %112, align 8, !tbaa !23
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %113

113:                                              ; preds = %98, %77
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %114

114:                                              ; preds = %113, %74, %2
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %115 = load ptr, ptr %5, align 8, !tbaa !5
  %116 = getelementptr inbounds %class.voxel, ptr %115, i32 0, i32 1
  %117 = load i16, ptr %116, align 8, !tbaa !15
  %118 = sext i16 %117 to i32
  %119 = load ptr, ptr %5, align 8, !tbaa !5
  %120 = getelementptr inbounds %class.voxel, ptr %119, i32 0, i32 2
  %121 = load i16, ptr %120, align 2, !tbaa !17
  %122 = sext i16 %121 to i32
  %123 = sub nsw i32 %122, 1
  %124 = load ptr, ptr %5, align 8, !tbaa !5
  %125 = getelementptr inbounds %class.voxel, ptr %124, i32 0, i32 3
  %126 = load i16, ptr %125, align 4, !tbaa !18
  %127 = sext i16 %126 to i32
  %128 = call noundef ptr @_ZN13medialSurface3vxlEiii(ptr noundef nonnull align 8 dereferenceable(252) %30, i32 noundef %118, i32 noundef %123, i32 noundef %127)
  store ptr %128, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %129 = load ptr, ptr %5, align 8, !tbaa !5
  %130 = getelementptr inbounds %class.voxel, ptr %129, i32 0, i32 1
  %131 = load i16, ptr %130, align 8, !tbaa !15
  %132 = sext i16 %131 to i32
  %133 = load ptr, ptr %5, align 8, !tbaa !5
  %134 = getelementptr inbounds %class.voxel, ptr %133, i32 0, i32 2
  %135 = load i16, ptr %134, align 2, !tbaa !17
  %136 = sext i16 %135 to i32
  %137 = add nsw i32 %136, 1
  %138 = load ptr, ptr %5, align 8, !tbaa !5
  %139 = getelementptr inbounds %class.voxel, ptr %138, i32 0, i32 3
  %140 = load i16, ptr %139, align 4, !tbaa !18
  %141 = sext i16 %140 to i32
  %142 = call noundef ptr @_ZN13medialSurface3vxlEiii(ptr noundef nonnull align 8 dereferenceable(252) %30, i32 noundef %132, i32 noundef %137, i32 noundef %141)
  store ptr %142, ptr %15, align 8, !tbaa !5
  %143 = load ptr, ptr %14, align 8, !tbaa !5
  %144 = icmp ne ptr %143, null
  br i1 %144, label %145, label %185

145:                                              ; preds = %114
  %146 = load ptr, ptr %15, align 8, !tbaa !5
  %147 = icmp ne ptr %146, null
  br i1 %147, label %148, label %185

148:                                              ; preds = %145
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %149 = load ptr, ptr %15, align 8, !tbaa !5
  %150 = getelementptr inbounds %class.voxel, ptr %149, i32 0, i32 5
  %151 = load float, ptr %150, align 8, !tbaa !19
  %152 = load ptr, ptr %5, align 8, !tbaa !5
  %153 = getelementptr inbounds %class.voxel, ptr %152, i32 0, i32 5
  %154 = load float, ptr %153, align 8, !tbaa !19
  %155 = fsub float %151, %154
  store float %155, ptr %16, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %156 = load ptr, ptr %5, align 8, !tbaa !5
  %157 = getelementptr inbounds %class.voxel, ptr %156, i32 0, i32 5
  %158 = load float, ptr %157, align 8, !tbaa !19
  %159 = load ptr, ptr %14, align 8, !tbaa !5
  %160 = getelementptr inbounds %class.voxel, ptr %159, i32 0, i32 5
  %161 = load float, ptr %160, align 8, !tbaa !19
  %162 = fsub float %158, %161
  store float %162, ptr %17, align 4, !tbaa !20
  %163 = load float, ptr %16, align 4, !tbaa !20
  %164 = load float, ptr %17, align 4, !tbaa !20
  %165 = fsub float %163, %164
  %166 = call noundef float @_ZSt3absf(float noundef %165)
  %167 = fpext float %166 to double
  %168 = fcmp ogt double %167, 1.000000e-02
  br i1 %168, label %169, label %184

169:                                              ; preds = %148
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  store double -4.900000e-01, ptr %18, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  store double 4.900000e-01, ptr %19, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %170 = load float, ptr %16, align 4, !tbaa !20
  %171 = load float, ptr %17, align 4, !tbaa !20
  %172 = fadd float %170, %171
  %173 = fpext float %172 to double
  %174 = fmul double -5.000000e-01, %173
  %175 = load float, ptr %16, align 4, !tbaa !20
  %176 = load float, ptr %17, align 4, !tbaa !20
  %177 = fsub float %175, %176
  %178 = fpext float %177 to double
  %179 = fdiv double %174, %178
  store double %179, ptr %20, align 8, !tbaa !21
  %180 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(8) %20)
  %181 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %180)
  %182 = load double, ptr %181, align 8, !tbaa !21
  %183 = getelementptr inbounds %class.var3.10, ptr %6, i32 0, i32 1
  store double %182, ptr %183, align 8, !tbaa !25
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %184

184:                                              ; preds = %169, %148
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %185

185:                                              ; preds = %184, %145, %114
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %186 = load ptr, ptr %5, align 8, !tbaa !5
  %187 = getelementptr inbounds %class.voxel, ptr %186, i32 0, i32 1
  %188 = load i16, ptr %187, align 8, !tbaa !15
  %189 = sext i16 %188 to i32
  %190 = load ptr, ptr %5, align 8, !tbaa !5
  %191 = getelementptr inbounds %class.voxel, ptr %190, i32 0, i32 2
  %192 = load i16, ptr %191, align 2, !tbaa !17
  %193 = sext i16 %192 to i32
  %194 = load ptr, ptr %5, align 8, !tbaa !5
  %195 = getelementptr inbounds %class.voxel, ptr %194, i32 0, i32 3
  %196 = load i16, ptr %195, align 4, !tbaa !18
  %197 = sext i16 %196 to i32
  %198 = sub nsw i32 %197, 1
  %199 = call noundef ptr @_ZN13medialSurface3vxlEiii(ptr noundef nonnull align 8 dereferenceable(252) %30, i32 noundef %189, i32 noundef %193, i32 noundef %198)
  store ptr %199, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %200 = load ptr, ptr %5, align 8, !tbaa !5
  %201 = getelementptr inbounds %class.voxel, ptr %200, i32 0, i32 1
  %202 = load i16, ptr %201, align 8, !tbaa !15
  %203 = sext i16 %202 to i32
  %204 = load ptr, ptr %5, align 8, !tbaa !5
  %205 = getelementptr inbounds %class.voxel, ptr %204, i32 0, i32 2
  %206 = load i16, ptr %205, align 2, !tbaa !17
  %207 = sext i16 %206 to i32
  %208 = load ptr, ptr %5, align 8, !tbaa !5
  %209 = getelementptr inbounds %class.voxel, ptr %208, i32 0, i32 3
  %210 = load i16, ptr %209, align 4, !tbaa !18
  %211 = sext i16 %210 to i32
  %212 = add nsw i32 %211, 1
  %213 = call noundef ptr @_ZN13medialSurface3vxlEiii(ptr noundef nonnull align 8 dereferenceable(252) %30, i32 noundef %203, i32 noundef %207, i32 noundef %212)
  store ptr %213, ptr %22, align 8, !tbaa !5
  %214 = load ptr, ptr %21, align 8, !tbaa !5
  %215 = icmp ne ptr %214, null
  br i1 %215, label %216, label %256

216:                                              ; preds = %185
  %217 = load ptr, ptr %22, align 8, !tbaa !5
  %218 = icmp ne ptr %217, null
  br i1 %218, label %219, label %256

219:                                              ; preds = %216
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  %220 = load ptr, ptr %22, align 8, !tbaa !5
  %221 = getelementptr inbounds %class.voxel, ptr %220, i32 0, i32 5
  %222 = load float, ptr %221, align 8, !tbaa !19
  %223 = load ptr, ptr %5, align 8, !tbaa !5
  %224 = getelementptr inbounds %class.voxel, ptr %223, i32 0, i32 5
  %225 = load float, ptr %224, align 8, !tbaa !19
  %226 = fsub float %222, %225
  store float %226, ptr %23, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  %227 = load ptr, ptr %5, align 8, !tbaa !5
  %228 = getelementptr inbounds %class.voxel, ptr %227, i32 0, i32 5
  %229 = load float, ptr %228, align 8, !tbaa !19
  %230 = load ptr, ptr %21, align 8, !tbaa !5
  %231 = getelementptr inbounds %class.voxel, ptr %230, i32 0, i32 5
  %232 = load float, ptr %231, align 8, !tbaa !19
  %233 = fsub float %229, %232
  store float %233, ptr %24, align 4, !tbaa !20
  %234 = load float, ptr %23, align 4, !tbaa !20
  %235 = load float, ptr %24, align 4, !tbaa !20
  %236 = fsub float %234, %235
  %237 = call noundef float @_ZSt3absf(float noundef %236)
  %238 = fpext float %237 to double
  %239 = fcmp ogt double %238, 1.000000e-02
  br i1 %239, label %240, label %255

240:                                              ; preds = %219
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  store double -4.900000e-01, ptr %25, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #6
  store double 4.900000e-01, ptr %26, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #6
  %241 = load float, ptr %23, align 4, !tbaa !20
  %242 = load float, ptr %24, align 4, !tbaa !20
  %243 = fadd float %241, %242
  %244 = fpext float %243 to double
  %245 = fmul double -5.000000e-01, %244
  %246 = load float, ptr %23, align 4, !tbaa !20
  %247 = load float, ptr %24, align 4, !tbaa !20
  %248 = fsub float %246, %247
  %249 = fpext float %248 to double
  %250 = fdiv double %245, %249
  store double %250, ptr %27, align 8, !tbaa !21
  %251 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %26, ptr noundef nonnull align 8 dereferenceable(8) %27)
  %252 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull align 8 dereferenceable(8) %251)
  %253 = load double, ptr %252, align 8, !tbaa !21
  %254 = getelementptr inbounds %class.var3.10, ptr %6, i32 0, i32 2
  store double %253, ptr %254, align 8, !tbaa !26
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  br label %255

255:                                              ; preds = %240, %219
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  br label %256

256:                                              ; preds = %255, %216, %185
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  %257 = load ptr, ptr %4, align 8, !tbaa !5
  %258 = load ptr, ptr %4, align 8, !tbaa !5
  %259 = getelementptr inbounds %class.medialBall, ptr %258, i32 0, i32 11
  %260 = load ptr, ptr %259, align 8, !tbaa !27
  %261 = icmp ne ptr %257, %260
  br i1 %261, label %262, label %273

262:                                              ; preds = %256
  call void @llvm.lifetime.start.p0(i64 24, ptr %28) #6
  %263 = load ptr, ptr %4, align 8, !tbaa !5
  %264 = load ptr, ptr %4, align 8, !tbaa !5
  %265 = getelementptr inbounds %class.medialBall, ptr %264, i32 0, i32 11
  %266 = load ptr, ptr %265, align 8, !tbaa !27
  call void @_ZmiRK10medialBallS1_(ptr dead_on_unwind writable sret(%class.var3.10) align 8 %28, ptr noundef nonnull align 8 dereferenceable(64) %263, ptr noundef nonnull align 8 dereferenceable(64) %266)
  call void @llvm.lifetime.start.p0(i64 24, ptr %29) #6
  %267 = call noundef double @_ZNK4var3IdEanERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %28, ptr noundef nonnull align 8 dereferenceable(24) %6)
  %268 = call noundef double @_Z6magSqrIdEdRK4var3IT_E(ptr noundef nonnull align 8 dereferenceable(24) %28)
  %269 = fadd double %268, 0x3D719799812DEA11
  %270 = fdiv double %267, %269
  %271 = fmul double 0x3FEE666666666666, %270
  call void @_ZmlIdE4var3IT_EdRKS2_(ptr dead_on_unwind writable sret(%class.var3.10) align 8 %29, double noundef %271, ptr noundef nonnull align 8 dereferenceable(24) %28)
  %272 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN4var3IdEmIERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(24) %29)
  call void @llvm.lifetime.end.p0(i64 24, ptr %29) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %28) #6
  br label %273

273:                                              ; preds = %262, %256
  %274 = load ptr, ptr %5, align 8, !tbaa !5
  %275 = getelementptr inbounds %class.voxel, ptr %274, i32 0, i32 1
  %276 = load i16, ptr %275, align 8, !tbaa !15
  %277 = sext i16 %276 to i32
  %278 = sitofp i32 %277 to double
  %279 = fsub double %278, -5.000000e-01
  %280 = getelementptr inbounds %class.var3.10, ptr %6, i32 0, i32 0
  %281 = load double, ptr %280, align 8, !tbaa !23
  %282 = fadd double %279, %281
  %283 = fptrunc double %282 to float
  %284 = load ptr, ptr %4, align 8, !tbaa !5
  %285 = getelementptr inbounds %class.medialBall, ptr %284, i32 0, i32 1
  store float %283, ptr %285, align 8, !tbaa !9
  %286 = load ptr, ptr %5, align 8, !tbaa !5
  %287 = getelementptr inbounds %class.voxel, ptr %286, i32 0, i32 2
  %288 = load i16, ptr %287, align 2, !tbaa !17
  %289 = sext i16 %288 to i32
  %290 = sitofp i32 %289 to double
  %291 = fsub double %290, -5.000000e-01
  %292 = getelementptr inbounds %class.var3.10, ptr %6, i32 0, i32 1
  %293 = load double, ptr %292, align 8, !tbaa !25
  %294 = fadd double %291, %293
  %295 = fptrunc double %294 to float
  %296 = load ptr, ptr %4, align 8, !tbaa !5
  %297 = getelementptr inbounds %class.medialBall, ptr %296, i32 0, i32 2
  store float %295, ptr %297, align 4, !tbaa !13
  %298 = load ptr, ptr %5, align 8, !tbaa !5
  %299 = getelementptr inbounds %class.voxel, ptr %298, i32 0, i32 3
  %300 = load i16, ptr %299, align 4, !tbaa !18
  %301 = sext i16 %300 to i32
  %302 = sitofp i32 %301 to double
  %303 = fsub double %302, -5.000000e-01
  %304 = getelementptr inbounds %class.var3.10, ptr %6, i32 0, i32 2
  %305 = load double, ptr %304, align 8, !tbaa !26
  %306 = fadd double %303, %305
  %307 = fptrunc double %306 to float
  %308 = load ptr, ptr %4, align 8, !tbaa !5
  %309 = getelementptr inbounds %class.medialBall, ptr %308, i32 0, i32 3
  store float %307, ptr %309, align 8, !tbaa !14
  %310 = load ptr, ptr %5, align 8, !tbaa !5
  %311 = getelementptr inbounds %class.voxel, ptr %310, i32 0, i32 5
  %312 = load float, ptr %311, align 8, !tbaa !19
  %313 = fpext float %312 to double
  %314 = call noundef double @_Z3magIdET_RK4var3IS0_E(ptr noundef nonnull align 8 dereferenceable(24) %6)
  %315 = call double @llvm.fmuladd.f64(double 0x3FEE666666666666, double %314, double %313)
  %316 = fptrunc double %315 to float
  %317 = load ptr, ptr %4, align 8, !tbaa !5
  %318 = getelementptr inbounds %class.medialBall, ptr %317, i32 0, i32 5
  store float %316, ptr %318, align 8, !tbaa !28
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4var3IdEC2Eddd(ptr noundef nonnull align 8 dereferenceable(24), double noundef, double noundef, double noundef) unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZmiRK10medialBallS1_(ptr dead_on_unwind noalias writable sret(%class.var3.10) align 8, ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 8 dereferenceable(64)) #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZmlIdE4var3IT_EdRKS2_(ptr dead_on_unwind noalias writable sret(%class.var3.10) align 8, double noundef, ptr noundef nonnull align 8 dereferenceable(24)) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK4var3IdEanERKS0_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_Z6magSqrIdEdRK4var3IT_E(ptr noundef nonnull align 8 dereferenceable(24)) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN4var3IdEmIERKS0_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_Z3magIdET_RK4var3IS0_E(ptr noundef nonnull align 8 dereferenceable(24)) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { inlinehint 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 #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, !11, i64 8}
!10 = !{!"_ZTS10medialBall", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !12, i64 20, !11, i64 24, !12, i64 28, !12, i64 30, !12, i64 32, !12, i64 34, !12, i64 36, !6, i64 40, !6, i64 48, !6, i64 56}
!11 = !{!"float", !7, i64 0}
!12 = !{!"short", !7, i64 0}
!13 = !{!10, !11, i64 12}
!14 = !{!10, !11, i64 16}
!15 = !{!16, !12, i64 8}
!16 = !{!"_ZTS5voxel", !6, i64 0, !12, i64 8, !12, i64 10, !12, i64 12, !11, i64 16}
!17 = !{!16, !12, i64 10}
!18 = !{!16, !12, i64 12}
!19 = !{!16, !11, i64 16}
!20 = !{!11, !11, i64 0}
!21 = !{!22, !22, i64 0}
!22 = !{!"double", !7, i64 0}
!23 = !{!24, !22, i64 0}
!24 = !{!"_ZTS4var3IdE", !22, i64 0, !22, i64 8, !22, i64 16}
!25 = !{!24, !22, i64 8}
!26 = !{!24, !22, i64 16}
!27 = !{!10, !6, i64 40}
!28 = !{!10, !11, i64 24}


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

%class.var3.10 = type { double, double, double }

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3absf(float noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN13medialSurface3vxlEiii(ptr noundef nonnull align 8 dereferenceable(252), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN13medialSurface10moveUphillEP10medialBall(ptr noundef nonnull align 8 dereferenceable(252) %0, ptr noundef %1) local_unnamed_addr #4 align 2 {
  %3 = alloca %class.var3.10, align 16
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca %class.var3.10, align 8
  %14 = alloca %class.var3.10, align 8
  %15 = getelementptr inbounds i8, ptr %1, i64 8
  %16 = load float, ptr %15, align 8, !tbaa !5
  %17 = fptosi float %16 to i32
  %18 = getelementptr inbounds i8, ptr %1, i64 12
  %19 = load float, ptr %18, align 4, !tbaa !12
  %20 = fptosi float %19 to i32
  %21 = getelementptr inbounds i8, ptr %1, i64 16
  %22 = load float, ptr %21, align 8, !tbaa !13
  %23 = fptosi float %22 to i32
  %24 = tail call noundef ptr @_ZN13medialSurface3vxlEiii(ptr noundef nonnull align 8 dereferenceable(252) %0, i32 noundef %17, i32 noundef %20, i32 noundef %23)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #6
  call void @_ZN4var3IdEC2Eddd(ptr noundef nonnull align 8 dereferenceable(24) %3, double noundef 0.000000e+00, double noundef 0.000000e+00, double noundef 0.000000e+00)
  %25 = getelementptr inbounds i8, ptr %24, i64 8
  %26 = load i16, ptr %25, align 8, !tbaa !14
  %27 = sext i16 %26 to i32
  %28 = add nsw i32 %27, -1
  %29 = getelementptr inbounds i8, ptr %24, i64 10
  %30 = load i16, ptr %29, align 2, !tbaa !16
  %31 = sext i16 %30 to i32
  %32 = getelementptr inbounds i8, ptr %24, i64 12
  %33 = load i16, ptr %32, align 4, !tbaa !17
  %34 = sext i16 %33 to i32
  %35 = call noundef ptr @_ZN13medialSurface3vxlEiii(ptr noundef nonnull align 8 dereferenceable(252) %0, i32 noundef %28, i32 noundef %31, i32 noundef %34)
  %36 = load i16, ptr %25, align 8, !tbaa !14
  %37 = sext i16 %36 to i32
  %38 = add nsw i32 %37, 1
  %39 = load i16, ptr %29, align 2, !tbaa !16
  %40 = sext i16 %39 to i32
  %41 = load i16, ptr %32, align 4, !tbaa !17
  %42 = sext i16 %41 to i32
  %43 = call noundef ptr @_ZN13medialSurface3vxlEiii(ptr noundef nonnull align 8 dereferenceable(252) %0, i32 noundef %38, i32 noundef %40, i32 noundef %42)
  %44 = icmp ne ptr %35, null
  %45 = icmp ne ptr %43, null
  %or.cond = and i1 %44, %45
  br i1 %or.cond, label %46, label %68

46:                                               ; preds = %2
  %47 = getelementptr inbounds i8, ptr %43, i64 16
  %48 = load float, ptr %47, align 8, !tbaa !18
  %49 = getelementptr inbounds i8, ptr %24, i64 16
  %50 = load float, ptr %49, align 8, !tbaa !18
  %51 = fsub float %48, %50
  %52 = getelementptr inbounds i8, ptr %35, i64 16
  %53 = load float, ptr %52, align 8, !tbaa !18
  %54 = fsub float %50, %53
  %55 = fsub float %51, %54
  %56 = call noundef float @_ZSt3absf(float noundef %55)
  %57 = fpext float %56 to double
  %58 = fcmp ogt double %57, 1.000000e-02
  br i1 %58, label %59, label %68

59:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  store double -4.900000e-01, ptr %4, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  store double 4.900000e-01, ptr %5, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %60 = fadd float %51, %54
  %61 = fpext float %60 to double
  %62 = fmul double %61, -5.000000e-01
  %63 = fpext float %55 to double
  %64 = fdiv double %62, %63
  store double %64, ptr %6, align 8, !tbaa !19
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %66 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %65)
  %67 = load double, ptr %66, align 8, !tbaa !19
  store double %67, ptr %3, align 16, !tbaa !21
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  br label %68

68:                                               ; preds = %46, %59, %2
  %69 = load i16, ptr %25, align 8, !tbaa !14
  %70 = sext i16 %69 to i32
  %71 = load i16, ptr %29, align 2, !tbaa !16
  %72 = sext i16 %71 to i32
  %73 = add nsw i32 %72, -1
  %74 = load i16, ptr %32, align 4, !tbaa !17
  %75 = sext i16 %74 to i32
  %76 = call noundef ptr @_ZN13medialSurface3vxlEiii(ptr noundef nonnull align 8 dereferenceable(252) %0, i32 noundef %70, i32 noundef %73, i32 noundef %75)
  %77 = load i16, ptr %25, align 8, !tbaa !14
  %78 = sext i16 %77 to i32
  %79 = load i16, ptr %29, align 2, !tbaa !16
  %80 = sext i16 %79 to i32
  %81 = add nsw i32 %80, 1
  %82 = load i16, ptr %32, align 4, !tbaa !17
  %83 = sext i16 %82 to i32
  %84 = call noundef ptr @_ZN13medialSurface3vxlEiii(ptr noundef nonnull align 8 dereferenceable(252) %0, i32 noundef %78, i32 noundef %81, i32 noundef %83)
  %85 = icmp ne ptr %76, null
  %86 = icmp ne ptr %84, null
  %or.cond3 = and i1 %85, %86
  br i1 %or.cond3, label %87, label %110

87:                                               ; preds = %68
  %88 = getelementptr inbounds i8, ptr %84, i64 16
  %89 = load float, ptr %88, align 8, !tbaa !18
  %90 = getelementptr inbounds i8, ptr %24, i64 16
  %91 = load float, ptr %90, align 8, !tbaa !18
  %92 = fsub float %89, %91
  %93 = getelementptr inbounds i8, ptr %76, i64 16
  %94 = load float, ptr %93, align 8, !tbaa !18
  %95 = fsub float %91, %94
  %96 = fsub float %92, %95
  %97 = call noundef float @_ZSt3absf(float noundef %96)
  %98 = fpext float %97 to double
  %99 = fcmp ogt double %98, 1.000000e-02
  br i1 %99, label %100, label %110

100:                                              ; preds = %87
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  store double -4.900000e-01, ptr %7, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  store double 4.900000e-01, ptr %8, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  %101 = fadd float %92, %95
  %102 = fpext float %101 to double
  %103 = fmul double %102, -5.000000e-01
  %104 = fpext float %96 to double
  %105 = fdiv double %103, %104
  store double %105, ptr %9, align 8, !tbaa !19
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %106)
  %108 = load double, ptr %107, align 8, !tbaa !19
  %109 = getelementptr inbounds i8, ptr %3, i64 8
  store double %108, ptr %109, align 8, !tbaa !23
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  br label %110

110:                                              ; preds = %87, %100, %68
  %111 = load i16, ptr %25, align 8, !tbaa !14
  %112 = sext i16 %111 to i32
  %113 = load i16, ptr %29, align 2, !tbaa !16
  %114 = sext i16 %113 to i32
  %115 = load i16, ptr %32, align 4, !tbaa !17
  %116 = sext i16 %115 to i32
  %117 = add nsw i32 %116, -1
  %118 = call noundef ptr @_ZN13medialSurface3vxlEiii(ptr noundef nonnull align 8 dereferenceable(252) %0, i32 noundef %112, i32 noundef %114, i32 noundef %117)
  %119 = load i16, ptr %25, align 8, !tbaa !14
  %120 = sext i16 %119 to i32
  %121 = load i16, ptr %29, align 2, !tbaa !16
  %122 = sext i16 %121 to i32
  %123 = load i16, ptr %32, align 4, !tbaa !17
  %124 = sext i16 %123 to i32
  %125 = add nsw i32 %124, 1
  %126 = call noundef ptr @_ZN13medialSurface3vxlEiii(ptr noundef nonnull align 8 dereferenceable(252) %0, i32 noundef %120, i32 noundef %122, i32 noundef %125)
  %127 = icmp ne ptr %118, null
  %128 = icmp ne ptr %126, null
  %or.cond5 = and i1 %127, %128
  br i1 %or.cond5, label %129, label %152

129:                                              ; preds = %110
  %130 = getelementptr inbounds i8, ptr %126, i64 16
  %131 = load float, ptr %130, align 8, !tbaa !18
  %132 = getelementptr inbounds i8, ptr %24, i64 16
  %133 = load float, ptr %132, align 8, !tbaa !18
  %134 = fsub float %131, %133
  %135 = getelementptr inbounds i8, ptr %118, i64 16
  %136 = load float, ptr %135, align 8, !tbaa !18
  %137 = fsub float %133, %136
  %138 = fsub float %134, %137
  %139 = call noundef float @_ZSt3absf(float noundef %138)
  %140 = fpext float %139 to double
  %141 = fcmp ogt double %140, 1.000000e-02
  br i1 %141, label %142, label %152

142:                                              ; preds = %129
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  store double -4.900000e-01, ptr %10, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #6
  store double 4.900000e-01, ptr %11, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #6
  %143 = fadd float %134, %137
  %144 = fpext float %143 to double
  %145 = fmul double %144, -5.000000e-01
  %146 = fpext float %138 to double
  %147 = fdiv double %145, %146
  store double %147, ptr %12, align 8, !tbaa !19
  %148 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12)
  %149 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %148)
  %150 = load double, ptr %149, align 8, !tbaa !19
  %151 = getelementptr inbounds i8, ptr %3, i64 16
  store double %150, ptr %151, align 16, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  br label %152

152:                                              ; preds = %129, %142, %110
  %153 = getelementptr inbounds i8, ptr %1, i64 40
  %154 = load ptr, ptr %153, align 8, !tbaa !25
  %.not = icmp eq ptr %154, %1
  br i1 %.not, label %162, label %155

155:                                              ; preds = %152
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #6
  call void @_ZmiRK10medialBallS1_(ptr dead_on_unwind nonnull writable sret(%class.var3.10) align 8 %13, ptr noundef nonnull align 8 dereferenceable(64) %1, ptr noundef nonnull align 8 dereferenceable(64) %154)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %14) #6
  %156 = call noundef double @_ZNK4var3IdEanERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(24) %3)
  %157 = call noundef double @_Z6magSqrIdEdRK4var3IT_E(ptr noundef nonnull align 8 dereferenceable(24) %13)
  %158 = fadd double %157, 0x3D719799812DEA11
  %159 = fdiv double %156, %158
  %160 = fmul double %159, 0x3FEE666666666666
  call void @_ZmlIdE4var3IT_EdRKS2_(ptr dead_on_unwind nonnull writable sret(%class.var3.10) align 8 %14, double noundef %160, ptr noundef nonnull align 8 dereferenceable(24) %13)
  %161 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN4var3IdEmIERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %14)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %14) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #6
  br label %162

162:                                              ; preds = %155, %152
  %163 = load <2 x i16>, ptr %25, align 8, !tbaa !26
  %164 = sitofp <2 x i16> %163 to <2 x double>
  %165 = fadd <2 x double> %164, <double 5.000000e-01, double 5.000000e-01>
  %166 = load <2 x double>, ptr %3, align 16, !tbaa !19
  %167 = fadd <2 x double> %166, %165
  %168 = fptrunc <2 x double> %167 to <2 x float>
  store <2 x float> %168, ptr %15, align 8, !tbaa !27
  %169 = load i16, ptr %32, align 4, !tbaa !17
  %170 = sitofp i16 %169 to double
  %171 = fadd double %170, 5.000000e-01
  %172 = getelementptr inbounds i8, ptr %3, i64 16
  %173 = load double, ptr %172, align 16, !tbaa !24
  %174 = fadd double %173, %171
  %175 = fptrunc double %174 to float
  store float %175, ptr %21, align 8, !tbaa !13
  %176 = getelementptr inbounds i8, ptr %24, i64 16
  %177 = load float, ptr %176, align 8, !tbaa !18
  %178 = fpext float %177 to double
  %179 = call noundef double @_Z3magIdET_RK4var3IS0_E(ptr noundef nonnull align 8 dereferenceable(24) %3)
  %180 = call double @llvm.fmuladd.f64(double %179, double 0x3FEE666666666666, double %178)
  %181 = fptrunc double %180 to float
  %182 = getelementptr inbounds i8, ptr %1, i64 24
  store float %181, ptr %182, align 8, !tbaa !28
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4var3IdEC2Eddd(ptr noundef nonnull align 8 dereferenceable(24), double noundef, double noundef, double noundef) unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZmiRK10medialBallS1_(ptr dead_on_unwind noalias writable sret(%class.var3.10) align 8, ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 8 dereferenceable(64)) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZmlIdE4var3IT_EdRKS2_(ptr dead_on_unwind noalias writable sret(%class.var3.10) align 8, double noundef, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK4var3IdEanERKS0_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_Z6magSqrIdEdRK4var3IT_E(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN4var3IdEmIERKS0_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_Z3magIdET_RK4var3IS0_E(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { inlinehint 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 #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, !10, i64 8}
!6 = !{!"_ZTS10medialBall", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !11, i64 20, !10, i64 24, !11, i64 28, !11, i64 30, !11, i64 32, !11, i64 34, !11, i64 36, !7, i64 40, !7, i64 48, !7, i64 56}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"float", !8, i64 0}
!11 = !{!"short", !8, i64 0}
!12 = !{!6, !10, i64 12}
!13 = !{!6, !10, i64 16}
!14 = !{!15, !11, i64 8}
!15 = !{!"_ZTS5voxel", !7, i64 0, !11, i64 8, !11, i64 10, !11, i64 12, !10, i64 16}
!16 = !{!15, !11, i64 10}
!17 = !{!15, !11, i64 12}
!18 = !{!15, !10, i64 16}
!19 = !{!20, !20, i64 0}
!20 = !{!"double", !8, i64 0}
!21 = !{!22, !20, i64 0}
!22 = !{!"_ZTS4var3IdE", !20, i64 0, !20, i64 8, !20, i64 16}
!23 = !{!22, !20, i64 8}
!24 = !{!22, !20, i64 16}
!25 = !{!6, !7, i64 40}
!26 = !{!11, !11, i64 0}
!27 = !{!10, !10, i64 0}
!28 = !{!6, !10, i64 24}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass