; LLVM IR from ljm941004/HYPERCV_PUBLIC :: modules/process/src/c_src (gradient)

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

%struct.SIMPLE_MAT = type { i32, i32, i32, i32, i32, ptr }

@.str = external hidden unnamed_addr constant [8 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [16 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @hypercv_laplacian(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3) #0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %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 [3 x [3 x float]], align 16
  %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 ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca float, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  store i32 %3, ptr %8, align 4, !tbaa !9
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = icmp ne ptr %26, null
  br i1 %27, label %28, label %32

28:                                               ; preds = %4
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = icmp ne ptr %29, null
  br i1 %30, label %31, label %32

31:                                               ; preds = %28
  br label %36

32:                                               ; preds = %28, %4
  %33 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  %34 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  %35 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  call void @exit(i32 noundef 1) #7
  unreachable

36:                                               ; preds = %31
  %37 = load i32, ptr %7, align 4, !tbaa !9
  %38 = icmp sgt i32 %37, 0
  br i1 %38, label %39, label %40

39:                                               ; preds = %36
  br label %44

40:                                               ; preds = %36
  %41 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  %42 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  %43 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  call void @exit(i32 noundef 1) #7
  unreachable

44:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.SIMPLE_MAT, ptr %45, i32 0, i32 1
  %47 = load i32, ptr %46, align 4, !tbaa !11
  store i32 %47, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.SIMPLE_MAT, ptr %48, i32 0, i32 0
  %50 = load i32, ptr %49, align 8, !tbaa !13
  store i32 %50, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.SIMPLE_MAT, ptr %51, i32 0, i32 3
  %53 = load i32, ptr %52, align 4, !tbaa !14
  store i32 %53, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  %54 = load ptr, ptr %5, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.SIMPLE_MAT, ptr %54, i32 0, i32 2
  %56 = load i32, ptr %55, align 8, !tbaa !15
  store i32 %56, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 36, ptr %13) #8
  call void @llvm.memset.p0.i64(ptr align 16 %13, i8 0, i64 36, i1 false)
  %57 = getelementptr inbounds [3 x [3 x float]], ptr %13, i32 0, i32 0
  %58 = getelementptr inbounds [3 x float], ptr %57, i32 0, i32 1
  store float 1.000000e+00, ptr %58, align 4
  %59 = getelementptr inbounds [3 x [3 x float]], ptr %13, i32 0, i32 1
  %60 = getelementptr inbounds [3 x float], ptr %59, i32 0, i32 0
  store float 1.000000e+00, ptr %60, align 4
  %61 = getelementptr inbounds [3 x float], ptr %59, i32 0, i32 1
  store float -4.000000e+00, ptr %61, align 4
  %62 = getelementptr inbounds [3 x float], ptr %59, i32 0, i32 2
  store float 1.000000e+00, ptr %62, align 4
  %63 = getelementptr inbounds [3 x [3 x float]], ptr %13, i32 0, i32 2
  %64 = getelementptr inbounds [3 x float], ptr %63, i32 0, i32 1
  store float 1.000000e+00, ptr %64, align 4
  %65 = load i32, ptr %7, align 4, !tbaa !9
  %66 = icmp eq i32 %65, 2
  br i1 %66, label %67, label %100

67:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %68

68:                                               ; preds = %96, %67
  %69 = load i32, ptr %14, align 4, !tbaa !9
  %70 = icmp slt i32 %69, 3
  br i1 %70, label %72, label %71

71:                                               ; preds = %68
  store i32 2, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  br label %99

72:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %73

73:                                               ; preds = %92, %72
  %74 = load i32, ptr %16, align 4, !tbaa !9
  %75 = icmp slt i32 %74, 3
  br i1 %75, label %77, label %76

76:                                               ; preds = %73
  store i32 5, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  br label %95

77:                                               ; preds = %73
  %78 = load i32, ptr %14, align 4, !tbaa !9
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [3 x [3 x float]], ptr %13, i64 0, i64 %79
  %81 = load i32, ptr %16, align 4, !tbaa !9
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [3 x float], ptr %80, i64 0, i64 %82
  %84 = load float, ptr %83, align 4, !tbaa !16
  %85 = fmul float %84, 2.000000e+00
  %86 = load i32, ptr %14, align 4, !tbaa !9
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [3 x [3 x float]], ptr %13, i64 0, i64 %87
  %89 = load i32, ptr %16, align 4, !tbaa !9
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [3 x float], ptr %88, i64 0, i64 %90
  store float %85, ptr %91, align 4, !tbaa !16
  br label %92

92:                                               ; preds = %77
  %93 = load i32, ptr %16, align 4, !tbaa !9
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %16, align 4, !tbaa !9
  br label %73, !llvm.loop !18

95:                                               ; preds = %76
  br label %96

96:                                               ; preds = %95
  %97 = load i32, ptr %14, align 4, !tbaa !9
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %14, align 4, !tbaa !9
  br label %68, !llvm.loop !20

99:                                               ; preds = %71
  br label %100

100:                                              ; preds = %99, %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  %101 = load ptr, ptr %5, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.SIMPLE_MAT, ptr %101, i32 0, i32 5
  %103 = load ptr, ptr %102, align 8, !tbaa !21
  store ptr %103, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  %104 = load ptr, ptr %6, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.SIMPLE_MAT, ptr %104, i32 0, i32 5
  %106 = load ptr, ptr %105, align 8, !tbaa !21
  store ptr %106, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  store i32 0, ptr %21, align 4, !tbaa !9
  br label %107

107:                                              ; preds = %222, %100
  %108 = load i32, ptr %21, align 4, !tbaa !9
  %109 = load i32, ptr %10, align 4, !tbaa !9
  %110 = icmp slt i32 %108, %109
  br i1 %110, label %112, label %111

111:                                              ; preds = %107
  store i32 8, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  br label %225

112:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  store i32 0, ptr %22, align 4, !tbaa !9
  br label %113

113:                                              ; preds = %218, %112
  %114 = load i32, ptr %22, align 4, !tbaa !9
  %115 = load i32, ptr %9, align 4, !tbaa !9
  %116 = icmp slt i32 %114, %115
  br i1 %116, label %118, label %117

117:                                              ; preds = %113
  store i32 11, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  br label %221

118:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  store float 0.000000e+00, ptr %23, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  store i32 0, ptr %24, align 4, !tbaa !9
  br label %119

119:                                              ; preds = %204, %118
  %120 = load i32, ptr %24, align 4, !tbaa !9
  %121 = icmp slt i32 %120, 3
  br i1 %121, label %123, label %122

122:                                              ; preds = %119
  store i32 14, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  br label %207

123:                                              ; preds = %119
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #8
  store i32 0, ptr %25, align 4, !tbaa !9
  br label %124

124:                                              ; preds = %200, %123
  %125 = load i32, ptr %25, align 4, !tbaa !9
  %126 = icmp slt i32 %125, 3
  br i1 %126, label %128, label %127

127:                                              ; preds = %124
  store i32 17, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #8
  br label %203

128:                                              ; preds = %124
  %129 = load i32, ptr %21, align 4, !tbaa !9
  %130 = load i32, ptr %24, align 4, !tbaa !9
  %131 = add nsw i32 %129, %130
  %132 = sub nsw i32 %131, 1
  %133 = icmp slt i32 %132, 0
  br i1 %133, label %141, label %134

134:                                              ; preds = %128
  %135 = load i32, ptr %21, align 4, !tbaa !9
  %136 = load i32, ptr %24, align 4, !tbaa !9
  %137 = add nsw i32 %135, %136
  %138 = sub nsw i32 %137, 1
  %139 = load i32, ptr %10, align 4, !tbaa !9
  %140 = icmp sge i32 %138, %139
  br i1 %140, label %141, label %149

141:                                              ; preds = %134, %128
  %142 = load i32, ptr %21, align 4, !tbaa !9
  %143 = load i32, ptr %24, align 4, !tbaa !9
  %144 = add nsw i32 %142, %143
  %145 = sub nsw i32 %144, 1
  %146 = load i32, ptr %10, align 4, !tbaa !9
  %147 = load i32, ptr %8, align 4, !tbaa !9
  %148 = call i32 @hypercv_border_Interpolate(i32 noundef %145, i32 noundef %146, i32 noundef %147)
  store i32 %148, ptr %17, align 4, !tbaa !9
  br label %154

149:                                              ; preds = %134
  %150 = load i32, ptr %21, align 4, !tbaa !9
  %151 = load i32, ptr %24, align 4, !tbaa !9
  %152 = add nsw i32 %150, %151
  %153 = sub nsw i32 %152, 1
  store i32 %153, ptr %17, align 4, !tbaa !9
  br label %154

154:                                              ; preds = %149, %141
  %155 = load i32, ptr %22, align 4, !tbaa !9
  %156 = load i32, ptr %25, align 4, !tbaa !9
  %157 = add nsw i32 %155, %156
  %158 = sub nsw i32 %157, 1
  %159 = icmp slt i32 %158, 0
  br i1 %159, label %166, label %160

160:                                              ; preds = %154
  %161 = load i32, ptr %22, align 4, !tbaa !9
  %162 = load i32, ptr %25, align 4, !tbaa !9
  %163 = add nsw i32 %161, %162
  %164 = load i32, ptr %9, align 4, !tbaa !9
  %165 = icmp sgt i32 %163, %164
  br i1 %165, label %166, label %174

166:                                              ; preds = %160, %154
  %167 = load i32, ptr %22, align 4, !tbaa !9
  %168 = load i32, ptr %25, align 4, !tbaa !9
  %169 = add nsw i32 %167, %168
  %170 = sub nsw i32 %169, 1
  %171 = load i32, ptr %9, align 4, !tbaa !9
  %172 = load i32, ptr %8, align 4, !tbaa !9
  %173 = call i32 @hypercv_border_Interpolate(i32 noundef %170, i32 noundef %171, i32 noundef %172)
  store i32 %173, ptr %18, align 4, !tbaa !9
  br label %179

174:                                              ; preds = %160
  %175 = load i32, ptr %22, align 4, !tbaa !9
  %176 = load i32, ptr %25, align 4, !tbaa !9
  %177 = add nsw i32 %175, %176
  %178 = sub nsw i32 %177, 1
  store i32 %178, ptr %18, align 4, !tbaa !9
  br label %179

179:                                              ; preds = %174, %166
  %180 = load i32, ptr %24, align 4, !tbaa !9
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds [3 x [3 x float]], ptr %13, i64 0, i64 %181
  %183 = load i32, ptr %25, align 4, !tbaa !9
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [3 x float], ptr %182, i64 0, i64 %184
  %186 = load float, ptr %185, align 4, !tbaa !16
  %187 = load ptr, ptr %19, align 8, !tbaa !5
  %188 = load i32, ptr %17, align 4, !tbaa !9
  %189 = load i32, ptr %9, align 4, !tbaa !9
  %190 = mul nsw i32 %188, %189
  %191 = load i32, ptr %18, align 4, !tbaa !9
  %192 = add nsw i32 %190, %191
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds i8, ptr %187, i64 %193
  %195 = load i8, ptr %194, align 1, !tbaa !22
  %196 = zext i8 %195 to i32
  %197 = sitofp i32 %196 to float
  %198 = load float, ptr %23, align 4, !tbaa !16
  %199 = call float @llvm.fmuladd.f32(float %186, float %197, float %198)
  store float %199, ptr %23, align 4, !tbaa !16
  br label %200

200:                                              ; preds = %179
  %201 = load i32, ptr %25, align 4, !tbaa !9
  %202 = add nsw i32 %201, 1
  store i32 %202, ptr %25, align 4, !tbaa !9
  br label %124, !llvm.loop !23

203:                                              ; preds = %127
  br label %204

204:                                              ; preds = %203
  %205 = load i32, ptr %24, align 4, !tbaa !9
  %206 = add nsw i32 %205, 1
  store i32 %206, ptr %24, align 4, !tbaa !9
  br label %119, !llvm.loop !24

207:                                              ; preds = %122
  %208 = load float, ptr %23, align 4, !tbaa !16
  %209 = call zeroext i8 @saturate_cast_float2uchar(float noundef %208)
  %210 = load ptr, ptr %20, align 8, !tbaa !5
  %211 = load i32, ptr %21, align 4, !tbaa !9
  %212 = load i32, ptr %9, align 4, !tbaa !9
  %213 = mul nsw i32 %211, %212
  %214 = load i32, ptr %22, align 4, !tbaa !9
  %215 = add nsw i32 %213, %214
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds i8, ptr %210, i64 %216
  store i8 %209, ptr %217, align 1, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  br label %218

218:                                              ; preds = %207
  %219 = load i32, ptr %22, align 4, !tbaa !9
  %220 = add nsw i32 %219, 1
  store i32 %220, ptr %22, align 4, !tbaa !9
  br label %113, !llvm.loop !25

221:                                              ; preds = %117
  br label %222

222:                                              ; preds = %221
  %223 = load i32, ptr %21, align 4, !tbaa !9
  %224 = add nsw i32 %223, 1
  store i32 %224, ptr %21, align 4, !tbaa !9
  br label %107, !llvm.loop !26

225:                                              ; preds = %111
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 36, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  ret void
}

declare i32 @printf(ptr noundef, ...) #1

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #2

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @hypercv_border_Interpolate(i32 noundef, i32 noundef, i32 noundef) #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #6

; Function Attrs: nounwind uwtable
declare hidden zeroext i8 @saturate_cast_float2uchar(float noundef) #0

attributes #0 = { 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 = { "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 = { noreturn 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { inlinehint 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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { noreturn nounwind }
attributes #8 = { 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 4}
!12 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !6, i64 24}
!13 = !{!12, !10, i64 0}
!14 = !{!12, !10, i64 12}
!15 = !{!12, !10, i64 8}
!16 = !{!17, !17, i64 0}
!17 = !{!"float", !7, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = !{!12, !6, i64 24}
!22 = !{!7, !7, i64 0}
!23 = distinct !{!23, !19}
!24 = distinct !{!24, !19}
!25 = distinct !{!25, !19}
!26 = distinct !{!26, !19}


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

@.str = external hidden unnamed_addr constant [8 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [16 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @hypercv_laplacian(ptr noundef readonly %0, ptr noundef readonly %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #0 {
  %5 = icmp ne ptr %0, null
  %6 = icmp ne ptr %1, null
  %or.cond = and i1 %5, %6
  br i1 %or.cond, label %11, label %7

7:                                                ; preds = %4
  %8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  %9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  tail call void @exit(i32 noundef 1) #5
  unreachable

11:                                               ; preds = %4
  %12 = icmp sgt i32 %2, 0
  br i1 %12, label %.loopexit, label %13

13:                                               ; preds = %11
  %14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  %15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %16 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  tail call void @exit(i32 noundef 1) #5
  unreachable

.loopexit:                                        ; preds = %11
  %17 = getelementptr inbounds i8, ptr %0, i64 4
  %18 = load i32, ptr %17, align 4, !tbaa !5
  %19 = load i32, ptr %0, align 8, !tbaa !11
  %.fr = freeze i32 %19
  %20 = icmp eq i32 %2, 2
  %.sroa.5.0 = select i1 %20, float 2.000000e+00, float 1.000000e+00
  %.sroa.11.0 = select i1 %20, <2 x float> <float 2.000000e+00, float -8.000000e+00>, <2 x float> <float 1.000000e+00, float -4.000000e+00>
  %21 = getelementptr inbounds i8, ptr %0, i64 24
  %22 = load ptr, ptr %21, align 8, !tbaa !12
  %23 = getelementptr inbounds i8, ptr %1, i64 24
  %24 = load ptr, ptr %23, align 8, !tbaa !12
  %25 = icmp sgt i32 %.fr, 0
  %26 = icmp sgt i32 %18, 0
  %or.cond116 = select i1 %25, i1 %26, i1 false
  br i1 %or.cond116, label %.preheader80.us.preheader, label %._crit_edge91

.preheader80.us.preheader:                        ; preds = %.loopexit
  %27 = zext nneg i32 %18 to i64
  %28 = zext nneg i32 %.fr to i64
  %29 = zext nneg i32 %18 to i64
  %wide.trip.count114 = zext nneg i32 %.fr to i64
  %.sroa.11.12.vec.extract = extractelement <2 x float> %.sroa.11.0, i64 0
  %.sroa.11.16.vec.extract = extractelement <2 x float> %.sroa.11.0, i64 1
  %.sroa.11.12.vec.extract123 = extractelement <2 x float> %.sroa.11.0, i64 0
  %.sroa.11.16.vec.extract125 = extractelement <2 x float> %.sroa.11.0, i64 1
  br label %.preheader80.us

.preheader80.us:                                  ; preds = %.preheader80.us.preheader, %._crit_edge.us
  %indvars.iv111 = phi i64 [ 0, %.preheader80.us.preheader ], [ %indvars.iv.next112, %._crit_edge.us ]
  %30 = mul nuw nsw i64 %indvars.iv111, %29
  %invariant.gep = getelementptr inbounds i8, ptr %24, i64 %30
  %31 = add nsw i64 %indvars.iv111, -1
  %32 = add nsw i64 %indvars.iv111, -1
  %or.cond77.us.not = icmp ult i64 %32, %28
  %33 = trunc nsw i64 %31 to i32
  %34 = mul nsw i64 %31, %27
  %or.cond77.us.not.1 = icmp ult i64 %indvars.iv111, %28
  %35 = trunc nsw i64 %indvars.iv111 to i32
  %36 = mul nuw nsw i64 %indvars.iv111, %27
  %37 = getelementptr i8, ptr %22, i64 %36
  %38 = getelementptr i8, ptr %22, i64 %36
  %39 = add nuw nsw i64 %indvars.iv111, 1
  %40 = add nuw nsw i64 %indvars.iv111, 1
  %or.cond77.us.not.2 = icmp ult i64 %40, %28
  %41 = trunc nsw i64 %39 to i32
  %42 = mul nuw nsw i64 %39, %27
  br label %.preheader79.us

43:                                               ; preds = %.preheader.split.us98
  %44 = tail call i32 @hypercv_border_Interpolate(i32 noundef %63, i32 noundef %18, i32 noundef %3)
  br label %45

45:                                               ; preds = %43, %.preheader.split.us98
  %46 = getelementptr i8, ptr %65, i64 %34
  %47 = load i8, ptr %46, align 1, !tbaa !13
  %48 = uitofp i8 %47 to float
  %49 = tail call float @llvm.fmuladd.f32(float %.sroa.5.0, float %48, float 0.000000e+00)
  br i1 %67, label %50, label %.split.us92

50:                                               ; preds = %45
  %51 = tail call i32 @hypercv_border_Interpolate(i32 noundef %69, i32 noundef %18, i32 noundef %3)
  br label %.split.us92

.preheader.split.us.us.preheader:                 ; preds = %.preheader79.us
  %52 = tail call i32 @hypercv_border_Interpolate(i32 noundef %33, i32 noundef %.fr, i32 noundef %3)
  br i1 %53, label %143, label %.preheader.split.us.us.2

.preheader79.us:                                  ; preds = %.preheader80.us, %.split.us92.2
  %indvars.iv107 = phi i64 [ 0, %.preheader80.us ], [ %indvars.iv.next108, %.split.us92.2 ]
  %53 = icmp eq i64 %indvars.iv107, 0
  %54 = trunc i64 %indvars.iv107 to i32
  %55 = add i32 %54, -1
  %56 = trunc i64 %indvars.iv107 to i32
  %57 = trunc i64 %indvars.iv107 to i32
  %58 = add i32 %57, 2
  %59 = add i32 %57, 1
  %60 = icmp sgt i32 %58, %18
  %61 = icmp eq i64 %indvars.iv107, 0
  %62 = trunc i64 %indvars.iv107 to i32
  %63 = add i32 %62, -1
  %sext = shl i64 %indvars.iv107, 32
  %64 = ashr exact i64 %sext, 32
  %65 = getelementptr i8, ptr %22, i64 %64
  %66 = add nuw nsw i64 %indvars.iv107, 2
  %67 = icmp ugt i64 %66, %27
  %68 = trunc i64 %indvars.iv107 to i32
  %69 = add i32 %68, 1
  br i1 %or.cond77.us.not, label %.preheader.split.us98, label %.preheader.split.us.us.preheader

.preheader.split.us98:                            ; preds = %.preheader79.us
  br i1 %61, label %43, label %45

.split.us92:                                      ; preds = %.preheader.split.us.us.2, %154, %45, %50
  %.us-phi.us.in = phi float [ %49, %50 ], [ %49, %45 ], [ %152, %154 ], [ %152, %.preheader.split.us.us.2 ]
  %.us-phi.us = fadd float %.us-phi.us.in, 0.000000e+00
  br i1 %or.cond77.us.not.1, label %.preheader.split.us98.1, label %.preheader.split.us.us.preheader.1

.preheader.split.us.us.preheader.1:               ; preds = %.split.us92
  %70 = tail call i32 @hypercv_border_Interpolate(i32 noundef %35, i32 noundef %.fr, i32 noundef %3)
  br i1 %53, label %71, label %.preheader.split.us.us.2.1

71:                                               ; preds = %.preheader.split.us.us.preheader.1
  %72 = tail call i32 @hypercv_border_Interpolate(i32 noundef %55, i32 noundef %18, i32 noundef %3)
  br label %.preheader.split.us.us.2.1

.preheader.split.us.us.2.1:                       ; preds = %71, %.preheader.split.us.us.preheader.1
  %.067.us.us.1 = phi i32 [ %72, %71 ], [ %55, %.preheader.split.us.us.preheader.1 ]
  %73 = mul nsw i32 %70, %18
  %74 = add nsw i32 %.067.us.us.1, %73
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds i8, ptr %22, i64 %75
  %77 = load i8, ptr %76, align 1, !tbaa !13
  %78 = uitofp i8 %77 to float
  %79 = tail call float @llvm.fmuladd.f32(float %.sroa.11.12.vec.extract, float %78, float %.us-phi.us)
  %80 = tail call i32 @hypercv_border_Interpolate(i32 noundef %35, i32 noundef %.fr, i32 noundef %3)
  %81 = mul nsw i32 %80, %18
  %82 = add nsw i32 %81, %56
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds i8, ptr %22, i64 %83
  %85 = load i8, ptr %84, align 1, !tbaa !13
  %86 = uitofp i8 %85 to float
  %87 = tail call float @llvm.fmuladd.f32(float %.sroa.11.16.vec.extract, float %86, float %79)
  %88 = tail call i32 @hypercv_border_Interpolate(i32 noundef %35, i32 noundef %.fr, i32 noundef %3)
  br i1 %60, label %89, label %.split.us92.loopexit.1

89:                                               ; preds = %.preheader.split.us.us.2.1
  %90 = tail call i32 @hypercv_border_Interpolate(i32 noundef %59, i32 noundef %18, i32 noundef %3)
  br label %.split.us92.loopexit.1

.split.us92.loopexit.1:                           ; preds = %89, %.preheader.split.us.us.2.1
  %.067.us.us.2.1 = phi i32 [ %90, %89 ], [ %59, %.preheader.split.us.us.2.1 ]
  %91 = mul nsw i32 %88, %18
  %92 = add nsw i32 %.067.us.us.2.1, %91
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds i8, ptr %22, i64 %93
  %95 = load i8, ptr %94, align 1, !tbaa !13
  %96 = uitofp i8 %95 to float
  %97 = tail call float @llvm.fmuladd.f32(float %.sroa.5.0, float %96, float %87)
  br label %.split.us92.1

.preheader.split.us98.1:                          ; preds = %.split.us92
  br i1 %61, label %98, label %100

98:                                               ; preds = %.preheader.split.us98.1
  %99 = tail call i32 @hypercv_border_Interpolate(i32 noundef %63, i32 noundef %18, i32 noundef %3)
  br label %100

100:                                              ; preds = %98, %.preheader.split.us98.1
  %.067.us97.1 = phi i32 [ %99, %98 ], [ %63, %.preheader.split.us98.1 ]
  %101 = sext i32 %.067.us97.1 to i64
  %102 = getelementptr i8, ptr %37, i64 %101
  %103 = load i8, ptr %102, align 1, !tbaa !13
  %104 = uitofp i8 %103 to float
  %105 = tail call float @llvm.fmuladd.f32(float %.sroa.11.12.vec.extract123, float %104, float %.us-phi.us)
  %106 = getelementptr i8, ptr %65, i64 %36
  %107 = load i8, ptr %106, align 1, !tbaa !13
  %108 = uitofp i8 %107 to float
  %109 = tail call float @llvm.fmuladd.f32(float %.sroa.11.16.vec.extract125, float %108, float %105)
  br i1 %67, label %110, label %.split.us92.loopexit99.1

110:                                              ; preds = %100
  %111 = tail call i32 @hypercv_border_Interpolate(i32 noundef %69, i32 noundef %18, i32 noundef %3)
  br label %.split.us92.loopexit99.1

.split.us92.loopexit99.1:                         ; preds = %110, %100
  %.067.us97.2.1 = phi i32 [ %111, %110 ], [ %69, %100 ]
  %112 = sext i32 %.067.us97.2.1 to i64
  %113 = getelementptr i8, ptr %38, i64 %112
  %114 = load i8, ptr %113, align 1, !tbaa !13
  %115 = uitofp i8 %114 to float
  %116 = tail call float @llvm.fmuladd.f32(float %.sroa.5.0, float %115, float %109)
  br label %.split.us92.1

.split.us92.1:                                    ; preds = %.split.us92.loopexit99.1, %.split.us92.loopexit.1
  %.us-phi.us.1 = phi float [ %97, %.split.us92.loopexit.1 ], [ %116, %.split.us92.loopexit99.1 ]
  br i1 %or.cond77.us.not.2, label %.preheader.split.us98.2, label %.preheader.split.us.us.preheader.2

.preheader.split.us.us.preheader.2:               ; preds = %.split.us92.1
  %117 = tail call i32 @hypercv_border_Interpolate(i32 noundef %41, i32 noundef %.fr, i32 noundef %3)
  br i1 %53, label %118, label %.preheader.split.us.us.2.2

118:                                              ; preds = %.preheader.split.us.us.preheader.2
  %119 = tail call i32 @hypercv_border_Interpolate(i32 noundef %55, i32 noundef %18, i32 noundef %3)
  br label %.preheader.split.us.us.2.2

.preheader.split.us.us.2.2:                       ; preds = %118, %.preheader.split.us.us.preheader.2
  %120 = fadd float %.us-phi.us.1, 0.000000e+00
  %121 = tail call i32 @hypercv_border_Interpolate(i32 noundef %41, i32 noundef %.fr, i32 noundef %3)
  %122 = mul nsw i32 %121, %18
  %123 = add nsw i32 %122, %56
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds i8, ptr %22, i64 %124
  %126 = load i8, ptr %125, align 1, !tbaa !13
  %127 = uitofp i8 %126 to float
  %128 = tail call float @llvm.fmuladd.f32(float %.sroa.5.0, float %127, float %120)
  %129 = tail call i32 @hypercv_border_Interpolate(i32 noundef %41, i32 noundef %.fr, i32 noundef %3)
  br i1 %60, label %130, label %.split.us92.2

130:                                              ; preds = %.preheader.split.us.us.2.2
  %131 = tail call i32 @hypercv_border_Interpolate(i32 noundef %59, i32 noundef %18, i32 noundef %3)
  br label %.split.us92.2

.preheader.split.us98.2:                          ; preds = %.split.us92.1
  br i1 %61, label %132, label %134

132:                                              ; preds = %.preheader.split.us98.2
  %133 = tail call i32 @hypercv_border_Interpolate(i32 noundef %63, i32 noundef %18, i32 noundef %3)
  br label %134

134:                                              ; preds = %132, %.preheader.split.us98.2
  %135 = fadd float %.us-phi.us.1, 0.000000e+00
  %136 = getelementptr i8, ptr %65, i64 %42
  %137 = load i8, ptr %136, align 1, !tbaa !13
  %138 = uitofp i8 %137 to float
  %139 = tail call float @llvm.fmuladd.f32(float %.sroa.5.0, float %138, float %135)
  br i1 %67, label %140, label %.split.us92.2

140:                                              ; preds = %134
  %141 = tail call i32 @hypercv_border_Interpolate(i32 noundef %69, i32 noundef %18, i32 noundef %3)
  br label %.split.us92.2

.split.us92.2:                                    ; preds = %134, %140, %.preheader.split.us.us.2.2, %130
  %.us-phi.us.2.in = phi float [ %128, %130 ], [ %128, %.preheader.split.us.us.2.2 ], [ %139, %140 ], [ %139, %134 ]
  %.us-phi.us.2 = fadd float %.us-phi.us.2.in, 0.000000e+00
  %142 = tail call zeroext i8 @saturate_cast_float2uchar(float noundef %.us-phi.us.2)
  %gep = getelementptr inbounds i8, ptr %invariant.gep, i64 %indvars.iv107
  store i8 %142, ptr %gep, align 1, !tbaa !13
  %indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1
  %exitcond110.not = icmp eq i64 %indvars.iv.next108, %29
  br i1 %exitcond110.not, label %._crit_edge.us, label %.preheader79.us, !llvm.loop !14

143:                                              ; preds = %.preheader.split.us.us.preheader
  %144 = tail call i32 @hypercv_border_Interpolate(i32 noundef %55, i32 noundef %18, i32 noundef %3)
  br label %.preheader.split.us.us.2

.preheader.split.us.us.2:                         ; preds = %143, %.preheader.split.us.us.preheader
  %145 = tail call i32 @hypercv_border_Interpolate(i32 noundef %33, i32 noundef %.fr, i32 noundef %3)
  %146 = mul nsw i32 %145, %18
  %147 = add nsw i32 %146, %56
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds i8, ptr %22, i64 %148
  %150 = load i8, ptr %149, align 1, !tbaa !13
  %151 = uitofp i8 %150 to float
  %152 = tail call float @llvm.fmuladd.f32(float %.sroa.5.0, float %151, float 0.000000e+00)
  %153 = tail call i32 @hypercv_border_Interpolate(i32 noundef %33, i32 noundef %.fr, i32 noundef %3)
  br i1 %60, label %154, label %.split.us92

154:                                              ; preds = %.preheader.split.us.us.2
  %155 = tail call i32 @hypercv_border_Interpolate(i32 noundef %59, i32 noundef %18, i32 noundef %3)
  br label %.split.us92

._crit_edge.us:                                   ; preds = %.split.us92.2
  %indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1
  %exitcond115.not = icmp eq i64 %indvars.iv.next112, %wide.trip.count114
  br i1 %exitcond115.not, label %._crit_edge91, label %.preheader80.us, !llvm.loop !16

._crit_edge91:                                    ; preds = %._crit_edge.us, %.loopexit
  ret void
}

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @hypercv_border_Interpolate(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #4

; Function Attrs: nounwind uwtable
declare hidden zeroext i8 @saturate_cast_float2uchar(float noundef) local_unnamed_addr #0

attributes #0 = { 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 = { nofree 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 #2 = { noreturn 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 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 nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { noreturn 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 4}
!6 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !10, i64 24}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 0}
!12 = !{!6, !10, i64 24}
!13 = !{!8, !8, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalDCEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass