; LLVM IR from imkcat/CatCrypto :: Sources/ModuleMaps/MD6 (md6_compress)

; 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: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; Function Attrs: nounwind uwtable
declare dso_local i64 @md6_make_control_word(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i64 @md6_make_nodeID(i32 noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @md6_pack(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6, i32 noundef %7, i32 noundef %8, i32 noundef %9, i32 noundef %10, ptr noundef %11) #2 {
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca ptr, align 8
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i64, align 8
  %28 = alloca i64, align 8
  store ptr %0, ptr %13, align 8, !tbaa !5
  store ptr %1, ptr %14, align 8, !tbaa !5
  store ptr %2, ptr %15, align 8, !tbaa !5
  store i32 %3, ptr %16, align 4, !tbaa !9
  store i32 %4, ptr %17, align 4, !tbaa !9
  store i32 %5, ptr %18, align 4, !tbaa !9
  store i32 %6, ptr %19, align 4, !tbaa !9
  store i32 %7, ptr %20, align 4, !tbaa !9
  store i32 %8, ptr %21, align 4, !tbaa !9
  store i32 %9, ptr %22, align 4, !tbaa !9
  store i32 %10, ptr %23, align 4, !tbaa !9
  store ptr %11, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #3
  store i32 0, ptr %26, align 4, !tbaa !9
  store i32 0, ptr %25, align 4, !tbaa !9
  br label %29

29:                                               ; preds = %43, %12
  %30 = load i32, ptr %25, align 4, !tbaa !9
  %31 = icmp slt i32 %30, 15
  br i1 %31, label %32, label %46

32:                                               ; preds = %29
  %33 = load ptr, ptr %14, align 8, !tbaa !5
  %34 = load i32, ptr %25, align 4, !tbaa !9
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds i64, ptr %33, i64 %35
  %37 = load i64, ptr %36, align 8, !tbaa !11
  %38 = load ptr, ptr %13, align 8, !tbaa !5
  %39 = load i32, ptr %26, align 4, !tbaa !9
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %26, align 4, !tbaa !9
  %41 = sext i32 %39 to i64
  %42 = getelementptr inbounds i64, ptr %38, i64 %41
  store i64 %37, ptr %42, align 8, !tbaa !11
  br label %43

43:                                               ; preds = %32
  %44 = load i32, ptr %25, align 4, !tbaa !9
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %25, align 4, !tbaa !9
  br label %29, !llvm.loop !13

46:                                               ; preds = %29
  store i32 0, ptr %25, align 4, !tbaa !9
  br label %47

47:                                               ; preds = %61, %46
  %48 = load i32, ptr %25, align 4, !tbaa !9
  %49 = icmp slt i32 %48, 8
  br i1 %49, label %50, label %64

50:                                               ; preds = %47
  %51 = load ptr, ptr %15, align 8, !tbaa !5
  %52 = load i32, ptr %25, align 4, !tbaa !9
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds i64, ptr %51, i64 %53
  %55 = load i64, ptr %54, align 8, !tbaa !11
  %56 = load ptr, ptr %13, align 8, !tbaa !5
  %57 = load i32, ptr %26, align 4, !tbaa !9
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %26, align 4, !tbaa !9
  %59 = sext i32 %57 to i64
  %60 = getelementptr inbounds i64, ptr %56, i64 %59
  store i64 %55, ptr %60, align 8, !tbaa !11
  br label %61

61:                                               ; preds = %50
  %62 = load i32, ptr %25, align 4, !tbaa !9
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %25, align 4, !tbaa !9
  br label %47, !llvm.loop !15

64:                                               ; preds = %47
  %65 = load i32, ptr %16, align 4, !tbaa !9
  %66 = load i32, ptr %17, align 4, !tbaa !9
  %67 = call i64 @md6_make_nodeID(i32 noundef %65, i32 noundef %66)
  store i64 %67, ptr %27, align 8, !tbaa !11
  %68 = load ptr, ptr %13, align 8, !tbaa !5
  %69 = load i32, ptr %26, align 4, !tbaa !9
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds i64, ptr %68, i64 %70
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %71, ptr align 8 %27, i64 8, i1 false)
  %72 = load i32, ptr %26, align 4, !tbaa !9
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %26, align 4, !tbaa !9
  %74 = load i32, ptr %18, align 4, !tbaa !9
  %75 = load i32, ptr %19, align 4, !tbaa !9
  %76 = load i32, ptr %20, align 4, !tbaa !9
  %77 = load i32, ptr %21, align 4, !tbaa !9
  %78 = load i32, ptr %22, align 4, !tbaa !9
  %79 = load i32, ptr %23, align 4, !tbaa !9
  %80 = call i64 @md6_make_control_word(i32 noundef %74, i32 noundef %75, i32 noundef %76, i32 noundef %77, i32 noundef %78, i32 noundef %79)
  store i64 %80, ptr %28, align 8, !tbaa !11
  %81 = load ptr, ptr %13, align 8, !tbaa !5
  %82 = load i32, ptr %26, align 4, !tbaa !9
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds i64, ptr %81, i64 %83
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %84, ptr align 8 %28, i64 8, i1 false)
  %85 = load i32, ptr %26, align 4, !tbaa !9
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %26, align 4, !tbaa !9
  %87 = load ptr, ptr %13, align 8, !tbaa !5
  %88 = load i32, ptr %26, align 4, !tbaa !9
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds i64, ptr %87, i64 %89
  %91 = load ptr, ptr %24, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %90, ptr align 8 %91, i64 512, i1 false)
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #3
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


; 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0

; Function Attrs: nounwind uwtable
declare dso_local i64 @md6_make_control_word(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local i64 @md6_make_nodeID(i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @md6_pack(ptr nocapture noundef writeonly %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6, i32 noundef %7, i32 noundef %8, i32 noundef %9, i32 noundef %10, ptr nocapture noundef readonly %11) local_unnamed_addr #1 {
.preheader.preheader:
  %12 = load i64, ptr %1, align 8, !tbaa !5
  store i64 %12, ptr %0, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %1, i64 8
  %14 = load i64, ptr %13, align 8, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %0, i64 8
  store i64 %14, ptr %15, align 8, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %1, i64 16
  %17 = load i64, ptr %16, align 8, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %0, i64 16
  store i64 %17, ptr %18, align 8, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %1, i64 24
  %20 = load i64, ptr %19, align 8, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %0, i64 24
  store i64 %20, ptr %21, align 8, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %1, i64 32
  %23 = load i64, ptr %22, align 8, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %0, i64 32
  store i64 %23, ptr %24, align 8, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %1, i64 40
  %26 = load i64, ptr %25, align 8, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %0, i64 40
  store i64 %26, ptr %27, align 8, !tbaa !5
  %28 = getelementptr inbounds i8, ptr %1, i64 48
  %29 = load i64, ptr %28, align 8, !tbaa !5
  %30 = getelementptr inbounds i8, ptr %0, i64 48
  store i64 %29, ptr %30, align 8, !tbaa !5
  %31 = getelementptr inbounds i8, ptr %1, i64 56
  %32 = load i64, ptr %31, align 8, !tbaa !5
  %33 = getelementptr inbounds i8, ptr %0, i64 56
  store i64 %32, ptr %33, align 8, !tbaa !5
  %34 = getelementptr inbounds i8, ptr %1, i64 64
  %35 = load i64, ptr %34, align 8, !tbaa !5
  %36 = getelementptr inbounds i8, ptr %0, i64 64
  store i64 %35, ptr %36, align 8, !tbaa !5
  %37 = getelementptr inbounds i8, ptr %1, i64 72
  %38 = load i64, ptr %37, align 8, !tbaa !5
  %39 = getelementptr inbounds i8, ptr %0, i64 72
  store i64 %38, ptr %39, align 8, !tbaa !5
  %40 = getelementptr inbounds i8, ptr %1, i64 80
  %41 = load i64, ptr %40, align 8, !tbaa !5
  %42 = getelementptr inbounds i8, ptr %0, i64 80
  store i64 %41, ptr %42, align 8, !tbaa !5
  %43 = getelementptr inbounds i8, ptr %1, i64 88
  %44 = load i64, ptr %43, align 8, !tbaa !5
  %45 = getelementptr inbounds i8, ptr %0, i64 88
  store i64 %44, ptr %45, align 8, !tbaa !5
  %46 = getelementptr inbounds i8, ptr %1, i64 96
  %47 = load i64, ptr %46, align 8, !tbaa !5
  %48 = getelementptr inbounds i8, ptr %0, i64 96
  store i64 %47, ptr %48, align 8, !tbaa !5
  %49 = getelementptr inbounds i8, ptr %1, i64 104
  %50 = load i64, ptr %49, align 8, !tbaa !5
  %51 = getelementptr inbounds i8, ptr %0, i64 104
  store i64 %50, ptr %51, align 8, !tbaa !5
  %52 = getelementptr inbounds i8, ptr %1, i64 112
  %53 = load i64, ptr %52, align 8, !tbaa !5
  %54 = getelementptr inbounds i8, ptr %0, i64 112
  store i64 %53, ptr %54, align 8, !tbaa !5
  %55 = load i64, ptr %2, align 8, !tbaa !5
  %56 = getelementptr inbounds i8, ptr %0, i64 120
  store i64 %55, ptr %56, align 8, !tbaa !5
  %57 = getelementptr inbounds i8, ptr %2, i64 8
  %58 = load i64, ptr %57, align 8, !tbaa !5
  %59 = getelementptr inbounds i8, ptr %0, i64 128
  store i64 %58, ptr %59, align 8, !tbaa !5
  %60 = getelementptr inbounds i8, ptr %2, i64 16
  %61 = load i64, ptr %60, align 8, !tbaa !5
  %62 = getelementptr inbounds i8, ptr %0, i64 136
  store i64 %61, ptr %62, align 8, !tbaa !5
  %63 = getelementptr inbounds i8, ptr %2, i64 24
  %64 = load i64, ptr %63, align 8, !tbaa !5
  %65 = getelementptr inbounds i8, ptr %0, i64 144
  store i64 %64, ptr %65, align 8, !tbaa !5
  %66 = getelementptr inbounds i8, ptr %2, i64 32
  %67 = load i64, ptr %66, align 8, !tbaa !5
  %68 = getelementptr inbounds i8, ptr %0, i64 152
  store i64 %67, ptr %68, align 8, !tbaa !5
  %69 = getelementptr inbounds i8, ptr %2, i64 40
  %70 = load i64, ptr %69, align 8, !tbaa !5
  %71 = getelementptr inbounds i8, ptr %0, i64 160
  store i64 %70, ptr %71, align 8, !tbaa !5
  %72 = getelementptr inbounds i8, ptr %2, i64 48
  %73 = load i64, ptr %72, align 8, !tbaa !5
  %74 = getelementptr inbounds i8, ptr %0, i64 168
  store i64 %73, ptr %74, align 8, !tbaa !5
  %75 = getelementptr inbounds i8, ptr %2, i64 56
  %76 = load i64, ptr %75, align 8, !tbaa !5
  %77 = getelementptr inbounds i8, ptr %0, i64 176
  store i64 %76, ptr %77, align 8, !tbaa !5
  %78 = tail call i64 @md6_make_nodeID(i32 noundef %3, i32 noundef %4)
  %79 = getelementptr inbounds i8, ptr %0, i64 184
  store i64 %78, ptr %79, align 1
  %80 = tail call i64 @md6_make_control_word(i32 noundef %5, i32 noundef %6, i32 noundef %7, i32 noundef %8, i32 noundef %9, i32 noundef %10)
  %81 = getelementptr inbounds i8, ptr %0, i64 192
  store i64 %80, ptr %81, align 1
  %82 = getelementptr inbounds i8, ptr %0, i64 200
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(512) %82, ptr noundef nonnull align 8 dereferenceable(512) %11, i64 512, i1 false)
  ret void
}

attributes #0 = { mustprogress nocallback nofree 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" }

!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"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass