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

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

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

; 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

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

77:                                               ; preds = %2
  %78 = load ptr, ptr %9, align 8, !tbaa !5
  %79 = icmp ne ptr %78, null
  br i1 %79, label %80, label %123

80:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %81 = load ptr, ptr %9, 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 = load ptr, ptr %5, align 8, !tbaa !5
  %85 = getelementptr inbounds %class.voxel, ptr %84, i32 0, i32 5
  %86 = load float, ptr %85, align 8, !tbaa !19
  %87 = fsub float %83, %86
  store float %87, ptr %10, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %88 = load ptr, ptr %5, 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 = load ptr, ptr %8, align 8, !tbaa !5
  %92 = getelementptr inbounds %class.voxel, ptr %91, i32 0, i32 5
  %93 = load float, ptr %92, align 8, !tbaa !19
  %94 = fsub float %90, %93
  store float %94, ptr %11, align 4, !tbaa !20
  %95 = load float, ptr %10, align 4, !tbaa !20
  %96 = load float, ptr %11, align 4, !tbaa !20
  %97 = fadd float %95, %96
  %98 = fpext float %97 to double
  %99 = fmul double 5.000000e-01, %98
  %100 = getelementptr inbounds %class.var3.10, ptr %7, i32 0, i32 0
  store double %99, ptr %100, align 8, !tbaa !21
  %101 = load float, ptr %10, align 4, !tbaa !20
  %102 = load float, ptr %11, align 4, !tbaa !20
  %103 = fsub float %101, %102
  %104 = call noundef float @_ZSt3absf(float noundef %103)
  %105 = fpext float %104 to double
  %106 = fcmp ogt double %105, 1.000000e-02
  br i1 %106, label %107, label %122

107:                                              ; preds = %80
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store double -5.900000e-01, ptr %12, align 8, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  store double 5.900000e-01, ptr %13, align 8, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %108 = load float, ptr %10, align 4, !tbaa !20
  %109 = load float, ptr %11, align 4, !tbaa !20
  %110 = fadd float %108, %109
  %111 = fpext float %110 to double
  %112 = fmul double -5.000000e-01, %111
  %113 = load float, ptr %10, align 4, !tbaa !20
  %114 = load float, ptr %11, align 4, !tbaa !20
  %115 = fsub float %113, %114
  %116 = fpext float %115 to double
  %117 = fdiv double %112, %116
  store double %117, ptr %14, align 8, !tbaa !24
  %118 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %14)
  %119 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %118)
  %120 = load double, ptr %119, align 8, !tbaa !24
  %121 = getelementptr inbounds %class.var3.10, ptr %6, i32 0, i32 0
  store double %120, ptr %121, align 8, !tbaa !21
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %122

122:                                              ; preds = %107, %80
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %123

123:                                              ; preds = %122, %77, %2
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %124 = load ptr, ptr %5, align 8, !tbaa !5
  %125 = getelementptr inbounds %class.voxel, ptr %124, i32 0, i32 1
  %126 = load i16, ptr %125, align 8, !tbaa !15
  %127 = sext i16 %126 to i32
  %128 = load ptr, ptr %5, align 8, !tbaa !5
  %129 = getelementptr inbounds %class.voxel, ptr %128, i32 0, i32 2
  %130 = load i16, ptr %129, align 2, !tbaa !17
  %131 = sext i16 %130 to i32
  %132 = sub nsw i32 %131, 1
  %133 = load ptr, ptr %5, align 8, !tbaa !5
  %134 = getelementptr inbounds %class.voxel, ptr %133, i32 0, i32 3
  %135 = load i16, ptr %134, align 4, !tbaa !18
  %136 = sext i16 %135 to i32
  %137 = call noundef ptr @_ZN13medialSurface3vxlEiii(ptr noundef nonnull align 8 dereferenceable(252) %33, i32 noundef %127, i32 noundef %132, i32 noundef %136)
  store ptr %137, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %138 = load ptr, ptr %5, align 8, !tbaa !5
  %139 = getelementptr inbounds %class.voxel, ptr %138, i32 0, i32 1
  %140 = load i16, ptr %139, align 8, !tbaa !15
  %141 = sext i16 %140 to i32
  %142 = load ptr, ptr %5, align 8, !tbaa !5
  %143 = getelementptr inbounds %class.voxel, ptr %142, i32 0, i32 2
  %144 = load i16, ptr %143, align 2, !tbaa !17
  %145 = sext i16 %144 to i32
  %146 = add nsw i32 %145, 1
  %147 = load ptr, ptr %5, align 8, !tbaa !5
  %148 = getelementptr inbounds %class.voxel, ptr %147, i32 0, i32 3
  %149 = load i16, ptr %148, align 4, !tbaa !18
  %150 = sext i16 %149 to i32
  %151 = call noundef ptr @_ZN13medialSurface3vxlEiii(ptr noundef nonnull align 8 dereferenceable(252) %33, i32 noundef %141, i32 noundef %146, i32 noundef %150)
  store ptr %151, ptr %16, align 8, !tbaa !5
  %152 = load ptr, ptr %15, align 8, !tbaa !5
  %153 = icmp ne ptr %152, null
  br i1 %153, label %154, label %200

154:                                              ; preds = %123
  %155 = load ptr, ptr %16, align 8, !tbaa !5
  %156 = icmp ne ptr %155, null
  br i1 %156, label %157, label %200

157:                                              ; preds = %154
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %158 = load ptr, ptr %16, align 8, !tbaa !5
  %159 = getelementptr inbounds %class.voxel, ptr %158, i32 0, i32 5
  %160 = load float, ptr %159, align 8, !tbaa !19
  %161 = load ptr, ptr %5, align 8, !tbaa !5
  %162 = getelementptr inbounds %class.voxel, ptr %161, i32 0, i32 5
  %163 = load float, ptr %162, align 8, !tbaa !19
  %164 = fsub float %160, %163
  store float %164, ptr %17, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %165 = load ptr, ptr %5, align 8, !tbaa !5
  %166 = getelementptr inbounds %class.voxel, ptr %165, i32 0, i32 5
  %167 = load float, ptr %166, align 8, !tbaa !19
  %168 = load ptr, ptr %15, align 8, !tbaa !5
  %169 = getelementptr inbounds %class.voxel, ptr %168, i32 0, i32 5
  %170 = load float, ptr %169, align 8, !tbaa !19
  %171 = fsub float %167, %170
  store float %171, ptr %18, align 4, !tbaa !20
  %172 = load float, ptr %17, align 4, !tbaa !20
  %173 = load float, ptr %18, align 4, !tbaa !20
  %174 = fadd float %172, %173
  %175 = fpext float %174 to double
  %176 = fmul double 5.000000e-01, %175
  %177 = getelementptr inbounds %class.var3.10, ptr %7, i32 0, i32 1
  store double %176, ptr %177, align 8, !tbaa !25
  %178 = load float, ptr %17, align 4, !tbaa !20
  %179 = load float, ptr %18, align 4, !tbaa !20
  %180 = fsub float %178, %179
  %181 = call noundef float @_ZSt3absf(float noundef %180)
  %182 = fpext float %181 to double
  %183 = fcmp ogt double %182, 1.000000e-02
  br i1 %183, label %184, label %199

184:                                              ; preds = %157
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  store double -5.900000e-01, ptr %19, align 8, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  store double 5.900000e-01, ptr %20, align 8, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %185 = load float, ptr %17, align 4, !tbaa !20
  %186 = load float, ptr %18, align 4, !tbaa !20
  %187 = fadd float %185, %186
  %188 = fpext float %187 to double
  %189 = fmul double -5.000000e-01, %188
  %190 = load float, ptr %17, align 4, !tbaa !20
  %191 = load float, ptr %18, align 4, !tbaa !20
  %192 = fsub float %190, %191
  %193 = fpext float %192 to double
  %194 = fdiv double %189, %193
  store double %194, ptr %21, align 8, !tbaa !24
  %195 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %21)
  %196 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(8) %195)
  %197 = load double, ptr %196, align 8, !tbaa !24
  %198 = getelementptr inbounds %class.var3.10, ptr %6, i32 0, i32 1
  store double %197, ptr %198, align 8, !tbaa !25
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  br label %199

199:                                              ; preds = %184, %157
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %200

200:                                              ; preds = %199, %154, %123
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %201 = load ptr, ptr %5, align 8, !tbaa !5
  %202 = getelementptr inbounds %class.voxel, ptr %201, i32 0, i32 1
  %203 = load i16, ptr %202, align 8, !tbaa !15
  %204 = sext i16 %203 to i32
  %205 = load ptr, ptr %5, align 8, !tbaa !5
  %206 = getelementptr inbounds %class.voxel, ptr %205, i32 0, i32 2
  %207 = load i16, ptr %206, align 2, !tbaa !17
  %208 = sext i16 %207 to i32
  %209 = load ptr, ptr %5, align 8, !tbaa !5
  %210 = getelementptr inbounds %class.voxel, ptr %209, i32 0, i32 3
  %211 = load i16, ptr %210, align 4, !tbaa !18
  %212 = sext i16 %211 to i32
  %213 = sub nsw i32 %212, 1
  %214 = call noundef ptr @_ZN13medialSurface3vxlEiii(ptr noundef nonnull align 8 dereferenceable(252) %33, i32 noundef %204, i32 noundef %208, i32 noundef %213)
  store ptr %214, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  %215 = load ptr, ptr %5, align 8, !tbaa !5
  %216 = getelementptr inbounds %class.voxel, ptr %215, i32 0, i32 1
  %217 = load i16, ptr %216, align 8, !tbaa !15
  %218 = sext i16 %217 to i32
  %219 = load ptr, ptr %5, align 8, !tbaa !5
  %220 = getelementptr inbounds %class.voxel, ptr %219, i32 0, i32 2
  %221 = load i16, ptr %220, align 2, !tbaa !17
  %222 = sext i16 %221 to i32
  %223 = load ptr, ptr %5, align 8, !tbaa !5
  %224 = getelementptr inbounds %class.voxel, ptr %223, i32 0, i32 3
  %225 = load i16, ptr %224, align 4, !tbaa !18
  %226 = sext i16 %225 to i32
  %227 = add nsw i32 %226, 1
  %228 = call noundef ptr @_ZN13medialSurface3vxlEiii(ptr noundef nonnull align 8 dereferenceable(252) %33, i32 noundef %218, i32 noundef %222, i32 noundef %227)
  store ptr %228, ptr %23, align 8, !tbaa !5
  %229 = load ptr, ptr %22, align 8, !tbaa !5
  %230 = icmp ne ptr %229, null
  br i1 %230, label %231, label %277

231:                                              ; preds = %200
  %232 = load ptr, ptr %23, align 8, !tbaa !5
  %233 = icmp ne ptr %232, null
  br i1 %233, label %234, label %277

234:                                              ; preds = %231
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  %235 = load ptr, ptr %23, align 8, !tbaa !5
  %236 = getelementptr inbounds %class.voxel, ptr %235, i32 0, i32 5
  %237 = load float, ptr %236, align 8, !tbaa !19
  %238 = load ptr, ptr %5, align 8, !tbaa !5
  %239 = getelementptr inbounds %class.voxel, ptr %238, i32 0, i32 5
  %240 = load float, ptr %239, align 8, !tbaa !19
  %241 = fsub float %237, %240
  store float %241, ptr %24, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #6
  %242 = load ptr, ptr %5, align 8, !tbaa !5
  %243 = getelementptr inbounds %class.voxel, ptr %242, i32 0, i32 5
  %244 = load float, ptr %243, align 8, !tbaa !19
  %245 = load ptr, ptr %22, align 8, !tbaa !5
  %246 = getelementptr inbounds %class.voxel, ptr %245, i32 0, i32 5
  %247 = load float, ptr %246, align 8, !tbaa !19
  %248 = fsub float %244, %247
  store float %248, ptr %25, align 4, !tbaa !20
  %249 = load float, ptr %24, align 4, !tbaa !20
  %250 = load float, ptr %25, align 4, !tbaa !20
  %251 = fadd float %249, %250
  %252 = fpext float %251 to double
  %253 = fmul double 5.000000e-01, %252
  %254 = getelementptr inbounds %class.var3.10, ptr %7, i32 0, i32 2
  store double %253, ptr %254, align 8, !tbaa !26
  %255 = load float, ptr %24, align 4, !tbaa !20
  %256 = load float, ptr %25, align 4, !tbaa !20
  %257 = fsub float %255, %256
  %258 = call noundef float @_ZSt3absf(float noundef %257)
  %259 = fpext float %258 to double
  %260 = fcmp ogt double %259, 1.000000e-02
  br i1 %260, label %261, label %276

261:                                              ; preds = %234
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #6
  store double -5.900000e-01, ptr %26, align 8, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #6
  store double 5.900000e-01, ptr %27, align 8, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #6
  %262 = load float, ptr %24, align 4, !tbaa !20
  %263 = load float, ptr %25, align 4, !tbaa !20
  %264 = fadd float %262, %263
  %265 = fpext float %264 to double
  %266 = fmul double -5.000000e-01, %265
  %267 = load float, ptr %24, align 4, !tbaa !20
  %268 = load float, ptr %25, align 4, !tbaa !20
  %269 = fsub float %267, %268
  %270 = fpext float %269 to double
  %271 = fdiv double %266, %270
  store double %271, ptr %28, align 8, !tbaa !24
  %272 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef nonnull align 8 dereferenceable(8) %28)
  %273 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %26, ptr noundef nonnull align 8 dereferenceable(8) %272)
  %274 = load double, ptr %273, align 8, !tbaa !24
  %275 = getelementptr inbounds %class.var3.10, ptr %6, i32 0, i32 2
  store double %274, ptr %275, align 8, !tbaa !26
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  br label %276

276:                                              ; preds = %261, %234
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  br label %277

277:                                              ; preds = %276, %231, %200
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %29) #6
  call void @_ZmlIdE4var3IT_EdRKS2_(ptr dead_on_unwind writable sret(%class.var3.10) align 8 %29, double noundef 1.400000e+00, ptr noundef nonnull align 8 dereferenceable(24) %7)
  %278 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN4var3IdEpLERKS0_(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
  %279 = load ptr, ptr %4, align 8, !tbaa !5
  %280 = load ptr, ptr %4, align 8, !tbaa !5
  %281 = getelementptr inbounds %class.medialBall, ptr %280, i32 0, i32 11
  %282 = load ptr, ptr %281, align 8, !tbaa !27
  %283 = icmp ne ptr %279, %282
  br i1 %283, label %284, label %295

284:                                              ; preds = %277
  call void @llvm.lifetime.start.p0(i64 24, ptr %30) #6
  %285 = load ptr, ptr %4, align 8, !tbaa !5
  %286 = load ptr, ptr %4, align 8, !tbaa !5
  %287 = getelementptr inbounds %class.medialBall, ptr %286, i32 0, i32 11
  %288 = load ptr, ptr %287, align 8, !tbaa !27
  call void @_ZmiRK10medialBallS1_(ptr dead_on_unwind writable sret(%class.var3.10) align 8 %30, ptr noundef nonnull align 8 dereferenceable(64) %285, ptr noundef nonnull align 8 dereferenceable(64) %288)
  call void @llvm.lifetime.start.p0(i64 24, ptr %31) #6
  %289 = call noundef double @_ZNK4var3IdEanERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %30, ptr noundef nonnull align 8 dereferenceable(24) %6)
  %290 = call noundef double @_Z6magSqrIdEdRK4var3IT_E(ptr noundef nonnull align 8 dereferenceable(24) %30)
  %291 = fadd double %290, 0x3D719799812DEA11
  %292 = fdiv double %289, %291
  %293 = fmul double 5.000000e-01, %292
  call void @_ZmlIdE4var3IT_EdRKS2_(ptr dead_on_unwind writable sret(%class.var3.10) align 8 %31, double noundef %293, ptr noundef nonnull align 8 dereferenceable(24) %30)
  %294 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN4var3IdEmIERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(24) %31)
  call void @llvm.lifetime.end.p0(i64 24, ptr %31) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %30) #6
  br label %295

295:                                              ; preds = %284, %277
  %296 = call noundef double @_Z3magIdET_RK4var3IS0_E(ptr noundef nonnull align 8 dereferenceable(24) %6)
  %297 = call double @llvm.fmuladd.f64(double 5.500000e-01, double %296, double 5.000000e-02)
  %298 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN4var3IdEdVEd(ptr noundef nonnull align 8 dereferenceable(24) %6, double noundef %297)
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #6
  %299 = load ptr, ptr %4, align 8, !tbaa !5
  %300 = getelementptr inbounds %class.medialBall, ptr %299, i32 0, i32 1
  %301 = load float, ptr %300, align 8, !tbaa !9
  %302 = fpext float %301 to double
  %303 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4var3IdEixEl(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef 0)
  %304 = load double, ptr %303, align 8, !tbaa !24
  %305 = fadd double %302, %304
  %306 = fptosi double %305 to i32
  %307 = load ptr, ptr %4, align 8, !tbaa !5
  %308 = getelementptr inbounds %class.medialBall, ptr %307, i32 0, i32 2
  %309 = load float, ptr %308, align 4, !tbaa !13
  %310 = fpext float %309 to double
  %311 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4var3IdEixEl(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef 1)
  %312 = load double, ptr %311, align 8, !tbaa !24
  %313 = fadd double %310, %312
  %314 = fptosi double %313 to i32
  %315 = load ptr, ptr %4, align 8, !tbaa !5
  %316 = getelementptr inbounds %class.medialBall, ptr %315, i32 0, i32 3
  %317 = load float, ptr %316, align 8, !tbaa !14
  %318 = fpext float %317 to double
  %319 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4var3IdEixEl(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef 2)
  %320 = load double, ptr %319, align 8, !tbaa !24
  %321 = fadd double %318, %320
  %322 = fptosi double %321 to i32
  %323 = call noundef ptr @_ZN13medialSurface3vxlEiii(ptr noundef nonnull align 8 dereferenceable(252) %33, i32 noundef %306, i32 noundef %314, i32 noundef %322)
  store ptr %323, ptr %32, align 8, !tbaa !5
  %324 = load ptr, ptr %32, align 8, !tbaa !5
  %325 = icmp ne ptr %324, null
  br i1 %325, label %326, label %386

326:                                              ; preds = %295
  %327 = load ptr, ptr %5, align 8, !tbaa !5
  %328 = load ptr, ptr %32, align 8, !tbaa !5
  %329 = icmp ne ptr %327, %328
  br i1 %329, label %330, label %386

330:                                              ; preds = %326
  %331 = load ptr, ptr %32, align 8, !tbaa !5
  %332 = getelementptr inbounds %class.voxel, ptr %331, i32 0, i32 5
  %333 = load float, ptr %332, align 8, !tbaa !19
  %334 = load ptr, ptr %5, align 8, !tbaa !5
  %335 = getelementptr inbounds %class.voxel, ptr %334, i32 0, i32 5
  %336 = load float, ptr %335, align 8, !tbaa !19
  %337 = fcmp ogt float %333, %336
  br i1 %337, label %338, label %386

338:                                              ; preds = %330
  %339 = load ptr, ptr %32, align 8, !tbaa !5
  %340 = getelementptr inbounds %class.voxel, ptr %339, i32 0, i32 0
  %341 = load ptr, ptr %340, align 8, !tbaa !28
  %342 = icmp eq ptr %341, null
  br i1 %342, label %343, label %386

343:                                              ; preds = %338
  %344 = load ptr, ptr %32, align 8, !tbaa !5
  %345 = getelementptr inbounds %class.voxel, ptr %344, i32 0, i32 1
  %346 = load i16, ptr %345, align 8, !tbaa !15
  %347 = sext i16 %346 to i32
  %348 = sitofp i32 %347 to double
  %349 = fsub double %348, -5.000000e-01
  %350 = fptrunc double %349 to float
  %351 = load ptr, ptr %4, align 8, !tbaa !5
  %352 = getelementptr inbounds %class.medialBall, ptr %351, i32 0, i32 1
  store float %350, ptr %352, align 8, !tbaa !9
  %353 = load ptr, ptr %32, align 8, !tbaa !5
  %354 = getelementptr inbounds %class.voxel, ptr %353, i32 0, i32 2
  %355 = load i16, ptr %354, align 2, !tbaa !17
  %356 = sext i16 %355 to i32
  %357 = sitofp i32 %356 to double
  %358 = fsub double %357, -5.000000e-01
  %359 = fptrunc double %358 to float
  %360 = load ptr, ptr %4, align 8, !tbaa !5
  %361 = getelementptr inbounds %class.medialBall, ptr %360, i32 0, i32 2
  store float %359, ptr %361, align 4, !tbaa !13
  %362 = load ptr, ptr %32, align 8, !tbaa !5
  %363 = getelementptr inbounds %class.voxel, ptr %362, i32 0, i32 3
  %364 = load i16, ptr %363, align 4, !tbaa !18
  %365 = sext i16 %364 to i32
  %366 = sitofp i32 %365 to double
  %367 = fsub double %366, -5.000000e-01
  %368 = fptrunc double %367 to float
  %369 = load ptr, ptr %4, align 8, !tbaa !5
  %370 = getelementptr inbounds %class.medialBall, ptr %369, i32 0, i32 3
  store float %368, ptr %370, align 8, !tbaa !14
  %371 = load ptr, ptr %32, align 8, !tbaa !5
  %372 = getelementptr inbounds %class.voxel, ptr %371, i32 0, i32 5
  %373 = load float, ptr %372, align 8, !tbaa !19
  %374 = load ptr, ptr %4, align 8, !tbaa !5
  %375 = getelementptr inbounds %class.medialBall, ptr %374, i32 0, i32 5
  store float %373, ptr %375, align 8, !tbaa !29
  %376 = load ptr, ptr %4, align 8, !tbaa !5
  %377 = getelementptr inbounds %class.medialBall, ptr %376, i32 0, i32 0
  %378 = load ptr, ptr %377, align 8, !tbaa !30
  %379 = getelementptr inbounds %class.voxel, ptr %378, i32 0, i32 0
  store ptr null, ptr %379, align 8, !tbaa !28
  %380 = load ptr, ptr %32, align 8, !tbaa !5
  %381 = load ptr, ptr %4, align 8, !tbaa !5
  %382 = getelementptr inbounds %class.medialBall, ptr %381, i32 0, i32 0
  store ptr %380, ptr %382, align 8, !tbaa !30
  %383 = load ptr, ptr %4, align 8, !tbaa !5
  %384 = load ptr, ptr %32, align 8, !tbaa !5
  %385 = getelementptr inbounds %class.voxel, ptr %384, i32 0, i32 0
  store ptr %383, ptr %385, align 8, !tbaa !28
  br label %386

386:                                              ; preds = %343, %338, %330, %326, %295
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #6
  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 noundef nonnull align 8 dereferenceable(24) ptr @_ZN4var3IdEpLERKS0_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

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

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

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 = { 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 #5 = { 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, !23, i64 0}
!22 = !{!"_ZTS4var3IdE", !23, i64 0, !23, i64 8, !23, i64 16}
!23 = !{!"double", !7, i64 0}
!24 = !{!23, !23, i64 0}
!25 = !{!22, !23, i64 8}
!26 = !{!22, !23, i64 16}
!27 = !{!10, !6, i64 40}
!28 = !{!16, !6, i64 0}
!29 = !{!10, !11, i64 24}
!30 = !{!10, !6, i64 0}


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

; 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 #5

; 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

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

48:                                               ; preds = %2
  %49 = getelementptr inbounds i8, ptr %45, i64 16
  %50 = load float, ptr %49, align 8, !tbaa !18
  %51 = getelementptr inbounds i8, ptr %26, i64 16
  %52 = load float, ptr %51, align 8, !tbaa !18
  %53 = fsub float %50, %52
  %54 = getelementptr inbounds i8, ptr %37, i64 16
  %55 = load float, ptr %54, align 8, !tbaa !18
  %56 = fsub float %52, %55
  %57 = fadd float %53, %56
  %58 = fpext float %57 to double
  %59 = fmul double %58, 5.000000e-01
  store double %59, ptr %4, align 8, !tbaa !19
  %60 = fsub float %53, %56
  %61 = call noundef float @_ZSt3absf(float noundef %60)
  %62 = fpext float %61 to double
  %63 = fcmp ogt double %62, 1.000000e-02
  br i1 %63, label %64, label %71

64:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  store double -5.900000e-01, ptr %5, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  store double 5.900000e-01, ptr %6, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %65 = fmul double %58, -5.000000e-01
  %66 = fpext float %60 to double
  %67 = fdiv double %65, %66
  store double %67, ptr %7, align 8, !tbaa !22
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %68)
  %70 = load double, ptr %69, align 8, !tbaa !22
  store double %70, ptr %3, align 8, !tbaa !19
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  br label %71

71:                                               ; preds = %48, %64, %2
  %72 = load i16, ptr %27, align 8, !tbaa !14
  %73 = sext i16 %72 to i32
  %74 = load i16, ptr %31, align 2, !tbaa !16
  %75 = sext i16 %74 to i32
  %76 = add nsw i32 %75, -1
  %77 = load i16, ptr %34, align 4, !tbaa !17
  %78 = sext i16 %77 to i32
  %79 = call noundef ptr @_ZN13medialSurface3vxlEiii(ptr noundef nonnull align 8 dereferenceable(252) %0, i32 noundef %73, i32 noundef %76, i32 noundef %78)
  %80 = load i16, ptr %27, align 8, !tbaa !14
  %81 = sext i16 %80 to i32
  %82 = load i16, ptr %31, align 2, !tbaa !16
  %83 = sext i16 %82 to i32
  %84 = add nsw i32 %83, 1
  %85 = load i16, ptr %34, align 4, !tbaa !17
  %86 = sext i16 %85 to i32
  %87 = call noundef ptr @_ZN13medialSurface3vxlEiii(ptr noundef nonnull align 8 dereferenceable(252) %0, i32 noundef %81, i32 noundef %84, i32 noundef %86)
  %88 = icmp ne ptr %79, null
  %89 = icmp ne ptr %87, null
  %or.cond3 = and i1 %88, %89
  br i1 %or.cond3, label %90, label %115

90:                                               ; preds = %71
  %91 = getelementptr inbounds i8, ptr %87, i64 16
  %92 = load float, ptr %91, align 8, !tbaa !18
  %93 = getelementptr inbounds i8, ptr %26, i64 16
  %94 = load float, ptr %93, align 8, !tbaa !18
  %95 = fsub float %92, %94
  %96 = getelementptr inbounds i8, ptr %79, i64 16
  %97 = load float, ptr %96, align 8, !tbaa !18
  %98 = fsub float %94, %97
  %99 = fadd float %95, %98
  %100 = fpext float %99 to double
  %101 = fmul double %100, 5.000000e-01
  %102 = getelementptr inbounds i8, ptr %4, i64 8
  store double %101, ptr %102, align 8, !tbaa !23
  %103 = fsub float %95, %98
  %104 = call noundef float @_ZSt3absf(float noundef %103)
  %105 = fpext float %104 to double
  %106 = fcmp ogt double %105, 1.000000e-02
  br i1 %106, label %107, label %115

107:                                              ; preds = %90
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  store double -5.900000e-01, ptr %8, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  store double 5.900000e-01, ptr %9, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  %108 = fmul double %100, -5.000000e-01
  %109 = fpext float %103 to double
  %110 = fdiv double %108, %109
  store double %110, ptr %10, align 8, !tbaa !22
  %111 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %111)
  %113 = load double, ptr %112, align 8, !tbaa !22
  %114 = getelementptr inbounds i8, ptr %3, i64 8
  store double %113, ptr %114, align 8, !tbaa !23
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  br label %115

115:                                              ; preds = %90, %107, %71
  %116 = load i16, ptr %27, align 8, !tbaa !14
  %117 = sext i16 %116 to i32
  %118 = load i16, ptr %31, align 2, !tbaa !16
  %119 = sext i16 %118 to i32
  %120 = load i16, ptr %34, align 4, !tbaa !17
  %121 = sext i16 %120 to i32
  %122 = add nsw i32 %121, -1
  %123 = call noundef ptr @_ZN13medialSurface3vxlEiii(ptr noundef nonnull align 8 dereferenceable(252) %0, i32 noundef %117, i32 noundef %119, i32 noundef %122)
  %124 = load i16, ptr %27, align 8, !tbaa !14
  %125 = sext i16 %124 to i32
  %126 = load i16, ptr %31, align 2, !tbaa !16
  %127 = sext i16 %126 to i32
  %128 = load i16, ptr %34, align 4, !tbaa !17
  %129 = sext i16 %128 to i32
  %130 = add nsw i32 %129, 1
  %131 = call noundef ptr @_ZN13medialSurface3vxlEiii(ptr noundef nonnull align 8 dereferenceable(252) %0, i32 noundef %125, i32 noundef %127, i32 noundef %130)
  %132 = icmp ne ptr %123, null
  %133 = icmp ne ptr %131, null
  %or.cond5 = and i1 %132, %133
  br i1 %or.cond5, label %134, label %159

134:                                              ; preds = %115
  %135 = getelementptr inbounds i8, ptr %131, i64 16
  %136 = load float, ptr %135, align 8, !tbaa !18
  %137 = getelementptr inbounds i8, ptr %26, i64 16
  %138 = load float, ptr %137, align 8, !tbaa !18
  %139 = fsub float %136, %138
  %140 = getelementptr inbounds i8, ptr %123, i64 16
  %141 = load float, ptr %140, align 8, !tbaa !18
  %142 = fsub float %138, %141
  %143 = fadd float %139, %142
  %144 = fpext float %143 to double
  %145 = fmul double %144, 5.000000e-01
  %146 = getelementptr inbounds i8, ptr %4, i64 16
  store double %145, ptr %146, align 8, !tbaa !24
  %147 = fsub float %139, %142
  %148 = call noundef float @_ZSt3absf(float noundef %147)
  %149 = fpext float %148 to double
  %150 = fcmp ogt double %149, 1.000000e-02
  br i1 %150, label %151, label %159

151:                                              ; preds = %134
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #6
  store double -5.900000e-01, ptr %11, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #6
  store double 5.900000e-01, ptr %12, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #6
  %152 = fmul double %144, -5.000000e-01
  %153 = fpext float %147 to double
  %154 = fdiv double %152, %153
  store double %154, ptr %13, align 8, !tbaa !22
  %155 = 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)
  %156 = 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) %155)
  %157 = load double, ptr %156, align 8, !tbaa !22
  %158 = getelementptr inbounds i8, ptr %3, i64 16
  store double %157, ptr %158, align 8, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #6
  br label %159

159:                                              ; preds = %134, %151, %115
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %14) #6
  call void @_ZmlIdE4var3IT_EdRKS2_(ptr dead_on_unwind nonnull writable sret(%class.var3.10) align 8 %14, double noundef 1.400000e+00, ptr noundef nonnull align 8 dereferenceable(24) %4)
  %160 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN4var3IdEpLERKS0_(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
  %161 = getelementptr inbounds i8, ptr %1, i64 40
  %162 = load ptr, ptr %161, align 8, !tbaa !25
  %.not = icmp eq ptr %162, %1
  br i1 %.not, label %170, label %163

163:                                              ; preds = %159
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %15) #6
  call void @_ZmiRK10medialBallS1_(ptr dead_on_unwind nonnull writable sret(%class.var3.10) align 8 %15, ptr noundef nonnull align 8 dereferenceable(64) %1, ptr noundef nonnull align 8 dereferenceable(64) %162)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %16) #6
  %164 = call noundef double @_ZNK4var3IdEanERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %15, ptr noundef nonnull align 8 dereferenceable(24) %3)
  %165 = call noundef double @_Z6magSqrIdEdRK4var3IT_E(ptr noundef nonnull align 8 dereferenceable(24) %15)
  %166 = fadd double %165, 0x3D719799812DEA11
  %167 = fdiv double %164, %166
  %168 = fmul double %167, 5.000000e-01
  call void @_ZmlIdE4var3IT_EdRKS2_(ptr dead_on_unwind nonnull writable sret(%class.var3.10) align 8 %16, double noundef %168, ptr noundef nonnull align 8 dereferenceable(24) %15)
  %169 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN4var3IdEmIERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %16)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %16) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %15) #6
  br label %170

170:                                              ; preds = %163, %159
  %171 = call noundef double @_Z3magIdET_RK4var3IS0_E(ptr noundef nonnull align 8 dereferenceable(24) %3)
  %172 = call double @llvm.fmuladd.f64(double %171, double 5.500000e-01, double 5.000000e-02)
  %173 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN4var3IdEdVEd(ptr noundef nonnull align 8 dereferenceable(24) %3, double noundef %172)
  %174 = load float, ptr %17, align 8, !tbaa !5
  %175 = fpext float %174 to double
  %176 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4var3IdEixEl(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef 0)
  %177 = load double, ptr %176, align 8, !tbaa !22
  %178 = fadd double %177, %175
  %179 = fptosi double %178 to i32
  %180 = load float, ptr %20, align 4, !tbaa !12
  %181 = fpext float %180 to double
  %182 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4var3IdEixEl(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef 1)
  %183 = load double, ptr %182, align 8, !tbaa !22
  %184 = fadd double %183, %181
  %185 = fptosi double %184 to i32
  %186 = load float, ptr %23, align 8, !tbaa !13
  %187 = fpext float %186 to double
  %188 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4var3IdEixEl(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef 2)
  %189 = load double, ptr %188, align 8, !tbaa !22
  %190 = fadd double %189, %187
  %191 = fptosi double %190 to i32
  %192 = call noundef ptr @_ZN13medialSurface3vxlEiii(ptr noundef nonnull align 8 dereferenceable(252) %0, i32 noundef %179, i32 noundef %185, i32 noundef %191)
  %.not103 = icmp eq ptr %192, null
  %.not104 = icmp eq ptr %26, %192
  %or.cond105 = or i1 %.not103, %.not104
  br i1 %or.cond105, label %215, label %193

193:                                              ; preds = %170
  %194 = getelementptr inbounds i8, ptr %192, i64 16
  %195 = load float, ptr %194, align 8, !tbaa !18
  %196 = getelementptr inbounds i8, ptr %26, i64 16
  %197 = load float, ptr %196, align 8, !tbaa !18
  %198 = fcmp ogt float %195, %197
  br i1 %198, label %199, label %215

199:                                              ; preds = %193
  %200 = load ptr, ptr %192, align 8, !tbaa !26
  %201 = icmp eq ptr %200, null
  br i1 %201, label %202, label %215

202:                                              ; preds = %199
  %203 = getelementptr inbounds i8, ptr %192, i64 8
  %204 = load <2 x i16>, ptr %203, align 8, !tbaa !27
  %205 = sitofp <2 x i16> %204 to <2 x double>
  %206 = fadd <2 x double> %205, <double 5.000000e-01, double 5.000000e-01>
  %207 = fptrunc <2 x double> %206 to <2 x float>
  store <2 x float> %207, ptr %17, align 8, !tbaa !28
  %208 = getelementptr inbounds i8, ptr %192, i64 12
  %209 = load i16, ptr %208, align 4, !tbaa !17
  %210 = sitofp i16 %209 to double
  %211 = fadd double %210, 5.000000e-01
  %212 = fptrunc double %211 to float
  store float %212, ptr %23, align 8, !tbaa !13
  %213 = getelementptr inbounds i8, ptr %1, i64 24
  store float %195, ptr %213, align 8, !tbaa !29
  %214 = load ptr, ptr %1, align 8, !tbaa !30
  store ptr null, ptr %214, align 8, !tbaa !26
  store ptr %192, ptr %1, align 8, !tbaa !30
  store ptr %1, ptr %192, align 8, !tbaa !26
  br label %215

215:                                              ; preds = %202, %199, %193, %170
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  ret void
}

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

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

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

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 = { 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 #5 = { 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, !21, i64 0}
!20 = !{!"_ZTS4var3IdE", !21, i64 0, !21, i64 8, !21, i64 16}
!21 = !{!"double", !8, i64 0}
!22 = !{!21, !21, i64 0}
!23 = !{!20, !21, i64 8}
!24 = !{!20, !21, i64 16}
!25 = !{!6, !7, i64 40}
!26 = !{!15, !7, i64 0}
!27 = !{!11, !11, i64 0}
!28 = !{!10, !10, i64 0}
!29 = !{!6, !10, i64 24}
!30 = !{!6, !7, i64 0}


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