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

@pbox_dec = external dso_local constant [16 x i8], align 16

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

8:                                                ; preds = %19, %3
  %9 = load i64, ptr %7, align 8, !tbaa !9
  %10 = icmp ult i64 %9, 16
  br i1 %10, label %11, label %22

11:                                               ; preds = %8
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = load i64, ptr %7, align 8, !tbaa !9
  %14 = getelementptr inbounds i8, ptr %12, i64 %13
  %15 = load i8, ptr %14, align 1, !tbaa !11
  %16 = load ptr, ptr %6, align 8, !tbaa !5
  %17 = load i64, ptr %7, align 8, !tbaa !9
  %18 = getelementptr inbounds i8, ptr %16, i64 %17
  store i8 %15, ptr %18, align 1, !tbaa !11
  br label %19

19:                                               ; preds = %11
  %20 = load i64, ptr %7, align 8, !tbaa !9
  %21 = add i64 %20, 1
  store i64 %21, ptr %7, align 8, !tbaa !9
  br label %8, !llvm.loop !12

22:                                               ; preds = %8
  store i64 0, ptr %7, align 8, !tbaa !9
  br label %23

23:                                               ; preds = %37, %22
  %24 = load i64, ptr %7, align 8, !tbaa !9
  %25 = icmp ult i64 %24, 16
  br i1 %25, label %26, label %40

26:                                               ; preds = %23
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = load i64, ptr %7, align 8, !tbaa !9
  %29 = getelementptr inbounds i8, ptr %27, i64 %28
  %30 = load i8, ptr %29, align 1, !tbaa !11
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = load i64, ptr %7, align 8, !tbaa !9
  %33 = getelementptr inbounds [16 x i8], ptr @pbox_dec, i64 0, i64 %32
  %34 = load i8, ptr %33, align 1, !tbaa !11
  %35 = zext i8 %34 to i64
  %36 = getelementptr inbounds i8, ptr %31, i64 %35
  store i8 %30, ptr %36, align 1, !tbaa !11
  br label %37

37:                                               ; preds = %26
  %38 = load i64, ptr %7, align 8, !tbaa !9
  %39 = add i64 %38, 1
  store i64 %39, ptr %7, align 8, !tbaa !9
  br label %23, !llvm.loop !14

40:                                               ; preds = %23
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #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"}
!14 = distinct !{!14, !13}


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

@pbox_dec = external dso_local local_unnamed_addr constant [16 x i8], align 16

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @round_dec_per(ptr nocapture noundef %0, ptr nocapture noundef readnone %1, ptr nocapture noundef %2) local_unnamed_addr #0 {
.preheader.preheader:
  %3 = load i8, ptr %0, align 1, !tbaa !5
  store i8 %3, ptr %2, align 1, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 1
  %5 = load i8, ptr %4, align 1, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %2, i64 1
  store i8 %5, ptr %6, align 1, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 2
  %8 = load i8, ptr %7, align 1, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %2, i64 2
  store i8 %8, ptr %9, align 1, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %0, i64 3
  %11 = load i8, ptr %10, align 1, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %2, i64 3
  store i8 %11, ptr %12, align 1, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %0, i64 4
  %14 = load i8, ptr %13, align 1, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %2, i64 4
  store i8 %14, ptr %15, align 1, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %0, i64 5
  %17 = load i8, ptr %16, align 1, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %2, i64 5
  store i8 %17, ptr %18, align 1, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %0, i64 6
  %20 = load i8, ptr %19, align 1, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %2, i64 6
  store i8 %20, ptr %21, align 1, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %0, i64 7
  %23 = load i8, ptr %22, align 1, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %2, i64 7
  store i8 %23, ptr %24, align 1, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %0, i64 8
  %26 = load i8, ptr %25, align 1, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %2, i64 8
  store i8 %26, ptr %27, align 1, !tbaa !5
  %28 = getelementptr inbounds i8, ptr %0, i64 9
  %29 = load i8, ptr %28, align 1, !tbaa !5
  %30 = getelementptr inbounds i8, ptr %2, i64 9
  store i8 %29, ptr %30, align 1, !tbaa !5
  %31 = getelementptr inbounds i8, ptr %0, i64 10
  %32 = load i8, ptr %31, align 1, !tbaa !5
  %33 = getelementptr inbounds i8, ptr %2, i64 10
  store i8 %32, ptr %33, align 1, !tbaa !5
  %34 = getelementptr inbounds i8, ptr %0, i64 11
  %35 = load i8, ptr %34, align 1, !tbaa !5
  %36 = getelementptr inbounds i8, ptr %2, i64 11
  store i8 %35, ptr %36, align 1, !tbaa !5
  %37 = getelementptr inbounds i8, ptr %0, i64 12
  %38 = load i8, ptr %37, align 1, !tbaa !5
  %39 = getelementptr inbounds i8, ptr %2, i64 12
  store i8 %38, ptr %39, align 1, !tbaa !5
  %40 = getelementptr inbounds i8, ptr %0, i64 13
  %41 = load i8, ptr %40, align 1, !tbaa !5
  %42 = getelementptr inbounds i8, ptr %2, i64 13
  store i8 %41, ptr %42, align 1, !tbaa !5
  %43 = getelementptr inbounds i8, ptr %0, i64 14
  %44 = load i8, ptr %43, align 1, !tbaa !5
  %45 = getelementptr inbounds i8, ptr %2, i64 14
  store i8 %44, ptr %45, align 1, !tbaa !5
  %46 = getelementptr inbounds i8, ptr %0, i64 15
  %47 = load i8, ptr %46, align 1, !tbaa !5
  %48 = getelementptr inbounds i8, ptr %2, i64 15
  store i8 %47, ptr %48, align 1, !tbaa !5
  %49 = load i8, ptr @pbox_dec, align 16, !tbaa !5
  %50 = zext i8 %49 to i64
  %51 = getelementptr inbounds i8, ptr %0, i64 %50
  store i8 %3, ptr %51, align 1, !tbaa !5
  %52 = load i8, ptr %6, align 1, !tbaa !5
  %53 = load i8, ptr getelementptr inbounds (i8, ptr @pbox_dec, i64 1), align 1, !tbaa !5
  %54 = zext i8 %53 to i64
  %55 = getelementptr inbounds i8, ptr %0, i64 %54
  store i8 %52, ptr %55, align 1, !tbaa !5
  %56 = load i8, ptr %9, align 1, !tbaa !5
  %57 = load i8, ptr getelementptr inbounds (i8, ptr @pbox_dec, i64 2), align 2, !tbaa !5
  %58 = zext i8 %57 to i64
  %59 = getelementptr inbounds i8, ptr %0, i64 %58
  store i8 %56, ptr %59, align 1, !tbaa !5
  %60 = load i8, ptr %12, align 1, !tbaa !5
  %61 = load i8, ptr getelementptr inbounds (i8, ptr @pbox_dec, i64 3), align 1, !tbaa !5
  %62 = zext i8 %61 to i64
  %63 = getelementptr inbounds i8, ptr %0, i64 %62
  store i8 %60, ptr %63, align 1, !tbaa !5
  %64 = load i8, ptr %15, align 1, !tbaa !5
  %65 = load i8, ptr getelementptr inbounds (i8, ptr @pbox_dec, i64 4), align 4, !tbaa !5
  %66 = zext i8 %65 to i64
  %67 = getelementptr inbounds i8, ptr %0, i64 %66
  store i8 %64, ptr %67, align 1, !tbaa !5
  %68 = load i8, ptr %18, align 1, !tbaa !5
  %69 = load i8, ptr getelementptr inbounds (i8, ptr @pbox_dec, i64 5), align 1, !tbaa !5
  %70 = zext i8 %69 to i64
  %71 = getelementptr inbounds i8, ptr %0, i64 %70
  store i8 %68, ptr %71, align 1, !tbaa !5
  %72 = load i8, ptr %21, align 1, !tbaa !5
  %73 = load i8, ptr getelementptr inbounds (i8, ptr @pbox_dec, i64 6), align 2, !tbaa !5
  %74 = zext i8 %73 to i64
  %75 = getelementptr inbounds i8, ptr %0, i64 %74
  store i8 %72, ptr %75, align 1, !tbaa !5
  %76 = load i8, ptr %24, align 1, !tbaa !5
  %77 = load i8, ptr getelementptr inbounds (i8, ptr @pbox_dec, i64 7), align 1, !tbaa !5
  %78 = zext i8 %77 to i64
  %79 = getelementptr inbounds i8, ptr %0, i64 %78
  store i8 %76, ptr %79, align 1, !tbaa !5
  %80 = load i8, ptr %27, align 1, !tbaa !5
  %81 = load i8, ptr getelementptr inbounds (i8, ptr @pbox_dec, i64 8), align 8, !tbaa !5
  %82 = zext i8 %81 to i64
  %83 = getelementptr inbounds i8, ptr %0, i64 %82
  store i8 %80, ptr %83, align 1, !tbaa !5
  %84 = load i8, ptr %30, align 1, !tbaa !5
  %85 = load i8, ptr getelementptr inbounds (i8, ptr @pbox_dec, i64 9), align 1, !tbaa !5
  %86 = zext i8 %85 to i64
  %87 = getelementptr inbounds i8, ptr %0, i64 %86
  store i8 %84, ptr %87, align 1, !tbaa !5
  %88 = load i8, ptr %33, align 1, !tbaa !5
  %89 = load i8, ptr getelementptr inbounds (i8, ptr @pbox_dec, i64 10), align 2, !tbaa !5
  %90 = zext i8 %89 to i64
  %91 = getelementptr inbounds i8, ptr %0, i64 %90
  store i8 %88, ptr %91, align 1, !tbaa !5
  %92 = load i8, ptr %36, align 1, !tbaa !5
  %93 = load i8, ptr getelementptr inbounds (i8, ptr @pbox_dec, i64 11), align 1, !tbaa !5
  %94 = zext i8 %93 to i64
  %95 = getelementptr inbounds i8, ptr %0, i64 %94
  store i8 %92, ptr %95, align 1, !tbaa !5
  %96 = load i8, ptr %39, align 1, !tbaa !5
  %97 = load i8, ptr getelementptr inbounds (i8, ptr @pbox_dec, i64 12), align 4, !tbaa !5
  %98 = zext i8 %97 to i64
  %99 = getelementptr inbounds i8, ptr %0, i64 %98
  store i8 %96, ptr %99, align 1, !tbaa !5
  %100 = load i8, ptr %42, align 1, !tbaa !5
  %101 = load i8, ptr getelementptr inbounds (i8, ptr @pbox_dec, i64 13), align 1, !tbaa !5
  %102 = zext i8 %101 to i64
  %103 = getelementptr inbounds i8, ptr %0, i64 %102
  store i8 %100, ptr %103, align 1, !tbaa !5
  %104 = load i8, ptr %45, align 1, !tbaa !5
  %105 = load i8, ptr getelementptr inbounds (i8, ptr @pbox_dec, i64 14), align 2, !tbaa !5
  %106 = zext i8 %105 to i64
  %107 = getelementptr inbounds i8, ptr %0, i64 %106
  store i8 %104, ptr %107, align 1, !tbaa !5
  %108 = load i8, ptr %48, align 1, !tbaa !5
  %109 = load i8, ptr getelementptr inbounds (i8, ptr @pbox_dec, i64 15), align 1, !tbaa !5
  %110 = zext i8 %109 to i64
  %111 = getelementptr inbounds i8, ptr %0, i64 %110
  store i8 %108, ptr %111, 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: GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,LoopSimplifyPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass