; LLVM IR from jingweizhanghuai/Morn :: src/util (morn_DES)

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

@in_map = external dso_local global [64 x i8], align 16
@des_e = external dso_local global [48 x i8], align 16
@des_p = external dso_local global [32 x i8], align 16
@des_out = external dso_local global [64 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
declare dso_local i64 @DesTransform(i64 noundef, ptr noundef, i32 noundef) #1

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

; Function Attrs: nounwind uwtable
declare dso_local i64 @DesSBox(i64 noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i64 @DesDecrypt(i64 noundef %0, i64 noundef %1) #1 {
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca [16 x i64], align 16
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  store i64 %0, ptr %3, align 8, !tbaa !5
  store i64 %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 128, ptr %5) #2
  %12 = load i64, ptr %4, align 8, !tbaa !5
  %13 = getelementptr inbounds [16 x i64], ptr %5, i64 0, i64 0
  call void @DesKey(i64 noundef %12, ptr noundef %13)
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #2
  store i64 0, ptr %6, align 8, !tbaa !5
  %14 = load i64, ptr %3, align 8, !tbaa !5
  %15 = call i64 @DesTransform(i64 noundef %14, ptr noundef @in_map, i32 noundef 64)
  store i64 %15, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #2
  %16 = load i64, ptr %6, align 8, !tbaa !5
  %17 = and i64 %16, -4294967296
  store i64 %17, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #2
  %18 = load i64, ptr %6, align 8, !tbaa !5
  %19 = shl i64 %18, 32
  store i64 %19, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #2
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %20

20:                                               ; preds = %42, %2
  %21 = load i32, ptr %10, align 4, !tbaa !9
  %22 = icmp slt i32 %21, 16
  br i1 %22, label %23, label %45

23:                                               ; preds = %20
  %24 = load i64, ptr %8, align 8, !tbaa !5
  store i64 %24, ptr %9, align 8, !tbaa !5
  %25 = load i64, ptr %8, align 8, !tbaa !5
  %26 = call i64 @DesTransform(i64 noundef %25, ptr noundef @des_e, i32 noundef 48)
  store i64 %26, ptr %8, align 8, !tbaa !5
  %27 = load i64, ptr %8, align 8, !tbaa !5
  %28 = load i32, ptr %10, align 4, !tbaa !9
  %29 = sub nsw i32 15, %28
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [16 x i64], ptr %5, i64 0, i64 %30
  %32 = load i64, ptr %31, align 8, !tbaa !5
  %33 = xor i64 %27, %32
  store i64 %33, ptr %8, align 8, !tbaa !5
  %34 = load i64, ptr %8, align 8, !tbaa !5
  %35 = call i64 @DesSBox(i64 noundef %34)
  store i64 %35, ptr %8, align 8, !tbaa !5
  %36 = load i64, ptr %8, align 8, !tbaa !5
  %37 = call i64 @DesTransform(i64 noundef %36, ptr noundef @des_p, i32 noundef 32)
  store i64 %37, ptr %8, align 8, !tbaa !5
  %38 = load i64, ptr %8, align 8, !tbaa !5
  %39 = load i64, ptr %7, align 8, !tbaa !5
  %40 = xor i64 %38, %39
  store i64 %40, ptr %8, align 8, !tbaa !5
  %41 = load i64, ptr %9, align 8, !tbaa !5
  store i64 %41, ptr %7, align 8, !tbaa !5
  br label %42

42:                                               ; preds = %23
  %43 = load i32, ptr %10, align 4, !tbaa !9
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %10, align 4, !tbaa !9
  br label %20, !llvm.loop !11

45:                                               ; preds = %20
  %46 = load i64, ptr %8, align 8, !tbaa !5
  %47 = load i64, ptr %7, align 8, !tbaa !5
  %48 = lshr i64 %47, 32
  %49 = add i64 %46, %48
  store i64 %49, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #2
  %50 = load i64, ptr %6, align 8, !tbaa !5
  %51 = call i64 @DesTransform(i64 noundef %50, ptr noundef @des_out, i32 noundef 64)
  store i64 %51, ptr %11, align 8, !tbaa !5
  %52 = load i64, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #2
  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 8, ptr %6) #2
  call void @llvm.lifetime.end.p0(i64 128, ptr %5) #2
  ret i64 %52
}

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 = !{!"long", !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 = distinct !{!11, !12}
!12 = !{!"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"

@in_map = external dso_local global [64 x i8], align 16
@des_e = external dso_local global [48 x i8], align 16
@des_p = external dso_local global [32 x i8], align 16
@des_out = external dso_local global [64 x i8], align 16

; 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 i64 @DesTransform(i64 noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

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

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

; Function Attrs: nounwind uwtable
define dso_local i64 @DesDecrypt(i64 noundef %0, i64 noundef %1) local_unnamed_addr #1 {
  %3 = alloca [16 x i64], align 16
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %3) #2
  call void @DesKey(i64 noundef %1, ptr noundef nonnull %3)
  %4 = call i64 @DesTransform(i64 noundef %0, ptr noundef nonnull @in_map, i32 noundef 64)
  %5 = and i64 %4, -4294967296
  %6 = shl i64 %4, 32
  %7 = call i64 @DesTransform(i64 noundef %6, ptr noundef nonnull @des_e, i32 noundef 48)
  %8 = getelementptr inbounds i8, ptr %3, i64 120
  %9 = load i64, ptr %8, align 8, !tbaa !5
  %10 = xor i64 %9, %7
  %11 = call i64 @DesSBox(i64 noundef %10)
  %12 = call i64 @DesTransform(i64 noundef %11, ptr noundef nonnull @des_p, i32 noundef 32)
  %13 = xor i64 %12, %5
  %14 = call i64 @DesTransform(i64 noundef %13, ptr noundef nonnull @des_e, i32 noundef 48)
  %15 = getelementptr inbounds i8, ptr %3, i64 112
  %16 = load i64, ptr %15, align 16, !tbaa !5
  %17 = xor i64 %16, %14
  %18 = call i64 @DesSBox(i64 noundef %17)
  %19 = call i64 @DesTransform(i64 noundef %18, ptr noundef nonnull @des_p, i32 noundef 32)
  %20 = xor i64 %19, %6
  %21 = call i64 @DesTransform(i64 noundef %20, ptr noundef nonnull @des_e, i32 noundef 48)
  %22 = getelementptr inbounds i8, ptr %3, i64 104
  %23 = load i64, ptr %22, align 8, !tbaa !5
  %24 = xor i64 %23, %21
  %25 = call i64 @DesSBox(i64 noundef %24)
  %26 = call i64 @DesTransform(i64 noundef %25, ptr noundef nonnull @des_p, i32 noundef 32)
  %27 = xor i64 %26, %13
  %28 = call i64 @DesTransform(i64 noundef %27, ptr noundef nonnull @des_e, i32 noundef 48)
  %29 = getelementptr inbounds i8, ptr %3, i64 96
  %30 = load i64, ptr %29, align 16, !tbaa !5
  %31 = xor i64 %30, %28
  %32 = call i64 @DesSBox(i64 noundef %31)
  %33 = call i64 @DesTransform(i64 noundef %32, ptr noundef nonnull @des_p, i32 noundef 32)
  %34 = xor i64 %33, %20
  %35 = call i64 @DesTransform(i64 noundef %34, ptr noundef nonnull @des_e, i32 noundef 48)
  %36 = getelementptr inbounds i8, ptr %3, i64 88
  %37 = load i64, ptr %36, align 8, !tbaa !5
  %38 = xor i64 %37, %35
  %39 = call i64 @DesSBox(i64 noundef %38)
  %40 = call i64 @DesTransform(i64 noundef %39, ptr noundef nonnull @des_p, i32 noundef 32)
  %41 = xor i64 %40, %27
  %42 = call i64 @DesTransform(i64 noundef %41, ptr noundef nonnull @des_e, i32 noundef 48)
  %43 = getelementptr inbounds i8, ptr %3, i64 80
  %44 = load i64, ptr %43, align 16, !tbaa !5
  %45 = xor i64 %44, %42
  %46 = call i64 @DesSBox(i64 noundef %45)
  %47 = call i64 @DesTransform(i64 noundef %46, ptr noundef nonnull @des_p, i32 noundef 32)
  %48 = xor i64 %47, %34
  %49 = call i64 @DesTransform(i64 noundef %48, ptr noundef nonnull @des_e, i32 noundef 48)
  %50 = getelementptr inbounds i8, ptr %3, i64 72
  %51 = load i64, ptr %50, align 8, !tbaa !5
  %52 = xor i64 %51, %49
  %53 = call i64 @DesSBox(i64 noundef %52)
  %54 = call i64 @DesTransform(i64 noundef %53, ptr noundef nonnull @des_p, i32 noundef 32)
  %55 = xor i64 %54, %41
  %56 = call i64 @DesTransform(i64 noundef %55, ptr noundef nonnull @des_e, i32 noundef 48)
  %57 = getelementptr inbounds i8, ptr %3, i64 64
  %58 = load i64, ptr %57, align 16, !tbaa !5
  %59 = xor i64 %58, %56
  %60 = call i64 @DesSBox(i64 noundef %59)
  %61 = call i64 @DesTransform(i64 noundef %60, ptr noundef nonnull @des_p, i32 noundef 32)
  %62 = xor i64 %61, %48
  %63 = call i64 @DesTransform(i64 noundef %62, ptr noundef nonnull @des_e, i32 noundef 48)
  %64 = getelementptr inbounds i8, ptr %3, i64 56
  %65 = load i64, ptr %64, align 8, !tbaa !5
  %66 = xor i64 %65, %63
  %67 = call i64 @DesSBox(i64 noundef %66)
  %68 = call i64 @DesTransform(i64 noundef %67, ptr noundef nonnull @des_p, i32 noundef 32)
  %69 = xor i64 %68, %55
  %70 = call i64 @DesTransform(i64 noundef %69, ptr noundef nonnull @des_e, i32 noundef 48)
  %71 = getelementptr inbounds i8, ptr %3, i64 48
  %72 = load i64, ptr %71, align 16, !tbaa !5
  %73 = xor i64 %72, %70
  %74 = call i64 @DesSBox(i64 noundef %73)
  %75 = call i64 @DesTransform(i64 noundef %74, ptr noundef nonnull @des_p, i32 noundef 32)
  %76 = xor i64 %75, %62
  %77 = call i64 @DesTransform(i64 noundef %76, ptr noundef nonnull @des_e, i32 noundef 48)
  %78 = getelementptr inbounds i8, ptr %3, i64 40
  %79 = load i64, ptr %78, align 8, !tbaa !5
  %80 = xor i64 %79, %77
  %81 = call i64 @DesSBox(i64 noundef %80)
  %82 = call i64 @DesTransform(i64 noundef %81, ptr noundef nonnull @des_p, i32 noundef 32)
  %83 = xor i64 %82, %69
  %84 = call i64 @DesTransform(i64 noundef %83, ptr noundef nonnull @des_e, i32 noundef 48)
  %85 = getelementptr inbounds i8, ptr %3, i64 32
  %86 = load i64, ptr %85, align 16, !tbaa !5
  %87 = xor i64 %86, %84
  %88 = call i64 @DesSBox(i64 noundef %87)
  %89 = call i64 @DesTransform(i64 noundef %88, ptr noundef nonnull @des_p, i32 noundef 32)
  %90 = xor i64 %89, %76
  %91 = call i64 @DesTransform(i64 noundef %90, ptr noundef nonnull @des_e, i32 noundef 48)
  %92 = getelementptr inbounds i8, ptr %3, i64 24
  %93 = load i64, ptr %92, align 8, !tbaa !5
  %94 = xor i64 %93, %91
  %95 = call i64 @DesSBox(i64 noundef %94)
  %96 = call i64 @DesTransform(i64 noundef %95, ptr noundef nonnull @des_p, i32 noundef 32)
  %97 = xor i64 %96, %83
  %98 = call i64 @DesTransform(i64 noundef %97, ptr noundef nonnull @des_e, i32 noundef 48)
  %99 = getelementptr inbounds i8, ptr %3, i64 16
  %100 = load i64, ptr %99, align 16, !tbaa !5
  %101 = xor i64 %100, %98
  %102 = call i64 @DesSBox(i64 noundef %101)
  %103 = call i64 @DesTransform(i64 noundef %102, ptr noundef nonnull @des_p, i32 noundef 32)
  %104 = xor i64 %103, %90
  %105 = call i64 @DesTransform(i64 noundef %104, ptr noundef nonnull @des_e, i32 noundef 48)
  %106 = getelementptr inbounds i8, ptr %3, i64 8
  %107 = load i64, ptr %106, align 8, !tbaa !5
  %108 = xor i64 %107, %105
  %109 = call i64 @DesSBox(i64 noundef %108)
  %110 = call i64 @DesTransform(i64 noundef %109, ptr noundef nonnull @des_p, i32 noundef 32)
  %111 = xor i64 %110, %97
  %112 = call i64 @DesTransform(i64 noundef %111, ptr noundef nonnull @des_e, i32 noundef 48)
  %113 = load i64, ptr %3, align 16, !tbaa !5
  %114 = xor i64 %113, %112
  %115 = call i64 @DesSBox(i64 noundef %114)
  %116 = call i64 @DesTransform(i64 noundef %115, ptr noundef nonnull @des_p, i32 noundef 32)
  %117 = xor i64 %116, %104
  %118 = lshr i64 %111, 32
  %119 = add i64 %118, %117
  %120 = call i64 @DesTransform(i64 noundef %119, ptr noundef nonnull @des_out, i32 noundef 64)
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %3) #2
  ret i64 %120
}

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


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LCSSAPass,LoopRotatePass,ReassociatePass,SROAPass,SimplifyCFGPass