; LLVM IR from intel/cryptography-primitives :: sources/ippcp (pcprsasign_pss_rmf)

; 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._cpBigNum = type { i32, i32, i32, i32, ptr, ptr }
%struct._cpHashMethod_rmf = type { i32, i32, i32, i32, ptr, ptr, ptr, ptr }
%struct._cpRSA_private_key = type { i32, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

; Function Attrs: nounwind uwtable
define dso_local i32 @ippsRSASign_PSS_rmf(ptr noundef %0, i32 noundef %1, ptr noundef %2, i32 noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef %8) #0 {
  %10 = alloca i32, align 4
  %11 = alloca ptr, 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 ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca [64 x i8], align 16
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca ptr, align 8
  %28 = alloca %struct._cpBigNum, align 8
  %29 = alloca %struct._cpBigNum, align 8
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca ptr, align 8
  %34 = alloca ptr, align 8
  %35 = alloca ptr, align 8
  %36 = alloca i32, align 4
  %37 = alloca ptr, align 8
  store ptr %0, ptr %11, align 8, !tbaa !5
  store i32 %1, ptr %12, align 4, !tbaa !9
  store ptr %2, ptr %13, align 8, !tbaa !5
  store i32 %3, ptr %14, align 4, !tbaa !9
  store ptr %4, ptr %15, align 8, !tbaa !5
  store ptr %5, ptr %16, align 8, !tbaa !5
  store ptr %6, ptr %17, align 8, !tbaa !5
  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) #4
  %38 = load ptr, ptr %11, align 8, !tbaa !5
  %39 = load i32, ptr %12, align 4, !tbaa !9
  %40 = load ptr, ptr %13, align 8, !tbaa !5
  %41 = load i32, ptr %14, align 4, !tbaa !9
  %42 = load ptr, ptr %15, align 8, !tbaa !5
  %43 = load ptr, ptr %18, align 8, !tbaa !5
  %44 = load ptr, ptr %19, align 8, !tbaa !5
  %45 = call i32 @SingleSignPssRmfPreproc(ptr noundef %38, i32 noundef %39, ptr noundef %40, i32 noundef %41, ptr noundef %42, ptr noundef %16, ptr noundef %17, ptr noundef %43, ptr noundef %44)
  store i32 %45, ptr %20, align 4, !tbaa !9
  %46 = load i32, ptr %20, align 4, !tbaa !9
  %47 = icmp ne i32 0, %46
  br i1 %47, label %48, label %50

48:                                               ; preds = %9
  %49 = load i32, ptr %20, align 4, !tbaa !9
  store i32 %49, ptr %10, align 4
  store i32 1, ptr %21, align 4
  br label %232

50:                                               ; preds = %9
  call void @llvm.lifetime.start.p0(i64 64, ptr %22) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #4
  %51 = load ptr, ptr %18, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct._cpHashMethod_rmf, ptr %51, i32 0, i32 1
  %53 = load i32, ptr %52, align 4, !tbaa !11
  store i32 %53, ptr %23, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #4
  %54 = load ptr, ptr %16, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct._cpRSA_private_key, ptr %54, i32 0, i32 3
  %56 = load i32, ptr %55, align 4, !tbaa !13
  store i32 %56, ptr %24, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #4
  %57 = load i32, ptr %24, align 4, !tbaa !9
  %58 = add nsw i32 %57, 7
  %59 = ashr i32 %58, 3
  store i32 %59, ptr %25, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #4
  %60 = load i32, ptr %24, align 4, !tbaa !9
  %61 = add nsw i32 %60, 64
  %62 = sub nsw i32 %61, 1
  %63 = sdiv i32 %62, 64
  store i32 %63, ptr %26, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #4
  %64 = load ptr, ptr %19, align 8, !tbaa !5
  %65 = load ptr, ptr %19, align 8, !tbaa !5
  %66 = call i64 @IPP_INT_PTR(ptr noundef %65)
  %67 = and i64 %66, 7
  %68 = xor i64 %67, -1
  %69 = add nsw i64 %68, 1
  %70 = and i64 %69, 7
  %71 = getelementptr inbounds i8, ptr %64, i64 %70
  store ptr %71, ptr %27, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %28) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr %29) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #4
  %72 = load i32, ptr %24, align 4, !tbaa !9
  %73 = sub nsw i32 %72, 1
  store i32 %73, ptr %30, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #4
  %74 = load i32, ptr %30, align 4, !tbaa !9
  %75 = add nsw i32 %74, 7
  %76 = ashr i32 %75, 3
  store i32 %76, ptr %31, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #4
  %77 = load i32, ptr %31, align 4, !tbaa !9
  %78 = load i32, ptr %23, align 4, !tbaa !9
  %79 = sub nsw i32 %77, %78
  %80 = load i32, ptr %14, align 4, !tbaa !9
  %81 = sub nsw i32 %79, %80
  %82 = sub nsw i32 %81, 2
  store i32 %82, ptr %32, align 4, !tbaa !9
  %83 = load i32, ptr %32, align 4, !tbaa !9
  %84 = icmp sgt i32 0, %83
  br i1 %84, label %85, label %86

