; LLVM IR from gost-engine/engine :: gost_omac (omac_imit_ctrl)

; 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.omac_ctx = type { ptr, i64, ptr, i32, [32 x i8] }
%struct.gost_mac_key = type { i32, [32 x i8], i16 }

@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [64 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @omac_imit_ctrl(ptr noundef %0, i32 noundef %1, i32 noundef %2, ptr noundef %3) #0 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %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 [32 x i8], align 16
  %19 = alloca i32, align 4
  %20 = alloca ptr, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store i32 %2, ptr %8, align 4, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !5
  %21 = load i32, ptr %7, align 4, !tbaa !9
  switch i32 %21, label %201 [
    i32 4099, label %22
    i32 4100, label %24
    i32 3, label %125
    i32 4, label %159
  ]

22:                                               ; preds = %4
  %23 = load ptr, ptr %9, align 8, !tbaa !5
  store i32 32, ptr %23, align 4, !tbaa !9
  store i32 1, ptr %5, align 4
  br label %202

24:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = call ptr @EVP_MD_CTX_get0_md_data(ptr noundef %25)
  store ptr %26, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = call ptr @EVP_MD_CTX_md(ptr noundef %27)
  store ptr %28, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  store ptr null, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store i32 0, ptr %13, align 4, !tbaa !9
  %29 = load ptr, ptr %10, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.omac_ctx, ptr %29, i32 0, i32 2
  %31 = load ptr, ptr %30, align 8, !tbaa !11
  %32 = icmp eq ptr %31, null
  br i1 %32, label %33, label %49

33:                                               ; preds = %24
  %34 = load ptr, ptr %11, align 8, !tbaa !5
  %35 = call i32 @EVP_MD_is_a(ptr noundef %34, ptr noundef @.str)
  %36 = icmp ne i32 %35, 0
  br i1 %36, label %37, label %40

37:                                               ; preds = %33
  %38 = load ptr, ptr %10, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.omac_ctx, ptr %38, i32 0, i32 2
  store ptr @.str.1, ptr %39, align 8, !tbaa !11
  br label %48

40:                                               ; preds = %33
  %41 = load ptr, ptr %11, align 8, !tbaa !5
  %42 = call i32 @EVP_MD_is_a(ptr noundef %41, ptr noundef @.str.2)
  %43 = icmp ne i32 %42, 0
  br i1 %43, label %44, label %47

44:                                               ; preds = %40
  %45 = load ptr, ptr %10, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.omac_ctx, ptr %45, i32 0, i32 2
  store ptr @.str.3, ptr %46, align 8, !tbaa !11
  br label %47

47:                                               ; preds = %44, %40
  br label %48

48:                                               ; preds = %47, %37
  br label %49

49:                                               ; preds = %48, %24
  %50 = load ptr, ptr %10, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.omac_ctx, ptr %50, i32 0, i32 2
  %52 = load ptr, ptr %51, align 8, !tbaa !11
  %53 = call ptr @EVP_get_cipherbyname(ptr noundef %52)
  store ptr %53, ptr %12, align 8, !tbaa !5
  %54 = icmp eq ptr %53, null
  br i1 %54, label %55, label %62

55:                                               ; preds = %49
  %56 = load ptr, ptr %10, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.omac_ctx, ptr %56, i32 0, i32 2
  %58 = load ptr, ptr %57, align 8, !tbaa !11
  %59 = call ptr @EVP_CIPHER_fetch(ptr noundef null, ptr noundef %58, ptr noundef null)
  store ptr %59, ptr %12, align 8, !tbaa !5
  %60 = icmp eq ptr %59, null
  br i1 %60, label %61, label %62

61:                                               ; preds = %55
  call void @ERR_GOST_error(i32 noundef 116, i32 noundef 103, ptr noundef @.str.4, i32 noundef 180)
  br label %117

62:                                               ; preds = %55, %49
  %63 = load ptr, ptr %6, align 8, !tbaa !5
  %64 = call ptr @EVP_MD_CTX_md(ptr noundef %63)
  %65 = call ptr @EVP_MD_meth_get_init(ptr noundef %64)
  %66 = load ptr, ptr %6, align 8, !tbaa !5
  %67 = call i32 %65(ptr noundef %66)
  %68 = icmp sle i32 %67, 0
  br i1 %68, label %69, label %70

69:                                               ; preds = %62
  call void @ERR_GOST_error(i32 noundef 116, i32 noundef 121, ptr noundef @.str.4, i32 noundef 185)
  br label %117

70:                                               ; preds = %62
  %71 = load ptr, ptr %6, align 8, !tbaa !5
  call void @EVP_MD_CTX_set_flags(ptr noundef %71, i32 noundef 256)
  %72 = load ptr, ptr %10, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.omac_ctx, ptr %72, i32 0, i32 3
  %74 = load i32, ptr %73, align 8, !tbaa !14
  %75 = icmp ne i32 %74, 0
  br i1 %75, label %76, label %77

76:                                               ; preds = %70
  call void @ERR_GOST_error(i32 noundef 116, i32 noundef 132, ptr noundef @.str.4, i32 noundef 191)
  br label %117

77:                                               ; preds = %70
  %78 = load i32, ptr %8, align 4, !tbaa !9
  %79 = icmp eq i32 %78, 0
  br i1 %79, label %80, label %99

80:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %81 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %81, ptr %14, align 8, !tbaa !5
  %82 = load ptr, ptr %10, align 8, !tbaa !5
  %83 = load ptr, ptr %12, align 8, !tbaa !5
  %84 = load ptr, ptr %14, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.gost_mac_key, ptr %84, i32 0, i32 1
  %86 = getelementptr inbounds [32 x i8], ptr %85, i64 0, i64 0
  %87 = call i32 @omac_key(ptr noundef %82, ptr noundef %83, ptr noundef %86, i64 noundef 32)
  store i32 %87, ptr %13, align 4, !tbaa !9
  %88 = load i32, ptr %13, align 4, !tbaa !9
  %89 = icmp sgt i32 %88, 0
  br i1 %89, label %90, label %97

90:                                               ; preds = %80
  %91 = load ptr, ptr %10, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.omac_ctx, ptr %91, i32 0, i32 4
  %93 = getelementptr inbounds [32 x i8], ptr %92, i64 0, i64 0
  %94 = load ptr, ptr %14, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.gost_mac_key, ptr %94, i32 0, i32 1
  %96 = getelementptr inbounds [32 x i8], ptr %95, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %93, ptr align 4 %96, i64 32, i1 false)
  br label %97

97:                                               ; preds = %90, %80
  store i32 3, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  %98 = load i32, ptr %15, align 4
  switch i32 %98, label %124 [
    i32 3, label %117
  ]

99:                                               ; preds = %77
  %100 = load i32, ptr %8, align 4, !tbaa !9
  %101 = icmp eq i32 %100, 32
  br i1 %101, label %102, label %115

102:                                              ; preds = %99
  %103 = load ptr, ptr %10, align 8, !tbaa !5
  %104 = load ptr, ptr %12, align 8, !tbaa !5
  %105 = load ptr, ptr %9, align 8, !tbaa !5
  %106 = call i32 @omac_key(ptr noundef %103, ptr noundef %104, ptr noundef %105, i64 noundef 32)
  store i32 %106, ptr %13, align 4, !tbaa !9
  %107 = load i32, ptr %13, align 4, !tbaa !9
  %108 = icmp sgt i32 %107, 0
  br i1 %108, label %109, label %114

109:                                              ; preds = %102
  %110 = load ptr, ptr %10, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.omac_ctx, ptr %110, i32 0, i32 4
  %112 = getelementptr inbounds [32 x i8], ptr %111, i64 0, i64 0
  %113 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %112, ptr align 1 %113, i64 32, i1 false)
  br label %114

114:                                              ; preds = %109, %102
  br label %117

115:                                              ; preds = %99
  br label %116

116:                                              ; preds = %115
  call void @ERR_GOST_error(i32 noundef 116, i32 noundef 115, ptr noundef @.str.4, i32 noundef 207)
  br label %117

117:                                              ; preds = %116, %114, %97, %76, %69, %61
  %118 = load ptr, ptr %12, align 8, !tbaa !5
  call void @EVP_CIPHER_free(ptr noundef %118)
  %119 = load i32, ptr %13, align 4, !tbaa !9
  %120 = icmp sgt i32 %119, 0
  br i1 %120, label %121, label %123

121:                                              ; preds = %117
  %122 = load i32, ptr %13, align 4, !tbaa !9
  store i32 %122, ptr %5, align 4
  store i32 1, ptr %15, align 4
  br label %124

123:                                              ; preds = %117
  store i32 0, ptr %5, align 4
  store i32 1, ptr %15, align 4
  br label %124

124:                                              ; preds = %123, %121, %97
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  br label %202

125:                                              ; preds = %4
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %126 = load ptr, ptr %6, align 8, !tbaa !5
  %127 = call ptr @EVP_MD_CTX_get0_md_data(ptr noundef %126)
  store ptr %127, ptr %16, align 8, !tbaa !5
  %128 = load ptr, ptr %16, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.omac_ctx, ptr %128, i32 0, i32 2
  %130 = load ptr, ptr %129, align 8, !tbaa !11
  %131 = call i32 @OBJ_txt2nid(ptr noundef %130)
  switch i32 %131, label %156 [
    i32 1190, label %132
    i32 1015, label %144
  ]

132:                                              ; preds = %125
  %133 = load i32, ptr %8, align 4, !tbaa !9
  %134 = icmp slt i32 %133, 1
  br i1 %134, label %138, label %135

135:                                              ; preds = %132
  %136 = load i32, ptr %8, align 4, !tbaa !9
  %137 = icmp sgt i32 %136, 8
  br i1 %137, label %138, label %139

138:                                              ; preds = %135, %132
  call void @ERR_GOST_error(i32 noundef 116, i32 noundef 117, ptr noundef @.str.4, i32 noundef 220)
  store i32 0, ptr %5, align 4
  store i32 1, ptr %15, align 4
  br label %158

139:                                              ; preds = %135
  %140 = load i32, ptr %8, align 4, !tbaa !9
  %141 = sext i32 %140 to i64
  %142 = load ptr, ptr %16, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.omac_ctx, ptr %142, i32 0, i32 1
  store i64 %141, ptr %143, align 8, !tbaa !15
  br label %157

144:                                              ; preds = %125
  %145 = load i32, ptr %8, align 4, !tbaa !9
  %146 = icmp slt i32 %145, 1
  br i1 %146, label %150, label %147

147:                                              ; preds = %144
  %148 = load i32, ptr %8, align 4, !tbaa !9
  %149 = icmp sgt i32 %148, 16
  br i1 %149, label %150, label %151

150:                                              ; preds = %147, %144
  call void @ERR_GOST_error(i32 noundef 116, i32 noundef 117, ptr noundef @.str.4, i32 noundef 227)
  store i32 0, ptr %5, align 4
  store i32 1, ptr %15, align 4
  br label %158

151:                                              ; preds = %147
  %152 = load i32, ptr %8, align 4, !tbaa !9
  %153 = sext i32 %152 to i64
  %154 = load ptr, ptr %16, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.omac_ctx, ptr %154, i32 0, i32 1
  store i64 %153, ptr %155, align 8, !tbaa !15
  br label %157

156:                                              ; preds = %125
  store i32 0, ptr %5, align 4
  store i32 1, ptr %15, align 4
  br label %158

157:                                              ; preds = %151, %139
  store i32 1, ptr %5, align 4
  store i32 1, ptr %15, align 4
  br label %158

158:                                              ; preds = %157, %156, %150, %138
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  br label %202

159:                                              ; preds = %4
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %160 = load ptr, ptr %6, align 8, !tbaa !5
  %161 = call ptr @EVP_MD_CTX_get0_md_data(ptr noundef %160)
  store ptr %161, ptr %17, align 8, !tbaa !5
  %162 = load ptr, ptr %17, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.omac_ctx, ptr %162, i32 0, i32 3
  %164 = load i32, ptr %163, align 8, !tbaa !14
  %165 = icmp ne i32 %164, 0
  br i1 %165, label %166, label %199

166:                                              ; preds = %159
  call void @llvm.lifetime.start.p0(i64 32, ptr %18) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  store i32 0, ptr %19, align 4, !tbaa !9
  %167 = load ptr, ptr %17, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.omac_ctx, ptr %167, i32 0, i32 2
  %169 = load ptr, ptr %168, align 8, !tbaa !11
  %170 = call i32 @OBJ_txt2nid(ptr noundef %169)
  %171 = load ptr, ptr %17, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.omac_ctx, ptr %171, i32 0, i32 4
  %173 = getelementptr inbounds [32 x i8], ptr %172, i64 0, i64 0
  %174 = getelementptr inbounds [32 x i8], ptr %18, i64 0, i64 0
  %175 = load ptr, ptr %9, align 8, !tbaa !5
  %176 = call i32 @gost_tlstree(i32 noundef %170, ptr noundef %173, ptr noundef %174, ptr noundef %175)
  %177 = icmp ne i32 %176, 0
  br i1 %177, label %178, label %197

178:                                              ; preds = %166
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  %179 = load ptr, ptr %17, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.omac_ctx, ptr %179, i32 0, i32 2
  %181 = load ptr, ptr %180, align 8, !tbaa !11
  %182 = call ptr @EVP_get_cipherbyname(ptr noundef %181)
  store ptr %182, ptr %20, align 8, !tbaa !5
  %183 = icmp ne ptr %182, null
  br i1 %183, label %190, label %184

184:                                              ; preds = %178
  %185 = load ptr, ptr %17, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.omac_ctx, ptr %185, i32 0, i32 2
  %187 = load ptr, ptr %186, align 8, !tbaa !11
  %188 = call ptr @EVP_CIPHER_fetch(ptr noundef null, ptr noundef %187, ptr noundef null)
  store ptr %188, ptr %20, align 8, !tbaa !5
  %189 = icmp ne ptr %188, null
  br i1 %189, label %190, label %195

190:                                              ; preds = %184, %178
  %191 = load ptr, ptr %17, align 8, !tbaa !5
  %192 = load ptr, ptr %20, align 8, !tbaa !5
  %193 = getelementptr inbounds [32 x i8], ptr %18, i64 0, i64 0
  %194 = call i32 @omac_key(ptr noundef %191, ptr noundef %192, ptr noundef %193, i64 noundef 32)
  store i32 %194, ptr %19, align 4, !tbaa !9
  br label %195

195:                                              ; preds = %190, %184
  %196 = load ptr, ptr %20, align 8, !tbaa !5
  call void @EVP_CIPHER_free(ptr noundef %196)
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  br label %197

197:                                              ; preds = %195, %166
  %198 = load i32, ptr %19, align 4, !tbaa !9
  store i32 %198, ptr %5, align 4
  store i32 1, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #4
  br label %200

199:                                              ; preds = %159
  call void @ERR_GOST_error(i32 noundef 116, i32 noundef 132, ptr noundef @.str.4, i32 noundef 255)
  store i32 0, ptr %5, align 4
  store i32 1, ptr %15, align 4
  br label %200

200:                                              ; preds = %199, %197
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  br label %202

201:                                              ; preds = %4
  store i32 0, ptr %5, align 4
  br label %202

202:                                              ; preds = %201, %200, %158, %124, %22
  %203 = load i32, ptr %5, align 4
  ret i32 %203
}

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

declare ptr @EVP_MD_CTX_get0_md_data(ptr noundef) #2

declare ptr @EVP_MD_CTX_md(ptr noundef) #2

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

declare ptr @EVP_get_cipherbyname(ptr noundef) #2

declare ptr @EVP_CIPHER_fetch(ptr noundef, ptr noundef, ptr noundef) #2

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

declare ptr @EVP_MD_meth_get_init(ptr noundef) #2

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

; Function Attrs: nounwind uwtable
declare hidden i32 @omac_key(ptr noundef, ptr noundef, ptr noundef, i64 noundef) #0

; 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

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

declare void @EVP_CIPHER_free(ptr noundef) #2

declare i32 @OBJ_txt2nid(ptr noundef) #2

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

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: readwrite) }
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 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 16}
!12 = !{!"omac_ctx", !6, i64 0, !13, i64 8, !6, i64 16, !10, i64 24, !7, i64 28}
!13 = !{!"long", !7, i64 0}
!14 = !{!12, !10, i64 24}
!15 = !{!12, !13, i64 8}


; 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 [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [64 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @omac_imit_ctrl(ptr noundef %0, i32 noundef %1, i32 noundef %2, ptr noundef %3) local_unnamed_addr #0 {
  %5 = alloca [32 x i8], align 16
  switch i32 %1, label %90 [
    i32 4099, label %6
    i32 4100, label %7
    i32 3, label %52
    i32 4, label %69
  ]

6:                                                ; preds = %4
  store i32 32, ptr %3, align 4, !tbaa !5
  br label %90

7:                                                ; preds = %4
  %8 = tail call ptr @EVP_MD_CTX_get0_md_data(ptr noundef %0) #4
  %9 = tail call ptr @EVP_MD_CTX_md(ptr noundef %0) #4
  %10 = getelementptr inbounds i8, ptr %8, i64 16
  %11 = load ptr, ptr %10, align 8, !tbaa !9
  %12 = icmp eq ptr %11, null
  br i1 %12, label %13, label %19

13:                                               ; preds = %7
  %14 = tail call i32 @EVP_MD_is_a(ptr noundef %9, ptr noundef nonnull @.str) #4
  %.not79 = icmp eq i32 %14, 0
  br i1 %.not79, label %16, label %15

15:                                               ; preds = %13
  store ptr @.str.1, ptr %10, align 8, !tbaa !9
  br label %19

16:                                               ; preds = %13
  %17 = tail call i32 @EVP_MD_is_a(ptr noundef %9, ptr noundef nonnull @.str.2) #4
  %.not80 = icmp eq i32 %17, 0
  br i1 %.not80, label %._crit_edge, label %18

._crit_edge:                                      ; preds = %16
  %.pre = load ptr, ptr %10, align 8, !tbaa !9
  br label %19

18:                                               ; preds = %16
  store ptr @.str.3, ptr %10, align 8, !tbaa !9
  br label %19

19:                                               ; preds = %._crit_edge, %15, %18, %7
  %20 = phi ptr [ %.pre, %._crit_edge ], [ @.str.1, %15 ], [ @.str.3, %18 ], [ %11, %7 ]
  %21 = tail call ptr @EVP_get_cipherbyname(ptr noundef %20) #4
  %22 = icmp eq ptr %21, null
  br i1 %22, label %23, label %28

23:                                               ; preds = %19
  %24 = load ptr, ptr %10, align 8, !tbaa !9
  %25 = tail call ptr @EVP_CIPHER_fetch(ptr noundef null, ptr noundef %24, ptr noundef null) #4
  %26 = icmp eq ptr %25, null
  br i1 %26, label %27, label %28

27:                                               ; preds = %23
  tail call void @ERR_GOST_error(i32 noundef 116, i32 noundef 103, ptr noundef nonnull @.str.4, i32 noundef 180) #4
  br label %.thread

28:                                               ; preds = %23, %19
  %.062 = phi ptr [ %25, %23 ], [ %21, %19 ]
  %29 = tail call ptr @EVP_MD_CTX_md(ptr noundef %0) #4
  %30 = tail call ptr @EVP_MD_meth_get_init(ptr noundef %29) #4
  %31 = tail call i32 %30(ptr noundef %0) #4
  %32 = icmp slt i32 %31, 1
  br i1 %32, label %33, label %34

33:                                               ; preds = %28
  tail call void @ERR_GOST_error(i32 noundef 116, i32 noundef 121, ptr noundef nonnull @.str.4, i32 noundef 185) #4
  br label %.thread

34:                                               ; preds = %28
  tail call void @EVP_MD_CTX_set_flags(ptr noundef %0, i32 noundef 256) #4
  %35 = getelementptr inbounds i8, ptr %8, i64 24
  %36 = load i32, ptr %35, align 8, !tbaa !13
  %.not81 = icmp eq i32 %36, 0
  br i1 %.not81, label %38, label %37

37:                                               ; preds = %34
  tail call void @ERR_GOST_error(i32 noundef 116, i32 noundef 132, ptr noundef nonnull @.str.4, i32 noundef 191) #4
  br label %.thread

38:                                               ; preds = %34
  switch i32 %2, label %50 [
    i32 0, label %39
    i32 32, label %45
  ]

39:                                               ; preds = %38
  %40 = getelementptr inbounds i8, ptr %3, i64 4
  %41 = tail call i32 @omac_key(ptr noundef nonnull %8, ptr noundef nonnull %.062, ptr noundef nonnull %40, i64 noundef 32)
  %42 = icmp sgt i32 %41, 0
  br i1 %42, label %43, label %.thread

43:                                               ; preds = %39
  %44 = getelementptr inbounds i8, ptr %8, i64 28
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(32) %44, ptr noundef nonnull align 4 dereferenceable(32) %40, i64 32, i1 false)
  br label %51

45:                                               ; preds = %38
  %46 = tail call i32 @omac_key(ptr noundef nonnull %8, ptr noundef nonnull %.062, ptr noundef %3, i64 noundef 32)
  %47 = icmp sgt i32 %46, 0
  br i1 %47, label %48, label %.thread

48:                                               ; preds = %45
  %49 = getelementptr inbounds i8, ptr %8, i64 28
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(32) %49, ptr noundef nonnull align 1 dereferenceable(32) %3, i64 32, i1 false)
  br label %51

50:                                               ; preds = %38
  tail call void @ERR_GOST_error(i32 noundef 116, i32 noundef 115, ptr noundef nonnull @.str.4, i32 noundef 207) #4
  br label %.thread

.thread:                                          ; preds = %27, %33, %37, %45, %50, %39
  %.163.ph = phi ptr [ %.062, %39 ], [ %.062, %50 ], [ %.062, %45 ], [ %.062, %37 ], [ %.062, %33 ], [ null, %27 ]
  tail call void @EVP_CIPHER_free(ptr noundef %.163.ph) #4
  br label %90

51:                                               ; preds = %48, %43
  %.064 = phi i32 [ %46, %48 ], [ %41, %43 ]
  tail call void @EVP_CIPHER_free(ptr noundef nonnull %.062) #4
  br label %90

52:                                               ; preds = %4
  %53 = tail call ptr @EVP_MD_CTX_get0_md_data(ptr noundef %0) #4
  %54 = getelementptr inbounds i8, ptr %53, i64 16
  %55 = load ptr, ptr %54, align 8, !tbaa !9
  %56 = tail call i32 @OBJ_txt2nid(ptr noundef %55) #4
  switch i32 %56, label %90 [
    i32 1190, label %57
    i32 1015, label %63
  ]

57:                                               ; preds = %52
  %58 = add i32 %2, -9
  %or.cond = icmp ult i32 %58, -8
  br i1 %or.cond, label %59, label %60

59:                                               ; preds = %57
  tail call void @ERR_GOST_error(i32 noundef 116, i32 noundef 117, ptr noundef nonnull @.str.4, i32 noundef 220) #4
  br label %90

60:                                               ; preds = %57
  %61 = zext nneg i32 %2 to i64
  %62 = getelementptr inbounds i8, ptr %53, i64 8
  store i64 %61, ptr %62, align 8, !tbaa !14
  br label %90

63:                                               ; preds = %52
  %64 = add i32 %2, -17
  %or.cond3 = icmp ult i32 %64, -16
  br i1 %or.cond3, label %65, label %66

65:                                               ; preds = %63
  tail call void @ERR_GOST_error(i32 noundef 116, i32 noundef 117, ptr noundef nonnull @.str.4, i32 noundef 227) #4
  br label %90

66:                                               ; preds = %63
  %67 = zext nneg i32 %2 to i64
  %68 = getelementptr inbounds i8, ptr %53, i64 8
  store i64 %67, ptr %68, align 8, !tbaa !14
  br label %90

69:                                               ; preds = %4
  %70 = tail call ptr @EVP_MD_CTX_get0_md_data(ptr noundef %0) #4
  %71 = getelementptr inbounds i8, ptr %70, i64 24
  %72 = load i32, ptr %71, align 8, !tbaa !13
  %.not = icmp eq i32 %72, 0
  br i1 %.not, label %89, label %73

73:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #4
  %74 = getelementptr inbounds i8, ptr %70, i64 16
  %75 = load ptr, ptr %74, align 8, !tbaa !9
  %76 = tail call i32 @OBJ_txt2nid(ptr noundef %75) #4
  %77 = getelementptr inbounds i8, ptr %70, i64 28
  %78 = call i32 @gost_tlstree(i32 noundef %76, ptr noundef nonnull %77, ptr noundef nonnull %5, ptr noundef %3) #4
  %.not76 = icmp eq i32 %78, 0
  br i1 %.not76, label %88, label %79

79:                                               ; preds = %73
  %80 = load ptr, ptr %74, align 8, !tbaa !9
  %81 = call ptr @EVP_get_cipherbyname(ptr noundef %80) #4
  %.not77 = icmp eq ptr %81, null
  br i1 %.not77, label %82, label %85

82:                                               ; preds = %79
  %83 = load ptr, ptr %74, align 8, !tbaa !9
  %84 = call ptr @EVP_CIPHER_fetch(ptr noundef null, ptr noundef %83, ptr noundef null) #4
  %.not78 = icmp eq ptr %84, null
  br i1 %.not78, label %87, label %85

85:                                               ; preds = %82, %79
  %.0 = phi ptr [ %81, %79 ], [ %84, %82 ]
  %86 = call i32 @omac_key(ptr noundef nonnull %70, ptr noundef nonnull %.0, ptr noundef nonnull %5, i64 noundef 32)
  br label %87

87:                                               ; preds = %85, %82
  %.058 = phi i32 [ %86, %85 ], [ 0, %82 ]
  %.1 = phi ptr [ %.0, %85 ], [ null, %82 ]
  call void @EVP_CIPHER_free(ptr noundef %.1) #4
  br label %88

88:                                               ; preds = %87, %73
  %.159 = phi i32 [ %.058, %87 ], [ 0, %73 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #4
  br label %90

89:                                               ; preds = %69
  tail call void @ERR_GOST_error(i32 noundef 116, i32 noundef 132, ptr noundef nonnull @.str.4, i32 noundef 255) #4
  br label %90

90:                                               ; preds = %51, %.thread, %4, %88, %89, %59, %65, %52, %66, %60, %6
  %.3 = phi i32 [ 1, %6 ], [ 0, %65 ], [ 0, %59 ], [ 0, %52 ], [ 1, %66 ], [ 1, %60 ], [ %.159, %88 ], [ 0, %89 ], [ 0, %4 ], [ %.064, %51 ], [ 0, %.thread ]
  ret i32 %.3
}

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

declare ptr @EVP_MD_CTX_get0_md_data(ptr noundef) local_unnamed_addr #2

declare ptr @EVP_MD_CTX_md(ptr noundef) local_unnamed_addr #2

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

declare ptr @EVP_get_cipherbyname(ptr noundef) local_unnamed_addr #2

declare ptr @EVP_CIPHER_fetch(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

declare ptr @EVP_MD_meth_get_init(ptr noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
declare hidden i32 @omac_key(ptr noundef, ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #0

; 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

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

declare void @EVP_CIPHER_free(ptr noundef) local_unnamed_addr #2

declare i32 @OBJ_txt2nid(ptr noundef) local_unnamed_addr #2

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

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: readwrite) }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 16}
!10 = !{!"omac_ctx", !11, i64 0, !12, i64 8, !11, i64 16, !6, i64 24, !7, i64 28}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!10, !6, i64 24}
!14 = !{!10, !12, i64 8}


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