; LLVM IR from SourangshuGhosh/Fluid-Simulation-for-Computer-Graphics :: src/collision.ll (ZN9Collision17rayIntersectsAABBEN5vmath4vec3ES1_R4AABBPS1_)

; 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.vmath::vec3" = type { float, float, float }

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: nounwind
declare void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #2

; 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 float @_ZSt4fabsf(float noundef) #3

declare void @_ZN5vmathplERKNS_4vec3ES2_(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #4

declare void @_ZN5vmathmlEfRKNS_4vec3E(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4, float noundef, ptr noundef nonnull align 4 dereferenceable(12)) #4

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN9Collision17rayIntersectsAABBEN5vmath4vec3ES1_R4AABBPS1_(ptr noundef %0, ptr noundef %1, ptr noundef nonnull align 8 dereferenceable(40) %2, ptr noundef %3) #5 personality ptr @__gxx_personality_v0 {
  %5 = alloca i1, align 1
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca %"class.vmath::vec3", align 4
  %11 = alloca %"class.vmath::vec3", align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca double, align 8
  %15 = alloca %"class.vmath::vec3", align 4
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca %"class.vmath::vec3", align 4
  %21 = alloca %"class.vmath::vec3", align 4
  %22 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr %10) #7
  %23 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN4AABB11getMinPointEv(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %10, ptr noundef nonnull align 8 dereferenceable(40) %23)
  call void @llvm.lifetime.start.p0(i64 12, ptr %11) #7
  %24 = load ptr, ptr %8, align 8, !tbaa !5
  invoke void @_ZN4AABB11getMaxPointEv(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %11, ptr noundef nonnull align 8 dereferenceable(40) %24)
          to label %25 unwind label %46

25:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  store double 1.000000e-10, ptr %14, align 8, !tbaa !9
  %26 = getelementptr inbounds %"class.vmath::vec3", ptr %1, i32 0, i32 0
  %27 = load float, ptr %26, align 4, !tbaa !11
  %28 = invoke noundef float @_ZSt4fabsf(float noundef %27)
          to label %29 unwind label %50

29:                                               ; preds = %25
  %30 = fpext float %28 to double
  %31 = load double, ptr %14, align 8, !tbaa !9
  %32 = fcmp olt double %30, %31
  br i1 %32, label %33, label %54

33:                                               ; preds = %29
  %34 = getelementptr inbounds %"class.vmath::vec3", ptr %1, i32 0, i32 0
  %35 = load float, ptr %34, align 4, !tbaa !11
  %36 = fcmp olt float %35, 0.000000e+00
  br i1 %36, label %37, label %40

37:                                               ; preds = %33
  %38 = load double, ptr %14, align 8, !tbaa !9
  %39 = fneg double %38
  br label %42

40:                                               ; preds = %33
  %41 = load double, ptr %14, align 8, !tbaa !9
  br label %42

42:                                               ; preds = %40, %37
  %43 = phi double [ %39, %37 ], [ %41, %40 ]
  %44 = fptrunc double %43 to float
  %45 = getelementptr inbounds %"class.vmath::vec3", ptr %1, i32 0, i32 0
  store float %44, ptr %45, align 4, !tbaa !11
  br label %54

46:                                               ; preds = %4
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %12, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %13, align 4
  br label %221

50:                                               ; preds = %75, %54, %25
  %51 = landingpad { ptr, i32 }
          cleanup
  %52 = extractvalue { ptr, i32 } %51, 0
  store ptr %52, ptr %12, align 8
  %53 = extractvalue { ptr, i32 } %51, 1
  store i32 %53, ptr %13, align 4
  br label %220

54:                                               ; preds = %42, %29
  %55 = getelementptr inbounds %"class.vmath::vec3", ptr %1, i32 0, i32 1
  %56 = load float, ptr %55, align 4, !tbaa !14
  %57 = invoke noundef float @_ZSt4fabsf(float noundef %56)
          to label %58 unwind label %50

58:                                               ; preds = %54
  %59 = fpext float %57 to double
  %60 = load double, ptr %14, align 8, !tbaa !9
  %61 = fcmp olt double %59, %60
  br i1 %61, label %62, label %75

62:                                               ; preds = %58
  %63 = getelementptr inbounds %"class.vmath::vec3", ptr %1, i32 0, i32 1
  %64 = load float, ptr %63, align 4, !tbaa !14
  %65 = fcmp olt float %64, 0.000000e+00
  br i1 %65, label %66, label %69

66:                                               ; preds = %62
  %67 = load double, ptr %14, align 8, !tbaa !9
  %68 = fneg double %67
  br label %71

69:                                               ; preds = %62
  %70 = load double, ptr %14, align 8, !tbaa !9
  br label %71

71:                                               ; preds = %69, %66
  %72 = phi double [ %68, %66 ], [ %70, %69 ]
  %73 = fptrunc double %72 to float
  %74 = getelementptr inbounds %"class.vmath::vec3", ptr %1, i32 0, i32 1
  store float %73, ptr %74, align 4, !tbaa !14
  br label %75

75:                                               ; preds = %71, %58
  %76 = getelementptr inbounds %"class.vmath::vec3", ptr %1, i32 0, i32 0
  %77 = load float, ptr %76, align 4, !tbaa !11
  %78 = invoke noundef float @_ZSt4fabsf(float noundef %77)
          to label %79 unwind label %50

79:                                               ; preds = %75
  %80 = fpext float %78 to double
  %81 = load double, ptr %14, align 8, !tbaa !9
  %82 = fcmp olt double %80, %81
  br i1 %82, label %83, label %96

83:                                               ; preds = %79
  %84 = getelementptr inbounds %"class.vmath::vec3", ptr %1, i32 0, i32 2
  %85 = load float, ptr %84, align 4, !tbaa !15
  %86 = fcmp olt float %85, 0.000000e+00
  br i1 %86, label %87, label %90

87:                                               ; preds = %83
  %88 = load double, ptr %14, align 8, !tbaa !9
  %89 = fneg double %88
  br label %92

90:                                               ; preds = %83
  %91 = load double, ptr %14, align 8, !tbaa !9
  br label %92

92:                                               ; preds = %90, %87
  %93 = phi double [ %89, %87 ], [ %91, %90 ]
  %94 = fptrunc double %93 to float
  %95 = getelementptr inbounds %"class.vmath::vec3", ptr %1, i32 0, i32 2
  store float %94, ptr %95, align 4, !tbaa !15
  br label %96

96:                                               ; preds = %92, %79
  call void @llvm.lifetime.start.p0(i64 12, ptr %15) #7
  %97 = getelementptr inbounds %"class.vmath::vec3", ptr %1, i32 0, i32 0
  %98 = load float, ptr %97, align 4, !tbaa !11
  %99 = fpext float %98 to double
  %100 = fdiv double 1.000000e+00, %99
  %101 = fptrunc double %100 to float
  %102 = getelementptr inbounds %"class.vmath::vec3", ptr %1, i32 0, i32 1
  %103 = load float, ptr %102, align 4, !tbaa !14
  %104 = fpext float %103 to double
  %105 = fdiv double 1.000000e+00, %104
  %106 = fptrunc double %105 to float
  %107 = getelementptr inbounds %"class.vmath::vec3", ptr %1, i32 0, i32 2
  %108 = load float, ptr %107, align 4, !tbaa !15
  %109 = fpext float %108 to double
  %110 = fdiv double 1.000000e+00, %109
  %111 = fptrunc double %110 to float
  invoke void @_ZN5vmath4vec3C1Efff(ptr noundef nonnull align 4 dereferenceable(12) %15, float noundef %101, float noundef %106, float noundef %111)
          to label %112 unwind label %203

112:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %113 = getelementptr inbounds %"class.vmath::vec3", ptr %10, i32 0, i32 0
  %114 = load float, ptr %113, align 4, !tbaa !11
  %115 = getelementptr inbounds %"class.vmath::vec3", ptr %0, i32 0, i32 0
  %116 = load float, ptr %115, align 4, !tbaa !11
  %117 = fsub float %114, %116
  %118 = getelementptr inbounds %"class.vmath::vec3", ptr %15, i32 0, i32 0
  %119 = load float, ptr %118, align 4, !tbaa !11
  %120 = fmul float %117, %119
  %121 = fpext float %120 to double
  store double %121, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %122 = getelementptr inbounds %"class.vmath::vec3", ptr %11, i32 0, i32 0
  %123 = load float, ptr %122, align 4, !tbaa !11
  %124 = getelementptr inbounds %"class.vmath::vec3", ptr %0, i32 0, i32 0
  %125 = load float, ptr %124, align 4, !tbaa !11
  %126 = fsub float %123, %125
  %127 = getelementptr inbounds %"class.vmath::vec3", ptr %15, i32 0, i32 0
  %128 = load float, ptr %127, align 4, !tbaa !11
  %129 = fmul float %126, %128
  %130 = fpext float %129 to double
  store double %130, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %131 = load double, ptr %16, align 8, !tbaa !9
  %132 = load double, ptr %17, align 8, !tbaa !9
  %133 = call double @llvm.minnum.f64(double %131, double %132)
  store double %133, ptr %18, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %134 = load double, ptr %16, align 8, !tbaa !9
  %135 = load double, ptr %17, align 8, !tbaa !9
  %136 = call double @llvm.maxnum.f64(double %134, double %135)
  store double %136, ptr %19, align 8, !tbaa !9
  %137 = getelementptr inbounds %"class.vmath::vec3", ptr %10, i32 0, i32 1
  %138 = load float, ptr %137, align 4, !tbaa !14
  %139 = getelementptr inbounds %"class.vmath::vec3", ptr %0, i32 0, i32 1
  %140 = load float, ptr %139, align 4, !tbaa !14
  %141 = fsub float %138, %140
  %142 = getelementptr inbounds %"class.vmath::vec3", ptr %15, i32 0, i32 1
  %143 = load float, ptr %142, align 4, !tbaa !14
  %144 = fmul float %141, %143
  %145 = fpext float %144 to double
  store double %145, ptr %16, align 8, !tbaa !9
  %146 = getelementptr inbounds %"class.vmath::vec3", ptr %11, i32 0, i32 1
  %147 = load float, ptr %146, align 4, !tbaa !14
  %148 = getelementptr inbounds %"class.vmath::vec3", ptr %0, i32 0, i32 1
  %149 = load float, ptr %148, align 4, !tbaa !14
  %150 = fsub float %147, %149
  %151 = getelementptr inbounds %"class.vmath::vec3", ptr %15, i32 0, i32 1
  %152 = load float, ptr %151, align 4, !tbaa !14
  %153 = fmul float %150, %152
  %154 = fpext float %153 to double
  store double %154, ptr %17, align 8, !tbaa !9
  %155 = load double, ptr %18, align 8, !tbaa !9
  %156 = load double, ptr %16, align 8, !tbaa !9
  %157 = load double, ptr %17, align 8, !tbaa !9
  %158 = call double @llvm.minnum.f64(double %156, double %157)
  %159 = call double @llvm.maxnum.f64(double %155, double %158)
  store double %159, ptr %18, align 8, !tbaa !9
  %160 = load double, ptr %19, align 8, !tbaa !9
  %161 = load double, ptr %16, align 8, !tbaa !9
  %162 = load double, ptr %17, align 8, !tbaa !9
  %163 = call double @llvm.maxnum.f64(double %161, double %162)
  %164 = call double @llvm.minnum.f64(double %160, double %163)
  store double %164, ptr %19, align 8, !tbaa !9
  %165 = getelementptr inbounds %"class.vmath::vec3", ptr %10, i32 0, i32 2
  %166 = load float, ptr %165, align 4, !tbaa !15
  %167 = getelementptr inbounds %"class.vmath::vec3", ptr %0, i32 0, i32 2
  %168 = load float, ptr %167, align 4, !tbaa !15
  %169 = fsub float %166, %168
  %170 = getelementptr inbounds %"class.vmath::vec3", ptr %15, i32 0, i32 2
  %171 = load float, ptr %170, align 4, !tbaa !15
  %172 = fmul float %169, %171
  %173 = fpext float %172 to double
  store double %173, ptr %16, align 8, !tbaa !9
  %174 = getelementptr inbounds %"class.vmath::vec3", ptr %11, i32 0, i32 2
  %175 = load float, ptr %174, align 4, !tbaa !15
  %176 = getelementptr inbounds %"class.vmath::vec3", ptr %0, i32 0, i32 2
  %177 = load float, ptr %176, align 4, !tbaa !15
  %178 = fsub float %175, %177
  %179 = getelementptr inbounds %"class.vmath::vec3", ptr %15, i32 0, i32 2
  %180 = load float, ptr %179, align 4, !tbaa !15
  %181 = fmul float %178, %180
  %182 = fpext float %181 to double
  store double %182, ptr %17, align 8, !tbaa !9
  %183 = load double, ptr %18, align 8, !tbaa !9
  %184 = load double, ptr %16, align 8, !tbaa !9
  %185 = load double, ptr %17, align 8, !tbaa !9
  %186 = call double @llvm.minnum.f64(double %184, double %185)
  %187 = call double @llvm.maxnum.f64(double %183, double %186)
  store double %187, ptr %18, align 8, !tbaa !9
  %188 = load double, ptr %19, align 8, !tbaa !9
  %189 = load double, ptr %16, align 8, !tbaa !9
  %190 = load double, ptr %17, align 8, !tbaa !9
  %191 = call double @llvm.maxnum.f64(double %189, double %190)
  %192 = call double @llvm.minnum.f64(double %188, double %191)
  store double %192, ptr %19, align 8, !tbaa !9
  %193 = load double, ptr %19, align 8, !tbaa !9
  %194 = load double, ptr %18, align 8, !tbaa !9
  %195 = call double @llvm.maxnum.f64(double %194, double 0.000000e+00)
  %196 = fcmp ogt double %193, %195
  br i1 %196, label %197, label %216

197:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 12, ptr %20) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %21) #7
  %198 = load double, ptr %18, align 8, !tbaa !9
  %199 = fptrunc double %198 to float
  invoke void @_ZN5vmathmlEfRKNS_4vec3E(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %21, float noundef %199, ptr noundef nonnull align 4 dereferenceable(12) %1)
          to label %200 unwind label %207

200:                                              ; preds = %197
  invoke void @_ZN5vmathplERKNS_4vec3ES2_(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %20, ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %21)
          to label %201 unwind label %211

201:                                              ; preds = %200
  %202 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %202, ptr align 4 %20, i64 12, i1 false), !tbaa.struct !16
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %20) #7
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %21) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %20) #7
  store i1 true, ptr %5, align 1
  store i32 1, ptr %22, align 4
  br label %217

203:                                              ; preds = %96
  %204 = landingpad { ptr, i32 }
          cleanup
  %205 = extractvalue { ptr, i32 } %204, 0
  store ptr %205, ptr %12, align 8
  %206 = extractvalue { ptr, i32 } %204, 1
  store i32 %206, ptr %13, align 4
  br label %219

207:                                              ; preds = %197
  %208 = landingpad { ptr, i32 }
          cleanup
  %209 = extractvalue { ptr, i32 } %208, 0
  store ptr %209, ptr %12, align 8
  %210 = extractvalue { ptr, i32 } %208, 1
  store i32 %210, ptr %13, align 4
  br label %215

211:                                              ; preds = %200
  %212 = landingpad { ptr, i32 }
          cleanup
  %213 = extractvalue { ptr, i32 } %212, 0
  store ptr %213, ptr %12, align 8
  %214 = extractvalue { ptr, i32 } %212, 1
  store i32 %214, ptr %13, align 4
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %21) #7
  br label %215

215:                                              ; preds = %211, %207
  call void @llvm.lifetime.end.p0(i64 12, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %15) #7
  br label %219

216:                                              ; preds = %112
  store i1 false, ptr %5, align 1
  store i32 1, ptr %22, align 4
  br label %217

217:                                              ; preds = %216, %201
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %15) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %11) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %11) #7
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %10) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %10) #7
  %218 = load i1, ptr %5, align 1
  ret i1 %218

219:                                              ; preds = %215, %203
  call void @llvm.lifetime.end.p0(i64 12, ptr %15) #7
  br label %220

220:                                              ; preds = %219, %50
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %11) #7
  br label %221

221:                                              ; preds = %220, %46
  call void @llvm.lifetime.end.p0(i64 12, ptr %11) #7
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %10) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %10) #7
  br label %222

222:                                              ; preds = %221
  %223 = load ptr, ptr %12, align 8
  %224 = load i32, ptr %13, align 4
  %225 = insertvalue { ptr, i32 } poison, ptr %223, 0
  %226 = insertvalue { ptr, i32 } %225, i32 %224, 1
  resume { ptr, i32 } %226
}

declare void @_ZN4AABB11getMinPointEv(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4, ptr noundef nonnull align 8 dereferenceable(40)) #4

declare void @_ZN4AABB11getMaxPointEv(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4, ptr noundef nonnull align 8 dereferenceable(40)) #4

declare void @_ZN5vmath4vec3C1Efff(ptr noundef nonnull align 4 dereferenceable(12), float noundef, float noundef, float noundef) unnamed_addr #4

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind "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 = { 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 #4 = { "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { 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, !13, i64 0}
!12 = !{!"_ZTSN5vmath4vec3E", !13, i64 0, !13, i64 4, !13, i64 8}
!13 = !{!"float", !7, i64 0}
!14 = !{!12, !13, i64 4}
!15 = !{!12, !13, i64 8}
!16 = !{i64 0, i64 4, !17, i64 4, i64 4, !17, i64 8, i64 4, !17}
!17 = !{!13, !13, 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.vmath::vec3" = type { float, float, float }

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: nounwind
declare void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #2

; 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 float @_ZSt4fabsf(float noundef) local_unnamed_addr #3

declare void @_ZN5vmathplERKNS_4vec3ES2_(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #4

declare void @_ZN5vmathmlEfRKNS_4vec3E(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4, float noundef, ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN9Collision17rayIntersectsAABBEN5vmath4vec3ES1_R4AABBPS1_(ptr noundef %0, ptr noundef %1, ptr noundef nonnull align 8 dereferenceable(40) %2, ptr nocapture noundef writeonly %3) local_unnamed_addr #5 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.vmath::vec3", align 4
  %6 = alloca %"class.vmath::vec3", align 4
  %7 = alloca %"class.vmath::vec3", align 4
  %8 = alloca %"class.vmath::vec3", align 4
  %9 = alloca %"class.vmath::vec3", align 4
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #7
  call void @_ZN4AABB11getMinPointEv(ptr dead_on_unwind nonnull writable sret(%"class.vmath::vec3") align 4 %5, ptr noundef nonnull align 8 dereferenceable(40) %2)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #7
  invoke void @_ZN4AABB11getMaxPointEv(ptr dead_on_unwind nonnull writable sret(%"class.vmath::vec3") align 4 %6, ptr noundef nonnull align 8 dereferenceable(40) %2)
          to label %10 unwind label %19

10:                                               ; preds = %4
  %11 = load float, ptr %1, align 4, !tbaa !5
  %12 = call noundef float @_ZSt4fabsf(float noundef %11)
  %13 = fpext float %12 to double
  %14 = fcmp olt double %13, 1.000000e-10
  br i1 %14, label %15, label %21

15:                                               ; preds = %10
  %16 = load float, ptr %1, align 4, !tbaa !5
  %17 = fcmp olt float %16, 0.000000e+00
  %18 = select i1 %17, float 0xBDDB7CDFE0000000, float 0x3DDB7CDFE0000000
  store float %18, ptr %1, align 4, !tbaa !5
  br label %21

19:                                               ; preds = %4
  %20 = landingpad { ptr, i32 }
          cleanup
  br label %111

21:                                               ; preds = %15, %10
  %22 = getelementptr inbounds i8, ptr %1, i64 4
  %23 = load float, ptr %22, align 4, !tbaa !10
  %24 = call noundef float @_ZSt4fabsf(float noundef %23)
  %25 = fpext float %24 to double
  %26 = fcmp olt double %25, 1.000000e-10
  br i1 %26, label %27, label %31

27:                                               ; preds = %21
  %28 = load float, ptr %22, align 4, !tbaa !10
  %29 = fcmp olt float %28, 0.000000e+00
  %30 = select i1 %29, float 0xBDDB7CDFE0000000, float 0x3DDB7CDFE0000000
  store float %30, ptr %22, align 4, !tbaa !10
  br label %31

31:                                               ; preds = %27, %21
  %32 = load float, ptr %1, align 4, !tbaa !5
  %33 = call noundef float @_ZSt4fabsf(float noundef %32)
  %34 = fpext float %33 to double
  %35 = fcmp olt double %34, 1.000000e-10
  %36 = getelementptr inbounds i8, ptr %1, i64 8
  %37 = load float, ptr %36, align 4, !tbaa !11
  br i1 %35, label %38, label %._crit_edge

38:                                               ; preds = %31
  %39 = fcmp olt float %37, 0.000000e+00
  %40 = select i1 %39, float 0xBDDB7CDFE0000000, float 0x3DDB7CDFE0000000
  store float %40, ptr %36, align 4, !tbaa !11
  br label %._crit_edge

._crit_edge:                                      ; preds = %31, %38
  %41 = phi float [ %40, %38 ], [ %37, %31 ]
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #7
  %42 = load float, ptr %1, align 4, !tbaa !5
  %43 = fdiv float 1.000000e+00, %42
  %44 = load float, ptr %22, align 4, !tbaa !10
  %45 = fdiv float 1.000000e+00, %44
  %46 = fdiv float 1.000000e+00, %41
  invoke void @_ZN5vmath4vec3C1Efff(ptr noundef nonnull align 4 dereferenceable(12) %7, float noundef %43, float noundef %45, float noundef %46)
          to label %47 unwind label %102

47:                                               ; preds = %._crit_edge
  %48 = load float, ptr %5, align 4, !tbaa !5
  %49 = load float, ptr %0, align 4, !tbaa !5
  %50 = fsub float %48, %49
  %51 = load float, ptr %7, align 4, !tbaa !5
  %52 = fmul float %50, %51
  %53 = fpext float %52 to double
  %54 = load float, ptr %6, align 4, !tbaa !5
  %55 = fsub float %54, %49
  %56 = fmul float %51, %55
  %57 = fpext float %56 to double
  %58 = call double @llvm.minnum.f64(double %53, double %57)
  %59 = call double @llvm.maxnum.f64(double %53, double %57)
  %60 = getelementptr inbounds i8, ptr %5, i64 4
  %61 = load float, ptr %60, align 4, !tbaa !10
  %62 = getelementptr inbounds i8, ptr %0, i64 4
  %63 = load float, ptr %62, align 4, !tbaa !10
  %64 = fsub float %61, %63
  %65 = getelementptr inbounds i8, ptr %7, i64 4
  %66 = load float, ptr %65, align 4, !tbaa !10
  %67 = fmul float %64, %66
  %68 = fpext float %67 to double
  %69 = getelementptr inbounds i8, ptr %6, i64 4
  %70 = load float, ptr %69, align 4, !tbaa !10
  %71 = fsub float %70, %63
  %72 = fmul float %66, %71
  %73 = fpext float %72 to double
  %74 = call double @llvm.minnum.f64(double %68, double %73)
  %75 = call double @llvm.maxnum.f64(double %58, double %74)
  %76 = call double @llvm.maxnum.f64(double %68, double %73)
  %77 = call double @llvm.minnum.f64(double %59, double %76)
  %78 = getelementptr inbounds i8, ptr %5, i64 8
  %79 = load float, ptr %78, align 4, !tbaa !11
  %80 = getelementptr inbounds i8, ptr %0, i64 8
  %81 = load float, ptr %80, align 4, !tbaa !11
  %82 = fsub float %79, %81
  %83 = getelementptr inbounds i8, ptr %7, i64 8
  %84 = load float, ptr %83, align 4, !tbaa !11
  %85 = fmul float %82, %84
  %86 = fpext float %85 to double
  %87 = getelementptr inbounds i8, ptr %6, i64 8
  %88 = load float, ptr %87, align 4, !tbaa !11
  %89 = fsub float %88, %81
  %90 = fmul float %84, %89
  %91 = fpext float %90 to double
  %92 = call double @llvm.minnum.f64(double %86, double %91)
  %93 = call double @llvm.maxnum.f64(double %75, double %92)
  %94 = call double @llvm.maxnum.f64(double %86, double %91)
  %95 = call double @llvm.minnum.f64(double %77, double %94)
  %96 = call double @llvm.maxnum.f64(double %93, double 0.000000e+00)
  %97 = fcmp ogt double %95, %96
  br i1 %97, label %98, label %109

98:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %9) #7
  %99 = fptrunc double %93 to float
  invoke void @_ZN5vmathmlEfRKNS_4vec3E(ptr dead_on_unwind nonnull writable sret(%"class.vmath::vec3") align 4 %9, float noundef %99, ptr noundef nonnull align 4 dereferenceable(12) %1)
          to label %100 unwind label %104

100:                                              ; preds = %98
  invoke void @_ZN5vmathplERKNS_4vec3ES2_(ptr dead_on_unwind nonnull writable sret(%"class.vmath::vec3") align 4 %8, ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %9)
          to label %101 unwind label %106

101:                                              ; preds = %100
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull align 4 dereferenceable(12) %8, i64 12, i1 false), !tbaa.struct !12
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %8) #7
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %9) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #7
  br label %109

102:                                              ; preds = %._crit_edge
  %103 = landingpad { ptr, i32 }
          cleanup
  br label %110

104:                                              ; preds = %98
  %105 = landingpad { ptr, i32 }
          cleanup
  br label %108

106:                                              ; preds = %100
  %107 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %9) #7
  br label %108

108:                                              ; preds = %106, %104
  %.pn = phi { ptr, i32 } [ %107, %106 ], [ %105, %104 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #7
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %7) #7
  br label %110

109:                                              ; preds = %47, %101
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %7) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #7
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %6) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #7
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %5) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #7
  ret i1 %97

110:                                              ; preds = %108, %102
  %.pn.pn = phi { ptr, i32 } [ %.pn, %108 ], [ %103, %102 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #7
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %6) #7
  br label %111

111:                                              ; preds = %110, %19
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %110 ], [ %20, %19 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #7
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %5) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #7
  resume { ptr, i32 } %.pn.pn.pn
}

declare void @_ZN4AABB11getMinPointEv(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4, ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #4

declare void @_ZN4AABB11getMaxPointEv(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4, ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #4

declare void @_ZN5vmath4vec3C1Efff(ptr noundef nonnull align 4 dereferenceable(12), float noundef, float noundef, float noundef) unnamed_addr #4

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind "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 = { 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 #4 = { "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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { 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, !7, i64 0}
!6 = !{!"_ZTSN5vmath4vec3E", !7, i64 0, !7, i64 4, !7, i64 8}
!7 = !{!"float", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!6, !7, i64 4}
!11 = !{!6, !7, i64 8}
!12 = !{i64 0, i64 4, !13, i64 4, i64 4, !13, i64 8, i64 4, !13}
!13 = !{!7, !7, i64 0}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass