; 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
declare dso_local void @dec(ptr noundef, ptr noundef, ptr noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local void @decrypt(ptr noundef %0, ptr noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca [528 x i8], align 16
  %6 = alloca [16 x i8], align 16
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  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 528, ptr %5) #2
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #2
  %9 = load ptr, ptr %4, align 8, !tbaa !5
  %10 = getelementptr inbounds [528 x i8], ptr %5, i64 0, i64 0
  call void @expand_key(ptr noundef %9, ptr noundef %10)
  %11 = load ptr, ptr %3, align 8, !tbaa !5
  %12 = getelementptr inbounds [528 x i8], ptr %5, i64 0, i64 0
  %13 = getelementptr inbounds [16 x i8], ptr %6, i64 0, i64 0
  call void @dec(ptr noundef %11, ptr noundef %12, ptr noundef %13)
  store i64 0, ptr %7, align 8, !tbaa !9
  br label %14

14:                                               ; preds = %21, %2
  %15 = load i64, ptr %7, align 8, !tbaa !9
  %16 = icmp ult i64 %15, 32
  br i1 %16, label %17, label %24

17:                                               ; preds = %14
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = load i64, ptr %7, align 8, !tbaa !9
  %20 = getelementptr inbounds i8, ptr %18, i64 %19
  store i8 0, ptr %20, align 1, !tbaa !11
  br label %21

21:                                               ; preds = %17
  %22 = load i64, ptr %7, align 8, !tbaa !9
  %23 = add i64 %22, 1
  store i64 %23, ptr %7, align 8, !tbaa !9
  br label %14, !llvm.loop !12

24:                                               ; preds = %14
  store i64 0, ptr %7, align 8, !tbaa !9
  br label %25

25:                                               ; preds = %44, %24
  %26 = load i64, ptr %7, align 8, !tbaa !9
  %27 = icmp ult i64 %26, 16
  br i1 %27, label %28, label %47

28:                                               ; preds = %25
  %29 = load i64, ptr %7, align 8, !tbaa !9
  %30 = getelementptr inbounds [16 x i8], ptr %6, i64 0, i64 %29
  store i8 0, ptr %30, align 1, !tbaa !11
  store i64 0, ptr %8, align 8, !tbaa !9
  br label %31

31:                                               ; preds = %40, %28
  %32 = load i64, ptr %8, align 8, !tbaa !9
  %33 = icmp ult i64 %32, 32
  br i1 %33, label %34, label %43

34:                                               ; preds = %31
  %35 = load i64, ptr %8, align 8, !tbaa !9
  %36 = mul i64 %35, 16
  %37 = load i64, ptr %7, align 8, !tbaa !9
  %38 = add i64 %36, %37
  %39 = getelementptr inbounds [528 x i8], ptr %5, i64 0, i64 %38
  store i8 0, ptr %39, align 1, !tbaa !11
  br label %40

40:                                               ; preds = %34
  %41 = load i64, ptr %8, align 8, !tbaa !9
  %42 = add i64 %41, 1
  store i64 %42, ptr %8, align 8, !tbaa !9
  br label %31, !llvm.loop !14

43:                                               ; preds = %31
  br label %44

44:                                               ; preds = %43
  %45 = load i64, ptr %7, align 8, !tbaa !9
  %46 = add i64 %45, 1
  store i64 %46, ptr %7, align 8, !tbaa !9
  br label %25, !llvm.loop !15

47:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #2
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #2
  call void @llvm.lifetime.end.p0(i64 528, 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"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !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"

; 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
declare dso_local void @dec(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
define dso_local void @decrypt(ptr noundef %0, ptr noundef %1) local_unnamed_addr #1 {
.preheader.preheader:
  %2 = alloca [528 x i8], align 16
  %3 = alloca [16 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 528, ptr nonnull %2) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #3
  call void @expand_key(ptr noundef %1, ptr noundef nonnull %2)
  call void @dec(ptr noundef %0, ptr noundef nonnull %2, ptr noundef nonnull %3)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(32) %1, i8 0, i64 32, i1 false), !tbaa !5
  store <16 x i8> zeroinitializer, ptr %2, align 16, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %2, i64 16
  store <16 x i8> zeroinitializer, ptr %4, align 16, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %2, i64 32
  store <16 x i8> zeroinitializer, ptr %5, align 16, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %2, i64 48
  store <16 x i8> zeroinitializer, ptr %6, align 16, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %2, i64 64
  store <16 x i8> zeroinitializer, ptr %7, align 16, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %2, i64 80
  store <16 x i8> zeroinitializer, ptr %8, align 16, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %2, i64 96
  store <16 x i8> zeroinitializer, ptr %9, align 16, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %2, i64 112
  store <16 x i8> zeroinitializer, ptr %10, align 16, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %2, i64 128
  store <16 x i8> zeroinitializer, ptr %11, align 16, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %2, i64 144
  store <16 x i8> zeroinitializer, ptr %12, align 16, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %2, i64 160
  store <16 x i8> zeroinitializer, ptr %13, align 16, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %2, i64 176
  store <16 x i8> zeroinitializer, ptr %14, align 16, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %2, i64 192
  store <16 x i8> zeroinitializer, ptr %15, align 16, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %2, i64 208
  store <16 x i8> zeroinitializer, ptr %16, align 16, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %2, i64 224
  store <16 x i8> zeroinitializer, ptr %17, align 16, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %2, i64 240
  store <16 x i8> zeroinitializer, ptr %18, align 16, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %2, i64 256
  store <16 x i8> zeroinitializer, ptr %19, align 16, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %2, i64 272
  store <16 x i8> zeroinitializer, ptr %20, align 16, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %2, i64 288
  store <16 x i8> zeroinitializer, ptr %21, align 16, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %2, i64 304
  store <16 x i8> zeroinitializer, ptr %22, align 16, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %2, i64 320
  store <16 x i8> zeroinitializer, ptr %23, align 16, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %2, i64 336
  store <16 x i8> zeroinitializer, ptr %24, align 16, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %2, i64 352
  store <16 x i8> zeroinitializer, ptr %25, align 16, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %2, i64 368
  store <16 x i8> zeroinitializer, ptr %26, align 16, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %2, i64 384
  store <16 x i8> zeroinitializer, ptr %27, align 16, !tbaa !5
  %28 = getelementptr inbounds i8, ptr %2, i64 400
  store <16 x i8> zeroinitializer, ptr %28, align 16, !tbaa !5
  %29 = getelementptr inbounds i8, ptr %2, i64 416
  store <16 x i8> zeroinitializer, ptr %29, align 16, !tbaa !5
  %30 = getelementptr inbounds i8, ptr %2, i64 432
  store <16 x i8> zeroinitializer, ptr %30, align 16, !tbaa !5
  %31 = getelementptr inbounds i8, ptr %2, i64 448
  store <16 x i8> zeroinitializer, ptr %31, align 16, !tbaa !5
  %32 = getelementptr inbounds i8, ptr %2, i64 464
  store <16 x i8> zeroinitializer, ptr %32, align 16, !tbaa !5
  %33 = getelementptr inbounds i8, ptr %2, i64 480
  store <16 x i8> zeroinitializer, ptr %33, align 16, !tbaa !5
  %34 = getelementptr inbounds i8, ptr %2, i64 496
  store <16 x i8> zeroinitializer, ptr %34, align 16, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #3
  call void @llvm.lifetime.end.p0(i64 528, ptr nonnull %2) #3
  ret void
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LoopIdiomRecognizePass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopVectorizePass,ReassociatePass,SROAPass,SimplifyCFGPass