; LLVM IR from ermig1979/Simd :: src/Simd (SimdBaseImageLoadJpeg)

; 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.Simd::Array" = type { ptr, i64 }

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN4Simd5ArrayIhEC2Embm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, i1 noundef zeroext, i64 noundef) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef ptr @_ZN4Simd4BaseL18JpegResampleRowHv2EPhPKhS3_ii(ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) #2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZN4Simd5ArrayIhED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4Simd4Base17JpegYuv420pToBgraEPKhmS2_mS2_mmmPhmh11SimdYuvType(ptr noundef %0, i64 noundef %1, ptr noundef %2, i64 noundef %3, ptr noundef %4, i64 noundef %5, i64 noundef %6, i64 noundef %7, ptr noundef %8, i64 noundef %9, i8 noundef zeroext %10, i32 noundef %11) #4 personality ptr @__gxx_personality_v0 {
  %13 = alloca ptr, align 8
  %14 = alloca i64, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i64, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca ptr, align 8
  %22 = alloca i64, align 8
  %23 = alloca i8, align 1
  %24 = alloca i32, align 4
  %25 = alloca i64, align 8
  %26 = alloca i64, align 8
  %27 = alloca %"struct.Simd::Array", align 8
  %28 = alloca ptr, align 8
  %29 = alloca ptr, align 8
  %30 = alloca i64, align 8
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca ptr, align 8
  %34 = alloca i32, align 4
  %35 = alloca i64, align 8
  store ptr %0, ptr %13, align 8, !tbaa !5
  store i64 %1, ptr %14, align 8, !tbaa !9
  store ptr %2, ptr %15, align 8, !tbaa !5
  store i64 %3, ptr %16, align 8, !tbaa !9
  store ptr %4, ptr %17, align 8, !tbaa !5
  store i64 %5, ptr %18, align 8, !tbaa !9
  store i64 %6, ptr %19, align 8, !tbaa !9
  store i64 %7, ptr %20, align 8, !tbaa !9
  store ptr %8, ptr %21, align 8, !tbaa !5
  store i64 %9, ptr %22, align 8, !tbaa !9
  store i8 %10, ptr %23, align 1, !tbaa !11
  store i32 %11, ptr %24, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  %36 = load i64, ptr %20, align 8, !tbaa !9
  %37 = sub i64 %36, 1
  store i64 %37, ptr %25, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  %38 = load i64, ptr %19, align 8, !tbaa !9
  %39 = add i64 %38, 1
  %40 = udiv i64 %39, 2
  store i64 %40, ptr %26, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %27) #5
  %41 = load i64, ptr %19, align 8, !tbaa !9
  %42 = mul i64 %41, 2
  %43 = add i64 %42, 6
  call void @_ZN4Simd5ArrayIhEC2Embm(ptr noundef nonnull align 8 dereferenceable(16) %27, i64 noundef %43, i1 noundef zeroext false, i64 noundef 8)
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #5
  %44 = getelementptr inbounds %"struct.Simd::Array", ptr %27, i32 0, i32 0
  %45 = load ptr, ptr %44, align 8, !tbaa !14
  store ptr %45, ptr %28, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #5
  %46 = getelementptr inbounds %"struct.Simd::Array", ptr %27, i32 0, i32 0
  %47 = load ptr, ptr %46, align 8, !tbaa !14
  %48 = load i64, ptr %19, align 8, !tbaa !9
  %49 = getelementptr inbounds i8, ptr %47, i64 %48
  %50 = getelementptr inbounds i8, ptr %49, i64 3
  store ptr %50, ptr %29, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #5
  store i64 0, ptr %30, align 8, !tbaa !9
  br label %51

51:                                               ; preds = %184, %12
  %52 = load i64, ptr %30, align 8, !tbaa !9
  %53 = load i64, ptr %20, align 8, !tbaa !9
  %54 = icmp ult i64 %52, %53
  br i1 %54, label %56, label %55

55:                                               ; preds = %51
  store i32 2, ptr %31, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #5
  br label %188

56:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #5
  %57 = load i64, ptr %30, align 8, !tbaa !9
  %58 = and i64 %57, 1
  %59 = trunc i64 %58 to i32
  store i32 %59, ptr %32, align 4, !tbaa !16
  %60 = load ptr, ptr %28, align 8, !tbaa !5
  %61 = load ptr, ptr %15, align 8, !tbaa !5
  %62 = load i32, ptr %32, align 4, !tbaa !16
  %63 = icmp ne i32 %62, 0
  br i1 %63, label %64, label %76

64:                                               ; preds = %56
  %65 = load i64, ptr %30, align 8, !tbaa !9
  %66 = load i64, ptr %25, align 8, !tbaa !9
  %67 = icmp eq i64 %65, %66
  br i1 %67, label %68, label %70

68:                                               ; preds = %64
  %69 = load ptr, ptr %15, align 8, !tbaa !5
  br label %74

70:                                               ; preds = %64
  %71 = load ptr, ptr %15, align 8, !tbaa !5
  %72 = load i64, ptr %16, align 8, !tbaa !9
  %73 = getelementptr inbounds i8, ptr %71, i64 %72
  br label %74

74:                                               ; preds = %70, %68
  %75 = phi ptr [ %69, %68 ], [ %73, %70 ]
  br label %88

76:                                               ; preds = %56
  %77 = load i64, ptr %30, align 8, !tbaa !9
  %78 = icmp eq i64 %77, 0
  br i1 %78, label %79, label %81

79:                                               ; preds = %76
  %80 = load ptr, ptr %15, align 8, !tbaa !5
  br label %86

81:                                               ; preds = %76
  %82 = load ptr, ptr %15, align 8, !tbaa !5
  %83 = load i64, ptr %16, align 8, !tbaa !9
  %84 = sub i64 0, %83
  %85 = getelementptr inbounds i8, ptr %82, i64 %84
  br label %86

86:                                               ; preds = %81, %79
  %87 = phi ptr [ %80, %79 ], [ %85, %81 ]
  br label %88

88:                                               ; preds = %86, %74
  %89 = phi ptr [ %75, %74 ], [ %87, %86 ]
  %90 = load i64, ptr %26, align 8, !tbaa !9
  %91 = trunc i64 %90 to i32
  %92 = invoke noundef ptr @_ZN4Simd4BaseL18JpegResampleRowHv2EPhPKhS3_ii(ptr noundef %60, ptr noundef %61, ptr noundef %89, i32 noundef %91, i32 noundef 0)
          to label %93 unwind label %133

93:                                               ; preds = %88
  %94 = load ptr, ptr %29, align 8, !tbaa !5
  %95 = load ptr, ptr %17, align 8, !tbaa !5
  %96 = load i32, ptr %32, align 4, !tbaa !16
  %97 = icmp ne i32 %96, 0
  br i1 %97, label %98, label %110

98:                                               ; preds = %93
  %99 = load i64, ptr %30, align 8, !tbaa !9
  %100 = load i64, ptr %25, align 8, !tbaa !9
  %101 = icmp eq i64 %99, %100
  br i1 %101, label %102, label %104

102:                                              ; preds = %98
  %103 = load ptr, ptr %17, align 8, !tbaa !5
  br label %108

104:                                              ; preds = %98
  %105 = load ptr, ptr %17, align 8, !tbaa !5
  %106 = load i64, ptr %16, align 8, !tbaa !9
  %107 = getelementptr inbounds i8, ptr %105, i64 %106
  br label %108

108:                                              ; preds = %104, %102
  %109 = phi ptr [ %103, %102 ], [ %107, %104 ]
  br label %122

110:                                              ; preds = %93
  %111 = load i64, ptr %30, align 8, !tbaa !9
  %112 = icmp eq i64 %111, 0
  br i1 %112, label %113, label %115

113:                                              ; preds = %110
  %114 = load ptr, ptr %17, align 8, !tbaa !5
  br label %120

115:                                              ; preds = %110
  %116 = load ptr, ptr %17, align 8, !tbaa !5
  %117 = load i64, ptr %16, align 8, !tbaa !9
  %118 = sub i64 0, %117
  %119 = getelementptr inbounds i8, ptr %116, i64 %118
  br label %120

120:                                              ; preds = %115, %113
  %121 = phi ptr [ %114, %113 ], [ %119, %115 ]
  br label %122

122:                                              ; preds = %120, %108
  %123 = phi ptr [ %109, %108 ], [ %121, %120 ]
  %124 = load i64, ptr %26, align 8, !tbaa !9
  %125 = trunc i64 %124 to i32
  %126 = invoke noundef ptr @_ZN4Simd4BaseL18JpegResampleRowHv2EPhPKhS3_ii(ptr noundef %94, ptr noundef %95, ptr noundef %123, i32 noundef %125, i32 noundef 0)
          to label %127 unwind label %133

127:                                              ; preds = %122
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #5
  store i64 0, ptr %35, align 8, !tbaa !9
  br label %128

128:                                              ; preds = %160, %127
  %129 = load i64, ptr %35, align 8, !tbaa !9
  %130 = load i64, ptr %19, align 8, !tbaa !9
  %131 = icmp ult i64 %129, %130
  br i1 %131, label %137, label %132

132:                                              ; preds = %128
  store i32 5, ptr %31, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #5
  br label %167

133:                                              ; preds = %122, %88
  %134 = landingpad { ptr, i32 }
          cleanup
  %135 = extractvalue { ptr, i32 } %134, 0
  store ptr %135, ptr %33, align 8
  %136 = extractvalue { ptr, i32 } %134, 1
  store i32 %136, ptr %34, align 4
  br label %187

137:                                              ; preds = %128
  %138 = load ptr, ptr %13, align 8, !tbaa !5
  %139 = load i64, ptr %35, align 8, !tbaa !9
  %140 = getelementptr inbounds i8, ptr %138, i64 %139
  %141 = load i8, ptr %140, align 1, !tbaa !11
  %142 = zext i8 %141 to i32
  %143 = load ptr, ptr %28, align 8, !tbaa !5
  %144 = load i64, ptr %35, align 8, !tbaa !9
  %145 = getelementptr inbounds i8, ptr %143, i64 %144
  %146 = load i8, ptr %145, align 1, !tbaa !11
  %147 = zext i8 %146 to i32
  %148 = load ptr, ptr %29, align 8, !tbaa !5
  %149 = load i64, ptr %35, align 8, !tbaa !9
  %150 = getelementptr inbounds i8, ptr %148, i64 %149
  %151 = load i8, ptr %150, align 1, !tbaa !11
  %152 = zext i8 %151 to i32
  %153 = load i8, ptr %23, align 1, !tbaa !11
  %154 = zext i8 %153 to i32
  %155 = load ptr, ptr %21, align 8, !tbaa !5
  %156 = load i64, ptr %35, align 8, !tbaa !9
  %157 = mul i64 %156, 4
  %158 = getelementptr inbounds i8, ptr %155, i64 %157
  invoke void @_ZN4Simd4Base9YuvToBgraINS0_8Trect871EEEviiiiPh(i32 noundef %142, i32 noundef %147, i32 noundef %152, i32 noundef %154, ptr noundef %158)
          to label %159 unwind label %163

159:                                              ; preds = %137
  br label %160

160:                                              ; preds = %159
  %161 = load i64, ptr %35, align 8, !tbaa !9
  %162 = add i64 %161, 1
  store i64 %162, ptr %35, align 8, !tbaa !9
  br label %128, !llvm.loop !18

163:                                              ; preds = %137
  %164 = landingpad { ptr, i32 }
          cleanup
  %165 = extractvalue { ptr, i32 } %164, 0
  store ptr %165, ptr %33, align 8
  %166 = extractvalue { ptr, i32 } %164, 1
  store i32 %166, ptr %34, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #5
  br label %187

167:                                              ; preds = %132
  %168 = load i64, ptr %14, align 8, !tbaa !9
  %169 = load ptr, ptr %13, align 8, !tbaa !5
  %170 = getelementptr inbounds i8, ptr %169, i64 %168
  store ptr %170, ptr %13, align 8, !tbaa !5
  %171 = load i64, ptr %22, align 8, !tbaa !9
  %172 = load ptr, ptr %21, align 8, !tbaa !5
  %173 = getelementptr inbounds i8, ptr %172, i64 %171
  store ptr %173, ptr %21, align 8, !tbaa !5
  %174 = load i32, ptr %32, align 4, !tbaa !16
  %175 = icmp ne i32 %174, 0
  br i1 %175, label %176, label %183

176:                                              ; preds = %167
  %177 = load i64, ptr %16, align 8, !tbaa !9
  %178 = load ptr, ptr %15, align 8, !tbaa !5
  %179 = getelementptr inbounds i8, ptr %178, i64 %177
  store ptr %179, ptr %15, align 8, !tbaa !5
  %180 = load i64, ptr %18, align 8, !tbaa !9
  %181 = load ptr, ptr %17, align 8, !tbaa !5
  %182 = getelementptr inbounds i8, ptr %181, i64 %180
  store ptr %182, ptr %17, align 8, !tbaa !5
  br label %183

183:                                              ; preds = %176, %167
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #5
  br label %184

184:                                              ; preds = %183
  %185 = load i64, ptr %30, align 8, !tbaa !9
  %186 = add i64 %185, 1
  store i64 %186, ptr %30, align 8, !tbaa !9
  br label %51, !llvm.loop !20

187:                                              ; preds = %163, %133
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #5
  call void @_ZN4Simd5ArrayIhED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %27) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  br label %189

188:                                              ; preds = %55
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #5
  call void @_ZN4Simd5ArrayIhED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %27) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  ret void

189:                                              ; preds = %187
  %190 = load ptr, ptr %33, align 8
  %191 = load i32, ptr %34, align 4
  %192 = insertvalue { ptr, i32 } poison, ptr %190, 0
  %193 = insertvalue { ptr, i32 } %192, i32 %191, 1
  resume { ptr, i32 } %193
}

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN4Simd4Base9YuvToBgraINS0_8Trect871EEEviiiiPh(i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { alwaysinline mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"_ZTS11SimdYuvType", !7, i64 0}
!14 = !{!15, !6, i64 0}
!15 = !{!"_ZTSN4Simd5ArrayIhEE", !6, i64 0, !10, i64 8}
!16 = !{!17, !17, i64 0}
!17 = !{!"int", !7, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !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"

%"struct.Simd::Array" = type { ptr, i64 }

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN4Simd5ArrayIhEC2Embm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, i1 noundef zeroext, i64 noundef) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef ptr @_ZN4Simd4BaseL18JpegResampleRowHv2EPhPKhS3_ii(ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZN4Simd5ArrayIhED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4Simd4Base17JpegYuv420pToBgraEPKhmS2_mS2_mmmPhmh11SimdYuvType(ptr nocapture noundef readonly %0, i64 noundef %1, ptr noundef %2, i64 noundef %3, ptr noundef %4, i64 noundef %5, i64 noundef %6, i64 noundef %7, ptr noundef %8, i64 noundef %9, i8 noundef zeroext %10, i32 noundef %11) local_unnamed_addr #4 personality ptr @__gxx_personality_v0 {
  %13 = alloca %"struct.Simd::Array", align 8
  %14 = add i64 %7, -1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %13) #5
  %15 = shl i64 %6, 1
  %16 = add i64 %15, 6
  call void @_ZN4Simd5ArrayIhEC2Embm(ptr noundef nonnull align 8 dereferenceable(16) %13, i64 noundef %16, i1 noundef zeroext false, i64 noundef 8)
  %17 = load ptr, ptr %13, align 8, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %17, i64 %6
  %19 = getelementptr inbounds i8, ptr %18, i64 3
  %.not75 = icmp eq i64 %7, 0
  br i1 %.not75, label %._crit_edge74, label %.lr.ph73

.lr.ph73:                                         ; preds = %12
  %20 = add i64 %6, 1
  %21 = lshr i64 %20, 1
  %22 = trunc i64 %21 to i32
  %23 = sub i64 0, %3
  %.not76 = icmp eq i64 %6, 0
  %24 = zext i8 %10 to i32
  br i1 %.not76, label %25, label %.lr.ph73.split.us

25:                                               ; preds = %.lr.ph73
  %26 = call noundef ptr @_ZN4Simd4BaseL18JpegResampleRowHv2EPhPKhS3_ii(ptr noundef %17, ptr noundef %2, ptr noundef %2, i32 noundef %22, i32 noundef 0)
  %27 = call noundef ptr @_ZN4Simd4BaseL18JpegResampleRowHv2EPhPKhS3_ii(ptr noundef nonnull %19, ptr noundef %4, ptr noundef %4, i32 noundef %22, i32 noundef 0)
  %exitcond79.peel.not = icmp eq i64 %7, 1
  br i1 %exitcond79.peel.not, label %._crit_edge74, label %.lr.ph73.split

.lr.ph73.split.us:                                ; preds = %.lr.ph73, %._crit_edge.us
  %.05671.us = phi ptr [ %48, %._crit_edge.us ], [ %0, %.lr.ph73 ]
  %.05770.us = phi ptr [ %.1.us, %._crit_edge.us ], [ %2, %.lr.ph73 ]
  %.05869.us = phi ptr [ %.159.us, %._crit_edge.us ], [ %4, %.lr.ph73 ]
  %.06068.us = phi i64 [ %50, %._crit_edge.us ], [ 0, %.lr.ph73 ]
  %.06167.us = phi ptr [ %49, %._crit_edge.us ], [ %8, %.lr.ph73 ]
  %28 = and i64 %.06068.us, 1
  %.not.us = icmp eq i64 %28, 0
  %. = select i1 %.not.us, i64 0, i64 %14
  %.85 = select i1 %.not.us, i64 %23, i64 %3
  %29 = icmp eq i64 %.06068.us, %.
  %.idx.us = select i1 %29, i64 0, i64 %.85
  %30 = getelementptr inbounds i8, ptr %.05770.us, i64 %.idx.us
  %31 = call noundef ptr @_ZN4Simd4BaseL18JpegResampleRowHv2EPhPKhS3_ii(ptr noundef %17, ptr noundef %.05770.us, ptr noundef %30, i32 noundef %22, i32 noundef 0)
  %32 = getelementptr inbounds i8, ptr %.05869.us, i64 %.idx.us
  %33 = call noundef ptr @_ZN4Simd4BaseL18JpegResampleRowHv2EPhPKhS3_ii(ptr noundef nonnull %19, ptr noundef %.05869.us, ptr noundef %32, i32 noundef %22, i32 noundef 0)
  br label %34

34:                                               ; preds = %.lr.ph73.split.us, %46
  %.066.us = phi i64 [ 0, %.lr.ph73.split.us ], [ %47, %46 ]
  %35 = getelementptr inbounds i8, ptr %.05671.us, i64 %.066.us
  %36 = load i8, ptr %35, align 1, !tbaa !11
  %37 = zext i8 %36 to i32
  %38 = getelementptr inbounds i8, ptr %17, i64 %.066.us
  %39 = load i8, ptr %38, align 1, !tbaa !11
  %40 = zext i8 %39 to i32
  %41 = getelementptr inbounds i8, ptr %19, i64 %.066.us
  %42 = load i8, ptr %41, align 1, !tbaa !11
  %43 = zext i8 %42 to i32
  %44 = shl i64 %.066.us, 2
  %45 = getelementptr inbounds i8, ptr %.06167.us, i64 %44
  invoke void @_ZN4Simd4Base9YuvToBgraINS0_8Trect871EEEviiiiPh(i32 noundef %37, i32 noundef %40, i32 noundef %43, i32 noundef %24, ptr noundef %45)
          to label %46 unwind label %.split.us

46:                                               ; preds = %34
  %47 = add nuw i64 %.066.us, 1
  %exitcond.not = icmp eq i64 %47, %6
  br i1 %exitcond.not, label %._crit_edge.us, label %34, !llvm.loop !12

._crit_edge.us:                                   ; preds = %46
  %48 = getelementptr inbounds i8, ptr %.05671.us, i64 %1
  %49 = getelementptr inbounds i8, ptr %.06167.us, i64 %9
  %.159.idx.us = select i1 %.not.us, i64 0, i64 %5
  %.159.us = getelementptr inbounds i8, ptr %.05869.us, i64 %.159.idx.us
  %.1.idx.us = select i1 %.not.us, i64 0, i64 %3
  %.1.us = getelementptr inbounds i8, ptr %.05770.us, i64 %.1.idx.us
  %50 = add nuw i64 %.06068.us, 1
  %exitcond78.not = icmp eq i64 %50, %7
  br i1 %exitcond78.not, label %._crit_edge74, label %.lr.ph73.split.us, !llvm.loop !14

.split.us:                                        ; preds = %34
  %51 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN4Simd5ArrayIhED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %13) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #5
  resume { ptr, i32 } %51

._crit_edge74:                                    ; preds = %._crit_edge.us, %.lr.ph73.split, %25, %12
  call void @_ZN4Simd5ArrayIhED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %13) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #5
  ret void

.lr.ph73.split:                                   ; preds = %25, %.lr.ph73.split
  %.05770 = phi ptr [ %.1, %.lr.ph73.split ], [ %2, %25 ]
  %.05869 = phi ptr [ %.159, %.lr.ph73.split ], [ %4, %25 ]
  %.06068 = phi i64 [ %58, %.lr.ph73.split ], [ 1, %25 ]
  %52 = and i64 %.06068, 1
  %.not = icmp eq i64 %52, 0
  %53 = icmp eq i64 %.06068, %14
  %.idx62 = select i1 %53, i64 0, i64 %3
  %.sink84 = select i1 %.not, i64 %23, i64 %.idx62
  %.1.idx = select i1 %.not, i64 0, i64 %3
  %.159.idx = select i1 %.not, i64 0, i64 %5
  %54 = getelementptr inbounds i8, ptr %.05770, i64 %.sink84
  %55 = call noundef ptr @_ZN4Simd4BaseL18JpegResampleRowHv2EPhPKhS3_ii(ptr noundef %17, ptr noundef %.05770, ptr noundef %54, i32 noundef %22, i32 noundef 0)
  %56 = getelementptr inbounds i8, ptr %.05869, i64 %.sink84
  %57 = call noundef ptr @_ZN4Simd4BaseL18JpegResampleRowHv2EPhPKhS3_ii(ptr noundef nonnull %19, ptr noundef %.05869, ptr noundef %56, i32 noundef %22, i32 noundef 0)
  %.159 = getelementptr inbounds i8, ptr %.05869, i64 %.159.idx
  %.1 = getelementptr inbounds i8, ptr %.05770, i64 %.1.idx
  %58 = add nuw i64 %.06068, 1
  %exitcond79.not = icmp eq i64 %58, %7
  br i1 %exitcond79.not, label %._crit_edge74, label %.lr.ph73.split, !llvm.loop !15
}

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN4Simd4Base9YuvToBgraINS0_8Trect871EEEviiiiPh(i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { alwaysinline mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = !{!"_ZTSN4Simd5ArrayIhEE", !7, i64 0, !10, i64 8}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!8, !8, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13, !16}
!16 = !{!"llvm.loop.peeled.count", i32 1}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopFullUnrollPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass