; LLVM IR from Serpent27/Wyndhim :: src (main)

; 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 void @round_mix(ptr noundef %0, ptr noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i8, align 1
  %7 = alloca i8, align 1
  %8 = alloca i8, align 1
  %9 = alloca i8, align 1
  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) #2
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #2
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #2
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #2
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #2
  store i64 0, ptr %5, align 8, !tbaa !9
  br label %10

10:                                               ; preds = %50, %2
  %11 = load i64, ptr %5, align 8, !tbaa !9
  %12 = icmp ult i64 %11, 16
  br i1 %12, label %13, label %53

13:                                               ; preds = %10
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  %15 = load i64, ptr %5, align 8, !tbaa !9
  %16 = getelementptr inbounds i8, ptr %14, i64 %15
  %17 = load i8, ptr %16, align 1, !tbaa !11
  store i8 %17, ptr %6, align 1, !tbaa !11
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  %19 = load i64, ptr %5, align 8, !tbaa !9
  %20 = add i64 %19, 1
  %21 = and i64 %20, 15
  %22 = getelementptr inbounds i8, ptr %18, i64 %21
  %23 = load i8, ptr %22, align 1, !tbaa !11
  store i8 %23, ptr %7, align 1, !tbaa !11
  %24 = load i8, ptr %6, align 1, !tbaa !11
  %25 = zext i8 %24 to i32
  %26 = and i32 %25, 170
  %27 = load i8, ptr %7, align 1, !tbaa !11
  %28 = zext i8 %27 to i32
  %29 = and i32 %28, 85
  %30 = or i32 %26, %29
  %31 = trunc i32 %30 to i8
  store i8 %31, ptr %8, align 1, !tbaa !11
  %32 = load i8, ptr %6, align 1, !tbaa !11
  %33 = zext i8 %32 to i32
  %34 = and i32 %33, 85
  %35 = load i8, ptr %7, align 1, !tbaa !11
  %36 = zext i8 %35 to i32
  %37 = and i32 %36, 170
  %38 = or i32 %34, %37
  %39 = trunc i32 %38 to i8
  store i8 %39, ptr %9, align 1, !tbaa !11
  %40 = load i8, ptr %8, align 1, !tbaa !11
  %41 = load ptr, ptr %3, align 8, !tbaa !5
  %42 = load i64, ptr %5, align 8, !tbaa !9
  %43 = getelementptr inbounds i8, ptr %41, i64 %42
  store i8 %40, ptr %43, align 1, !tbaa !11
  %44 = load i8, ptr %9, align 1, !tbaa !11
  %45 = load ptr, ptr %3, align 8, !tbaa !5
  %46 = load i64, ptr %5, align 8, !tbaa !9
  %47 = add i64 %46, 1
  %48 = and i64 %47, 15
  %49 = getelementptr inbounds i8, ptr %45, i64 %48
  store i8 %44, ptr %49, align 1, !tbaa !11
  br label %50

50:                                               ; preds = %13
  %51 = load i64, ptr %5, align 8, !tbaa !9
  %52 = add i64 %51, 2
  store i64 %52, ptr %5, align 8, !tbaa !9
  br label %10, !llvm.loop !12

53:                                               ; preds = %10
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #2
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #2
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #2
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #2
  ret void
}

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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}


; 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 nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @round_mix(ptr nocapture noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #0 {
  %3 = load <16 x i8>, ptr %0, align 1, !tbaa !5
  %4 = and <16 x i8> %3, <i8 -86, i8 -86, i8 85, i8 85, i8 -86, i8 -86, i8 85, i8 85, i8 -86, i8 -86, i8 85, i8 85, i8 -86, i8 -86, i8 85, i8 85>
  %5 = and <16 x i8> %3, <i8 85, i8 85, i8 -86, i8 -86, i8 85, i8 85, i8 -86, i8 -86, i8 85, i8 85, i8 -86, i8 -86, i8 85, i8 85, i8 -86, i8 -86>
  %6 = shufflevector <16 x i8> %5, <16 x i8> poison, <16 x i32> <i32 1, i32 0, i32 3, i32 2, i32 5, i32 4, i32 7, i32 6, i32 9, i32 8, i32 11, i32 10, i32 13, i32 12, i32 15, i32 14>
  %7 = or disjoint <16 x i8> %6, %4
  %8 = shufflevector <16 x i8> %7, <16 x i8> poison, <16 x i32> <i32 0, i32 1, i32 3, i32 2, i32 4, i32 5, i32 7, i32 6, i32 8, i32 9, i32 11, i32 10, i32 12, i32 13, i32 15, i32 14>
  store <16 x i8> %8, ptr %0, align 1, !tbaa !5
  ret void
}

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}


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