; LLVM IR from ox-vgg/vise :: src/search_engine/relja_retrival/external/KMCode_relja/descriptor/AffineRegion._3d802f3d (Z12checkTangentP12ImageContentiiiif)

; 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.ImageContent = type { i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK12ImageContent1xEv(ptr noundef nonnull align 8 dereferenceable(80)) #1 align 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 @_ZSt5atan2ff(float noundef, float noundef) #1

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z5getXYPPfiiRiS1_(ptr noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

; Function Attrs: mustprogress uwtable
define dso_local noundef float @_Z12checkTangentP12ImageContentiiiif(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, float noundef %5) #4 {
  %7 = alloca float, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca float, 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
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca float, align 4
  %23 = alloca float, align 4
  %24 = alloca float, align 4
  %25 = alloca ptr, align 8
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca float, align 4
  %31 = alloca float, align 4
  %32 = alloca float, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  store i32 %1, ptr %9, align 4, !tbaa !9
  store i32 %2, ptr %10, align 4, !tbaa !9
  store i32 %3, ptr %11, align 4, !tbaa !9
  store i32 %4, ptr %12, align 4, !tbaa !9
  store float %5, ptr %13, align 4, !tbaa !11
  %33 = load i32, ptr %11, align 4, !tbaa !9
  %34 = sub nsw i32 %33, 4
  %35 = icmp slt i32 %34, 0
  br i1 %35, label %52, label %36

36:                                               ; preds = %6
  %37 = load i32, ptr %11, align 4, !tbaa !9
  %38 = add nsw i32 %37, 4
  %39 = load ptr, ptr %8, align 8, !tbaa !5
  %40 = call noundef i32 @_ZNK12ImageContent1xEv(ptr noundef nonnull align 8 dereferenceable(80) %39)
  %41 = icmp ugt i32 %38, %40
  br i1 %41, label %52, label %42

42:                                               ; preds = %36
  %43 = load i32, ptr %12, align 4, !tbaa !9
  %44 = sub nsw i32 %43, 4
  %45 = icmp slt i32 %44, 0
  br i1 %45, label %52, label %46

46:                                               ; preds = %42
  %47 = load i32, ptr %12, align 4, !tbaa !9
  %48 = add nsw i32 %47, 4
  %49 = load ptr, ptr %8, align 8, !tbaa !5
  %50 = call noundef i32 @_ZNK12ImageContent1yEv(ptr noundef nonnull align 8 dereferenceable(80) %49)
  %51 = icmp ugt i32 %48, %50
  br i1 %51, label %52, label %53

52:                                               ; preds = %46, %42, %36, %6
  store float 1.000000e+05, ptr %7, align 4
  br label %214

53:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  %54 = load i32, ptr %9, align 4, !tbaa !9
  %55 = load i32, ptr %11, align 4, !tbaa !9
  %56 = sub nsw i32 %54, %55
  %57 = sitofp i32 %56 to float
  store float %57, ptr %22, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  %58 = load i32, ptr %10, align 4, !tbaa !9
  %59 = load i32, ptr %12, align 4, !tbaa !9
  %60 = sub nsw i32 %58, %59
  %61 = sitofp i32 %60 to float
  store float %61, ptr %23, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  %62 = load float, ptr %23, align 4, !tbaa !11
  %63 = load float, ptr %22, align 4, !tbaa !11
  %64 = call noundef float @_ZSt5atan2ff(float noundef %62, float noundef %63)
  store float %64, ptr %24, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  %65 = call noalias noundef nonnull ptr @_Znam(i64 noundef 40) #8
  store ptr %65, ptr %25, align 8, !tbaa !5
  %66 = call noalias noundef nonnull ptr @_Znam(i64 noundef 100) #8
  %67 = load ptr, ptr %25, align 8, !tbaa !5
  %68 = getelementptr inbounds ptr, ptr %67, i64 0
  store ptr %66, ptr %68, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  store i32 1, ptr %26, align 4, !tbaa !9
  br label %69

69:                                               ; preds = %85, %53
  %70 = load i32, ptr %26, align 4, !tbaa !9
  %71 = icmp slt i32 %70, 5
  br i1 %71, label %73, label %72

72:                                               ; preds = %69
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  br label %88

73:                                               ; preds = %69
  %74 = load ptr, ptr %25, align 8, !tbaa !5
  %75 = getelementptr inbounds ptr, ptr %74, i64 0
  %76 = load ptr, ptr %75, align 8, !tbaa !5
  %77 = load i32, ptr %26, align 4, !tbaa !9
  %78 = mul nsw i32 %77, 5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds float, ptr %76, i64 %79
  %81 = load ptr, ptr %25, align 8, !tbaa !5
  %82 = load i32, ptr %26, align 4, !tbaa !9
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds ptr, ptr %81, i64 %83
  store ptr %80, ptr %84, align 8, !tbaa !5
  br label %85

85:                                               ; preds = %73
  %86 = load i32, ptr %26, align 4, !tbaa !9
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %26, align 4, !tbaa !9
  br label %69, !llvm.loop !13

88:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #7
  store i32 -2, ptr %27, align 4, !tbaa !9
  br label %89

89:                                               ; preds = %128, %88
  %90 = load i32, ptr %27, align 4, !tbaa !9
  %91 = icmp slt i32 %90, 3
  br i1 %91, label %93, label %92

92:                                               ; preds = %89
  store i32 5, ptr %28, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  br label %131

93:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #7
  store i32 -2, ptr %29, align 4, !tbaa !9
  br label %94

94:                                               ; preds = %124, %93
  %95 = load i32, ptr %29, align 4, !tbaa !9
  %96 = icmp slt i32 %95, 3
  br i1 %96, label %98, label %97

97:                                               ; preds = %94
  store i32 8, ptr %28, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #7
  br label %127

98:                                               ; preds = %94
  %99 = load ptr, ptr %8, align 8, !tbaa !5
  %100 = getelementptr inbounds %class.ImageContent, ptr %99, i32 0, i32 4
  %101 = load ptr, ptr %100, align 8, !tbaa !15
  %102 = load i32, ptr %12, align 4, !tbaa !9
  %103 = load i32, ptr %27, align 4, !tbaa !9
  %104 = add nsw i32 %102, %103
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds ptr, ptr %101, i64 %105
  %107 = load ptr, ptr %106, align 8, !tbaa !5
  %108 = load i32, ptr %11, align 4, !tbaa !9
  %109 = load i32, ptr %29, align 4, !tbaa !9
  %110 = add nsw i32 %108, %109
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds float, ptr %107, i64 %111
  %113 = load float, ptr %112, align 4, !tbaa !11
  %114 = load ptr, ptr %25, align 8, !tbaa !5
  %115 = load i32, ptr %27, align 4, !tbaa !9
  %116 = add nsw i32 2, %115
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds ptr, ptr %114, i64 %117
  %119 = load ptr, ptr %118, align 8, !tbaa !5
  %120 = load i32, ptr %29, align 4, !tbaa !9
  %121 = add nsw i32 2, %120
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds float, ptr %119, i64 %122
  store float %113, ptr %123, align 4, !tbaa !11
  br label %124

124:                                              ; preds = %98
  %125 = load i32, ptr %29, align 4, !tbaa !9
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr %29, align 4, !tbaa !9
  br label %94, !llvm.loop !17

127:                                              ; preds = %97
  br label %128

128:                                              ; preds = %127
  %129 = load i32, ptr %27, align 4, !tbaa !9
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %27, align 4, !tbaa !9
  br label %89, !llvm.loop !18

131:                                              ; preds = %92
  %132 = load ptr, ptr %25, align 8, !tbaa !5
  %133 = getelementptr inbounds ptr, ptr %132, i64 2
  %134 = load ptr, ptr %133, align 8, !tbaa !5
  %135 = getelementptr inbounds float, ptr %134, i64 2
  store float 0.000000e+00, ptr %135, align 4, !tbaa !11
  %136 = load ptr, ptr %25, align 8, !tbaa !5
  call void @_Z5getXYPPfiiRiS1_(ptr noundef %136, i32 noundef 2, i32 noundef 2, ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %137 = load ptr, ptr %25, align 8, !tbaa !5
  call void @_Z5getXYPPfiiRiS1_(ptr noundef %137, i32 noundef 2, i32 noundef 2, ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef nonnull align 4 dereferenceable(4) %17)
  %138 = load ptr, ptr %25, align 8, !tbaa !5
  %139 = load i32, ptr %14, align 4, !tbaa !9
  %140 = add nsw i32 2, %139
  %141 = load i32, ptr %15, align 4, !tbaa !9
  %142 = add nsw i32 2, %141
  call void @_Z5getXYPPfiiRiS1_(ptr noundef %138, i32 noundef %140, i32 noundef %142, ptr noundef nonnull align 4 dereferenceable(4) %18, ptr noundef nonnull align 4 dereferenceable(4) %19)
  %143 = load ptr, ptr %25, align 8, !tbaa !5
  %144 = load i32, ptr %16, align 4, !tbaa !9
  %145 = add nsw i32 2, %144
  %146 = load i32, ptr %17, align 4, !tbaa !9
  %147 = add nsw i32 2, %146
  call void @_Z5getXYPPfiiRiS1_(ptr noundef %143, i32 noundef %145, i32 noundef %147, ptr noundef nonnull align 4 dereferenceable(4) %20, ptr noundef nonnull align 4 dereferenceable(4) %21)
  %148 = load i32, ptr %14, align 4, !tbaa !9
  %149 = load i32, ptr %18, align 4, !tbaa !9
  %150 = add nsw i32 %148, %149
  store i32 %150, ptr %18, align 4, !tbaa !9
  %151 = load i32, ptr %15, align 4, !tbaa !9
  %152 = load i32, ptr %19, align 4, !tbaa !9
  %153 = add nsw i32 %151, %152
  store i32 %153, ptr %19, align 4, !tbaa !9
  %154 = load i32, ptr %16, align 4, !tbaa !9
  %155 = load i32, ptr %20, align 4, !tbaa !9
  %156 = add nsw i32 %154, %155
  store i32 %156, ptr %20, align 4, !tbaa !9
  %157 = load i32, ptr %17, align 4, !tbaa !9
  %158 = load i32, ptr %21, align 4, !tbaa !9
  %159 = add nsw i32 %157, %158
  store i32 %159, ptr %21, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #7
  %160 = load i32, ptr %21, align 4, !tbaa !9
  %161 = load i32, ptr %19, align 4, !tbaa !9
  %162 = sub nsw i32 %160, %161
  %163 = sitofp i32 %162 to float
  %164 = load i32, ptr %20, align 4, !tbaa !9
  %165 = load i32, ptr %18, align 4, !tbaa !9
  %166 = sub nsw i32 %164, %165
  %167 = sitofp i32 %166 to float
  %168 = call noundef float @_ZSt5atan2ff(float noundef %163, float noundef %167)
  store float %168, ptr %30, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #7
  %169 = load float, ptr %24, align 4, !tbaa !11
  %170 = load float, ptr %30, align 4, !tbaa !11
  %171 = fsub float %169, %170
  %172 = call noundef float @_ZSt4fabsf(float noundef %171)
  store float %172, ptr %31, align 4, !tbaa !11
  %173 = load float, ptr %31, align 4, !tbaa !11
  %174 = fpext float %173 to double
  %175 = fcmp ogt double %174, 0x400921FB54442D18
  br i1 %175, label %176, label %181

176:                                              ; preds = %131
  %177 = load float, ptr %31, align 4, !tbaa !11
  %178 = fpext float %177 to double
  %179 = fsub double %178, 0x400921FB54442D18
  %180 = fptrunc double %179 to float
  store float %180, ptr %31, align 4, !tbaa !11
  br label %181

181:                                              ; preds = %176, %131
  %182 = load float, ptr %31, align 4, !tbaa !11
  %183 = fpext float %182 to double
  %184 = fsub double 0x3FF921FB54442D18, %183
  %185 = call double @llvm.fabs.f64(double %184)
  %186 = fptrunc double %185 to float
  store float %186, ptr %31, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #7
  %187 = load float, ptr %13, align 4, !tbaa !11
  %188 = load float, ptr %30, align 4, !tbaa !11
  %189 = fsub float %187, %188
  %190 = call noundef float @_ZSt4fabsf(float noundef %189)
  store float %190, ptr %32, align 4, !tbaa !11
  %191 = load float, ptr %32, align 4, !tbaa !11
  %192 = fpext float %191 to double
  %193 = fcmp ogt double %192, 0x400921FB54442D18
  br i1 %193, label %194, label %199

194:                                              ; preds = %181
  %195 = load float, ptr %32, align 4, !tbaa !11
  %196 = fpext float %195 to double
  %197 = fsub double %196, 0x400921FB54442D18
  %198 = fptrunc double %197 to float
  store float %198, ptr %32, align 4, !tbaa !11
  br label %199

199:                                              ; preds = %194, %181
  %200 = load float, ptr %32, align 4, !tbaa !11
  %201 = fpext float %200 to double
  %202 = fcmp ogt double %201, 0x3FF921FB54442D18
  br i1 %202, label %203, label %208

203:                                              ; preds = %199
  %204 = load float, ptr %32, align 4, !tbaa !11
  %205 = fpext float %204 to double
  %206 = fsub double 0x400921FB54442D18, %205
  %207 = fptrunc double %206 to float
  store float %207, ptr %32, align 4, !tbaa !11
  br label %208

208:                                              ; preds = %203, %199
  %209 = load ptr, ptr %25, align 8, !tbaa !5
  %210 = icmp eq ptr %209, null
  br i1 %210, label %212, label %211

211:                                              ; preds = %208
  call void @_ZdaPv(ptr noundef %209) #9
  br label %212

212:                                              ; preds = %211, %208
  %213 = load float, ptr %32, align 4, !tbaa !11
  store float %213, ptr %7, align 4
  store i32 1, ptr %28, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %214

214:                                              ; preds = %212, %52
  %215 = load float, ptr %7, align 4
  ret float %215
}

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #5

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #6

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nobuiltin allocsize(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 = { nobuiltin 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 #7 = { nounwind }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { builtin 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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !6, i64 16}
!16 = !{!"_ZTS12ImageContent", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK12ImageContent1xEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #1 align 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 @_ZSt5atan2ff(float noundef, float noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z5getXYPPfiiRiS1_(ptr noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noundef float @_Z12checkTangentP12ImageContentiiiif(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, float noundef %5) local_unnamed_addr #3 {
  %7 = alloca i32, align 4
  %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 = icmp slt i32 %3, 4
  br i1 %15, label %152, label %16

16:                                               ; preds = %6
  %17 = add nuw nsw i32 %3, 4
  %18 = tail call noundef i32 @_ZNK12ImageContent1xEv(ptr noundef nonnull align 8 dereferenceable(80) %0)
  %19 = icmp ugt i32 %17, %18
  %20 = icmp slt i32 %4, 4
  %or.cond = or i1 %20, %19
  br i1 %or.cond, label %152, label %21

21:                                               ; preds = %16
  %22 = add nuw nsw i32 %4, 4
  %23 = tail call noundef i32 @_ZNK12ImageContent1yEv(ptr noundef nonnull align 8 dereferenceable(80) %0)
  %24 = icmp ugt i32 %22, %23
  br i1 %24, label %152, label %.preheader57

.preheader57:                                     ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #6
  %25 = sub nsw i32 %1, %3
  %26 = sitofp i32 %25 to float
  %27 = sub nsw i32 %2, %4
  %28 = sitofp i32 %27 to float
  %29 = tail call noundef float @_ZSt5atan2ff(float noundef %28, float noundef %26)
  %30 = tail call noalias noundef nonnull dereferenceable(40) ptr @_Znam(i64 noundef 40) #7
  %31 = tail call noalias noundef nonnull dereferenceable(100) ptr @_Znam(i64 noundef 100) #7
  store ptr %31, ptr %30, align 8, !tbaa !5
  %32 = getelementptr inbounds i8, ptr %31, i64 20
  %33 = getelementptr inbounds i8, ptr %30, i64 8
  store ptr %32, ptr %33, align 8, !tbaa !5
  %34 = getelementptr inbounds i8, ptr %31, i64 40
  %35 = getelementptr inbounds i8, ptr %30, i64 16
  store ptr %34, ptr %35, align 8, !tbaa !5
  %36 = getelementptr inbounds i8, ptr %31, i64 60
  %37 = getelementptr inbounds i8, ptr %30, i64 24
  store ptr %36, ptr %37, align 8, !tbaa !5
  %38 = getelementptr inbounds i8, ptr %31, i64 80
  %39 = getelementptr inbounds i8, ptr %30, i64 32
  store ptr %38, ptr %39, align 8, !tbaa !5
  %40 = getelementptr inbounds i8, ptr %0, i64 16
  %41 = load ptr, ptr %40, align 8, !tbaa !9
  %42 = zext nneg i32 %3 to i64
  %43 = add nsw i64 %42, -2
  %44 = zext nneg i32 %4 to i64
  %45 = getelementptr ptr, ptr %41, i64 %44
  %46 = getelementptr i8, ptr %45, i64 -16
  %47 = load ptr, ptr %46, align 8, !tbaa !5
  %invariant.gep = getelementptr inbounds i8, ptr %31, i64 8
  %48 = getelementptr inbounds float, ptr %47, i64 %43
  %49 = load float, ptr %48, align 4, !tbaa !12
  store float %49, ptr %31, align 4, !tbaa !12
  %50 = add nsw i64 %42, -1
  %51 = getelementptr inbounds float, ptr %47, i64 %50
  %52 = load float, ptr %51, align 4, !tbaa !12
  %gep.1 = getelementptr inbounds i8, ptr %31, i64 4
  store float %52, ptr %gep.1, align 4, !tbaa !12
  %53 = getelementptr inbounds float, ptr %47, i64 %42
  %54 = load float, ptr %53, align 4, !tbaa !12
  store float %54, ptr %invariant.gep, align 4, !tbaa !12
  %55 = add nuw nsw i64 %42, 1
  %56 = getelementptr inbounds float, ptr %47, i64 %55
  %57 = load float, ptr %56, align 4, !tbaa !12
  %gep.3 = getelementptr inbounds i8, ptr %31, i64 12
  store float %57, ptr %gep.3, align 4, !tbaa !12
  %58 = add nuw nsw i64 %42, 2
  %59 = getelementptr inbounds float, ptr %47, i64 %58
  %60 = load float, ptr %59, align 4, !tbaa !12
  %gep.4 = getelementptr inbounds i8, ptr %31, i64 16
  store float %60, ptr %gep.4, align 4, !tbaa !12
  %61 = getelementptr ptr, ptr %41, i64 %44
  %62 = getelementptr i8, ptr %61, i64 -8
  %63 = load ptr, ptr %62, align 8, !tbaa !5
  %invariant.gep.1 = getelementptr inbounds i8, ptr %31, i64 28
  %64 = getelementptr inbounds float, ptr %63, i64 %43
  %65 = load float, ptr %64, align 4, !tbaa !12
  %gep.166 = getelementptr inbounds i8, ptr %31, i64 20
  store float %65, ptr %gep.166, align 4, !tbaa !12
  %66 = getelementptr inbounds float, ptr %63, i64 %50
  %67 = load float, ptr %66, align 4, !tbaa !12
  %gep.1.1 = getelementptr inbounds i8, ptr %31, i64 24
  store float %67, ptr %gep.1.1, align 4, !tbaa !12
  %68 = getelementptr inbounds float, ptr %63, i64 %42
  %69 = load float, ptr %68, align 4, !tbaa !12
  store float %69, ptr %invariant.gep.1, align 4, !tbaa !12
  %70 = getelementptr inbounds float, ptr %63, i64 %55
  %71 = load float, ptr %70, align 4, !tbaa !12
  %gep.3.1 = getelementptr inbounds i8, ptr %31, i64 32
  store float %71, ptr %gep.3.1, align 4, !tbaa !12
  %72 = getelementptr inbounds float, ptr %63, i64 %58
  %73 = load float, ptr %72, align 4, !tbaa !12
  %gep.4.1 = getelementptr inbounds i8, ptr %31, i64 36
  store float %73, ptr %gep.4.1, align 4, !tbaa !12
  %74 = getelementptr inbounds ptr, ptr %41, i64 %44
  %75 = load ptr, ptr %74, align 8, !tbaa !5
  %invariant.gep.2 = getelementptr inbounds i8, ptr %31, i64 48
  %76 = getelementptr inbounds float, ptr %75, i64 %43
  %77 = load float, ptr %76, align 4, !tbaa !12
  %gep.2 = getelementptr inbounds i8, ptr %31, i64 40
  store float %77, ptr %gep.2, align 4, !tbaa !12
  %78 = getelementptr inbounds float, ptr %75, i64 %50
  %79 = load float, ptr %78, align 4, !tbaa !12
  %gep.1.2 = getelementptr inbounds i8, ptr %31, i64 44
  store float %79, ptr %gep.1.2, align 4, !tbaa !12
  %80 = getelementptr inbounds float, ptr %75, i64 %42
  %81 = load float, ptr %80, align 4, !tbaa !12
  store float %81, ptr %invariant.gep.2, align 4, !tbaa !12
  %82 = getelementptr inbounds float, ptr %75, i64 %55
  %83 = load float, ptr %82, align 4, !tbaa !12
  %gep.3.2 = getelementptr inbounds i8, ptr %31, i64 52
  store float %83, ptr %gep.3.2, align 4, !tbaa !12
  %84 = getelementptr inbounds float, ptr %75, i64 %58
  %85 = load float, ptr %84, align 4, !tbaa !12
  %gep.4.2 = getelementptr inbounds i8, ptr %31, i64 56
  store float %85, ptr %gep.4.2, align 4, !tbaa !12
  %86 = getelementptr inbounds ptr, ptr %41, i64 %44
  %87 = getelementptr inbounds i8, ptr %86, i64 8
  %88 = load ptr, ptr %87, align 8, !tbaa !5
  %invariant.gep.3 = getelementptr inbounds i8, ptr %31, i64 68
  %89 = getelementptr inbounds float, ptr %88, i64 %43
  %90 = load float, ptr %89, align 4, !tbaa !12
  %gep.367 = getelementptr inbounds i8, ptr %31, i64 60
  store float %90, ptr %gep.367, align 4, !tbaa !12
  %91 = getelementptr inbounds float, ptr %88, i64 %50
  %92 = load float, ptr %91, align 4, !tbaa !12
  %gep.1.3 = getelementptr inbounds i8, ptr %31, i64 64
  store float %92, ptr %gep.1.3, align 4, !tbaa !12
  %93 = getelementptr inbounds float, ptr %88, i64 %42
  %94 = load float, ptr %93, align 4, !tbaa !12
  store float %94, ptr %invariant.gep.3, align 4, !tbaa !12
  %95 = getelementptr inbounds float, ptr %88, i64 %55
  %96 = load float, ptr %95, align 4, !tbaa !12
  %gep.3.3 = getelementptr inbounds i8, ptr %31, i64 72
  store float %96, ptr %gep.3.3, align 4, !tbaa !12
  %97 = getelementptr inbounds float, ptr %88, i64 %58
  %98 = load float, ptr %97, align 4, !tbaa !12
  %gep.4.3 = getelementptr inbounds i8, ptr %31, i64 76
  store float %98, ptr %gep.4.3, align 4, !tbaa !12
  %99 = getelementptr inbounds ptr, ptr %41, i64 %44
  %100 = getelementptr inbounds i8, ptr %99, i64 16
  %101 = load ptr, ptr %100, align 8, !tbaa !5
  %gep61.4 = getelementptr inbounds i8, ptr %30, i64 32
  %102 = load ptr, ptr %gep61.4, align 8, !tbaa !5
  %invariant.gep.4 = getelementptr i8, ptr %102, i64 8
  %103 = getelementptr inbounds float, ptr %101, i64 %43
  %104 = load float, ptr %103, align 4, !tbaa !12
  store float %104, ptr %102, align 4, !tbaa !12
  %105 = getelementptr inbounds float, ptr %101, i64 %50
  %106 = load float, ptr %105, align 4, !tbaa !12
  %gep.1.4 = getelementptr i8, ptr %102, i64 4
  store float %106, ptr %gep.1.4, align 4, !tbaa !12
  %107 = getelementptr inbounds float, ptr %101, i64 %42
  %108 = load float, ptr %107, align 4, !tbaa !12
  store float %108, ptr %invariant.gep.4, align 4, !tbaa !12
  %109 = getelementptr inbounds float, ptr %101, i64 %55
  %110 = load float, ptr %109, align 4, !tbaa !12
  %gep.3.4 = getelementptr i8, ptr %102, i64 12
  store float %110, ptr %gep.3.4, align 4, !tbaa !12
  %111 = getelementptr inbounds float, ptr %101, i64 %58
  %112 = load float, ptr %111, align 4, !tbaa !12
  %gep.4.4 = getelementptr i8, ptr %102, i64 16
  store float %112, ptr %gep.4.4, align 4, !tbaa !12
  %113 = load ptr, ptr %35, align 8, !tbaa !5
  %114 = getelementptr inbounds i8, ptr %113, i64 8
  store float 0.000000e+00, ptr %114, align 4, !tbaa !12
  call void @_Z5getXYPPfiiRiS1_(ptr noundef nonnull %30, i32 noundef 2, i32 noundef 2, ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
  call void @_Z5getXYPPfiiRiS1_(ptr noundef nonnull %30, i32 noundef 2, i32 noundef 2, ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %115 = load i32, ptr %7, align 4, !tbaa !14
  %116 = add nsw i32 %115, 2
  %117 = load i32, ptr %8, align 4, !tbaa !14
  %118 = add nsw i32 %117, 2
  call void @_Z5getXYPPfiiRiS1_(ptr noundef nonnull %30, i32 noundef %116, i32 noundef %118, ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %119 = load i32, ptr %9, align 4, !tbaa !14
  %120 = add nsw i32 %119, 2
  %121 = load i32, ptr %10, align 4, !tbaa !14
  %122 = add nsw i32 %121, 2
  call void @_Z5getXYPPfiiRiS1_(ptr noundef nonnull %30, i32 noundef %120, i32 noundef %122, ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %123 = load i32, ptr %7, align 4, !tbaa !14
  %124 = load i32, ptr %11, align 4, !tbaa !14
  %125 = add nsw i32 %124, %123
  store i32 %125, ptr %11, align 4, !tbaa !14
  %126 = load i32, ptr %8, align 4, !tbaa !14
  %127 = load i32, ptr %12, align 4, !tbaa !14
  %128 = add nsw i32 %127, %126
  store i32 %128, ptr %12, align 4, !tbaa !14
  %129 = load i32, ptr %9, align 4, !tbaa !14
  %130 = load i32, ptr %13, align 4, !tbaa !14
  %131 = add nsw i32 %130, %129
  store i32 %131, ptr %13, align 4, !tbaa !14
  %132 = load i32, ptr %10, align 4, !tbaa !14
  %133 = load i32, ptr %14, align 4, !tbaa !14
  %134 = add nsw i32 %133, %132
  store i32 %134, ptr %14, align 4, !tbaa !14
  %135 = sub nsw i32 %134, %128
  %136 = sitofp i32 %135 to float
  %137 = sub nsw i32 %131, %125
  %138 = sitofp i32 %137 to float
  %139 = call noundef float @_ZSt5atan2ff(float noundef %136, float noundef %138)
  %140 = fsub float %29, %139
  %141 = call noundef float @_ZSt4fabsf(float noundef %140)
  %142 = fsub float %5, %139
  %143 = call noundef float @_ZSt4fabsf(float noundef %142)
  %144 = fpext float %143 to double
  %145 = fcmp ogt double %144, 0x400921FB54442D18
  %146 = fadd double %144, 0xC00921FB54442D18
  %147 = fptrunc double %146 to float
  %.0 = select i1 %145, float %147, float %143
  %148 = fpext float %.0 to double
  %149 = fcmp ogt double %148, 0x3FF921FB54442D18
  %150 = fsub double 0x400921FB54442D18, %148
  %151 = fptrunc double %150 to float
  %.1 = select i1 %149, float %151, float %.0
  call void @_ZdaPv(ptr noundef nonnull %30) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  br label %152

152:                                              ; preds = %6, %16, %21, %.preheader57
  %.050 = phi float [ %.1, %.preheader57 ], [ 1.000000e+05, %21 ], [ 1.000000e+05, %16 ], [ 1.000000e+05, %6 ]
  ret float %.050
}

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #4

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #5

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress 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 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 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nobuiltin 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 #6 = { nounwind }
attributes #7 = { builtin allocsize(0) }
attributes #8 = { builtin 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, !6, i64 16}
!10 = !{!"_ZTS12ImageContent", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"float", !7, i64 0}
!14 = !{!11, !11, i64 0}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,LoopSimplifyPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass