; LLVM IR from openssl/openssl :: crypto/des (ecb_enc)

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

declare void @DES_encrypt1(ptr noundef, ptr noundef, i32 noundef) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 #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 = !{!"any pointer", !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 = !{!7, !7, i64 0}


; 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: nounwind uwtable
define dso_local void @DES_ecb_encrypt(ptr nocapture noundef readonly %0, ptr nocapture noundef writeonly %1, ptr noundef %2, i32 noundef %3) local_unnamed_addr #0 {
  %5 = alloca [2 x i32], align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  %6 = getelementptr inbounds i8, ptr %5, i64 4
  %7 = load <2 x i32>, ptr %0, align 1
  store <2 x i32> %7, ptr %5, align 8, !tbaa !5
  call void @DES_encrypt1(ptr noundef nonnull %5, ptr noundef %2, i32 noundef %3) #3
  %8 = load i32, ptr %5, align 8, !tbaa !5
  %9 = trunc i32 %8 to i8
  %10 = getelementptr inbounds i8, ptr %1, i64 1
  store i8 %9, ptr %1, align 1, !tbaa !9
  %11 = lshr i32 %8, 8
  %12 = trunc i32 %11 to i8
  %13 = getelementptr inbounds i8, ptr %1, i64 2
  store i8 %12, ptr %10, align 1, !tbaa !9
  %14 = lshr i32 %8, 16
  %15 = trunc i32 %14 to i8
  %16 = getelementptr inbounds i8, ptr %1, i64 3
  store i8 %15, ptr %13, align 1, !tbaa !9
  %17 = lshr i32 %8, 24
  %18 = trunc nuw i32 %17 to i8
  %19 = getelementptr inbounds i8, ptr %1, i64 4
  store i8 %18, ptr %16, align 1, !tbaa !9
  %20 = load i32, ptr %6, align 4, !tbaa !5
  %21 = trunc i32 %20 to i8
  %22 = getelementptr inbounds i8, ptr %1, i64 5
  store i8 %21, ptr %19, align 1, !tbaa !9
  %23 = lshr i32 %20, 8
  %24 = trunc i32 %23 to i8
  %25 = getelementptr inbounds i8, ptr %1, i64 6
  store i8 %24, ptr %22, align 1, !tbaa !9
  %26 = lshr i32 %20, 16
  %27 = trunc i32 %26 to i8
  %28 = getelementptr inbounds i8, ptr %1, i64 7
  store i8 %27, ptr %25, align 1, !tbaa !9
  %29 = lshr i32 %20, 24
  %30 = trunc nuw i32 %29 to i8
  store i8 %30, ptr %28, align 1, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  ret void
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

declare void @DES_encrypt1(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

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


; Effective O3 passes: AggressiveInstCombinePass,DSEPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass