; LLVM IR from team-charls/charls :: src/jpeg_stream_reader.ll (ZN6charls18jpeg_stream_reader27read_start_of_frame_segmentEv)

; 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.charls::jpeg_stream_reader" = type { ptr, ptr, %"class.charls::span", %struct.charls_frame_info, %"struct.charls::coding_parameters", %struct.charls_jpegls_pc_parameters, %"class.std::vector", %"class.std::vector.0", i32, i32, i32, i32, i8, i32, %"struct.charls::callback_function", %"struct.charls::callback_function.5" }
%"class.charls::span" = type { ptr, i64 }
%struct.charls_frame_info = type { i32, i32, i32, i32 }
%"struct.charls::coding_parameters" = type { i32, i32, i32, i32 }
%struct.charls_jpegls_pc_parameters = type { i32, i32, i32, i32, i32 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<charls::jpeg_stream_reader::component_info, std::allocator<charls::jpeg_stream_reader::component_info>>::_Vector_impl" }
%"struct.std::_Vector_base<charls::jpeg_stream_reader::component_info, std::allocator<charls::jpeg_stream_reader::component_info>>::_Vector_impl" = type { %"struct.std::_Vector_base<charls::jpeg_stream_reader::component_info, std::allocator<charls::jpeg_stream_reader::component_info>>::_Vector_impl_data" }
%"struct.std::_Vector_base<charls::jpeg_stream_reader::component_info, std::allocator<charls::jpeg_stream_reader::component_info>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<charls::jpeg_stream_reader::mapping_table_entry, std::allocator<charls::jpeg_stream_reader::mapping_table_entry>>::_Vector_impl" }
%"struct.std::_Vector_base<charls::jpeg_stream_reader::mapping_table_entry, std::allocator<charls::jpeg_stream_reader::mapping_table_entry>>::_Vector_impl" = type { %"struct.std::_Vector_base<charls::jpeg_stream_reader::mapping_table_entry, std::allocator<charls::jpeg_stream_reader::mapping_table_entry>>::_Vector_impl_data" }
%"struct.std::_Vector_base<charls::jpeg_stream_reader::mapping_table_entry, std::allocator<charls::jpeg_stream_reader::mapping_table_entry>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.charls::callback_function" = type { ptr, ptr }
%"struct.charls::callback_function.5" = type { ptr, ptr }

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare i64 @llvm.expect.i64(i64, i64) #0

; Function Attrs: mustprogress noinline noreturn uwtable
declare dso_local void @_ZN6charls4impl18throw_jpegls_errorENS_11jpegls_errcE(i32 noundef) #1

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6charls18jpeg_stream_reader27read_start_of_frame_segmentEv(ptr noundef nonnull align 8 dereferenceable(192) %0) #3 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i8, align 1
  store ptr %0, ptr %2, align 8, !tbaa !5
  %5 = load ptr, ptr %2, align 8
  call void @_ZNK6charls18jpeg_stream_reader26check_minimal_segment_sizeEm(ptr noundef nonnull align 8 dereferenceable(192) %5, i64 noundef 6)
  %6 = call noundef zeroext i8 @_ZN6charls18jpeg_stream_reader10read_uint8Ev(ptr noundef nonnull align 8 dereferenceable(192) %5) #5
  %7 = zext i8 %6 to i32
  %8 = getelementptr inbounds %"class.charls::jpeg_stream_reader", ptr %5, i32 0, i32 3
  %9 = getelementptr inbounds %struct.charls_frame_info, ptr %8, i32 0, i32 2
  store i32 %7, ptr %9, align 8, !tbaa !9
  %10 = getelementptr inbounds %"class.charls::jpeg_stream_reader", ptr %5, i32 0, i32 3
  %11 = getelementptr inbounds %struct.charls_frame_info, ptr %10, i32 0, i32 2
  %12 = load i32, ptr %11, align 8, !tbaa !9
  %13 = icmp slt i32 %12, 2
  br i1 %13, label %19, label %14

14:                                               ; preds = %1
  %15 = getelementptr inbounds %"class.charls::jpeg_stream_reader", ptr %5, i32 0, i32 3
  %16 = getelementptr inbounds %struct.charls_frame_info, ptr %15, i32 0, i32 2
  %17 = load i32, ptr %16, align 8, !tbaa !9
  %18 = icmp sgt i32 %17, 16
  br label %19

19:                                               ; preds = %14, %1
  %20 = phi i1 [ true, %1 ], [ %18, %14 ]
  %21 = xor i1 %20, true
  %22 = xor i1 %21, true
  %23 = zext i1 %22 to i64
  %24 = call i64 @llvm.expect.i64(i64 %23, i64 0)
  %25 = icmp ne i64 %24, 0
  br i1 %25, label %26, label %27

26:                                               ; preds = %19
  call void @_ZN6charls4impl18throw_jpegls_errorENS_11jpegls_errcE(i32 noundef 31) #6
  unreachable

27:                                               ; preds = %19
  %28 = call noundef zeroext i16 @_ZN6charls18jpeg_stream_reader11read_uint16Ev(ptr noundef nonnull align 8 dereferenceable(192) %5) #5
  %29 = zext i16 %28 to i32
  call void @_ZN6charls18jpeg_stream_reader17frame_info_heightEjb(ptr noundef nonnull align 8 dereferenceable(192) %5, i32 noundef %29, i1 noundef zeroext false)
  %30 = call noundef zeroext i16 @_ZN6charls18jpeg_stream_reader11read_uint16Ev(ptr noundef nonnull align 8 dereferenceable(192) %5) #5
  %31 = zext i16 %30 to i32
  call void @_ZN6charls18jpeg_stream_reader16frame_info_widthEj(ptr noundef nonnull align 8 dereferenceable(192) %5, i32 noundef %31)
  %32 = call noundef zeroext i8 @_ZN6charls18jpeg_stream_reader10read_uint8Ev(ptr noundef nonnull align 8 dereferenceable(192) %5) #5
  %33 = zext i8 %32 to i32
  %34 = getelementptr inbounds %"class.charls::jpeg_stream_reader", ptr %5, i32 0, i32 3
  %35 = getelementptr inbounds %struct.charls_frame_info, ptr %34, i32 0, i32 3
  store i32 %33, ptr %35, align 4, !tbaa !32
  %36 = getelementptr inbounds %"class.charls::jpeg_stream_reader", ptr %5, i32 0, i32 3
  %37 = getelementptr inbounds %struct.charls_frame_info, ptr %36, i32 0, i32 3
  %38 = load i32, ptr %37, align 4, !tbaa !32
  %39 = icmp eq i32 %38, 0
  %40 = xor i1 %39, true
  %41 = xor i1 %40, true
  %42 = zext i1 %41 to i64
  %43 = call i64 @llvm.expect.i64(i64 %42, i64 0)
  %44 = icmp ne i64 %43, 0
  br i1 %44, label %45, label %46

45:                                               ; preds = %27
  call void @_ZN6charls4impl18throw_jpegls_errorENS_11jpegls_errcE(i32 noundef 32) #6
  unreachable

46:                                               ; preds = %27
  %47 = getelementptr inbounds %"class.charls::jpeg_stream_reader", ptr %5, i32 0, i32 3
  %48 = getelementptr inbounds %struct.charls_frame_info, ptr %47, i32 0, i32 3
  %49 = load i32, ptr %48, align 4, !tbaa !32
  %50 = sext i32 %49 to i64
  %51 = mul i64 %50, 3
  %52 = add i64 %51, 6
  call void @_ZNK6charls18jpeg_stream_reader18check_segment_sizeEm(ptr noundef nonnull align 8 dereferenceable(192) %5, i64 noundef %52)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !33
  br label %53

53:                                               ; preds = %73, %46
  %54 = load i32, ptr %3, align 4, !tbaa !33
  %55 = getelementptr inbounds %"class.charls::jpeg_stream_reader", ptr %5, i32 0, i32 3
  %56 = getelementptr inbounds %struct.charls_frame_info, ptr %55, i32 0, i32 3
  %57 = load i32, ptr %56, align 4, !tbaa !32
  %58 = icmp ne i32 %54, %57
  br i1 %58, label %60, label %59

59:                                               ; preds = %53
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %76

60:                                               ; preds = %53
  %61 = call noundef zeroext i8 @_ZN6charls18jpeg_stream_reader10read_uint8Ev(ptr noundef nonnull align 8 dereferenceable(192) %5) #5
  call void @_ZN6charls18jpeg_stream_reader13add_componentEh(ptr noundef nonnull align 8 dereferenceable(192) %5, i8 noundef zeroext %61)
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #5
  %62 = call noundef zeroext i8 @_ZN6charls18jpeg_stream_reader10read_uint8Ev(ptr noundef nonnull align 8 dereferenceable(192) %5) #5
  store i8 %62, ptr %4, align 1, !tbaa !34
  %63 = load i8, ptr %4, align 1, !tbaa !34
  %64 = zext i8 %63 to i32
  %65 = icmp ne i32 %64, 17
  %66 = xor i1 %65, true
  %67 = xor i1 %66, true
  %68 = zext i1 %67 to i64
  %69 = call i64 @llvm.expect.i64(i64 %68, i64 0)
  %70 = icmp ne i64 %69, 0
  br i1 %70, label %71, label %72

71:                                               ; preds = %60
  call void @_ZN6charls4impl18throw_jpegls_errorENS_11jpegls_errcE(i32 noundef 7) #6
  unreachable

72:                                               ; preds = %60
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #5
  call void @_ZN6charls18jpeg_stream_reader9skip_byteEv(ptr noundef nonnull align 8 dereferenceable(192) %5) #5
  br label %73

73:                                               ; preds = %72
  %74 = load i32, ptr %3, align 4, !tbaa !33
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr %3, align 4, !tbaa !33
  br label %53, !llvm.loop !35

76:                                               ; preds = %59
  %77 = getelementptr inbounds %"class.charls::jpeg_stream_reader", ptr %5, i32 0, i32 8
  store i32 4, ptr %77, align 8, !tbaa !37
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK6charls18jpeg_stream_reader26check_minimal_segment_sizeEm(ptr noundef nonnull align 8 dereferenceable(192), i64 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK6charls18jpeg_stream_reader18check_segment_sizeEm(ptr noundef nonnull align 8 dereferenceable(192), i64 noundef) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i8 @_ZN6charls18jpeg_stream_reader10read_uint8Ev(ptr noundef nonnull align 8 dereferenceable(192)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6charls18jpeg_stream_reader17frame_info_heightEjb(ptr noundef nonnull align 8 dereferenceable(192), i32 noundef, i1 noundef zeroext) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i16 @_ZN6charls18jpeg_stream_reader11read_uint16Ev(ptr noundef nonnull align 8 dereferenceable(192)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6charls18jpeg_stream_reader16frame_info_widthEj(ptr noundef nonnull align 8 dereferenceable(192), i32 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6charls18jpeg_stream_reader13add_componentEh(ptr noundef nonnull align 8 dereferenceable(192), i8 noundef zeroext) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6charls18jpeg_stream_reader9skip_byteEv(ptr noundef nonnull align 8 dereferenceable(192)) #4 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(none) }
attributes #1 = { mustprogress noinline noreturn 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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 }
attributes #6 = { noreturn }

!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, !14, i64 40}
!10 = !{!"_ZTSN6charls18jpeg_stream_readerE", !6, i64 0, !6, i64 8, !11, i64 16, !13, i64 32, !15, i64 48, !18, i64 64, !19, i64 88, !23, i64 112, !27, i64 136, !14, i64 140, !14, i64 144, !16, i64 148, !28, i64 152, !29, i64 156, !30, i64 160, !31, i64 176}
!11 = !{!"_ZTSN6charls4spanIKSt4byteEE", !6, i64 0, !12, i64 8}
!12 = !{!"long", !7, i64 0}
!13 = !{!"_ZTS17charls_frame_info", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12}
!14 = !{!"int", !7, i64 0}
!15 = !{!"_ZTSN6charls17coding_parametersE", !14, i64 0, !14, i64 4, !16, i64 8, !17, i64 12}
!16 = !{!"_ZTSN6charls15interleave_modeE", !7, i64 0}
!17 = !{!"_ZTSN6charls20color_transformationE", !7, i64 0}
!18 = !{!"_ZTS27charls_jpegls_pc_parameters", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !14, i64 16}
!19 = !{!"_ZTSSt6vectorIN6charls18jpeg_stream_reader14component_infoESaIS2_EE", !20, i64 0}
!20 = !{!"_ZTSSt12_Vector_baseIN6charls18jpeg_stream_reader14component_infoESaIS2_EE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIN6charls18jpeg_stream_reader14component_infoESaIS2_EE12_Vector_implE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIN6charls18jpeg_stream_reader14component_infoESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!23 = !{!"_ZTSSt6vectorIN6charls18jpeg_stream_reader19mapping_table_entryESaIS2_EE", !24, i64 0}
!24 = !{!"_ZTSSt12_Vector_baseIN6charls18jpeg_stream_reader19mapping_table_entryESaIS2_EE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIN6charls18jpeg_stream_reader19mapping_table_entryESaIS2_EE12_Vector_implE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIN6charls18jpeg_stream_reader19mapping_table_entryESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!27 = !{!"_ZTSN6charls18jpeg_stream_reader5stateE", !7, i64 0}
!28 = !{!"bool", !7, i64 0}
!29 = !{!"_ZTSN6charls22compressed_data_formatE", !7, i64 0}
!30 = !{!"_ZTSN6charls17callback_functionIPFiPKvmPvEEE", !6, i64 0, !6, i64 8}
!31 = !{!"_ZTSN6charls17callback_functionIPFiiPKvmPvEEE", !6, i64 0, !6, i64 8}
!32 = !{!10, !14, i64 44}
!33 = !{!14, !14, i64 0}
!34 = !{!7, !7, i64 0}
!35 = distinct !{!35, !36}
!36 = !{!"llvm.loop.mustprogress"}
!37 = !{!10, !27, i64 136}


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

; Function Attrs: mustprogress noinline noreturn uwtable
declare dso_local void @_ZN6charls4impl18throw_jpegls_errorENS_11jpegls_errcE(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6charls18jpeg_stream_reader27read_start_of_frame_segmentEv(ptr noundef nonnull align 8 dereferenceable(192) %0) local_unnamed_addr #1 align 2 {
  tail call void @_ZNK6charls18jpeg_stream_reader26check_minimal_segment_sizeEm(ptr noundef nonnull align 8 dereferenceable(192) %0, i64 noundef 6)
  %2 = tail call noundef zeroext i8 @_ZN6charls18jpeg_stream_reader10read_uint8Ev(ptr noundef nonnull align 8 dereferenceable(192) %0) #3
  %3 = zext i8 %2 to i32
  %4 = getelementptr inbounds i8, ptr %0, i64 40
  store i32 %3, ptr %4, align 8, !tbaa !5
  %5 = add i8 %2, -17
  %spec.select = icmp ult i8 %5, -15
  br i1 %spec.select, label %6, label %7, !prof !31

6:                                                ; preds = %1
  tail call void @_ZN6charls4impl18throw_jpegls_errorENS_11jpegls_errcE(i32 noundef 31) #4
  unreachable

7:                                                ; preds = %1
  %8 = tail call noundef zeroext i16 @_ZN6charls18jpeg_stream_reader11read_uint16Ev(ptr noundef nonnull align 8 dereferenceable(192) %0) #3
  %9 = zext i16 %8 to i32
  tail call void @_ZN6charls18jpeg_stream_reader17frame_info_heightEjb(ptr noundef nonnull align 8 dereferenceable(192) %0, i32 noundef %9, i1 noundef zeroext false)
  %10 = tail call noundef zeroext i16 @_ZN6charls18jpeg_stream_reader11read_uint16Ev(ptr noundef nonnull align 8 dereferenceable(192) %0) #3
  %11 = zext i16 %10 to i32
  tail call void @_ZN6charls18jpeg_stream_reader16frame_info_widthEj(ptr noundef nonnull align 8 dereferenceable(192) %0, i32 noundef %11)
  %12 = tail call noundef zeroext i8 @_ZN6charls18jpeg_stream_reader10read_uint8Ev(ptr noundef nonnull align 8 dereferenceable(192) %0) #3
  %13 = zext i8 %12 to i32
  %14 = getelementptr inbounds i8, ptr %0, i64 44
  store i32 %13, ptr %14, align 4, !tbaa !32
  %15 = icmp eq i8 %12, 0
  br i1 %15, label %16, label %17, !prof !31

16:                                               ; preds = %7
  tail call void @_ZN6charls4impl18throw_jpegls_errorENS_11jpegls_errcE(i32 noundef 32) #4
  unreachable

17:                                               ; preds = %7
  %18 = zext i8 %12 to i64
  %19 = mul nuw nsw i64 %18, 3
  %20 = add nuw nsw i64 %19, 6
  tail call void @_ZNK6charls18jpeg_stream_reader18check_segment_sizeEm(ptr noundef nonnull align 8 dereferenceable(192) %0, i64 noundef %20)
  %21 = load i32, ptr %14, align 4, !tbaa !32
  %.not6 = icmp eq i32 %21, 0
  br i1 %.not6, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %26, %17
  %22 = getelementptr inbounds i8, ptr %0, i64 136
  store i32 4, ptr %22, align 8, !tbaa !33
  ret void

.lr.ph:                                           ; preds = %17, %26
  %.07 = phi i32 [ %27, %26 ], [ 0, %17 ]
  %23 = tail call noundef zeroext i8 @_ZN6charls18jpeg_stream_reader10read_uint8Ev(ptr noundef nonnull align 8 dereferenceable(192) %0) #3
  tail call void @_ZN6charls18jpeg_stream_reader13add_componentEh(ptr noundef nonnull align 8 dereferenceable(192) %0, i8 noundef zeroext %23)
  %24 = tail call noundef zeroext i8 @_ZN6charls18jpeg_stream_reader10read_uint8Ev(ptr noundef nonnull align 8 dereferenceable(192) %0) #3
  %.not5 = icmp eq i8 %24, 17
  br i1 %.not5, label %26, label %25, !prof !34

25:                                               ; preds = %.lr.ph
  tail call void @_ZN6charls4impl18throw_jpegls_errorENS_11jpegls_errcE(i32 noundef 7) #4
  unreachable

26:                                               ; preds = %.lr.ph
  tail call void @_ZN6charls18jpeg_stream_reader9skip_byteEv(ptr noundef nonnull align 8 dereferenceable(192) %0) #3
  %27 = add nuw nsw i32 %.07, 1
  %28 = load i32, ptr %14, align 4, !tbaa !32
  %.not = icmp eq i32 %27, %28
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !35
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK6charls18jpeg_stream_reader26check_minimal_segment_sizeEm(ptr noundef nonnull align 8 dereferenceable(192), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK6charls18jpeg_stream_reader18check_segment_sizeEm(ptr noundef nonnull align 8 dereferenceable(192), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i8 @_ZN6charls18jpeg_stream_reader10read_uint8Ev(ptr noundef nonnull align 8 dereferenceable(192)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6charls18jpeg_stream_reader17frame_info_heightEjb(ptr noundef nonnull align 8 dereferenceable(192), i32 noundef, i1 noundef zeroext) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i16 @_ZN6charls18jpeg_stream_reader11read_uint16Ev(ptr noundef nonnull align 8 dereferenceable(192)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6charls18jpeg_stream_reader16frame_info_widthEj(ptr noundef nonnull align 8 dereferenceable(192), i32 noundef) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6charls18jpeg_stream_reader9skip_byteEv(ptr noundef nonnull align 8 dereferenceable(192)) local_unnamed_addr #2 align 2

attributes #0 = { mustprogress noinline noreturn 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 = { 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 = { nounwind }
attributes #4 = { noreturn }

!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, !13, i64 40}
!6 = !{!"_ZTSN6charls18jpeg_stream_readerE", !7, i64 0, !7, i64 8, !10, i64 16, !12, i64 32, !14, i64 48, !17, i64 64, !18, i64 88, !22, i64 112, !26, i64 136, !13, i64 140, !13, i64 144, !15, i64 148, !27, i64 152, !28, i64 156, !29, i64 160, !30, i64 176}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN6charls4spanIKSt4byteEE", !7, i64 0, !11, i64 8}
!11 = !{!"long", !8, i64 0}
!12 = !{!"_ZTS17charls_frame_info", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12}
!13 = !{!"int", !8, i64 0}
!14 = !{!"_ZTSN6charls17coding_parametersE", !13, i64 0, !13, i64 4, !15, i64 8, !16, i64 12}
!15 = !{!"_ZTSN6charls15interleave_modeE", !8, i64 0}
!16 = !{!"_ZTSN6charls20color_transformationE", !8, i64 0}
!17 = !{!"_ZTS27charls_jpegls_pc_parameters", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16}
!18 = !{!"_ZTSSt6vectorIN6charls18jpeg_stream_reader14component_infoESaIS2_EE", !19, i64 0}
!19 = !{!"_ZTSSt12_Vector_baseIN6charls18jpeg_stream_reader14component_infoESaIS2_EE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIN6charls18jpeg_stream_reader14component_infoESaIS2_EE12_Vector_implE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIN6charls18jpeg_stream_reader14component_infoESaIS2_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!22 = !{!"_ZTSSt6vectorIN6charls18jpeg_stream_reader19mapping_table_entryESaIS2_EE", !23, i64 0}
!23 = !{!"_ZTSSt12_Vector_baseIN6charls18jpeg_stream_reader19mapping_table_entryESaIS2_EE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIN6charls18jpeg_stream_reader19mapping_table_entryESaIS2_EE12_Vector_implE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIN6charls18jpeg_stream_reader19mapping_table_entryESaIS2_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!26 = !{!"_ZTSN6charls18jpeg_stream_reader5stateE", !8, i64 0}
!27 = !{!"bool", !8, i64 0}
!28 = !{!"_ZTSN6charls22compressed_data_formatE", !8, i64 0}
!29 = !{!"_ZTSN6charls17callback_functionIPFiPKvmPvEEE", !7, i64 0, !7, i64 8}
!30 = !{!"_ZTSN6charls17callback_functionIPFiiPKvmPvEEE", !7, i64 0, !7, i64 8}
!31 = !{!"branch_weights", !"expected", i32 1, i32 2000}
!32 = !{!6, !13, i64 44}
!33 = !{!6, !26, i64 136}
!34 = !{!"branch_weights", !"expected", i32 2000, i32 1}
!35 = distinct !{!35, !36}
!36 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LowerExpectIntrinsicPass,SROAPass,SimplifyCFGPass,TailCallElimPass