; LLVM IR from chronokings/huntercoin :: src/scrypt-sse2.ll (Z27scrypt_1024_1_1_256_sp_sse2PKcPcS1_)

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

%union.anon = type { [8 x <2 x i64>] }

; Function Attrs: mustprogress uwtable
define dso_local void @_Z27scrypt_1024_1_1_256_sp_sse2PKcPcS1_(ptr noundef %0, ptr noundef %1, ptr noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca [128 x i8], align 16
  %8 = alloca %union.anon, align 16
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  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 128, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 128, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %13 = load ptr, ptr %6, align 8, !tbaa !5
  %14 = ptrtoint ptr %13 to i64
  %15 = add i64 %14, 63
  %16 = and i64 %15, -64
  %17 = inttoptr i64 %16 to ptr
  store ptr %17, ptr %9, align 8, !tbaa !5
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = getelementptr inbounds [128 x i8], ptr %7, i64 0, i64 0
  call void @_Z13PBKDF2_SHA256PKhmS0_mmPhm(ptr noundef %18, i64 noundef 80, ptr noundef %19, i64 noundef 80, i64 noundef 1, ptr noundef %20, i64 noundef 128)
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %21

21:                                               ; preds = %49, %3
  %22 = load i32, ptr %12, align 4, !tbaa !9
  %23 = icmp ult i32 %22, 2
  br i1 %23, label %24, label %52

24:                                               ; preds = %21
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %25

25:                                               ; preds = %45, %24
  %26 = load i32, ptr %10, align 4, !tbaa !9
  %27 = icmp ult i32 %26, 16
  br i1 %27, label %28, label %48

28:                                               ; preds = %25
  %29 = load i32, ptr %12, align 4, !tbaa !9
  %30 = mul i32 %29, 16
  %31 = load i32, ptr %10, align 4, !tbaa !9
  %32 = mul i32 %31, 5
  %33 = urem i32 %32, 16
  %34 = add i32 %30, %33
  %35 = mul i32 %34, 4
  %36 = zext i32 %35 to i64
  %37 = getelementptr inbounds [128 x i8], ptr %7, i64 0, i64 %36
  %38 = call noundef i32 @_ZL7le32decPKv(ptr noundef %37)
  %39 = load i32, ptr %12, align 4, !tbaa !9
  %40 = mul i32 %39, 16
  %41 = load i32, ptr %10, align 4, !tbaa !9
  %42 = add i32 %40, %41
  %43 = zext i32 %42 to i64
  %44 = getelementptr inbounds [32 x i32], ptr %8, i64 0, i64 %43
  store i32 %38, ptr %44, align 4, !tbaa !11
  br label %45

45:                                               ; preds = %28
  %46 = load i32, ptr %10, align 4, !tbaa !9
  %47 = add i32 %46, 1
  store i32 %47, ptr %10, align 4, !tbaa !9
  br label %25, !llvm.loop !12

48:                                               ; preds = %25
  br label %49

49:                                               ; preds = %48
  %50 = load i32, ptr %12, align 4, !tbaa !9
  %51 = add i32 %50, 1
  store i32 %51, ptr %12, align 4, !tbaa !9
  br label %21, !llvm.loop !14

52:                                               ; preds = %21
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %53

53:                                               ; preds = %80, %52
  %54 = load i32, ptr %10, align 4, !tbaa !9
  %55 = icmp ult i32 %54, 1024
  br i1 %55, label %56, label %83

56:                                               ; preds = %53
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %57

57:                                               ; preds = %72, %56
  %58 = load i32, ptr %12, align 4, !tbaa !9
  %59 = icmp ult i32 %58, 8
  br i1 %59, label %60, label %75

60:                                               ; preds = %57
  %61 = load i32, ptr %12, align 4, !tbaa !9
  %62 = zext i32 %61 to i64
  %63 = getelementptr inbounds [8 x <2 x i64>], ptr %8, i64 0, i64 %62
  %64 = load <2 x i64>, ptr %63, align 16, !tbaa !11
  %65 = load ptr, ptr %9, align 8, !tbaa !5
  %66 = load i32, ptr %10, align 4, !tbaa !9
  %67 = mul i32 %66, 8
  %68 = load i32, ptr %12, align 4, !tbaa !9
  %69 = add i32 %67, %68
  %70 = zext i32 %69 to i64
  %71 = getelementptr inbounds <2 x i64>, ptr %65, i64 %70
  store <2 x i64> %64, ptr %71, align 16, !tbaa !11
  br label %72

72:                                               ; preds = %60
  %73 = load i32, ptr %12, align 4, !tbaa !9
  %74 = add i32 %73, 1
  store i32 %74, ptr %12, align 4, !tbaa !9
  br label %57, !llvm.loop !15

75:                                               ; preds = %57
  %76 = getelementptr inbounds [8 x <2 x i64>], ptr %8, i64 0, i64 0
  %77 = getelementptr inbounds [8 x <2 x i64>], ptr %8, i64 0, i64 4
  call void @_ZL15xor_salsa8_sse2PDv2_xPKS_(ptr noundef %76, ptr noundef %77)
  %78 = getelementptr inbounds [8 x <2 x i64>], ptr %8, i64 0, i64 4
  %79 = getelementptr inbounds [8 x <2 x i64>], ptr %8, i64 0, i64 0
  call void @_ZL15xor_salsa8_sse2PDv2_xPKS_(ptr noundef %78, ptr noundef %79)
  br label %80

80:                                               ; preds = %75
  %81 = load i32, ptr %10, align 4, !tbaa !9
  %82 = add i32 %81, 1
  store i32 %82, ptr %10, align 4, !tbaa !9
  br label %53, !llvm.loop !16

83:                                               ; preds = %53
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %84

84:                                               ; preds = %119, %83
  %85 = load i32, ptr %10, align 4, !tbaa !9
  %86 = icmp ult i32 %85, 1024
  br i1 %86, label %87, label %122

87:                                               ; preds = %84
  %88 = getelementptr inbounds [32 x i32], ptr %8, i64 0, i64 16
  %89 = load i32, ptr %88, align 16, !tbaa !11
  %90 = and i32 %89, 1023
  %91 = mul i32 8, %90
  store i32 %91, ptr %11, align 4, !tbaa !9
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %92

92:                                               ; preds = %111, %87
  %93 = load i32, ptr %12, align 4, !tbaa !9
  %94 = icmp ult i32 %93, 8
  br i1 %94, label %95, label %114

95:                                               ; preds = %92
  %96 = load i32, ptr %12, align 4, !tbaa !9
  %97 = zext i32 %96 to i64
  %98 = getelementptr inbounds [8 x <2 x i64>], ptr %8, i64 0, i64 %97
  %99 = load <2 x i64>, ptr %98, align 16, !tbaa !11
  %100 = load ptr, ptr %9, align 8, !tbaa !5
  %101 = load i32, ptr %11, align 4, !tbaa !9
  %102 = load i32, ptr %12, align 4, !tbaa !9
  %103 = add i32 %101, %102
  %104 = zext i32 %103 to i64
  %105 = getelementptr inbounds <2 x i64>, ptr %100, i64 %104
  %106 = load <2 x i64>, ptr %105, align 16, !tbaa !11
  %107 = call noundef <2 x i64> @_ZL13_mm_xor_si128Dv2_xS_(<2 x i64> noundef %99, <2 x i64> noundef %106)
  %108 = load i32, ptr %12, align 4, !tbaa !9
  %109 = zext i32 %108 to i64
  %110 = getelementptr inbounds [8 x <2 x i64>], ptr %8, i64 0, i64 %109
  store <2 x i64> %107, ptr %110, align 16, !tbaa !11
  br label %111

111:                                              ; preds = %95
  %112 = load i32, ptr %12, align 4, !tbaa !9
  %113 = add i32 %112, 1
  store i32 %113, ptr %12, align 4, !tbaa !9
  br label %92, !llvm.loop !17

114:                                              ; preds = %92
  %115 = getelementptr inbounds [8 x <2 x i64>], ptr %8, i64 0, i64 0
  %116 = getelementptr inbounds [8 x <2 x i64>], ptr %8, i64 0, i64 4
  call void @_ZL15xor_salsa8_sse2PDv2_xPKS_(ptr noundef %115, ptr noundef %116)
  %117 = getelementptr inbounds [8 x <2 x i64>], ptr %8, i64 0, i64 4
  %118 = getelementptr inbounds [8 x <2 x i64>], ptr %8, i64 0, i64 0
  call void @_ZL15xor_salsa8_sse2PDv2_xPKS_(ptr noundef %117, ptr noundef %118)
  br label %119

119:                                              ; preds = %114
  %120 = load i32, ptr %10, align 4, !tbaa !9
  %121 = add i32 %120, 1
  store i32 %121, ptr %10, align 4, !tbaa !9
  br label %84, !llvm.loop !18

122:                                              ; preds = %84
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %123

123:                                              ; preds = %151, %122
  %124 = load i32, ptr %12, align 4, !tbaa !9
  %125 = icmp ult i32 %124, 2
  br i1 %125, label %126, label %154

126:                                              ; preds = %123
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %127

127:                                              ; preds = %147, %126
  %128 = load i32, ptr %10, align 4, !tbaa !9
  %129 = icmp ult i32 %128, 16
  br i1 %129, label %130, label %150

130:                                              ; preds = %127
  %131 = load i32, ptr %12, align 4, !tbaa !9
  %132 = mul i32 %131, 16
  %133 = load i32, ptr %10, align 4, !tbaa !9
  %134 = mul i32 %133, 5
  %135 = urem i32 %134, 16
  %136 = add i32 %132, %135
  %137 = mul i32 %136, 4
  %138 = zext i32 %137 to i64
  %139 = getelementptr inbounds [128 x i8], ptr %7, i64 0, i64 %138
  %140 = load i32, ptr %12, align 4, !tbaa !9
  %141 = mul i32 %140, 16
  %142 = load i32, ptr %10, align 4, !tbaa !9
  %143 = add i32 %141, %142
  %144 = zext i32 %143 to i64
  %145 = getelementptr inbounds [32 x i32], ptr %8, i64 0, i64 %144
  %146 = load i32, ptr %145, align 4, !tbaa !11
  call void @_ZL7le32encPvj(ptr noundef %139, i32 noundef %146)
  br label %147

147:                                              ; preds = %130
  %148 = load i32, ptr %10, align 4, !tbaa !9
  %149 = add i32 %148, 1
  store i32 %149, ptr %10, align 4, !tbaa !9
  br label %127, !llvm.loop !19

150:                                              ; preds = %127
  br label %151

151:                                              ; preds = %150
  %152 = load i32, ptr %12, align 4, !tbaa !9
  %153 = add i32 %152, 1
  store i32 %153, ptr %12, align 4, !tbaa !9
  br label %123, !llvm.loop !20

154:                                              ; preds = %123
  %155 = load ptr, ptr %4, align 8, !tbaa !5
  %156 = getelementptr inbounds [128 x i8], ptr %7, i64 0, i64 0
  %157 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_Z13PBKDF2_SHA256PKhmS0_mmPhm(ptr noundef %155, i64 noundef 80, ptr noundef %156, i64 noundef 128, i64 noundef 1, ptr noundef %157, i64 noundef 32)
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 128, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 128, ptr %7) #6
  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 @_Z13PBKDF2_SHA256PKhmS0_mmPhm(ptr noundef, i64 noundef, ptr noundef, i64 noundef, i64 noundef, ptr noundef, i64 noundef) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL7le32decPKv(ptr noundef) #3

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @_ZL15xor_salsa8_sse2PDv2_xPKS_(ptr noundef, ptr noundef) #4

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare hidden noundef <2 x i64> @_ZL13_mm_xor_si128Dv2_xS_(<2 x i64> noundef, <2 x i64> noundef) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @_ZL7le32encPvj(ptr noundef, i32 noundef) #3

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="128" "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 = { inlinehint mustprogress 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 #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="128" "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 #5 = { alwaysinline mustprogress nounwind uwtable "min-legal-vector-width"="128" "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 #6 = { 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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}
!18 = distinct !{!18, !13}
!19 = distinct !{!19, !13}
!20 = distinct !{!20, !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"

%union.anon = type { [8 x <2 x i64>] }

; Function Attrs: mustprogress uwtable
define dso_local void @_Z27scrypt_1024_1_1_256_sp_sse2PKcPcS1_(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #0 {
.preheader45:
  %3 = alloca [128 x i8], align 16
  %4 = alloca %union.anon, align 16
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %4) #6
  %5 = ptrtoint ptr %2 to i64
  %6 = add i64 %5, 63
  %7 = and i64 %6, -64
  call void @_Z13PBKDF2_SHA256PKhmS0_mmPhm(ptr noundef %0, i64 noundef 80, ptr noundef %0, i64 noundef 80, i64 noundef 1, ptr noundef nonnull %3, i64 noundef 128)
  %8 = call noundef i32 @_ZL7le32decPKv(ptr noundef nonnull %3)
  store i32 %8, ptr %4, align 16, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %3, i64 20
  %10 = call noundef i32 @_ZL7le32decPKv(ptr noundef nonnull %9)
  %11 = getelementptr inbounds i8, ptr %4, i64 4
  store i32 %10, ptr %11, align 4, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %3, i64 40
  %13 = call noundef i32 @_ZL7le32decPKv(ptr noundef nonnull %12)
  %14 = getelementptr inbounds i8, ptr %4, i64 8
  store i32 %13, ptr %14, align 8, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %3, i64 60
  %16 = call noundef i32 @_ZL7le32decPKv(ptr noundef nonnull %15)
  %17 = getelementptr inbounds i8, ptr %4, i64 12
  store i32 %16, ptr %17, align 4, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %3, i64 16
  %19 = call noundef i32 @_ZL7le32decPKv(ptr noundef nonnull %18)
  %20 = getelementptr inbounds i8, ptr %4, i64 16
  store i32 %19, ptr %20, align 16, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %3, i64 36
  %22 = call noundef i32 @_ZL7le32decPKv(ptr noundef nonnull %21)
  %23 = getelementptr inbounds i8, ptr %4, i64 20
  store i32 %22, ptr %23, align 4, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %3, i64 56
  %25 = call noundef i32 @_ZL7le32decPKv(ptr noundef nonnull %24)
  %26 = getelementptr inbounds i8, ptr %4, i64 24
  store i32 %25, ptr %26, align 8, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %3, i64 12
  %28 = call noundef i32 @_ZL7le32decPKv(ptr noundef nonnull %27)
  %29 = getelementptr inbounds i8, ptr %4, i64 28
  store i32 %28, ptr %29, align 4, !tbaa !5
  %30 = getelementptr inbounds i8, ptr %3, i64 32
  %31 = call noundef i32 @_ZL7le32decPKv(ptr noundef nonnull %30)
  %32 = getelementptr inbounds i8, ptr %4, i64 32
  store i32 %31, ptr %32, align 16, !tbaa !5
  %33 = getelementptr inbounds i8, ptr %3, i64 52
  %34 = call noundef i32 @_ZL7le32decPKv(ptr noundef nonnull %33)
  %35 = getelementptr inbounds i8, ptr %4, i64 36
  store i32 %34, ptr %35, align 4, !tbaa !5
  %36 = getelementptr inbounds i8, ptr %3, i64 8
  %37 = call noundef i32 @_ZL7le32decPKv(ptr noundef nonnull %36)
  %38 = getelementptr inbounds i8, ptr %4, i64 40
  store i32 %37, ptr %38, align 8, !tbaa !5
  %39 = getelementptr inbounds i8, ptr %3, i64 28
  %40 = call noundef i32 @_ZL7le32decPKv(ptr noundef nonnull %39)
  %41 = getelementptr inbounds i8, ptr %4, i64 44
  store i32 %40, ptr %41, align 4, !tbaa !5
  %42 = getelementptr inbounds i8, ptr %3, i64 48
  %43 = call noundef i32 @_ZL7le32decPKv(ptr noundef nonnull %42)
  %44 = getelementptr inbounds i8, ptr %4, i64 48
  store i32 %43, ptr %44, align 16, !tbaa !5
  %45 = getelementptr inbounds i8, ptr %3, i64 4
  %46 = call noundef i32 @_ZL7le32decPKv(ptr noundef nonnull %45)
  %47 = getelementptr inbounds i8, ptr %4, i64 52
  store i32 %46, ptr %47, align 4, !tbaa !5
  %48 = getelementptr inbounds i8, ptr %3, i64 24
  %49 = call noundef i32 @_ZL7le32decPKv(ptr noundef nonnull %48)
  %50 = getelementptr inbounds i8, ptr %4, i64 56
  store i32 %49, ptr %50, align 8, !tbaa !5
  %51 = getelementptr inbounds i8, ptr %3, i64 44
  %52 = call noundef i32 @_ZL7le32decPKv(ptr noundef nonnull %51)
  %53 = getelementptr inbounds i8, ptr %4, i64 60
  store i32 %52, ptr %53, align 4, !tbaa !5
  %54 = getelementptr inbounds i8, ptr %3, i64 64
  %55 = call noundef i32 @_ZL7le32decPKv(ptr noundef nonnull %54)
  %56 = getelementptr inbounds i8, ptr %4, i64 64
  store i32 %55, ptr %56, align 16, !tbaa !5
  %57 = getelementptr inbounds i8, ptr %3, i64 84
  %58 = call noundef i32 @_ZL7le32decPKv(ptr noundef nonnull %57)
  %59 = getelementptr inbounds i8, ptr %4, i64 68
  store i32 %58, ptr %59, align 4, !tbaa !5
  %60 = getelementptr inbounds i8, ptr %3, i64 104
  %61 = call noundef i32 @_ZL7le32decPKv(ptr noundef nonnull %60)
  %62 = getelementptr inbounds i8, ptr %4, i64 72
  store i32 %61, ptr %62, align 8, !tbaa !5
  %63 = getelementptr inbounds i8, ptr %3, i64 124
  %64 = call noundef i32 @_ZL7le32decPKv(ptr noundef nonnull %63)
  %65 = getelementptr inbounds i8, ptr %4, i64 76
  store i32 %64, ptr %65, align 4, !tbaa !5
  %66 = getelementptr inbounds i8, ptr %3, i64 80
  %67 = call noundef i32 @_ZL7le32decPKv(ptr noundef nonnull %66)
  %68 = getelementptr inbounds i8, ptr %4, i64 80
  store i32 %67, ptr %68, align 16, !tbaa !5
  %69 = getelementptr inbounds i8, ptr %3, i64 100
  %70 = call noundef i32 @_ZL7le32decPKv(ptr noundef nonnull %69)
  %71 = getelementptr inbounds i8, ptr %4, i64 84
  store i32 %70, ptr %71, align 4, !tbaa !5
  %72 = getelementptr inbounds i8, ptr %3, i64 120
  %73 = call noundef i32 @_ZL7le32decPKv(ptr noundef nonnull %72)
  %74 = getelementptr inbounds i8, ptr %4, i64 88
  store i32 %73, ptr %74, align 8, !tbaa !5
  %75 = getelementptr inbounds i8, ptr %3, i64 76
  %76 = call noundef i32 @_ZL7le32decPKv(ptr noundef nonnull %75)
  %77 = getelementptr inbounds i8, ptr %4, i64 92
  store i32 %76, ptr %77, align 4, !tbaa !5
  %78 = getelementptr inbounds i8, ptr %3, i64 96
  %79 = call noundef i32 @_ZL7le32decPKv(ptr noundef nonnull %78)
  %80 = getelementptr inbounds i8, ptr %4, i64 96
  store i32 %79, ptr %80, align 16, !tbaa !5
  %81 = getelementptr inbounds i8, ptr %3, i64 116
  %82 = call noundef i32 @_ZL7le32decPKv(ptr noundef nonnull %81)
  %83 = getelementptr inbounds i8, ptr %4, i64 100
  store i32 %82, ptr %83, align 4, !tbaa !5
  %84 = getelementptr inbounds i8, ptr %3, i64 72
  %85 = call noundef i32 @_ZL7le32decPKv(ptr noundef nonnull %84)
  %86 = getelementptr inbounds i8, ptr %4, i64 104
  store i32 %85, ptr %86, align 8, !tbaa !5
  %87 = getelementptr inbounds i8, ptr %3, i64 92
  %88 = call noundef i32 @_ZL7le32decPKv(ptr noundef nonnull %87)
  %89 = getelementptr inbounds i8, ptr %4, i64 108
  store i32 %88, ptr %89, align 4, !tbaa !5
  %90 = getelementptr inbounds i8, ptr %3, i64 112
  %91 = call noundef i32 @_ZL7le32decPKv(ptr noundef nonnull %90)
  %92 = getelementptr inbounds i8, ptr %4, i64 112
  store i32 %91, ptr %92, align 16, !tbaa !5
  %93 = getelementptr inbounds i8, ptr %3, i64 68
  %94 = call noundef i32 @_ZL7le32decPKv(ptr noundef nonnull %93)
  %95 = getelementptr inbounds i8, ptr %4, i64 116
  store i32 %94, ptr %95, align 4, !tbaa !5
  %96 = getelementptr inbounds i8, ptr %3, i64 88
  %97 = call noundef i32 @_ZL7le32decPKv(ptr noundef nonnull %96)
  %98 = getelementptr inbounds i8, ptr %4, i64 120
  store i32 %97, ptr %98, align 8, !tbaa !5
  %99 = getelementptr inbounds i8, ptr %3, i64 108
  %100 = call noundef i32 @_ZL7le32decPKv(ptr noundef nonnull %99)
  %101 = getelementptr inbounds i8, ptr %4, i64 124
  store i32 %100, ptr %101, align 4, !tbaa !5
  %102 = inttoptr i64 %7 to ptr
  br label %.preheader43

.preheader43:                                     ; preds = %.preheader45, %.preheader43
  %indvars.iv = phi i64 [ 0, %.preheader45 ], [ %indvars.iv.next, %.preheader43 ]
  %103 = shl nuw nsw i64 %indvars.iv, 3
  %104 = load <2 x i64>, ptr %4, align 16, !tbaa !5
  %105 = getelementptr inbounds <2 x i64>, ptr %102, i64 %103
  store <2 x i64> %104, ptr %105, align 64, !tbaa !5
  %106 = load <2 x i64>, ptr %20, align 16, !tbaa !5
  %107 = or disjoint i64 %103, 1
  %108 = getelementptr inbounds <2 x i64>, ptr %102, i64 %107
  store <2 x i64> %106, ptr %108, align 16, !tbaa !5
  %109 = load <2 x i64>, ptr %32, align 16, !tbaa !5
  %110 = or disjoint i64 %103, 2
  %111 = getelementptr inbounds <2 x i64>, ptr %102, i64 %110
  store <2 x i64> %109, ptr %111, align 32, !tbaa !5
  %112 = load <2 x i64>, ptr %44, align 16, !tbaa !5
  %113 = or disjoint i64 %103, 3
  %114 = getelementptr inbounds <2 x i64>, ptr %102, i64 %113
  store <2 x i64> %112, ptr %114, align 16, !tbaa !5
  %115 = load <2 x i64>, ptr %56, align 16, !tbaa !5
  %116 = or disjoint i64 %103, 4
  %117 = getelementptr inbounds <2 x i64>, ptr %102, i64 %116
  store <2 x i64> %115, ptr %117, align 64, !tbaa !5
  %118 = load <2 x i64>, ptr %68, align 16, !tbaa !5
  %119 = or disjoint i64 %103, 5
  %120 = getelementptr inbounds <2 x i64>, ptr %102, i64 %119
  store <2 x i64> %118, ptr %120, align 16, !tbaa !5
  %121 = load <2 x i64>, ptr %80, align 16, !tbaa !5
  %122 = or disjoint i64 %103, 6
  %123 = getelementptr inbounds <2 x i64>, ptr %102, i64 %122
  store <2 x i64> %121, ptr %123, align 32, !tbaa !5
  %124 = load <2 x i64>, ptr %92, align 16, !tbaa !5
  %125 = or disjoint i64 %103, 7
  %126 = getelementptr inbounds <2 x i64>, ptr %102, i64 %125
  store <2 x i64> %124, ptr %126, align 16, !tbaa !5
  call void @_ZL15xor_salsa8_sse2PDv2_xPKS_(ptr noundef nonnull %4, ptr noundef nonnull %56)
  call void @_ZL15xor_salsa8_sse2PDv2_xPKS_(ptr noundef nonnull %56, ptr noundef nonnull %4)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 1024
  br i1 %exitcond.not, label %.preheader42, label %.preheader43, !llvm.loop !8

.preheader42:                                     ; preds = %.preheader43, %.preheader42
  %.23951 = phi i32 [ %170, %.preheader42 ], [ 0, %.preheader43 ]
  %127 = load i32, ptr %56, align 16, !tbaa !5
  %128 = shl i32 %127, 3
  %129 = and i32 %128, 8184
  %130 = zext nneg i32 %129 to i64
  %131 = load <2 x i64>, ptr %4, align 16, !tbaa !5
  %132 = getelementptr inbounds <2 x i64>, ptr %102, i64 %130
  %133 = load <2 x i64>, ptr %132, align 64, !tbaa !5
  %134 = call noundef <2 x i64> @_ZL13_mm_xor_si128Dv2_xS_(<2 x i64> noundef %131, <2 x i64> noundef %133)
  store <2 x i64> %134, ptr %4, align 16, !tbaa !5
  %135 = load <2 x i64>, ptr %20, align 16, !tbaa !5
  %136 = or disjoint i64 %130, 1
  %137 = getelementptr inbounds <2 x i64>, ptr %102, i64 %136
  %138 = load <2 x i64>, ptr %137, align 16, !tbaa !5
  %139 = call noundef <2 x i64> @_ZL13_mm_xor_si128Dv2_xS_(<2 x i64> noundef %135, <2 x i64> noundef %138)
  store <2 x i64> %139, ptr %20, align 16, !tbaa !5
  %140 = load <2 x i64>, ptr %32, align 16, !tbaa !5
  %141 = or disjoint i64 %130, 2
  %142 = getelementptr inbounds <2 x i64>, ptr %102, i64 %141
  %143 = load <2 x i64>, ptr %142, align 32, !tbaa !5
  %144 = call noundef <2 x i64> @_ZL13_mm_xor_si128Dv2_xS_(<2 x i64> noundef %140, <2 x i64> noundef %143)
  store <2 x i64> %144, ptr %32, align 16, !tbaa !5
  %145 = load <2 x i64>, ptr %44, align 16, !tbaa !5
  %146 = or disjoint i64 %130, 3
  %147 = getelementptr inbounds <2 x i64>, ptr %102, i64 %146
  %148 = load <2 x i64>, ptr %147, align 16, !tbaa !5
  %149 = call noundef <2 x i64> @_ZL13_mm_xor_si128Dv2_xS_(<2 x i64> noundef %145, <2 x i64> noundef %148)
  store <2 x i64> %149, ptr %44, align 16, !tbaa !5
  %150 = load <2 x i64>, ptr %56, align 16, !tbaa !5
  %151 = or disjoint i64 %130, 4
  %152 = getelementptr inbounds <2 x i64>, ptr %102, i64 %151
  %153 = load <2 x i64>, ptr %152, align 64, !tbaa !5
  %154 = call noundef <2 x i64> @_ZL13_mm_xor_si128Dv2_xS_(<2 x i64> noundef %150, <2 x i64> noundef %153)
  store <2 x i64> %154, ptr %56, align 16, !tbaa !5
  %155 = load <2 x i64>, ptr %68, align 16, !tbaa !5
  %156 = or disjoint i64 %130, 5
  %157 = getelementptr inbounds <2 x i64>, ptr %102, i64 %156
  %158 = load <2 x i64>, ptr %157, align 16, !tbaa !5
  %159 = call noundef <2 x i64> @_ZL13_mm_xor_si128Dv2_xS_(<2 x i64> noundef %155, <2 x i64> noundef %158)
  store <2 x i64> %159, ptr %68, align 16, !tbaa !5
  %160 = load <2 x i64>, ptr %80, align 16, !tbaa !5
  %161 = or disjoint i64 %130, 6
  %162 = getelementptr inbounds <2 x i64>, ptr %102, i64 %161
  %163 = load <2 x i64>, ptr %162, align 32, !tbaa !5
  %164 = call noundef <2 x i64> @_ZL13_mm_xor_si128Dv2_xS_(<2 x i64> noundef %160, <2 x i64> noundef %163)
  store <2 x i64> %164, ptr %80, align 16, !tbaa !5
  %165 = load <2 x i64>, ptr %92, align 16, !tbaa !5
  %166 = or disjoint i64 %130, 7
  %167 = getelementptr inbounds <2 x i64>, ptr %102, i64 %166
  %168 = load <2 x i64>, ptr %167, align 16, !tbaa !5
  %169 = call noundef <2 x i64> @_ZL13_mm_xor_si128Dv2_xS_(<2 x i64> noundef %165, <2 x i64> noundef %168)
  store <2 x i64> %169, ptr %92, align 16, !tbaa !5
  call void @_ZL15xor_salsa8_sse2PDv2_xPKS_(ptr noundef nonnull %4, ptr noundef nonnull %56)
  call void @_ZL15xor_salsa8_sse2PDv2_xPKS_(ptr noundef nonnull %56, ptr noundef nonnull %4)
  %170 = add nuw nsw i32 %.23951, 1
  %exitcond62.not = icmp eq i32 %170, 1024
  br i1 %exitcond62.not, label %.preheader.preheader, label %.preheader42, !llvm.loop !10

.preheader.preheader:                             ; preds = %.preheader42
  %171 = load i32, ptr %4, align 16, !tbaa !5
  call void @_ZL7le32encPvj(ptr noundef nonnull %3, i32 noundef %171)
  %172 = load i32, ptr %11, align 4, !tbaa !5
  call void @_ZL7le32encPvj(ptr noundef nonnull %9, i32 noundef %172)
  %173 = load i32, ptr %14, align 8, !tbaa !5
  call void @_ZL7le32encPvj(ptr noundef nonnull %12, i32 noundef %173)
  %174 = load i32, ptr %17, align 4, !tbaa !5
  call void @_ZL7le32encPvj(ptr noundef nonnull %15, i32 noundef %174)
  %175 = load i32, ptr %20, align 16, !tbaa !5
  call void @_ZL7le32encPvj(ptr noundef nonnull %18, i32 noundef %175)
  %176 = load i32, ptr %23, align 4, !tbaa !5
  call void @_ZL7le32encPvj(ptr noundef nonnull %21, i32 noundef %176)
  %177 = load i32, ptr %26, align 8, !tbaa !5
  call void @_ZL7le32encPvj(ptr noundef nonnull %24, i32 noundef %177)
  %178 = load i32, ptr %29, align 4, !tbaa !5
  call void @_ZL7le32encPvj(ptr noundef nonnull %27, i32 noundef %178)
  %179 = load i32, ptr %32, align 16, !tbaa !5
  call void @_ZL7le32encPvj(ptr noundef nonnull %30, i32 noundef %179)
  %180 = load i32, ptr %35, align 4, !tbaa !5
  call void @_ZL7le32encPvj(ptr noundef nonnull %33, i32 noundef %180)
  %181 = load i32, ptr %38, align 8, !tbaa !5
  call void @_ZL7le32encPvj(ptr noundef nonnull %36, i32 noundef %181)
  %182 = load i32, ptr %41, align 4, !tbaa !5
  call void @_ZL7le32encPvj(ptr noundef nonnull %39, i32 noundef %182)
  %183 = load i32, ptr %44, align 16, !tbaa !5
  call void @_ZL7le32encPvj(ptr noundef nonnull %42, i32 noundef %183)
  %184 = load i32, ptr %47, align 4, !tbaa !5
  call void @_ZL7le32encPvj(ptr noundef nonnull %45, i32 noundef %184)
  %185 = load i32, ptr %50, align 8, !tbaa !5
  call void @_ZL7le32encPvj(ptr noundef nonnull %48, i32 noundef %185)
  %186 = load i32, ptr %53, align 4, !tbaa !5
  call void @_ZL7le32encPvj(ptr noundef nonnull %51, i32 noundef %186)
  %187 = load i32, ptr %56, align 16, !tbaa !5
  call void @_ZL7le32encPvj(ptr noundef nonnull %54, i32 noundef %187)
  %188 = load i32, ptr %59, align 4, !tbaa !5
  call void @_ZL7le32encPvj(ptr noundef nonnull %57, i32 noundef %188)
  %189 = load i32, ptr %62, align 8, !tbaa !5
  call void @_ZL7le32encPvj(ptr noundef nonnull %60, i32 noundef %189)
  %190 = load i32, ptr %65, align 4, !tbaa !5
  call void @_ZL7le32encPvj(ptr noundef nonnull %63, i32 noundef %190)
  %191 = load i32, ptr %68, align 16, !tbaa !5
  call void @_ZL7le32encPvj(ptr noundef nonnull %66, i32 noundef %191)
  %192 = load i32, ptr %71, align 4, !tbaa !5
  call void @_ZL7le32encPvj(ptr noundef nonnull %69, i32 noundef %192)
  %193 = load i32, ptr %74, align 8, !tbaa !5
  call void @_ZL7le32encPvj(ptr noundef nonnull %72, i32 noundef %193)
  %194 = load i32, ptr %77, align 4, !tbaa !5
  call void @_ZL7le32encPvj(ptr noundef nonnull %75, i32 noundef %194)
  %195 = load i32, ptr %80, align 16, !tbaa !5
  call void @_ZL7le32encPvj(ptr noundef nonnull %78, i32 noundef %195)
  %196 = load i32, ptr %83, align 4, !tbaa !5
  call void @_ZL7le32encPvj(ptr noundef nonnull %81, i32 noundef %196)
  %197 = load i32, ptr %86, align 8, !tbaa !5
  call void @_ZL7le32encPvj(ptr noundef nonnull %84, i32 noundef %197)
  %198 = load i32, ptr %89, align 4, !tbaa !5
  call void @_ZL7le32encPvj(ptr noundef nonnull %87, i32 noundef %198)
  %199 = load i32, ptr %92, align 16, !tbaa !5
  call void @_ZL7le32encPvj(ptr noundef nonnull %90, i32 noundef %199)
  %200 = load i32, ptr %95, align 4, !tbaa !5
  call void @_ZL7le32encPvj(ptr noundef nonnull %93, i32 noundef %200)
  %201 = load i32, ptr %98, align 8, !tbaa !5
  call void @_ZL7le32encPvj(ptr noundef nonnull %96, i32 noundef %201)
  %202 = load i32, ptr %101, align 4, !tbaa !5
  call void @_ZL7le32encPvj(ptr noundef nonnull %99, i32 noundef %202)
  call void @_Z13PBKDF2_SHA256PKhmS0_mmPhm(ptr noundef %0, i64 noundef 80, ptr noundef nonnull %3, i64 noundef 128, i64 noundef 1, ptr noundef %1, i64 noundef 32)
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %3) #6
  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 @_Z13PBKDF2_SHA256PKhmS0_mmPhm(ptr noundef, i64 noundef, ptr noundef, i64 noundef, i64 noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL7le32decPKv(ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @_ZL15xor_salsa8_sse2PDv2_xPKS_(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare hidden noundef <2 x i64> @_ZL13_mm_xor_si128Dv2_xS_(<2 x i64> noundef, <2 x i64> noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @_ZL7le32encPvj(ptr noundef, i32 noundef) local_unnamed_addr #3

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="128" "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 = { inlinehint mustprogress 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 #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="128" "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 #5 = { alwaysinline mustprogress nounwind uwtable "min-legal-vector-width"="128" "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 #6 = { 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++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass