; LLVM IR from DanEngelbrecht/longtail :: lib/blake3/ext (blake3_portable)

; 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: nounwind uwtable
define dso_local void @blake3_compress_in_place_portable(ptr noundef %0, ptr noundef %1, i8 noundef zeroext %2, i64 noundef %3, i8 noundef zeroext %4) #0 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i8, align 1
  %9 = alloca i64, align 8
  %10 = alloca i8, align 1
  %11 = alloca [16 x i32], align 16
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store i8 %2, ptr %8, align 1, !tbaa !9
  store i64 %3, ptr %9, align 8, !tbaa !10
  store i8 %4, ptr %10, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 64, ptr %11) #3
  %12 = getelementptr inbounds [16 x i32], ptr %11, i64 0, i64 0
  %13 = load ptr, ptr %6, align 8, !tbaa !5
  %14 = load ptr, ptr %7, align 8, !tbaa !5
  %15 = load i8, ptr %8, align 1, !tbaa !9
  %16 = load i64, ptr %9, align 8, !tbaa !10
  %17 = load i8, ptr %10, align 1, !tbaa !9
  call void @compress_pre(ptr noundef %12, ptr noundef %13, ptr noundef %14, i8 noundef zeroext %15, i64 noundef %16, i8 noundef zeroext %17)
  %18 = getelementptr inbounds [16 x i32], ptr %11, i64 0, i64 0
  %19 = load i32, ptr %18, align 16, !tbaa !12
  %20 = getelementptr inbounds [16 x i32], ptr %11, i64 0, i64 8
  %21 = load i32, ptr %20, align 16, !tbaa !12
  %22 = xor i32 %19, %21
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = getelementptr inbounds i32, ptr %23, i64 0
  store i32 %22, ptr %24, align 4, !tbaa !12
  %25 = getelementptr inbounds [16 x i32], ptr %11, i64 0, i64 1
  %26 = load i32, ptr %25, align 4, !tbaa !12
  %27 = getelementptr inbounds [16 x i32], ptr %11, i64 0, i64 9
  %28 = load i32, ptr %27, align 4, !tbaa !12
  %29 = xor i32 %26, %28
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = getelementptr inbounds i32, ptr %30, i64 1
  store i32 %29, ptr %31, align 4, !tbaa !12
  %32 = getelementptr inbounds [16 x i32], ptr %11, i64 0, i64 2
  %33 = load i32, ptr %32, align 8, !tbaa !12
  %34 = getelementptr inbounds [16 x i32], ptr %11, i64 0, i64 10
  %35 = load i32, ptr %34, align 8, !tbaa !12
  %36 = xor i32 %33, %35
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = getelementptr inbounds i32, ptr %37, i64 2
  store i32 %36, ptr %38, align 4, !tbaa !12
  %39 = getelementptr inbounds [16 x i32], ptr %11, i64 0, i64 3
  %40 = load i32, ptr %39, align 4, !tbaa !12
  %41 = getelementptr inbounds [16 x i32], ptr %11, i64 0, i64 11
  %42 = load i32, ptr %41, align 4, !tbaa !12
  %43 = xor i32 %40, %42
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = getelementptr inbounds i32, ptr %44, i64 3
  store i32 %43, ptr %45, align 4, !tbaa !12
  %46 = getelementptr inbounds [16 x i32], ptr %11, i64 0, i64 4
  %47 = load i32, ptr %46, align 16, !tbaa !12
  %48 = getelementptr inbounds [16 x i32], ptr %11, i64 0, i64 12
  %49 = load i32, ptr %48, align 16, !tbaa !12
  %50 = xor i32 %47, %49
  %51 = load ptr, ptr %6, align 8, !tbaa !5
  %52 = getelementptr inbounds i32, ptr %51, i64 4
  store i32 %50, ptr %52, align 4, !tbaa !12
  %53 = getelementptr inbounds [16 x i32], ptr %11, i64 0, i64 5
  %54 = load i32, ptr %53, align 4, !tbaa !12
  %55 = getelementptr inbounds [16 x i32], ptr %11, i64 0, i64 13
  %56 = load i32, ptr %55, align 4, !tbaa !12
  %57 = xor i32 %54, %56
  %58 = load ptr, ptr %6, align 8, !tbaa !5
  %59 = getelementptr inbounds i32, ptr %58, i64 5
  store i32 %57, ptr %59, align 4, !tbaa !12
  %60 = getelementptr inbounds [16 x i32], ptr %11, i64 0, i64 6
  %61 = load i32, ptr %60, align 8, !tbaa !12
  %62 = getelementptr inbounds [16 x i32], ptr %11, i64 0, i64 14
  %63 = load i32, ptr %62, align 8, !tbaa !12
  %64 = xor i32 %61, %63
  %65 = load ptr, ptr %6, align 8, !tbaa !5
  %66 = getelementptr inbounds i32, ptr %65, i64 6
  store i32 %64, ptr %66, align 4, !tbaa !12
  %67 = getelementptr inbounds [16 x i32], ptr %11, i64 0, i64 7
  %68 = load i32, ptr %67, align 4, !tbaa !12
  %69 = getelementptr inbounds [16 x i32], ptr %11, i64 0, i64 15
  %70 = load i32, ptr %69, align 4, !tbaa !12
  %71 = xor i32 %68, %70
  %72 = load ptr, ptr %6, align 8, !tbaa !5
  %73 = getelementptr inbounds i32, ptr %72, i64 7
  store i32 %71, ptr %73, align 4, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 64, ptr %11) #3
  ret void
}

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

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @compress_pre(ptr noundef, ptr noundef, ptr noundef, i8 noundef zeroext, i64 noundef, i8 noundef zeroext) #2

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

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

; Function Attrs: nounwind uwtable
define dso_local void @blake3_compress_in_place_portable(ptr noundef %0, ptr noundef %1, i8 noundef zeroext %2, i64 noundef %3, i8 noundef zeroext %4) local_unnamed_addr #0 {
  %6 = alloca [16 x i32], align 16
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %6) #3
  call void @compress_pre(ptr noundef nonnull %6, ptr noundef %0, ptr noundef %1, i8 noundef zeroext %2, i64 noundef %3, i8 noundef zeroext %4)
  %7 = getelementptr inbounds i8, ptr %6, i64 32
  %8 = load <4 x i32>, ptr %6, align 16, !tbaa !5
  %9 = load <4 x i32>, ptr %7, align 16, !tbaa !5
  %10 = xor <4 x i32> %9, %8
  store <4 x i32> %10, ptr %0, align 4, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %6, i64 16
  %12 = getelementptr inbounds i8, ptr %6, i64 48
  %13 = getelementptr inbounds i8, ptr %0, i64 16
  %14 = load <4 x i32>, ptr %11, align 16, !tbaa !5
  %15 = load <4 x i32>, ptr %12, align 16, !tbaa !5
  %16 = xor <4 x i32> %15, %14
  store <4 x i32> %16, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %6) #3
  ret void
}

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

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @compress_pre(ptr noundef, ptr noundef, ptr noundef, i8 noundef zeroext, i64 noundef, i8 noundef zeroext) local_unnamed_addr #2

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

attributes #0 = { 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 = { alwaysinline 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, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SLPVectorizerPass,SROAPass