; LLVM IR from gost-engine/engine :: gost_keyexpimp (gost_kexp15)

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @gost_kexp15(ptr noundef %0, i32 noundef %1, i32 noundef %2, ptr noundef %3, i32 noundef %4, ptr noundef %5, ptr noundef %6, i64 noundef %7, ptr noundef %8, ptr noundef %9) #0 {
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i64, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca [16 x i8], align 16
  %22 = alloca [16 x i8], align 16
  %23 = alloca i32, align 4
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  store ptr %0, ptr %11, align 8, !tbaa !5
  store i32 %1, ptr %12, align 4, !tbaa !9
  store i32 %2, ptr %13, align 4, !tbaa !9
  store ptr %3, ptr %14, align 8, !tbaa !5
  store i32 %4, ptr %15, align 4, !tbaa !9
  store ptr %5, ptr %16, align 8, !tbaa !5
  store ptr %6, ptr %17, align 8, !tbaa !5
  store i64 %7, ptr %18, align 8, !tbaa !11
  store ptr %8, ptr %19, align 8, !tbaa !5
  store ptr %9, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  store ptr null, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  store ptr null, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #5
  store i32 0, ptr %26, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #5
  %28 = load i32, ptr %13, align 4, !tbaa !9
  %29 = icmp eq i32 %28, 1188
  br i1 %29, label %30, label %31

30:                                               ; preds = %10
  br label %36

31:                                               ; preds = %10
  %32 = load i32, ptr %13, align 4, !tbaa !9
  %33 = icmp eq i32 %32, 1013
  %34 = zext i1 %33 to i64
  %35 = select i1 %33, i32 16, i32 0
  br label %36

36:                                               ; preds = %31, %30
  %37 = phi i32 [ 8, %30 ], [ %35, %31 ]
  store i32 %37, ptr %23, align 4, !tbaa !9
  %38 = load i32, ptr %23, align 4, !tbaa !9
  %39 = icmp eq i32 %38, 0
  br i1 %39, label %40, label %41

40:                                               ; preds = %36
  call void @ERR_GOST_error(i32 noundef 143, i32 noundef 134, ptr noundef @.str, i32 noundef 53)
  br label %149

41:                                               ; preds = %36
  %42 = load i32, ptr %12, align 4, !tbaa !9
  %43 = load i32, ptr %23, align 4, !tbaa !9
  %44 = add i32 %42, %43
  %45 = load ptr, ptr %20, align 8, !tbaa !5
  %46 = load i32, ptr %45, align 4, !tbaa !9
  %47 = icmp ugt i32 %44, %46
  br i1 %47, label %48, label %49

48:                                               ; preds = %41
  call void @ERR_GOST_error(i32 noundef 143, i32 noundef 786691, ptr noundef @.str, i32 noundef 58)
  br label %149

49:                                               ; preds = %41
  %50 = getelementptr inbounds [16 x i8], ptr %21, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %50, i8 0, i64 16, i1 false)
  %51 = getelementptr inbounds [16 x i8], ptr %21, i64 0, i64 0
  %52 = load ptr, ptr %17, align 8, !tbaa !5
  %53 = load i64, ptr %18, align 8, !tbaa !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %51, ptr align 1 %52, i64 %53, i1 false)
  %54 = call ptr @EVP_MD_CTX_new()
  store ptr %54, ptr %25, align 8, !tbaa !5
  %55 = load ptr, ptr %25, align 8, !tbaa !5
  %56 = icmp eq ptr %55, null
  br i1 %56, label %57, label %58

57:                                               ; preds = %49
  call void @ERR_GOST_error(i32 noundef 143, i32 noundef 786688, ptr noundef @.str, i32 noundef 68)
  br label %149

58:                                               ; preds = %49
  %59 = load ptr, ptr %25, align 8, !tbaa !5
  %60 = load i32, ptr %15, align 4, !tbaa !9
  %61 = call ptr @OBJ_nid2sn(i32 noundef %60)
  %62 = call ptr @EVP_get_digestbyname(ptr noundef %61)
  %63 = call i32 @EVP_DigestInit_ex(ptr noundef %59, ptr noundef %62, ptr noundef null)
  %64 = icmp sle i32 %63, 0
  br i1 %64, label %95, label %65

65:                                               ; preds = %58
  %66 = load ptr, ptr %25, align 8, !tbaa !5
  %67 = load ptr, ptr %16, align 8, !tbaa !5
  %68 = call i32 @omac_imit_ctrl(ptr noundef %66, i32 noundef 4100, i32 noundef 32, ptr noundef %67)
  %69 = icmp sle i32 %68, 0
  br i1 %69, label %95, label %70

70:                                               ; preds = %65
  %71 = load ptr, ptr %25, align 8, !tbaa !5
  %72 = load i32, ptr %23, align 4, !tbaa !9
  %73 = call i32 @omac_imit_ctrl(ptr noundef %71, i32 noundef 3, i32 noundef %72, ptr noundef null)
  %74 = icmp sle i32 %73, 0
  br i1 %74, label %95, label %75

75:                                               ; preds = %70
  %76 = load ptr, ptr %25, align 8, !tbaa !5
  %77 = load ptr, ptr %17, align 8, !tbaa !5
  %78 = load i64, ptr %18, align 8, !tbaa !11
  %79 = call i32 @EVP_DigestUpdate(ptr noundef %76, ptr noundef %77, i64 noundef %78)
  %80 = icmp sle i32 %79, 0
  br i1 %80, label %95, label %81

81:                                               ; preds = %75
  %82 = load ptr, ptr %25, align 8, !tbaa !5
  %83 = load ptr, ptr %11, align 8, !tbaa !5
  %84 = load i32, ptr %12, align 4, !tbaa !9
  %85 = sext i32 %84 to i64
  %86 = call i32 @EVP_DigestUpdate(ptr noundef %82, ptr noundef %83, i64 noundef %85)
  %87 = icmp sle i32 %86, 0
  br i1 %87, label %95, label %88

88:                                               ; preds = %81
  %89 = load ptr, ptr %25, align 8, !tbaa !5
  %90 = getelementptr inbounds [16 x i8], ptr %22, i64 0, i64 0
  %91 = load i32, ptr %23, align 4, !tbaa !9
  %92 = zext i32 %91 to i64
  %93 = call i32 @EVP_DigestFinalXOF(ptr noundef %89, ptr noundef %90, i64 noundef %92)
  %94 = icmp sle i32 %93, 0
  br i1 %94, label %95, label %96

95:                                               ; preds = %88, %81, %75, %70, %65, %58
  call void @ERR_GOST_error(i32 noundef 143, i32 noundef 786691, ptr noundef @.str, i32 noundef 79)
  br label %149

96:                                               ; preds = %88
  %97 = call ptr @EVP_CIPHER_CTX_new()
  store ptr %97, ptr %24, align 8, !tbaa !5
  %98 = load ptr, ptr %24, align 8, !tbaa !5
  %99 = icmp eq ptr %98, null
  br i1 %99, label %100, label %101

100:                                              ; preds = %96
  call void @ERR_GOST_error(i32 noundef 143, i32 noundef 786688, ptr noundef @.str, i32 noundef 85)
  br label %149

101:                                              ; preds = %96
  %102 = load ptr, ptr %24, align 8, !tbaa !5
  %103 = load i32, ptr %13, align 4, !tbaa !9
  %104 = call ptr @OBJ_nid2sn(i32 noundef %103)
  %105 = call ptr @EVP_get_cipherbyname(ptr noundef %104)
  %106 = call i32 @EVP_CipherInit_ex(ptr noundef %102, ptr noundef %105, ptr noundef null, ptr noundef null, ptr noundef null, i32 noundef 1)
  %107 = icmp sle i32 %106, 0
  br i1 %107, label %143, label %108

108:                                              ; preds = %101
  %109 = load ptr, ptr %24, align 8, !tbaa !5
  %110 = load ptr, ptr %14, align 8, !tbaa !5
  %111 = getelementptr inbounds [16 x i8], ptr %21, i64 0, i64 0
  %112 = call i32 @EVP_CipherInit_ex(ptr noundef %109, ptr noundef null, ptr noundef null, ptr noundef %110, ptr noundef %111, i32 noundef 1)
  %113 = icmp sle i32 %112, 0
  br i1 %113, label %143, label %114

114:                                              ; preds = %108
  %115 = load ptr, ptr %24, align 8, !tbaa !5
  %116 = load ptr, ptr %19, align 8, !tbaa !5
  %117 = load ptr, ptr %11, align 8, !tbaa !5
  %118 = load i32, ptr %12, align 4, !tbaa !9
  %119 = call i32 @EVP_CipherUpdate(ptr noundef %115, ptr noundef %116, ptr noundef %27, ptr noundef %117, i32 noundef %118)
  %120 = icmp sle i32 %119, 0
  br i1 %120, label %143, label %121

121:                                              ; preds = %114
  %122 = load ptr, ptr %24, align 8, !tbaa !5
  %123 = load ptr, ptr %19, align 8, !tbaa !5
  %124 = load i32, ptr %12, align 4, !tbaa !9
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds i8, ptr %123, i64 %125
  %127 = getelementptr inbounds [16 x i8], ptr %22, i64 0, i64 0
  %128 = load i32, ptr %23, align 4, !tbaa !9
  %129 = call i32 @EVP_CipherUpdate(ptr noundef %122, ptr noundef %126, ptr noundef %27, ptr noundef %127, i32 noundef %128)
  %130 = icmp sle i32 %129, 0
  br i1 %130, label %143, label %131

131:                                              ; preds = %121
  %132 = load ptr, ptr %24, align 8, !tbaa !5
  %133 = load ptr, ptr %19, align 8, !tbaa !5
  %134 = load i32, ptr %12, align 4, !tbaa !9
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds i8, ptr %133, i64 %135
  %137 = load i32, ptr %27, align 4, !tbaa !9
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds i8, ptr %136, i64 %138
  %140 = load ptr, ptr %20, align 8, !tbaa !5
  %141 = call i32 @EVP_CipherFinal_ex(ptr noundef %132, ptr noundef %139, ptr noundef %140)
  %142 = icmp sle i32 %141, 0
  br i1 %142, label %143, label %144

143:                                              ; preds = %131, %121, %114, %108, %101
  call void @ERR_GOST_error(i32 noundef 143, i32 noundef 786691, ptr noundef @.str, i32 noundef 95)
  br label %149

144:                                              ; preds = %131
  %145 = load i32, ptr %12, align 4, !tbaa !9
  %146 = load i32, ptr %23, align 4, !tbaa !9
  %147 = add i32 %145, %146
  %148 = load ptr, ptr %20, align 8, !tbaa !5
  store i32 %147, ptr %148, align 4, !tbaa !9
  store i32 1, ptr %26, align 4, !tbaa !9
  br label %149

149:                                              ; preds = %144, %143, %100, %95, %57, %48, %40
  %150 = getelementptr inbounds [16 x i8], ptr %22, i64 0, i64 0
  %151 = load i32, ptr %23, align 4, !tbaa !9
  %152 = zext i32 %151 to i64
  call void @OPENSSL_cleanse(ptr noundef %150, i64 noundef %152)
  %153 = load ptr, ptr %25, align 8, !tbaa !5
  call void @EVP_MD_CTX_free(ptr noundef %153)
  %154 = load ptr, ptr %24, align 8, !tbaa !5
  call void @EVP_CIPHER_CTX_free(ptr noundef %154)
  %155 = load i32, ptr %26, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #5
  ret i32 %155
}

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

declare ptr @EVP_MD_CTX_new() #2

declare i32 @EVP_DigestInit_ex(ptr noundef, ptr noundef, ptr noundef) #2

declare ptr @EVP_get_digestbyname(ptr noundef) #2

declare ptr @OBJ_nid2sn(i32 noundef) #2

declare i32 @omac_imit_ctrl(ptr noundef, i32 noundef, i32 noundef, ptr noundef) #2

declare i32 @EVP_DigestUpdate(ptr noundef, ptr noundef, i64 noundef) #2

declare i32 @EVP_DigestFinalXOF(ptr noundef, ptr noundef, i64 noundef) #2

declare ptr @EVP_CIPHER_CTX_new() #2

declare i32 @EVP_CipherInit_ex(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) #2

declare ptr @EVP_get_cipherbyname(ptr noundef) #2

declare i32 @EVP_CipherUpdate(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) #2

declare i32 @EVP_CipherFinal_ex(ptr noundef, ptr noundef, ptr noundef) #2

declare void @OPENSSL_cleanse(ptr noundef, i64 noundef) #2

declare void @EVP_MD_CTX_free(ptr noundef) #2

declare void @EVP_CIPHER_CTX_free(ptr noundef) #2

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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, !12, i64 0}
!12 = !{!"long", !7, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @gost_kexp15(ptr noundef %0, i32 noundef %1, i32 noundef %2, ptr noundef %3, i32 noundef %4, ptr noundef %5, ptr noundef %6, i64 noundef %7, ptr noundef %8, ptr noundef %9) local_unnamed_addr #0 {
  %11 = alloca [16 x i8], align 16
  %12 = alloca [16 x i8], align 16
  %13 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #5
  %14 = icmp eq i32 %2, 1188
  %15 = icmp eq i32 %2, 1013
  %16 = select i1 %15, i32 16, i32 0
  %17 = select i1 %14, i32 8, i32 %16
  %18 = icmp eq i32 %17, 0
  br i1 %18, label %19, label %20

19:                                               ; preds = %10
  tail call void @ERR_GOST_error(i32 noundef 143, i32 noundef 134, ptr noundef nonnull @.str, i32 noundef 53) #5
  br label %79

20:                                               ; preds = %10
  %21 = add i32 %17, %1
  %22 = load i32, ptr %9, align 4, !tbaa !5
  %23 = icmp ugt i32 %21, %22
  br i1 %23, label %24, label %25

24:                                               ; preds = %20
  tail call void @ERR_GOST_error(i32 noundef 143, i32 noundef 786691, ptr noundef nonnull @.str, i32 noundef 58) #5
  br label %79

25:                                               ; preds = %20
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %11, i8 0, i64 16, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %11, ptr align 1 %6, i64 %7, i1 false)
  %26 = tail call ptr @EVP_MD_CTX_new() #5
  %27 = icmp eq ptr %26, null
  br i1 %27, label %28, label %29

28:                                               ; preds = %25
  tail call void @ERR_GOST_error(i32 noundef 143, i32 noundef 786688, ptr noundef nonnull @.str, i32 noundef 68) #5
  br label %79

29:                                               ; preds = %25
  %30 = tail call ptr @OBJ_nid2sn(i32 noundef %4) #5
  %31 = tail call ptr @EVP_get_digestbyname(ptr noundef %30) #5
  %32 = tail call i32 @EVP_DigestInit_ex(ptr noundef nonnull %26, ptr noundef %31, ptr noundef null) #5
  %33 = icmp slt i32 %32, 1
  br i1 %33, label %51, label %34

34:                                               ; preds = %29
  %35 = tail call i32 @omac_imit_ctrl(ptr noundef nonnull %26, i32 noundef 4100, i32 noundef 32, ptr noundef %5) #5
  %36 = icmp slt i32 %35, 1
  br i1 %36, label %51, label %37

37:                                               ; preds = %34
  %38 = tail call i32 @omac_imit_ctrl(ptr noundef nonnull %26, i32 noundef 3, i32 noundef %17, ptr noundef null) #5
  %39 = icmp slt i32 %38, 1
  br i1 %39, label %51, label %40

40:                                               ; preds = %37
  %41 = tail call i32 @EVP_DigestUpdate(ptr noundef nonnull %26, ptr noundef %6, i64 noundef %7) #5
  %42 = icmp slt i32 %41, 1
  br i1 %42, label %51, label %43

43:                                               ; preds = %40
  %44 = sext i32 %1 to i64
  %45 = tail call i32 @EVP_DigestUpdate(ptr noundef nonnull %26, ptr noundef %0, i64 noundef %44) #5
  %46 = icmp slt i32 %45, 1
  br i1 %46, label %51, label %47

47:                                               ; preds = %43
  %48 = zext nneg i32 %17 to i64
  %49 = call i32 @EVP_DigestFinalXOF(ptr noundef nonnull %26, ptr noundef nonnull %12, i64 noundef %48) #5
  %50 = icmp slt i32 %49, 1
  br i1 %50, label %51, label %52

51:                                               ; preds = %47, %43, %40, %37, %34, %29
  call void @ERR_GOST_error(i32 noundef 143, i32 noundef 786691, ptr noundef nonnull @.str, i32 noundef 79) #5
  br label %79

52:                                               ; preds = %47
  %53 = call ptr @EVP_CIPHER_CTX_new() #5
  %54 = icmp eq ptr %53, null
  br i1 %54, label %55, label %56

55:                                               ; preds = %52
  call void @ERR_GOST_error(i32 noundef 143, i32 noundef 786688, ptr noundef nonnull @.str, i32 noundef 85) #5
  br label %79

56:                                               ; preds = %52
  %57 = call ptr @OBJ_nid2sn(i32 noundef %2) #5
  %58 = call ptr @EVP_get_cipherbyname(ptr noundef %57) #5
  %59 = call i32 @EVP_CipherInit_ex(ptr noundef nonnull %53, ptr noundef %58, ptr noundef null, ptr noundef null, ptr noundef null, i32 noundef 1) #5
  %60 = icmp slt i32 %59, 1
  br i1 %60, label %77, label %61

61:                                               ; preds = %56
  %62 = call i32 @EVP_CipherInit_ex(ptr noundef nonnull %53, ptr noundef null, ptr noundef null, ptr noundef %3, ptr noundef nonnull %11, i32 noundef 1) #5
  %63 = icmp slt i32 %62, 1
  br i1 %63, label %77, label %64

64:                                               ; preds = %61
  %65 = call i32 @EVP_CipherUpdate(ptr noundef nonnull %53, ptr noundef %8, ptr noundef nonnull %13, ptr noundef %0, i32 noundef %1) #5
  %66 = icmp slt i32 %65, 1
  br i1 %66, label %77, label %67

67:                                               ; preds = %64
  %68 = getelementptr inbounds i8, ptr %8, i64 %44
  %69 = call i32 @EVP_CipherUpdate(ptr noundef nonnull %53, ptr noundef %68, ptr noundef nonnull %13, ptr noundef nonnull %12, i32 noundef %17) #5
  %70 = icmp slt i32 %69, 1
  br i1 %70, label %77, label %71

71:                                               ; preds = %67
  %72 = load i32, ptr %13, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds i8, ptr %68, i64 %73
  %75 = call i32 @EVP_CipherFinal_ex(ptr noundef nonnull %53, ptr noundef %74, ptr noundef nonnull %9) #5
  %76 = icmp slt i32 %75, 1
  br i1 %76, label %77, label %78

77:                                               ; preds = %71, %67, %64, %61, %56
  call void @ERR_GOST_error(i32 noundef 143, i32 noundef 786691, ptr noundef nonnull @.str, i32 noundef 95) #5
  br label %79

78:                                               ; preds = %71
  store i32 %21, ptr %9, align 4, !tbaa !5
  br label %79

79:                                               ; preds = %78, %77, %55, %51, %28, %24, %19
  %.047 = phi ptr [ null, %19 ], [ null, %24 ], [ null, %28 ], [ null, %51 ], [ null, %55 ], [ %53, %77 ], [ %53, %78 ]
  %.046 = phi ptr [ null, %19 ], [ null, %24 ], [ null, %28 ], [ %26, %51 ], [ %26, %55 ], [ %26, %77 ], [ %26, %78 ]
  %.0 = phi i32 [ 0, %19 ], [ 0, %24 ], [ 0, %28 ], [ 0, %51 ], [ 0, %55 ], [ 0, %77 ], [ 1, %78 ]
  %80 = zext nneg i32 %17 to i64
  call void @OPENSSL_cleanse(ptr noundef nonnull %12, i64 noundef %80) #5
  call void @EVP_MD_CTX_free(ptr noundef %.046) #5
  call void @EVP_CIPHER_CTX_free(ptr noundef %.047) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #5
  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

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

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

declare ptr @EVP_MD_CTX_new() local_unnamed_addr #2

declare i32 @EVP_DigestInit_ex(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare ptr @EVP_get_digestbyname(ptr noundef) local_unnamed_addr #2

declare ptr @OBJ_nid2sn(i32 noundef) local_unnamed_addr #2

declare i32 @omac_imit_ctrl(ptr noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

declare i32 @EVP_DigestUpdate(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

declare i32 @EVP_DigestFinalXOF(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

declare ptr @EVP_CIPHER_CTX_new() local_unnamed_addr #2

declare i32 @EVP_CipherInit_ex(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare ptr @EVP_get_cipherbyname(ptr noundef) local_unnamed_addr #2

declare i32 @EVP_CipherUpdate(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare i32 @EVP_CipherFinal_ex(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @OPENSSL_cleanse(ptr noundef, i64 noundef) local_unnamed_addr #2

declare void @EVP_MD_CTX_free(ptr noundef) local_unnamed_addr #2

declare void @EVP_CIPHER_CTX_free(ptr noundef) local_unnamed_addr #2

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass