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

; 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.subterranean_state_t = type { [9 x i32] }

; Function Attrs: nounwind uwtable
define dso_local i32 @subterranean_aead_decrypt(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i64 noundef %4, ptr noundef %5, i64 noundef %6, ptr noundef %7, ptr noundef %8) #0 {
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %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.subterranean_state_t, align 4
  %21 = alloca ptr, align 8
  %22 = alloca [16 x i8], align 16
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  store ptr %0, ptr %11, align 8, !tbaa !5
  store ptr %1, ptr %12, align 8, !tbaa !5
  store ptr %2, ptr %13, align 8, !tbaa !5
  store ptr %3, ptr %14, align 8, !tbaa !5
  store i64 %4, ptr %15, align 8, !tbaa !9
  store ptr %5, ptr %16, align 8, !tbaa !5
  store i64 %6, ptr %17, align 8, !tbaa !9
  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 36, ptr %20) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  %26 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %26, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #4
  %27 = load ptr, ptr %13, align 8, !tbaa !5
  %28 = load i64, ptr %15, align 8, !tbaa !9
  %29 = icmp ult i64 %28, 16
  br i1 %29, label %30, label %31

30:                                               ; preds = %9
  store i32 -1, ptr %10, align 4
  store i32 1, ptr %24, align 4
  br label %215

31:                                               ; preds = %9
  %32 = load i64, ptr %15, align 8, !tbaa !9
  %33 = sub i64 %32, 16
  %34 = load ptr, ptr %12, align 8, !tbaa !5
  store i64 %33, ptr %34, align 8, !tbaa !9
  call void @llvm.memset.p0.i64(ptr align 4 %20, i8 0, i64 36, i1 false)
  %35 = load ptr, ptr %19, align 8, !tbaa !5
  call void @subterranean_absorb(ptr noundef %20, ptr noundef %35, i64 noundef 16)
  %36 = load ptr, ptr %18, align 8, !tbaa !5
  call void @subterranean_absorb(ptr noundef %20, ptr noundef %36, i64 noundef 16)
  call void @subterranean_blank(ptr noundef %20)
  %37 = load ptr, ptr %16, align 8, !tbaa !5
  %38 = load i64, ptr %17, align 8, !tbaa !9
  call void @subterranean_absorb(ptr noundef %20, ptr noundef %37, i64 noundef %38)
  %39 = load i64, ptr %15, align 8, !tbaa !9
  %40 = sub i64 %39, 16
  store i64 %40, ptr %15, align 8, !tbaa !9
  br label %41

41:                                               ; preds = %103, %31
  %42 = load i64, ptr %15, align 8, !tbaa !9
  %43 = icmp uge i64 %42, 4
  br i1 %43, label %44, label %110

44:                                               ; preds = %41
  %45 = load ptr, ptr %14, align 8, !tbaa !5
  %46 = getelementptr inbounds i8, ptr %45, i64 3
  %47 = load i8, ptr %46, align 1, !tbaa !11
  %48 = zext i8 %47 to i32
  %49 = shl i32 %48, 24
  %50 = load ptr, ptr %14, align 8, !tbaa !5
  %51 = getelementptr inbounds i8, ptr %50, i64 2
  %52 = load i8, ptr %51, align 1, !tbaa !11
  %53 = zext i8 %52 to i32
  %54 = shl i32 %53, 16
  %55 = or i32 %49, %54
  %56 = load ptr, ptr %14, align 8, !tbaa !5
  %57 = getelementptr inbounds i8, ptr %56, i64 1
  %58 = load i8, ptr %57, align 1, !tbaa !11
  %59 = zext i8 %58 to i32
  %60 = shl i32 %59, 8
  %61 = or i32 %55, %60
  %62 = load ptr, ptr %14, align 8, !tbaa !5
  %63 = getelementptr inbounds i8, ptr %62, i64 0
  %64 = load i8, ptr %63, align 1, !tbaa !11
  %65 = zext i8 %64 to i32
  %66 = or i32 %61, %65
  store i32 %66, ptr %23, align 4, !tbaa !12
  %67 = call i32 @subterranean_extract(ptr noundef %20)
  %68 = load i32, ptr %23, align 4, !tbaa !12
  %69 = xor i32 %68, %67
  store i32 %69, ptr %23, align 4, !tbaa !12
  br label %70

70:                                               ; preds = %44
  br label %71

71:                                               ; preds = %70
  call void @subterranean_round(ptr noundef %20)
  %72 = load i32, ptr %23, align 4, !tbaa !12
  call void @subterranean_absorb_word(ptr noundef %20, i32 noundef %72)
  br label %73

73:                                               ; preds = %71
  br label %74

74:                                               ; preds = %73
  %75 = getelementptr inbounds %struct.subterranean_state_t, ptr %20, i32 0, i32 0
  %76 = getelementptr inbounds [9 x i32], ptr %75, i64 0, i64 8
  %77 = load i32, ptr %76, align 4, !tbaa !12
  %78 = xor i32 %77, 1
  store i32 %78, ptr %76, align 4, !tbaa !12
  br label %79

79:                                               ; preds = %74
  br label %80

80:                                               ; preds = %79
  br label %81

81:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #4
  %82 = load i32, ptr %23, align 4, !tbaa !12
  store i32 %82, ptr %25, align 4, !tbaa !12
  %83 = load i32, ptr %25, align 4, !tbaa !12
  %84 = trunc i32 %83 to i8
  %85 = load ptr, ptr %11, align 8, !tbaa !5
  %86 = getelementptr inbounds i8, ptr %85, i64 0
  store i8 %84, ptr %86, align 1, !tbaa !11
  %87 = load i32, ptr %25, align 4, !tbaa !12
  %88 = lshr i32 %87, 8
  %89 = trunc i32 %88 to i8
  %90 = load ptr, ptr %11, align 8, !tbaa !5
  %91 = getelementptr inbounds i8, ptr %90, i64 1
  store i8 %89, ptr %91, align 1, !tbaa !11
  %92 = load i32, ptr %25, align 4, !tbaa !12
  %93 = lshr i32 %92, 16
  %94 = trunc i32 %93 to i8
  %95 = load ptr, ptr %11, align 8, !tbaa !5
  %96 = getelementptr inbounds i8, ptr %95, i64 2
  store i8 %94, ptr %96, align 1, !tbaa !11
  %97 = load i32, ptr %25, align 4, !tbaa !12
  %98 = lshr i32 %97, 24
  %99 = trunc i32 %98 to i8
  %100 = load ptr, ptr %11, align 8, !tbaa !5
  %101 = getelementptr inbounds i8, ptr %100, i64 3
  store i8 %99, ptr %101, align 1, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #4
  br label %102

102:                                              ; preds = %81
  br label %103

103:                                              ; preds = %102
  %104 = load ptr, ptr %14, align 8, !tbaa !5
  %105 = getelementptr inbounds i8, ptr %104, i64 4
  store ptr %105, ptr %14, align 8, !tbaa !5
  %106 = load ptr, ptr %11, align 8, !tbaa !5
  %107 = getelementptr inbounds i8, ptr %106, i64 4
  store ptr %107, ptr %11, align 8, !tbaa !5
  %108 = load i64, ptr %15, align 8, !tbaa !9
  %109 = sub i64 %108, 4
  store i64 %109, ptr %15, align 8, !tbaa !9
  br label %41, !llvm.loop !14

110:                                              ; preds = %41
  %111 = load i64, ptr %15, align 8, !tbaa !9
  %112 = trunc i64 %111 to i8
  %113 = zext i8 %112 to i32
  switch i32 %113, label %114 [
    i32 1, label %122
    i32 2, label %138
    i32 3, label %166
  ]

114:                                              ; preds = %110
  br label %115

115:                                              ; preds = %114
  call void @subterranean_round(ptr noundef %20)
  %116 = getelementptr inbounds %struct.subterranean_state_t, ptr %20, i32 0, i32 0
  %117 = getelementptr inbounds [9 x i32], ptr %116, i64 0, i64 0
  %118 = load i32, ptr %117, align 4, !tbaa !12
  %119 = xor i32 %118, 2
  store i32 %119, ptr %117, align 4, !tbaa !12
  br label %120

120:                                              ; preds = %115
  br label %121

121:                                              ; preds = %120
  br label %205

122:                                              ; preds = %110
  %123 = call i32 @subterranean_extract(ptr noundef %20)
  %124 = load ptr, ptr %14, align 8, !tbaa !5
  %125 = getelementptr inbounds i8, ptr %124, i64 0
  %126 = load i8, ptr %125, align 1, !tbaa !11
  %127 = zext i8 %126 to i32
  %128 = xor i32 %123, %127
  %129 = trunc i32 %128 to i8
  %130 = load ptr, ptr %11, align 8, !tbaa !5
  %131 = getelementptr inbounds i8, ptr %130, i64 0
  store i8 %129, ptr %131, align 1, !tbaa !11
  br label %132

132:                                              ; preds = %122
  call void @subterranean_round(ptr noundef %20)
  %133 = load ptr, ptr %11, align 8, !tbaa !5
  %134 = getelementptr inbounds i8, ptr %133, i64 0
  %135 = load i8, ptr %134, align 1, !tbaa !11
  call void @subterranean_absorb_1(ptr noundef %20, i8 noundef zeroext %135)
  br label %136

136:                                              ; preds = %132
  br label %137

137:                                              ; preds = %136
  br label %205

138:                                              ; preds = %110
  %139 = call i32 @subterranean_extract(ptr noundef %20)
  %140 = load ptr, ptr %14, align 8, !tbaa !5
  %141 = getelementptr inbounds i8, ptr %140, i64 0
  %142 = load i8, ptr %141, align 1, !tbaa !11
  %143 = zext i8 %142 to i32
  %144 = xor i32 %139, %143
  %145 = load ptr, ptr %14, align 8, !tbaa !5
  %146 = getelementptr inbounds i8, ptr %145, i64 1
  %147 = load i8, ptr %146, align 1, !tbaa !11
  %148 = zext i8 %147 to i32
  %149 = shl i32 %148, 8
  %150 = xor i32 %144, %149
  store i32 %150, ptr %23, align 4, !tbaa !12
  %151 = load i32, ptr %23, align 4, !tbaa !12
  %152 = trunc i32 %151 to i8
  %153 = load ptr, ptr %11, align 8, !tbaa !5
  %154 = getelementptr inbounds i8, ptr %153, i64 0
  store i8 %152, ptr %154, align 1, !tbaa !11
  %155 = load i32, ptr %23, align 4, !tbaa !12
  %156 = lshr i32 %155, 8
  %157 = trunc i32 %156 to i8
  %158 = load ptr, ptr %11, align 8, !tbaa !5
  %159 = getelementptr inbounds i8, ptr %158, i64 1
  store i8 %157, ptr %159, align 1, !tbaa !11
  br label %160

160:                                              ; preds = %138
  call void @subterranean_round(ptr noundef %20)
  %161 = load i32, ptr %23, align 4, !tbaa !12
  %162 = and i32 %161, 65535
  %163 = or i32 %162, 65536
  call void @subterranean_absorb_word(ptr noundef %20, i32 noundef %163)
  br label %164

164:                                              ; preds = %160
  br label %165

165:                                              ; preds = %164
  br label %205

166:                                              ; preds = %110
  %167 = call i32 @subterranean_extract(ptr noundef %20)
  %168 = load ptr, ptr %14, align 8, !tbaa !5
  %169 = getelementptr inbounds i8, ptr %168, i64 0
  %170 = load i8, ptr %169, align 1, !tbaa !11
  %171 = zext i8 %170 to i32
  %172 = xor i32 %167, %171
  %173 = load ptr, ptr %14, align 8, !tbaa !5
  %174 = getelementptr inbounds i8, ptr %173, i64 1
  %175 = load i8, ptr %174, align 1, !tbaa !11
  %176 = zext i8 %175 to i32
  %177 = shl i32 %176, 8
  %178 = xor i32 %172, %177
  %179 = load ptr, ptr %14, align 8, !tbaa !5
  %180 = getelementptr inbounds i8, ptr %179, i64 2
  %181 = load i8, ptr %180, align 1, !tbaa !11
  %182 = zext i8 %181 to i32
  %183 = shl i32 %182, 16
  %184 = xor i32 %178, %183
  store i32 %184, ptr %23, align 4, !tbaa !12
  %185 = load i32, ptr %23, align 4, !tbaa !12
  %186 = trunc i32 %185 to i8
  %187 = load ptr, ptr %11, align 8, !tbaa !5
  %188 = getelementptr inbounds i8, ptr %187, i64 0
  store i8 %186, ptr %188, align 1, !tbaa !11
  %189 = load i32, ptr %23, align 4, !tbaa !12
  %190 = lshr i32 %189, 8
  %191 = trunc i32 %190 to i8
  %192 = load ptr, ptr %11, align 8, !tbaa !5
  %193 = getelementptr inbounds i8, ptr %192, i64 1
  store i8 %191, ptr %193, align 1, !tbaa !11
  %194 = load i32, ptr %23, align 4, !tbaa !12
  %195 = lshr i32 %194, 16
  %196 = trunc i32 %195 to i8
  %197 = load ptr, ptr %11, align 8, !tbaa !5
  %198 = getelementptr inbounds i8, ptr %197, i64 2
  store i8 %196, ptr %198, align 1, !tbaa !11
  br label %199

199:                                              ; preds = %166
  call void @subterranean_round(ptr noundef %20)
  %200 = load i32, ptr %23, align 4, !tbaa !12
  %201 = and i32 %200, 16777215
  %202 = or i32 %201, 16777216
  call void @subterranean_absorb_word(ptr noundef %20, i32 noundef %202)
  br label %203

203:                                              ; preds = %199
  br label %204

204:                                              ; preds = %203
  br label %205

205:                                              ; preds = %204, %165, %137, %121
  call void @subterranean_blank(ptr noundef %20)
  %206 = getelementptr inbounds [16 x i8], ptr %22, i64 0, i64 0
  call void @subterranean_squeeze(ptr noundef %20, ptr noundef %206, i32 noundef 16)
  %207 = load ptr, ptr %21, align 8, !tbaa !5
  %208 = load ptr, ptr %12, align 8, !tbaa !5
  %209 = load i64, ptr %208, align 8, !tbaa !9
  %210 = getelementptr inbounds [16 x i8], ptr %22, i64 0, i64 0
  %211 = load ptr, ptr %14, align 8, !tbaa !5
  %212 = load i64, ptr %15, align 8, !tbaa !9
  %213 = getelementptr inbounds i8, ptr %211, i64 %212
  %214 = call i32 @aead_check_tag(ptr noundef %207, i64 noundef %209, ptr noundef %210, ptr noundef %213, i32 noundef 16)
  store i32 %214, ptr %10, align 4
  store i32 1, ptr %24, align 4
  br label %215

215:                                              ; preds = %205, %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 36, ptr %20) #4
  %216 = load i32, ptr %10, align 4
  ret i32 %216
}

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

declare void @subterranean_absorb(ptr noundef, ptr noundef, i64 noundef) #3

declare void @subterranean_blank(ptr noundef) #3

declare i32 @subterranean_extract(ptr noundef) #3

declare void @subterranean_round(ptr noundef) #3

declare void @subterranean_absorb_word(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

declare void @subterranean_squeeze(ptr noundef, ptr noundef, i32 noundef) #3

declare void @subterranean_absorb_1(ptr noundef, i8 noundef zeroext) #3

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

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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { "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 = { 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 = !{!"long long", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"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"

%struct.subterranean_state_t = type { [9 x i32] }

; Function Attrs: nounwind uwtable
define dso_local i32 @subterranean_aead_decrypt(ptr noundef %0, ptr nocapture noundef %1, ptr nocapture noundef readnone %2, ptr noundef %3, i64 noundef %4, ptr noundef %5, i64 noundef %6, ptr noundef %7, ptr noundef %8) local_unnamed_addr #0 {
  %10 = alloca %struct.subterranean_state_t, align 4
  %11 = alloca [16 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %10) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #4
  %12 = icmp ult i64 %4, 16
  br i1 %12, label %86, label %13

13:                                               ; preds = %9
  %14 = add i64 %4, -16
  store i64 %14, ptr %1, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(36) %10, i8 0, i64 36, i1 false)
  call void @subterranean_absorb(ptr noundef nonnull %10, ptr noundef %8, i64 noundef 16) #4
  call void @subterranean_absorb(ptr noundef nonnull %10, ptr noundef %7, i64 noundef 16) #4
  call void @subterranean_blank(ptr noundef nonnull %10) #4
  call void @subterranean_absorb(ptr noundef nonnull %10, ptr noundef %5, i64 noundef %6) #4
  %15 = icmp ugt i64 %14, 3
  br i1 %15, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %13
  %16 = getelementptr inbounds i8, ptr %10, i64 32
  br label %17

17:                                               ; preds = %.lr.ph, %17
  %.05460 = phi ptr [ %0, %.lr.ph ], [ %34, %17 ]
  %.05559 = phi ptr [ %3, %.lr.ph ], [ %33, %17 ]
  %.05658 = phi i64 [ %14, %.lr.ph ], [ %35, %17 ]
  %18 = load i32, ptr %.05559, align 1
  %19 = call i32 @subterranean_extract(ptr noundef nonnull %10) #4
  %20 = xor i32 %19, %18
  call void @subterranean_round(ptr noundef nonnull %10) #4
  call void @subterranean_absorb_word(ptr noundef nonnull %10, i32 noundef %20) #4
  %21 = load i32, ptr %16, align 4, !tbaa !9
  %22 = xor i32 %21, 1
  store i32 %22, ptr %16, align 4, !tbaa !9
  %23 = trunc i32 %20 to i8
  store i8 %23, ptr %.05460, align 1, !tbaa !11
  %24 = lshr i32 %20, 8
  %25 = trunc i32 %24 to i8
  %26 = getelementptr inbounds i8, ptr %.05460, i64 1
  store i8 %25, ptr %26, align 1, !tbaa !11
  %27 = lshr i32 %20, 16
  %28 = trunc i32 %27 to i8
  %29 = getelementptr inbounds i8, ptr %.05460, i64 2
  store i8 %28, ptr %29, align 1, !tbaa !11
  %30 = lshr i32 %20, 24
  %31 = trunc nuw i32 %30 to i8
  %32 = getelementptr inbounds i8, ptr %.05460, i64 3
  store i8 %31, ptr %32, align 1, !tbaa !11
  %33 = getelementptr inbounds i8, ptr %.05559, i64 4
  %34 = getelementptr inbounds i8, ptr %.05460, i64 4
  %35 = add i64 %.05658, -4
  %36 = icmp ugt i64 %35, 3
  br i1 %36, label %17, label %._crit_edge, !llvm.loop !12

._crit_edge:                                      ; preds = %17, %13
  %.056.lcssa = phi i64 [ %14, %13 ], [ %35, %17 ]
  %.055.lcssa = phi ptr [ %3, %13 ], [ %33, %17 ]
  %.054.lcssa = phi ptr [ %0, %13 ], [ %34, %17 ]
  %37 = trunc nuw i64 %.056.lcssa to i32
  switch i32 %37, label %._crit_edge.unreachabledefault [
    i32 1, label %41
    i32 2, label %47
    i32 3, label %63
    i32 0, label %38
  ]

._crit_edge.unreachabledefault:                   ; preds = %._crit_edge
  unreachable

38:                                               ; preds = %._crit_edge
  call void @subterranean_round(ptr noundef nonnull %10) #4
  %39 = load i32, ptr %10, align 4, !tbaa !9
  %40 = xor i32 %39, 2
  store i32 %40, ptr %10, align 4, !tbaa !9
  br label %82

41:                                               ; preds = %._crit_edge
  %42 = call i32 @subterranean_extract(ptr noundef nonnull %10) #4
  %43 = load i8, ptr %.055.lcssa, align 1, !tbaa !11
  %44 = trunc i32 %42 to i8
  %45 = xor i8 %43, %44
  store i8 %45, ptr %.054.lcssa, align 1, !tbaa !11
  call void @subterranean_round(ptr noundef nonnull %10) #4
  %46 = load i8, ptr %.054.lcssa, align 1, !tbaa !11
  call void @subterranean_absorb_1(ptr noundef nonnull %10, i8 noundef zeroext %46) #4
  br label %82

47:                                               ; preds = %._crit_edge
  %48 = call i32 @subterranean_extract(ptr noundef nonnull %10) #4
  %49 = load i8, ptr %.055.lcssa, align 1, !tbaa !11
  %50 = zext i8 %49 to i32
  %51 = xor i32 %48, %50
  %52 = getelementptr inbounds i8, ptr %.055.lcssa, i64 1
  %53 = load i8, ptr %52, align 1, !tbaa !11
  %54 = zext i8 %53 to i32
  %55 = shl nuw nsw i32 %54, 8
  %56 = xor i32 %55, %51
  %57 = trunc i32 %51 to i8
  store i8 %57, ptr %.054.lcssa, align 1, !tbaa !11
  %58 = lshr i32 %56, 8
  %59 = trunc i32 %58 to i8
  %60 = getelementptr inbounds i8, ptr %.054.lcssa, i64 1
  store i8 %59, ptr %60, align 1, !tbaa !11
  call void @subterranean_round(ptr noundef nonnull %10) #4
  %61 = and i32 %56, 65535
  %62 = or disjoint i32 %61, 65536
  call void @subterranean_absorb_word(ptr noundef nonnull %10, i32 noundef %62) #4
  br label %82

63:                                               ; preds = %._crit_edge
  %64 = call i32 @subterranean_extract(ptr noundef nonnull %10) #4
  %65 = load i8, ptr %.055.lcssa, align 1, !tbaa !11
  %66 = zext i8 %65 to i32
  %67 = xor i32 %64, %66
  %68 = getelementptr inbounds i8, ptr %.055.lcssa, i64 1
  %69 = load i16, ptr %68, align 1
  %70 = zext i16 %69 to i32
  %71 = shl nuw nsw i32 %70, 8
  %72 = xor i32 %71, %67
  %73 = trunc i32 %67 to i8
  store i8 %73, ptr %.054.lcssa, align 1, !tbaa !11
  %74 = lshr i32 %72, 8
  %75 = trunc i32 %74 to i8
  %76 = getelementptr inbounds i8, ptr %.054.lcssa, i64 1
  store i8 %75, ptr %76, align 1, !tbaa !11
  %77 = lshr i32 %72, 16
  %78 = trunc i32 %77 to i8
  %79 = getelementptr inbounds i8, ptr %.054.lcssa, i64 2
  store i8 %78, ptr %79, align 1, !tbaa !11
  call void @subterranean_round(ptr noundef nonnull %10) #4
  %80 = and i32 %72, 16777215
  %81 = or disjoint i32 %80, 16777216
  call void @subterranean_absorb_word(ptr noundef nonnull %10, i32 noundef %81) #4
  br label %82

82:                                               ; preds = %63, %47, %41, %38
  call void @subterranean_blank(ptr noundef nonnull %10) #4
  call void @subterranean_squeeze(ptr noundef nonnull %10, ptr noundef nonnull %11, i32 noundef 16) #4
  %83 = load i64, ptr %1, align 8, !tbaa !5
  %84 = getelementptr inbounds i8, ptr %.055.lcssa, i64 %.056.lcssa
  %85 = call i32 @aead_check_tag(ptr noundef %0, i64 noundef %83, ptr noundef nonnull %11, ptr noundef %84, i32 noundef 16) #4
  br label %86

86:                                               ; preds = %9, %82
  %.0 = phi i32 [ %85, %82 ], [ -1, %9 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %10) #4
  ret i32 %.0
}

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

declare void @subterranean_absorb(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #3

declare void @subterranean_blank(ptr noundef) local_unnamed_addr #3

declare i32 @subterranean_extract(ptr noundef) local_unnamed_addr #3

declare void @subterranean_round(ptr noundef) local_unnamed_addr #3

declare void @subterranean_absorb_word(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

declare void @subterranean_squeeze(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

declare void @subterranean_absorb_1(ptr noundef, i8 noundef zeroext) local_unnamed_addr #3

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

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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { "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 = { 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 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}


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