; LLVM IR from rweather/lightweight-crypto :: src/combined (drygascon)

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

%struct.drysponge128_state_t = type { %union.gascon128_state_t, i32, i32, %union.drysponge128_rate_t, %union.drysponge128_x_t }
%union.gascon128_state_t = type { [5 x i64] }
%union.drysponge128_rate_t = type { [2 x i64] }
%union.drysponge128_x_t = type { [2 x i64] }

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

declare i32 @drysponge128_safe_alignement(ptr noundef) #1

declare void @drysponge128_setup(ptr noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare hidden void @drygascon128_process_ad(ptr noundef, ptr noundef, i64 noundef, i32 noundef) #2

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

declare void @drygascon128_f_wrap(ptr noundef, ptr noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @drygascon128_aead_decrypt_core(ptr noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, i64 noundef %4, ptr noundef %5, i64 noundef %6, ptr noundef %7, ptr noundef %8) #2 {
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i64, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i64, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca %struct.drysponge128_state_t, align 16
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca ptr, align 8
  %27 = alloca i32, align 4
  %28 = alloca ptr, align 8
  %29 = alloca ptr, align 8
  %30 = alloca ptr, align 8
  %31 = alloca i32, align 4
  store ptr %0, ptr %11, align 8, !tbaa !5
  store ptr %1, ptr %12, align 8, !tbaa !5
  store i32 %2, ptr %13, align 4, !tbaa !9
  store ptr %3, ptr %14, align 8, !tbaa !5
  store i64 %4, ptr %15, align 8, !tbaa !11
  store ptr %5, ptr %16, align 8, !tbaa !5
  store i64 %6, ptr %17, align 8, !tbaa !11
  store ptr %7, ptr %18, align 8, !tbaa !5
  store ptr %8, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 80, ptr %20) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  %32 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %32, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #3
  %33 = call i32 @drysponge128_safe_alignement(ptr noundef %20)
  %34 = icmp ne i32 %33, 0
  br i1 %34, label %36, label %35

35:                                               ; preds = %9
  store i32 -1, ptr %10, align 4
  store i32 1, ptr %23, align 4
  br label %158

36:                                               ; preds = %9
  %37 = load i64, ptr %15, align 8, !tbaa !11
  %38 = icmp ult i64 %37, 16
  br i1 %38, label %39, label %40

39:                                               ; preds = %36
  store i32 -1, ptr %10, align 4
  store i32 1, ptr %23, align 4
  br label %158

40:                                               ; preds = %36
  %41 = load i64, ptr %15, align 8, !tbaa !11
  %42 = sub i64 %41, 16
  %43 = load ptr, ptr %12, align 8, !tbaa !5
  store i64 %42, ptr %43, align 8, !tbaa !11
  %44 = load i64, ptr %15, align 8, !tbaa !11
  %45 = sub i64 %44, 16
  store i64 %45, ptr %15, align 8, !tbaa !11
  %46 = load ptr, ptr %19, align 8, !tbaa !5
  %47 = load i32, ptr %13, align 4, !tbaa !9
  %48 = load ptr, ptr %18, align 8, !tbaa !5
  %49 = load i64, ptr %17, align 8, !tbaa !11
  %50 = icmp eq i64 %49, 0
  br i1 %50, label %51, label %54

51:                                               ; preds = %40
  %52 = load i64, ptr %15, align 8, !tbaa !11
  %53 = icmp eq i64 %52, 0
  br label %54

54:                                               ; preds = %51, %40
  %55 = phi i1 [ false, %40 ], [ %53, %51 ]
  %56 = zext i1 %55 to i32
  call void @drysponge128_setup(ptr noundef %20, ptr noundef %46, i32 noundef %47, ptr noundef %48, i32 noundef %56)
  %57 = load i64, ptr %17, align 8, !tbaa !11
  %58 = icmp ugt i64 %57, 0
  br i1 %58, label %59, label %65

59:                                               ; preds = %54
  %60 = load ptr, ptr %16, align 8, !tbaa !5
  %61 = load i64, ptr %17, align 8, !tbaa !11
  %62 = load i64, ptr %15, align 8, !tbaa !11
  %63 = icmp eq i64 %62, 0
  %64 = zext i1 %63 to i32
  call void @drygascon128_process_ad(ptr noundef %20, ptr noundef %60, i64 noundef %61, i32 noundef %64)
  br label %65

65:                                               ; preds = %59, %54
  %66 = load i64, ptr %15, align 8, !tbaa !11
  %67 = icmp ugt i64 %66, 0
  br i1 %67, label %68, label %150

68:                                               ; preds = %65
  br label %69

69:                                               ; preds = %98, %68
  %70 = load i64, ptr %15, align 8, !tbaa !11
  %71 = icmp ugt i64 %70, 16
  br i1 %71, label %72, label %106

72:                                               ; preds = %69
  br label %73

73:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #3
  %74 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %74, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #3
  %75 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %75, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #3
  %76 = getelementptr inbounds %struct.drysponge128_state_t, ptr %20, i32 0, i32 3
  %77 = getelementptr inbounds [16 x i8], ptr %76, i64 0, i64 0
  store ptr %77, ptr %26, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #3
  store i32 16, ptr %27, align 4, !tbaa !9
  br label %78

78:                                               ; preds = %81, %73
  %79 = load i32, ptr %27, align 4, !tbaa !9
  %80 = icmp ugt i32 %79, 0
  br i1 %80, label %81, label %96

81:                                               ; preds = %78
  %82 = load ptr, ptr %25, align 8, !tbaa !5
  %83 = getelementptr inbounds i8, ptr %82, i32 1
  store ptr %83, ptr %25, align 8, !tbaa !5
  %84 = load i8, ptr %82, align 1, !tbaa !13
  %85 = zext i8 %84 to i32
  %86 = load ptr, ptr %26, align 8, !tbaa !5
  %87 = getelementptr inbounds i8, ptr %86, i32 1
  store ptr %87, ptr %26, align 8, !tbaa !5
  %88 = load i8, ptr %86, align 1, !tbaa !13
  %89 = zext i8 %88 to i32
  %90 = xor i32 %85, %89
  %91 = trunc i32 %90 to i8
  %92 = load ptr, ptr %24, align 8, !tbaa !5
  %93 = getelementptr inbounds i8, ptr %92, i32 1
  store ptr %93, ptr %24, align 8, !tbaa !5
  store i8 %91, ptr %92, align 1, !tbaa !13
  %94 = load i32, ptr %27, align 4, !tbaa !9
  %95 = add i32 %94, -1
  store i32 %95, ptr %27, align 4, !tbaa !9
  br label %78, !llvm.loop !14

96:                                               ; preds = %78
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #3
  br label %97

97:                                               ; preds = %96
  br label %98

98:                                               ; preds = %97
  %99 = load ptr, ptr %11, align 8, !tbaa !5
  call void @drygascon128_f_wrap(ptr noundef %20, ptr noundef %99, i32 noundef 16)
  %100 = load ptr, ptr %14, align 8, !tbaa !5
  %101 = getelementptr inbounds i8, ptr %100, i64 16
  store ptr %101, ptr %14, align 8, !tbaa !5
  %102 = load ptr, ptr %11, align 8, !tbaa !5
  %103 = getelementptr inbounds i8, ptr %102, i64 16
  store ptr %103, ptr %11, align 8, !tbaa !5
  %104 = load i64, ptr %15, align 8, !tbaa !11
  %105 = sub i64 %104, 16
  store i64 %105, ptr %15, align 8, !tbaa !11
  br label %69, !llvm.loop !16

106:                                              ; preds = %69
  %107 = getelementptr inbounds %struct.drysponge128_state_t, ptr %20, i32 0, i32 1
  store i32 3584, ptr %107, align 8, !tbaa !17
  %108 = load i64, ptr %15, align 8, !tbaa !11
  %109 = icmp ult i64 %108, 16
  br i1 %109, label %110, label %114

110:                                              ; preds = %106
  %111 = getelementptr inbounds %struct.drysponge128_state_t, ptr %20, i32 0, i32 1
  %112 = load i32, ptr %111, align 8, !tbaa !17
  %113 = or i32 %112, 256
  store i32 %113, ptr %111, align 8, !tbaa !17
  br label %114

114:                                              ; preds = %110, %106
  %115 = load i64, ptr %15, align 8, !tbaa !11
  %116 = trunc i64 %115 to i32
  store i32 %116, ptr %22, align 4, !tbaa !9
  br label %117

117:                                              ; preds = %114
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #3
  %118 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %118, ptr %28, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #3
  %119 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %119, ptr %29, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #3
  %120 = getelementptr inbounds %struct.drysponge128_state_t, ptr %20, i32 0, i32 3
  %121 = getelementptr inbounds [16 x i8], ptr %120, i64 0, i64 0
  store ptr %121, ptr %30, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #3
  %122 = load i32, ptr %22, align 4, !tbaa !9
  store i32 %122, ptr %31, align 4, !tbaa !9
  br label %123

123:                                              ; preds = %126, %117
  %124 = load i32, ptr %31, align 4, !tbaa !9
  %125 = icmp ugt i32 %124, 0
  br i1 %125, label %126, label %141

126:                                              ; preds = %123
  %127 = load ptr, ptr %29, align 8, !tbaa !5
  %128 = getelementptr inbounds i8, ptr %127, i32 1
  store ptr %128, ptr %29, align 8, !tbaa !5
  %129 = load i8, ptr %127, align 1, !tbaa !13
  %130 = zext i8 %129 to i32
  %131 = load ptr, ptr %30, align 8, !tbaa !5
  %132 = getelementptr inbounds i8, ptr %131, i32 1
  store ptr %132, ptr %30, align 8, !tbaa !5
  %133 = load i8, ptr %131, align 1, !tbaa !13
  %134 = zext i8 %133 to i32
  %135 = xor i32 %130, %134
  %136 = trunc i32 %135 to i8
  %137 = load ptr, ptr %28, align 8, !tbaa !5
  %138 = getelementptr inbounds i8, ptr %137, i32 1
  store ptr %138, ptr %28, align 8, !tbaa !5
  store i8 %136, ptr %137, align 1, !tbaa !13
  %139 = load i32, ptr %31, align 4, !tbaa !9
  %140 = add i32 %139, -1
  store i32 %140, ptr %31, align 4, !tbaa !9
  br label %123, !llvm.loop !19

141:                                              ; preds = %123
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #3
  br label %142

142:                                              ; preds = %141
  br label %143

143:                                              ; preds = %142
  %144 = load ptr, ptr %11, align 8, !tbaa !5
  %145 = load i32, ptr %22, align 4, !tbaa !9
  call void @drygascon128_f_wrap(ptr noundef %20, ptr noundef %144, i32 noundef %145)
  %146 = load i32, ptr %22, align 4, !tbaa !9
  %147 = load ptr, ptr %14, align 8, !tbaa !5
  %148 = zext i32 %146 to i64
  %149 = getelementptr inbounds i8, ptr %147, i64 %148
  store ptr %149, ptr %14, align 8, !tbaa !5
  br label %150

150:                                              ; preds = %143, %65
  %151 = load ptr, ptr %21, align 8, !tbaa !5
  %152 = load ptr, ptr %12, align 8, !tbaa !5
  %153 = load i64, ptr %152, align 8, !tbaa !11
  %154 = getelementptr inbounds %struct.drysponge128_state_t, ptr %20, i32 0, i32 3
  %155 = getelementptr inbounds [16 x i8], ptr %154, i64 0, i64 0
  %156 = load ptr, ptr %14, align 8, !tbaa !5
  %157 = call i32 @aead_check_tag(ptr noundef %151, i64 noundef %153, ptr noundef %155, ptr noundef %156, i32 noundef 16)
  store i32 %157, ptr %10, align 4
  store i32 1, ptr %23, align 4
  br label %158

158:                                              ; preds = %150, %39, %35
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 80, ptr %20) #3
  %159 = load i32, ptr %10, align 4
  ret i32 %159
}

