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

49:                                               ; preds = %180, %11
  %50 = load i64, ptr %28, align 8, !tbaa !9
  %51 = load i64, ptr %19, align 8, !tbaa !9
  %52 = icmp ult i64 %50, %51
  br i1 %52, label %54, label %53

53:                                               ; preds = %49
  store i32 2, ptr %29, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #5
  br label %184

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

62:                                               ; preds = %54
  %63 = load i64, ptr %28, align 8, !tbaa !9
  %64 = load i64, ptr %23, align 8, !tbaa !9
  %65 = icmp eq i64 %63, %64
  br i1 %65, label %66, label %68

66:                                               ; preds = %62
  %67 = load ptr, ptr %14, align 8, !tbaa !5
  br label %72

68:                                               ; preds = %62
  %69 = load ptr, ptr %14, align 8, !tbaa !5
  %70 = load i64, ptr %15, align 8, !tbaa !9
  %71 = getelementptr inbounds i8, ptr %69, i64 %70
  br label %72

72:                                               ; preds = %68, %66
  %73 = phi ptr [ %67, %66 ], [ %71, %68 ]
  br label %86

74:                                               ; preds = %54
  %75 = load i64, ptr %28, align 8, !tbaa !9
  %76 = icmp eq i64 %75, 0
  br i1 %76, label %77, label %79

77:                                               ; preds = %74
  %78 = load ptr, ptr %14, align 8, !tbaa !5
  br label %84

79:                                               ; preds = %74
  %80 = load ptr, ptr %14, align 8, !tbaa !5
  %81 = load i64, ptr %15, align 8, !tbaa !9
  %82 = sub i64 0, %81
  %83 = getelementptr inbounds i8, ptr %80, i64 %82
  br label %84

84:                                               ; preds = %79, %77
  %85 = phi ptr [ %78, %77 ], [ %83, %79 ]
  br label %86

86:                                               ; preds = %84, %72
  %87 = phi ptr [ %73, %72 ], [ %85, %84 ]
  %88 = load i64, ptr %24, align 8, !tbaa !9
  %89 = trunc i64 %88 to i32
  %90 = invoke noundef ptr @_ZN4Simd4BaseL18JpegResampleRowHv2EPhPKhS3_ii(ptr noundef %58, ptr noundef %59, ptr noundef %87, i32 noundef %89, i32 noundef 0)
          to label %91 unwind label %131

91:                                               ; preds = %86
  %92 = load ptr, ptr %27, align 8, !tbaa !5
  %93 = load ptr, ptr %16, align 8, !tbaa !5
  %94 = load i32, ptr %30, align 4, !tbaa !15
  %95 = icmp ne i32 %94, 0
  br i1 %95, label %96, label %108

96:                                               ; preds = %91
  %97 = load i64, ptr %28, align 8, !tbaa !9
  %98 = load i64, ptr %23, align 8, !tbaa !9
  %99 = icmp eq i64 %97, %98
  br i1 %99, label %100, label %102

100:                                              ; preds = %96
  %101 = load ptr, ptr %16, align 8, !tbaa !5
  br label %106

102:                                              ; preds = %96
  %103 = load ptr, ptr %16, align 8, !tbaa !5
  %104 = load i64, ptr %15, align 8, !tbaa !9
  %105 = getelementptr inbounds i8, ptr %103, i64 %104
  br label %106

106:                                              ; preds = %102, %100
  %107 = phi ptr [ %101, %100 ], [ %105, %102 ]
  br label %120

108:                                              ; preds = %91
  %109 = load i64, ptr %28, align 8, !tbaa !9
  %110 = icmp eq i64 %109, 0
  br i1 %110, label %111, label %113

111:                                              ; preds = %108
  %112 = load ptr, ptr %16, align 8, !tbaa !5
  br label %118

113:                                              ; preds = %108
  %114 = load ptr, ptr %16, align 8, !tbaa !5
  %115 = load i64, ptr %15, align 8, !tbaa !9
  %116 = sub i64 0, %115
  %117 = getelementptr inbounds i8, ptr %114, i64 %116
  br label %118

118:                                              ; preds = %113, %111
  %119 = phi ptr [ %112, %111 ], [ %117, %113 ]
  br label %120

120:                                              ; preds = %118, %106
  %121 = phi ptr [ %107, %106 ], [ %119, %118 ]
  %122 = load i64, ptr %24, align 8, !tbaa !9
  %123 = trunc i64 %122 to i32
  %124 = invoke noundef ptr @_ZN4Simd4BaseL18JpegResampleRowHv2EPhPKhS3_ii(ptr noundef %92, ptr noundef %93, ptr noundef %121, i32 noundef %123, i32 noundef 0)
          to label %125 unwind label %131

125:                                              ; preds = %120
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #5
  store i64 0, ptr %33, align 8, !tbaa !9
  br label %126

126:                                              ; preds = %156, %125
  %127 = load i64, ptr %33, align 8, !tbaa !9
  %128 = load i64, ptr %18, align 8, !tbaa !9
  %129 = icmp ult i64 %127, %128
  br i1 %129, label %135, label %130

130:                                              ; preds = %126
  store i32 5, ptr %29, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #5
  br label %163

131:                                              ; preds = %120, %86
  %132 = landingpad { ptr, i32 }
          cleanup
  %133 = extractvalue { ptr, i32 } %132, 0
  store ptr %133, ptr %31, align 8
  %134 = extractvalue { ptr, i32 } %132, 1
  store i32 %134, ptr %32, align 4
  br label %183

135:                                              ; preds = %126
  %136 = load ptr, ptr %12, align 8, !tbaa !5
  %137 = load i64, ptr %33, align 8, !tbaa !9
  %138 = getelementptr inbounds i8, ptr %136, i64 %137
  %139 = load i8, ptr %138, align 1, !tbaa !17
  %140 = zext i8 %139 to i32
  %141 = load ptr, ptr %26, align 8, !tbaa !5
  %142 = load i64, ptr %33, align 8, !tbaa !9
  %143 = getelementptr inbounds i8, ptr %141, i64 %142
  %144 = load i8, ptr %143, align 1, !tbaa !17
  %145 = zext i8 %144 to i32
  %146 = load ptr, ptr %27, align 8, !tbaa !5
  %147 = load i64, ptr %33, align 8, !tbaa !9
  %148 = getelementptr inbounds i8, ptr %146, i64 %147
  %149 = load i8, ptr %148, align 1, !tbaa !17
  %150 = zext i8 %149 to i32
  %151 = load ptr, ptr %20, align 8, !tbaa !5
  %152 = load i64, ptr %33, align 8, !tbaa !9
  %153 = mul i64 %152, 3
  %154 = getelementptr inbounds i8, ptr %151, i64 %153
  invoke void @_ZN4Simd4Base8YuvToBgrINS0_8Trect871EEEviiiPh(i32 noundef %140, i32 noundef %145, i32 noundef %150, ptr noundef %154)
          to label %155 unwind label %159

155:                                              ; preds = %135
  br label %156

156:                                              ; preds = %155
  %157 = load i64, ptr %33, align 8, !tbaa !9
  %158 = add i64 %157, 1
  store i64 %158, ptr %33, align 8, !tbaa !9
  br label %126, !llvm.loop !18

159:                                              ; preds = %135
  %160 = landingpad { ptr, i32 }
          cleanup
  %161 = extractvalue { ptr, i32 } %160, 0
  store ptr %161, ptr %31, align 8
  %162 = extractvalue { ptr, i32 } %160, 1
  store i32 %162, ptr %32, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #5
  br label %183

163:                                              ; preds = %130
  %164 = load i64, ptr %13, align 8, !tbaa !9
  %165 = load ptr, ptr %12, align 8, !tbaa !5
  %166 = getelementptr inbounds i8, ptr %165, i64 %164
  store ptr %166, ptr %12, align 8, !tbaa !5
  %167 = load i64, ptr %21, align 8, !tbaa !9
  %168 = load ptr, ptr %20, align 8, !tbaa !5
  %169 = getelementptr inbounds i8, ptr %168, i64 %167
  store ptr %169, ptr %20, align 8, !tbaa !5
  %170 = load i32, ptr %30, align 4, !tbaa !15
  %171 = icmp ne i32 %170, 0
  br i1 %171, label %172, label %179

172:                                              ; preds = %163
  %173 = load i64, ptr %15, align 8, !tbaa !9
  %174 = load ptr, ptr %14, align 8, !tbaa !5
  %175 = getelementptr inbounds i8, ptr %174, i64 %173
  store ptr %175, ptr %14, align 8, !tbaa !5
  %176 = load i64, ptr %17, align 8, !tbaa !9
  %177 = load ptr, ptr %16, align 8, !tbaa !5
  %178 = getelementptr inbounds i8, ptr %177, i64 %176
  store ptr %178, ptr %16, align 8, !tbaa !5
  br label %179

179:                                              ; preds = %172, %163
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #5
  br label %180

180:                                              ; preds = %179
  %181 = load i64, ptr %28, align 8, !tbaa !9
  %182 = add i64 %181, 1
  store i64 %182, ptr %28, align 8, !tbaa !9
  br label %49, !llvm.loop !20

183:                                              ; preds = %159, %131
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  call void @_ZN4Simd5ArrayIhED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %25) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  br label %185

184:                                              ; preds = %53
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  call void @_ZN4Simd5ArrayIhED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %25) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  ret void

185:                                              ; preds = %183
  %186 = load ptr, ptr %31, align 8
  %187 = load i32, ptr %32, align 4
  %188 = insertvalue { ptr, i32 } poison, ptr %186, 0
  %189 = insertvalue { ptr, i32 } %188, i32 %187, 1
  resume { ptr, i32 } %189
}

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

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

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

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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 = { 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 #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 = !{!12, !12, i64 0}
!12 = !{!"_ZTS11SimdYuvType", !7, i64 0}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTSN4Simd5ArrayIhEE", !6, i64 0, !10, i64 8}
!15 = !{!16, !16, i64 0}
!16 = !{!"int", !7, i64 0}
!17 = !{!7, !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 uwtable
define dso_local void @_ZN4Simd4Base16JpegYuv420pToBgrEPKhmS2_mS2_mmmPhm11SimdYuvType(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, i32 noundef %10) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %12 = alloca %"struct.Simd::Array", align 8
  %13 = add i64 %7, -1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #5
  %14 = shl i64 %6, 1
  %15 = add i64 %14, 6
  call void @_ZN4Simd5ArrayIhEC2Embm(ptr noundef nonnull align 8 dereferenceable(16) %12, i64 noundef %15, i1 noundef zeroext false, i64 noundef 8)
  %16 = load ptr, ptr %12, align 8, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %16, i64 %6
  %18 = getelementptr inbounds i8, ptr %17, i64 3
  %.not74 = icmp eq i64 %7, 0
  br i1 %.not74, label %._crit_edge73, label %.lr.ph72

.lr.ph72:                                         ; preds = %11
  %19 = add i64 %6, 1
  %20 = lshr i64 %19, 1
  %21 = trunc i64 %20 to i32
  %22 = sub i64 0, %3
  %.not75 = icmp eq i64 %6, 0
  br i1 %.not75, label %23, label %.lr.ph72.split.us

23:                                               ; preds = %.lr.ph72
  %24 = call noundef ptr @_ZN4Simd4BaseL18JpegResampleRowHv2EPhPKhS3_ii(ptr noundef %16, ptr noundef %2, ptr noundef %2, i32 noundef %21, i32 noundef 0)
  %25 = call noundef ptr @_ZN4Simd4BaseL18JpegResampleRowHv2EPhPKhS3_ii(ptr noundef nonnull %18, ptr noundef %4, ptr noundef %4, i32 noundef %21, i32 noundef 0)
  %exitcond78.peel.not = icmp eq i64 %7, 1
  br i1 %exitcond78.peel.not, label %._crit_edge73, label %.lr.ph72.split

.lr.ph72.split.us:                                ; preds = %.lr.ph72, %._crit_edge.us
  %.05570.us = phi ptr [ %46, %._crit_edge.us ], [ %0, %.lr.ph72 ]
  %.05669.us = phi ptr [ %.1.us, %._crit_edge.us ], [ %2, %.lr.ph72 ]
  %.05768.us = phi ptr [ %.158.us, %._crit_edge.us ], [ %4, %.lr.ph72 ]
  %.05967.us = phi i64 [ %48, %._crit_edge.us ], [ 0, %.lr.ph72 ]
  %.06066.us = phi ptr [ %47, %._crit_edge.us ], [ %8, %.lr.ph72 ]
  %26 = and i64 %.05967.us, 1
  %.not.us = icmp eq i64 %26, 0
  %. = select i1 %.not.us, i64 0, i64 %13
  %.84 = select i1 %.not.us, i64 %22, i64 %3
  %27 = icmp eq i64 %.05967.us, %.
  %.idx.us = select i1 %27, i64 0, i64 %.84
  %28 = getelementptr inbounds i8, ptr %.05669.us, i64 %.idx.us
  %29 = call noundef ptr @_ZN4Simd4BaseL18JpegResampleRowHv2EPhPKhS3_ii(ptr noundef %16, ptr noundef %.05669.us, ptr noundef %28, i32 noundef %21, i32 noundef 0)
  %30 = getelementptr inbounds i8, ptr %.05768.us, i64 %.idx.us
  %31 = call noundef ptr @_ZN4Simd4BaseL18JpegResampleRowHv2EPhPKhS3_ii(ptr noundef nonnull %18, ptr noundef %.05768.us, ptr noundef %30, i32 noundef %21, i32 noundef 0)
  br label %32

32:                                               ; preds = %.lr.ph72.split.us, %44
  %.065.us = phi i64 [ 0, %.lr.ph72.split.us ], [ %45, %44 ]
  %33 = getelementptr inbounds i8, ptr %.05570.us, i64 %.065.us
  %34 = load i8, ptr %33, align 1, !tbaa !11
  %35 = zext i8 %34 to i32
  %36 = getelementptr inbounds i8, ptr %16, i64 %.065.us
  %37 = load i8, ptr %36, align 1, !tbaa !11
  %38 = zext i8 %37 to i32
  %39 = getelementptr inbounds i8, ptr %18, i64 %.065.us
  %40 = load i8, ptr %39, align 1, !tbaa !11
  %41 = zext i8 %40 to i32
  %42 = mul i64 %.065.us, 3
  %43 = getelementptr inbounds i8, ptr %.06066.us, i64 %42
  invoke void @_ZN4Simd4Base8YuvToBgrINS0_8Trect871EEEviiiPh(i32 noundef %35, i32 noundef %38, i32 noundef %41, ptr noundef %43)
          to label %44 unwind label %.split.us

44:                                               ; preds = %32
  %45 = add nuw i64 %.065.us, 1
  %exitcond.not = icmp eq i64 %45, %6
  br i1 %exitcond.not, label %._crit_edge.us, label %32, !llvm.loop !12

._crit_edge.us:                                   ; preds = %44
  %46 = getelementptr inbounds i8, ptr %.05570.us, i64 %1
  %47 = getelementptr inbounds i8, ptr %.06066.us, i64 %9
  %.158.idx.us = select i1 %.not.us, i64 0, i64 %5
  %.158.us = getelementptr inbounds i8, ptr %.05768.us, i64 %.158.idx.us
  %.1.idx.us = select i1 %.not.us, i64 0, i64 %3
  %.1.us = getelementptr inbounds i8, ptr %.05669.us, i64 %.1.idx.us
  %48 = add nuw i64 %.05967.us, 1
  %exitcond77.not = icmp eq i64 %48, %7
  br i1 %exitcond77.not, label %._crit_edge73, label %.lr.ph72.split.us, !llvm.loop !14

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

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

.lr.ph72.split:                                   ; preds = %23, %.lr.ph72.split
  %.05669 = phi ptr [ %.1, %.lr.ph72.split ], [ %2, %23 ]
  %.05768 = phi ptr [ %.158, %.lr.ph72.split ], [ %4, %23 ]
  %.05967 = phi i64 [ %56, %.lr.ph72.split ], [ 1, %23 ]
  %50 = and i64 %.05967, 1
  %.not = icmp eq i64 %50, 0
  %51 = icmp eq i64 %.05967, %13
  %.idx61 = select i1 %51, i64 0, i64 %3
  %.sink83 = select i1 %.not, i64 %22, i64 %.idx61
  %.1.idx = select i1 %.not, i64 0, i64 %3
  %.158.idx = select i1 %.not, i64 0, i64 %5
  %52 = getelementptr inbounds i8, ptr %.05669, i64 %.sink83
  %53 = call noundef ptr @_ZN4Simd4BaseL18JpegResampleRowHv2EPhPKhS3_ii(ptr noundef %16, ptr noundef %.05669, ptr noundef %52, i32 noundef %21, i32 noundef 0)
  %54 = getelementptr inbounds i8, ptr %.05768, i64 %.sink83
  %55 = call noundef ptr @_ZN4Simd4BaseL18JpegResampleRowHv2EPhPKhS3_ii(ptr noundef nonnull %18, ptr noundef %.05768, ptr noundef %54, i32 noundef %21, i32 noundef 0)
  %.158 = getelementptr inbounds i8, ptr %.05768, i64 %.158.idx
  %.1 = getelementptr inbounds i8, ptr %.05669, i64 %.1.idx
  %56 = add nuw i64 %.05967, 1
  %exitcond78.not = icmp eq i64 %56, %7
  br i1 %exitcond78.not, label %._crit_edge73, label %.lr.ph72.split, !llvm.loop !15
}

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

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

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

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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 = { 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 #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