; LLVM IR from ermig1979/Simd :: src/Simd/SimdBaseImageSaveJpeg.ll (ZN4Simd4Base14ImageJpegSaver11WriteHeaderEv)

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

%"class.Simd::ImageSaver" = type { ptr, %"struct.Simd::ImageSaverParam", %"class.Simd::OutputMemoryStream" }
%"struct.Simd::ImageSaverParam" = type { i64, i64, i32, i32, i32, i32 }
%"class.Simd::OutputMemoryStream" = type { i64, ptr, i64, i64, i64, i64, i64 }
%"class.Simd::Base::ImageJpegSaver" = type { %"class.Simd::ImageSaver", %"struct.Simd::Array", ptr, ptr, ptr, ptr, ptr, i8, i32, i32, i32, [64 x float], [64 x float], [64 x i8], [64 x i8] }
%"struct.Simd::Array" = type { ptr, i64 }

@_ZZN4Simd4Base14ImageJpegSaver11WriteHeaderEvE10DC_LUM_COD = external hidden constant [17 x i8], align 16
@_ZZN4Simd4Base14ImageJpegSaver11WriteHeaderEvE10DC_LUM_VAL = external hidden constant [12 x i8], align 1
@_ZZN4Simd4Base14ImageJpegSaver11WriteHeaderEvE10AC_LUM_COD = external hidden constant [17 x i8], align 16
@_ZZN4Simd4Base14ImageJpegSaver11WriteHeaderEvE10AC_LUM_VAL = external hidden constant [162 x i8], align 16
@_ZZN4Simd4Base14ImageJpegSaver11WriteHeaderEvE10DC_CHR_COD = external hidden constant [17 x i8], align 16
@_ZZN4Simd4Base14ImageJpegSaver11WriteHeaderEvE10DC_CHR_VAL = external hidden constant [12 x i8], align 1
@_ZZN4Simd4Base14ImageJpegSaver11WriteHeaderEvE10AC_CHR_COD = external hidden constant [17 x i8], align 16
@_ZZN4Simd4Base14ImageJpegSaver11WriteHeaderEvE10AC_CHR_VAL = external hidden constant [162 x i8], align 16
@_ZZN4Simd4Base14ImageJpegSaver11WriteHeaderEvE5head0 = external hidden constant [25 x i8], align 16
@_ZZN4Simd4Base14ImageJpegSaver11WriteHeaderEvE5head2 = external hidden constant [14 x i8], align 1

; 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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4Simd4Base14ImageJpegSaver11WriteHeaderEv(ptr noundef nonnull align 8 dereferenceable(808) %0) #1 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca [24 x i8], align 16
  store ptr %0, ptr %2, align 8, !tbaa !5
  %4 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #3
  store i8 -1, ptr %3, align 1, !tbaa !9
  %5 = getelementptr inbounds i8, ptr %3, i64 1
  store i8 -64, ptr %5, align 1, !tbaa !9
  %6 = getelementptr inbounds i8, ptr %3, i64 2
  store i8 0, ptr %6, align 1, !tbaa !9
  %7 = getelementptr inbounds i8, ptr %3, i64 3
  store i8 17, ptr %7, align 1, !tbaa !9
  %8 = getelementptr inbounds i8, ptr %3, i64 4
  store i8 8, ptr %8, align 1, !tbaa !9
  %9 = getelementptr inbounds i8, ptr %3, i64 5
  %10 = getelementptr inbounds %"class.Simd::ImageSaver", ptr %4, i32 0, i32 1
  %11 = getelementptr inbounds %"struct.Simd::ImageSaverParam", ptr %10, i32 0, i32 1
  %12 = load i64, ptr %11, align 8, !tbaa !10
  %13 = lshr i64 %12, 8
  %14 = trunc i64 %13 to i8
  store i8 %14, ptr %9, align 1, !tbaa !9
  %15 = getelementptr inbounds i8, ptr %3, i64 6
  %16 = getelementptr inbounds %"class.Simd::ImageSaver", ptr %4, i32 0, i32 1
  %17 = getelementptr inbounds %"struct.Simd::ImageSaverParam", ptr %16, i32 0, i32 1
  %18 = load i64, ptr %17, align 8, !tbaa !10
  %19 = trunc i64 %18 to i8
  store i8 %19, ptr %15, align 1, !tbaa !9
  %20 = getelementptr inbounds i8, ptr %3, i64 7
  %21 = getelementptr inbounds %"class.Simd::ImageSaver", ptr %4, i32 0, i32 1
  %22 = getelementptr inbounds %"struct.Simd::ImageSaverParam", ptr %21, i32 0, i32 0
  %23 = load i64, ptr %22, align 8, !tbaa !19
  %24 = lshr i64 %23, 8
  %25 = trunc i64 %24 to i8
  store i8 %25, ptr %20, align 1, !tbaa !9
  %26 = getelementptr inbounds i8, ptr %3, i64 8
  %27 = getelementptr inbounds %"class.Simd::ImageSaver", ptr %4, i32 0, i32 1
  %28 = getelementptr inbounds %"struct.Simd::ImageSaverParam", ptr %27, i32 0, i32 0
  %29 = load i64, ptr %28, align 8, !tbaa !19
  %30 = trunc i64 %29 to i8
  store i8 %30, ptr %26, align 1, !tbaa !9
  %31 = getelementptr inbounds i8, ptr %3, i64 9
  store i8 3, ptr %31, align 1, !tbaa !9
  %32 = getelementptr inbounds i8, ptr %3, i64 10
  store i8 1, ptr %32, align 1, !tbaa !9
  %33 = getelementptr inbounds i8, ptr %3, i64 11
  %34 = getelementptr inbounds %"class.Simd::Base::ImageJpegSaver", ptr %4, i32 0, i32 7
  %35 = load i8, ptr %34, align 8, !tbaa !20, !range !24, !noundef !25
  %36 = trunc i8 %35 to i1
  %37 = zext i1 %36 to i64
  %38 = select i1 %36, i32 34, i32 17
  %39 = trunc i32 %38 to i8
  store i8 %39, ptr %33, align 1, !tbaa !9
  %40 = getelementptr inbounds i8, ptr %3, i64 12
  store i8 0, ptr %40, align 1, !tbaa !9
  %41 = getelementptr inbounds i8, ptr %3, i64 13
  store i8 2, ptr %41, align 1, !tbaa !9
  %42 = getelementptr inbounds i8, ptr %3, i64 14
  store i8 17, ptr %42, align 1, !tbaa !9
  %43 = getelementptr inbounds i8, ptr %3, i64 15
  store i8 1, ptr %43, align 1, !tbaa !9
  %44 = getelementptr inbounds i8, ptr %3, i64 16
  store i8 3, ptr %44, align 1, !tbaa !9
  %45 = getelementptr inbounds i8, ptr %3, i64 17
  store i8 17, ptr %45, align 1, !tbaa !9
  %46 = getelementptr inbounds i8, ptr %3, i64 18
  store i8 1, ptr %46, align 1, !tbaa !9
  %47 = getelementptr inbounds i8, ptr %3, i64 19
  store i8 -1, ptr %47, align 1, !tbaa !9
  %48 = getelementptr inbounds i8, ptr %3, i64 20
  store i8 -60, ptr %48, align 1, !tbaa !9
  %49 = getelementptr inbounds i8, ptr %3, i64 21
  store i8 1, ptr %49, align 1, !tbaa !9
  %50 = getelementptr inbounds i8, ptr %3, i64 22
  store i8 -94, ptr %50, align 1, !tbaa !9
  %51 = getelementptr inbounds i8, ptr %3, i64 23
  store i8 0, ptr %51, align 1, !tbaa !9
  %52 = getelementptr inbounds %"class.Simd::ImageSaver", ptr %4, i32 0, i32 2
  call void @_ZN4Simd18OutputMemoryStream5WriteEPKvm(ptr noundef nonnull align 8 dereferenceable(56) %52, ptr noundef @_ZZN4Simd4Base14ImageJpegSaver11WriteHeaderEvE5head0, i64 noundef 25)
  %53 = getelementptr inbounds %"class.Simd::ImageSaver", ptr %4, i32 0, i32 2
  %54 = getelementptr inbounds %"class.Simd::Base::ImageJpegSaver", ptr %4, i32 0, i32 13
  %55 = getelementptr inbounds [64 x i8], ptr %54, i64 0, i64 0
  call void @_ZN4Simd18OutputMemoryStream5WriteEPKvm(ptr noundef nonnull align 8 dereferenceable(56) %53, ptr noundef %55, i64 noundef 64)
  %56 = getelementptr inbounds %"class.Simd::ImageSaver", ptr %4, i32 0, i32 2
  call void @_ZN4Simd18OutputMemoryStream7Write8uEh(ptr noundef nonnull align 8 dereferenceable(56) %56, i8 noundef zeroext 1)
  %57 = getelementptr inbounds %"class.Simd::ImageSaver", ptr %4, i32 0, i32 2
  %58 = getelementptr inbounds %"class.Simd::Base::ImageJpegSaver", ptr %4, i32 0, i32 14
  %59 = getelementptr inbounds [64 x i8], ptr %58, i64 0, i64 0
  call void @_ZN4Simd18OutputMemoryStream5WriteEPKvm(ptr noundef nonnull align 8 dereferenceable(56) %57, ptr noundef %59, i64 noundef 64)
  %60 = getelementptr inbounds %"class.Simd::ImageSaver", ptr %4, i32 0, i32 2
  %61 = getelementptr inbounds [24 x i8], ptr %3, i64 0, i64 0
  call void @_ZN4Simd18OutputMemoryStream5WriteEPKvm(ptr noundef nonnull align 8 dereferenceable(56) %60, ptr noundef %61, i64 noundef 24)
  %62 = getelementptr inbounds %"class.Simd::ImageSaver", ptr %4, i32 0, i32 2
  call void @_ZN4Simd18OutputMemoryStream5WriteEPKvm(ptr noundef nonnull align 8 dereferenceable(56) %62, ptr noundef getelementptr inbounds (i8, ptr @_ZZN4Simd4Base14ImageJpegSaver11WriteHeaderEvE10DC_LUM_COD, i64 1), i64 noundef 16)
  %63 = getelementptr inbounds %"class.Simd::ImageSaver", ptr %4, i32 0, i32 2
  call void @_ZN4Simd18OutputMemoryStream5WriteEPKvm(ptr noundef nonnull align 8 dereferenceable(56) %63, ptr noundef @_ZZN4Simd4Base14ImageJpegSaver11WriteHeaderEvE10DC_LUM_VAL, i64 noundef 12)
  %64 = getelementptr inbounds %"class.Simd::ImageSaver", ptr %4, i32 0, i32 2
  call void @_ZN4Simd18OutputMemoryStream7Write8uEh(ptr noundef nonnull align 8 dereferenceable(56) %64, i8 noundef zeroext 16)
  %65 = getelementptr inbounds %"class.Simd::ImageSaver", ptr %4, i32 0, i32 2
  call void @_ZN4Simd18OutputMemoryStream5WriteEPKvm(ptr noundef nonnull align 8 dereferenceable(56) %65, ptr noundef getelementptr inbounds (i8, ptr @_ZZN4Simd4Base14ImageJpegSaver11WriteHeaderEvE10AC_LUM_COD, i64 1), i64 noundef 16)
  %66 = getelementptr inbounds %"class.Simd::ImageSaver", ptr %4, i32 0, i32 2
  call void @_ZN4Simd18OutputMemoryStream5WriteEPKvm(ptr noundef nonnull align 8 dereferenceable(56) %66, ptr noundef @_ZZN4Simd4Base14ImageJpegSaver11WriteHeaderEvE10AC_LUM_VAL, i64 noundef 162)
  %67 = getelementptr inbounds %"class.Simd::ImageSaver", ptr %4, i32 0, i32 2
  call void @_ZN4Simd18OutputMemoryStream7Write8uEh(ptr noundef nonnull align 8 dereferenceable(56) %67, i8 noundef zeroext 1)
  %68 = getelementptr inbounds %"class.Simd::ImageSaver", ptr %4, i32 0, i32 2
  call void @_ZN4Simd18OutputMemoryStream5WriteEPKvm(ptr noundef nonnull align 8 dereferenceable(56) %68, ptr noundef getelementptr inbounds (i8, ptr @_ZZN4Simd4Base14ImageJpegSaver11WriteHeaderEvE10DC_CHR_COD, i64 1), i64 noundef 16)
  %69 = getelementptr inbounds %"class.Simd::ImageSaver", ptr %4, i32 0, i32 2
  call void @_ZN4Simd18OutputMemoryStream5WriteEPKvm(ptr noundef nonnull align 8 dereferenceable(56) %69, ptr noundef @_ZZN4Simd4Base14ImageJpegSaver11WriteHeaderEvE10DC_CHR_VAL, i64 noundef 12)
  %70 = getelementptr inbounds %"class.Simd::ImageSaver", ptr %4, i32 0, i32 2
  call void @_ZN4Simd18OutputMemoryStream7Write8uEh(ptr noundef nonnull align 8 dereferenceable(56) %70, i8 noundef zeroext 17)
  %71 = getelementptr inbounds %"class.Simd::ImageSaver", ptr %4, i32 0, i32 2
  call void @_ZN4Simd18OutputMemoryStream5WriteEPKvm(ptr noundef nonnull align 8 dereferenceable(56) %71, ptr noundef getelementptr inbounds (i8, ptr @_ZZN4Simd4Base14ImageJpegSaver11WriteHeaderEvE10AC_CHR_COD, i64 1), i64 noundef 16)
  %72 = getelementptr inbounds %"class.Simd::ImageSaver", ptr %4, i32 0, i32 2
  call void @_ZN4Simd18OutputMemoryStream5WriteEPKvm(ptr noundef nonnull align 8 dereferenceable(56) %72, ptr noundef @_ZZN4Simd4Base14ImageJpegSaver11WriteHeaderEvE10AC_CHR_VAL, i64 noundef 162)
  %73 = getelementptr inbounds %"class.Simd::ImageSaver", ptr %4, i32 0, i32 2
  call void @_ZN4Simd18OutputMemoryStream5WriteEPKvm(ptr noundef nonnull align 8 dereferenceable(56) %73, ptr noundef @_ZZN4Simd4Base14ImageJpegSaver11WriteHeaderEvE5head2, i64 noundef 14)
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #3
  ret void
}

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN4Simd18OutputMemoryStream5WriteEPKvm(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef, i64 noundef) #2 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN4Simd18OutputMemoryStream7Write8uEh(ptr noundef nonnull align 8 dereferenceable(56), i8 noundef zeroext) #2 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { 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 #3 = { 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 = !{!7, !7, i64 0}
!10 = !{!11, !13, i64 16}
!11 = !{!"_ZTSN4Simd10ImageSaverE", !12, i64 8, !18, i64 40}
!12 = !{!"_ZTSN4Simd15ImageSaverParamE", !13, i64 0, !13, i64 8, !14, i64 16, !15, i64 20, !16, i64 24, !17, i64 28}
!13 = !{!"long", !7, i64 0}
!14 = !{!"_ZTS19SimdPixelFormatType", !7, i64 0}
!15 = !{!"_ZTS17SimdImageFileType", !7, i64 0}
!16 = !{!"int", !7, i64 0}
!17 = !{!"_ZTS11SimdYuvType", !7, i64 0}
!18 = !{!"_ZTSN4Simd18OutputMemoryStreamE", !13, i64 0, !6, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !13, i64 48}
!19 = !{!11, !13, i64 8}
!20 = !{!21, !23, i64 152}
!21 = !{!"_ZTSN4Simd4Base14ImageJpegSaverE", !11, i64 0, !22, i64 96, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !23, i64 152, !16, i64 156, !16, i64 160, !16, i64 164, !7, i64 168, !7, i64 424, !7, i64 680, !7, i64 744}
!22 = !{!"_ZTSN4Simd5ArrayIhEE", !6, i64 0, !13, i64 8}
!23 = !{!"bool", !7, i64 0}
!24 = !{i8 0, i8 2}
!25 = !{}


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

@_ZZN4Simd4Base14ImageJpegSaver11WriteHeaderEvE10DC_LUM_COD = external hidden constant [17 x i8], align 16
@_ZZN4Simd4Base14ImageJpegSaver11WriteHeaderEvE10DC_LUM_VAL = external hidden constant [12 x i8], align 1
@_ZZN4Simd4Base14ImageJpegSaver11WriteHeaderEvE10AC_LUM_COD = external hidden constant [17 x i8], align 16
@_ZZN4Simd4Base14ImageJpegSaver11WriteHeaderEvE10AC_LUM_VAL = external hidden constant [162 x i8], align 16
@_ZZN4Simd4Base14ImageJpegSaver11WriteHeaderEvE10DC_CHR_COD = external hidden constant [17 x i8], align 16
@_ZZN4Simd4Base14ImageJpegSaver11WriteHeaderEvE10DC_CHR_VAL = external hidden constant [12 x i8], align 1
@_ZZN4Simd4Base14ImageJpegSaver11WriteHeaderEvE10AC_CHR_COD = external hidden constant [17 x i8], align 16
@_ZZN4Simd4Base14ImageJpegSaver11WriteHeaderEvE10AC_CHR_VAL = external hidden constant [162 x i8], align 16
@_ZZN4Simd4Base14ImageJpegSaver11WriteHeaderEvE5head0 = external hidden constant [25 x i8], align 16
@_ZZN4Simd4Base14ImageJpegSaver11WriteHeaderEvE5head2 = external hidden constant [14 x i8], align 1

; 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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4Simd4Base14ImageJpegSaver11WriteHeaderEv(ptr noundef nonnull align 8 dereferenceable(808) %0) local_unnamed_addr #1 align 2 {
  %2 = alloca [24 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #3
  store <4 x i8> <i8 -1, i8 -64, i8 0, i8 17>, ptr %2, align 16, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %2, i64 4
  store i8 8, ptr %3, align 4, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %2, i64 5
  %5 = getelementptr inbounds i8, ptr %0, i64 8
  %6 = getelementptr inbounds i8, ptr %0, i64 16
  %7 = load i64, ptr %6, align 8, !tbaa !8
  %8 = lshr i64 %7, 8
  %9 = trunc i64 %8 to i8
  store i8 %9, ptr %4, align 1, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %2, i64 6
  %11 = trunc i64 %7 to i8
  store i8 %11, ptr %10, align 2, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %2, i64 7
  %13 = load i64, ptr %5, align 8, !tbaa !18
  %14 = lshr i64 %13, 8
  %15 = trunc i64 %14 to i8
  store i8 %15, ptr %12, align 1, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %2, i64 8
  %17 = trunc i64 %13 to i8
  store i8 %17, ptr %16, align 8, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %2, i64 9
  store i8 3, ptr %18, align 1, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %2, i64 10
  store i8 1, ptr %19, align 2, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %2, i64 11
  %21 = getelementptr inbounds i8, ptr %0, i64 152
  %22 = load i8, ptr %21, align 8, !tbaa !19, !range !23, !noundef !24
  %23 = trunc nuw i8 %22 to i1
  %24 = select i1 %23, i8 34, i8 17
  store i8 %24, ptr %20, align 1, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %2, i64 12
  store <8 x i8> <i8 0, i8 2, i8 17, i8 1, i8 3, i8 17, i8 1, i8 -1>, ptr %25, align 4, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %2, i64 20
  store <4 x i8> <i8 -60, i8 1, i8 -94, i8 0>, ptr %26, align 4, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %0, i64 40
  tail call void @_ZN4Simd18OutputMemoryStream5WriteEPKvm(ptr noundef nonnull align 8 dereferenceable(56) %27, ptr noundef nonnull @_ZZN4Simd4Base14ImageJpegSaver11WriteHeaderEvE5head0, i64 noundef 25)
  %28 = getelementptr inbounds i8, ptr %0, i64 680
  tail call void @_ZN4Simd18OutputMemoryStream5WriteEPKvm(ptr noundef nonnull align 8 dereferenceable(56) %27, ptr noundef nonnull %28, i64 noundef 64)
  tail call void @_ZN4Simd18OutputMemoryStream7Write8uEh(ptr noundef nonnull align 8 dereferenceable(56) %27, i8 noundef zeroext 1)
  %29 = getelementptr inbounds i8, ptr %0, i64 744
  tail call void @_ZN4Simd18OutputMemoryStream5WriteEPKvm(ptr noundef nonnull align 8 dereferenceable(56) %27, ptr noundef nonnull %29, i64 noundef 64)
  call void @_ZN4Simd18OutputMemoryStream5WriteEPKvm(ptr noundef nonnull align 8 dereferenceable(56) %27, ptr noundef nonnull %2, i64 noundef 24)
  call void @_ZN4Simd18OutputMemoryStream5WriteEPKvm(ptr noundef nonnull align 8 dereferenceable(56) %27, ptr noundef nonnull getelementptr inbounds (i8, ptr @_ZZN4Simd4Base14ImageJpegSaver11WriteHeaderEvE10DC_LUM_COD, i64 1), i64 noundef 16)
  call void @_ZN4Simd18OutputMemoryStream5WriteEPKvm(ptr noundef nonnull align 8 dereferenceable(56) %27, ptr noundef nonnull @_ZZN4Simd4Base14ImageJpegSaver11WriteHeaderEvE10DC_LUM_VAL, i64 noundef 12)
  call void @_ZN4Simd18OutputMemoryStream7Write8uEh(ptr noundef nonnull align 8 dereferenceable(56) %27, i8 noundef zeroext 16)
  call void @_ZN4Simd18OutputMemoryStream5WriteEPKvm(ptr noundef nonnull align 8 dereferenceable(56) %27, ptr noundef nonnull getelementptr inbounds (i8, ptr @_ZZN4Simd4Base14ImageJpegSaver11WriteHeaderEvE10AC_LUM_COD, i64 1), i64 noundef 16)
  call void @_ZN4Simd18OutputMemoryStream5WriteEPKvm(ptr noundef nonnull align 8 dereferenceable(56) %27, ptr noundef nonnull @_ZZN4Simd4Base14ImageJpegSaver11WriteHeaderEvE10AC_LUM_VAL, i64 noundef 162)
  call void @_ZN4Simd18OutputMemoryStream7Write8uEh(ptr noundef nonnull align 8 dereferenceable(56) %27, i8 noundef zeroext 1)
  call void @_ZN4Simd18OutputMemoryStream5WriteEPKvm(ptr noundef nonnull align 8 dereferenceable(56) %27, ptr noundef nonnull getelementptr inbounds (i8, ptr @_ZZN4Simd4Base14ImageJpegSaver11WriteHeaderEvE10DC_CHR_COD, i64 1), i64 noundef 16)
  call void @_ZN4Simd18OutputMemoryStream5WriteEPKvm(ptr noundef nonnull align 8 dereferenceable(56) %27, ptr noundef nonnull @_ZZN4Simd4Base14ImageJpegSaver11WriteHeaderEvE10DC_CHR_VAL, i64 noundef 12)
  call void @_ZN4Simd18OutputMemoryStream7Write8uEh(ptr noundef nonnull align 8 dereferenceable(56) %27, i8 noundef zeroext 17)
  call void @_ZN4Simd18OutputMemoryStream5WriteEPKvm(ptr noundef nonnull align 8 dereferenceable(56) %27, ptr noundef nonnull getelementptr inbounds (i8, ptr @_ZZN4Simd4Base14ImageJpegSaver11WriteHeaderEvE10AC_CHR_COD, i64 1), i64 noundef 16)
  call void @_ZN4Simd18OutputMemoryStream5WriteEPKvm(ptr noundef nonnull align 8 dereferenceable(56) %27, ptr noundef nonnull @_ZZN4Simd4Base14ImageJpegSaver11WriteHeaderEvE10AC_CHR_VAL, i64 noundef 162)
  call void @_ZN4Simd18OutputMemoryStream5WriteEPKvm(ptr noundef nonnull align 8 dereferenceable(56) %27, ptr noundef nonnull @_ZZN4Simd4Base14ImageJpegSaver11WriteHeaderEvE5head2, i64 noundef 14)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #3
  ret void
}

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN4Simd18OutputMemoryStream5WriteEPKvm(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef, i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN4Simd18OutputMemoryStream7Write8uEh(ptr noundef nonnull align 8 dereferenceable(56), i8 noundef zeroext) local_unnamed_addr #2 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { 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 #3 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !11, i64 16}
!9 = !{!"_ZTSN4Simd10ImageSaverE", !10, i64 8, !16, i64 40}
!10 = !{!"_ZTSN4Simd15ImageSaverParamE", !11, i64 0, !11, i64 8, !12, i64 16, !13, i64 20, !14, i64 24, !15, i64 28}
!11 = !{!"long", !6, i64 0}
!12 = !{!"_ZTS19SimdPixelFormatType", !6, i64 0}
!13 = !{!"_ZTS17SimdImageFileType", !6, i64 0}
!14 = !{!"int", !6, i64 0}
!15 = !{!"_ZTS11SimdYuvType", !6, i64 0}
!16 = !{!"_ZTSN4Simd18OutputMemoryStreamE", !11, i64 0, !17, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48}
!17 = !{!"any pointer", !6, i64 0}
!18 = !{!9, !11, i64 8}
!19 = !{!20, !22, i64 152}
!20 = !{!"_ZTSN4Simd4Base14ImageJpegSaverE", !9, i64 0, !21, i64 96, !17, i64 112, !17, i64 120, !17, i64 128, !17, i64 136, !17, i64 144, !22, i64 152, !14, i64 156, !14, i64 160, !14, i64 164, !6, i64 168, !6, i64 424, !6, i64 680, !6, i64 744}
!21 = !{!"_ZTSN4Simd5ArrayIhEE", !17, i64 0, !11, i64 8}
!22 = !{!"bool", !6, i64 0}
!23 = !{i8 0, i8 2}
!24 = !{}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,SLPVectorizerPass,SROAPass,TailCallElimPass