; LLVM IR from modlfo/AudioEngine :: AudioEngine/JuceLibraryCode/modules/juce_core/zip/zlib (crc32)

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

; 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: nounwind uwtable
define dso_local i64 @z_crc32_combine(i64 noundef %0, i64 noundef %1, i64 noundef %2) #1 {
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca [32 x i64], align 16
  %11 = alloca [32 x i64], align 16
  %12 = alloca i32, align 4
  store i64 %0, ptr %5, align 8, !tbaa !5
  store i64 %1, ptr %6, align 8, !tbaa !5
  store i64 %2, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #2
  call void @llvm.lifetime.start.p0(i64 256, ptr %10) #2
  call void @llvm.lifetime.start.p0(i64 256, ptr %11) #2
  %13 = load i64, ptr %7, align 8, !tbaa !5
  %14 = icmp eq i64 %13, 0
  br i1 %14, label %15, label %17

15:                                               ; preds = %3
  %16 = load i64, ptr %5, align 8, !tbaa !5
  store i64 %16, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %74

17:                                               ; preds = %3
  %18 = getelementptr inbounds [32 x i64], ptr %11, i64 0, i64 0
  store i64 3988292384, ptr %18, align 16, !tbaa !5
  store i64 1, ptr %9, align 8, !tbaa !5
  store i32 1, ptr %8, align 4, !tbaa !9
  br label %19

19:                                               ; preds = %29, %17
  %20 = load i32, ptr %8, align 4, !tbaa !9
  %21 = icmp slt i32 %20, 32
  br i1 %21, label %22, label %32

22:                                               ; preds = %19
  %23 = load i64, ptr %9, align 8, !tbaa !5
  %24 = load i32, ptr %8, align 4, !tbaa !9
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [32 x i64], ptr %11, i64 0, i64 %25
  store i64 %23, ptr %26, align 8, !tbaa !5
  %27 = load i64, ptr %9, align 8, !tbaa !5
  %28 = shl i64 %27, 1
  store i64 %28, ptr %9, align 8, !tbaa !5
  br label %29

29:                                               ; preds = %22
  %30 = load i32, ptr %8, align 4, !tbaa !9
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr %8, align 4, !tbaa !9
  br label %19, !llvm.loop !11

32:                                               ; preds = %19
  %33 = getelementptr inbounds [32 x i64], ptr %10, i64 0, i64 0
  %34 = getelementptr inbounds [32 x i64], ptr %11, i64 0, i64 0
  call void @gf2_matrix_square(ptr noundef %33, ptr noundef %34)
  %35 = getelementptr inbounds [32 x i64], ptr %11, i64 0, i64 0
  %36 = getelementptr inbounds [32 x i64], ptr %10, i64 0, i64 0
  call void @gf2_matrix_square(ptr noundef %35, ptr noundef %36)
  br label %37

37:                                               ; preds = %66, %32
  %38 = getelementptr inbounds [32 x i64], ptr %10, i64 0, i64 0
  %39 = getelementptr inbounds [32 x i64], ptr %11, i64 0, i64 0
  call void @gf2_matrix_square(ptr noundef %38, ptr noundef %39)
  %40 = load i64, ptr %7, align 8, !tbaa !5
  %41 = and i64 %40, 1
  %42 = icmp ne i64 %41, 0
  br i1 %42, label %43, label %47

43:                                               ; preds = %37
  %44 = getelementptr inbounds [32 x i64], ptr %10, i64 0, i64 0
  %45 = load i64, ptr %5, align 8, !tbaa !5
  %46 = call i64 @gf2_matrix_times(ptr noundef %44, i64 noundef %45)
  store i64 %46, ptr %5, align 8, !tbaa !5
  br label %47

47:                                               ; preds = %43, %37
  %48 = load i64, ptr %7, align 8, !tbaa !5
  %49 = ashr i64 %48, 1
  store i64 %49, ptr %7, align 8, !tbaa !5
  %50 = load i64, ptr %7, align 8, !tbaa !5
  %51 = icmp eq i64 %50, 0
  br i1 %51, label %52, label %53

52:                                               ; preds = %47
  br label %69

53:                                               ; preds = %47
  %54 = getelementptr inbounds [32 x i64], ptr %11, i64 0, i64 0
  %55 = getelementptr inbounds [32 x i64], ptr %10, i64 0, i64 0
  call void @gf2_matrix_square(ptr noundef %54, ptr noundef %55)
  %56 = load i64, ptr %7, align 8, !tbaa !5
  %57 = and i64 %56, 1
  %58 = icmp ne i64 %57, 0
  br i1 %58, label %59, label %63

59:                                               ; preds = %53
  %60 = getelementptr inbounds [32 x i64], ptr %11, i64 0, i64 0
  %61 = load i64, ptr %5, align 8, !tbaa !5
  %62 = call i64 @gf2_matrix_times(ptr noundef %60, i64 noundef %61)
  store i64 %62, ptr %5, align 8, !tbaa !5
  br label %63

63:                                               ; preds = %59, %53
  %64 = load i64, ptr %7, align 8, !tbaa !5
  %65 = ashr i64 %64, 1
  store i64 %65, ptr %7, align 8, !tbaa !5
  br label %66

66:                                               ; preds = %63
  %67 = load i64, ptr %7, align 8, !tbaa !5
  %68 = icmp ne i64 %67, 0
  br i1 %68, label %37, label %69, !llvm.loop !13

69:                                               ; preds = %66, %52
  %70 = load i64, ptr %6, align 8, !tbaa !5
  %71 = load i64, ptr %5, align 8, !tbaa !5
  %72 = xor i64 %71, %70
  store i64 %72, ptr %5, align 8, !tbaa !5
  %73 = load i64, ptr %5, align 8, !tbaa !5
  store i64 %73, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %74

74:                                               ; preds = %69, %15
  call void @llvm.lifetime.end.p0(i64 256, ptr %11) #2
  call void @llvm.lifetime.end.p0(i64 256, ptr %10) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #2
  %75 = load i64, ptr %4, align 8
  ret i64 %75
}

; Function Attrs: nounwind uwtable
declare hidden void @gf2_matrix_square(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden i64 @gf2_matrix_times(ptr noundef, i64 noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


; 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 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: nounwind uwtable
define dso_local i64 @z_crc32_combine(i64 noundef %0, i64 noundef %1, i64 noundef %2) local_unnamed_addr #1 {
  %4 = alloca [32 x i64], align 16
  %5 = alloca [32 x i64], align 16
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %4) #2
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %5) #2
  %6 = icmp eq i64 %2, 0
  br i1 %6, label %53, label %7

7:                                                ; preds = %3
  store i64 3988292384, ptr %5, align 16, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %5, i64 8
  store i64 1, ptr %8, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %5, i64 16
  store i64 2, ptr %9, align 16, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %5, i64 24
  store i64 4, ptr %10, align 8, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %5, i64 32
  store i64 8, ptr %11, align 16, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %5, i64 40
  store i64 16, ptr %12, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %5, i64 48
  store i64 32, ptr %13, align 16, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %5, i64 56
  store i64 64, ptr %14, align 8, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %5, i64 64
  store i64 128, ptr %15, align 16, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %5, i64 72
  store i64 256, ptr %16, align 8, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %5, i64 80
  store i64 512, ptr %17, align 16, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %5, i64 88
  store i64 1024, ptr %18, align 8, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %5, i64 96
  store i64 2048, ptr %19, align 16, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %5, i64 104
  store i64 4096, ptr %20, align 8, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %5, i64 112
  store i64 8192, ptr %21, align 16, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %5, i64 120
  store i64 16384, ptr %22, align 8, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %5, i64 128
  store i64 32768, ptr %23, align 16, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %5, i64 136
  store i64 65536, ptr %24, align 8, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %5, i64 144
  store i64 131072, ptr %25, align 16, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %5, i64 152
  store i64 262144, ptr %26, align 8, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %5, i64 160
  store i64 524288, ptr %27, align 16, !tbaa !5
  %28 = getelementptr inbounds i8, ptr %5, i64 168
  store i64 1048576, ptr %28, align 8, !tbaa !5
  %29 = getelementptr inbounds i8, ptr %5, i64 176
  store i64 2097152, ptr %29, align 16, !tbaa !5
  %30 = getelementptr inbounds i8, ptr %5, i64 184
  store i64 4194304, ptr %30, align 8, !tbaa !5
  %31 = getelementptr inbounds i8, ptr %5, i64 192
  store i64 8388608, ptr %31, align 16, !tbaa !5
  %32 = getelementptr inbounds i8, ptr %5, i64 200
  store i64 16777216, ptr %32, align 8, !tbaa !5
  %33 = getelementptr inbounds i8, ptr %5, i64 208
  store i64 33554432, ptr %33, align 16, !tbaa !5
  %34 = getelementptr inbounds i8, ptr %5, i64 216
  store i64 67108864, ptr %34, align 8, !tbaa !5
  %35 = getelementptr inbounds i8, ptr %5, i64 224
  store i64 134217728, ptr %35, align 16, !tbaa !5
  %36 = getelementptr inbounds i8, ptr %5, i64 232
  store i64 268435456, ptr %36, align 8, !tbaa !5
  %37 = getelementptr inbounds i8, ptr %5, i64 240
  store i64 536870912, ptr %37, align 16, !tbaa !5
  %38 = getelementptr inbounds i8, ptr %5, i64 248
  store i64 1073741824, ptr %38, align 8, !tbaa !5
  call void @gf2_matrix_square(ptr noundef nonnull %4, ptr noundef nonnull %5)
  call void @gf2_matrix_square(ptr noundef nonnull %5, ptr noundef nonnull %4)
  br label %39

39:                                               ; preds = %49, %7
  %.022 = phi i64 [ %0, %7 ], [ %.2, %49 ]
  %.020 = phi i64 [ %2, %7 ], [ %50, %49 ]
  call void @gf2_matrix_square(ptr noundef nonnull %4, ptr noundef nonnull %5)
  %40 = and i64 %.020, 1
  %.not = icmp eq i64 %40, 0
  br i1 %.not, label %43, label %41

41:                                               ; preds = %39
  %42 = call i64 @gf2_matrix_times(ptr noundef nonnull %4, i64 noundef %.022)
  br label %43

43:                                               ; preds = %41, %39
  %.1 = phi i64 [ %42, %41 ], [ %.022, %39 ]
  %44 = icmp ult i64 %.020, 2
  br i1 %44, label %51, label %45

45:                                               ; preds = %43
  call void @gf2_matrix_square(ptr noundef nonnull %5, ptr noundef nonnull %4)
  %46 = and i64 %.020, 2
  %.not26 = icmp eq i64 %46, 0
  br i1 %.not26, label %49, label %47

47:                                               ; preds = %45
  %48 = call i64 @gf2_matrix_times(ptr noundef nonnull %5, i64 noundef %.1)
  br label %49

49:                                               ; preds = %47, %45
  %.2 = phi i64 [ %48, %47 ], [ %.1, %45 ]
  %50 = ashr i64 %.020, 2
  %.not27 = icmp ult i64 %.020, 4
  br i1 %.not27, label %51, label %39, !llvm.loop !9

51:                                               ; preds = %43, %49
  %.3 = phi i64 [ %.1, %43 ], [ %.2, %49 ]
  %52 = xor i64 %.3, %1
  br label %53

53:                                               ; preds = %3, %51
  %.021 = phi i64 [ %52, %51 ], [ %0, %3 ]
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %5) #2
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %4) #2
  ret i64 %.021
}

; Function Attrs: nounwind uwtable
declare hidden void @gf2_matrix_square(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden i64 @gf2_matrix_times(ptr noundef, i64 noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,SROAPass,SimplifyCFGPass