; LLVM IR from ImperialCollegeLondon/pnflow :: src/pnm/pnextract (writers_vtk)

; 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 = type { double, double, double }

; 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: mustprogress uwtable
declare dso_local void @_Z16insertHalfCornerRSt6vectorI4var3IdESaIS1_EERS_IiSaIiEES1_S1_S1_S1_ddddddd(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef byval(%class.var3) align 8, ptr noundef byval(%class.var3) align 8, ptr noundef byval(%class.var3) align 8, ptr noundef byval(%class.var3) align 8, double noundef, double noundef, double noundef, double noundef, double noundef, double noundef, double noundef) #1

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z15rotateAroundVecIdE4var3IT_ES2_dS2_(ptr dead_on_unwind noalias writable sret(%class.var3) align 8, ptr noundef byval(%class.var3) align 8, double noundef, ptr noundef byval(%class.var3) align 8) #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #1 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 #2 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) #2 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z16addSphereSegmentR4var3IdES1_dRmRSt6vectorIS0_SaIS0_EERS3_IiSaIiEES9_i(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, double noundef %2, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(24) %6, i32 noundef %7) #1 {
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca double, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca %class.var3, align 8
  %18 = alloca %class.var3, align 8
  %19 = alloca %class.var3, align 8
  %20 = alloca i64, align 8
  %21 = alloca i32, align 4
  %22 = alloca %class.var3, align 8
  %23 = alloca %class.var3, align 8
  %24 = alloca i32, align 4
  %25 = alloca double, align 8
  %26 = alloca double, align 8
  %27 = alloca %class.var3, align 8
  %28 = alloca %class.var3, align 8
  %29 = alloca %class.var3, align 8
  %30 = alloca %class.var3, align 8
  %31 = alloca %class.var3, align 8
  %32 = alloca %class.var3, align 8
  %33 = alloca %class.var3, align 8
  %34 = alloca i32, align 4
  %35 = alloca %class.var3, align 8
  %36 = alloca %class.var3, align 8
  %37 = alloca %class.var3, align 8
  %38 = alloca %class.var3, align 8
  %39 = alloca %class.var3, align 8
  %40 = alloca %class.var3, align 8
  %41 = alloca %class.var3, align 8
  %42 = alloca %class.var3, align 8
  %43 = alloca i32, align 4
  %44 = alloca %class.var3, align 8
  %45 = alloca %class.var3, align 8
  %46 = alloca %class.var3, align 8
  %47 = alloca %class.var3, align 8
  %48 = alloca i32, align 4
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store double %2, ptr %11, align 8, !tbaa !9
  store ptr %3, ptr %12, align 8, !tbaa !5
  store ptr %4, ptr %13, align 8, !tbaa !5
  store ptr %5, ptr %14, align 8, !tbaa !5
  store ptr %6, ptr %15, align 8, !tbaa !5
  store i32 %7, ptr %16, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 24, ptr %17) #4
  %49 = load ptr, ptr %10, align 8, !tbaa !5
  %50 = load ptr, ptr %9, align 8, !tbaa !5
  call void @_ZNK4var3IdEmiERKS0_(ptr dead_on_unwind writable sret(%class.var3) align 8 %17, ptr noundef nonnull align 8 dereferenceable(24) %49, ptr noundef nonnull align 8 dereferenceable(24) %50)
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #4
  %51 = call noundef double @_Z3magIdET_RK4var3IS0_E(ptr noundef nonnull align 8 dereferenceable(24) %17)
  %52 = fadd double %51, 1.000000e-32
  call void @_ZNK4var3IdEdvEd(ptr dead_on_unwind writable sret(%class.var3) align 8 %18, ptr noundef nonnull align 8 dereferenceable(24) %17, double noundef %52)
  call void @llvm.lifetime.start.p0(i64 24, ptr %19) #4
  call void @_ZN4var3IdEC2Eddd(ptr noundef nonnull align 8 dereferenceable(24) %19, double noundef 0.000000e+00, double noundef 0.000000e+00, double noundef 0.000000e+00)
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  store i64 0, ptr %20, align 8, !tbaa !13
  br label %53

53:                                               ; preds = %66, %8
  %54 = load i64, ptr %20, align 8, !tbaa !13
  %55 = icmp ult i64 %54, 3
  br i1 %55, label %57, label %56

56:                                               ; preds = %53
  store i32 2, ptr %21, align 4
  br label %69

57:                                               ; preds = %53
  %58 = load i64, ptr %20, align 8, !tbaa !13
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4var3IdEixEl(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef %58)
  %60 = load double, ptr %59, align 8, !tbaa !9
  %61 = fcmp olt double %60, 6.000000e-01
  br i1 %61, label %62, label %65

62:                                               ; preds = %57
  %63 = load i64, ptr %20, align 8, !tbaa !13
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4var3IdEixEl(ptr noundef nonnull align 8 dereferenceable(24) %19, i64 noundef %63)
  store double 1.000000e+00, ptr %64, align 8, !tbaa !9
  store i32 2, ptr %21, align 4
  br label %69

65:                                               ; preds = %57
  br label %66

66:                                               ; preds = %65
  %67 = load i64, ptr %20, align 8, !tbaa !13
  %68 = add i64 %67, 1
  store i64 %68, ptr %20, align 8, !tbaa !13
  br label %53, !llvm.loop !15

69:                                               ; preds = %62, %56
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  br label %70

70:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 24, ptr %22) #4
  call void @_ZNK4var3IdEeoERKS0_(ptr dead_on_unwind writable sret(%class.var3) align 8 %22, ptr noundef nonnull align 8 dereferenceable(24) %18, ptr noundef nonnull align 8 dereferenceable(24) %19)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %19, ptr align 8 %22, i64 24, i1 false), !tbaa.struct !17
  call void @llvm.lifetime.end.p0(i64 24, ptr %22) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr %23) #4
  %71 = call noundef double @_Z3magIdET_RK4var3IS0_E(ptr noundef nonnull align 8 dereferenceable(24) %19)
  %72 = fadd double %71, 1.000000e-32
  call void @_ZNK4var3IdEdvEd(ptr dead_on_unwind writable sret(%class.var3) align 8 %23, ptr noundef nonnull align 8 dereferenceable(24) %19, double noundef %72)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %19, ptr align 8 %23, i64 24, i1 false), !tbaa.struct !17
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #4
  store i32 0, ptr %24, align 4, !tbaa !11
  br label %73

73:                                               ; preds = %124, %70
  %74 = load i32, ptr %24, align 4, !tbaa !11
  %75 = load i32, ptr %16, align 4, !tbaa !11
  %76 = icmp slt i32 %74, %75
  br i1 %76, label %78, label %77

77:                                               ; preds = %73
  store i32 5, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #4
  br label %127

78:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #4
  %79 = load i32, ptr %16, align 4, !tbaa !11
  %80 = sitofp i32 %79 to double
  %81 = fdiv double 0x400921FB54442EEA, %80
  store double %81, ptr %25, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #4
  %82 = load i32, ptr %16, align 4, !tbaa !11
  %83 = sitofp i32 %82 to double
  %84 = fdiv double 0x3FF921FB54442EEA, %83
  store double %84, ptr %26, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %27) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %28, ptr align 8 %19, i64 24, i1 false), !tbaa.struct !17
  %85 = load double, ptr %25, align 8, !tbaa !9
  %86 = fmul double 2.000000e+00, %85
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %29, ptr align 8 %18, i64 24, i1 false), !tbaa.struct !17
  call void @_Z15rotateAroundVecIdE4var3IT_ES2_dS2_(ptr dead_on_unwind writable sret(%class.var3) align 8 %27, ptr noundef byval(%class.var3) align 8 %28, double noundef %86, ptr noundef byval(%class.var3) align 8 %29)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %19, ptr align 8 %27, i64 24, i1 false), !tbaa.struct !17
  call void @llvm.lifetime.end.p0(i64 24, ptr %27) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr %30) #4
  call void @_ZNK4var3IdEeoERKS0_(ptr dead_on_unwind writable sret(%class.var3) align 8 %30, ptr noundef nonnull align 8 dereferenceable(24) %18, ptr noundef nonnull align 8 dereferenceable(24) %19)
  call void @llvm.lifetime.start.p0(i64 24, ptr %31) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %32, ptr align 8 %19, i64 24, i1 false), !tbaa.struct !17
  %87 = load i32, ptr %16, align 4, !tbaa !11
  %88 = sitofp i32 %87 to double
  %89 = load double, ptr %26, align 8, !tbaa !9
  %90 = fmul double %88, %89
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %33, ptr align 8 %30, i64 24, i1 false), !tbaa.struct !17
  call void @_Z15rotateAroundVecIdE4var3IT_ES2_dS2_(ptr dead_on_unwind writable sret(%class.var3) align 8 %31, ptr noundef byval(%class.var3) align 8 %32, double noundef %90, ptr noundef byval(%class.var3) align 8 %33)
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #4
  store i32 0, ptr %34, align 4, !tbaa !11
  br label %91

91:                                               ; preds = %120, %78
  %92 = load i32, ptr %34, align 4, !tbaa !11
  %93 = load i32, ptr %16, align 4, !tbaa !11
  %94 = icmp slt i32 %92, %93
  br i1 %94, label %96, label %95

95:                                               ; preds = %91
  store i32 8, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #4
  br label %123

96:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 24, ptr %35) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %35, ptr align 8 %31, i64 24, i1 false), !tbaa.struct !17
  call void @llvm.lifetime.start.p0(i64 24, ptr %36) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %37, ptr align 8 %31, i64 24, i1 false), !tbaa.struct !17
  %97 = load double, ptr %26, align 8, !tbaa !9
  %98 = fmul double %97, 2.000000e+00
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %38, ptr align 8 %30, i64 24, i1 false), !tbaa.struct !17
  call void @_Z15rotateAroundVecIdE4var3IT_ES2_dS2_(ptr dead_on_unwind writable sret(%class.var3) align 8 %36, ptr noundef byval(%class.var3) align 8 %37, double noundef %98, ptr noundef byval(%class.var3) align 8 %38)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %31, ptr align 8 %36, i64 24, i1 false), !tbaa.struct !17
  call void @llvm.lifetime.end.p0(i64 24, ptr %36) #4
  %99 = load ptr, ptr %13, align 8, !tbaa !5
  %100 = load ptr, ptr %15, align 8, !tbaa !5
  %101 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %39, ptr align 8 %101, i64 24, i1 false), !tbaa.struct !17
  %102 = load ptr, ptr %10, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %40, ptr align 8 %102, i64 24, i1 false), !tbaa.struct !17
  call void @_ZNK4var3IdEngEv(ptr dead_on_unwind writable sret(%class.var3) align 8 %41, ptr noundef nonnull align 8 dereferenceable(24) %35)
  call void @_ZNK4var3IdEngEv(ptr dead_on_unwind writable sret(%class.var3) align 8 %42, ptr noundef nonnull align 8 dereferenceable(24) %31)
  %103 = load double, ptr %11, align 8, !tbaa !9
  %104 = load double, ptr %25, align 8, !tbaa !9
  call void @_Z16insertHalfCornerRSt6vectorI4var3IdESaIS1_EERS_IiSaIiEES1_S1_S1_S1_ddddddd(ptr noundef nonnull align 8 dereferenceable(24) %99, ptr noundef nonnull align 8 dereferenceable(24) %100, ptr noundef byval(%class.var3) align 8 %39, ptr noundef byval(%class.var3) align 8 %40, ptr noundef byval(%class.var3) align 8 %41, ptr noundef byval(%class.var3) align 8 %42, double noundef 1.000000e-18, double noundef %103, double noundef 0.000000e+00, double noundef 0.000000e+00, double noundef 0.000000e+00, double noundef %104, double noundef 0.000000e+00)
  %105 = load ptr, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %43) #4
  %106 = load ptr, ptr %12, align 8, !tbaa !5
  %107 = load i64, ptr %106, align 8, !tbaa !13
  %108 = trunc i64 %107 to i32
  store i32 %108, ptr %43, align 4, !tbaa !11
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %105, ptr noundef nonnull align 4 dereferenceable(4) %43)
  call void @llvm.lifetime.end.p0(i64 4, ptr %43) #4
  %109 = load ptr, ptr %13, align 8, !tbaa !5
  %110 = load ptr, ptr %15, align 8, !tbaa !5
  %111 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %44, ptr align 8 %111, i64 24, i1 false), !tbaa.struct !17
  %112 = load ptr, ptr %10, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %45, ptr align 8 %112, i64 24, i1 false), !tbaa.struct !17
  call void @_ZNK4var3IdEngEv(ptr dead_on_unwind writable sret(%class.var3) align 8 %46, ptr noundef nonnull align 8 dereferenceable(24) %35)
  call void @_ZNK4var3IdEngEv(ptr dead_on_unwind writable sret(%class.var3) align 8 %47, ptr noundef nonnull align 8 dereferenceable(24) %31)
  %113 = load double, ptr %11, align 8, !tbaa !9
  %114 = load double, ptr %25, align 8, !tbaa !9
  %115 = fneg double %114
  call void @_Z16insertHalfCornerRSt6vectorI4var3IdESaIS1_EERS_IiSaIiEES1_S1_S1_S1_ddddddd(ptr noundef nonnull align 8 dereferenceable(24) %109, ptr noundef nonnull align 8 dereferenceable(24) %110, ptr noundef byval(%class.var3) align 8 %44, ptr noundef byval(%class.var3) align 8 %45, ptr noundef byval(%class.var3) align 8 %46, ptr noundef byval(%class.var3) align 8 %47, double noundef 1.000000e-18, double noundef %113, double noundef 0.000000e+00, double noundef 0.000000e+00, double noundef 0.000000e+00, double noundef %115, double noundef 0.000000e+00)
  %116 = load ptr, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %48) #4
  %117 = load ptr, ptr %12, align 8, !tbaa !5
  %118 = load i64, ptr %117, align 8, !tbaa !13
  %119 = trunc i64 %118 to i32
  store i32 %119, ptr %48, align 4, !tbaa !11
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %116, ptr noundef nonnull align 4 dereferenceable(4) %48)
  call void @llvm.lifetime.end.p0(i64 4, ptr %48) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %35) #4
  br label %120

120:                                              ; preds = %96
  %121 = load i32, ptr %34, align 4, !tbaa !11
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr %34, align 4, !tbaa !11
  br label %91, !llvm.loop !18

123:                                              ; preds = %95
  call void @llvm.lifetime.end.p0(i64 24, ptr %31) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %30) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #4
  br label %124

124:                                              ; preds = %123
  %125 = load i32, ptr %24, align 4, !tbaa !11
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr %24, align 4, !tbaa !11
  br label %73, !llvm.loop !19

127:                                              ; preds = %77
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #4
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{i64 0, i64 8, !9, i64 8, i64 8, !9, i64 16, i64 8, !9}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%class.var3 = 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: mustprogress uwtable
declare dso_local void @_Z16insertHalfCornerRSt6vectorI4var3IdESaIS1_EERS_IiSaIiEES1_S1_S1_S1_ddddddd(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef byval(%class.var3) align 8, ptr noundef byval(%class.var3) align 8, ptr noundef byval(%class.var3) align 8, ptr noundef byval(%class.var3) align 8, double noundef, double noundef, double noundef, double noundef, double noundef, double noundef, double noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK4var3IdEdvEd(ptr dead_on_unwind noalias writable sret(%class.var3) align 8, ptr noundef nonnull align 8 dereferenceable(24), double noundef) local_unnamed_addr #1 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 #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z15rotateAroundVecIdE4var3IT_ES2_dS2_(ptr dead_on_unwind noalias writable sret(%class.var3) align 8, ptr noundef byval(%class.var3) align 8, double noundef, ptr noundef byval(%class.var3) align 8) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 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 #2 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 #2 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z16addSphereSegmentR4var3IdES1_dRmRSt6vectorIS0_SaIS0_EERS3_IiSaIiEES9_i(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, double noundef %2, ptr nocapture noundef nonnull readonly align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(24) %6, i32 noundef %7) local_unnamed_addr #1 {
  %9 = alloca %class.var3, align 8
  %10 = alloca %class.var3, align 8
  %11 = alloca %class.var3, align 8
  %12 = alloca %class.var3, align 8
  %13 = alloca %class.var3, align 8
  %14 = alloca %class.var3, align 8
  %15 = alloca %class.var3, align 8
  %16 = alloca %class.var3, align 8
  %17 = alloca %class.var3, align 8
  %18 = alloca %class.var3, align 8
  %19 = alloca %class.var3, align 8
  %20 = alloca %class.var3, align 8
  %21 = alloca %class.var3, align 8
  %22 = alloca %class.var3, align 8
  %23 = alloca i32, align 4
  %24 = alloca %class.var3, align 8
  %25 = alloca %class.var3, align 8
  %26 = alloca %class.var3, align 8
  %27 = alloca %class.var3, align 8
  %28 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #4
  call void @_ZNK4var3IdEmiERKS0_(ptr dead_on_unwind nonnull writable sret(%class.var3) align 8 %9, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %0)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #4
  %29 = call noundef double @_Z3magIdET_RK4var3IS0_E(ptr noundef nonnull align 8 dereferenceable(24) %9)
  %30 = fadd double %29, 1.000000e-32
  call void @_ZNK4var3IdEdvEd(ptr dead_on_unwind nonnull writable sret(%class.var3) align 8 %10, ptr noundef nonnull align 8 dereferenceable(24) %9, double noundef %30)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %11) #4
  call void @_ZN4var3IdEC2Eddd(ptr noundef nonnull align 8 dereferenceable(24) %11, double noundef 0.000000e+00, double noundef 0.000000e+00, double noundef 0.000000e+00)
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4var3IdEixEl(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef 0)
  %32 = load double, ptr %31, align 8, !tbaa !5
  %33 = fcmp olt double %32, 6.000000e-01
  br i1 %33, label %34, label %36

34:                                               ; preds = %40, %36, %8
  %.03337.lcssa = phi i64 [ 0, %8 ], [ 1, %36 ], [ 2, %40 ]
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4var3IdEixEl(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %.03337.lcssa)
  store double 1.000000e+00, ptr %35, align 8, !tbaa !5
  br label %.loopexit

36:                                               ; preds = %8
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4var3IdEixEl(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef 1)
  %38 = load double, ptr %37, align 8, !tbaa !5
  %39 = fcmp olt double %38, 6.000000e-01
  br i1 %39, label %34, label %40

40:                                               ; preds = %36
  %41 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4var3IdEixEl(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef 2)
  %42 = load double, ptr %41, align 8, !tbaa !5
  %43 = fcmp olt double %42, 6.000000e-01
  br i1 %43, label %34, label %.loopexit

.loopexit:                                        ; preds = %40, %34
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %12) #4
  call void @_ZNK4var3IdEeoERKS0_(ptr dead_on_unwind nonnull writable sret(%class.var3) align 8 %12, ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(24) %11)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 8 dereferenceable(24) %12, i64 24, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #4
  %44 = call noundef double @_Z3magIdET_RK4var3IS0_E(ptr noundef nonnull align 8 dereferenceable(24) %11)
  %45 = fadd double %44, 1.000000e-32
  call void @_ZNK4var3IdEdvEd(ptr dead_on_unwind nonnull writable sret(%class.var3) align 8 %13, ptr noundef nonnull align 8 dereferenceable(24) %11, double noundef %45)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 8 dereferenceable(24) %13, i64 24, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #4
  %46 = icmp sgt i32 %7, 0
  br i1 %46, label %.lr.ph41, label %._crit_edge42

.lr.ph41:                                         ; preds = %.loopexit
  %47 = uitofp nneg i32 %7 to double
  %48 = fdiv double 0x400921FB54442EEA, %47
  %49 = fdiv double 0x3FF921FB54442EEA, %47
  %50 = fmul double %48, 2.000000e+00
  %51 = fmul double %49, %47
  %52 = fmul double %49, 2.000000e+00
  %53 = fneg double %48
  br label %.lr.ph.us

.lr.ph.us:                                        ; preds = %._crit_edge.us, %.lr.ph41
  %.03439.us = phi i32 [ 0, %.lr.ph41 ], [ %60, %._crit_edge.us ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %14) #4
  call void @_Z15rotateAroundVecIdE4var3IT_ES2_dS2_(ptr dead_on_unwind nonnull writable sret(%class.var3) align 8 %14, ptr noundef nonnull byval(%class.var3) align 8 %11, double noundef %50, ptr noundef nonnull byval(%class.var3) align 8 %10)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 8 dereferenceable(24) %14, i64 24, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %14) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %15) #4
  call void @_ZNK4var3IdEeoERKS0_(ptr dead_on_unwind nonnull writable sret(%class.var3) align 8 %15, ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(24) %11)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %16) #4
  call void @_Z15rotateAroundVecIdE4var3IT_ES2_dS2_(ptr dead_on_unwind nonnull writable sret(%class.var3) align 8 %16, ptr noundef nonnull byval(%class.var3) align 8 %11, double noundef %51, ptr noundef nonnull byval(%class.var3) align 8 %15)
  br label %54

54:                                               ; preds = %.lr.ph.us, %54
  %.038.us = phi i32 [ 0, %.lr.ph.us ], [ %59, %54 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %17) #4
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %17, ptr noundef nonnull align 8 dereferenceable(24) %16, i64 24, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %18) #4
  call void @_Z15rotateAroundVecIdE4var3IT_ES2_dS2_(ptr dead_on_unwind nonnull writable sret(%class.var3) align 8 %18, ptr noundef nonnull byval(%class.var3) align 8 %16, double noundef %52, ptr noundef nonnull byval(%class.var3) align 8 %15)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %16, ptr noundef nonnull align 8 dereferenceable(24) %18, i64 24, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %18) #4
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %19, ptr noundef nonnull align 8 dereferenceable(24) %0, i64 24, i1 false), !tbaa.struct !9
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %20, ptr noundef nonnull align 8 dereferenceable(24) %1, i64 24, i1 false), !tbaa.struct !9
  call void @_ZNK4var3IdEngEv(ptr dead_on_unwind nonnull writable sret(%class.var3) align 8 %21, ptr noundef nonnull align 8 dereferenceable(24) %17)
  call void @_ZNK4var3IdEngEv(ptr dead_on_unwind nonnull writable sret(%class.var3) align 8 %22, ptr noundef nonnull align 8 dereferenceable(24) %16)
  call void @_Z16insertHalfCornerRSt6vectorI4var3IdESaIS1_EERS_IiSaIiEES1_S1_S1_S1_ddddddd(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull byval(%class.var3) align 8 %19, ptr noundef nonnull byval(%class.var3) align 8 %20, ptr noundef nonnull byval(%class.var3) align 8 %21, ptr noundef nonnull byval(%class.var3) align 8 %22, double noundef 1.000000e-18, double noundef %2, double noundef 0.000000e+00, double noundef 0.000000e+00, double noundef 0.000000e+00, double noundef %48, double noundef 0.000000e+00)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %23) #4
  %55 = load i64, ptr %3, align 8, !tbaa !10
  %56 = trunc i64 %55 to i32
  store i32 %56, ptr %23, align 4, !tbaa !12
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 4 dereferenceable(4) %23)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %23) #4
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %24, ptr noundef nonnull align 8 dereferenceable(24) %0, i64 24, i1 false), !tbaa.struct !9
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %25, ptr noundef nonnull align 8 dereferenceable(24) %1, i64 24, i1 false), !tbaa.struct !9
  call void @_ZNK4var3IdEngEv(ptr dead_on_unwind nonnull writable sret(%class.var3) align 8 %26, ptr noundef nonnull align 8 dereferenceable(24) %17)
  call void @_ZNK4var3IdEngEv(ptr dead_on_unwind nonnull writable sret(%class.var3) align 8 %27, ptr noundef nonnull align 8 dereferenceable(24) %16)
  call void @_Z16insertHalfCornerRSt6vectorI4var3IdESaIS1_EERS_IiSaIiEES1_S1_S1_S1_ddddddd(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull byval(%class.var3) align 8 %24, ptr noundef nonnull byval(%class.var3) align 8 %25, ptr noundef nonnull byval(%class.var3) align 8 %26, ptr noundef nonnull byval(%class.var3) align 8 %27, double noundef 1.000000e-18, double noundef %2, double noundef 0.000000e+00, double noundef 0.000000e+00, double noundef 0.000000e+00, double noundef %53, double noundef 0.000000e+00)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %28) #4
  %57 = load i64, ptr %3, align 8, !tbaa !10
  %58 = trunc i64 %57 to i32
  store i32 %58, ptr %28, align 4, !tbaa !12
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 4 dereferenceable(4) %28)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %28) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %17) #4
  %59 = add nuw nsw i32 %.038.us, 1
  %exitcond.not = icmp eq i32 %59, %7
  br i1 %exitcond.not, label %._crit_edge.us, label %54, !llvm.loop !14

._crit_edge.us:                                   ; preds = %54
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %16) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %15) #4
  %60 = add nuw nsw i32 %.03439.us, 1
  %exitcond44.not = icmp eq i32 %60, %7
  br i1 %exitcond44.not, label %._crit_edge42, label %.lr.ph.us, !llvm.loop !16

._crit_edge42:                                    ; preds = %._crit_edge.us, %.loopexit
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #4
  ret void
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nounwind }

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

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


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