; LLVM IR from lesialin/ImageSignalProcessing_C :: src/isp_ccm.ll (Z7isp_ccmPt)

; 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.isp_config_t = type <{ i32, i32, i16, [6 x i8], %"class.std::__cxx11::basic_string", %struct.blc_cfg_t, i16, [6 x i8], %"class.std::__cxx11::basic_string", %struct.awb_gain_t, [12 x float], %"class.std::__cxx11::basic_string", float, [12 x float], %struct.nlm_cfg_t, i8, %struct.bnf_cfg_t, [15 x i16], %struct.eeh_cfg_t, %struct.fcs_cfg_t, %struct.hsc_cfg_t, %struct.bcc_cfg_t, [4 x i8] }>
%struct.blc_cfg_t = type { i16, i16, i16, i16, float, float }
%struct.awb_gain_t = type { float, float, float, float }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%struct.nlm_cfg_t = type { i8, i8, i8 }
%struct.bnf_cfg_t = type { [25 x i16], [4 x i16], [3 x i16] }
%struct.eeh_cfg_t = type { i16, i16, i16, i16, i16, i16 }
%struct.fcs_cfg_t = type { i8, i8 }
%struct.hsc_cfg_t = type { i8, float }
%struct.bcc_cfg_t = type { i8, float }

@g_isp_config = external global %struct.isp_config_t, align 8

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z7isp_ccmPt(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca i16, align 2
  %4 = alloca i16, align 2
  %5 = alloca ptr, align 8
  %6 = alloca [12 x i16], align 16
  %7 = alloca i16, align 2
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2, ptr %3) #2
  call void @llvm.lifetime.start.p0(i64 2, ptr %4) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #2
  call void @llvm.lifetime.start.p0(i64 24, ptr %6) #2
  call void @llvm.lifetime.start.p0(i64 2, ptr %7) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #2
  store ptr getelementptr inbounds (%struct.isp_config_t, ptr @g_isp_config, i32 0, i32 10), ptr %5, align 8, !tbaa !5
  %16 = load i32, ptr @g_isp_config, align 8, !tbaa !9
  %17 = trunc i32 %16 to i16
  store i16 %17, ptr %3, align 2, !tbaa !25
  %18 = load i32, ptr getelementptr inbounds (%struct.isp_config_t, ptr @g_isp_config, i32 0, i32 1), align 4, !tbaa !26
  %19 = trunc i32 %18 to i16
  store i16 %19, ptr %4, align 2, !tbaa !25
  %20 = load i16, ptr getelementptr inbounds (%struct.isp_config_t, ptr @g_isp_config, i32 0, i32 2), align 8, !tbaa !27
  %21 = zext i16 %20 to i32
  %22 = shl i32 1, %21
  %23 = sub nsw i32 %22, 1
  %24 = trunc i32 %23 to i16
  store i16 %24, ptr %7, align 2, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #2
  store i32 0, ptr %12, align 4, !tbaa !28
  br label %25

25:                                               ; preds = %40, %1
  %26 = load i32, ptr %12, align 4, !tbaa !28
  %27 = icmp slt i32 %26, 12
  br i1 %27, label %29, label %28

28:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #2
  br label %43

29:                                               ; preds = %25
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = load i32, ptr %12, align 4, !tbaa !28
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds float, ptr %30, i64 %32
  %34 = load float, ptr %33, align 4, !tbaa !29
  %35 = fmul float %34, 1.024000e+03
  %36 = fptosi float %35 to i16
  %37 = load i32, ptr %12, align 4, !tbaa !28
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [12 x i16], ptr %6, i64 0, i64 %38
  store i16 %36, ptr %39, align 2, !tbaa !25
  br label %40

40:                                               ; preds = %29
  %41 = load i32, ptr %12, align 4, !tbaa !28
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %12, align 4, !tbaa !28
  br label %25, !llvm.loop !30

43:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #2
  store i32 0, ptr %13, align 4, !tbaa !28
  br label %44

44:                                               ; preds = %227, %43
  %45 = load i32, ptr %13, align 4, !tbaa !28
  %46 = load i16, ptr %4, align 2, !tbaa !25
  %47 = zext i16 %46 to i32
  %48 = icmp slt i32 %45, %47
  br i1 %48, label %50, label %49

49:                                               ; preds = %44
  store i32 5, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #2
  br label %230

50:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #2
  store i32 0, ptr %15, align 4, !tbaa !28
  br label %51

51:                                               ; preds = %223, %50
  %52 = load i32, ptr %15, align 4, !tbaa !28
  %53 = load i16, ptr %3, align 2, !tbaa !25
  %54 = zext i16 %53 to i32
  %55 = icmp slt i32 %52, %54
  br i1 %55, label %57, label %56

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

57:                                               ; preds = %51
  %58 = load i32, ptr %13, align 4, !tbaa !28
  %59 = load i16, ptr %3, align 2, !tbaa !25
  %60 = zext i16 %59 to i32
  %61 = mul nsw i32 %58, %60
  %62 = load i32, ptr %15, align 4, !tbaa !28
  %63 = add nsw i32 %61, %62
  %64 = mul nsw i32 3, %63
  store i32 %64, ptr %8, align 4, !tbaa !28
  %65 = load ptr, ptr %2, align 8, !tbaa !5
  %66 = load i32, ptr %8, align 4, !tbaa !28
  %67 = zext i32 %66 to i64
  %68 = getelementptr inbounds i16, ptr %65, i64 %67
  %69 = load i16, ptr %68, align 2, !tbaa !25
  %70 = sext i16 %69 to i32
  %71 = getelementptr inbounds [12 x i16], ptr %6, i64 0, i64 0
  %72 = load i16, ptr %71, align 16, !tbaa !25
  %73 = sext i16 %72 to i32
  %74 = mul nsw i32 %70, %73
  %75 = load ptr, ptr %2, align 8, !tbaa !5
  %76 = load i32, ptr %8, align 4, !tbaa !28
  %77 = add i32 %76, 1
  %78 = zext i32 %77 to i64
  %79 = getelementptr inbounds i16, ptr %75, i64 %78
  %80 = load i16, ptr %79, align 2, !tbaa !25
  %81 = sext i16 %80 to i32
  %82 = getelementptr inbounds [12 x i16], ptr %6, i64 0, i64 1
  %83 = load i16, ptr %82, align 2, !tbaa !25
  %84 = sext i16 %83 to i32
  %85 = mul nsw i32 %81, %84
  %86 = add nsw i32 %74, %85
  %87 = load ptr, ptr %2, align 8, !tbaa !5
  %88 = load i32, ptr %8, align 4, !tbaa !28
  %89 = add i32 %88, 2
  %90 = zext i32 %89 to i64
  %91 = getelementptr inbounds i16, ptr %87, i64 %90
  %92 = load i16, ptr %91, align 2, !tbaa !25
  %93 = sext i16 %92 to i32
  %94 = getelementptr inbounds [12 x i16], ptr %6, i64 0, i64 2
  %95 = load i16, ptr %94, align 4, !tbaa !25
  %96 = sext i16 %95 to i32
  %97 = mul nsw i32 %93, %96
  %98 = add nsw i32 %86, %97
  %99 = getelementptr inbounds [12 x i16], ptr %6, i64 0, i64 3
  %100 = load i16, ptr %99, align 2, !tbaa !25
  %101 = sext i16 %100 to i32
  %102 = add nsw i32 %98, %101
  store i32 %102, ptr %9, align 4, !tbaa !28
  %103 = load ptr, ptr %2, align 8, !tbaa !5
  %104 = load i32, ptr %8, align 4, !tbaa !28
  %105 = zext i32 %104 to i64
  %106 = getelementptr inbounds i16, ptr %103, i64 %105
  %107 = load i16, ptr %106, align 2, !tbaa !25
  %108 = sext i16 %107 to i32
  %109 = getelementptr inbounds [12 x i16], ptr %6, i64 0, i64 4
  %110 = load i16, ptr %109, align 8, !tbaa !25
  %111 = sext i16 %110 to i32
  %112 = mul nsw i32 %108, %111
  %113 = load ptr, ptr %2, align 8, !tbaa !5
  %114 = load i32, ptr %8, align 4, !tbaa !28
  %115 = add i32 %114, 1
  %116 = zext i32 %115 to i64
  %117 = getelementptr inbounds i16, ptr %113, i64 %116
  %118 = load i16, ptr %117, align 2, !tbaa !25
  %119 = sext i16 %118 to i32
  %120 = getelementptr inbounds [12 x i16], ptr %6, i64 0, i64 5
  %121 = load i16, ptr %120, align 2, !tbaa !25
  %122 = sext i16 %121 to i32
  %123 = mul nsw i32 %119, %122
  %124 = add nsw i32 %112, %123
  %125 = load ptr, ptr %2, align 8, !tbaa !5
  %126 = load i32, ptr %8, align 4, !tbaa !28
  %127 = add i32 %126, 2
  %128 = zext i32 %127 to i64
  %129 = getelementptr inbounds i16, ptr %125, i64 %128
  %130 = load i16, ptr %129, align 2, !tbaa !25
  %131 = sext i16 %130 to i32
  %132 = getelementptr inbounds [12 x i16], ptr %6, i64 0, i64 6
  %133 = load i16, ptr %132, align 4, !tbaa !25
  %134 = sext i16 %133 to i32
  %135 = mul nsw i32 %131, %134
  %136 = add nsw i32 %124, %135
  %137 = getelementptr inbounds [12 x i16], ptr %6, i64 0, i64 7
  %138 = load i16, ptr %137, align 2, !tbaa !25
  %139 = sext i16 %138 to i32
  %140 = add nsw i32 %136, %139
  store i32 %140, ptr %10, align 4, !tbaa !28
  %141 = load ptr, ptr %2, align 8, !tbaa !5
  %142 = load i32, ptr %8, align 4, !tbaa !28
  %143 = zext i32 %142 to i64
  %144 = getelementptr inbounds i16, ptr %141, i64 %143
  %145 = load i16, ptr %144, align 2, !tbaa !25
  %146 = sext i16 %145 to i32
  %147 = getelementptr inbounds [12 x i16], ptr %6, i64 0, i64 8
  %148 = load i16, ptr %147, align 16, !tbaa !25
  %149 = sext i16 %148 to i32
  %150 = mul nsw i32 %146, %149
  %151 = load ptr, ptr %2, align 8, !tbaa !5
  %152 = load i32, ptr %8, align 4, !tbaa !28
  %153 = add i32 %152, 1
  %154 = zext i32 %153 to i64
  %155 = getelementptr inbounds i16, ptr %151, i64 %154
  %156 = load i16, ptr %155, align 2, !tbaa !25
  %157 = sext i16 %156 to i32
  %158 = getelementptr inbounds [12 x i16], ptr %6, i64 0, i64 9
  %159 = load i16, ptr %158, align 2, !tbaa !25
  %160 = sext i16 %159 to i32
  %161 = mul nsw i32 %157, %160
  %162 = add nsw i32 %150, %161
  %163 = load ptr, ptr %2, align 8, !tbaa !5
  %164 = load i32, ptr %8, align 4, !tbaa !28
  %165 = add i32 %164, 2
  %166 = zext i32 %165 to i64
  %167 = getelementptr inbounds i16, ptr %163, i64 %166
  %168 = load i16, ptr %167, align 2, !tbaa !25
  %169 = sext i16 %168 to i32
  %170 = getelementptr inbounds [12 x i16], ptr %6, i64 0, i64 10
  %171 = load i16, ptr %170, align 4, !tbaa !25
  %172 = sext i16 %171 to i32
  %173 = mul nsw i32 %169, %172
  %174 = add nsw i32 %162, %173
  %175 = getelementptr inbounds [12 x i16], ptr %6, i64 0, i64 11
  %176 = load i16, ptr %175, align 2, !tbaa !25
  %177 = sext i16 %176 to i32
  %178 = add nsw i32 %174, %177
  store i32 %178, ptr %11, align 4, !tbaa !28
  %179 = load i32, ptr %9, align 4, !tbaa !28
  %180 = icmp slt i32 %179, 0
  br i1 %180, label %181, label %182

181:                                              ; preds = %57
  br label %184

182:                                              ; preds = %57
  %183 = load i32, ptr %9, align 4, !tbaa !28
  br label %184

184:                                              ; preds = %182, %181
  %185 = phi i32 [ 0, %181 ], [ %183, %182 ]
  store i32 %185, ptr %9, align 4, !tbaa !28
  %186 = load i32, ptr %10, align 4, !tbaa !28
  %187 = icmp slt i32 %186, 0
  br i1 %187, label %188, label %189

188:                                              ; preds = %184
  br label %191

189:                                              ; preds = %184
  %190 = load i32, ptr %10, align 4, !tbaa !28
  br label %191

191:                                              ; preds = %189, %188
  %192 = phi i32 [ 0, %188 ], [ %190, %189 ]
  store i32 %192, ptr %10, align 4, !tbaa !28
  %193 = load i32, ptr %11, align 4, !tbaa !28
  %194 = icmp slt i32 %193, 0
  br i1 %194, label %195, label %196

195:                                              ; preds = %191
  br label %198

196:                                              ; preds = %191
  %197 = load i32, ptr %11, align 4, !tbaa !28
  br label %198

198:                                              ; preds = %196, %195
  %199 = phi i32 [ 0, %195 ], [ %197, %196 ]
  store i32 %199, ptr %11, align 4, !tbaa !28
  %200 = load i32, ptr %9, align 4, !tbaa !28
  %201 = ashr i32 %200, 10
  %202 = trunc i32 %201 to i16
  %203 = load ptr, ptr %2, align 8, !tbaa !5
  %204 = load i32, ptr %8, align 4, !tbaa !28
  %205 = zext i32 %204 to i64
  %206 = getelementptr inbounds i16, ptr %203, i64 %205
  store i16 %202, ptr %206, align 2, !tbaa !25
  %207 = load i32, ptr %10, align 4, !tbaa !28
  %208 = ashr i32 %207, 10
  %209 = trunc i32 %208 to i16
  %210 = load ptr, ptr %2, align 8, !tbaa !5
  %211 = load i32, ptr %8, align 4, !tbaa !28
  %212 = add i32 %211, 1
  %213 = zext i32 %212 to i64
  %214 = getelementptr inbounds i16, ptr %210, i64 %213
  store i16 %209, ptr %214, align 2, !tbaa !25
  %215 = load i32, ptr %11, align 4, !tbaa !28
  %216 = ashr i32 %215, 10
  %217 = trunc i32 %216 to i16
  %218 = load ptr, ptr %2, align 8, !tbaa !5
  %219 = load i32, ptr %8, align 4, !tbaa !28
  %220 = add i32 %219, 2
  %221 = zext i32 %220 to i64
  %222 = getelementptr inbounds i16, ptr %218, i64 %221
  store i16 %217, ptr %222, align 2, !tbaa !25
  br label %223

223:                                              ; preds = %198
  %224 = load i32, ptr %15, align 4, !tbaa !28
  %225 = add nsw i32 %224, 1
  store i32 %225, ptr %15, align 4, !tbaa !28
  br label %51, !llvm.loop !32

226:                                              ; preds = %56
  br label %227

227:                                              ; preds = %226
  %228 = load i32, ptr %13, align 4, !tbaa !28
  %229 = add nsw i32 %228, 1
  store i32 %229, ptr %13, align 4, !tbaa !28
  br label %44, !llvm.loop !33

230:                                              ; preds = %49
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #2
  call void @llvm.lifetime.end.p0(i64 2, ptr %7) #2
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #2
  call void @llvm.lifetime.end.p0(i64 2, ptr %4) #2
  call void @llvm.lifetime.end.p0(i64 2, ptr %3) #2
  ret void
}

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

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

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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, !11, i64 0}
!10 = !{!"_ZTS12isp_config_t", !11, i64 0, !11, i64 4, !12, i64 8, !13, i64 16, !16, i64 48, !12, i64 64, !13, i64 72, !18, i64 104, !7, i64 120, !13, i64 168, !17, i64 200, !7, i64 204, !19, i64 252, !20, i64 256, !7, i64 320, !21, i64 350, !22, i64 362, !23, i64 364, !24, i64 372}
!11 = !{!"int", !7, i64 0}
!12 = !{!"short", !7, i64 0}
!13 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !14, i64 0, !15, i64 8, !7, i64 16}
!14 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!15 = !{!"long", !7, i64 0}
!16 = !{!"_ZTS9blc_cfg_t", !12, i64 0, !12, i64 2, !12, i64 4, !12, i64 6, !17, i64 8, !17, i64 12}
!17 = !{!"float", !7, i64 0}
!18 = !{!"_ZTS10awb_gain_t", !17, i64 0, !17, i64 4, !17, i64 8, !17, i64 12}
!19 = !{!"_ZTS9nlm_cfg_t", !7, i64 0, !7, i64 1, !7, i64 2}
!20 = !{!"_ZTS9bnf_cfg_t", !7, i64 0, !7, i64 50, !7, i64 58}
!21 = !{!"_ZTS9eeh_cfg_t", !12, i64 0, !12, i64 2, !12, i64 4, !12, i64 6, !12, i64 8, !12, i64 10}
!22 = !{!"_ZTS9fcs_cfg_t", !7, i64 0, !7, i64 1}
!23 = !{!"_ZTS9hsc_cfg_t", !7, i64 0, !17, i64 4}
!24 = !{!"_ZTS9bcc_cfg_t", !7, i64 0, !17, i64 4}
!25 = !{!12, !12, i64 0}
!26 = !{!10, !11, i64 4}
!27 = !{!10, !12, i64 8}
!28 = !{!11, !11, i64 0}
!29 = !{!17, !17, i64 0}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}
!32 = distinct !{!32, !31}
!33 = distinct !{!33, !31}


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

%struct.isp_config_t = type <{ i32, i32, i16, [6 x i8], %"class.std::__cxx11::basic_string", %struct.blc_cfg_t, i16, [6 x i8], %"class.std::__cxx11::basic_string", %struct.awb_gain_t, [12 x float], %"class.std::__cxx11::basic_string", float, [12 x float], %struct.nlm_cfg_t, i8, %struct.bnf_cfg_t, [15 x i16], %struct.eeh_cfg_t, %struct.fcs_cfg_t, %struct.hsc_cfg_t, %struct.bcc_cfg_t, [4 x i8] }>
%struct.blc_cfg_t = type { i16, i16, i16, i16, float, float }
%struct.awb_gain_t = type { float, float, float, float }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%struct.nlm_cfg_t = type { i8, i8, i8 }
%struct.bnf_cfg_t = type { [25 x i16], [4 x i16], [3 x i16] }
%struct.eeh_cfg_t = type { i16, i16, i16, i16, i16, i16 }
%struct.fcs_cfg_t = type { i8, i8 }
%struct.hsc_cfg_t = type { i8, float }
%struct.bcc_cfg_t = type { i8, float }

@g_isp_config = external local_unnamed_addr global %struct.isp_config_t, align 8

; Function Attrs: mustprogress nofree norecurse nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) uwtable
define dso_local void @_Z7isp_ccmPt(ptr nocapture noundef %0) local_unnamed_addr #0 {
.preheader49:
  %1 = load i32, ptr getelementptr inbounds (i8, ptr @g_isp_config, i64 4), align 4, !tbaa !5
  %2 = and i32 %1, 65535
  %.not = icmp eq i32 %2, 0
  br i1 %.not, label %._crit_edge53, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %.preheader49
  %3 = load float, ptr getelementptr inbounds (i8, ptr @g_isp_config, i64 164), align 4, !tbaa !24
  %4 = fmul float %3, 1.024000e+03
  %5 = fptosi float %4 to i16
  %6 = load float, ptr getelementptr inbounds (i8, ptr @g_isp_config, i64 160), align 8, !tbaa !24
  %7 = fmul float %6, 1.024000e+03
  %8 = fptosi float %7 to i16
  %9 = load float, ptr getelementptr inbounds (i8, ptr @g_isp_config, i64 156), align 4, !tbaa !24
  %10 = fmul float %9, 1.024000e+03
  %11 = fptosi float %10 to i16
  %12 = load float, ptr getelementptr inbounds (i8, ptr @g_isp_config, i64 152), align 8, !tbaa !24
  %13 = fmul float %12, 1.024000e+03
  %14 = fptosi float %13 to i16
  %15 = load float, ptr getelementptr inbounds (i8, ptr @g_isp_config, i64 148), align 4, !tbaa !24
  %16 = load float, ptr getelementptr inbounds (i8, ptr @g_isp_config, i64 144), align 8, !tbaa !24
  %17 = load float, ptr getelementptr inbounds (i8, ptr @g_isp_config, i64 140), align 4, !tbaa !24
  %18 = load float, ptr getelementptr inbounds (i8, ptr @g_isp_config, i64 136), align 8, !tbaa !24
  %19 = load <4 x float>, ptr getelementptr inbounds (i8, ptr @g_isp_config, i64 132), align 4
  %20 = shufflevector <4 x float> %19, <4 x float> poison, <2 x i32> <i32 0, i32 poison>
  %21 = load <4 x float>, ptr getelementptr inbounds (i8, ptr @g_isp_config, i64 128), align 8
  %22 = shufflevector <4 x float> %21, <4 x float> poison, <2 x i32> <i32 0, i32 poison>
  %23 = load <4 x float>, ptr getelementptr inbounds (i8, ptr @g_isp_config, i64 124), align 4
  %24 = shufflevector <4 x float> %23, <4 x float> poison, <2 x i32> <i32 0, i32 poison>
  %25 = load <4 x float>, ptr getelementptr inbounds (i8, ptr @g_isp_config, i64 120), align 8
  %26 = shufflevector <4 x float> %25, <4 x float> poison, <2 x i32> <i32 0, i32 poison>
  %27 = insertelement <2 x float> %20, float %15, i64 1
  %28 = fmul <2 x float> %27, <float 1.024000e+03, float 1.024000e+03>
  %29 = fptosi <2 x float> %28 to <2 x i16>
  %30 = insertelement <2 x float> %22, float %16, i64 1
  %31 = fmul <2 x float> %30, <float 1.024000e+03, float 1.024000e+03>
  %32 = fptosi <2 x float> %31 to <2 x i16>
  %33 = insertelement <2 x float> %24, float %18, i64 1
  %34 = fmul <2 x float> %33, <float 1.024000e+03, float 1.024000e+03>
  %35 = fptosi <2 x float> %34 to <2 x i16>
  %36 = insertelement <2 x float> %26, float %17, i64 1
  %37 = fmul <2 x float> %36, <float 1.024000e+03, float 1.024000e+03>
  %38 = fptosi <2 x float> %37 to <2 x i16>
  %39 = load i32, ptr @g_isp_config, align 8, !tbaa !25
  %40 = and i32 %39, 65535
  %.not54 = icmp eq i32 %40, 0
  %41 = sext <2 x i16> %35 to <2 x i32>
  %42 = sext <2 x i16> %38 to <2 x i32>
  %43 = sext <2 x i16> %32 to <2 x i32>
  %44 = sext <2 x i16> %29 to <2 x i32>
  %45 = sext i16 %14 to i32
  %46 = sext i16 %11 to i32
  %47 = sext i16 %8 to i32
  %48 = sext i16 %5 to i32
  br i1 %.not54, label %._crit_edge53, label %.preheader.us.preheader

.preheader.us.preheader:                          ; preds = %.preheader.lr.ph
  %49 = zext nneg i32 %40 to i64
  %wide.trip.count61 = zext nneg i32 %2 to i64
  %invariant.gep63 = getelementptr inbounds i8, ptr %0, i64 4
  %min.iters.check = icmp ult i32 %40, 8
  %n.vec = and i64 %49, 65528
  %broadcast.splat = shufflevector <2 x i32> %42, <2 x i32> poison, <8 x i32> zeroinitializer
  %broadcast.splat68 = shufflevector <2 x i32> %41, <2 x i32> poison, <8 x i32> zeroinitializer
  %broadcast.splat70 = shufflevector <2 x i32> %43, <2 x i32> poison, <8 x i32> zeroinitializer
  %broadcast.splat72 = shufflevector <2 x i32> %44, <2 x i32> poison, <8 x i32> zeroinitializer
  %broadcast.splat74 = shufflevector <2 x i32> %41, <2 x i32> poison, <8 x i32> <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>
  %broadcast.splat76 = shufflevector <2 x i32> %42, <2 x i32> poison, <8 x i32> <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>
  %broadcast.splat78 = shufflevector <2 x i32> %43, <2 x i32> poison, <8 x i32> <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>
  %broadcast.splat80 = shufflevector <2 x i32> %44, <2 x i32> poison, <8 x i32> <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>
  %broadcast.splatinsert81 = insertelement <8 x i32> poison, i32 %45, i64 0
  %broadcast.splat82 = shufflevector <8 x i32> %broadcast.splatinsert81, <8 x i32> poison, <8 x i32> zeroinitializer
  %broadcast.splatinsert83 = insertelement <8 x i32> poison, i32 %46, i64 0
  %broadcast.splat84 = shufflevector <8 x i32> %broadcast.splatinsert83, <8 x i32> poison, <8 x i32> zeroinitializer
  %broadcast.splatinsert85 = insertelement <8 x i32> poison, i32 %47, i64 0
  %broadcast.splat86 = shufflevector <8 x i32> %broadcast.splatinsert85, <8 x i32> poison, <8 x i32> zeroinitializer
  %broadcast.splatinsert87 = insertelement <8 x i32> poison, i32 %48, i64 0
  %broadcast.splat88 = shufflevector <8 x i32> %broadcast.splatinsert87, <8 x i32> poison, <8 x i32> zeroinitializer
  %invariant.gep = getelementptr i8, ptr %invariant.gep63, i64 -4
  %cmp.n = icmp eq i64 %n.vec, %49
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge.us
  %indvars.iv58 = phi i64 [ 0, %.preheader.us.preheader ], [ %indvars.iv.next59, %._crit_edge.us ]
  %50 = mul nuw nsw i64 %indvars.iv58, %49
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.body

vector.body:                                      ; preds = %.preheader.us, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %.preheader.us ]
  %51 = add nuw nsw i64 %index, %50
  %52 = mul nuw nsw i64 %51, 3
  %53 = getelementptr inbounds i16, ptr %0, i64 %52
  %wide.vec = load <24 x i16>, ptr %53, align 2, !tbaa !26
  %strided.vec = shufflevector <24 x i16> %wide.vec, <24 x i16> poison, <8 x i32> <i32 0, i32 3, i32 6, i32 9, i32 12, i32 15, i32 18, i32 21>
  %strided.vec65 = shufflevector <24 x i16> %wide.vec, <24 x i16> poison, <8 x i32> <i32 1, i32 4, i32 7, i32 10, i32 13, i32 16, i32 19, i32 22>
  %strided.vec66 = shufflevector <24 x i16> %wide.vec, <24 x i16> poison, <8 x i32> <i32 2, i32 5, i32 8, i32 11, i32 14, i32 17, i32 20, i32 23>
  %54 = sext <8 x i16> %strided.vec to <8 x i32>
  %55 = mul nsw <8 x i32> %broadcast.splat, %54
  %56 = sext <8 x i16> %strided.vec65 to <8 x i32>
  %57 = mul nsw <8 x i32> %broadcast.splat68, %56
  %58 = add nsw <8 x i32> %57, %55
  %59 = sext <8 x i16> %strided.vec66 to <8 x i32>
  %60 = mul nsw <8 x i32> %broadcast.splat70, %59
  %61 = add nsw <8 x i32> %58, %60
  %62 = add nsw <8 x i32> %61, %broadcast.splat72
  %63 = mul nsw <8 x i32> %broadcast.splat74, %54
  %64 = mul nsw <8 x i32> %broadcast.splat76, %56
  %65 = add nsw <8 x i32> %64, %63
  %66 = mul nsw <8 x i32> %broadcast.splat78, %59
  %67 = add nsw <8 x i32> %65, %66
  %68 = add nsw <8 x i32> %67, %broadcast.splat80
  %69 = mul nsw <8 x i32> %broadcast.splat82, %54
  %70 = mul nsw <8 x i32> %broadcast.splat84, %56
  %71 = add nsw <8 x i32> %70, %69
  %72 = mul nsw <8 x i32> %broadcast.splat86, %59
  %73 = add nsw <8 x i32> %71, %72
  %74 = add nsw <8 x i32> %73, %broadcast.splat88
  %75 = tail call <8 x i32> @llvm.smax.v8i32(<8 x i32> %62, <8 x i32> zeroinitializer)
  %76 = tail call <8 x i32> @llvm.smax.v8i32(<8 x i32> %68, <8 x i32> zeroinitializer)
  %77 = tail call <8 x i32> @llvm.smax.v8i32(<8 x i32> %74, <8 x i32> zeroinitializer)
  %78 = lshr <8 x i32> %75, <i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10>
  %79 = trunc <8 x i32> %78 to <8 x i16>
  %80 = lshr <8 x i32> %76, <i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10>
  %81 = trunc <8 x i32> %80 to <8 x i16>
  %82 = lshr <8 x i32> %77, <i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10>
  %83 = trunc <8 x i32> %82 to <8 x i16>
  %gep = getelementptr i16, ptr %invariant.gep, i64 %52
  %84 = shufflevector <8 x i16> %79, <8 x i16> %81, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
  %85 = shufflevector <8 x i16> %83, <8 x i16> poison, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
  %interleaved.vec = shufflevector <16 x i16> %84, <16 x i16> %85, <24 x i32> <i32 0, i32 8, i32 16, i32 1, i32 9, i32 17, i32 2, i32 10, i32 18, i32 3, i32 11, i32 19, i32 4, i32 12, i32 20, i32 5, i32 13, i32 21, i32 6, i32 14, i32 22, i32 7, i32 15, i32 23>
  store <24 x i16> %interleaved.vec, ptr %gep, align 2, !tbaa !26
  %index.next = add nuw i64 %index, 8
  %86 = icmp eq i64 %index.next, %n.vec
  br i1 %86, label %middle.block, label %vector.body, !llvm.loop !27

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

scalar.ph.preheader:                              ; preds = %middle.block, %.preheader.us
  %indvars.iv.ph = phi i64 [ 0, %.preheader.us ], [ %n.vec, %middle.block ]
  br label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %87 = add nuw nsw i64 %indvars.iv, %50
  %88 = mul nuw nsw i64 %87, 3
  %89 = getelementptr inbounds i16, ptr %0, i64 %88
  %gep64 = getelementptr inbounds i16, ptr %invariant.gep63, i64 %88
  %90 = load i16, ptr %gep64, align 2, !tbaa !26
  %91 = sext i16 %90 to i32
  %92 = mul nsw i32 %47, %91
  %93 = load <2 x i16>, ptr %89, align 2, !tbaa !26
  %94 = sext <2 x i16> %93 to <2 x i32>
  %95 = shufflevector <2 x i32> %94, <2 x i32> poison, <2 x i32> <i32 1, i32 0>
  %96 = mul nsw <2 x i32> %95, %41
  %97 = mul nsw <2 x i32> %42, %94
  %98 = add nsw <2 x i32> %97, %96
  %99 = insertelement <2 x i32> poison, i32 %91, i64 0
  %100 = shufflevector <2 x i32> %99, <2 x i32> poison, <2 x i32> zeroinitializer
  %101 = mul nsw <2 x i32> %100, %43
  %102 = add nsw <2 x i32> %98, %101
  %103 = add nsw <2 x i32> %102, %44
  %104 = extractelement <2 x i32> %94, i64 0
  %105 = mul nsw i32 %104, %45
  %106 = extractelement <2 x i32> %94, i64 1
  %107 = mul nsw i32 %106, %46
  %108 = add nsw i32 %107, %105
  %109 = add nsw i32 %108, %92
  %110 = add nsw i32 %109, %48
  %111 = tail call <2 x i32> @llvm.smax.v2i32(<2 x i32> %103, <2 x i32> zeroinitializer)
  %112 = tail call i32 @llvm.smax.i32(i32 %110, i32 0)
  %113 = lshr <2 x i32> %111, <i32 10, i32 10>
  %114 = trunc <2 x i32> %113 to <2 x i16>
  store <2 x i16> %114, ptr %89, align 2, !tbaa !26
  %115 = lshr i32 %112, 10
  %116 = trunc i32 %115 to i16
  store i16 %116, ptr %gep64, align 2, !tbaa !26
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %49
  br i1 %exitcond.not, label %._crit_edge.us, label %scalar.ph, !llvm.loop !31

._crit_edge.us:                                   ; preds = %scalar.ph, %middle.block
  %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
  %exitcond62.not = icmp eq i64 %indvars.iv.next59, %wide.trip.count61
  br i1 %exitcond62.not, label %._crit_edge53, label %.preheader.us, !llvm.loop !32

._crit_edge53:                                    ; preds = %._crit_edge.us, %.preheader.lr.ph, %.preheader49
  ret void
}

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <8 x i32> @llvm.smax.v8i32(<8 x i32>, <8 x i32>) #1

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

attributes #0 = { mustprogress nofree norecurse nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 4}
!6 = !{!"_ZTS12isp_config_t", !7, i64 0, !7, i64 4, !10, i64 8, !11, i64 16, !15, i64 48, !10, i64 64, !11, i64 72, !17, i64 104, !8, i64 120, !11, i64 168, !16, i64 200, !8, i64 204, !18, i64 252, !19, i64 256, !8, i64 320, !20, i64 350, !21, i64 362, !22, i64 364, !23, i64 372}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"short", !8, i64 0}
!11 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !12, i64 0, !14, i64 8, !8, i64 16}
!12 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !13, i64 0}
!13 = !{!"any pointer", !8, i64 0}
!14 = !{!"long", !8, i64 0}
!15 = !{!"_ZTS9blc_cfg_t", !10, i64 0, !10, i64 2, !10, i64 4, !10, i64 6, !16, i64 8, !16, i64 12}
!16 = !{!"float", !8, i64 0}
!17 = !{!"_ZTS10awb_gain_t", !16, i64 0, !16, i64 4, !16, i64 8, !16, i64 12}
!18 = !{!"_ZTS9nlm_cfg_t", !8, i64 0, !8, i64 1, !8, i64 2}
!19 = !{!"_ZTS9bnf_cfg_t", !8, i64 0, !8, i64 50, !8, i64 58}
!20 = !{!"_ZTS9eeh_cfg_t", !10, i64 0, !10, i64 2, !10, i64 4, !10, i64 6, !10, i64 8, !10, i64 10}
!21 = !{!"_ZTS9fcs_cfg_t", !8, i64 0, !8, i64 1}
!22 = !{!"_ZTS9hsc_cfg_t", !8, i64 0, !16, i64 4}
!23 = !{!"_ZTS9bcc_cfg_t", !8, i64 0, !16, i64 4}
!24 = !{!16, !16, i64 0}
!25 = !{!6, !7, i64 0}
!26 = !{!10, !10, i64 0}
!27 = distinct !{!27, !28, !29, !30}
!28 = !{!"llvm.loop.mustprogress"}
!29 = !{!"llvm.loop.isvectorized", i32 1}
!30 = !{!"llvm.loop.unroll.runtime.disable"}
!31 = distinct !{!31, !28, !30, !29}
!32 = distinct !{!32, !28}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass,VectorCombinePass