; 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 @DesEncrypt(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
  %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 = %41, %2
  %21 = load i32, ptr %10, align 4, !tbaa !9
  %22 = icmp slt i32 %21, 16
  br i1 %22, label %23, label %44

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 = sext i32 %28 to i64
  %30 = getelementptr inbounds [16 x i64], ptr %5, i64 0, i64 %29
  %31 = load i64, ptr %30, align 8, !tbaa !5
  %32 = xor i64 %27, %31
  store i64 %32, ptr %8, align 8, !tbaa !5
  %33 = load i64, ptr %8, align 8, !tbaa !5
  %34 = call i64 @DesSBox(i64 noundef %33)
  store i64 %34, ptr %8, align 8, !tbaa !5
  %35 = load i64, ptr %8, align 8, !tbaa !5
  %36 = call i64 @DesTransform(i64 noundef %35, ptr noundef @des_p, i32 noundef 32)
  store i64 %36, ptr %8, align 8, !tbaa !5
  %37 = load i64, ptr %8, align 8, !tbaa !5
  %38 = load i64, ptr %7, align 8, !tbaa !5
  %39 = xor i64 %37, %38
  store i64 %39, ptr %8, align 8, !tbaa !5
  %40 = load i64, ptr %9, align 8, !tbaa !5
  store i64 %40, ptr %7, align 8, !tbaa !5
  br label %41

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

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

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 @DesEncrypt(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 = load i64, ptr %3, align 16, !tbaa !5
  %9 = xor i64 %8, %7
  %10 = call i64 @DesSBox(i64 noundef %9)
  %11 = call i64 @DesTransform(i64 noundef %10, ptr noundef nonnull @des_p, i32 noundef 32)
  %12 = xor i64 %11, %5
  %13 = call i64 @DesTransform(i64 noundef %12, ptr noundef nonnull @des_e, i32 noundef 48)
  %14 = getelementptr inbounds i8, ptr %3, i64 8
  %15 = load i64, ptr %14, align 8, !tbaa !5
  %16 = xor i64 %15, %13
  %17 = call i64 @DesSBox(i64 noundef %16)
  %18 = call i64 @DesTransform(i64 noundef %17, ptr noundef nonnull @des_p, i32 noundef 32)
  %19 = xor i64 %18, %6
  %20 = call i64 @DesTransform(i64 noundef %19, ptr noundef nonnull @des_e, i32 noundef 48)
  %21 = getelementptr inbounds i8, ptr %3, i64 16
  %22 = load i64, ptr %21, align 16, !tbaa !5
  %23 = xor i64 %22, %20
  %24 = call i64 @DesSBox(i64 noundef %23)
  %25 = call i64 @DesTransform(i64 noundef %24, ptr noundef nonnull @des_p, i32 noundef 32)
  %26 = xor i64 %25, %12
  %27 = call i64 @DesTransform(i64 noundef %26, ptr noundef nonnull @des_e, i32 noundef 48)
  %28 = getelementptr inbounds i8, ptr %3, i64 24
  %29 = load i64, ptr %28, align 8, !tbaa !5
  %30 = xor i64 %29, %27
  %31 = call i64 @DesSBox(i64 noundef %30)
  %32 = call i64 @DesTransform(i64 noundef %31, ptr noundef nonnull @des_p, i32 noundef 32)
  %33 = xor i64 %32, %19
  %34 = call i64 @DesTransform(i64 noundef %33, ptr noundef nonnull @des_e, i32 noundef 48)
  %35 = getelementptr inbounds i8, ptr %3, i64 32
  %36 = load i64, ptr %35, align 16, !tbaa !5
  %37 = xor i64 %36, %34
  %38 = call i64 @DesSBox(i64 noundef %37)
  %39 = call i64 @DesTransform(i64 noundef %38, ptr noundef nonnull @des_p, i32 noundef 32)
  %40 = xor i64 %39, %26
  %41 = call i64 @DesTransform(i64 noundef %40, ptr noundef nonnull @des_e, i32 noundef 48)
  %42 = getelementptr inbounds i8, ptr %3, i64 40
  %43 = load i64, ptr %42, align 8, !tbaa !5
  %44 = xor i64 %43, %41
  %45 = call i64 @DesSBox(i64 noundef %44)
  %46 = call i64 @DesTransform(i64 noundef %45, ptr noundef nonnull @des_p, i32 noundef 32)
  %47 = xor i64 %46, %33
  %48 = call i64 @DesTransform(i64 noundef %47, ptr noundef nonnull @des_e, i32 noundef 48)
  %49 = getelementptr inbounds i8, ptr %3, i64 48
  %50 = load i64, ptr %49, align 16, !tbaa !5
  %51 = xor i64 %50, %48
  %52 = call i64 @DesSBox(i64 noundef %51)
  %53 = call i64 @DesTransform(i64 noundef %52, ptr noundef nonnull @des_p, i32 noundef 32)
  %54 = xor i64 %53, %40
  %55 = call i64 @DesTransform(i64 noundef %54, ptr noundef nonnull @des_e, i32 noundef 48)
  %56 = getelementptr inbounds i8, ptr %3, i64 56
  %57 = load i64, ptr %56, align 8, !tbaa !5
  %58 = xor i64 %57, %55
  %59 = call i64 @DesSBox(i64 noundef %58)
  %60 = call i64 @DesTransform(i64 noundef %59, ptr noundef nonnull @des_p, i32 noundef 32)
  %61 = xor i64 %60, %47
  %62 = call i64 @DesTransform(i64 noundef %61, ptr noundef nonnull @des_e, i32 noundef 48)
  %63 = getelementptr inbounds i8, ptr %3, i64 64
  %64 = load i64, ptr %63, align 16, !tbaa !5
  %65 = xor i64 %64, %62
  %66 = call i64 @DesSBox(i64 noundef %65)
  %67 = call i64 @DesTransform(i64 noundef %66, ptr noundef nonnull @des_p, i32 noundef 32)
  %68 = xor i64 %67, %54
  %69 = call i64 @DesTransform(i64 noundef %68, ptr noundef nonnull @des_e, i32 noundef 48)
  %70 = getelementptr inbounds i8, ptr %3, i64 72
  %71 = load i64, ptr %70, align 8, !tbaa !5
  %72 = xor i64 %71, %69
  %73 = call i64 @DesSBox(i64 noundef %72)
  %74 = call i64 @DesTransform(i64 noundef %73, ptr noundef nonnull @des_p, i32 noundef 32)
  %75 = xor i64 %74, %61
  %76 = call i64 @DesTransform(i64 noundef %75, ptr noundef nonnull @des_e, i32 noundef 48)
  %77 = getelementptr inbounds i8, ptr %3, i64 80
  %78 = load i64, ptr %77, align 16, !tbaa !5
  %79 = xor i64 %78, %76
  %80 = call i64 @DesSBox(i64 noundef %79)
  %81 = call i64 @DesTransform(i64 noundef %80, ptr noundef nonnull @des_p, i32 noundef 32)
  %82 = xor i64 %81, %68
  %83 = call i64 @DesTransform(i64 noundef %82, ptr noundef nonnull @des_e, i32 noundef 48)
  %84 = getelementptr inbounds i8, ptr %3, i64 88
  %85 = load i64, ptr %84, align 8, !tbaa !5
  %86 = xor i64 %85, %83
  %87 = call i64 @DesSBox(i64 noundef %86)
  %88 = call i64 @DesTransform(i64 noundef %87, ptr noundef nonnull @des_p, i32 noundef 32)
  %89 = xor i64 %88, %75
  %90 = call i64 @DesTransform(i64 noundef %89, ptr noundef nonnull @des_e, i32 noundef 48)
  %91 = getelementptr inbounds i8, ptr %3, i64 96
  %92 = load i64, ptr %91, align 16, !tbaa !5
  %93 = xor i64 %92, %90
  %94 = call i64 @DesSBox(i64 noundef %93)
  %95 = call i64 @DesTransform(i64 noundef %94, ptr noundef nonnull @des_p, i32 noundef 32)
  %96 = xor i64 %95, %82
  %97 = call i64 @DesTransform(i64 noundef %96, ptr noundef nonnull @des_e, i32 noundef 48)
  %98 = getelementptr inbounds i8, ptr %3, i64 104
  %99 = load i64, ptr %98, align 8, !tbaa !5
  %100 = xor i64 %99, %97
  %101 = call i64 @DesSBox(i64 noundef %100)
  %102 = call i64 @DesTransform(i64 noundef %101, ptr noundef nonnull @des_p, i32 noundef 32)
  %103 = xor i64 %102, %89
  %104 = call i64 @DesTransform(i64 noundef %103, ptr noundef nonnull @des_e, i32 noundef 48)
  %105 = getelementptr inbounds i8, ptr %3, i64 112
  %106 = load i64, ptr %105, align 16, !tbaa !5
  %107 = xor i64 %106, %104
  %108 = call i64 @DesSBox(i64 noundef %107)
  %109 = call i64 @DesTransform(i64 noundef %108, ptr noundef nonnull @des_p, i32 noundef 32)
  %110 = xor i64 %109, %96
  %111 = call i64 @DesTransform(i64 noundef %110, ptr noundef nonnull @des_e, i32 noundef 48)
  %112 = getelementptr inbounds i8, ptr %3, i64 120
  %113 = load i64, ptr %112, align 8, !tbaa !5
  %114 = xor i64 %113, %111
  %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, %103
  %118 = lshr i64 %110, 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,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LCSSAPass,LoopRotatePass,ReassociatePass,SROAPass,SimplifyCFGPass