; LLVM IR from niessner/Matterport :: code/gaps/pkgs/R3Shapes/R3Grid.ll (ZN6R3Grid16RasterizeGridBoxERK5R3Boxdi)

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

; 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 i32 @_ZNK6R3Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(592)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6R3Grid18RasterizeGridValueEiiidi(ptr noundef nonnull align 8 dereferenceable(592), i32 noundef, i32 noundef, i32 noundef, double noundef, i32 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6R3Grid16RasterizeGridBoxERK5R3Boxdi(ptr noundef nonnull align 8 dereferenceable(592) %0, ptr noundef nonnull align 8 dereferenceable(56) %1, double noundef %2, i32 noundef %3) #2 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca double, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store double %2, ptr %7, align 8, !tbaa !9
  store i32 %3, ptr %8, align 4, !tbaa !11
  %19 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  %20 = load ptr, ptr %6, align 8, !tbaa !5
  %21 = call noundef double @_ZNK5R3Box4XMinEv(ptr noundef nonnull align 8 dereferenceable(56) %20)
  %22 = fadd double %21, 5.000000e-01
  %23 = fptosi double %22 to i32
  store i32 %23, ptr %9, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = call noundef double @_ZNK5R3Box4XMaxEv(ptr noundef nonnull align 8 dereferenceable(56) %24)
  %26 = fadd double %25, 5.000000e-01
  %27 = fptosi double %26 to i32
  store i32 %27, ptr %10, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = call noundef double @_ZNK5R3Box4YMinEv(ptr noundef nonnull align 8 dereferenceable(56) %28)
  %30 = fadd double %29, 5.000000e-01
  %31 = fptosi double %30 to i32
  store i32 %31, ptr %11, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = call noundef double @_ZNK5R3Box4YMaxEv(ptr noundef nonnull align 8 dereferenceable(56) %32)
  %34 = fadd double %33, 5.000000e-01
  %35 = fptosi double %34 to i32
  store i32 %35, ptr %12, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = call noundef double @_ZNK5R3Box4ZMinEv(ptr noundef nonnull align 8 dereferenceable(56) %36)
  %38 = fadd double %37, 5.000000e-01
  %39 = fptosi double %38 to i32
  store i32 %39, ptr %13, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = call noundef double @_ZNK5R3Box4ZMaxEv(ptr noundef nonnull align 8 dereferenceable(56) %40)
  %42 = fadd double %41, 5.000000e-01
  %43 = fptosi double %42 to i32
  store i32 %43, ptr %14, align 4, !tbaa !11
  %44 = load i32, ptr %9, align 4, !tbaa !11
  %45 = call noundef i32 @_ZNK6R3Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %19)
  %46 = icmp sge i32 %44, %45
  br i1 %46, label %47, label %48

47:                                               ; preds = %4
  store i32 1, ptr %15, align 4
  br label %142

48:                                               ; preds = %4
  %49 = load i32, ptr %11, align 4, !tbaa !11
  %50 = call noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %19)
  %51 = icmp sge i32 %49, %50
  br i1 %51, label %52, label %53

52:                                               ; preds = %48
  store i32 1, ptr %15, align 4
  br label %142

53:                                               ; preds = %48
  %54 = load i32, ptr %13, align 4, !tbaa !11
  %55 = call noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %19)
  %56 = icmp sge i32 %54, %55
  br i1 %56, label %57, label %58

57:                                               ; preds = %53
  store i32 1, ptr %15, align 4
  br label %142

58:                                               ; preds = %53
  %59 = load i32, ptr %10, align 4, !tbaa !11
  %60 = icmp slt i32 %59, 0
  br i1 %60, label %61, label %62

61:                                               ; preds = %58
  store i32 1, ptr %15, align 4
  br label %142

62:                                               ; preds = %58
  %63 = load i32, ptr %12, align 4, !tbaa !11
  %64 = icmp slt i32 %63, 0
  br i1 %64, label %65, label %66

65:                                               ; preds = %62
  store i32 1, ptr %15, align 4
  br label %142

66:                                               ; preds = %62
  %67 = load i32, ptr %14, align 4, !tbaa !11
  %68 = icmp slt i32 %67, 0
  br i1 %68, label %69, label %70

69:                                               ; preds = %66
  store i32 1, ptr %15, align 4
  br label %142

70:                                               ; preds = %66
  %71 = load i32, ptr %9, align 4, !tbaa !11
  %72 = icmp slt i32 %71, 0
  br i1 %72, label %73, label %74

73:                                               ; preds = %70
  store i32 0, ptr %9, align 4, !tbaa !11
  br label %74

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

77:                                               ; preds = %74
  store i32 0, ptr %11, align 4, !tbaa !11
  br label %78

78:                                               ; preds = %77, %74
  %79 = load i32, ptr %13, align 4, !tbaa !11
  %80 = icmp slt i32 %79, 0
  br i1 %80, label %81, label %82

81:                                               ; preds = %78
  store i32 0, ptr %13, align 4, !tbaa !11
  br label %82

82:                                               ; preds = %81, %78
  %83 = load i32, ptr %10, align 4, !tbaa !11
  %84 = call noundef i32 @_ZNK6R3Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %19)
  %85 = icmp sge i32 %83, %84
  br i1 %85, label %86, label %89

86:                                               ; preds = %82
  %87 = call noundef i32 @_ZNK6R3Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %19)
  %88 = sub nsw i32 %87, 1
  store i32 %88, ptr %10, align 4, !tbaa !11
  br label %89

89:                                               ; preds = %86, %82
  %90 = load i32, ptr %12, align 4, !tbaa !11
  %91 = call noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %19)
  %92 = icmp sge i32 %90, %91
  br i1 %92, label %93, label %96

93:                                               ; preds = %89
  %94 = call noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %19)
  %95 = sub nsw i32 %94, 1
  store i32 %95, ptr %12, align 4, !tbaa !11
  br label %96

96:                                               ; preds = %93, %89
  %97 = load i32, ptr %14, align 4, !tbaa !11
  %98 = call noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %19)
  %99 = icmp sge i32 %97, %98
  br i1 %99, label %100, label %103

100:                                              ; preds = %96
  %101 = call noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %19)
  %102 = sub nsw i32 %101, 1
  store i32 %102, ptr %14, align 4, !tbaa !11
  br label %103

103:                                              ; preds = %100, %96
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  %104 = load i32, ptr %13, align 4, !tbaa !11
  store i32 %104, ptr %16, align 4, !tbaa !11
  br label %105

105:                                              ; preds = %138, %103
  %106 = load i32, ptr %16, align 4, !tbaa !11
  %107 = load i32, ptr %14, align 4, !tbaa !11
  %108 = icmp sle i32 %106, %107
  br i1 %108, label %110, label %109

109:                                              ; preds = %105
  store i32 2, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  br label %141

110:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  %111 = load i32, ptr %11, align 4, !tbaa !11
  store i32 %111, ptr %17, align 4, !tbaa !11
  br label %112

112:                                              ; preds = %134, %110
  %113 = load i32, ptr %17, align 4, !tbaa !11
  %114 = load i32, ptr %12, align 4, !tbaa !11
  %115 = icmp sle i32 %113, %114
  br i1 %115, label %117, label %116

116:                                              ; preds = %112
  store i32 5, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  br label %137

117:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #3
  %118 = load i32, ptr %9, align 4, !tbaa !11
  store i32 %118, ptr %18, align 4, !tbaa !11
  br label %119

119:                                              ; preds = %130, %117
  %120 = load i32, ptr %18, align 4, !tbaa !11
  %121 = load i32, ptr %10, align 4, !tbaa !11
  %122 = icmp sle i32 %120, %121
  br i1 %122, label %124, label %123

123:                                              ; preds = %119
  store i32 8, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #3
  br label %133

124:                                              ; preds = %119
  %125 = load i32, ptr %18, align 4, !tbaa !11
  %126 = load i32, ptr %17, align 4, !tbaa !11
  %127 = load i32, ptr %16, align 4, !tbaa !11
  %128 = load double, ptr %7, align 8, !tbaa !9
  %129 = load i32, ptr %8, align 4, !tbaa !11
  call void @_ZN6R3Grid18RasterizeGridValueEiiidi(ptr noundef nonnull align 8 dereferenceable(592) %19, i32 noundef %125, i32 noundef %126, i32 noundef %127, double noundef %128, i32 noundef %129)
  br label %130

130:                                              ; preds = %124
  %131 = load i32, ptr %18, align 4, !tbaa !11
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %18, align 4, !tbaa !11
  br label %119, !llvm.loop !13

133:                                              ; preds = %123
  br label %134

134:                                              ; preds = %133
  %135 = load i32, ptr %17, align 4, !tbaa !11
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %17, align 4, !tbaa !11
  br label %112, !llvm.loop !15

137:                                              ; preds = %116
  br label %138

138:                                              ; preds = %137
  %139 = load i32, ptr %16, align 4, !tbaa !11
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %16, align 4, !tbaa !11
  br label %105, !llvm.loop !16

141:                                              ; preds = %109
  store i32 0, ptr %15, align 4
  br label %142

142:                                              ; preds = %141, %69, %65, %61, %57, %52, %47
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  %143 = load i32, ptr %15, align 4
  switch i32 %143, label %145 [
    i32 0, label %144
    i32 1, label %144
  ]

144:                                              ; preds = %142, %142
  ret void

145:                                              ; preds = %142
  unreachable
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK5R3Box4XMinEv(ptr noundef nonnull align 8 dereferenceable(56)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK5R3Box4XMaxEv(ptr noundef nonnull align 8 dereferenceable(56)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK5R3Box4YMinEv(ptr noundef nonnull align 8 dereferenceable(56)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK5R3Box4YMaxEv(ptr noundef nonnull align 8 dereferenceable(56)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK5R3Box4ZMinEv(ptr noundef nonnull align 8 dereferenceable(56)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK5R3Box4ZMaxEv(ptr noundef nonnull align 8 dereferenceable(56)) #1 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 = { 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 #3 = { 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 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}


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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6R3Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(592)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6R3Grid18RasterizeGridValueEiiidi(ptr noundef nonnull align 8 dereferenceable(592), i32 noundef, i32 noundef, i32 noundef, double noundef, i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6R3Grid16RasterizeGridBoxERK5R3Boxdi(ptr noundef nonnull align 8 dereferenceable(592) %0, ptr noundef nonnull align 8 dereferenceable(56) %1, double noundef %2, i32 noundef %3) local_unnamed_addr #1 align 2 {
  %5 = tail call noundef double @_ZNK5R3Box4XMinEv(ptr noundef nonnull align 8 dereferenceable(56) %1)
  %6 = fadd double %5, 5.000000e-01
  %7 = fptosi double %6 to i32
  %8 = tail call noundef double @_ZNK5R3Box4XMaxEv(ptr noundef nonnull align 8 dereferenceable(56) %1)
  %9 = tail call noundef double @_ZNK5R3Box4YMinEv(ptr noundef nonnull align 8 dereferenceable(56) %1)
  %10 = fadd double %9, 5.000000e-01
  %11 = fptosi double %10 to i32
  %12 = tail call noundef double @_ZNK5R3Box4YMaxEv(ptr noundef nonnull align 8 dereferenceable(56) %1)
  %13 = insertelement <2 x double> poison, double %12, i64 0
  %14 = insertelement <2 x double> %13, double %8, i64 1
  %15 = fadd <2 x double> %14, <double 5.000000e-01, double 5.000000e-01>
  %16 = fptosi <2 x double> %15 to <2 x i32>
  %17 = tail call noundef double @_ZNK5R3Box4ZMinEv(ptr noundef nonnull align 8 dereferenceable(56) %1)
  %18 = fadd double %17, 5.000000e-01
  %19 = fptosi double %18 to i32
  %20 = tail call noundef double @_ZNK5R3Box4ZMaxEv(ptr noundef nonnull align 8 dereferenceable(56) %1)
  %21 = fadd double %20, 5.000000e-01
  %22 = fptosi double %21 to i32
  %23 = tail call noundef i32 @_ZNK6R3Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %.not = icmp sgt i32 %23, %7
  br i1 %.not, label %24, label %.loopexit

24:                                               ; preds = %4
  %25 = tail call noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %.not48 = icmp sgt i32 %25, %11
  br i1 %.not48, label %26, label %.loopexit

26:                                               ; preds = %24
  %27 = tail call noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %.not49 = icmp sle i32 %27, %19
  %28 = icmp slt <2 x i32> %16, zeroinitializer
  %29 = extractelement <2 x i1> %28, i64 1
  %or.cond = select i1 %.not49, i1 true, i1 %29
  %30 = extractelement <2 x i1> %28, i64 0
  %or.cond56 = select i1 %or.cond, i1 true, i1 %30
  %31 = icmp slt i32 %22, 0
  %or.cond57 = select i1 %or.cond56, i1 true, i1 %31
  br i1 %or.cond57, label %.loopexit, label %32

32:                                               ; preds = %26
  %spec.store.select = tail call i32 @llvm.smax.i32(i32 %7, i32 0)
  %spec.store.select2 = tail call i32 @llvm.smax.i32(i32 %11, i32 0)
  %spec.store.select1 = tail call i32 @llvm.smax.i32(i32 %19, i32 0)
  %33 = tail call noundef i32 @_ZNK6R3Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %34 = extractelement <2 x i32> %16, i64 1
  %.not50 = icmp sgt i32 %33, %34
  br i1 %.not50, label %38, label %35

35:                                               ; preds = %32
  %36 = tail call noundef i32 @_ZNK6R3Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %37 = add nsw i32 %36, -1
  br label %38

38:                                               ; preds = %35, %32
  %.041 = phi i32 [ %37, %35 ], [ %34, %32 ]
  %39 = tail call noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %40 = extractelement <2 x i32> %16, i64 0
  %.not51 = icmp sgt i32 %39, %40
  br i1 %.not51, label %44, label %41

41:                                               ; preds = %38
  %42 = tail call noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %43 = add nsw i32 %42, -1
  br label %44

44:                                               ; preds = %41, %38
  %.040 = phi i32 [ %43, %41 ], [ %40, %38 ]
  %45 = tail call noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %.not52 = icmp sgt i32 %45, %22
  br i1 %.not52, label %49, label %46

46:                                               ; preds = %44
  %47 = tail call noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %48 = add nsw i32 %47, -1
  br label %49

49:                                               ; preds = %46, %44
  %.039 = phi i32 [ %48, %46 ], [ %22, %44 ]
  %.not5364 = icmp sgt i32 %spec.store.select1, %.039
  %.not5461 = icmp sgt i32 %spec.store.select2, %.040
  %or.cond74 = select i1 %.not5364, i1 true, i1 %.not5461
  %.not5559 = icmp sgt i32 %spec.store.select, %.041
  %or.cond75 = select i1 %or.cond74, i1 true, i1 %.not5559
  br i1 %or.cond75, label %.loopexit, label %.preheader58

.preheader58:                                     ; preds = %49, %._crit_edge63.split
  %.03865 = phi i32 [ %50, %._crit_edge63.split ], [ %spec.store.select1, %49 ]
  br label %.preheader

.preheader:                                       ; preds = %.preheader58, %._crit_edge
  %.03762 = phi i32 [ %spec.store.select2, %.preheader58 ], [ %51, %._crit_edge ]
  br label %52

._crit_edge63.split:                              ; preds = %._crit_edge
  %50 = add nuw i32 %.03865, 1
  %exitcond73.not = icmp eq i32 %.03865, %.039
  br i1 %exitcond73.not, label %.loopexit, label %.preheader58, !llvm.loop !5

._crit_edge:                                      ; preds = %52
  %51 = add nuw i32 %.03762, 1
  %exitcond72.not = icmp eq i32 %.03762, %.040
  br i1 %exitcond72.not, label %._crit_edge63.split, label %.preheader, !llvm.loop !7

52:                                               ; preds = %.preheader, %52
  %.060 = phi i32 [ %spec.store.select, %.preheader ], [ %53, %52 ]
  tail call void @_ZN6R3Grid18RasterizeGridValueEiiidi(ptr noundef nonnull align 8 dereferenceable(592) %0, i32 noundef %.060, i32 noundef %.03762, i32 noundef %.03865, double noundef %2, i32 noundef %3)
  %53 = add nuw i32 %.060, 1
  %exitcond.not = icmp eq i32 %.060, %.041
  br i1 %exitcond.not, label %._crit_edge, label %52, !llvm.loop !8

.loopexit:                                        ; preds = %._crit_edge63.split, %49, %26, %24, %4
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK5R3Box4XMinEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK5R3Box4XMaxEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK5R3Box4YMinEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK5R3Box4YMaxEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK5R3Box4ZMinEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK5R3Box4ZMaxEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #0 align 2

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

attributes #0 = { 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 #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}
!8 = distinct !{!8, !6}


; Effective O3 passes: GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass