; LLVM IR from specinfo-ua/UAPKI :: library/uapkic/src (gost34311)

; 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.Gost34311Ctx_st = type { ptr, [32 x i8], i64, [8 x i32], [32 x i8], [8 x i32], [32 x i8] }

@.str = external hidden unnamed_addr constant [19 x i8], align 1

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

declare void @stacktrace_create(ptr noundef, i64 noundef, i32 noundef, ptr noundef) #1

declare void @stacktrace_add(ptr noundef, i64 noundef, i32 noundef) #1

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @reset(ptr noundef) #3

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

; Function Attrs: nounwind uwtable
define dso_local i32 @gost34311_final(ptr noundef %0, ptr noundef %1) #4 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca [8 x i32], align 16
  %6 = alloca i32, align 4
  %7 = alloca [32 x i8], align 16
  %8 = alloca [32 x i8], align 16
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %11

11:                                               ; preds = %2
  %12 = load ptr, ptr %3, align 8, !tbaa !5
  %13 = icmp ne ptr %12, null
  br i1 %13, label %16, label %14

14:                                               ; preds = %11
  store i32 2, ptr %10, align 4, !tbaa !9
  %15 = load i32, ptr %10, align 4, !tbaa !9
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 385, i32 noundef %15, ptr noundef null)
  br label %168

16:                                               ; preds = %11
  br label %17

17:                                               ; preds = %16
  br label %18

18:                                               ; preds = %17
  br label %19

19:                                               ; preds = %18
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = icmp ne ptr %20, null
  br i1 %21, label %24, label %22

22:                                               ; preds = %19
  store i32 2, ptr %10, align 4, !tbaa !9
  %23 = load i32, ptr %10, align 4, !tbaa !9
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 386, i32 noundef %23, ptr noundef null)
  br label %168

24:                                               ; preds = %19
  br label %25

25:                                               ; preds = %24
  br label %26

26:                                               ; preds = %25
  %27 = load ptr, ptr %3, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.Gost34311Ctx_st, ptr %27, i32 0, i32 2
  %29 = load i64, ptr %28, align 8, !tbaa !11
  %30 = shl i64 %29, 3
  %31 = trunc i64 %30 to i32
  store i32 %31, ptr %6, align 4, !tbaa !9
  %32 = load i32, ptr %6, align 4, !tbaa !9
  %33 = load ptr, ptr %3, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.Gost34311Ctx_st, ptr %33, i32 0, i32 3
  %35 = getelementptr inbounds [8 x i32], ptr %34, i64 0, i64 0
  %36 = load i32, ptr %35, align 8, !tbaa !9
  %37 = add i32 %36, %32
  store i32 %37, ptr %35, align 8, !tbaa !9
  %38 = load ptr, ptr %3, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.Gost34311Ctx_st, ptr %38, i32 0, i32 3
  %40 = getelementptr inbounds [8 x i32], ptr %39, i64 0, i64 0
  %41 = load i32, ptr %40, align 8, !tbaa !9
  %42 = load i32, ptr %6, align 4, !tbaa !9
  %43 = icmp ult i32 %41, %42
  br i1 %43, label %44, label %64

44:                                               ; preds = %26
  store i32 1, ptr %9, align 4, !tbaa !9
  br label %45

45:                                               ; preds = %60, %44
  %46 = load i32, ptr %9, align 4, !tbaa !9
  %47 = icmp slt i32 %46, 8
  br i1 %47, label %48, label %57

48:                                               ; preds = %45
  %49 = load ptr, ptr %3, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.Gost34311Ctx_st, ptr %49, i32 0, i32 3
  %51 = load i32, ptr %9, align 4, !tbaa !9
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [8 x i32], ptr %50, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !9
  %55 = add i32 %54, 1
  store i32 %55, ptr %53, align 4, !tbaa !9
  %56 = icmp eq i32 %55, 0
  br label %57

57:                                               ; preds = %48, %45
  %58 = phi i1 [ false, %45 ], [ %56, %48 ]
  br i1 %58, label %59, label %63

59:                                               ; preds = %57
  br label %60

60:                                               ; preds = %59
  %61 = load i32, ptr %9, align 4, !tbaa !9
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %9, align 4, !tbaa !9
  br label %45, !llvm.loop !14

63:                                               ; preds = %57
  br label %64

64:                                               ; preds = %63, %26
  %65 = load ptr, ptr %3, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.Gost34311Ctx_st, ptr %65, i32 0, i32 1
  %67 = getelementptr inbounds [32 x i8], ptr %66, i64 0, i64 0
  %68 = load ptr, ptr %3, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.Gost34311Ctx_st, ptr %68, i32 0, i32 2
  %70 = load i64, ptr %69, align 8, !tbaa !11
  %71 = getelementptr inbounds i8, ptr %67, i64 %70
  %72 = load ptr, ptr %3, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.Gost34311Ctx_st, ptr %72, i32 0, i32 2
  %74 = load i64, ptr %73, align 8, !tbaa !11
  %75 = sub i64 32, %74
  call void @llvm.memset.p0.i64(ptr align 1 %71, i8 0, i64 %75, i1 false)
  br label %76

76:                                               ; preds = %64
  %77 = load ptr, ptr %3, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.Gost34311Ctx_st, ptr %77, i32 0, i32 1
  %79 = getelementptr inbounds [32 x i8], ptr %78, i64 0, i64 0
  %80 = getelementptr inbounds [8 x i32], ptr %5, i64 0, i64 0
  %81 = call i32 @uint8_to_uint32(ptr noundef %79, i64 noundef 32, ptr noundef %80, i64 noundef 8)
  store i32 %81, ptr %10, align 4, !tbaa !9
  %82 = load i32, ptr %10, align 4, !tbaa !9
  %83 = icmp ne i32 %82, 0
  br i1 %83, label %84, label %86

84:                                               ; preds = %76
  %85 = load i32, ptr %10, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 398, i32 noundef %85)
  br label %168

86:                                               ; preds = %76
  br label %87

87:                                               ; preds = %86
  br label %88

88:                                               ; preds = %87
  %89 = load ptr, ptr %3, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.Gost34311Ctx_st, ptr %89, i32 0, i32 5
  %91 = getelementptr inbounds [8 x i32], ptr %90, i64 0, i64 0
  %92 = getelementptr inbounds [8 x i32], ptr %5, i64 0, i64 0
  call void @add(ptr noundef %91, ptr noundef %92)
  %93 = getelementptr inbounds [8 x i32], ptr %5, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %93, i8 0, i64 32, i1 false)
  br label %94

94:                                               ; preds = %88
  %95 = load ptr, ptr %3, align 8, !tbaa !5
  %96 = load ptr, ptr %3, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.Gost34311Ctx_st, ptr %96, i32 0, i32 1
  %98 = getelementptr inbounds [32 x i8], ptr %97, i64 0, i64 0
  %99 = call i32 @hash_step(ptr noundef %95, ptr noundef %98)
  store i32 %99, ptr %10, align 4, !tbaa !9
  %100 = load i32, ptr %10, align 4, !tbaa !9
  %101 = icmp ne i32 %100, 0
  br i1 %101, label %102, label %104

102:                                              ; preds = %94
  %103 = load i32, ptr %10, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 402, i32 noundef %103)
  br label %168

104:                                              ; preds = %94
  br label %105

105:                                              ; preds = %104
  br label %106

106:                                              ; preds = %105
  br label %107

107:                                              ; preds = %106
  %108 = load ptr, ptr %3, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.Gost34311Ctx_st, ptr %108, i32 0, i32 3
  %110 = getelementptr inbounds [8 x i32], ptr %109, i64 0, i64 0
  %111 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 0
  %112 = call i32 @uint32_to_uint8(ptr noundef %110, i64 noundef 8, ptr noundef %111, i64 noundef 32)
  store i32 %112, ptr %10, align 4, !tbaa !9
  %113 = load i32, ptr %10, align 4, !tbaa !9
  %114 = icmp ne i32 %113, 0
  br i1 %114, label %115, label %117

115:                                              ; preds = %107
  %116 = load i32, ptr %10, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 404, i32 noundef %116)
  br label %168

117:                                              ; preds = %107
  br label %118

118:                                              ; preds = %117
  br label %119

119:                                              ; preds = %118
  br label %120

120:                                              ; preds = %119
  %121 = load ptr, ptr %3, align 8, !tbaa !5
  %122 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 0
  %123 = call i32 @hash_step(ptr noundef %121, ptr noundef %122)
  store i32 %123, ptr %10, align 4, !tbaa !9
  %124 = load i32, ptr %10, align 4, !tbaa !9
  %125 = icmp ne i32 %124, 0
  br i1 %125, label %126, label %128

126:                                              ; preds = %120
  %127 = load i32, ptr %10, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 405, i32 noundef %127)
  br label %168

128:                                              ; preds = %120
  br label %129

129:                                              ; preds = %128
  br label %130

130:                                              ; preds = %129
  br label %131

131:                                              ; preds = %130
  %132 = load ptr, ptr %3, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.Gost34311Ctx_st, ptr %132, i32 0, i32 5
  %134 = getelementptr inbounds [8 x i32], ptr %133, i64 0, i64 0
  %135 = getelementptr inbounds [32 x i8], ptr %8, i64 0, i64 0
  %136 = call i32 @uint32_to_uint8(ptr noundef %134, i64 noundef 8, ptr noundef %135, i64 noundef 32)
  store i32 %136, ptr %10, align 4, !tbaa !9
  %137 = load i32, ptr %10, align 4, !tbaa !9
  %138 = icmp ne i32 %137, 0
  br i1 %138, label %139, label %141

139:                                              ; preds = %131
  %140 = load i32, ptr %10, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 408, i32 noundef %140)
  br label %168

141:                                              ; preds = %131
  br label %142

142:                                              ; preds = %141
  br label %143

143:                                              ; preds = %142
  br label %144

144:                                              ; preds = %143
  %145 = load ptr, ptr %3, align 8, !tbaa !5
  %146 = getelementptr inbounds [32 x i8], ptr %8, i64 0, i64 0
  %147 = call i32 @hash_step(ptr noundef %145, ptr noundef %146)
  store i32 %147, ptr %10, align 4, !tbaa !9
  %148 = load i32, ptr %10, align 4, !tbaa !9
  %149 = icmp ne i32 %148, 0
  br i1 %149, label %150, label %152

150:                                              ; preds = %144
  %151 = load i32, ptr %10, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 409, i32 noundef %151)
  br label %168

152:                                              ; preds = %144
  br label %153

153:                                              ; preds = %152
  br label %154

154:                                              ; preds = %153
  br label %155

155:                                              ; preds = %154
  %156 = load ptr, ptr %3, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.Gost34311Ctx_st, ptr %156, i32 0, i32 6
  %158 = getelementptr inbounds [32 x i8], ptr %157, i64 0, i64 0
  %159 = call ptr @ba_alloc_from_uint8(ptr noundef %158, i64 noundef 32)
  %160 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %159, ptr %160, align 8, !tbaa !5
  %161 = icmp eq ptr null, %159
  br i1 %161, label %162, label %164

162:                                              ; preds = %155
  store i32 2, ptr %10, align 4, !tbaa !9
  %163 = load i32, ptr %10, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 411, i32 noundef %163)
  br label %168

164:                                              ; preds = %155
  br label %165

165:                                              ; preds = %164
  br label %166

166:                                              ; preds = %165
  %167 = load ptr, ptr %3, align 8, !tbaa !5
  call void @reset(ptr noundef %167)
  br label %168

168:                                              ; preds = %166, %162, %150, %139, %126, %115, %102, %84, %22, %14
  %169 = load i32, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #5
  ret i32 %169
}

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

; Function Attrs: nounwind uwtable
declare hidden void @add(ptr noundef, ptr noundef) #4

; Function Attrs: nounwind uwtable
declare hidden i32 @hash_step(ptr noundef, ptr noundef) #4

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

declare ptr @ba_alloc_from_uint8(ptr noundef, i64 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { inlinehint 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 = { 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 #5 = { 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, !13, i64 40}
!12 = !{!"Gost34311Ctx_st", !6, i64 0, !7, i64 8, !13, i64 40, !7, i64 48, !7, i64 80, !7, i64 112, !7, i64 144}
!13 = !{!"long", !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"

@.str = external hidden unnamed_addr constant [19 x i8], align 1

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

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

declare void @stacktrace_add(ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @reset(ptr 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) #0

; Function Attrs: nounwind uwtable
define dso_local i32 @gost34311_final(ptr noundef %0, ptr noundef writeonly %1) local_unnamed_addr #4 {
  %3 = alloca [8 x i32], align 16
  %4 = alloca [32 x i8], align 16
  %5 = alloca [32 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #5
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %6, label %7

6:                                                ; preds = %2
  tail call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 385, i32 noundef 2, ptr noundef null) #5
  br label %71

7:                                                ; preds = %2
  %.not49 = icmp eq ptr %1, null
  br i1 %.not49, label %8, label %9

8:                                                ; preds = %7
  tail call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 386, i32 noundef 2, ptr noundef null) #5
  br label %71

9:                                                ; preds = %7
  %10 = getelementptr inbounds i8, ptr %0, i64 40
  %11 = load i64, ptr %10, align 8, !tbaa !5
  %.tr = trunc i64 %11 to i32
  %12 = shl i32 %.tr, 3
  %13 = getelementptr inbounds i8, ptr %0, i64 48
  %14 = load i32, ptr %13, align 8, !tbaa !11
  %15 = add i32 %12, %14
  store i32 %15, ptr %13, align 8, !tbaa !11
  %16 = icmp ult i32 %15, %12
  br i1 %16, label %.preheader.preheader, label %.critedge

.preheader.preheader:                             ; preds = %9
  %17 = getelementptr inbounds i8, ptr %0, i64 52
  %18 = load i32, ptr %17, align 4, !tbaa !11
  %19 = add i32 %18, 1
  store i32 %19, ptr %17, align 4, !tbaa !11
  %20 = icmp eq i32 %19, 0
  br i1 %20, label %.preheader.1, label %.critedge

.preheader.1:                                     ; preds = %.preheader.preheader
  %21 = getelementptr inbounds i8, ptr %0, i64 56
  %22 = load i32, ptr %21, align 4, !tbaa !11
  %23 = add i32 %22, 1
  store i32 %23, ptr %21, align 4, !tbaa !11
  %24 = icmp eq i32 %23, 0
  br i1 %24, label %.preheader.2, label %.critedge

.preheader.2:                                     ; preds = %.preheader.1
  %25 = getelementptr inbounds i8, ptr %0, i64 60
  %26 = load i32, ptr %25, align 4, !tbaa !11
  %27 = add i32 %26, 1
  store i32 %27, ptr %25, align 4, !tbaa !11
  %28 = icmp eq i32 %27, 0
  br i1 %28, label %.preheader.3, label %.critedge

.preheader.3:                                     ; preds = %.preheader.2
  %29 = getelementptr inbounds i8, ptr %0, i64 64
  %30 = load i32, ptr %29, align 4, !tbaa !11
  %31 = add i32 %30, 1
  store i32 %31, ptr %29, align 4, !tbaa !11
  %32 = icmp eq i32 %31, 0
  br i1 %32, label %.preheader.4, label %.critedge

.preheader.4:                                     ; preds = %.preheader.3
  %33 = getelementptr inbounds i8, ptr %0, i64 68
  %34 = load i32, ptr %33, align 4, !tbaa !11
  %35 = add i32 %34, 1
  store i32 %35, ptr %33, align 4, !tbaa !11
  %36 = icmp eq i32 %35, 0
  br i1 %36, label %.preheader.5, label %.critedge

.preheader.5:                                     ; preds = %.preheader.4
  %37 = getelementptr inbounds i8, ptr %0, i64 72
  %38 = load i32, ptr %37, align 4, !tbaa !11
  %39 = add i32 %38, 1
  store i32 %39, ptr %37, align 4, !tbaa !11
  %40 = icmp eq i32 %39, 0
  br i1 %40, label %.preheader.6, label %.critedge

.preheader.6:                                     ; preds = %.preheader.5
  %41 = getelementptr inbounds i8, ptr %0, i64 76
  %42 = load i32, ptr %41, align 4, !tbaa !11
  %43 = add i32 %42, 1
  store i32 %43, ptr %41, align 4, !tbaa !11
  br label %.critedge

.critedge:                                        ; preds = %.preheader.6, %.preheader.preheader, %.preheader.1, %.preheader.2, %.preheader.3, %.preheader.4, %.preheader.5, %9
  %44 = getelementptr inbounds i8, ptr %0, i64 8
  %45 = getelementptr inbounds i8, ptr %44, i64 %11
  %46 = sub i64 32, %11
  tail call void @llvm.memset.p0.i64(ptr nonnull align 1 %45, i8 0, i64 %46, i1 false)
  %47 = call i32 @uint8_to_uint32(ptr noundef nonnull %44, i64 noundef 32, ptr noundef nonnull %3, i64 noundef 8) #5
  %.not50 = icmp eq i32 %47, 0
  br i1 %.not50, label %49, label %48

48:                                               ; preds = %.critedge
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 398, i32 noundef %47) #5
  br label %71

49:                                               ; preds = %.critedge
  %50 = getelementptr inbounds i8, ptr %0, i64 112
  call void @add(ptr noundef nonnull %50, ptr noundef nonnull %3)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %3, i8 0, i64 32, i1 false)
  %51 = call i32 @hash_step(ptr noundef nonnull %0, ptr noundef nonnull %44)
  %.not51 = icmp eq i32 %51, 0
  br i1 %.not51, label %53, label %52

52:                                               ; preds = %49
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 402, i32 noundef %51) #5
  br label %71

53:                                               ; preds = %49
  %54 = call i32 @uint32_to_uint8(ptr noundef nonnull %13, i64 noundef 8, ptr noundef nonnull %4, i64 noundef 32) #5
  %.not52 = icmp eq i32 %54, 0
  br i1 %.not52, label %56, label %55

55:                                               ; preds = %53
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 404, i32 noundef %54) #5
  br label %71

56:                                               ; preds = %53
  %57 = call i32 @hash_step(ptr noundef nonnull %0, ptr noundef nonnull %4)
  %.not53 = icmp eq i32 %57, 0
  br i1 %.not53, label %59, label %58

58:                                               ; preds = %56
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 405, i32 noundef %57) #5
  br label %71

59:                                               ; preds = %56
  %60 = call i32 @uint32_to_uint8(ptr noundef nonnull %50, i64 noundef 8, ptr noundef nonnull %5, i64 noundef 32) #5
  %.not54 = icmp eq i32 %60, 0
  br i1 %.not54, label %62, label %61

61:                                               ; preds = %59
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 408, i32 noundef %60) #5
  br label %71

62:                                               ; preds = %59
  %63 = call i32 @hash_step(ptr noundef nonnull %0, ptr noundef nonnull %5)
  %.not55 = icmp eq i32 %63, 0
  br i1 %.not55, label %65, label %64

64:                                               ; preds = %62
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 409, i32 noundef %63) #5
  br label %71

65:                                               ; preds = %62
  %66 = getelementptr inbounds i8, ptr %0, i64 144
  %67 = call ptr @ba_alloc_from_uint8(ptr noundef nonnull %66, i64 noundef 32) #5
  store ptr %67, ptr %1, align 8, !tbaa !13
  %68 = icmp eq ptr %67, null
  br i1 %68, label %69, label %70

69:                                               ; preds = %65
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 411, i32 noundef 2) #5
  br label %71

70:                                               ; preds = %65
  call void @reset(ptr noundef nonnull %0)
  br label %71

71:                                               ; preds = %70, %69, %64, %61, %58, %55, %52, %48, %8, %6
  %.0 = phi i32 [ %47, %48 ], [ %51, %52 ], [ %54, %55 ], [ %57, %58 ], [ %60, %61 ], [ %63, %64 ], [ 2, %69 ], [ 0, %70 ], [ 2, %8 ], [ 2, %6 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #5
  ret i32 %.0
}

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

; Function Attrs: nounwind uwtable
declare hidden void @add(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare hidden i32 @hash_step(ptr noundef, ptr noundef) local_unnamed_addr #4

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

declare ptr @ba_alloc_from_uint8(ptr noundef, i64 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { inlinehint 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 = { 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 #5 = { 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, !10, i64 40}
!6 = !{!"Gost34311Ctx_st", !7, i64 0, !8, i64 8, !10, i64 40, !8, i64 48, !8, i64 80, !8, i64 112, !8, i64 144}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !8, i64 0}
!13 = !{!7, !7, i64 0}


; Effective O3 passes: ADCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass