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

; 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

declare void @ERR_GOST_error(i32 noundef, i32 noundef, ptr 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: 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) #3

declare ptr @EVP_MD_CTX_new() #1

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

declare ptr @EVP_get_digestbyname(ptr noundef) #1

declare ptr @OBJ_nid2sn(i32 noundef) #1

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

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

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

declare ptr @EVP_CIPHER_CTX_new() #1

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

declare ptr @EVP_get_cipherbyname(ptr noundef) #1

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

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

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

declare void @EVP_MD_CTX_free(ptr noundef) #1

declare void @EVP_CIPHER_CTX_free(ptr noundef) #1

; 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 @gost_kimp15(ptr noundef %0, i64 noundef %1, i32 noundef %2, ptr noundef %3, i32 noundef %4, ptr noundef %5, ptr noundef %6, i64 noundef %7, ptr noundef %8) #4 {
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i64, align 8
  %18 = alloca ptr, align 8
  %19 = alloca [16 x i8], align 16
  %20 = alloca [48 x i8], align 16
  %21 = alloca [16 x i8], align 16
  %22 = alloca i32, align 4
  %23 = alloca i64, align 8
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  store ptr %0, ptr %10, align 8, !tbaa !5
  store i64 %1, ptr %11, align 8, !tbaa !9
  store i32 %2, ptr %12, align 4, !tbaa !11
  store ptr %3, ptr %13, align 8, !tbaa !5
  store i32 %4, ptr %14, align 4, !tbaa !11
  store ptr %5, ptr %15, align 8, !tbaa !5
  store ptr %6, ptr %16, align 8, !tbaa !5
  store i64 %7, ptr %17, align 8, !tbaa !9
  store ptr %8, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #5
  call void @llvm.lifetime.start.p0(i64 48, ptr %20) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  store i64 32, ptr %23, align 8, !tbaa !9
  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 !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #5
  %28 = load i32, ptr %12, align 4, !tbaa !11
  %29 = icmp eq i32 %28, 1188
  br i1 %29, label %30, label %31

30:                                               ; preds = %9
  br label %36

31:                                               ; preds = %9
  %32 = load i32, ptr %12, align 4, !tbaa !11
  %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 %22, align 4, !tbaa !11
  %38 = load i32, ptr %22, align 4, !tbaa !11
  %39 = icmp eq i32 %38, 0
  br i1 %39, label %40, label %41

40:                                               ; preds = %36
  call void @ERR_GOST_error(i32 noundef 148, i32 noundef 134, ptr noundef @.str, i32 noundef 135)
  br label %141

41:                                               ; preds = %36
  %42 = load i64, ptr %11, align 8, !tbaa !9
  %43 = icmp ugt i64 %42, 48
  br i1 %43, label %44, label %45

44:                                               ; preds = %41
  call void @ERR_GOST_error(i32 noundef 148, i32 noundef 786691, ptr noundef @.str, i32 noundef 140)
  br label %141

45:                                               ; preds = %41
  %46 = load i64, ptr %17, align 8, !tbaa !9
  %47 = icmp ugt i64 %46, 16
  br i1 %47, label %48, label %49

48:                                               ; preds = %45
  call void @ERR_GOST_error(i32 noundef 148, i32 noundef 786691, ptr noundef @.str, i32 noundef 145)
  br label %141

49:                                               ; preds = %45
  %50 = getelementptr inbounds [16 x i8], ptr %19, 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 %19, i64 0, i64 0
  %52 = load ptr, ptr %16, align 8, !tbaa !5
  %53 = load i64, ptr %17, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %51, ptr align 1 %52, i64 %53, i1 false)
  %54 = call ptr @EVP_CIPHER_CTX_new()
  store ptr %54, ptr %24, align 8, !tbaa !5
  %55 = load ptr, ptr %24, 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 148, i32 noundef 786688, ptr noundef @.str, i32 noundef 155)
  br label %141

58:                                               ; preds = %49
  %59 = load ptr, ptr %24, align 8, !tbaa !5
  %60 = load i32, ptr %12, align 4, !tbaa !11
  %61 = call ptr @OBJ_nid2sn(i32 noundef %60)
  %62 = call ptr @EVP_get_cipherbyname(ptr noundef %61)
  %63 = call i32 @EVP_CipherInit_ex(ptr noundef %59, ptr noundef %62, ptr noundef null, ptr noundef null, ptr noundef null, i32 noundef 0)
  %64 = icmp sle i32 %63, 0
  br i1 %64, label %87, label %65

65:                                               ; preds = %58
  %66 = load ptr, ptr %24, align 8, !tbaa !5
  %67 = load ptr, ptr %13, align 8, !tbaa !5
  %68 = getelementptr inbounds [16 x i8], ptr %19, i64 0, i64 0
  %69 = call i32 @EVP_CipherInit_ex(ptr noundef %66, ptr noundef null, ptr noundef null, ptr noundef %67, ptr noundef %68, i32 noundef 0)
  %70 = icmp sle i32 %69, 0
  br i1 %70, label %87, label %71

71:                                               ; preds = %65
  %72 = load ptr, ptr %24, align 8, !tbaa !5
  %73 = getelementptr inbounds [48 x i8], ptr %20, i64 0, i64 0
  %74 = load ptr, ptr %10, align 8, !tbaa !5
  %75 = load i64, ptr %11, align 8, !tbaa !9
  %76 = trunc i64 %75 to i32
  %77 = call i32 @EVP_CipherUpdate(ptr noundef %72, ptr noundef %73, ptr noundef %27, ptr noundef %74, i32 noundef %76)
  %78 = icmp sle i32 %77, 0
  br i1 %78, label %87, label %79

79:                                               ; preds = %71
  %80 = load ptr, ptr %24, align 8, !tbaa !5
  %81 = getelementptr inbounds [48 x i8], ptr %20, i64 0, i64 0
  %82 = load i32, ptr %27, align 4, !tbaa !11
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds i8, ptr %81, i64 %83
  %85 = call i32 @EVP_CipherFinal_ex(ptr noundef %80, ptr noundef %84, ptr noundef %27)
  %86 = icmp sle i32 %85, 0
  br i1 %86, label %87, label %88

87:                                               ; preds = %79, %71, %65, %58
  call void @ERR_GOST_error(i32 noundef 148, i32 noundef 786691, ptr noundef @.str, i32 noundef 164)
  br label %141

88:                                               ; preds = %79
  %89 = call ptr @EVP_MD_CTX_new()
  store ptr %89, ptr %25, align 8, !tbaa !5
  %90 = load ptr, ptr %25, align 8, !tbaa !5
  %91 = icmp eq ptr %90, null
  br i1 %91, label %92, label %93

92:                                               ; preds = %88
  call void @ERR_GOST_error(i32 noundef 148, i32 noundef 786688, ptr noundef @.str, i32 noundef 171)
  br label %141

93:                                               ; preds = %88
  %94 = load ptr, ptr %25, align 8, !tbaa !5
  %95 = load i32, ptr %14, align 4, !tbaa !11
  %96 = call ptr @OBJ_nid2sn(i32 noundef %95)
  %97 = call ptr @EVP_get_digestbyname(ptr noundef %96)
  %98 = call i32 @EVP_DigestInit_ex(ptr noundef %94, ptr noundef %97, ptr noundef null)
  %99 = icmp sle i32 %98, 0
  br i1 %99, label %128, label %100

100:                                              ; preds = %93
  %101 = load ptr, ptr %25, align 8, !tbaa !5
  %102 = load ptr, ptr %15, align 8, !tbaa !5
  %103 = call i32 @omac_imit_ctrl(ptr noundef %101, i32 noundef 4100, i32 noundef 32, ptr noundef %102)
  %104 = icmp sle i32 %103, 0
  br i1 %104, label %128, label %105

105:                                              ; preds = %100
  %106 = load ptr, ptr %25, align 8, !tbaa !5
  %107 = load i32, ptr %22, align 4, !tbaa !11
  %108 = call i32 @omac_imit_ctrl(ptr noundef %106, i32 noundef 3, i32 noundef %107, ptr noundef null)
  %109 = icmp sle i32 %108, 0
  br i1 %109, label %128, label %110

110:                                              ; preds = %105
  %111 = load ptr, ptr %25, align 8, !tbaa !5
  %112 = load ptr, ptr %16, align 8, !tbaa !5
  %113 = load i64, ptr %17, align 8, !tbaa !9
  %114 = call i32 @EVP_DigestUpdate(ptr noundef %111, ptr noundef %112, i64 noundef %113)
  %115 = icmp sle i32 %114, 0
  br i1 %115, label %128, label %116

116:                                              ; preds = %110
  %117 = load ptr, ptr %25, align 8, !tbaa !5
  %118 = getelementptr inbounds [48 x i8], ptr %20, i64 0, i64 0
  %119 = call i32 @EVP_DigestUpdate(ptr noundef %117, ptr noundef %118, i64 noundef 32)
  %120 = icmp sle i32 %119, 0
  br i1 %120, label %128, label %121

121:                                              ; preds = %116
  %122 = load ptr, ptr %25, align 8, !tbaa !5
  %123 = getelementptr inbounds [16 x i8], ptr %21, i64 0, i64 0
  %124 = load i32, ptr %22, align 4, !tbaa !11
  %125 = zext i32 %124 to i64
  %126 = call i32 @EVP_DigestFinalXOF(ptr noundef %122, ptr noundef %123, i64 noundef %125)
  %127 = icmp sle i32 %126, 0
  br i1 %127, label %128, label %129

128:                                              ; preds = %121, %116, %110, %105, %100, %93
  call void @ERR_GOST_error(i32 noundef 148, i32 noundef 786691, ptr noundef @.str, i32 noundef 182)
  br label %141

129:                                              ; preds = %121
  %130 = getelementptr inbounds [16 x i8], ptr %21, i64 0, i64 0
  %131 = getelementptr inbounds [48 x i8], ptr %20, i64 0, i64 0
  %132 = getelementptr inbounds i8, ptr %131, i64 32
  %133 = load i32, ptr %22, align 4, !tbaa !11
  %134 = zext i32 %133 to i64
  %135 = call i32 @CRYPTO_memcmp(ptr noundef %130, ptr noundef %132, i64 noundef %134)
  %136 = icmp ne i32 %135, 0
  br i1 %136, label %137, label %138

137:                                              ; preds = %129
  call void @ERR_GOST_error(i32 noundef 148, i32 noundef 133, ptr noundef @.str, i32 noundef 187)
  br label %141

138:                                              ; preds = %129
  %139 = load ptr, ptr %18, align 8, !tbaa !5
  %140 = getelementptr inbounds [48 x i8], ptr %20, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %139, ptr align 16 %140, i64 32, i1 false)
  store i32 1, ptr %26, align 4, !tbaa !11
  br label %141

141:                                              ; preds = %138, %137, %128, %92, %87, %57, %48, %44, %40
  %142 = getelementptr inbounds [48 x i8], ptr %20, i64 0, i64 0
  call void @OPENSSL_cleanse(ptr noundef %142, i64 noundef 48)
  %143 = load ptr, ptr %25, align 8, !tbaa !5
  call void @EVP_MD_CTX_free(ptr noundef %143)
  %144 = load ptr, ptr %24, align 8, !tbaa !5
  call void @EVP_CIPHER_CTX_free(ptr noundef %144)
  %145 = load i32, ptr %26, align 4, !tbaa !11
  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 8, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #5
  ret i32 %145
}

declare i32 @CRYPTO_memcmp(ptr noundef, 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

declare void @ERR_GOST_error(i32 noundef, i32 noundef, ptr 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: 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) #3

declare ptr @EVP_MD_CTX_new() local_unnamed_addr #1

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

declare ptr @EVP_get_digestbyname(ptr noundef) local_unnamed_addr #1

declare ptr @OBJ_nid2sn(i32 noundef) local_unnamed_addr #1

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

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

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

declare ptr @EVP_CIPHER_CTX_new() local_unnamed_addr #1

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

declare ptr @EVP_get_cipherbyname(ptr noundef) local_unnamed_addr #1

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

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

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

declare void @EVP_MD_CTX_free(ptr noundef) local_unnamed_addr #1

declare void @EVP_CIPHER_CTX_free(ptr noundef) local_unnamed_addr #1

; 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 range(i32 0, 2) i32 @gost_kimp15(ptr noundef %0, i64 noundef %1, i32 noundef %2, ptr noundef %3, i32 noundef %4, ptr noundef %5, ptr noundef %6, i64 noundef %7, ptr nocapture noundef writeonly %8) local_unnamed_addr #4 {
  %10 = alloca [16 x i8], align 16
  %11 = alloca [48 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 %10) #5
  call void @llvm.lifetime.start.p0(i64 48, 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 = %9
  tail call void @ERR_GOST_error(i32 noundef 148, i32 noundef 134, ptr noundef nonnull @.str, i32 noundef 135) #5
  br label %80

20:                                               ; preds = %9
  %21 = icmp ugt i64 %1, 48
  br i1 %21, label %22, label %23

22:                                               ; preds = %20
  tail call void @ERR_GOST_error(i32 noundef 148, i32 noundef 786691, ptr noundef nonnull @.str, i32 noundef 140) #5
  br label %80

23:                                               ; preds = %20
  %24 = icmp ugt i64 %7, 16
  br i1 %24, label %25, label %26

25:                                               ; preds = %23
  tail call void @ERR_GOST_error(i32 noundef 148, i32 noundef 786691, ptr noundef nonnull @.str, i32 noundef 145) #5
  br label %80

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

29:                                               ; preds = %26
  tail call void @ERR_GOST_error(i32 noundef 148, i32 noundef 786688, ptr noundef nonnull @.str, i32 noundef 155) #5
  br label %80

30:                                               ; preds = %26
  %31 = tail call ptr @OBJ_nid2sn(i32 noundef %2) #5
  %32 = tail call ptr @EVP_get_cipherbyname(ptr noundef %31) #5
  %33 = tail call i32 @EVP_CipherInit_ex(ptr noundef nonnull %27, ptr noundef %32, ptr noundef null, ptr noundef null, ptr noundef null, i32 noundef 0) #5
  %34 = icmp slt i32 %33, 1
  br i1 %34, label %48, label %35

35:                                               ; preds = %30
  %36 = call i32 @EVP_CipherInit_ex(ptr noundef nonnull %27, ptr noundef null, ptr noundef null, ptr noundef %3, ptr noundef nonnull %10, i32 noundef 0) #5
  %37 = icmp slt i32 %36, 1
  br i1 %37, label %48, label %38

38:                                               ; preds = %35
  %39 = trunc nuw nsw i64 %1 to i32
  %40 = call i32 @EVP_CipherUpdate(ptr noundef nonnull %27, ptr noundef nonnull %11, ptr noundef nonnull %13, ptr noundef %0, i32 noundef %39) #5
  %41 = icmp slt i32 %40, 1
  br i1 %41, label %48, label %42

42:                                               ; preds = %38
  %43 = load i32, ptr %13, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds i8, ptr %11, i64 %44
  %46 = call i32 @EVP_CipherFinal_ex(ptr noundef nonnull %27, ptr noundef nonnull %45, ptr noundef nonnull %13) #5
  %47 = icmp slt i32 %46, 1
  br i1 %47, label %48, label %49

48:                                               ; preds = %42, %38, %35, %30
  call void @ERR_GOST_error(i32 noundef 148, i32 noundef 786691, ptr noundef nonnull @.str, i32 noundef 164) #5
  br label %80

49:                                               ; preds = %42
  %50 = call ptr @EVP_MD_CTX_new() #5
  %51 = icmp eq ptr %50, null
  br i1 %51, label %52, label %53

52:                                               ; preds = %49
  call void @ERR_GOST_error(i32 noundef 148, i32 noundef 786688, ptr noundef nonnull @.str, i32 noundef 171) #5
  br label %80

53:                                               ; preds = %49
  %54 = call ptr @OBJ_nid2sn(i32 noundef %4) #5
  %55 = call ptr @EVP_get_digestbyname(ptr noundef %54) #5
  %56 = call i32 @EVP_DigestInit_ex(ptr noundef nonnull %50, ptr noundef %55, ptr noundef null) #5
  %57 = icmp slt i32 %56, 1
  br i1 %57, label %74, label %58

58:                                               ; preds = %53
  %59 = call i32 @omac_imit_ctrl(ptr noundef nonnull %50, i32 noundef 4100, i32 noundef 32, ptr noundef %5) #5
  %60 = icmp slt i32 %59, 1
  br i1 %60, label %74, label %61

61:                                               ; preds = %58
  %62 = call i32 @omac_imit_ctrl(ptr noundef nonnull %50, i32 noundef 3, i32 noundef %17, ptr noundef null) #5
  %63 = icmp slt i32 %62, 1
  br i1 %63, label %74, label %64

64:                                               ; preds = %61
  %65 = call i32 @EVP_DigestUpdate(ptr noundef nonnull %50, ptr noundef %6, i64 noundef %7) #5
  %66 = icmp slt i32 %65, 1
  br i1 %66, label %74, label %67

67:                                               ; preds = %64
  %68 = call i32 @EVP_DigestUpdate(ptr noundef nonnull %50, ptr noundef nonnull %11, i64 noundef 32) #5
  %69 = icmp slt i32 %68, 1
  br i1 %69, label %74, label %70

70:                                               ; preds = %67
  %71 = zext nneg i32 %17 to i64
  %72 = call i32 @EVP_DigestFinalXOF(ptr noundef nonnull %50, ptr noundef nonnull %12, i64 noundef %71) #5
  %73 = icmp slt i32 %72, 1
  br i1 %73, label %74, label %75

74:                                               ; preds = %70, %67, %64, %61, %58, %53
  call void @ERR_GOST_error(i32 noundef 148, i32 noundef 786691, ptr noundef nonnull @.str, i32 noundef 182) #5
  br label %80

75:                                               ; preds = %70
  %76 = getelementptr inbounds i8, ptr %11, i64 32
  %77 = call i32 @CRYPTO_memcmp(ptr noundef nonnull %12, ptr noundef nonnull %76, i64 noundef %71) #5
  %.not = icmp eq i32 %77, 0
  br i1 %.not, label %79, label %78

78:                                               ; preds = %75
  call void @ERR_GOST_error(i32 noundef 148, i32 noundef 133, ptr noundef nonnull @.str, i32 noundef 187) #5
  br label %80

79:                                               ; preds = %75
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(32) %8, ptr noundef nonnull align 16 dereferenceable(32) %11, i64 32, i1 false)
  br label %80

80:                                               ; preds = %79, %78, %74, %52, %48, %29, %25, %22, %19
  %.034 = phi ptr [ null, %19 ], [ null, %22 ], [ null, %25 ], [ null, %29 ], [ %27, %48 ], [ %27, %52 ], [ %27, %74 ], [ %27, %78 ], [ %27, %79 ]
  %.033 = phi ptr [ null, %19 ], [ null, %22 ], [ null, %25 ], [ null, %29 ], [ null, %48 ], [ null, %52 ], [ %50, %74 ], [ %50, %78 ], [ %50, %79 ]
  %.0 = phi i32 [ 0, %19 ], [ 0, %22 ], [ 0, %25 ], [ 0, %29 ], [ 0, %48 ], [ 0, %52 ], [ 0, %74 ], [ 0, %78 ], [ 1, %79 ]
  call void @OPENSSL_cleanse(ptr noundef nonnull %11, i64 noundef 48) #5
  call void @EVP_MD_CTX_free(ptr noundef %.033) #5
  call void @EVP_CIPHER_CTX_free(ptr noundef %.034) #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 48, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #5
  ret i32 %.0
}

declare i32 @CRYPTO_memcmp(ptr noundef, 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}


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