declare i32 @aead_check_tag(ptr noundef, i64 noundef, ptr noundef, ptr noundef, i32 noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 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 #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 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = !{!18, !10, i64 40}
!18 = !{!"", !7, i64 0, !10, i64 40, !10, i64 44, !7, i64 48, !7, i64 64}
!19 = distinct !{!19, !15}


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

%struct.drysponge128_state_t = type { %union.gascon128_state_t, i32, i32, %union.drysponge128_rate_t, %union.drysponge128_x_t }
%union.gascon128_state_t = type { [5 x i64] }
%union.drysponge128_rate_t = type { [2 x i64] }
%union.drysponge128_x_t = type { [2 x i64] }

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

declare i32 @drysponge128_safe_alignement(ptr noundef) local_unnamed_addr #1

declare void @drysponge128_setup(ptr noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @drygascon128_process_ad(ptr noundef, ptr noundef, i64 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) #0

declare void @drygascon128_f_wrap(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local i32 @drygascon128_aead_decrypt_core(ptr noundef %0, ptr nocapture noundef %1, i32 noundef %2, ptr noundef %3, i64 noundef %4, ptr noundef %5, i64 noundef %6, ptr noundef %7, ptr noundef %8) local_unnamed_addr #2 {
  %10 = alloca %struct.drysponge128_state_t, align 16
  %11 = ptrtoint ptr %10 to i64
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %10) #3
  %12 = call i32 @drysponge128_safe_alignement(ptr noundef nonnull %10) #3
  %.not = icmp eq i32 %12, 0
  %13 = icmp ult i64 %4, 16
  %or.cond = or i1 %13, %.not
  br i1 %or.cond, label %179, label %14

14:                                               ; preds = %9
  %15 = add i64 %4, -16
  store i64 %15, ptr %1, align 8, !tbaa !5
  %16 = or i64 %15, %6
  %17 = icmp eq i64 %16, 0
  %18 = zext i1 %17 to i32
  call void @drysponge128_setup(ptr noundef nonnull %10, ptr noundef %8, i32 noundef %2, ptr noundef %7, i32 noundef %18) #3
  %.not58 = icmp eq i64 %6, 0
  br i1 %.not58, label %22, label %19

19:                                               ; preds = %14
  %20 = icmp eq i64 %15, 0
  %21 = zext i1 %20 to i32
  call void @drygascon128_process_ad(ptr noundef nonnull %10, ptr noundef %5, i64 noundef %6, i32 noundef %21)
  br label %22

22:                                               ; preds = %19, %14
  %.not59 = icmp eq i64 %15, 0
  br i1 %.not59, label %175, label %.preheader

.preheader:                                       ; preds = %22
  %23 = icmp ugt i64 %15, 16
  br i1 %23, label %.lr.ph, label %iter.check

.lr.ph:                                           ; preds = %.preheader
  %24 = getelementptr inbounds i8, ptr %10, i64 48
  %25 = getelementptr inbounds i8, ptr %10, i64 49
  %26 = getelementptr inbounds i8, ptr %10, i64 50
  %27 = getelementptr inbounds i8, ptr %10, i64 51
  %28 = getelementptr inbounds i8, ptr %10, i64 52
  %29 = getelementptr inbounds i8, ptr %10, i64 53
  %30 = getelementptr inbounds i8, ptr %10, i64 54
  %31 = getelementptr inbounds i8, ptr %10, i64 55
  %32 = getelementptr inbounds i8, ptr %10, i64 56
  %33 = getelementptr inbounds i8, ptr %10, i64 57
  %34 = getelementptr inbounds i8, ptr %10, i64 58
  %35 = getelementptr inbounds i8, ptr %10, i64 59
  %36 = getelementptr inbounds i8, ptr %10, i64 60
  %37 = getelementptr inbounds i8, ptr %10, i64 61
  %38 = getelementptr inbounds i8, ptr %10, i64 62
  %39 = getelementptr inbounds i8, ptr %10, i64 63
  br label %40

40:                                               ; preds = %.lr.ph, %40
  %.05269 = phi ptr [ %0, %.lr.ph ], [ %120, %40 ]
  %.05368 = phi ptr [ %3, %.lr.ph ], [ %119, %40 ]
  %.05467 = phi i64 [ %15, %.lr.ph ], [ %121, %40 ]
  %41 = getelementptr inbounds i8, ptr %.05368, i64 1
  %42 = load i8, ptr %.05368, align 1, !tbaa !9
  %43 = load i8, ptr %24, align 16, !tbaa !9
  %44 = xor i8 %43, %42
  %45 = getelementptr inbounds i8, ptr %.05269, i64 1
  store i8 %44, ptr %.05269, align 1, !tbaa !9
  %46 = getelementptr inbounds i8, ptr %.05368, i64 2
  %47 = load i8, ptr %41, align 1, !tbaa !9
  %48 = load i8, ptr %25, align 1, !tbaa !9
  %49 = xor i8 %48, %47
  %50 = getelementptr inbounds i8, ptr %.05269, i64 2
  store i8 %49, ptr %45, align 1, !tbaa !9
  %51 = getelementptr inbounds i8, ptr %.05368, i64 3
  %52 = load i8, ptr %46, align 1, !tbaa !9
  %53 = load i8, ptr %26, align 2, !tbaa !9
  %54 = xor i8 %53, %52
  %55 = getelementptr inbounds i8, ptr %.05269, i64 3
  store i8 %54, ptr %50, align 1, !tbaa !9
  %56 = getelementptr inbounds i8, ptr %.05368, i64 4
  %57 = load i8, ptr %51, align 1, !tbaa !9
  %58 = load i8, ptr %27, align 1, !tbaa !9
  %59 = xor i8 %58, %57
  %60 = getelementptr inbounds i8, ptr %.05269, i64 4
  store i8 %59, ptr %55, align 1, !tbaa !9
  %61 = getelementptr inbounds i8, ptr %.05368, i64 5
  %62 = load i8, ptr %56, align 1, !tbaa !9
  %63 = load i8, ptr %28, align 4, !tbaa !9
  %64 = xor i8 %63, %62
  %65 = getelementptr inbounds i8, ptr %.05269, i64 5
  store i8 %64, ptr %60, align 1, !tbaa !9
  %66 = getelementptr inbounds i8, ptr %.05368, i64 6
  %67 = load i8, ptr %61, align 1, !tbaa !9
  %68 = load i8, ptr %29, align 1, !tbaa !9
  %69 = xor i8 %68, %67
  %70 = getelementptr inbounds i8, ptr %.05269, i64 6
  store i8 %69, ptr %65, align 1, !tbaa !9
  %71 = getelementptr inbounds i8, ptr %.05368, i64 7
  %72 = load i8, ptr %66, align 1, !tbaa !9
  %73 = load i8, ptr %30, align 2, !tbaa !9
  %74 = xor i8 %73, %72
  %75 = getelementptr inbounds i8, ptr %.05269, i64 7
  store i8 %74, ptr %70, align 1, !tbaa !9
  %76 = getelementptr inbounds i8, ptr %.05368, i64 8
  %77 = load i8, ptr %71, align 1, !tbaa !9
  %78 = load i8, ptr %31, align 1, !tbaa !9
  %79 = xor i8 %78, %77
  %80 = getelementptr inbounds i8, ptr %.05269, i64 8
  store i8 %79, ptr %75, align 1, !tbaa !9
  %81 = getelementptr inbounds i8, ptr %.05368, i64 9
  %82 = load i8, ptr %76, align 1, !tbaa !9
  %83 = load i8, ptr %32, align 8, !tbaa !9
  %84 = xor i8 %83, %82
  %85 = getelementptr inbounds i8, ptr %.05269, i64 9
  store i8 %84, ptr %80, align 1, !tbaa !9
  %86 = getelementptr inbounds i8, ptr %.05368, i64 10
  %87 = load i8, ptr %81, align 1, !tbaa !9
  %88 = load i8, ptr %33, align 1, !tbaa !9
  %89 = xor i8 %88, %87
  %90 = getelementptr inbounds i8, ptr %.05269, i64 10
  store i8 %89, ptr %85, align 1, !tbaa !9
  %91 = getelementptr inbounds i8, ptr %.05368, i64 11
  %92 = load i8, ptr %86, align 1, !tbaa !9
  %93 = load i8, ptr %34, align 2, !tbaa !9
  %94 = xor i8 %93, %92
  %95 = getelementptr inbounds i8, ptr %.05269, i64 11
  store i8 %94, ptr %90, align 1, !tbaa !9
  %96 = getelementptr inbounds i8, ptr %.05368, i64 12
  %97 = load i8, ptr %91, align 1, !tbaa !9
  %98 = load i8, ptr %35, align 1, !tbaa !9
  %99 = xor i8 %98, %97
  %100 = getelementptr inbounds i8, ptr %.05269, i64 12
  store i8 %99, ptr %95, align 1, !tbaa !9
  %101 = getelementptr inbounds i8, ptr %.05368, i64 13
  %102 = load i8, ptr %96, align 1, !tbaa !9
  %103 = load i8, ptr %36, align 4, !tbaa !9
  %104 = xor i8 %103, %102
  %105 = getelementptr inbounds i8, ptr %.05269, i64 13
  store i8 %104, ptr %100, align 1, !tbaa !9
  %106 = getelementptr inbounds i8, ptr %.05368, i64 14
  %107 = load i8, ptr %101, align 1, !tbaa !9
  %108 = load i8, ptr %37, align 1, !tbaa !9
  %109 = xor i8 %108, %107
  %110 = getelementptr inbounds i8, ptr %.05269, i64 14
  store i8 %109, ptr %105, align 1, !tbaa !9
  %111 = getelementptr inbounds i8, ptr %.05368, i64 15
  %112 = load i8, ptr %106, align 1, !tbaa !9
  %113 = load i8, ptr %38, align 2, !tbaa !9
  %114 = xor i8 %113, %112
  %115 = getelementptr inbounds i8, ptr %.05269, i64 15
  store i8 %114, ptr %110, align 1, !tbaa !9
  %116 = load i8, ptr %111, align 1, !tbaa !9
  %117 = load i8, ptr %39, align 1, !tbaa !9
  %118 = xor i8 %117, %116
  store i8 %118, ptr %115, align 1, !tbaa !9
  call void @drygascon128_f_wrap(ptr noundef nonnull %10, ptr noundef nonnull %.05269, i32 noundef 16) #3
  %119 = getelementptr inbounds i8, ptr %.05368, i64 16
  %120 = getelementptr inbounds i8, ptr %.05269, i64 16
  %121 = add i64 %.05467, -16
  %122 = icmp ugt i64 %121, 16
  br i1 %122, label %40, label %iter.check, !llvm.loop !10

iter.check:                                       ; preds = %40, %.preheader
  %.054.lcssa = phi i64 [ %15, %.preheader ], [ %121, %40 ]
  %.053.lcssa = phi ptr [ %3, %.preheader ], [ %119, %40 ]
  %.052.lcssa = phi ptr [ %0, %.preheader ], [ %120, %40 ]
  %123 = getelementptr inbounds i8, ptr %10, i64 40
  %.not60 = icmp eq i64 %.054.lcssa, 16
  %spec.select = select i1 %.not60, i32 3584, i32 3840
  store i32 %spec.select, ptr %123, align 8, !tbaa !12
  %124 = trunc nuw i64 %.054.lcssa to i32
  %125 = getelementptr inbounds i8, ptr %10, i64 48
  %126 = add nuw nsw i64 %.054.lcssa, 4294967295
  %127 = and i64 %126, 4294967295
  %128 = add nuw nsw i64 %127, 1
  %min.iters.check = icmp ult i64 %127, 7
  br i1 %min.iters.check, label %.lr.ph78.preheader, label %vector.memcheck

vector.memcheck:                                  ; preds = %iter.check
  %.053.lcssa87 = ptrtoint ptr %.053.lcssa to i64
  %.052.lcssa86 = ptrtoint ptr %.052.lcssa to i64
  %129 = sub i64 %.052.lcssa86, %.053.lcssa87
  %diff.check = icmp ult i64 %129, 32
  %130 = add i64 %.052.lcssa86, -48
  %131 = sub i64 %130, %11
  %diff.check88 = icmp ult i64 %131, 32
  %conflict.rdx = or i1 %diff.check, %diff.check88
  br i1 %conflict.rdx, label %.lr.ph78.preheader, label %vector.main.loop.iter.check

vector.main.loop.iter.check:                      ; preds = %vector.memcheck
  %min.iters.check89 = icmp ult i64 %127, 31
  br i1 %min.iters.check89, label %vec.epilog.ph, label %vector.ph

vector.ph:                                        ; preds = %vector.main.loop.iter.check
  %n.vec = and i64 %128, 8589934560
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %next.gep = getelementptr i8, ptr %125, i64 %index
  %next.gep91 = getelementptr i8, ptr %.053.lcssa, i64 %index
  %next.gep93 = getelementptr i8, ptr %.052.lcssa, i64 %index
  %132 = getelementptr i8, ptr %next.gep91, i64 16
  %wide.load = load <16 x i8>, ptr %next.gep91, align 1, !tbaa !9
  %wide.load95 = load <16 x i8>, ptr %132, align 1, !tbaa !9
  %133 = getelementptr i8, ptr %next.gep, i64 16
  %wide.load96 = load <16 x i8>, ptr %next.gep, align 16, !tbaa !9
  %wide.load97 = load <16 x i8>, ptr %133, align 16, !tbaa !9
  %134 = xor <16 x i8> %wide.load96, %wide.load
  %135 = xor <16 x i8> %wide.load97, %wide.load95
  %136 = getelementptr i8, ptr %next.gep93, i64 16
  store <16 x i8> %134, ptr %next.gep93, align 1, !tbaa !9
  store <16 x i8> %135, ptr %136, align 1, !tbaa !9
  %index.next = add nuw i64 %index, 32
  %137 = icmp eq i64 %index.next, %n.vec
  br i1 %137, label %middle.block, label %vector.body, !llvm.loop !15

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %128, %n.vec
  br i1 %cmp.n, label %._crit_edge79, label %vec.epilog.iter.check

vec.epilog.iter.check:                            ; preds = %middle.block
  %ind.end109 = getelementptr i8, ptr %.052.lcssa, i64 %n.vec
  %ind.end106 = getelementptr i8, ptr %.053.lcssa, i64 %n.vec
  %ind.end103 = getelementptr i8, ptr %125, i64 %n.vec
  %.cast100 = trunc i64 %n.vec to i32
  %ind.end101 = sub i32 %124, %.cast100
  %n.vec.remaining = and i64 %128, 24
  %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
  br i1 %min.epilog.iters.check, label %.lr.ph78.preheader, label %vec.epilog.ph

vec.epilog.ph:                                    ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
  %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
  %n.vec99 = and i64 %128, 8589934584
  %.cast = trunc i64 %n.vec99 to i32
  %ind.end = sub i32 %124, %.cast
  %ind.end102 = getelementptr i8, ptr %125, i64 %n.vec99
  %ind.end105 = getelementptr i8, ptr %.053.lcssa, i64 %n.vec99
  %ind.end108 = getelementptr i8, ptr %.052.lcssa, i64 %n.vec99
  br label %vec.epilog.vector.body

vec.epilog.vector.body:                           ; preds = %vec.epilog.vector.body, %vec.epilog.ph
  %index111 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next117, %vec.epilog.vector.body ]
  %next.gep112 = getelementptr i8, ptr %125, i64 %index111
  %next.gep113 = getelementptr i8, ptr %.053.lcssa, i64 %index111
  %next.gep114 = getelementptr i8, ptr %.052.lcssa, i64 %index111
  %wide.load115 = load <8 x i8>, ptr %next.gep113, align 1, !tbaa !9
  %wide.load116 = load <8 x i8>, ptr %next.gep112, align 8, !tbaa !9
  %138 = xor <8 x i8> %wide.load116, %wide.load115
  store <8 x i8> %138, ptr %next.gep114, align 1, !tbaa !9
  %index.next117 = add nuw i64 %index111, 8
  %139 = icmp eq i64 %index.next117, %n.vec99
  br i1 %139, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !18

vec.epilog.middle.block:                          ; preds = %vec.epilog.vector.body
  %cmp.n118 = icmp eq i64 %128, %n.vec99
  br i1 %cmp.n118, label %._crit_edge79, label %.lr.ph78.preheader

.lr.ph78.preheader:                               ; preds = %vec.epilog.middle.block, %vector.memcheck, %iter.check, %vec.epilog.iter.check
  %.076.ph = phi i32 [ %124, %iter.check ], [ %124, %vector.memcheck ], [ %ind.end101, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ]
  %.04475.ph = phi ptr [ %125, %iter.check ], [ %125, %vector.memcheck ], [ %ind.end103, %vec.epilog.iter.check ], [ %ind.end102, %vec.epilog.middle.block ]
  %.04574.ph = phi ptr [ %.053.lcssa, %iter.check ], [ %.053.lcssa, %vector.memcheck ], [ %ind.end106, %vec.epilog.iter.check ], [ %ind.end105, %vec.epilog.middle.block ]
  %.04673.ph = phi ptr [ %.052.lcssa, %iter.check ], [ %.052.lcssa, %vector.memcheck ], [ %ind.end109, %vec.epilog.iter.check ], [ %ind.end108, %vec.epilog.middle.block ]
  %140 = add nsw i32 %.076.ph, -1
  %xtraiter = and i32 %.076.ph, 3
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph78.prol.loopexit, label %.lr.ph78.prol

.lr.ph78.prol:                                    ; preds = %.lr.ph78.preheader, %.lr.ph78.prol
  %.076.prol = phi i32 [ %147, %.lr.ph78.prol ], [ %.076.ph, %.lr.ph78.preheader ]
  %.04475.prol = phi ptr [ %143, %.lr.ph78.prol ], [ %.04475.ph, %.lr.ph78.preheader ]
  %.04574.prol = phi ptr [ %141, %.lr.ph78.prol ], [ %.04574.ph, %.lr.ph78.preheader ]
  %.04673.prol = phi ptr [ %146, %.lr.ph78.prol ], [ %.04673.ph, %.lr.ph78.preheader ]
  %prol.iter = phi i32 [ %prol.iter.next, %.lr.ph78.prol ], [ 0, %.lr.ph78.preheader ]
  %141 = getelementptr inbounds i8, ptr %.04574.prol, i64 1
  %142 = load i8, ptr %.04574.prol, align 1, !tbaa !9
  %143 = getelementptr inbounds i8, ptr %.04475.prol, i64 1
  %144 = load i8, ptr %.04475.prol, align 1, !tbaa !9
  %145 = xor i8 %144, %142
  %146 = getelementptr inbounds i8, ptr %.04673.prol, i64 1
  store i8 %145, ptr %.04673.prol, align 1, !tbaa !9
  %147 = add nsw i32 %.076.prol, -1
  %prol.iter.next = add i32 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i32 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %.lr.ph78.prol.loopexit, label %.lr.ph78.prol, !llvm.loop !19

.lr.ph78.prol.loopexit:                           ; preds = %.lr.ph78.prol, %.lr.ph78.preheader
  %.076.unr = phi i32 [ %.076.ph, %.lr.ph78.preheader ], [ %147, %.lr.ph78.prol ]
  %.04475.unr = phi ptr [ %.04475.ph, %.lr.ph78.preheader ], [ %143, %.lr.ph78.prol ]
  %.04574.unr = phi ptr [ %.04574.ph, %.lr.ph78.preheader ], [ %141, %.lr.ph78.prol ]
  %.04673.unr = phi ptr [ %.04673.ph, %.lr.ph78.preheader ], [ %146, %.lr.ph78.prol ]
  %148 = icmp ult i32 %140, 3
  br i1 %148, label %._crit_edge79, label %.lr.ph78

.lr.ph78:                                         ; preds = %.lr.ph78.prol.loopexit, %.lr.ph78
  %.076 = phi i32 [ %173, %.lr.ph78 ], [ %.076.unr, %.lr.ph78.prol.loopexit ]
  %.04475 = phi ptr [ %169, %.lr.ph78 ], [ %.04475.unr, %.lr.ph78.prol.loopexit ]
  %.04574 = phi ptr [ %167, %.lr.ph78 ], [ %.04574.unr, %.lr.ph78.prol.loopexit ]
  %.04673 = phi ptr [ %172, %.lr.ph78 ], [ %.04673.unr, %.lr.ph78.prol.loopexit ]
  %149 = getelementptr inbounds i8, ptr %.04574, i64 1
  %150 = load i8, ptr %.04574, align 1, !tbaa !9
  %151 = getelementptr inbounds i8, ptr %.04475, i64 1
  %152 = load i8, ptr %.04475, align 1, !tbaa !9
  %153 = xor i8 %152, %150
  %154 = getelementptr inbounds i8, ptr %.04673, i64 1
  store i8 %153, ptr %.04673, align 1, !tbaa !9
  %155 = getelementptr inbounds i8, ptr %.04574, i64 2
  %156 = load i8, ptr %149, align 1, !tbaa !9
  %157 = getelementptr inbounds i8, ptr %.04475, i64 2
  %158 = load i8, ptr %151, align 1, !tbaa !9
  %159 = xor i8 %158, %156
  %160 = getelementptr inbounds i8, ptr %.04673, i64 2
  store i8 %159, ptr %154, align 1, !tbaa !9
  %161 = getelementptr inbounds i8, ptr %.04574, i64 3
  %162 = load i8, ptr %155, align 1, !tbaa !9
  %163 = getelementptr inbounds i8, ptr %.04475, i64 3
  %164 = load i8, ptr %157, align 1, !tbaa !9
  %165 = xor i8 %164, %162
  %166 = getelementptr inbounds i8, ptr %.04673, i64 3
  store i8 %165, ptr %160, align 1, !tbaa !9
  %167 = getelementptr inbounds i8, ptr %.04574, i64 4
  %168 = load i8, ptr %161, align 1, !tbaa !9
  %169 = getelementptr inbounds i8, ptr %.04475, i64 4
  %170 = load i8, ptr %163, align 1, !tbaa !9
  %171 = xor i8 %170, %168
  %172 = getelementptr inbounds i8, ptr %.04673, i64 4
  store i8 %171, ptr %166, align 1, !tbaa !9
  %173 = add nsw i32 %.076, -4
  %.not61.3 = icmp eq i32 %173, 0
  br i1 %.not61.3, label %._crit_edge79, label %.lr.ph78, !llvm.loop !21

._crit_edge79:                                    ; preds = %.lr.ph78.prol.loopexit, %.lr.ph78, %vec.epilog.middle.block, %middle.block
  call void @drygascon128_f_wrap(ptr noundef nonnull %10, ptr noundef %.052.lcssa, i32 noundef %124) #3
  %174 = getelementptr inbounds i8, ptr %.053.lcssa, i64 %.054.lcssa
  br label %175

175:                                              ; preds = %._crit_edge79, %22
  %.1 = phi ptr [ %174, %._crit_edge79 ], [ %3, %22 ]
  %176 = load i64, ptr %1, align 8, !tbaa !5
  %177 = getelementptr inbounds i8, ptr %10, i64 48
  %178 = call i32 @aead_check_tag(ptr noundef %0, i64 noundef %176, ptr noundef nonnull %177, ptr noundef %.1, i32 noundef 16) #3
  br label %179

179:                                              ; preds = %9, %175
  %.051 = phi i32 [ %178, %175 ], [ -1, %9 ]
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %10) #3
  ret i32 %.051
}

declare i32 @aead_check_tag(ptr noundef, i64 noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 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 #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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!13, !14, i64 40}
!13 = !{!"", !7, i64 0, !14, i64 40, !14, i64 44, !7, i64 48, !7, i64 64}
!14 = !{!"int", !7, i64 0}
!15 = distinct !{!15, !11, !16, !17}
!16 = !{!"llvm.loop.isvectorized", i32 1}
!17 = !{!"llvm.loop.unroll.runtime.disable"}
!18 = distinct !{!18, !11, !16, !17}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.unroll.disable"}
!21 = distinct !{!21, !11, !16}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass