; LLVM IR from dbry/wavpack-stream :: src (write_words)

; 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.WavpackMetadata = type { i32, ptr, i8 }
%struct.WavpackStream = type { %struct.WavpackHeader, %struct.words_data, ptr, ptr, ptr, ptr, ptr, i64, i64, i32, i32, i32, i8, i8, i8, i8, i8, i8, i8, i32, i32, i32, i32, i32, i32, i32, i32, %struct.bs, %struct.bs, %struct.bs, float, i8, i8, i8, i8, i8, i8, i8, i8, %struct.anon, [16 x %struct.decorr_pass], %struct.decorr_pass, ptr, %struct.anon.0 }
%struct.WavpackHeader = type { [4 x i8], i16, i16, i32 }
%struct.words_data = type { [2 x i32], [2 x i32], i32, i32, i32, i32, i32, [2 x %struct.entropy_data] }
%struct.entropy_data = type { [3 x i32], i32, i32 }
%struct.bs = type { ptr, ptr, ptr, ptr, i32, i32, i32 }
%struct.anon = type { [2 x i32], [2 x i32], [2 x i32], double, double, double, ptr, ptr, i32 }
%struct.decorr_pass = type { i32, i32, i32, i32, [8 x i32], [8 x i32], i32, i32, i32, i32 }
%struct.anon.0 = type { ptr, ptr, ptr, ptr, ptr, i8, i8, i32, i32, i32, ptr, i32, i32, i32, [2 x %struct.DSDfilters], ptr }
%struct.DSDfilters = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }

declare void @word_set_bitrate(ptr noundef) #0

; Function Attrs: nounwind uwtable
define dso_local void @write_entropy_combined(ptr noundef %0, ptr noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %6 = call noalias ptr @malloc(i64 noundef 64) #5
  %7 = load ptr, ptr %4, align 8, !tbaa !5
  %8 = getelementptr inbounds %struct.WavpackMetadata, ptr %7, i32 0, i32 1
  store ptr %6, ptr %8, align 8, !tbaa !9
  store ptr %6, ptr %5, align 8, !tbaa !5
  %9 = load ptr, ptr %4, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.WavpackMetadata, ptr %9, i32 0, i32 2
  store i8 17, ptr %10, align 8, !tbaa !12
  %11 = load ptr, ptr %3, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.WavpackStream, ptr %11, i32 0, i32 1
  %13 = getelementptr inbounds %struct.words_data, ptr %12, i32 0, i32 7
  %14 = getelementptr inbounds [2 x %struct.entropy_data], ptr %13, i64 0, i64 0
  %15 = getelementptr inbounds %struct.entropy_data, ptr %14, i32 0, i32 0
  %16 = getelementptr inbounds [3 x i32], ptr %15, i64 0, i64 0
  %17 = load i32, ptr %16, align 4, !tbaa !13
  %18 = call zeroext i8 @wp_log2_uchar(i32 noundef %17)
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %19, i32 1
  store ptr %20, ptr %5, align 8, !tbaa !5
  store i8 %18, ptr %19, align 1, !tbaa !14
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.WavpackStream, ptr %21, i32 0, i32 1
  %23 = getelementptr inbounds %struct.words_data, ptr %22, i32 0, i32 7
  %24 = getelementptr inbounds [2 x %struct.entropy_data], ptr %23, i64 0, i64 0
  %25 = getelementptr inbounds %struct.entropy_data, ptr %24, i32 0, i32 0
  %26 = getelementptr inbounds [3 x i32], ptr %25, i64 0, i64 1
  %27 = load i32, ptr %26, align 4, !tbaa !13
  %28 = call zeroext i8 @wp_log2_uchar(i32 noundef %27)
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = getelementptr inbounds i8, ptr %29, i32 1
  store ptr %30, ptr %5, align 8, !tbaa !5
  store i8 %28, ptr %29, align 1, !tbaa !14
  %31 = load ptr, ptr %3, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.WavpackStream, ptr %31, i32 0, i32 1
  %33 = getelementptr inbounds %struct.words_data, ptr %32, i32 0, i32 7
  %34 = getelementptr inbounds [2 x %struct.entropy_data], ptr %33, i64 0, i64 0
  %35 = getelementptr inbounds %struct.entropy_data, ptr %34, i32 0, i32 0
  %36 = getelementptr inbounds [3 x i32], ptr %35, i64 0, i64 2
  %37 = load i32, ptr %36, align 4, !tbaa !13
  %38 = call zeroext i8 @wp_log2_uchar(i32 noundef %37)
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = getelementptr inbounds i8, ptr %39, i32 1
  store ptr %40, ptr %5, align 8, !tbaa !5
  store i8 %38, ptr %39, align 1, !tbaa !14
  %41 = load ptr, ptr %3, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.WavpackStream, ptr %41, i32 0, i32 0
  %43 = getelementptr inbounds %struct.WavpackHeader, ptr %42, i32 0, i32 3
  %44 = load i32, ptr %43, align 8, !tbaa !15
  %45 = and i32 %44, 1073741828
  %46 = icmp ne i32 %45, 0
  br i1 %46, label %78, label %47

47:                                               ; preds = %2
  %48 = load ptr, ptr %3, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.WavpackStream, ptr %48, i32 0, i32 1
  %50 = getelementptr inbounds %struct.words_data, ptr %49, i32 0, i32 7
  %51 = getelementptr inbounds [2 x %struct.entropy_data], ptr %50, i64 0, i64 1
  %52 = getelementptr inbounds %struct.entropy_data, ptr %51, i32 0, i32 0
  %53 = getelementptr inbounds [3 x i32], ptr %52, i64 0, i64 0
  %54 = load i32, ptr %53, align 4, !tbaa !13
  %55 = call zeroext i8 @wp_log2_uchar(i32 noundef %54)
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = getelementptr inbounds i8, ptr %56, i32 1
  store ptr %57, ptr %5, align 8, !tbaa !5
  store i8 %55, ptr %56, align 1, !tbaa !14
  %58 = load ptr, ptr %3, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.WavpackStream, ptr %58, i32 0, i32 1
  %60 = getelementptr inbounds %struct.words_data, ptr %59, i32 0, i32 7
  %61 = getelementptr inbounds [2 x %struct.entropy_data], ptr %60, i64 0, i64 1
  %62 = getelementptr inbounds %struct.entropy_data, ptr %61, i32 0, i32 0
  %63 = getelementptr inbounds [3 x i32], ptr %62, i64 0, i64 1
  %64 = load i32, ptr %63, align 4, !tbaa !13
  %65 = call zeroext i8 @wp_log2_uchar(i32 noundef %64)
  %66 = load ptr, ptr %5, align 8, !tbaa !5
  %67 = getelementptr inbounds i8, ptr %66, i32 1
  store ptr %67, ptr %5, align 8, !tbaa !5
  store i8 %65, ptr %66, align 1, !tbaa !14
  %68 = load ptr, ptr %3, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.WavpackStream, ptr %68, i32 0, i32 1
  %70 = getelementptr inbounds %struct.words_data, ptr %69, i32 0, i32 7
  %71 = getelementptr inbounds [2 x %struct.entropy_data], ptr %70, i64 0, i64 1
  %72 = getelementptr inbounds %struct.entropy_data, ptr %71, i32 0, i32 0
  %73 = getelementptr inbounds [3 x i32], ptr %72, i64 0, i64 2
  %74 = load i32, ptr %73, align 4, !tbaa !13
  %75 = call zeroext i8 @wp_log2_uchar(i32 noundef %74)
  %76 = load ptr, ptr %5, align 8, !tbaa !5
  %77 = getelementptr inbounds i8, ptr %76, i32 1
  store ptr %77, ptr %5, align 8, !tbaa !5
  store i8 %75, ptr %76, align 1, !tbaa !14
  br label %78

78:                                               ; preds = %47, %2
  %79 = load ptr, ptr %3, align 8, !tbaa !5
  call void @word_set_bitrate(ptr noundef %79)
  %80 = load ptr, ptr %3, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.WavpackStream, ptr %80, i32 0, i32 0
  %82 = getelementptr inbounds %struct.WavpackHeader, ptr %81, i32 0, i32 3
  %83 = load i32, ptr %82, align 8, !tbaa !15
  %84 = and i32 %83, 8
  %85 = icmp ne i32 %84, 0
  br i1 %85, label %86, label %140

86:                                               ; preds = %78
  %87 = load ptr, ptr %3, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.WavpackStream, ptr %87, i32 0, i32 0
  %89 = getelementptr inbounds %struct.WavpackHeader, ptr %88, i32 0, i32 3
  %90 = load i32, ptr %89, align 8, !tbaa !15
  %91 = and i32 %90, 512
  %92 = icmp ne i32 %91, 0
  br i1 %92, label %93, label %126

93:                                               ; preds = %86
  %94 = load ptr, ptr %3, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.WavpackStream, ptr %94, i32 0, i32 1
  %96 = getelementptr inbounds %struct.words_data, ptr %95, i32 0, i32 7
  %97 = getelementptr inbounds [2 x %struct.entropy_data], ptr %96, i64 0, i64 0
  %98 = getelementptr inbounds %struct.entropy_data, ptr %97, i32 0, i32 1
  %99 = load i32, ptr %98, align 4, !tbaa !27
  %100 = add i32 %99, 128
  %101 = lshr i32 %100, 8
  %102 = call i32 @wp_exp2s(i32 noundef %101)
  %103 = call zeroext i8 @wp_log2_uchar(i32 noundef %102)
  %104 = load ptr, ptr %5, align 8, !tbaa !5
  %105 = getelementptr inbounds i8, ptr %104, i32 1
  store ptr %105, ptr %5, align 8, !tbaa !5
  store i8 %103, ptr %104, align 1, !tbaa !14
  %106 = load ptr, ptr %3, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.WavpackStream, ptr %106, i32 0, i32 0
  %108 = getelementptr inbounds %struct.WavpackHeader, ptr %107, i32 0, i32 3
  %109 = load i32, ptr %108, align 8, !tbaa !15
  %110 = and i32 %109, 1073741828
  %111 = icmp ne i32 %110, 0
  br i1 %111, label %125, label %112

112:                                              ; preds = %93
  %113 = load ptr, ptr %3, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.WavpackStream, ptr %113, i32 0, i32 1
  %115 = getelementptr inbounds %struct.words_data, ptr %114, i32 0, i32 7
  %116 = getelementptr inbounds [2 x %struct.entropy_data], ptr %115, i64 0, i64 1
  %117 = getelementptr inbounds %struct.entropy_data, ptr %116, i32 0, i32 1
  %118 = load i32, ptr %117, align 4, !tbaa !27
  %119 = add i32 %118, 128
  %120 = lshr i32 %119, 8
  %121 = call i32 @wp_exp2s(i32 noundef %120)
  %122 = call zeroext i8 @wp_log2_uchar(i32 noundef %121)
  %123 = load ptr, ptr %5, align 8, !tbaa !5
  %124 = getelementptr inbounds i8, ptr %123, i32 1
  store ptr %124, ptr %5, align 8, !tbaa !5
  store i8 %122, ptr %123, align 1, !tbaa !14
  br label %125

125:                                              ; preds = %112, %93
  br label %126

126:                                              ; preds = %125, %86
  %127 = load ptr, ptr %3, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.WavpackStream, ptr %127, i32 0, i32 9
  %129 = load i32, ptr %128, align 8, !tbaa !29
  %130 = trunc i32 %129 to i8
  %131 = load ptr, ptr %5, align 8, !tbaa !5
  %132 = getelementptr inbounds i8, ptr %131, i32 1
  store ptr %132, ptr %5, align 8, !tbaa !5
  store i8 %130, ptr %131, align 1, !tbaa !14
  %133 = load ptr, ptr %3, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.WavpackStream, ptr %133, i32 0, i32 9
  %135 = load i32, ptr %134, align 8, !tbaa !29
  %136 = ashr i32 %135, 8
  %137 = trunc i32 %136 to i8
  %138 = load ptr, ptr %5, align 8, !tbaa !5
  %139 = getelementptr inbounds i8, ptr %138, i32 1
  store ptr %139, ptr %5, align 8, !tbaa !5
  store i8 %137, ptr %138, align 1, !tbaa !14
  br label %140

140:                                              ; preds = %126, %78
  %141 = load ptr, ptr %5, align 8, !tbaa !5
  %142 = load ptr, ptr %4, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.WavpackMetadata, ptr %142, i32 0, i32 1
  %144 = load ptr, ptr %143, align 8, !tbaa !9
  %145 = ptrtoint ptr %141 to i64
  %146 = ptrtoint ptr %144 to i64
  %147 = sub i64 %145, %146
  %148 = trunc i64 %147 to i32
  %149 = load ptr, ptr %4, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.WavpackMetadata, ptr %149, i32 0, i32 0
  store i32 %148, ptr %150, align 8, !tbaa !30
  %151 = load ptr, ptr %3, align 8, !tbaa !5
  %152 = load ptr, ptr %4, align 8, !tbaa !5
  %153 = call i32 @read_entropy_combined(ptr noundef %151, ptr noundef %152)
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  ret void
}

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #3

declare zeroext i8 @wp_log2_uchar(i32 noundef) #0

declare i32 @wp_exp2s(i32 noundef) #0

declare i32 @read_entropy_combined(ptr noundef, ptr noundef) #0

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

attributes #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 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nounwind allocsize(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 }
attributes #5 = { nounwind allocsize(0) }

!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/C++ TBAA"}
!9 = !{!10, !6, i64 8}
!10 = !{!"", !11, i64 0, !6, i64 8, !7, i64 16}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !7, i64 16}
!13 = !{!11, !11, i64 0}
!14 = !{!7, !7, i64 0}
!15 = !{!16, !11, i64 8}
!16 = !{!"", !17, i64 0, !19, i64 12, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !20, i64 128, !20, i64 136, !11, i64 144, !11, i64 148, !11, i64 152, !7, i64 156, !7, i64 157, !7, i64 158, !7, i64 159, !7, i64 160, !7, i64 161, !7, i64 162, !11, i64 164, !11, i64 168, !11, i64 172, !11, i64 176, !11, i64 180, !11, i64 184, !11, i64 188, !11, i64 192, !21, i64 200, !21, i64 248, !21, i64 296, !22, i64 344, !7, i64 348, !7, i64 349, !7, i64 350, !7, i64 351, !7, i64 352, !7, i64 353, !7, i64 354, !7, i64 355, !23, i64 360, !7, i64 432, !25, i64 1968, !6, i64 2064, !26, i64 2072}
!17 = !{!"", !7, i64 0, !18, i64 4, !18, i64 6, !11, i64 8}
!18 = !{!"short", !7, i64 0}
!19 = !{!"words_data", !7, i64 0, !7, i64 8, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !7, i64 36}
!20 = !{!"long", !7, i64 0}
!21 = !{!"bs", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !11, i64 32, !11, i64 36, !11, i64 40}
!22 = !{!"float", !7, i64 0}
!23 = !{!"", !7, i64 0, !7, i64 8, !7, i64 16, !24, i64 24, !24, i64 32, !24, i64 40, !6, i64 48, !6, i64 56, !11, i64 64}
!24 = !{!"double", !7, i64 0}
!25 = !{!"decorr_pass", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !7, i64 16, !7, i64 48, !11, i64 80, !11, i64 84, !11, i64 88, !11, i64 92}
!26 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !7, i64 40, !7, i64 41, !11, i64 44, !11, i64 48, !11, i64 52, !6, i64 56, !11, i64 64, !11, i64 68, !11, i64 72, !7, i64 76, !6, i64 160}
!27 = !{!28, !11, i64 12}
!28 = !{!"entropy_data", !7, i64 0, !11, i64 12, !11, i64 16}
!29 = !{!16, !11, i64 144}
!30 = !{!10, !11, i64 0}


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

declare void @word_set_bitrate(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @write_entropy_combined(ptr noundef %0, ptr noundef %1) local_unnamed_addr #1 {
  %3 = tail call noalias dereferenceable_or_null(64) ptr @malloc(i64 noundef 64) #3
  %4 = getelementptr inbounds i8, ptr %1, i64 8
  store ptr %3, ptr %4, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %1, i64 16
  store i8 17, ptr %5, align 8, !tbaa !11
  %6 = getelementptr inbounds i8, ptr %0, i64 48
  %7 = load i32, ptr %6, align 4, !tbaa !12
  %8 = tail call zeroext i8 @wp_log2_uchar(i32 noundef %7) #4
  %9 = getelementptr inbounds i8, ptr %3, i64 1
  store i8 %8, ptr %3, align 1, !tbaa !13
  %10 = getelementptr inbounds i8, ptr %0, i64 52
  %11 = load i32, ptr %10, align 4, !tbaa !12
  %12 = tail call zeroext i8 @wp_log2_uchar(i32 noundef %11) #4
  %13 = getelementptr inbounds i8, ptr %3, i64 2
  store i8 %12, ptr %9, align 1, !tbaa !13
  %14 = getelementptr inbounds i8, ptr %0, i64 56
  %15 = load i32, ptr %14, align 4, !tbaa !12
  %16 = tail call zeroext i8 @wp_log2_uchar(i32 noundef %15) #4
  %17 = getelementptr inbounds i8, ptr %3, i64 3
  store i8 %16, ptr %13, align 1, !tbaa !13
  %18 = getelementptr inbounds i8, ptr %0, i64 8
  %19 = load i32, ptr %18, align 8, !tbaa !14
  %20 = and i32 %19, 1073741828
  %.not = icmp eq i32 %20, 0
  br i1 %.not, label %21, label %34

21:                                               ; preds = %2
  %22 = getelementptr inbounds i8, ptr %0, i64 68
  %23 = load i32, ptr %22, align 4, !tbaa !12
  %24 = tail call zeroext i8 @wp_log2_uchar(i32 noundef %23) #4
  %25 = getelementptr inbounds i8, ptr %3, i64 4
  store i8 %24, ptr %17, align 1, !tbaa !13
  %26 = getelementptr inbounds i8, ptr %0, i64 72
  %27 = load i32, ptr %26, align 4, !tbaa !12
  %28 = tail call zeroext i8 @wp_log2_uchar(i32 noundef %27) #4
  %29 = getelementptr inbounds i8, ptr %3, i64 5
  store i8 %28, ptr %25, align 1, !tbaa !13
  %30 = getelementptr inbounds i8, ptr %0, i64 76
  %31 = load i32, ptr %30, align 4, !tbaa !12
  %32 = tail call zeroext i8 @wp_log2_uchar(i32 noundef %31) #4
  %33 = getelementptr inbounds i8, ptr %3, i64 6
  store i8 %32, ptr %29, align 1, !tbaa !13
  br label %34

34:                                               ; preds = %21, %2
  %.0 = phi ptr [ %17, %2 ], [ %33, %21 ]
  tail call void @word_set_bitrate(ptr noundef nonnull %0) #4
  %35 = load i32, ptr %18, align 8, !tbaa !14
  %36 = and i32 %35, 8
  %.not32 = icmp eq i32 %36, 0
  br i1 %.not32, label %66, label %37

37:                                               ; preds = %34
  %38 = and i32 %35, 512
  %.not33 = icmp eq i32 %38, 0
  br i1 %.not33, label %57, label %39

39:                                               ; preds = %37
  %40 = getelementptr inbounds i8, ptr %0, i64 60
  %41 = load i32, ptr %40, align 4, !tbaa !26
  %42 = add i32 %41, 128
  %43 = lshr i32 %42, 8
  %44 = tail call i32 @wp_exp2s(i32 noundef %43) #4
  %45 = tail call zeroext i8 @wp_log2_uchar(i32 noundef %44) #4
  %46 = getelementptr inbounds i8, ptr %.0, i64 1
  store i8 %45, ptr %.0, align 1, !tbaa !13
  %47 = load i32, ptr %18, align 8, !tbaa !14
  %48 = and i32 %47, 1073741828
  %.not34 = icmp eq i32 %48, 0
  br i1 %.not34, label %49, label %57

49:                                               ; preds = %39
  %50 = getelementptr inbounds i8, ptr %0, i64 80
  %51 = load i32, ptr %50, align 4, !tbaa !26
  %52 = add i32 %51, 128
  %53 = lshr i32 %52, 8
  %54 = tail call i32 @wp_exp2s(i32 noundef %53) #4
  %55 = tail call zeroext i8 @wp_log2_uchar(i32 noundef %54) #4
  %56 = getelementptr inbounds i8, ptr %.0, i64 2
  store i8 %55, ptr %46, align 1, !tbaa !13
  br label %57

57:                                               ; preds = %39, %49, %37
  %.1 = phi ptr [ %46, %39 ], [ %56, %49 ], [ %.0, %37 ]
  %58 = getelementptr inbounds i8, ptr %0, i64 144
  %59 = load i32, ptr %58, align 8, !tbaa !28
  %60 = trunc i32 %59 to i8
  %61 = getelementptr inbounds i8, ptr %.1, i64 1
  store i8 %60, ptr %.1, align 1, !tbaa !13
  %62 = load i32, ptr %58, align 8, !tbaa !28
  %63 = lshr i32 %62, 8
  %64 = trunc i32 %63 to i8
  %65 = getelementptr inbounds i8, ptr %.1, i64 2
  store i8 %64, ptr %61, align 1, !tbaa !13
  br label %66

66:                                               ; preds = %57, %34
  %.2 = phi ptr [ %65, %57 ], [ %.0, %34 ]
  %67 = load ptr, ptr %4, align 8, !tbaa !5
  %68 = ptrtoint ptr %.2 to i64
  %69 = ptrtoint ptr %67 to i64
  %70 = sub i64 %68, %69
  %71 = trunc i64 %70 to i32
  store i32 %71, ptr %1, align 8, !tbaa !29
  %72 = tail call i32 @read_entropy_combined(ptr noundef nonnull %0, ptr noundef nonnull %1) #4
  ret void
}

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2

declare zeroext i8 @wp_log2_uchar(i32 noundef) local_unnamed_addr #0

declare i32 @wp_exp2s(i32 noundef) local_unnamed_addr #0

declare i32 @read_entropy_combined(ptr noundef, ptr noundef) local_unnamed_addr #0

attributes #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 = { 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 #2 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 allocsize(0) }
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, !10, i64 8}
!6 = !{!"", !7, i64 0, !10, i64 8, !8, i64 16}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !8, i64 16}
!12 = !{!7, !7, i64 0}
!13 = !{!8, !8, i64 0}
!14 = !{!15, !7, i64 8}
!15 = !{!"", !16, i64 0, !18, i64 12, !10, i64 88, !10, i64 96, !10, i64 104, !10, i64 112, !10, i64 120, !19, i64 128, !19, i64 136, !7, i64 144, !7, i64 148, !7, i64 152, !8, i64 156, !8, i64 157, !8, i64 158, !8, i64 159, !8, i64 160, !8, i64 161, !8, i64 162, !7, i64 164, !7, i64 168, !7, i64 172, !7, i64 176, !7, i64 180, !7, i64 184, !7, i64 188, !7, i64 192, !20, i64 200, !20, i64 248, !20, i64 296, !21, i64 344, !8, i64 348, !8, i64 349, !8, i64 350, !8, i64 351, !8, i64 352, !8, i64 353, !8, i64 354, !8, i64 355, !22, i64 360, !8, i64 432, !24, i64 1968, !10, i64 2064, !25, i64 2072}
!16 = !{!"", !8, i64 0, !17, i64 4, !17, i64 6, !7, i64 8}
!17 = !{!"short", !8, i64 0}
!18 = !{!"words_data", !8, i64 0, !8, i64 8, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !8, i64 36}
!19 = !{!"long", !8, i64 0}
!20 = !{!"bs", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !7, i64 32, !7, i64 36, !7, i64 40}
!21 = !{!"float", !8, i64 0}
!22 = !{!"", !8, i64 0, !8, i64 8, !8, i64 16, !23, i64 24, !23, i64 32, !23, i64 40, !10, i64 48, !10, i64 56, !7, i64 64}
!23 = !{!"double", !8, i64 0}
!24 = !{!"decorr_pass", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !8, i64 16, !8, i64 48, !7, i64 80, !7, i64 84, !7, i64 88, !7, i64 92}
!25 = !{!"", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !8, i64 40, !8, i64 41, !7, i64 44, !7, i64 48, !7, i64 52, !10, i64 56, !7, i64 64, !7, i64 68, !7, i64 72, !8, i64 76, !10, i64 160}
!26 = !{!27, !7, i64 12}
!27 = !{!"entropy_data", !8, i64 0, !7, i64 12, !7, i64 16}
!28 = !{!15, !7, i64 144}
!29 = !{!6, !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass