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

; 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._cpGFpElement = type { i32, i32, ptr }
%struct._cpGFpECPoint = type { i32, i32, i32, ptr }
%struct._cpGFpEC = type { i32, i32, ptr, i32, i32, i32, ptr, ptr, ptr, ptr, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct._cpGFp = type { i32, i32, ptr }
%struct._cpBigNum = type { i32, i32, i32, i32, ptr, ptr }
%struct._gsModEngine = type { ptr, i32, i32, i32, i32, i32, ptr, ptr, ptr, i64, ptr, ptr, ptr, ptr, i32, i32, ptr }
%struct._gsModMethod = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

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

28:                                               ; preds = %5
  store i32 -8, ptr %6, align 4
  store i32 1, ptr %14, align 4
  br label %227

29:                                               ; preds = %5
  %30 = load ptr, ptr %11, align 8, !tbaa !5
  %31 = icmp eq ptr null, %30
  br i1 %31, label %32, label %33

32:                                               ; preds = %29
  store i32 -8, ptr %6, align 4
  store i32 1, ptr %14, align 4
  br label %227

33:                                               ; preds = %29
  %34 = load ptr, ptr %10, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct._cpGFpEC, ptr %34, i32 0, i32 0
  %36 = load i32, ptr %35, align 8, !tbaa !9
  %37 = load ptr, ptr %10, align 8, !tbaa !5
  %38 = call i64 @IPP_UINT_PTR(ptr noundef %37)
  %39 = trunc i64 %38 to i32
  %40 = xor i32 %36, %39
  %41 = icmp eq i32 %40, 1129136461
  br i1 %41, label %43, label %42

42:                                               ; preds = %33
  store i32 -13, ptr %6, align 4
  store i32 1, ptr %14, align 4
  br label %227

43:                                               ; preds = %33
  %44 = load ptr, ptr %10, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct._cpGFpEC, ptr %44, i32 0, i32 3
  %46 = load i32, ptr %45, align 8, !tbaa !12
  %47 = icmp ne i32 %46, 0
  br i1 %47, label %49, label %48

48:                                               ; preds = %43
  store i32 -13, ptr %6, align 4
  store i32 1, ptr %14, align 4
  br label %227

49:                                               ; preds = %43
  %50 = load ptr, ptr %10, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct._cpGFpEC, ptr %50, i32 0, i32 2
  %52 = load ptr, ptr %51, align 8, !tbaa !13
  store ptr %52, ptr %12, align 8, !tbaa !5
  %53 = load ptr, ptr %12, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct._cpGFp, ptr %53, i32 0, i32 2
  %55 = load ptr, ptr %54, align 8, !tbaa !14
  store ptr %55, ptr %13, align 8, !tbaa !5
  %56 = load ptr, ptr %7, align 8, !tbaa !5
  %57 = icmp eq ptr null, %56
  br i1 %57, label %58, label %59

58:                                               ; preds = %49
  store i32 -8, ptr %6, align 4
  store i32 1, ptr %14, align 4
  br label %227

59:                                               ; preds = %49
  %60 = load ptr, ptr %7, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct._cpBigNum, ptr %60, i32 0, i32 0
  %62 = load i32, ptr %61, align 8, !tbaa !16
  %63 = load ptr, ptr %7, align 8, !tbaa !5
  %64 = call i64 @IPP_UINT_PTR(ptr noundef %63)
  %65 = trunc i64 %64 to i32
  %66 = xor i32 %62, %65
  %67 = icmp eq i32 %66, 1112098638
  br i1 %67, label %69, label %68

68:                                               ; preds = %59
  store i32 -13, ptr %6, align 4
  store i32 1, ptr %14, align 4
  br label %227

69:                                               ; preds = %59
  %70 = load ptr, ptr %7, align 8, !tbaa !5
  %71 = load ptr, ptr %10, align 8, !tbaa !5
  %72 = call i32 @gfec_CheckPrivateKey(ptr noundef %70, ptr noundef %71)
  %73 = icmp eq i32 0, %72
  br i1 %73, label %74, label %75

74:                                               ; preds = %69
  store i32 -1008, ptr %6, align 4
  store i32 1, ptr %14, align 4
  br label %227

75:                                               ; preds = %69
  %76 = load ptr, ptr %8, align 8, !tbaa !5
  %77 = icmp eq ptr null, %76
  br i1 %77, label %78, label %79

78:                                               ; preds = %75
  store i32 -8, ptr %6, align 4
  store i32 1, ptr %14, align 4
  br label %227

79:                                               ; preds = %75
  %80 = load ptr, ptr %8, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct._cpGFpECPoint, ptr %80, i32 0, i32 0
  %82 = load i32, ptr %81, align 8, !tbaa !18
  %83 = load ptr, ptr %8, align 8, !tbaa !5
  %84 = call i64 @IPP_UINT_PTR(ptr noundef %83)
  %85 = trunc i64 %84 to i32
  %86 = xor i32 %82, %85
  %87 = icmp eq i32 %86, 1129136462
  br i1 %87, label %89, label %88

88:                                               ; preds = %79
  store i32 -13, ptr %6, align 4
  store i32 1, ptr %14, align 4
  br label %227

89:                                               ; preds = %79
  %90 = load ptr, ptr %8, align 8, !tbaa !5
  %91 = load ptr, ptr %10, align 8, !tbaa !5
  %92 = call i32 @gfec_IsPointOnCurve(ptr noundef %90, ptr noundef %91)
  %93 = icmp eq i32 0, %92
  br i1 %93, label %94, label %95

94:                                               ; preds = %89
  store i32 -1017, ptr %6, align 4
  store i32 1, ptr %14, align 4
  br label %227

95:                                               ; preds = %89
  %96 = load ptr, ptr %9, align 8, !tbaa !5
  %97 = icmp eq ptr null, %96
  br i1 %97, label %98, label %99

98:                                               ; preds = %95
  store i32 -8, ptr %6, align 4
  store i32 1, ptr %14, align 4
  br label %227

99:                                               ; preds = %95
  %100 = load ptr, ptr %9, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct._cpBigNum, ptr %100, i32 0, i32 0
  %102 = load i32, ptr %101, align 8, !tbaa !16
  %103 = load ptr, ptr %9, align 8, !tbaa !5
  %104 = call i64 @IPP_UINT_PTR(ptr noundef %103)
  %105 = trunc i64 %104 to i32
  %106 = xor i32 %102, %105
  %107 = icmp eq i32 %106, 1112098638
  br i1 %107, label %109, label %108

108:                                              ; preds = %99
  store i32 -13, ptr %6, align 4
  store i32 1, ptr %14, align 4
  br label %227

109:                                              ; preds = %99
  %110 = load ptr, ptr %9, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct._cpBigNum, ptr %110, i32 0, i32 3
  %112 = load i32, ptr %111, align 4, !tbaa !20
  %113 = load ptr, ptr %13, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct._gsModEngine, ptr %113, i32 0, i32 3
  %115 = load i32, ptr %114, align 8, !tbaa !21
  %116 = icmp slt i32 %112, %115
  br i1 %116, label %117, label %118

117:                                              ; preds = %109
  store i32 -7, ptr %6, align 4
  store i32 1, ptr %14, align 4
  br label %227

118:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %119 = load ptr, ptr %10, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct._cpGFpEC, ptr %119, i32 0, i32 9
  %121 = load ptr, ptr %120, align 8, !tbaa !24
  store ptr %121, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %122 = load ptr, ptr %13, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct._gsModEngine, ptr %122, i32 0, i32 3
  %124 = load i32, ptr %123, align 8, !tbaa !21
  store i32 %124, ptr %16, align 4, !tbaa !25
  %125 = load ptr, ptr %15, align 8, !tbaa !5
  %126 = load i32, ptr %16, align 4, !tbaa !25
  %127 = call i32 @cpGFpElementLen(ptr noundef %125, i32 noundef %126)
  store i32 %127, ptr %16, align 4, !tbaa !25
  %128 = load ptr, ptr %15, align 8, !tbaa !5
  %129 = load i32, ptr %16, align 4, !tbaa !25
  %130 = call i32 @cpGFpElementIsEquChunk(ptr noundef %128, i32 noundef %129, i64 noundef 1)
  %131 = icmp ne i32 %130, 0
  br i1 %131, label %132, label %139

132:                                              ; preds = %118
  %133 = load ptr, ptr %7, align 8, !tbaa !5
  %134 = load ptr, ptr %8, align 8, !tbaa !5
  %135 = load ptr, ptr %9, align 8, !tbaa !5
  %136 = load ptr, ptr %10, align 8, !tbaa !5
  %137 = load ptr, ptr %11, align 8, !tbaa !5
  %138 = call i32 @ippsGFpECSharedSecretDH(ptr noundef %133, ptr noundef %134, ptr noundef %135, ptr noundef %136, ptr noundef %137)
  store i32 %138, ptr %6, align 4
  store i32 1, ptr %14, align 4
  br label %226

139:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  %140 = load ptr, ptr %13, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct._gsModEngine, ptr %140, i32 0, i32 3
  %142 = load i32, ptr %141, align 8, !tbaa !21
  store i32 %142, ptr %17, align 4, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr %19) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  %143 = load ptr, ptr %10, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct._cpGFpEC, ptr %143, i32 0, i32 13
  %145 = load ptr, ptr %144, align 8, !tbaa !26
  store ptr %145, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #4
  %146 = load ptr, ptr %21, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct._gsModEngine, ptr %146, i32 0, i32 3
  %148 = load i32, ptr %147, align 8, !tbaa !21
  store i32 %148, ptr %22, align 4, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #4
  %149 = load ptr, ptr %13, align 8, !tbaa !5
  %150 = call ptr @gsModPoolAlloc(ptr noundef %149, i32 noundef 2)
  store ptr %150, ptr %23, align 8, !tbaa !5
  %151 = load ptr, ptr %23, align 8, !tbaa !5
  %152 = load ptr, ptr %7, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct._cpBigNum, ptr %152, i32 0, i32 4
  %154 = load ptr, ptr %153, align 8, !tbaa !27
  %155 = load ptr, ptr %7, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct._cpBigNum, ptr %155, i32 0, i32 2
  %157 = load i32, ptr %156, align 8, !tbaa !28
  %158 = load ptr, ptr %21, align 8, !tbaa !5
  %159 = call i32 @cpMontEnc_BNU_EX(ptr noundef %151, ptr noundef %154, i32 noundef %157, ptr noundef %158)
  %160 = load ptr, ptr %23, align 8, !tbaa !5
  %161 = load ptr, ptr %23, align 8, !tbaa !5
  %162 = load i32, ptr %22, align 4, !tbaa !25
  %163 = load ptr, ptr %15, align 8, !tbaa !5
  %164 = load i32, ptr %16, align 4, !tbaa !25
  %165 = load ptr, ptr %21, align 8, !tbaa !5
  %166 = call i32 @cpMontMul_BNU_EX(ptr noundef %160, ptr noundef %161, i32 noundef %162, ptr noundef %163, i32 noundef %164, ptr noundef %165)
  %167 = load ptr, ptr %10, align 8, !tbaa !5
  %168 = call ptr @cpEcGFpGetPool(i32 noundef 1, ptr noundef %167)
  %169 = load ptr, ptr %10, align 8, !tbaa !5
  %170 = call ptr @cpEcGFpInitPoint(ptr noundef %19, ptr noundef %168, i32 noundef 0, ptr noundef %169)
  %171 = load ptr, ptr %8, align 8, !tbaa !5
  %172 = load ptr, ptr %23, align 8, !tbaa !5
  %173 = load i32, ptr %22, align 4, !tbaa !25
  %174 = load ptr, ptr %10, align 8, !tbaa !5
  %175 = load ptr, ptr %11, align 8, !tbaa !5
  %176 = call ptr @gfec_MulPoint(ptr noundef %19, ptr noundef %171, ptr noundef %172, i32 noundef %173, ptr noundef %174, ptr noundef %175)
  %177 = load ptr, ptr %23, align 8, !tbaa !5
  %178 = load i32, ptr %17, align 4, !tbaa !25
  %179 = call ptr @cpGFpElementConstruct(ptr noundef %18, ptr noundef %177, i32 noundef %178)
  %180 = getelementptr inbounds %struct._cpGFpElement, ptr %18, i32 0, i32 2
  %181 = load ptr, ptr %180, align 8, !tbaa !29
  %182 = load ptr, ptr %10, align 8, !tbaa !5
  %183 = call i32 @gfec_GetPoint(ptr noundef %181, ptr noundef null, ptr noundef %19, ptr noundef %182)
  store i32 %183, ptr %20, align 4, !tbaa !25
  %184 = load i32, ptr %20, align 4, !tbaa !25
  %185 = icmp ne i32 %184, 0
  br i1 %185, label %186, label %219

186:                                              ; preds = %139
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #4
  %187 = load ptr, ptr %9, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct._cpBigNum, ptr %187, i32 0, i32 4
  %189 = load ptr, ptr %188, align 8, !tbaa !27
  store ptr %189, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #4
  %190 = load ptr, ptr %9, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct._cpBigNum, ptr %190, i32 0, i32 3
  %192 = load i32, ptr %191, align 4, !tbaa !20
  store i32 %192, ptr %25, align 4, !tbaa !25
  %193 = load ptr, ptr %13, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct._gsModEngine, ptr %193, i32 0, i32 6
  %195 = load ptr, ptr %194, align 8, !tbaa !31
  %196 = getelementptr inbounds %struct._gsModMethod, ptr %195, i32 0, i32 1
  %197 = load ptr, ptr %196, align 8, !tbaa !32
  %198 = load ptr, ptr %24, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct._cpGFpElement, ptr %18, i32 0, i32 2
  %200 = load ptr, ptr %199, align 8, !tbaa !29
  %201 = load ptr, ptr %13, align 8, !tbaa !5
  %202 = call ptr %197(ptr noundef %198, ptr noundef %200, ptr noundef %201)
  %203 = load ptr, ptr %24, align 8, !tbaa !5
  %204 = load i32, ptr %17, align 4, !tbaa !25
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds i64, ptr %203, i64 %205
  %207 = load i32, ptr %25, align 4, !tbaa !25
  %208 = load i32, ptr %17, align 4, !tbaa !25
  %209 = sub nsw i32 %207, %208
  %210 = call ptr @cpGFpElementPad(ptr noundef %206, i32 noundef %209, i64 noundef 0)
  %211 = load ptr, ptr %9, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct._cpBigNum, ptr %211, i32 0, i32 1
  store i32 1, ptr %212, align 4, !tbaa !34
  %213 = load ptr, ptr %24, align 8, !tbaa !5
  %214 = load i32, ptr %25, align 4, !tbaa !25
  %215 = call i32 @cpFix_BNU(ptr noundef %213, i32 noundef %214)
  store i32 %215, ptr %25, align 4, !tbaa !25
  %216 = load i32, ptr %25, align 4, !tbaa !25
  %217 = load ptr, ptr %9, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct._cpBigNum, ptr %217, i32 0, i32 2
  store i32 %216, ptr %218, align 8, !tbaa !28
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #4
  br label %219

219:                                              ; preds = %186, %139
  %220 = load ptr, ptr %13, align 8, !tbaa !5
  call void @gsModPoolFree(ptr noundef %220, i32 noundef 2)
  %221 = load ptr, ptr %10, align 8, !tbaa !5
  call void @cpEcGFpReleasePool(i32 noundef 1, ptr noundef %221)
  %222 = load i32, ptr %20, align 4, !tbaa !25
  %223 = icmp ne i32 %222, 0
  %224 = zext i1 %223 to i64
  %225 = select i1 %223, i32 0, i32 -1009
  store i32 %225, ptr %6, align 4
  store i32 1, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  br label %226

226:                                              ; preds = %219, %132
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  br label %227

227:                                              ; preds = %226, %117, %108, %98, %94, %88, %78, %74, %68, %58, %48, %42, %32, %28
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  %228 = load i32, ptr %6, align 4
  ret i32 %228
}

; 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 i64 @IPP_UINT_PTR(ptr noundef) #2

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

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

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @cpFix_BNU(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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @cpEcGFpReleasePool(i32 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, !11, i64 0}
!10 = !{!"_cpGFpEC", !11, i64 0, !11, i64 4, !6, i64 8, !11, i64 16, !11, i64 20, !11, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !11, i64 64, !11, i64 68, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !11, i64 16}
!13 = !{!10, !6, i64 8}
!14 = !{!15, !6, i64 8}
!15 = !{!"_cpGFp", !11, i64 0, !11, i64 4, !6, i64 8}
!16 = !{!17, !11, i64 0}
!17 = !{!"_cpBigNum", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !6, i64 16, !6, i64 24}
!18 = !{!19, !11, i64 0}
!19 = !{!"_cpGFpECPoint", !11, i64 0, !11, i64 4, !11, i64 8, !6, i64 16}
!20 = !{!17, !11, i64 12}
!21 = !{!22, !11, i64 16}
!22 = !{!"_gsModEngine", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !23, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !11, i64 96, !11, i64 100, !6, i64 104}
!23 = !{!"long long", !7, i64 0}
!24 = !{!10, !6, i64 56}
!25 = !{!11, !11, i64 0}
!26 = !{!10, !6, i64 80}
!27 = !{!17, !6, i64 16}
!28 = !{!17, !11, i64 8}
!29 = !{!30, !6, i64 8}
!30 = !{!"_cpGFpElement", !11, i64 0, !11, i64 4, !6, i64 8}
!31 = !{!22, !6, i64 32}
!32 = !{!33, !6, i64 8}
!33 = !{!"_gsModMethod", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80}
!34 = !{!17, !11, i64 4}


; 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._cpGFpElement = type { i32, i32, ptr }
%struct._cpGFpECPoint = type { i32, i32, i32, ptr }

; Function Attrs: nounwind uwtable
define dso_local i32 @ippsGFpECSharedSecretDHC(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) local_unnamed_addr #0 {
  %6 = alloca %struct._cpGFpElement, align 8
  %7 = alloca %struct._cpGFpECPoint, align 8
  %8 = icmp eq ptr %3, null
  %9 = icmp eq ptr %4, null
  %or.cond = or i1 %8, %9
  br i1 %or.cond, label %105, label %10

10:                                               ; preds = %5
  %11 = load i32, ptr %3, align 8, !tbaa !5
  %12 = tail call i64 @IPP_UINT_PTR(ptr noundef nonnull %3)
  %13 = trunc i64 %12 to i32
  %14 = xor i32 %11, %13
  %15 = icmp eq i32 %14, 1129136461
  br i1 %15, label %16, label %105

16:                                               ; preds = %10
  %17 = getelementptr inbounds i8, ptr %3, i64 16
  %18 = load i32, ptr %17, align 8, !tbaa !11
  %.not = icmp eq i32 %18, 0
  br i1 %.not, label %105, label %19

19:                                               ; preds = %16
  %20 = getelementptr inbounds i8, ptr %3, i64 8
  %21 = load ptr, ptr %20, align 8, !tbaa !12
  %22 = getelementptr inbounds i8, ptr %21, i64 8
  %23 = load ptr, ptr %22, align 8, !tbaa !13
  %24 = icmp eq ptr %0, null
  br i1 %24, label %105, label %25

25:                                               ; preds = %19
  %26 = load i32, ptr %0, align 8, !tbaa !15
  %27 = tail call i64 @IPP_UINT_PTR(ptr noundef nonnull %0)
  %28 = trunc i64 %27 to i32
  %29 = xor i32 %26, %28
  %30 = icmp eq i32 %29, 1112098638
  br i1 %30, label %31, label %105

31:                                               ; preds = %25
  %32 = tail call i32 @gfec_CheckPrivateKey(ptr noundef nonnull %0, ptr noundef nonnull %3) #4
  %33 = icmp eq i32 %32, 0
  br i1 %33, label %105, label %34

34:                                               ; preds = %31
  %35 = icmp eq ptr %1, null
  br i1 %35, label %105, label %36

36:                                               ; preds = %34
  %37 = load i32, ptr %1, align 8, !tbaa !17
  %38 = tail call i64 @IPP_UINT_PTR(ptr noundef nonnull %1)
  %39 = trunc i64 %38 to i32
  %40 = xor i32 %37, %39
  %41 = icmp eq i32 %40, 1129136462
  br i1 %41, label %42, label %105

42:                                               ; preds = %36
  %43 = tail call i32 @gfec_IsPointOnCurve(ptr noundef nonnull %1, ptr noundef nonnull %3) #4
  %44 = icmp eq i32 %43, 0
  br i1 %44, label %105, label %45

45:                                               ; preds = %42
  %46 = icmp eq ptr %2, null
  br i1 %46, label %105, label %47

47:                                               ; preds = %45
  %48 = load i32, ptr %2, align 8, !tbaa !15
  %49 = tail call i64 @IPP_UINT_PTR(ptr noundef nonnull %2)
  %50 = trunc i64 %49 to i32
  %51 = xor i32 %48, %50
  %52 = icmp eq i32 %51, 1112098638
  br i1 %52, label %53, label %105

53:                                               ; preds = %47
  %54 = getelementptr inbounds i8, ptr %2, i64 12
  %55 = load i32, ptr %54, align 4, !tbaa !19
  %56 = getelementptr inbounds i8, ptr %23, i64 16
  %57 = load i32, ptr %56, align 8, !tbaa !20
  %58 = icmp slt i32 %55, %57
  br i1 %58, label %105, label %59

59:                                               ; preds = %53
  %60 = getelementptr inbounds i8, ptr %3, i64 56
  %61 = load ptr, ptr %60, align 8, !tbaa !23
  %62 = tail call i32 @cpGFpElementLen(ptr noundef %61, i32 noundef %57)
  %63 = tail call i32 @cpGFpElementIsEquChunk(ptr noundef %61, i32 noundef %62, i64 noundef 1)
  %.not81 = icmp eq i32 %63, 0
  br i1 %.not81, label %66, label %64

64:                                               ; preds = %59
  %65 = tail call i32 @ippsGFpECSharedSecretDH(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %4) #4
  br label %105

66:                                               ; preds = %59
  %67 = load i32, ptr %56, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #4
  %68 = getelementptr inbounds i8, ptr %3, i64 80
  %69 = load ptr, ptr %68, align 8, !tbaa !24
  %70 = getelementptr inbounds i8, ptr %69, i64 16
  %71 = load i32, ptr %70, align 8, !tbaa !20
  %72 = tail call ptr @gsModPoolAlloc(ptr noundef nonnull %23, i32 noundef 2)
  %73 = getelementptr inbounds i8, ptr %0, i64 16
  %74 = load ptr, ptr %73, align 8, !tbaa !25
  %75 = getelementptr inbounds i8, ptr %0, i64 8
  %76 = load i32, ptr %75, align 8, !tbaa !26
  %77 = tail call i32 @cpMontEnc_BNU_EX(ptr noundef %72, ptr noundef %74, i32 noundef %76, ptr noundef %69)
  %78 = tail call i32 @cpMontMul_BNU_EX(ptr noundef %72, ptr noundef %72, i32 noundef %71, ptr noundef %61, i32 noundef %62, ptr noundef %69)
  %79 = tail call ptr @cpEcGFpGetPool(i32 noundef 1, ptr noundef nonnull %3)
  %80 = call ptr @cpEcGFpInitPoint(ptr noundef nonnull %7, ptr noundef %79, i32 noundef 0, ptr noundef nonnull %3)
  %81 = call ptr @gfec_MulPoint(ptr noundef nonnull %7, ptr noundef nonnull %1, ptr noundef %72, i32 noundef %71, ptr noundef nonnull %3, ptr noundef nonnull %4) #4
  %82 = call ptr @cpGFpElementConstruct(ptr noundef nonnull %6, ptr noundef %72, i32 noundef %67)
  %83 = getelementptr inbounds i8, ptr %6, i64 8
  %84 = load ptr, ptr %83, align 8, !tbaa !27
  %85 = call i32 @gfec_GetPoint(ptr noundef %84, ptr noundef null, ptr noundef nonnull %7, ptr noundef nonnull %3) #4
  %.not82 = icmp eq i32 %85, 0
  br i1 %.not82, label %103, label %86

86:                                               ; preds = %66
  %87 = getelementptr inbounds i8, ptr %2, i64 16
  %88 = load ptr, ptr %87, align 8, !tbaa !25
  %89 = load i32, ptr %54, align 4, !tbaa !19
  %90 = getelementptr inbounds i8, ptr %23, i64 32
  %91 = load ptr, ptr %90, align 8, !tbaa !29
  %92 = getelementptr inbounds i8, ptr %91, i64 8
  %93 = load ptr, ptr %92, align 8, !tbaa !30
  %94 = load ptr, ptr %83, align 8, !tbaa !27
  %95 = call ptr %93(ptr noundef %88, ptr noundef %94, ptr noundef nonnull %23) #4
  %96 = sext i32 %67 to i64
  %97 = getelementptr inbounds i64, ptr %88, i64 %96
  %98 = sub nsw i32 %89, %67
  %99 = call ptr @cpGFpElementPad(ptr noundef %97, i32 noundef %98, i64 noundef 0)
  %100 = getelementptr inbounds i8, ptr %2, i64 4
  store i32 1, ptr %100, align 4, !tbaa !32
  %101 = call i32 @cpFix_BNU(ptr noundef %88, i32 noundef %89)
  %102 = getelementptr inbounds i8, ptr %2, i64 8
  store i32 %101, ptr %102, align 8, !tbaa !26
  br label %103

103:                                              ; preds = %86, %66
  %104 = phi i32 [ 0, %86 ], [ -1009, %66 ]
  call void @gsModPoolFree(ptr noundef nonnull %23, i32 noundef 2)
  call void @cpEcGFpReleasePool(i32 noundef 1, ptr noundef nonnull %3)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #4
  br label %105

105:                                              ; preds = %64, %103, %53, %47, %45, %42, %36, %34, %31, %25, %19, %16, %10, %5
  %.1 = phi i32 [ -8, %5 ], [ -13, %10 ], [ -13, %16 ], [ -8, %19 ], [ -13, %25 ], [ -1008, %31 ], [ -8, %34 ], [ -13, %36 ], [ -1017, %42 ], [ -8, %45 ], [ -13, %47 ], [ -7, %53 ], [ %65, %64 ], [ %104, %103 ]
  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 i64 @IPP_UINT_PTR(ptr noundef) local_unnamed_addr #2

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

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

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @cpFix_BNU(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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @cpEcGFpReleasePool(i32 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, !7, i64 0}
!6 = !{!"_cpGFpEC", !7, i64 0, !7, i64 4, !10, i64 8, !7, i64 16, !7, i64 20, !7, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !7, i64 64, !7, i64 68, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !10, i64 112, !10, i64 120, !10, i64 128}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 16}
!12 = !{!6, !10, i64 8}
!13 = !{!14, !10, i64 8}
!14 = !{!"_cpGFp", !7, i64 0, !7, i64 4, !10, i64 8}
!15 = !{!16, !7, i64 0}
!16 = !{!"_cpBigNum", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !10, i64 16, !10, i64 24}
!17 = !{!18, !7, i64 0}
!18 = !{!"_cpGFpECPoint", !7, i64 0, !7, i64 4, !7, i64 8, !10, i64 16}
!19 = !{!16, !7, i64 12}
!20 = !{!21, !7, i64 16}
!21 = !{!"_gsModEngine", !10, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !22, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !7, i64 96, !7, i64 100, !10, i64 104}
!22 = !{!"long long", !8, i64 0}
!23 = !{!6, !10, i64 56}
!24 = !{!6, !10, i64 80}
!25 = !{!16, !10, i64 16}
!26 = !{!16, !7, i64 8}
!27 = !{!28, !10, i64 8}
!28 = !{!"_cpGFpElement", !7, i64 0, !7, i64 4, !10, i64 8}
!29 = !{!21, !10, i64 32}
!30 = !{!31, !10, i64 8}
!31 = !{!"_gsModMethod", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80}
!32 = !{!16, !7, i64 4}


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