85:                                               ; preds = %50
  store i32 -15, ptr %10, align 4
  store i32 1, ptr %21, align 4
  br label %231

86:                                               ; preds = %50
  %87 = load ptr, ptr %11, align 8, !tbaa !5
  %88 = load i32, ptr %12, align 4, !tbaa !9
  %89 = getelementptr inbounds [64 x i8], ptr %22, i64 0, i64 0
  %90 = load ptr, ptr %18, align 8, !tbaa !5
  %91 = call i32 @ippsHashMessage_rmf(ptr noundef %87, i32 noundef %88, ptr noundef %89, ptr noundef %90)
  %92 = load ptr, ptr %27, align 8, !tbaa !5
  %93 = load ptr, ptr %27, align 8, !tbaa !5
  %94 = load i32, ptr %26, align 4, !tbaa !9
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds i64, ptr %93, i64 %95
  %97 = getelementptr inbounds i64, ptr %96, i64 1
  %98 = load i32, ptr %26, align 4, !tbaa !9
  %99 = call ptr @BN_Make(ptr noundef %92, ptr noundef %97, i32 noundef %98, ptr noundef %28)
  %100 = load i32, ptr %26, align 4, !tbaa !9
  %101 = add nsw i32 %100, 1
  %102 = mul nsw i32 %101, 2
  %103 = load ptr, ptr %27, align 8, !tbaa !5
  %104 = sext i32 %102 to i64
  %105 = getelementptr inbounds i64, ptr %103, i64 %104
  store ptr %105, ptr %27, align 8, !tbaa !5
  %106 = load ptr, ptr %27, align 8, !tbaa !5
  %107 = load ptr, ptr %27, align 8, !tbaa !5
  %108 = load i32, ptr %26, align 4, !tbaa !9
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds i64, ptr %107, i64 %109
  %111 = getelementptr inbounds i64, ptr %110, i64 1
  %112 = load i32, ptr %26, align 4, !tbaa !9
  %113 = call ptr @BN_Make(ptr noundef %106, ptr noundef %111, i32 noundef %112, ptr noundef %29)
  %114 = load i32, ptr %26, align 4, !tbaa !9
  %115 = add nsw i32 %114, 1
  %116 = mul nsw i32 %115, 2
  %117 = load ptr, ptr %27, align 8, !tbaa !5
  %118 = sext i32 %116 to i64
  %119 = getelementptr inbounds i64, ptr %117, i64 %118
  store ptr %119, ptr %27, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #4
  %120 = getelementptr inbounds %struct._cpBigNum, ptr %29, i32 0, i32 4
  %121 = load ptr, ptr %120, align 8, !tbaa !15
  store ptr %121, ptr %33, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #4
  %122 = load ptr, ptr %15, align 8, !tbaa !5
  store ptr %122, ptr %34, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #4
  %123 = load ptr, ptr %15, align 8, !tbaa !5
  store ptr %123, ptr %35, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #4
  %124 = load i32, ptr %31, align 4, !tbaa !9
  %125 = load i32, ptr %23, align 4, !tbaa !9
  %126 = sub nsw i32 %124, %125
  %127 = sub nsw i32 %126, 1
  store i32 %127, ptr %36, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #4
  %128 = load ptr, ptr %15, align 8, !tbaa !5
  %129 = load i32, ptr %36, align 4, !tbaa !9
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds i8, ptr %128, i64 %130
  store ptr %131, ptr %37, align 8, !tbaa !5
  %132 = load ptr, ptr %33, align 8, !tbaa !5
  call void @PadBlock(i8 noundef zeroext 0, ptr noundef %132, i32 noundef 8)
  %133 = getelementptr inbounds [64 x i8], ptr %22, i64 0, i64 0
  %134 = load ptr, ptr %33, align 8, !tbaa !5
  %135 = getelementptr inbounds i8, ptr %134, i64 8
  %136 = load i32, ptr %23, align 4, !tbaa !9
  call void @CopyBlock(ptr noundef %133, ptr noundef %135, i32 noundef %136)
  %137 = load ptr, ptr %13, align 8, !tbaa !5
  %138 = load ptr, ptr %33, align 8, !tbaa !5
  %139 = getelementptr inbounds i8, ptr %138, i64 8
  %140 = load i32, ptr %23, align 4, !tbaa !9
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds i8, ptr %139, i64 %141
  %143 = load i32, ptr %14, align 4, !tbaa !9
  call void @CopyBlock(ptr noundef %137, ptr noundef %142, i32 noundef %143)
  %144 = load ptr, ptr %34, align 8, !tbaa !5
  %145 = load i32, ptr %31, align 4, !tbaa !9
  %146 = sub nsw i32 %145, 1
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds i8, ptr %144, i64 %147
  store i8 -68, ptr %148, align 1, !tbaa !17
  %149 = load ptr, ptr %33, align 8, !tbaa !5
  %150 = load i32, ptr %23, align 4, !tbaa !9
  %151 = add nsw i32 8, %150
  %152 = load i32, ptr %14, align 4, !tbaa !9
  %153 = add nsw i32 %151, %152
  %154 = load ptr, ptr %37, align 8, !tbaa !5
  %155 = load ptr, ptr %18, align 8, !tbaa !5
  %156 = call i32 @ippsHashMessage_rmf(ptr noundef %149, i32 noundef %153, ptr noundef %154, ptr noundef %155)
  %157 = load ptr, ptr %37, align 8, !tbaa !5
  %158 = load i32, ptr %23, align 4, !tbaa !9
  %159 = load ptr, ptr %35, align 8, !tbaa !5
  %160 = load i32, ptr %36, align 4, !tbaa !9
  %161 = load ptr, ptr %18, align 8, !tbaa !5
  %162 = call i32 @ippsMGF1_rmf(ptr noundef %157, i32 noundef %158, ptr noundef %159, i32 noundef %160, ptr noundef %161)
  %163 = load ptr, ptr %35, align 8, !tbaa !5
  %164 = load i32, ptr %32, align 4, !tbaa !9
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds i8, ptr %163, i64 %165
  %167 = getelementptr inbounds i8, ptr %166, i64 1
  %168 = load ptr, ptr %13, align 8, !tbaa !5
  %169 = load ptr, ptr %35, align 8, !tbaa !5
  %170 = load i32, ptr %32, align 4, !tbaa !9
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds i8, ptr %169, i64 %171
  %173 = getelementptr inbounds i8, ptr %172, i64 1
  %174 = load i32, ptr %14, align 4, !tbaa !9
  call void @XorBlock(ptr noundef %167, ptr noundef %168, ptr noundef %173, i32 noundef %174)
  %175 = load ptr, ptr %35, align 8, !tbaa !5
  %176 = load i32, ptr %32, align 4, !tbaa !9
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds i8, ptr %175, i64 %177
  %179 = load i8, ptr %178, align 1, !tbaa !17
  %180 = zext i8 %179 to i32
  %181 = xor i32 %180, 1
  %182 = trunc i32 %181 to i8
  store i8 %182, ptr %178, align 1, !tbaa !17
  %183 = load i32, ptr %31, align 4, !tbaa !9
  %184 = mul nsw i32 8, %183
  %185 = sub nsw i32 8, %184
  %186 = load i32, ptr %30, align 4, !tbaa !9
  %187 = add nsw i32 %185, %186
  %188 = and i32 %187, 31
  %189 = sub nsw i32 32, %188
  %190 = and i32 %189, 31
  %191 = lshr i32 -1, %190
  %192 = load ptr, ptr %35, align 8, !tbaa !5
  %193 = getelementptr inbounds i8, ptr %192, i64 0
  %194 = load i8, ptr %193, align 1, !tbaa !17
  %195 = zext i8 %194 to i32
  %196 = and i32 %195, %191
  %197 = trunc i32 %196 to i8
  store i8 %197, ptr %193, align 1, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #4
  %198 = load ptr, ptr %15, align 8, !tbaa !5
  %199 = load i32, ptr %31, align 4, !tbaa !9
  %200 = call i32 @ippsSetOctString_BN(ptr noundef %198, i32 noundef %199, ptr noundef %28)
  %201 = load ptr, ptr %16, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct._cpRSA_private_key, ptr %201, i32 0, i32 0
  %203 = load i32, ptr %202, align 8, !tbaa !18
  %204 = load ptr, ptr %16, align 8, !tbaa !5
  %205 = call i64 @IPP_UINT_PTR(ptr noundef %204)
  %206 = trunc i64 %205 to i32
  %207 = xor i32 %203, %206
  %208 = icmp eq i32 %207, 1381187889
  br i1 %208, label %209, label %212

209:                                              ; preds = %86
  %210 = load ptr, ptr %16, align 8, !tbaa !5
  %211 = load ptr, ptr %27, align 8, !tbaa !5
  call void @gsRSAprv_cipher(ptr noundef %29, ptr noundef %28, ptr noundef %210, ptr noundef %211)
  br label %215

212:                                              ; preds = %86
  %213 = load ptr, ptr %16, align 8, !tbaa !5
  %214 = load ptr, ptr %27, align 8, !tbaa !5
  call void @gsRSAprv_cipher_crt(ptr noundef %29, ptr noundef %28, ptr noundef %213, ptr noundef %214)
  br label %215

215:                                              ; preds = %212, %209
  %216 = load ptr, ptr %15, align 8, !tbaa !5
  %217 = load i32, ptr %25, align 4, !tbaa !9
  %218 = call i32 @ippsGetOctString_BN(ptr noundef %216, i32 noundef %217, ptr noundef %29)
  %219 = load ptr, ptr %17, align 8, !tbaa !5
  %220 = icmp ne ptr %219, null
  br i1 %220, label %222, label %221

221:                                              ; preds = %215
  store i32 0, ptr %10, align 4
  store i32 1, ptr %21, align 4
  br label %231

222:                                              ; preds = %215
  %223 = load ptr, ptr %17, align 8, !tbaa !5
  %224 = load ptr, ptr %27, align 8, !tbaa !5
  call void @gsRSApub_cipher(ptr noundef %29, ptr noundef %29, ptr noundef %223, ptr noundef %224)
  %225 = call i32 @cpBN_cmp(ptr noundef %29, ptr noundef %28)
  %226 = icmp eq i32 0, %225
  br i1 %226, label %227, label %228

227:                                              ; preds = %222
  store i32 0, ptr %10, align 4
  store i32 1, ptr %21, align 4
  br label %231

228:                                              ; preds = %222
  %229 = load ptr, ptr %15, align 8, !tbaa !5
  %230 = load i32, ptr %25, align 4, !tbaa !9
  call void @PadBlock(i8 noundef zeroext 0, ptr noundef %229, i32 noundef %230)
  store i32 -2, ptr %10, align 4
  store i32 1, ptr %21, align 4
  br label %231

231:                                              ; preds = %228, %227, %221, %85
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %29) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %28) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr %22) #4
  br label %232

232:                                              ; preds = %231, %48
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  %233 = load i32, ptr %10, align 4
  ret i32 %233
}

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @SingleSignPssRmfPreproc(ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @IPP_INT_PTR(ptr noundef) #2

declare i32 @ippsHashMessage_rmf(ptr noundef, i32 noundef, ptr noundef, ptr noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @BN_Make(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @PadBlock(i8 noundef zeroext, ptr noundef, i32 noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @CopyBlock(ptr noundef, ptr noundef, i32 noundef) #2

declare i32 @ippsMGF1_rmf(ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @XorBlock(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #2

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

declare i32 @ippsSetOctString_BN(ptr noundef, i32 noundef, ptr noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @IPP_UINT_PTR(ptr noundef) #2

declare void @gsRSAprv_cipher(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #3

declare void @gsRSAprv_cipher_crt(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #3

declare i32 @ippsGetOctString_BN(ptr noundef, i32 noundef, ptr noundef) #3

declare void @gsRSApub_cipher(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @cpBN_cmp(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 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

!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, !10, i64 4}
!12 = !{!"_cpHashMethod_rmf", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!13 = !{!14, !10, i64 12}
!14 = !{!"_cpRSA_private_key", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80}
!15 = !{!16, !6, i64 16}
!16 = !{!"_cpBigNum", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !6, i64 16, !6, i64 24}
!17 = !{!7, !7, i64 0}
!18 = !{!14, !10, 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"

%struct._cpBigNum = type { i32, i32, i32, i32, ptr, ptr }

; Function Attrs: nounwind uwtable
define dso_local i32 @ippsRSASign_PSS_rmf(ptr noundef %0, i32 noundef %1, ptr noundef %2, i32 noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef %8) local_unnamed_addr #0 {
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca [64 x i8], align 16
  %13 = alloca %struct._cpBigNum, align 8
  %14 = alloca %struct._cpBigNum, align 8
  store ptr %5, ptr %10, align 8, !tbaa !5
  store ptr %6, ptr %11, align 8, !tbaa !5
  %15 = call i32 @SingleSignPssRmfPreproc(ptr noundef %0, i32 noundef %1, ptr noundef %2, i32 noundef %3, ptr noundef %4, ptr noundef nonnull %10, ptr noundef nonnull %11, ptr noundef %7, ptr noundef %8)
  %.not = icmp eq i32 %15, 0
  br i1 %.not, label %16, label %95

16:                                               ; preds = %9
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %12) #4
  %17 = getelementptr inbounds i8, ptr %7, i64 4
  %18 = load i32, ptr %17, align 4, !tbaa !9
  %19 = load ptr, ptr %10, align 8, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %19, i64 12
  %21 = load i32, ptr %20, align 4, !tbaa !12
  %22 = add nsw i32 %21, 7
  %23 = ashr i32 %22, 3
  %24 = call i64 @IPP_INT_PTR(ptr noundef %8)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %13) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %14) #4
  %25 = add nsw i32 %21, 6
  %26 = ashr i32 %25, 3
  %27 = sub nsw i32 %26, %18
  %28 = sub nsw i32 %27, %3
  %29 = icmp slt i32 %28, 2
  br i1 %29, label %94, label %30

30:                                               ; preds = %16
  %31 = sub i64 0, %24
  %32 = and i64 %31, 7
  %33 = getelementptr inbounds i8, ptr %8, i64 %32
  %34 = add nsw i32 %21, 63
  %35 = sdiv i32 %34, 64
  %36 = call i32 @ippsHashMessage_rmf(ptr noundef %0, i32 noundef %1, ptr noundef nonnull %12, ptr noundef nonnull %7) #4
  %37 = sext i32 %35 to i64
  %38 = getelementptr inbounds i64, ptr %33, i64 %37
  %39 = getelementptr inbounds i8, ptr %38, i64 8
  %40 = call ptr @BN_Make(ptr noundef %33, ptr noundef nonnull %39, i32 noundef %35, ptr noundef nonnull %13)
  %41 = shl nsw i32 %35, 1
  %42 = add nsw i32 %41, 2
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds i64, ptr %33, i64 %43
  %45 = getelementptr inbounds i64, ptr %44, i64 %37
  %46 = getelementptr inbounds i8, ptr %45, i64 8
  %47 = call ptr @BN_Make(ptr noundef %44, ptr noundef nonnull %46, i32 noundef %35, ptr noundef nonnull %14)
  %48 = getelementptr inbounds i64, ptr %44, i64 %43
  %49 = getelementptr inbounds i8, ptr %14, i64 16
  %50 = load ptr, ptr %49, align 8, !tbaa !14
  %51 = add nsw i32 %27, -1
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds i8, ptr %4, i64 %52
  call void @PadBlock(i8 noundef zeroext 0, ptr noundef %50, i32 noundef 8)
  %54 = getelementptr inbounds i8, ptr %50, i64 8
  call void @CopyBlock(ptr noundef nonnull %12, ptr noundef nonnull %54, i32 noundef %18)
  %55 = sext i32 %18 to i64
  %56 = getelementptr inbounds i8, ptr %54, i64 %55
  call void @CopyBlock(ptr noundef %2, ptr noundef nonnull %56, i32 noundef %3)
  %57 = sext i32 %26 to i64
  %58 = getelementptr i8, ptr %4, i64 %57
  %59 = getelementptr i8, ptr %58, i64 -1
  store i8 -68, ptr %59, align 1, !tbaa !16
  %60 = add i32 %3, 8
  %61 = add i32 %60, %18
  %62 = call i32 @ippsHashMessage_rmf(ptr noundef %50, i32 noundef %61, ptr noundef %53, ptr noundef nonnull %7) #4
  %63 = call i32 @ippsMGF1_rmf(ptr noundef %53, i32 noundef %18, ptr noundef %4, i32 noundef %51, ptr noundef nonnull %7) #4
  %64 = zext nneg i32 %28 to i64
  %65 = getelementptr i8, ptr %4, i64 %64
  %66 = getelementptr i8, ptr %65, i64 -2
  %67 = getelementptr i8, ptr %65, i64 -1
  call void @XorBlock(ptr noundef %67, ptr noundef %2, ptr noundef %67, i32 noundef %3)
  %68 = load i8, ptr %66, align 1, !tbaa !16
  %69 = xor i8 %68, 1
  store i8 %69, ptr %66, align 1, !tbaa !16
  %70 = and i32 %25, 24
  %reass.sub = sub i32 %70, %21
  %71 = add i32 %reass.sub, 25
  %72 = and i32 %71, 31
  %73 = lshr i32 -1, %72
  %74 = load i8, ptr %4, align 1, !tbaa !16
  %75 = trunc i32 %73 to i8
  %76 = and i8 %74, %75
  store i8 %76, ptr %4, align 1, !tbaa !16
  %77 = call i32 @ippsSetOctString_BN(ptr noundef nonnull %4, i32 noundef %26, ptr noundef nonnull %13) #4
  %78 = load ptr, ptr %10, align 8, !tbaa !5
  %79 = load i32, ptr %78, align 8, !tbaa !17
  %80 = call i64 @IPP_UINT_PTR(ptr noundef nonnull %78)
  %81 = trunc i64 %80 to i32
  %82 = xor i32 %79, %81
  %83 = icmp eq i32 %82, 1381187889
  %84 = load ptr, ptr %10, align 8, !tbaa !5
  br i1 %83, label %85, label %86

85:                                               ; preds = %30
  call void @gsRSAprv_cipher(ptr noundef nonnull %14, ptr noundef nonnull %13, ptr noundef %84, ptr noundef %48) #4
  br label %87

86:                                               ; preds = %30
  call void @gsRSAprv_cipher_crt(ptr noundef nonnull %14, ptr noundef nonnull %13, ptr noundef %84, ptr noundef %48) #4
  br label %87

87:                                               ; preds = %86, %85
  %88 = call i32 @ippsGetOctString_BN(ptr noundef nonnull %4, i32 noundef %23, ptr noundef nonnull %14) #4
  %89 = load ptr, ptr %11, align 8, !tbaa !5
  %.not83 = icmp eq ptr %89, null
  br i1 %.not83, label %94, label %90

90:                                               ; preds = %87
  call void @gsRSApub_cipher(ptr noundef nonnull %14, ptr noundef nonnull %14, ptr noundef nonnull %89, ptr noundef %48) #4
  %91 = call i32 @cpBN_cmp(ptr noundef nonnull %14, ptr noundef nonnull %13)
  %92 = icmp eq i32 %91, 0
  br i1 %92, label %94, label %93

93:                                               ; preds = %90
  call void @PadBlock(i8 noundef zeroext 0, ptr noundef nonnull %4, i32 noundef %23)
  br label %94

94:                                               ; preds = %90, %87, %16, %93
  %.0 = phi i32 [ -2, %93 ], [ -15, %16 ], [ 0, %87 ], [ 0, %90 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %14) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %13) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %12) #4
  br label %95

95:                                               ; preds = %9, %94
  %.1 = phi i32 [ %.0, %94 ], [ %15, %9 ]
  ret i32 %.1
}

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @SingleSignPssRmfPreproc(ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @IPP_INT_PTR(ptr noundef) local_unnamed_addr #2

declare i32 @ippsHashMessage_rmf(ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @BN_Make(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @PadBlock(i8 noundef zeroext, ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @CopyBlock(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare i32 @ippsMGF1_rmf(ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @XorBlock(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

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

declare i32 @ippsSetOctString_BN(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @IPP_UINT_PTR(ptr noundef) local_unnamed_addr #2

declare void @gsRSAprv_cipher(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare void @gsRSAprv_cipher_crt(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @ippsGetOctString_BN(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

declare void @gsRSApub_cipher(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @cpBN_cmp(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 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

!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, !11, i64 4}
!10 = !{!"_cpHashMethod_rmf", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !11, i64 12}
!13 = !{!"_cpRSA_private_key", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80}
!14 = !{!15, !6, i64 16}
!15 = !{!"_cpBigNum", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !6, i64 16, !6, i64 24}
!16 = !{!7, !7, i64 0}
!17 = !{!13, !11, i64 0}


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