; LLVM IR from intel/qpl :: sources/c_api/legacy_hw_path (qpl_hw_check_job)

; 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.qpl::ml::compression::gzip_decorator::gzip_trailer" = type { i32, i32 }
%struct.qpl_hw_state = type { %struct.hw_decompress_analytics_descriptor, %struct.hw_iaa_completion_record, [2 x %struct.hw_iaa_aecs_analytic], [2 x %struct.hw_iaa_aecs_compress], %struct.qpl_buffer, %struct.qpl_execution_history, i32, i32, i32, %struct.hw_huffman_code, i32, %struct.hw_accelerator_context, i32, i32, i8, i8, i32, i32, %struct.qpl_execution_record }
%struct.hw_decompress_analytics_descriptor = type { i32, i32, ptr, ptr, ptr, i32, i16, i16, ptr, i32, i32, i32, i32 }
%struct.hw_iaa_completion_record = type { i8, i8, i8, i8, i32, i64, i64, i32, i8, i8, i16, i32, i32, i32, i32, i64, i64 }
%struct.hw_iaa_aecs_analytic = type { %struct.hw_iaa_aecs_filter, [36 x i32], %struct.hw_iaa_aecs_decompress }
%struct.hw_iaa_aecs_filter = type { i32, i32, i32, i32, i32, i32 }
%struct.hw_iaa_aecs_decompress = type { [2 x i32], i32, i32, [32 x i64], [32 x i8], i32, i8, i8, i16, [5 x i32], [5 x i32], [5 x i32], [5 x i32], [62 x i32], %union.anon, i16, i16, %union.anon.0, %struct.anon.2, i16, [4096 x i8], [6 x i32] }
%union.anon = type { %struct.anon }
%struct.anon = type { [6 x i32], [224 x i8], [5 x i32] }
%union.anon.0 = type { %struct.anon.1 }
%struct.anon.1 = type { [2 x i32], [144 x i8], [5 x i32] }
%struct.anon.2 = type { i16 }
%struct.hw_iaa_aecs_compress = type { i32, i32, [5 x i32], i32, [256 x i8], %struct.hw_iaa_histogram, [12288 x i8] }
%struct.hw_iaa_histogram = type { [286 x i32], [2 x i32], [30 x i32], [2 x i32] }
%struct.qpl_buffer = type { [1024 x i8], i32, i32 }
%struct.qpl_execution_history = type { i8, i32, i32, i32, ptr }
%struct.hw_huffman_code = type { i16, i8, i8 }
%struct.hw_accelerator_context = type { %struct.hw_device_properties, ptr }
%struct.hw_device_properties = type { i32, i32, i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }
%struct.qpl_execution_record = type { double, i32, i32 }
%struct.qpl_job = type { ptr, i32, i32, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, i32, ptr, i32, i32, i8, i8, i8, i64, i64, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %struct.qpl_aux_data }
%struct.qpl_aux_data = type { ptr, ptr, ptr, ptr, ptr, i32 }

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN3qpl2ml30set_state_to_complete_and_wrapEP7qpl_jobP12qpl_hw_statej(ptr noundef %0, ptr noundef %1, i32 noundef %2) #0 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %"struct.qpl::ml::compression::gzip_decorator::gzip_trailer", align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  %11 = load ptr, ptr %6, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.qpl_hw_state, ptr %11, i32 0, i32 5
  %13 = getelementptr inbounds %struct.qpl_execution_history, ptr %12, i32 0, i32 1
  store i32 4, ptr %13, align 4, !tbaa !11
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.qpl_job, ptr %14, i32 0, i32 7
  %16 = load i32, ptr %15, align 4, !tbaa !29
  %17 = and i32 8, %16
  %18 = icmp ne i32 %17, 0
  br i1 %18, label %19, label %55

19:                                               ; preds = %3
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.qpl_job, ptr %20, i32 0, i32 4
  %22 = load i32, ptr %21, align 8, !tbaa !39
  %23 = zext i32 %22 to i64
  %24 = icmp ugt i64 8, %23
  br i1 %24, label %25, label %26

25:                                               ; preds = %19
  store i32 225, ptr %4, align 4
  br label %100

26:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  call void @llvm.memset.p0.i64(ptr align 4 %8, i8 0, i64 8, i1 false)
  %27 = load i32, ptr %7, align 4, !tbaa !9
  %28 = getelementptr inbounds %"struct.qpl::ml::compression::gzip_decorator::gzip_trailer", ptr %8, i32 0, i32 0
  store i32 %27, ptr %28, align 4, !tbaa !40
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.qpl_job, ptr %29, i32 0, i32 2
  %31 = load i32, ptr %30, align 4, !tbaa !42
  %32 = getelementptr inbounds %"struct.qpl::ml::compression::gzip_decorator::gzip_trailer", ptr %8, i32 0, i32 1
  store i32 %31, ptr %32, align 4, !tbaa !43
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.qpl_job, ptr %33, i32 0, i32 3
  %35 = load ptr, ptr %34, align 8, !tbaa !44
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.qpl_job, ptr %36, i32 0, i32 4
  %38 = load i32, ptr %37, align 8, !tbaa !39
  call void @_ZN3qpl2ml11compression14gzip_decorator20write_trailer_unsafeEPKhjRNS2_12gzip_trailerE(ptr noundef %35, i32 noundef %38, ptr noundef nonnull align 4 dereferenceable(8) %8) #4
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.qpl_job, ptr %39, i32 0, i32 3
  %41 = load ptr, ptr %40, align 8, !tbaa !44
  %42 = getelementptr inbounds i8, ptr %41, i64 8
  store ptr %42, ptr %40, align 8, !tbaa !44
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.qpl_job, ptr %43, i32 0, i32 4
  %45 = load i32, ptr %44, align 8, !tbaa !39
  %46 = zext i32 %45 to i64
  %47 = sub i64 %46, 8
  %48 = trunc i64 %47 to i32
  store i32 %48, ptr %44, align 8, !tbaa !39
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.qpl_job, ptr %49, i32 0, i32 5
  %51 = load i32, ptr %50, align 4, !tbaa !45
  %52 = zext i32 %51 to i64
  %53 = add i64 %52, 8
  %54 = trunc i64 %53 to i32
  store i32 %54, ptr %50, align 4, !tbaa !45
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %55

55:                                               ; preds = %26, %3
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.qpl_job, ptr %56, i32 0, i32 7
  %58 = load i32, ptr %57, align 4, !tbaa !29
  %59 = and i32 524288, %58
  %60 = icmp ne i32 %59, 0
  br i1 %60, label %61, label %99

61:                                               ; preds = %55
  %62 = load ptr, ptr %5, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.qpl_job, ptr %62, i32 0, i32 4
  %64 = load i32, ptr %63, align 8, !tbaa !39
  %65 = zext i32 %64 to i64
  %66 = icmp ugt i64 8, %65
  br i1 %66, label %67, label %68

67:                                               ; preds = %61
  store i32 225, ptr %4, align 4
  br label %100

68:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %69 = load ptr, ptr %5, align 8, !tbaa !5
  %70 = call noundef i32 @_ZN3qpl3jobL11get_adler32EPK7qpl_job(ptr noundef %69) #4
  store i32 %70, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %71 = load i32, ptr %9, align 4, !tbaa !9
  %72 = and i32 %71, -65536
  %73 = load i32, ptr %9, align 4, !tbaa !9
  %74 = and i32 %73, 65535
  %75 = add i32 %74, 1
  %76 = urem i32 %75, 65521
  %77 = or i32 %72, %76
  %78 = call noundef i32 @_ZL10swap_bytesj(i32 noundef %77)
  store i32 %78, ptr %10, align 4, !tbaa !9
  %79 = load ptr, ptr %5, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.qpl_job, ptr %79, i32 0, i32 3
  %81 = load ptr, ptr %80, align 8, !tbaa !44
  %82 = load i32, ptr %10, align 4, !tbaa !9
  call void @_ZN3qpl2ml11compression14zlib_decorator20write_trailer_unsafeEPKhj(ptr noundef %81, i32 noundef %82) #4
  %83 = load ptr, ptr %5, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.qpl_job, ptr %83, i32 0, i32 3
  %85 = load ptr, ptr %84, align 8, !tbaa !44
  %86 = getelementptr inbounds i8, ptr %85, i64 4
  store ptr %86, ptr %84, align 8, !tbaa !44
  %87 = load ptr, ptr %5, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.qpl_job, ptr %87, i32 0, i32 4
  %89 = load i32, ptr %88, align 8, !tbaa !39
  %90 = zext i32 %89 to i64
  %91 = sub i64 %90, 4
  %92 = trunc i64 %91 to i32
  store i32 %92, ptr %88, align 8, !tbaa !39
  %93 = load ptr, ptr %5, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.qpl_job, ptr %93, i32 0, i32 5
  %95 = load i32, ptr %94, align 4, !tbaa !45
  %96 = zext i32 %95 to i64
  %97 = add i64 %96, 4
  %98 = trunc i64 %97 to i32
  store i32 %98, ptr %94, align 4, !tbaa !45
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %99

99:                                               ; preds = %68, %55
  store i32 0, ptr %4, align 4
  br label %100

100:                                              ; preds = %99, %67, %25
  %101 = load i32, ptr %4, align 4
  ret i32 %101
}

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3qpl2ml11compression14gzip_decorator20write_trailer_unsafeEPKhjRNS2_12gzip_trailerE(ptr noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(8)) #3 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL10swap_bytesj(i32 noundef) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3qpl2ml11compression14zlib_decorator20write_trailer_unsafeEPKhj(ptr noundef, i32 noundef) #3 align 2

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { inlinehint 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 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !20, i64 39628}
!12 = !{!"_ZTS12qpl_hw_state", !13, i64 0, !15, i64 64, !7, i64 128, !7, i64 10880, !17, i64 38592, !18, i64 39624, !10, i64 39648, !10, i64 39652, !10, i64 39656, !22, i64 39660, !10, i64 39664, !23, i64 39672, !10, i64 39704, !10, i64 39708, !19, i64 39712, !19, i64 39713, !25, i64 39716, !26, i64 39720, !27, i64 39728}
!13 = !{!"_ZTS34hw_decompress_analytics_descriptor", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16, !6, i64 24, !10, i64 32, !14, i64 36, !14, i64 38, !6, i64 40, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60}
!14 = !{!"short", !7, i64 0}
!15 = !{!"_ZTS24hw_iaa_completion_record", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !10, i64 4, !16, i64 8, !16, i64 16, !10, i64 24, !7, i64 28, !7, i64 29, !14, i64 30, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !16, i64 48, !16, i64 56}
!16 = !{!"long", !7, i64 0}
!17 = !{!"_ZTS10qpl_buffer", !7, i64 0, !10, i64 1024, !10, i64 1028}
!18 = !{!"_ZTS21qpl_execution_history", !19, i64 0, !20, i64 4, !21, i64 8, !10, i64 12, !6, i64 16}
!19 = !{!"bool", !7, i64 0}
!20 = !{!"_ZTS23qpl_task_execution_step", !7, i64 0}
!21 = !{!"_ZTS14qpl_comp_style", !7, i64 0}
!22 = !{!"_ZTS15hw_huffman_code", !14, i64 0, !7, i64 2, !7, i64 3}
!23 = !{!"_ZTS22hw_accelerator_context", !24, i64 0, !6, i64 24}
!24 = !{!"_ZTS20hw_device_properties", !10, i64 0, !10, i64 4, !10, i64 8, !19, i64 12, !19, i64 13, !19, i64 14, !19, i64 15, !19, i64 16, !19, i64 17, !19, i64 18, !19, i64 19, !19, i64 20, !19, i64 21, !19, i64 22}
!25 = !{!"_ZTS25hw_multidescriptor_status", !7, i64 0}
!26 = !{!"_ZTS10qpl_status", !7, i64 0}
!27 = !{!"_ZTS20qpl_execution_record", !28, i64 0, !10, i64 8, !10, i64 12}
!28 = !{!"double", !7, i64 0}
!29 = !{!30, !10, i64 36}
!30 = !{!"_ZTS7qpl_job", !6, i64 0, !10, i64 8, !10, i64 12, !6, i64 16, !10, i64 24, !10, i64 28, !31, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !32, i64 52, !33, i64 56, !6, i64 64, !6, i64 72, !34, i64 80, !6, i64 88, !10, i64 96, !10, i64 100, !7, i64 104, !7, i64 105, !7, i64 106, !16, i64 112, !16, i64 120, !6, i64 128, !10, i64 136, !10, i64 140, !10, i64 144, !10, i64 148, !35, i64 152, !10, i64 156, !10, i64 160, !10, i64 164, !10, i64 168, !36, i64 172, !10, i64 176, !10, i64 180, !10, i64 184, !10, i64 188, !37, i64 192}
!31 = !{!"_ZTS13qpl_operation", !7, i64 0}
!32 = !{!"_ZTS22qpl_compression_levels", !7, i64 0}
!33 = !{!"_ZTS19qpl_statistics_mode", !7, i64 0}
!34 = !{!"_ZTS19qpl_mini_block_size", !7, i64 0}
!35 = !{!"_ZTS14qpl_out_format", !7, i64 0}
!36 = !{!"_ZTS10qpl_parser", !7, i64 0}
!37 = !{!"_ZTS12qpl_aux_data", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !38, i64 40}
!38 = !{!"_ZTS10qpl_path_t", !7, i64 0}
!39 = !{!30, !10, i64 24}
!40 = !{!41, !10, i64 0}
!41 = !{!"_ZTSN3qpl2ml11compression14gzip_decorator12gzip_trailerE", !10, i64 0, !10, i64 4}
!42 = !{!30, !10, i64 12}
!43 = !{!41, !10, i64 4}
!44 = !{!30, !6, i64 16}
!45 = !{!30, !10, i64 28}


; 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.qpl::ml::compression::gzip_decorator::gzip_trailer" = type { i32, i32 }

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef range(i32 0, 226) i32 @_ZN3qpl2ml30set_state_to_complete_and_wrapEP7qpl_jobP12qpl_hw_statej(ptr noundef %0, ptr nocapture noundef writeonly %1, i32 noundef %2) local_unnamed_addr #0 {
  %4 = alloca %"struct.qpl::ml::compression::gzip_decorator::gzip_trailer", align 4
  %5 = getelementptr inbounds i8, ptr %1, i64 39628
  store i32 4, ptr %5, align 4, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 36
  %7 = load i32, ptr %6, align 4, !tbaa !27
  %8 = and i32 %7, 8
  %.not = icmp eq i32 %8, 0
  br i1 %.not, label %23, label %9

9:                                                ; preds = %3
  %10 = getelementptr inbounds i8, ptr %0, i64 24
  %11 = load i32, ptr %10, align 8, !tbaa !37
  %12 = icmp ult i32 %11, 8
  br i1 %12, label %43, label %13

13:                                               ; preds = %9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  store i32 %2, ptr %4, align 4, !tbaa !38
  %14 = getelementptr inbounds i8, ptr %0, i64 12
  %15 = load i32, ptr %14, align 4, !tbaa !40
  %16 = getelementptr inbounds i8, ptr %4, i64 4
  store i32 %15, ptr %16, align 4, !tbaa !41
  %17 = getelementptr inbounds i8, ptr %0, i64 16
  %18 = load ptr, ptr %17, align 8, !tbaa !42
  call void @_ZN3qpl2ml11compression14gzip_decorator20write_trailer_unsafeEPKhjRNS2_12gzip_trailerE(ptr noundef %18, i32 noundef %11, ptr noundef nonnull align 4 dereferenceable(8) %4) #3
  %19 = load ptr, ptr %17, align 8, !tbaa !42
  %20 = getelementptr inbounds i8, ptr %19, i64 8
  store ptr %20, ptr %17, align 8, !tbaa !42
  %21 = load <2 x i32>, ptr %10, align 8, !tbaa !43
  %22 = add <2 x i32> %21, <i32 -8, i32 8>
  store <2 x i32> %22, ptr %10, align 8, !tbaa !43
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  %.pre = load i32, ptr %6, align 4, !tbaa !27
  br label %23

23:                                               ; preds = %13, %3
  %24 = phi i32 [ %.pre, %13 ], [ %7, %3 ]
  %25 = and i32 %24, 524288
  %.not20 = icmp eq i32 %25, 0
  br i1 %.not20, label %43, label %26

26:                                               ; preds = %23
  %27 = getelementptr inbounds i8, ptr %0, i64 24
  %28 = load i32, ptr %27, align 8, !tbaa !37
  %29 = icmp ult i32 %28, 8
  br i1 %29, label %43, label %30

30:                                               ; preds = %26
  %31 = call noundef i32 @_ZN3qpl3jobL11get_adler32EPK7qpl_job(ptr noundef nonnull %0) #3
  %32 = and i32 %31, -65536
  %33 = and i32 %31, 65535
  %.cmp = icmp ult i32 %33, 65520
  %.v = select i1 %.cmp, i32 1, i32 -65520
  %34 = add nsw i32 %.v, %33
  %35 = add nuw nsw i32 %34, %32
  %36 = call noundef i32 @_ZL10swap_bytesj(i32 noundef %35)
  %37 = getelementptr inbounds i8, ptr %0, i64 16
  %38 = load ptr, ptr %37, align 8, !tbaa !42
  call void @_ZN3qpl2ml11compression14zlib_decorator20write_trailer_unsafeEPKhj(ptr noundef %38, i32 noundef %36) #3
  %39 = load ptr, ptr %37, align 8, !tbaa !42
  %40 = getelementptr inbounds i8, ptr %39, i64 4
  store ptr %40, ptr %37, align 8, !tbaa !42
  %41 = load <2 x i32>, ptr %27, align 8, !tbaa !43
  %42 = add <2 x i32> %41, <i32 -4, i32 4>
  store <2 x i32> %42, ptr %27, align 8, !tbaa !43
  br label %43

43:                                               ; preds = %23, %30, %26, %9
  %.0 = phi i32 [ 225, %9 ], [ 225, %26 ], [ 0, %30 ], [ 0, %23 ]
  ret i32 %.0
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3qpl2ml11compression14gzip_decorator20write_trailer_unsafeEPKhjRNS2_12gzip_trailerE(ptr noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #2 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL10swap_bytesj(i32 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3qpl2ml11compression14zlib_decorator20write_trailer_unsafeEPKhj(ptr noundef, i32 noundef) local_unnamed_addr #2 align 2

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

!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, !18, i64 39628}
!6 = !{!"_ZTS12qpl_hw_state", !7, i64 0, !13, i64 64, !9, i64 128, !9, i64 10880, !15, i64 38592, !16, i64 39624, !8, i64 39648, !8, i64 39652, !8, i64 39656, !20, i64 39660, !8, i64 39664, !21, i64 39672, !8, i64 39704, !8, i64 39708, !17, i64 39712, !17, i64 39713, !23, i64 39716, !24, i64 39720, !25, i64 39728}
!7 = !{!"_ZTS34hw_decompress_analytics_descriptor", !8, i64 0, !8, i64 4, !11, i64 8, !11, i64 16, !11, i64 24, !8, i64 32, !12, i64 36, !12, i64 38, !11, i64 40, !8, i64 48, !8, i64 52, !8, i64 56, !8, i64 60}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"any pointer", !9, i64 0}
!12 = !{!"short", !9, i64 0}
!13 = !{!"_ZTS24hw_iaa_completion_record", !9, i64 0, !9, i64 1, !9, i64 2, !9, i64 3, !8, i64 4, !14, i64 8, !14, i64 16, !8, i64 24, !9, i64 28, !9, i64 29, !12, i64 30, !8, i64 32, !8, i64 36, !8, i64 40, !8, i64 44, !14, i64 48, !14, i64 56}
!14 = !{!"long", !9, i64 0}
!15 = !{!"_ZTS10qpl_buffer", !9, i64 0, !8, i64 1024, !8, i64 1028}
!16 = !{!"_ZTS21qpl_execution_history", !17, i64 0, !18, i64 4, !19, i64 8, !8, i64 12, !11, i64 16}
!17 = !{!"bool", !9, i64 0}
!18 = !{!"_ZTS23qpl_task_execution_step", !9, i64 0}
!19 = !{!"_ZTS14qpl_comp_style", !9, i64 0}
!20 = !{!"_ZTS15hw_huffman_code", !12, i64 0, !9, i64 2, !9, i64 3}
!21 = !{!"_ZTS22hw_accelerator_context", !22, i64 0, !11, i64 24}
!22 = !{!"_ZTS20hw_device_properties", !8, i64 0, !8, i64 4, !8, i64 8, !17, i64 12, !17, i64 13, !17, i64 14, !17, i64 15, !17, i64 16, !17, i64 17, !17, i64 18, !17, i64 19, !17, i64 20, !17, i64 21, !17, i64 22}
!23 = !{!"_ZTS25hw_multidescriptor_status", !9, i64 0}
!24 = !{!"_ZTS10qpl_status", !9, i64 0}
!25 = !{!"_ZTS20qpl_execution_record", !26, i64 0, !8, i64 8, !8, i64 12}
!26 = !{!"double", !9, i64 0}
!27 = !{!28, !8, i64 36}
!28 = !{!"_ZTS7qpl_job", !11, i64 0, !8, i64 8, !8, i64 12, !11, i64 16, !8, i64 24, !8, i64 28, !29, i64 32, !8, i64 36, !8, i64 40, !8, i64 44, !8, i64 48, !30, i64 52, !31, i64 56, !11, i64 64, !11, i64 72, !32, i64 80, !11, i64 88, !8, i64 96, !8, i64 100, !9, i64 104, !9, i64 105, !9, i64 106, !14, i64 112, !14, i64 120, !11, i64 128, !8, i64 136, !8, i64 140, !8, i64 144, !8, i64 148, !33, i64 152, !8, i64 156, !8, i64 160, !8, i64 164, !8, i64 168, !34, i64 172, !8, i64 176, !8, i64 180, !8, i64 184, !8, i64 188, !35, i64 192}
!29 = !{!"_ZTS13qpl_operation", !9, i64 0}
!30 = !{!"_ZTS22qpl_compression_levels", !9, i64 0}
!31 = !{!"_ZTS19qpl_statistics_mode", !9, i64 0}
!32 = !{!"_ZTS19qpl_mini_block_size", !9, i64 0}
!33 = !{!"_ZTS14qpl_out_format", !9, i64 0}
!34 = !{!"_ZTS10qpl_parser", !9, i64 0}
!35 = !{!"_ZTS12qpl_aux_data", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !36, i64 40}
!36 = !{!"_ZTS10qpl_path_t", !9, i64 0}
!37 = !{!28, !8, i64 24}
!38 = !{!39, !8, i64 0}
!39 = !{!"_ZTSN3qpl2ml11compression14gzip_decorator12gzip_trailerE", !8, i64 0, !8, i64 4}
!40 = !{!28, !8, i64 12}
!41 = !{!39, !8, i64 4}
!42 = !{!28, !11, i64 16}
!43 = !{!8, !8, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass