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

; 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.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [15 x i8], align 1

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

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

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

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

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

declare ptr @create_simple_mat(i32 noundef, i32 noundef, i32 noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
define dso_local ptr @hypercv_copy_make_border(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i8 noundef zeroext %6) #4 {
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %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 i8, align 1
  %16 = alloca ptr, align 8
  %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 i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca ptr, align 8
  %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 i32, align 4
  store ptr %0, ptr %9, align 8, !tbaa !5
  store i32 %1, ptr %10, align 4, !tbaa !9
  store i32 %2, ptr %11, align 4, !tbaa !9
  store i32 %3, ptr %12, align 4, !tbaa !9
  store i32 %4, ptr %13, align 4, !tbaa !9
  store i32 %5, ptr %14, align 4, !tbaa !9
  store i8 %6, ptr %15, align 1, !tbaa !11
  %31 = load ptr, ptr %9, align 8, !tbaa !5
  %32 = icmp ne ptr %31, null
  br i1 %32, label %33, label %34

33:                                               ; preds = %7
  br label %38

34:                                               ; preds = %7
  %35 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  %36 = call i32 (ptr, ...) @printf(ptr noundef @.str.18)
  %37 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  call void @exit(i32 noundef 1) #5
  unreachable

38:                                               ; preds = %33
  %39 = load i32, ptr %12, align 4, !tbaa !9
  %40 = icmp sge i32 %39, 0
  br i1 %40, label %41, label %51

41:                                               ; preds = %38
  %42 = load i32, ptr %13, align 4, !tbaa !9
  %43 = icmp sge i32 %42, 0
  br i1 %43, label %44, label %51

44:                                               ; preds = %41
  %45 = load i32, ptr %10, align 4, !tbaa !9
  %46 = icmp sge i32 %45, 0
  br i1 %46, label %47, label %51

47:                                               ; preds = %44
  %48 = load i32, ptr %11, align 4, !tbaa !9
  %49 = icmp sge i32 %48, 0
  br i1 %49, label %50, label %51

50:                                               ; preds = %47
  br label %55

51:                                               ; preds = %47, %44, %41, %38
  %52 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  %53 = call i32 (ptr, ...) @printf(ptr noundef @.str.19)
  %54 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  call void @exit(i32 noundef 1) #5
  unreachable

55:                                               ; preds = %50
  %56 = load i32, ptr %14, align 4, !tbaa !9
  %57 = icmp eq i32 %56, 2
  br i1 %57, label %70, label %58

58:                                               ; preds = %55
  %59 = load i32, ptr %14, align 4, !tbaa !9
  %60 = icmp eq i32 %59, 4
  br i1 %60, label %70, label %61

61:                                               ; preds = %58
  %62 = load i32, ptr %14, align 4, !tbaa !9
  %63 = icmp eq i32 %62, 1
  br i1 %63, label %70, label %64

64:                                               ; preds = %61
  %65 = load i32, ptr %14, align 4, !tbaa !9
  %66 = icmp eq i32 %65, 3
  br i1 %66, label %70, label %67

67:                                               ; preds = %64
  %68 = load i32, ptr %14, align 4, !tbaa !9
  %69 = icmp eq i32 %68, 0
  br i1 %69, label %70, label %71

70:                                               ; preds = %67, %64, %61, %58, %55
  br label %75

71:                                               ; preds = %67
  %72 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  %73 = call i32 (ptr, ...) @printf(ptr noundef @.str.11)
  %74 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  call void @exit(i32 noundef 1) #5
  unreachable

75:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %76 = load i32, ptr %10, align 4, !tbaa !9
  %77 = icmp eq i32 %76, 0
  br i1 %77, label %78, label %91

78:                                               ; preds = %75
  %79 = load i32, ptr %12, align 4, !tbaa !9
  %80 = icmp eq i32 %79, 0
  br i1 %80, label %81, label %91

81:                                               ; preds = %78
  %82 = load i32, ptr %11, align 4, !tbaa !9
  %83 = icmp eq i32 %82, 0
  br i1 %83, label %84, label %91

84:                                               ; preds = %81
  %85 = load i32, ptr %13, align 4, !tbaa !9
  %86 = icmp eq i32 %85, 0
  br i1 %86, label %87, label %91

87:                                               ; preds = %84
  %88 = load ptr, ptr %9, align 8, !tbaa !5
  %89 = call ptr @simple_mat_copy(ptr noundef %88)
  store ptr %89, ptr %16, align 8, !tbaa !5
  %90 = load ptr, ptr %16, align 8, !tbaa !5
  store ptr %90, ptr %8, align 8
  store i32 1, ptr %17, align 4
  br label %223

91:                                               ; preds = %84, %81, %78, %75
  %92 = load ptr, ptr %9, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.SIMPLE_MAT, ptr %92, i32 0, i32 0
  %94 = load i32, ptr %93, align 8, !tbaa !12
  %95 = load i32, ptr %10, align 4, !tbaa !9
  %96 = add nsw i32 %94, %95
  %97 = load i32, ptr %11, align 4, !tbaa !9
  %98 = add nsw i32 %96, %97
  %99 = load ptr, ptr %9, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.SIMPLE_MAT, ptr %99, i32 0, i32 1
  %101 = load i32, ptr %100, align 4, !tbaa !14
  %102 = load i32, ptr %12, align 4, !tbaa !9
  %103 = add nsw i32 %101, %102
  %104 = load i32, ptr %13, align 4, !tbaa !9
  %105 = add nsw i32 %103, %104
  %106 = load ptr, ptr %9, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.SIMPLE_MAT, ptr %106, i32 0, i32 2
  %108 = load i32, ptr %107, align 8, !tbaa !15
  %109 = load ptr, ptr %9, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.SIMPLE_MAT, ptr %109, i32 0, i32 3
  %111 = load i32, ptr %110, align 4, !tbaa !16
  %112 = call ptr @create_simple_mat(i32 noundef %98, i32 noundef %105, i32 noundef %108, i32 noundef %111)
  store ptr %112, ptr %16, align 8, !tbaa !5
  %113 = load i32, ptr %14, align 4, !tbaa !9
  %114 = icmp eq i32 %113, 0
  br i1 %114, label %115, label %125

115:                                              ; preds = %91
  %116 = load ptr, ptr %9, align 8, !tbaa !5
  %117 = load ptr, ptr %16, align 8, !tbaa !5
  %118 = load i32, ptr %10, align 4, !tbaa !9
  %119 = load i32, ptr %11, align 4, !tbaa !9
  %120 = load i32, ptr %12, align 4, !tbaa !9
  %121 = load i32, ptr %13, align 4, !tbaa !9
  %122 = load i32, ptr %14, align 4, !tbaa !9
  %123 = load i8, ptr %15, align 1, !tbaa !11
  call void @hypercv_make_const_border(ptr noundef %116, ptr noundef %117, i32 noundef %118, i32 noundef %119, i32 noundef %120, i32 noundef %121, i32 noundef %122, i8 noundef zeroext %123)
  %124 = load ptr, ptr %16, align 8, !tbaa !5
  store ptr %124, ptr %8, align 8
  store i32 1, ptr %17, align 4
  br label %223

125:                                              ; preds = %91
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %126 = load ptr, ptr %16, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.SIMPLE_MAT, ptr %126, i32 0, i32 0
  %128 = load i32, ptr %127, align 8, !tbaa !12
  store i32 %128, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %129 = load ptr, ptr %16, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.SIMPLE_MAT, ptr %129, i32 0, i32 1
  %131 = load i32, ptr %130, align 4, !tbaa !14
  store i32 %131, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %132 = load ptr, ptr %16, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.SIMPLE_MAT, ptr %132, i32 0, i32 3
  %134 = load i32, ptr %133, align 4, !tbaa !16
  store i32 %134, ptr %20, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  %135 = load ptr, ptr %16, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.SIMPLE_MAT, ptr %135, i32 0, i32 2
  %137 = load i32, ptr %136, align 8, !tbaa !15
  %138 = call i32 @get_elemsize(i32 noundef %137)
  store i32 %138, ptr %21, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  %139 = load ptr, ptr %9, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.SIMPLE_MAT, ptr %139, i32 0, i32 0
  %141 = load i32, ptr %140, align 8, !tbaa !12
  store i32 %141, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  %142 = load ptr, ptr %9, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.SIMPLE_MAT, ptr %142, i32 0, i32 1
  %144 = load i32, ptr %143, align 4, !tbaa !14
  store i32 %144, ptr %23, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  %145 = load ptr, ptr %16, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.SIMPLE_MAT, ptr %145, i32 0, i32 5
  %147 = load ptr, ptr %146, align 8, !tbaa !17
  store ptr %147, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  %148 = load ptr, ptr %9, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.SIMPLE_MAT, ptr %148, i32 0, i32 5
  %150 = load ptr, ptr %149, align 8, !tbaa !17
  store ptr %150, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #6
  store i32 0, ptr %26, align 4, !tbaa !9
  br label %151

151:                                              ; preds = %218, %125
  %152 = load i32, ptr %26, align 4, !tbaa !9
  %153 = load i32, ptr %18, align 4, !tbaa !9
  %154 = icmp slt i32 %152, %153
  br i1 %154, label %156, label %155

155:                                              ; preds = %151
  store i32 2, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #6
  br label %221

156:                                              ; preds = %151
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #6
  store i32 0, ptr %27, align 4, !tbaa !9
  br label %157

157:                                              ; preds = %214, %156
  %158 = load i32, ptr %27, align 4, !tbaa !9
  %159 = load i32, ptr %19, align 4, !tbaa !9
  %160 = icmp slt i32 %158, %159
  br i1 %160, label %162, label %161

161:                                              ; preds = %157
  store i32 5, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #6
  br label %217

162:                                              ; preds = %157
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #6
  %163 = load i32, ptr %27, align 4, !tbaa !9
  %164 = load i32, ptr %12, align 4, !tbaa !9
  %165 = sub nsw i32 %163, %164
  %166 = load i32, ptr %23, align 4, !tbaa !9
  %167 = load i32, ptr %14, align 4, !tbaa !9
  %168 = call i32 @hypercv_border_Interpolate(i32 noundef %165, i32 noundef %166, i32 noundef %167)
  store i32 %168, ptr %29, align 4, !tbaa !9
  %169 = load i32, ptr %26, align 4, !tbaa !9
  %170 = load i32, ptr %10, align 4, !tbaa !9
  %171 = sub nsw i32 %169, %170
  %172 = load i32, ptr %22, align 4, !tbaa !9
  %173 = load i32, ptr %14, align 4, !tbaa !9
  %174 = call i32 @hypercv_border_Interpolate(i32 noundef %171, i32 noundef %172, i32 noundef %173)
  store i32 %174, ptr %28, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #6
  store i32 0, ptr %30, align 4, !tbaa !9
  br label %175

175:                                              ; preds = %210, %162
  %176 = load i32, ptr %30, align 4, !tbaa !9
  %177 = load i32, ptr %20, align 4, !tbaa !9
  %178 = icmp slt i32 %176, %177
  br i1 %178, label %180, label %179

179:                                              ; preds = %175
  store i32 8, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #6
  br label %213

180:                                              ; preds = %175
  %181 = load ptr, ptr %25, align 8, !tbaa !5
  %182 = load i32, ptr %28, align 4, !tbaa !9
  %183 = load i32, ptr %23, align 4, !tbaa !9
  %184 = mul nsw i32 %182, %183
  %185 = load i32, ptr %20, align 4, !tbaa !9
  %186 = mul nsw i32 %184, %185
  %187 = load i32, ptr %29, align 4, !tbaa !9
  %188 = load i32, ptr %20, align 4, !tbaa !9
  %189 = mul nsw i32 %187, %188
  %190 = add nsw i32 %186, %189
  %191 = load i32, ptr %30, align 4, !tbaa !9
  %192 = add nsw i32 %190, %191
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds i8, ptr %181, i64 %193
  %195 = load i8, ptr %194, align 1, !tbaa !11
  %196 = load ptr, ptr %24, align 8, !tbaa !5
  %197 = load i32, ptr %26, align 4, !tbaa !9
  %198 = load i32, ptr %19, align 4, !tbaa !9
  %199 = mul nsw i32 %197, %198
  %200 = load i32, ptr %20, align 4, !tbaa !9
  %201 = mul nsw i32 %199, %200
  %202 = load i32, ptr %27, align 4, !tbaa !9
  %203 = load i32, ptr %20, align 4, !tbaa !9
  %204 = mul nsw i32 %202, %203
  %205 = add nsw i32 %201, %204
  %206 = load i32, ptr %30, align 4, !tbaa !9
  %207 = add nsw i32 %205, %206
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds i8, ptr %196, i64 %208
  store i8 %195, ptr %209, align 1, !tbaa !11
  br label %210

210:                                              ; preds = %180
  %211 = load i32, ptr %30, align 4, !tbaa !9
  %212 = add nsw i32 %211, 1
  store i32 %212, ptr %30, align 4, !tbaa !9
  br label %175, !llvm.loop !18

213:                                              ; preds = %179
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #6
  br label %214

214:                                              ; preds = %213
  %215 = load i32, ptr %27, align 4, !tbaa !9
  %216 = add nsw i32 %215, 1
  store i32 %216, ptr %27, align 4, !tbaa !9
  br label %157, !llvm.loop !20

217:                                              ; preds = %161
  br label %218

218:                                              ; preds = %217
  %219 = load i32, ptr %26, align 4, !tbaa !9
  %220 = add nsw i32 %219, 1
  store i32 %220, ptr %26, align 4, !tbaa !9
  br label %151, !llvm.loop !21

221:                                              ; preds = %155
  %222 = load ptr, ptr %16, align 8, !tbaa !5
  store ptr %222, ptr %8, align 8
  store i32 1, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %223

223:                                              ; preds = %221, %115, %87
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  %224 = load ptr, ptr %8, align 8
  ret ptr %224
}

declare ptr @simple_mat_copy(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @hypercv_make_const_border(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i8 noundef zeroext) #4

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

attributes #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 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #5 = { noreturn nounwind }
attributes #6 = { 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 = !{!7, !7, i64 0}
!12 = !{!13, !10, i64 0}
!13 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !6, i64 24}
!14 = !{!13, !10, i64 4}
!15 = !{!13, !10, i64 8}
!16 = !{!13, !10, i64 12}
!17 = !{!13, !6, i64 24}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = distinct !{!21, !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.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [15 x i8], align 1

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

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

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

declare ptr @create_simple_mat(i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local ptr @hypercv_copy_make_border(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i8 noundef zeroext %6) local_unnamed_addr #4 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %8, label %12

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

12:                                               ; preds = %7
  %13 = or i32 %2, %1
  %14 = or i32 %13, %3
  %15 = or i32 %14, %4
  %or.cond5 = icmp sgt i32 %15, -1
  br i1 %or.cond5, label %20, label %16

16:                                               ; preds = %12
  %17 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  %18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.19)
  %19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  tail call void @exit(i32 noundef 1) #5
  unreachable

20:                                               ; preds = %12
  %21 = icmp eq i32 %5, 0
  %or.cond13 = icmp ult i32 %5, 5
  br i1 %or.cond13, label %26, label %22

22:                                               ; preds = %20
  %23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  %24 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11)
  %25 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  tail call void @exit(i32 noundef 1) #5
  unreachable

26:                                               ; preds = %20
  %or.cond19 = icmp eq i32 %15, 0
  br i1 %or.cond19, label %27, label %29

27:                                               ; preds = %26
  %28 = tail call ptr @simple_mat_copy(ptr noundef nonnull %0) #6
  br label %.loopexit

29:                                               ; preds = %26
  %30 = load i32, ptr %0, align 8, !tbaa !5
  %31 = add i32 %2, %1
  %32 = add i32 %31, %30
  %33 = getelementptr inbounds i8, ptr %0, i64 4
  %34 = load i32, ptr %33, align 4, !tbaa !11
  %35 = add i32 %4, %3
  %36 = add i32 %35, %34
  %37 = getelementptr inbounds i8, ptr %0, i64 8
  %38 = load i32, ptr %37, align 8, !tbaa !12
  %39 = getelementptr inbounds i8, ptr %0, i64 12
  %40 = load i32, ptr %39, align 4, !tbaa !13
  %41 = tail call ptr @create_simple_mat(i32 noundef %32, i32 noundef %36, i32 noundef %38, i32 noundef %40) #6
  br i1 %21, label %42, label %43

42:                                               ; preds = %29
  tail call void @hypercv_make_const_border(ptr noundef nonnull %0, ptr noundef %41, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef 0, i8 noundef zeroext %6)
  br label %.loopexit

43:                                               ; preds = %29
  %44 = load i32, ptr %41, align 8, !tbaa !5
  %45 = getelementptr inbounds i8, ptr %41, i64 4
  %46 = load i32, ptr %45, align 4, !tbaa !11
  %47 = getelementptr inbounds i8, ptr %41, i64 12
  %48 = load i32, ptr %47, align 4, !tbaa !13
  %.fr112 = freeze i32 %48
  %49 = getelementptr inbounds i8, ptr %41, i64 8
  %50 = load i32, ptr %49, align 8, !tbaa !12
  %51 = tail call i32 @get_elemsize(i32 noundef %50)
  %52 = load i32, ptr %0, align 8, !tbaa !5
  %53 = load i32, ptr %33, align 4, !tbaa !11
  %54 = getelementptr inbounds i8, ptr %41, i64 24
  %55 = load ptr, ptr %54, align 8, !tbaa !14
  %56 = ptrtoint ptr %55 to i64
  %57 = getelementptr inbounds i8, ptr %0, i64 24
  %58 = load ptr, ptr %57, align 8, !tbaa !14
  %59 = ptrtoint ptr %58 to i64
  %60 = icmp sgt i32 %44, 0
  %61 = icmp sgt i32 %46, 0
  %or.cond = select i1 %60, i1 %61, i1 false
  br i1 %or.cond, label %.preheader.lr.ph.split.us, label %.loopexit

.preheader.lr.ph.split.us:                        ; preds = %43
  %62 = icmp sgt i32 %.fr112, 0
  br i1 %62, label %.preheader.us.us.preheader, label %.preheader.us

.preheader.us.us.preheader:                       ; preds = %.preheader.lr.ph.split.us
  %63 = zext nneg i32 %46 to i64
  %wide.trip.count127 = zext nneg i32 %44 to i64
  %wide.trip.count = zext nneg i32 %.fr112 to i64
  %64 = mul i32 %.fr112, %46
  %65 = zext i32 %64 to i64
  %min.iters.check = icmp ult i32 %.fr112, 8
  %min.iters.check133 = icmp ult i32 %.fr112, 32
  %n.vec = and i64 %wide.trip.count, 2147483616
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  %n.vec.remaining = and i64 %wide.trip.count, 24
  %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
  %n.vec136 = and i64 %wide.trip.count, 2147483640
  %cmp.n140 = icmp eq i64 %n.vec136, %wide.trip.count
  %xtraiter = and i64 %wide.trip.count, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.preheader.us.us

.preheader.us.us:                                 ; preds = %.preheader.us.us.preheader, %._crit_edge107.split.us.us.us
  %indvars.iv124 = phi i64 [ 0, %.preheader.us.us.preheader ], [ %indvars.iv.next125, %._crit_edge107.split.us.us.us ]
  %66 = mul i64 %indvars.iv124, %65
  %67 = mul nuw nsw i64 %indvars.iv124, %63
  %68 = trunc i64 %indvars.iv124 to i32
  %69 = sub i32 %68, %1
  br label %iter.check

iter.check:                                       ; preds = %._crit_edge.us.us.us, %.preheader.us.us
  %indvars.iv119 = phi i64 [ %indvars.iv.next120, %._crit_edge.us.us.us ], [ 0, %.preheader.us.us ]
  %70 = trunc i64 %indvars.iv119 to i32
  %71 = sub i32 %70, %3
  %72 = tail call i32 @hypercv_border_Interpolate(i32 noundef %71, i32 noundef %53, i32 noundef %5)
  %73 = tail call i32 @hypercv_border_Interpolate(i32 noundef %69, i32 noundef %52, i32 noundef %5)
  %74 = mul nsw i32 %73, %53
  %75 = add i32 %74, %72
  %76 = mul i32 %75, %.fr112
  %77 = add nuw nsw i64 %indvars.iv119, %67
  %78 = trunc nuw i64 %77 to i32
  %79 = mul i32 %.fr112, %78
  %80 = sext i32 %76 to i64
  %81 = sext i32 %79 to i64
  %invariant.gep = getelementptr i8, ptr %58, i64 %80
  %invariant.gep130 = getelementptr i8, ptr %55, i64 %81
  br i1 %min.iters.check, label %vec.epilog.scalar.ph.preheader, label %vector.memcheck

vector.memcheck:                                  ; preds = %iter.check
  %82 = mul i64 %indvars.iv119, %wide.trip.count
  %83 = add i64 %66, %82
  %sext = shl i64 %83, 32
  %84 = ashr exact i64 %sext, 32
  %85 = add i64 %84, %56
  %86 = add i64 %59, %80
  %87 = sub i64 %85, %86
  %diff.check = icmp ult i64 %87, 32
  br i1 %diff.check, label %vec.epilog.scalar.ph.preheader, label %vector.main.loop.iter.check

vector.main.loop.iter.check:                      ; preds = %vector.memcheck
  br i1 %min.iters.check133, label %vec.epilog.ph, label %vector.body

vector.body:                                      ; preds = %vector.main.loop.iter.check, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %vector.main.loop.iter.check ]
  %88 = getelementptr i8, ptr %invariant.gep, i64 %index
  %89 = getelementptr i8, ptr %88, i64 16
  %wide.load = load <16 x i8>, ptr %88, align 1, !tbaa !15
  %wide.load134 = load <16 x i8>, ptr %89, align 1, !tbaa !15
  %90 = getelementptr i8, ptr %invariant.gep130, i64 %index
  %91 = getelementptr i8, ptr %90, i64 16
  store <16 x i8> %wide.load, ptr %90, align 1, !tbaa !15
  store <16 x i8> %wide.load134, ptr %91, align 1, !tbaa !15
  %index.next = add nuw i64 %index, 32
  %92 = icmp eq i64 %index.next, %n.vec
  br i1 %92, label %middle.block, label %vector.body, !llvm.loop !16

middle.block:                                     ; preds = %vector.body
  br i1 %cmp.n, label %._crit_edge.us.us.us, label %vec.epilog.iter.check

vec.epilog.iter.check:                            ; preds = %middle.block
  br i1 %min.epilog.iters.check, label %vec.epilog.scalar.ph.preheader, label %vec.epilog.ph

vec.epilog.ph:                                    ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
  %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
  br label %vec.epilog.vector.body

vec.epilog.vector.body:                           ; preds = %vec.epilog.vector.body, %vec.epilog.ph
  %index137 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next139, %vec.epilog.vector.body ]
  %93 = getelementptr i8, ptr %invariant.gep, i64 %index137
  %wide.load138 = load <8 x i8>, ptr %93, align 1, !tbaa !15
  %94 = getelementptr i8, ptr %invariant.gep130, i64 %index137
  store <8 x i8> %wide.load138, ptr %94, align 1, !tbaa !15
  %index.next139 = add nuw i64 %index137, 8
  %95 = icmp eq i64 %index.next139, %n.vec136
  br i1 %95, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !20

vec.epilog.middle.block:                          ; preds = %vec.epilog.vector.body
  br i1 %cmp.n140, label %._crit_edge.us.us.us, label %vec.epilog.scalar.ph.preheader

vec.epilog.scalar.ph.preheader:                   ; preds = %vec.epilog.middle.block, %vector.memcheck, %iter.check, %vec.epilog.iter.check
  %indvars.iv.ph = phi i64 [ 0, %iter.check ], [ 0, %vector.memcheck ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec136, %vec.epilog.middle.block ]
  br i1 %lcmp.mod.not, label %vec.epilog.scalar.ph.prol.loopexit, label %vec.epilog.scalar.ph.prol

vec.epilog.scalar.ph.prol:                        ; preds = %vec.epilog.scalar.ph.preheader, %vec.epilog.scalar.ph.prol
  %indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %vec.epilog.scalar.ph.prol ], [ %indvars.iv.ph, %vec.epilog.scalar.ph.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %vec.epilog.scalar.ph.prol ], [ 0, %vec.epilog.scalar.ph.preheader ]
  %gep.prol = getelementptr i8, ptr %invariant.gep, i64 %indvars.iv.prol
  %96 = load i8, ptr %gep.prol, align 1, !tbaa !15
  %gep131.prol = getelementptr i8, ptr %invariant.gep130, i64 %indvars.iv.prol
  store i8 %96, ptr %gep131.prol, align 1, !tbaa !15
  %indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %vec.epilog.scalar.ph.prol.loopexit, label %vec.epilog.scalar.ph.prol, !llvm.loop !21

vec.epilog.scalar.ph.prol.loopexit:               ; preds = %vec.epilog.scalar.ph.prol, %vec.epilog.scalar.ph.preheader
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %vec.epilog.scalar.ph.preheader ], [ %indvars.iv.next.prol, %vec.epilog.scalar.ph.prol ]
  %97 = sub nsw i64 %indvars.iv.ph, %wide.trip.count
  %98 = icmp ugt i64 %97, -4
  br i1 %98, label %._crit_edge.us.us.us, label %vec.epilog.scalar.ph

vec.epilog.scalar.ph:                             ; preds = %vec.epilog.scalar.ph.prol.loopexit, %vec.epilog.scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next.3, %vec.epilog.scalar.ph ], [ %indvars.iv.unr, %vec.epilog.scalar.ph.prol.loopexit ]
  %gep = getelementptr i8, ptr %invariant.gep, i64 %indvars.iv
  %99 = load i8, ptr %gep, align 1, !tbaa !15
  %gep131 = getelementptr i8, ptr %invariant.gep130, i64 %indvars.iv
  store i8 %99, ptr %gep131, align 1, !tbaa !15
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %gep.1 = getelementptr i8, ptr %invariant.gep, i64 %indvars.iv.next
  %100 = load i8, ptr %gep.1, align 1, !tbaa !15
  %gep131.1 = getelementptr i8, ptr %invariant.gep130, i64 %indvars.iv.next
  store i8 %100, ptr %gep131.1, align 1, !tbaa !15
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %gep.2 = getelementptr i8, ptr %invariant.gep, i64 %indvars.iv.next.1
  %101 = load i8, ptr %gep.2, align 1, !tbaa !15
  %gep131.2 = getelementptr i8, ptr %invariant.gep130, i64 %indvars.iv.next.1
  store i8 %101, ptr %gep131.2, align 1, !tbaa !15
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %gep.3 = getelementptr i8, ptr %invariant.gep, i64 %indvars.iv.next.2
  %102 = load i8, ptr %gep.3, align 1, !tbaa !15
  %gep131.3 = getelementptr i8, ptr %invariant.gep130, i64 %indvars.iv.next.2
  store i8 %102, ptr %gep131.3, align 1, !tbaa !15
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %exitcond118.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
  br i1 %exitcond118.not.3, label %._crit_edge.us.us.us, label %vec.epilog.scalar.ph, !llvm.loop !23

._crit_edge.us.us.us:                             ; preds = %vec.epilog.scalar.ph.prol.loopexit, %vec.epilog.scalar.ph, %vec.epilog.middle.block, %middle.block
  %indvars.iv.next120 = add nuw nsw i64 %indvars.iv119, 1
  %exitcond123.not = icmp eq i64 %indvars.iv.next120, %63
  br i1 %exitcond123.not, label %._crit_edge107.split.us.us.us, label %iter.check, !llvm.loop !24

._crit_edge107.split.us.us.us:                    ; preds = %._crit_edge.us.us.us
  %indvars.iv.next125 = add nuw nsw i64 %indvars.iv124, 1
  %exitcond128.not = icmp eq i64 %indvars.iv.next125, %wide.trip.count127
  br i1 %exitcond128.not, label %.loopexit, label %.preheader.us.us, !llvm.loop !25

.preheader.us:                                    ; preds = %.preheader.lr.ph.split.us, %._crit_edge107.split.us110
  %.095108.us = phi i32 [ %109, %._crit_edge107.split.us110 ], [ 0, %.preheader.lr.ph.split.us ]
  %103 = sub nsw i32 %.095108.us, %1
  br label %104

104:                                              ; preds = %.preheader.us, %104
  %.094105.us109 = phi i32 [ 0, %.preheader.us ], [ %108, %104 ]
  %105 = sub nsw i32 %.094105.us109, %3
  %106 = tail call i32 @hypercv_border_Interpolate(i32 noundef %105, i32 noundef %53, i32 noundef %5)
  %107 = tail call i32 @hypercv_border_Interpolate(i32 noundef %103, i32 noundef %52, i32 noundef %5)
  %108 = add nuw nsw i32 %.094105.us109, 1
  %exitcond.not = icmp eq i32 %108, %46
  br i1 %exitcond.not, label %._crit_edge107.split.us110, label %104, !llvm.loop !24

._crit_edge107.split.us110:                       ; preds = %104
  %109 = add nuw nsw i32 %.095108.us, 1
  %exitcond115.not = icmp eq i32 %109, %44
  br i1 %exitcond115.not, label %.loopexit, label %.preheader.us, !llvm.loop !25

.loopexit:                                        ; preds = %._crit_edge107.split.us110, %._crit_edge107.split.us.us.us, %43, %42, %27
  %.093 = phi ptr [ %28, %27 ], [ %41, %42 ], [ %41, %43 ], [ %41, %._crit_edge107.split.us.us.us ], [ %41, %._crit_edge107.split.us110 ]
  ret ptr %.093
}

declare ptr @simple_mat_copy(ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @hypercv_make_const_border(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i8 noundef zeroext) local_unnamed_addr #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @get_elemsize(i32 noundef) local_unnamed_addr #2

attributes #0 = { 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 #1 = { 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 #2 = { 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 #3 = { "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 = { 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 #5 = { noreturn nounwind }
attributes #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"", !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 4}
!12 = !{!6, !7, i64 8}
!13 = !{!6, !7, i64 12}
!14 = !{!6, !10, i64 24}
!15 = !{!8, !8, i64 0}
!16 = distinct !{!16, !17, !18, !19}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!"llvm.loop.isvectorized", i32 1}
!19 = !{!"llvm.loop.unroll.runtime.disable"}
!20 = distinct !{!20, !17, !18, !19}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.unroll.disable"}
!23 = distinct !{!23, !17, !18}
!24 = distinct !{!24, !17}
!25 = distinct !{!25, !17}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass