; LLVM IR from openanolis/openssl :: crypto/crmf (crmf_pbm)

; 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.ossl_crmf_pbmparameter_st = type { ptr, ptr, ptr, ptr }
%struct.X509_algor_st = type { ptr, ptr }
%struct.asn1_string_st = type { i32, i32, ptr, i64 }

@.str = external hidden unnamed_addr constant [75 x i8], align 1
@__func__.OSSL_CRMF_pbm_new = external hidden unnamed_addr constant [18 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 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 ptr @CRYPTO_malloc(i64 noundef, ptr noundef, i32 noundef) #1

declare void @ERR_new() #1

declare void @ERR_set_debug(ptr noundef, i32 noundef, ptr noundef) #1

declare void @ERR_set_error(i32 noundef, i32 noundef, ptr noundef, ...) #1

declare ptr @OBJ_nid2obj(i32 noundef) #1

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

35:                                               ; preds = %9
  %36 = load ptr, ptr %13, align 8, !tbaa !5
  %37 = icmp eq ptr %36, null
  br i1 %37, label %56, label %38

38:                                               ; preds = %35
  %39 = load ptr, ptr %13, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.ossl_crmf_pbmparameter_st, ptr %39, i32 0, i32 3
  %41 = load ptr, ptr %40, align 8, !tbaa !13
  %42 = icmp eq ptr %41, null
  br i1 %42, label %56, label %43

43:                                               ; preds = %38
  %44 = load ptr, ptr %13, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.ossl_crmf_pbmparameter_st, ptr %44, i32 0, i32 3
  %46 = load ptr, ptr %45, align 8, !tbaa !13
  %47 = getelementptr inbounds %struct.X509_algor_st, ptr %46, i32 0, i32 0
  %48 = load ptr, ptr %47, align 8, !tbaa !15
  %49 = icmp eq ptr %48, null
  br i1 %49, label %56, label %50

50:                                               ; preds = %43
  %51 = load ptr, ptr %14, align 8, !tbaa !5
  %52 = icmp eq ptr %51, null
  br i1 %52, label %56, label %53

53:                                               ; preds = %50
  %54 = load ptr, ptr %16, align 8, !tbaa !5
  %55 = icmp eq ptr %54, null
  br i1 %55, label %56, label %57

56:                                               ; preds = %53, %50, %43, %38, %35, %9
  call void @ERR_new()
  call void @ERR_set_debug(ptr noundef @.str, i32 noundef 146, ptr noundef @__func__.OSSL_CRMF_pbm_new)
  call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 56, i32 noundef 109, ptr noundef null)
  br label %185

57:                                               ; preds = %53
  %58 = call ptr @CRYPTO_malloc(i64 noundef 64, ptr noundef @.str, i32 noundef 149)
  store ptr %58, ptr %29, align 8, !tbaa !5
  %59 = icmp eq ptr %58, null
  br i1 %59, label %60, label %61

60:                                               ; preds = %57
  br label %185

61:                                               ; preds = %57
  %62 = getelementptr inbounds [50 x i8], ptr %22, i64 0, i64 0
  %63 = load ptr, ptr %13, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.ossl_crmf_pbmparameter_st, ptr %63, i32 0, i32 1
  %65 = load ptr, ptr %64, align 8, !tbaa !17
  %66 = getelementptr inbounds %struct.X509_algor_st, ptr %65, i32 0, i32 0
  %67 = load ptr, ptr %66, align 8, !tbaa !15
  %68 = call i32 @OBJ_obj2txt(ptr noundef %62, i32 noundef 50, ptr noundef %67, i32 noundef 0)
  %69 = load ptr, ptr %11, align 8, !tbaa !5
  %70 = getelementptr inbounds [50 x i8], ptr %22, i64 0, i64 0
  %71 = load ptr, ptr %12, align 8, !tbaa !5
  %72 = call ptr @EVP_MD_fetch(ptr noundef %69, ptr noundef %70, ptr noundef %71)
  store ptr %72, ptr %24, align 8, !tbaa !5
  %73 = icmp eq ptr %72, null
  br i1 %73, label %74, label %75

74:                                               ; preds = %61
  call void @ERR_new()
  call void @ERR_set_debug(ptr noundef @.str, i32 noundef 159, ptr noundef @__func__.OSSL_CRMF_pbm_new)
  call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 56, i32 noundef 112, ptr noundef null)
  br label %185

75:                                               ; preds = %61
  %76 = call ptr @EVP_MD_CTX_new()
  store ptr %76, ptr %25, align 8, !tbaa !5
  %77 = icmp eq ptr %76, null
  br i1 %77, label %78, label %79

78:                                               ; preds = %75
  br label %185

79:                                               ; preds = %75
  %80 = load ptr, ptr %25, align 8, !tbaa !5
  %81 = load ptr, ptr %24, align 8, !tbaa !5
  %82 = call i32 @EVP_DigestInit_ex(ptr noundef %80, ptr noundef %81, ptr noundef null)
  %83 = icmp ne i32 %82, 0
  br i1 %83, label %85, label %84

84:                                               ; preds = %79
  br label %185

85:                                               ; preds = %79
  %86 = load ptr, ptr %25, align 8, !tbaa !5
  %87 = load ptr, ptr %16, align 8, !tbaa !5
  %88 = load i64, ptr %17, align 8, !tbaa !9
  %89 = call i32 @EVP_DigestUpdate(ptr noundef %86, ptr noundef %87, i64 noundef %88)
  %90 = icmp ne i32 %89, 0
  br i1 %90, label %92, label %91

91:                                               ; preds = %85
  br label %185

92:                                               ; preds = %85
  %93 = load ptr, ptr %25, align 8, !tbaa !5
  %94 = load ptr, ptr %13, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.ossl_crmf_pbmparameter_st, ptr %94, i32 0, i32 0
  %96 = load ptr, ptr %95, align 8, !tbaa !18
  %97 = getelementptr inbounds %struct.asn1_string_st, ptr %96, i32 0, i32 2
  %98 = load ptr, ptr %97, align 8, !tbaa !19
  %99 = load ptr, ptr %13, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.ossl_crmf_pbmparameter_st, ptr %99, i32 0, i32 0
  %101 = load ptr, ptr %100, align 8, !tbaa !18
  %102 = getelementptr inbounds %struct.asn1_string_st, ptr %101, i32 0, i32 0
  %103 = load i32, ptr %102, align 8, !tbaa !21
  %104 = sext i32 %103 to i64
  %105 = call i32 @EVP_DigestUpdate(ptr noundef %93, ptr noundef %98, i64 noundef %104)
  %106 = icmp ne i32 %105, 0
  br i1 %106, label %108, label %107

107:                                              ; preds = %92
  br label %185

108:                                              ; preds = %92
  %109 = load ptr, ptr %25, align 8, !tbaa !5
  %110 = getelementptr inbounds [64 x i8], ptr %26, i64 0, i64 0
  %111 = call i32 @EVP_DigestFinal_ex(ptr noundef %109, ptr noundef %110, ptr noundef %27)
  %112 = icmp ne i32 %111, 0
  br i1 %112, label %114, label %113

113:                                              ; preds = %108
  br label %185

114:                                              ; preds = %108
  %115 = load ptr, ptr %13, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.ossl_crmf_pbmparameter_st, ptr %115, i32 0, i32 2
  %117 = load ptr, ptr %116, align 8, !tbaa !22
  %118 = call i32 @ASN1_INTEGER_get_int64(ptr noundef %28, ptr noundef %117)
  %119 = icmp ne i32 %118, 0
  br i1 %119, label %120, label %126

120:                                              ; preds = %114
  %121 = load i64, ptr %28, align 8, !tbaa !9
  %122 = icmp slt i64 %121, 100
  br i1 %122, label %126, label %123

123:                                              ; preds = %120
  %124 = load i64, ptr %28, align 8, !tbaa !9
  %125 = icmp sgt i64 %124, 100000
  br i1 %125, label %126, label %127

126:                                              ; preds = %123, %120, %114
  call void @ERR_new()
  call void @ERR_set_debug(ptr noundef @.str, i32 noundef 180, ptr noundef @__func__.OSSL_CRMF_pbm_new)
  call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 56, i32 noundef 100, ptr noundef null)
  br label %185

127:                                              ; preds = %123
  br label %128

128:                                              ; preds = %152, %127
  %129 = load i64, ptr %28, align 8, !tbaa !9
  %130 = add nsw i64 %129, -1
  store i64 %130, ptr %28, align 8, !tbaa !9
  %131 = icmp sgt i64 %130, 0
  br i1 %131, label %132, label %153

132:                                              ; preds = %128
  %133 = load ptr, ptr %25, align 8, !tbaa !5
  %134 = load ptr, ptr %24, align 8, !tbaa !5
  %135 = call i32 @EVP_DigestInit_ex(ptr noundef %133, ptr noundef %134, ptr noundef null)
  %136 = icmp ne i32 %135, 0
  br i1 %136, label %138, label %137

137:                                              ; preds = %132
  br label %185

138:                                              ; preds = %132
  %139 = load ptr, ptr %25, align 8, !tbaa !5
  %140 = getelementptr inbounds [64 x i8], ptr %26, i64 0, i64 0
  %141 = load i32, ptr %27, align 4, !tbaa !11
  %142 = zext i32 %141 to i64
  %143 = call i32 @EVP_DigestUpdate(ptr noundef %139, ptr noundef %140, i64 noundef %142)
  %144 = icmp ne i32 %143, 0
  br i1 %144, label %146, label %145

145:                                              ; preds = %138
  br label %185

146:                                              ; preds = %138
  %147 = load ptr, ptr %25, align 8, !tbaa !5
  %148 = getelementptr inbounds [64 x i8], ptr %26, i64 0, i64 0
  %149 = call i32 @EVP_DigestFinal_ex(ptr noundef %147, ptr noundef %148, ptr noundef %27)
  %150 = icmp ne i32 %149, 0
  br i1 %150, label %152, label %151

151:                                              ; preds = %146
  br label %185

152:                                              ; preds = %146
  br label %128, !llvm.loop !23

153:                                              ; preds = %128
  %154 = load ptr, ptr %13, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.ossl_crmf_pbmparameter_st, ptr %154, i32 0, i32 3
  %156 = load ptr, ptr %155, align 8, !tbaa !13
  %157 = getelementptr inbounds %struct.X509_algor_st, ptr %156, i32 0, i32 0
  %158 = load ptr, ptr %157, align 8, !tbaa !15
  %159 = call i32 @OBJ_obj2nid(ptr noundef %158)
  store i32 %159, ptr %20, align 4, !tbaa !11
  %160 = load i32, ptr %20, align 4, !tbaa !11
  %161 = call i32 @EVP_PBE_find(i32 noundef 1, i32 noundef %160, ptr noundef null, ptr noundef %21, ptr noundef null)
  %162 = icmp ne i32 %161, 0
  br i1 %162, label %163, label %169

163:                                              ; preds = %153
  %164 = getelementptr inbounds [50 x i8], ptr %23, i64 0, i64 0
  %165 = load i32, ptr %21, align 4, !tbaa !11
  %166 = call ptr @OBJ_nid2obj(i32 noundef %165)
  %167 = call i32 @OBJ_obj2txt(ptr noundef %164, i32 noundef 50, ptr noundef %166, i32 noundef 0)
  %168 = icmp sle i32 %167, 0
  br i1 %168, label %169, label %170

169:                                              ; preds = %163, %153
  call void @ERR_new()
  call void @ERR_set_debug(ptr noundef @.str, i32 noundef 204, ptr noundef @__func__.OSSL_CRMF_pbm_new)
  call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 56, i32 noundef 112, ptr noundef null)
  br label %185

170:                                              ; preds = %163
  %171 = load ptr, ptr %11, align 8, !tbaa !5
  %172 = load ptr, ptr %12, align 8, !tbaa !5
  %173 = getelementptr inbounds [50 x i8], ptr %23, i64 0, i64 0
  %174 = getelementptr inbounds [64 x i8], ptr %26, i64 0, i64 0
  %175 = load i32, ptr %27, align 4, !tbaa !11
  %176 = zext i32 %175 to i64
  %177 = load ptr, ptr %14, align 8, !tbaa !5
  %178 = load i64, ptr %15, align 8, !tbaa !9
  %179 = load ptr, ptr %29, align 8, !tbaa !5
  %180 = load ptr, ptr %19, align 8, !tbaa !5
  %181 = call ptr @EVP_Q_mac(ptr noundef %171, ptr noundef @.str.1, ptr noundef %172, ptr noundef %173, ptr noundef null, ptr noundef %174, i64 noundef %176, ptr noundef %177, i64 noundef %178, ptr noundef %179, i64 noundef 64, ptr noundef %180)
  %182 = icmp eq ptr %181, null
  br i1 %182, label %183, label %184

183:                                              ; preds = %170
  br label %185

184:                                              ; preds = %170
  store i32 1, ptr %30, align 4, !tbaa !11
  br label %185

185:                                              ; preds = %184, %183, %169, %151, %145, %137, %126, %113, %107, %91, %84, %78, %74, %60, %56
  %186 = getelementptr inbounds [64 x i8], ptr %26, i64 0, i64 0
  %187 = load i32, ptr %27, align 4, !tbaa !11
  %188 = zext i32 %187 to i64
  call void @OPENSSL_cleanse(ptr noundef %186, i64 noundef %188)
  %189 = load ptr, ptr %24, align 8, !tbaa !5
  call void @EVP_MD_free(ptr noundef %189)
  %190 = load ptr, ptr %25, align 8, !tbaa !5
  call void @EVP_MD_CTX_free(ptr noundef %190)
  %191 = load i32, ptr %30, align 4, !tbaa !11
  %192 = icmp eq i32 %191, 1
  br i1 %192, label %193, label %196

193:                                              ; preds = %185
  %194 = load ptr, ptr %29, align 8, !tbaa !5
  %195 = load ptr, ptr %18, align 8, !tbaa !5
  store ptr %194, ptr %195, align 8, !tbaa !5
  store i32 1, ptr %10, align 4
  store i32 1, ptr %31, align 4
  br label %218

196:                                              ; preds = %185
  %197 = load ptr, ptr %29, align 8, !tbaa !5
  call void @CRYPTO_free(ptr noundef %197, ptr noundef @.str, i32 noundef 224)
  %198 = load ptr, ptr %13, align 8, !tbaa !5
  %199 = icmp ne ptr %198, null
  br i1 %199, label %200, label %217

200:                                              ; preds = %196
  %201 = load ptr, ptr %13, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct.ossl_crmf_pbmparameter_st, ptr %201, i32 0, i32 3
  %203 = load ptr, ptr %202, align 8, !tbaa !13
  %204 = icmp ne ptr %203, null
  br i1 %204, label %205, label %217

205:                                              ; preds = %200
  call void @llvm.lifetime.start.p0(i64 128, ptr %32) #3
  %206 = getelementptr inbounds [128 x i8], ptr %32, i64 0, i64 0
  %207 = load ptr, ptr %13, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct.ossl_crmf_pbmparameter_st, ptr %207, i32 0, i32 3
  %209 = load ptr, ptr %208, align 8, !tbaa !13
  %210 = getelementptr inbounds %struct.X509_algor_st, ptr %209, i32 0, i32 0
  %211 = load ptr, ptr %210, align 8, !tbaa !15
  %212 = call i32 @OBJ_obj2txt(ptr noundef %206, i32 noundef 128, ptr noundef %211, i32 noundef 0)
  %213 = icmp ne i32 %212, 0
  br i1 %213, label %214, label %216

214:                                              ; preds = %205
  %215 = getelementptr inbounds [128 x i8], ptr %32, i64 0, i64 0
  call void (i32, ...) @ERR_add_error_data(i32 noundef 1, ptr noundef %215)
  br label %216

216:                                              ; preds = %214, %205
  call void @llvm.lifetime.end.p0(i64 128, ptr %32) #3
  br label %217

217:                                              ; preds = %216, %200, %196
  store i32 0, ptr %10, align 4
  store i32 1, ptr %31, align 4
  br label %218

218:                                              ; preds = %217, %193
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #3
  call void @llvm.lifetime.end.p0(i64 64, ptr %26) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #3
  call void @llvm.lifetime.end.p0(i64 50, ptr %23) #3
  call void @llvm.lifetime.end.p0(i64 50, ptr %22) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #3
  %219 = load i32, ptr %10, align 4
  ret i32 %219
}

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

declare ptr @EVP_MD_fetch(ptr noundef, ptr noundef, ptr noundef) #1

declare ptr @EVP_MD_CTX_new() #1

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

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

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

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

declare i32 @OBJ_obj2nid(ptr noundef) #1

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

declare ptr @EVP_Q_mac(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef) #1

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

declare void @EVP_MD_free(ptr noundef) #1

declare void @EVP_MD_CTX_free(ptr noundef) #1

declare void @ERR_add_error_data(i32 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 = { 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 #3 = { 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}
!13 = !{!14, !6, i64 24}
!14 = !{!"ossl_crmf_pbmparameter_st", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!15 = !{!16, !6, i64 0}
!16 = !{!"X509_algor_st", !6, i64 0, !6, i64 8}
!17 = !{!14, !6, i64 8}
!18 = !{!14, !6, i64 0}
!19 = !{!20, !6, i64 8}
!20 = !{!"asn1_string_st", !12, i64 0, !12, i64 4, !6, i64 8, !10, i64 16}
!21 = !{!20, !12, i64 0}
!22 = !{!14, !6, i64 16}
!23 = distinct !{!23, !24}
!24 = !{!"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 [75 x i8], align 1
@__func__.OSSL_CRMF_pbm_new = external hidden unnamed_addr constant [18 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 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 ptr @CRYPTO_malloc(i64 noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

declare void @ERR_new() local_unnamed_addr #1

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

declare void @ERR_set_error(i32 noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #1

declare ptr @OBJ_nid2obj(i32 noundef) local_unnamed_addr #1

declare void @CRYPTO_free(ptr noundef, ptr noundef, i32 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 @OSSL_CRMF_pbm_new(ptr noundef %0, ptr noundef %1, ptr noundef readonly %2, ptr noundef %3, i64 noundef %4, ptr noundef %5, i64 noundef %6, ptr noundef writeonly %7, ptr noundef %8) local_unnamed_addr #2 {
  %10 = alloca i32, align 4
  %11 = alloca [50 x i8], align 16
  %12 = alloca [50 x i8], align 16
  %13 = alloca [64 x i8], align 16
  %14 = alloca i32, align 4
  %15 = alloca i64, align 8
  %16 = alloca [128 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #3
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 50, ptr nonnull %11) #3
  call void @llvm.lifetime.start.p0(i64 50, ptr nonnull %12) #3
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %13) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #3
  store i32 64, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #3
  %17 = icmp eq ptr %7, null
  %18 = icmp eq ptr %2, null
  %or.cond = or i1 %18, %17
  br i1 %or.cond, label %28, label %19

19:                                               ; preds = %9
  %20 = getelementptr inbounds i8, ptr %2, i64 24
  %21 = load ptr, ptr %20, align 8, !tbaa !9
  %22 = icmp eq ptr %21, null
  br i1 %22, label %28, label %23

23:                                               ; preds = %19
  %24 = load ptr, ptr %21, align 8, !tbaa !12
  %25 = icmp eq ptr %24, null
  %26 = icmp eq ptr %3, null
  %or.cond3 = or i1 %26, %25
  %27 = icmp eq ptr %5, null
  %or.cond5 = or i1 %27, %or.cond3
  br i1 %or.cond5, label %28, label %29

28:                                               ; preds = %23, %19, %9
  tail call void @ERR_new() #3
  tail call void @ERR_set_debug(ptr noundef nonnull @.str, i32 noundef 146, ptr noundef nonnull @__func__.OSSL_CRMF_pbm_new) #3
  tail call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 56, i32 noundef 109, ptr noundef null) #3
  br label %.loopexit

29:                                               ; preds = %23
  %30 = tail call ptr @CRYPTO_malloc(i64 noundef 64, ptr noundef nonnull @.str, i32 noundef 149) #3
  %31 = icmp eq ptr %30, null
  br i1 %31, label %.loopexit, label %32

32:                                               ; preds = %29
  %33 = getelementptr inbounds i8, ptr %2, i64 8
  %34 = load ptr, ptr %33, align 8, !tbaa !14
  %35 = load ptr, ptr %34, align 8, !tbaa !12
  %36 = call i32 @OBJ_obj2txt(ptr noundef nonnull %11, i32 noundef 50, ptr noundef %35, i32 noundef 0) #3
  %37 = call ptr @EVP_MD_fetch(ptr noundef %0, ptr noundef nonnull %11, ptr noundef %1) #3
  %38 = icmp eq ptr %37, null
  br i1 %38, label %39, label %40

39:                                               ; preds = %32
  call void @ERR_new() #3
  call void @ERR_set_debug(ptr noundef nonnull @.str, i32 noundef 159, ptr noundef nonnull @__func__.OSSL_CRMF_pbm_new) #3
  call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 56, i32 noundef 112, ptr noundef null) #3
  br label %.loopexit

40:                                               ; preds = %32
  %41 = call ptr @EVP_MD_CTX_new() #3
  %42 = icmp eq ptr %41, null
  br i1 %42, label %.loopexit, label %43

43:                                               ; preds = %40
  %44 = call i32 @EVP_DigestInit_ex(ptr noundef nonnull %41, ptr noundef nonnull %37, ptr noundef null) #3
  %.not = icmp eq i32 %44, 0
  br i1 %.not, label %.loopexit, label %45

45:                                               ; preds = %43
  %46 = call i32 @EVP_DigestUpdate(ptr noundef nonnull %41, ptr noundef nonnull %5, i64 noundef %6) #3
  %.not63 = icmp eq i32 %46, 0
  br i1 %.not63, label %.loopexit, label %47

47:                                               ; preds = %45
  %48 = load ptr, ptr %2, align 8, !tbaa !15
  %49 = getelementptr inbounds i8, ptr %48, i64 8
  %50 = load ptr, ptr %49, align 8, !tbaa !16
  %51 = load i32, ptr %48, align 8, !tbaa !19
  %52 = sext i32 %51 to i64
  %53 = call i32 @EVP_DigestUpdate(ptr noundef nonnull %41, ptr noundef %50, i64 noundef %52) #3
  %.not64 = icmp eq i32 %53, 0
  br i1 %.not64, label %.loopexit, label %54

54:                                               ; preds = %47
  %55 = call i32 @EVP_DigestFinal_ex(ptr noundef nonnull %41, ptr noundef nonnull %13, ptr noundef nonnull %14) #3
  %.not65 = icmp eq i32 %55, 0
  br i1 %.not65, label %.loopexit, label %56

56:                                               ; preds = %54
  %57 = getelementptr inbounds i8, ptr %2, i64 16
  %58 = load ptr, ptr %57, align 8, !tbaa !20
  %59 = call i32 @ASN1_INTEGER_get_int64(ptr noundef nonnull %15, ptr noundef %58) #3
  %60 = icmp eq i32 %59, 0
  %61 = load i64, ptr %15, align 8
  %62 = add i64 %61, -100001
  %63 = icmp ult i64 %62, -99901
  %or.cond9 = select i1 %60, i1 true, i1 %63
  br i1 %or.cond9, label %65, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %56
  %64 = add nsw i64 %61, -1
  store i64 %64, ptr %15, align 8, !tbaa !21
  br label %.lr.ph

65:                                               ; preds = %56
  call void @ERR_new() #3
  call void @ERR_set_debug(ptr noundef nonnull @.str, i32 noundef 180, ptr noundef nonnull @__func__.OSSL_CRMF_pbm_new) #3
  call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 56, i32 noundef 100, ptr noundef null) #3
  br label %.loopexit

thread-pre-split:                                 ; preds = %73
  %.pr = load i64, ptr %15, align 8, !tbaa !21
  %66 = add nsw i64 %.pr, -1
  store i64 %66, ptr %15, align 8, !tbaa !21
  %67 = icmp sgt i64 %.pr, 1
  br i1 %67, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph.preheader, %thread-pre-split
  %68 = call i32 @EVP_DigestInit_ex(ptr noundef nonnull %41, ptr noundef nonnull %37, ptr noundef null) #3
  %.not67 = icmp eq i32 %68, 0
  br i1 %.not67, label %.loopexit, label %69

69:                                               ; preds = %.lr.ph
  %70 = load i32, ptr %14, align 4, !tbaa !5
  %71 = zext i32 %70 to i64
  %72 = call i32 @EVP_DigestUpdate(ptr noundef nonnull %41, ptr noundef nonnull %13, i64 noundef %71) #3
  %.not68 = icmp eq i32 %72, 0
  br i1 %.not68, label %.loopexit, label %73

73:                                               ; preds = %69
  %74 = call i32 @EVP_DigestFinal_ex(ptr noundef nonnull %41, ptr noundef nonnull %13, ptr noundef nonnull %14) #3
  %.not69 = icmp eq i32 %74, 0
  br i1 %.not69, label %.loopexit, label %thread-pre-split, !llvm.loop !22

._crit_edge:                                      ; preds = %thread-pre-split
  %75 = load ptr, ptr %20, align 8, !tbaa !9
  %76 = load ptr, ptr %75, align 8, !tbaa !12
  %77 = call i32 @OBJ_obj2nid(ptr noundef %76) #3
  %78 = call i32 @EVP_PBE_find(i32 noundef 1, i32 noundef %77, ptr noundef null, ptr noundef nonnull %10, ptr noundef null) #3
  %.not66 = icmp eq i32 %78, 0
  br i1 %.not66, label %84, label %79

79:                                               ; preds = %._crit_edge
  %80 = load i32, ptr %10, align 4, !tbaa !5
  %81 = call ptr @OBJ_nid2obj(i32 noundef %80) #3
  %82 = call i32 @OBJ_obj2txt(ptr noundef nonnull %12, i32 noundef 50, ptr noundef %81, i32 noundef 0) #3
  %83 = icmp slt i32 %82, 1
  br i1 %83, label %84, label %85

84:                                               ; preds = %79, %._crit_edge
  call void @ERR_new() #3
  call void @ERR_set_debug(ptr noundef nonnull @.str, i32 noundef 204, ptr noundef nonnull @__func__.OSSL_CRMF_pbm_new) #3
  call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 56, i32 noundef 112, ptr noundef null) #3
  br label %.loopexit

85:                                               ; preds = %79
  %86 = load i32, ptr %14, align 4, !tbaa !5
  %87 = zext i32 %86 to i64
  %88 = call ptr @EVP_Q_mac(ptr noundef %0, ptr noundef nonnull @.str.1, ptr noundef %1, ptr noundef nonnull %12, ptr noundef null, ptr noundef nonnull %13, i64 noundef %87, ptr noundef %3, i64 noundef %4, ptr noundef nonnull %30, i64 noundef 64, ptr noundef %8) #3
  %89 = icmp ne ptr %88, null
  br label %.loopexit

.loopexit:                                        ; preds = %73, %69, %.lr.ph, %85, %54, %47, %45, %43, %40, %29, %84, %65, %39, %28
  %.051 = phi ptr [ null, %28 ], [ null, %29 ], [ null, %39 ], [ %37, %40 ], [ %37, %65 ], [ %37, %84 ], [ %37, %54 ], [ %37, %47 ], [ %37, %45 ], [ %37, %43 ], [ %37, %85 ], [ %37, %.lr.ph ], [ %37, %69 ], [ %37, %73 ]
  %.050 = phi ptr [ null, %28 ], [ null, %29 ], [ null, %39 ], [ null, %40 ], [ %41, %65 ], [ %41, %84 ], [ %41, %54 ], [ %41, %47 ], [ %41, %45 ], [ %41, %43 ], [ %41, %85 ], [ %41, %.lr.ph ], [ %41, %69 ], [ %41, %73 ]
  %.049 = phi ptr [ null, %28 ], [ null, %29 ], [ %30, %39 ], [ %30, %40 ], [ %30, %65 ], [ %30, %84 ], [ %30, %54 ], [ %30, %47 ], [ %30, %45 ], [ %30, %43 ], [ %30, %85 ], [ %30, %.lr.ph ], [ %30, %69 ], [ %30, %73 ]
  %90 = phi i1 [ false, %28 ], [ false, %29 ], [ false, %39 ], [ false, %40 ], [ false, %65 ], [ false, %84 ], [ false, %54 ], [ false, %47 ], [ false, %45 ], [ false, %43 ], [ %89, %85 ], [ false, %.lr.ph ], [ false, %69 ], [ false, %73 ]
  %91 = load i32, ptr %14, align 4, !tbaa !5
  %92 = zext i32 %91 to i64
  call void @OPENSSL_cleanse(ptr noundef nonnull %13, i64 noundef %92) #3
  call void @EVP_MD_free(ptr noundef %.051) #3
  call void @EVP_MD_CTX_free(ptr noundef %.050) #3
  br i1 %90, label %93, label %94

93:                                               ; preds = %.loopexit
  store ptr %.049, ptr %7, align 8, !tbaa !24
  br label %103

94:                                               ; preds = %.loopexit
  call void @CRYPTO_free(ptr noundef %.049, ptr noundef nonnull @.str, i32 noundef 224) #3
  br i1 %18, label %103, label %95

95:                                               ; preds = %94
  %96 = getelementptr inbounds i8, ptr %2, i64 24
  %97 = load ptr, ptr %96, align 8, !tbaa !9
  %.not71 = icmp eq ptr %97, null
  br i1 %.not71, label %103, label %98

98:                                               ; preds = %95
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %16) #3
  %99 = load ptr, ptr %97, align 8, !tbaa !12
  %100 = call i32 @OBJ_obj2txt(ptr noundef nonnull %16, i32 noundef 128, ptr noundef %99, i32 noundef 0) #3
  %.not72 = icmp eq i32 %100, 0
  br i1 %.not72, label %102, label %101

101:                                              ; preds = %98
  call void (i32, ...) @ERR_add_error_data(i32 noundef 1, ptr noundef nonnull %16) #3
  br label %102

102:                                              ; preds = %101, %98
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %16) #3
  br label %103

103:                                              ; preds = %94, %95, %102, %93
  %.052 = phi i32 [ 1, %93 ], [ 0, %102 ], [ 0, %95 ], [ 0, %94 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #3
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %13) #3
  call void @llvm.lifetime.end.p0(i64 50, ptr nonnull %12) #3
  call void @llvm.lifetime.end.p0(i64 50, ptr nonnull %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #3
  ret i32 %.052
}

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

declare ptr @EVP_MD_fetch(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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 i32 @EVP_DigestUpdate(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

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

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

declare i32 @OBJ_obj2nid(ptr noundef) local_unnamed_addr #1

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

declare ptr @EVP_Q_mac(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #1

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

declare void @EVP_MD_free(ptr noundef) local_unnamed_addr #1

declare void @EVP_MD_CTX_free(ptr noundef) local_unnamed_addr #1

declare void @ERR_add_error_data(i32 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 = { 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 #3 = { 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 24}
!10 = !{!"ossl_crmf_pbmparameter_st", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!13, !11, i64 0}
!13 = !{!"X509_algor_st", !11, i64 0, !11, i64 8}
!14 = !{!10, !11, i64 8}
!15 = !{!10, !11, i64 0}
!16 = !{!17, !11, i64 8}
!17 = !{!"asn1_string_st", !6, i64 0, !6, i64 4, !11, i64 8, !18, i64 16}
!18 = !{!"long", !7, i64 0}
!19 = !{!17, !6, i64 0}
!20 = !{!10, !11, i64 16}
!21 = !{!18, !18, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!11, !11, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass