; LLVM IR from openssl/openssl :: crypto/ec (ec_lib)

; 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.ec_group_st = type { ptr, ptr, ptr, ptr, i32, i32, i32, i32, ptr, i64, ptr, [6 x i32], ptr, ptr, i32, ptr, ptr, ptr, ptr, i32, %union.anon, ptr, ptr }
%union.anon = type { ptr }
%struct.ec_method_st = type { i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [68 x i8], align 1
@__func__.EC_GROUP_copy = external hidden unnamed_addr constant [14 x i8], align 1

declare void @ERR_new() #0

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

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

declare void @CRYPTO_free(ptr noundef, ptr noundef, i32 noundef) #0

declare void @BN_MONT_CTX_free(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @EC_POINT_clear_free(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @EC_GROUP_copy(ptr noundef %0, ptr noundef %1) #1 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %6 = load ptr, ptr %4, align 8, !tbaa !5
  %7 = getelementptr inbounds %struct.ec_group_st, ptr %6, i32 0, i32 0
  %8 = load ptr, ptr %7, align 8, !tbaa !9
  %9 = getelementptr inbounds %struct.ec_method_st, ptr %8, i32 0, i32 5
  %10 = load ptr, ptr %9, align 8, !tbaa !13
  %11 = icmp eq ptr %10, null
  br i1 %11, label %12, label %13

12:                                               ; preds = %2
  call void @ERR_new()
  call void @ERR_set_debug(ptr noundef @.str, i32 noundef 165, ptr noundef @__func__.EC_GROUP_copy)
  call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 16, i32 noundef 786689, ptr noundef null)
  store i32 0, ptr %3, align 4
  br label %255

13:                                               ; preds = %2
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.ec_group_st, ptr %14, i32 0, i32 0
  %16 = load ptr, ptr %15, align 8, !tbaa !9
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.ec_group_st, ptr %17, i32 0, i32 0
  %19 = load ptr, ptr %18, align 8, !tbaa !9
  %20 = icmp ne ptr %16, %19
  br i1 %20, label %21, label %22

21:                                               ; preds = %13
  call void @ERR_new()
  call void @ERR_set_debug(ptr noundef @.str, i32 noundef 169, ptr noundef @__func__.EC_GROUP_copy)
  call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 16, i32 noundef 101, ptr noundef null)
  store i32 0, ptr %3, align 4
  br label %255

22:                                               ; preds = %13
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = icmp eq ptr %23, %24
  br i1 %25, label %26, label %27

26:                                               ; preds = %22
  store i32 1, ptr %3, align 4
  br label %255

27:                                               ; preds = %22
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.ec_group_st, ptr %28, i32 0, i32 21
  %30 = load ptr, ptr %29, align 8, !tbaa !15
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.ec_group_st, ptr %31, i32 0, i32 21
  store ptr %30, ptr %32, align 8, !tbaa !15
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.ec_group_st, ptr %33, i32 0, i32 4
  %35 = load i32, ptr %34, align 8, !tbaa !16
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.ec_group_st, ptr %36, i32 0, i32 4
  store i32 %35, ptr %37, align 8, !tbaa !16
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.ec_group_st, ptr %38, i32 0, i32 19
  %40 = load i32, ptr %39, align 8, !tbaa !17
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.ec_group_st, ptr %41, i32 0, i32 19
  store i32 %40, ptr %42, align 8, !tbaa !17
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.ec_group_st, ptr %43, i32 0, i32 19
  %45 = load i32, ptr %44, align 8, !tbaa !17
  switch i32 %45, label %84 [
    i32 0, label %46
    i32 5, label %84
    i32 1, label %49
    i32 2, label %56
    i32 3, label %63
    i32 4, label %70
    i32 6, label %77
  ]

46:                                               ; preds = %27
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.ec_group_st, ptr %47, i32 0, i32 20
  store ptr null, ptr %48, align 8, !tbaa !18
  br label %84

49:                                               ; preds = %27
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.ec_group_st, ptr %50, i32 0, i32 20
  %52 = load ptr, ptr %51, align 8, !tbaa !18
  %53 = call ptr @EC_nistp224_pre_comp_dup(ptr noundef %52)
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.ec_group_st, ptr %54, i32 0, i32 20
  store ptr %53, ptr %55, align 8, !tbaa !18
  br label %84

56:                                               ; preds = %27
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.ec_group_st, ptr %57, i32 0, i32 20
  %59 = load ptr, ptr %58, align 8, !tbaa !18
  %60 = call ptr @EC_nistp256_pre_comp_dup(ptr noundef %59)
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.ec_group_st, ptr %61, i32 0, i32 20
  store ptr %60, ptr %62, align 8, !tbaa !18
  br label %84

63:                                               ; preds = %27
  %64 = load ptr, ptr %5, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.ec_group_st, ptr %64, i32 0, i32 20
  %66 = load ptr, ptr %65, align 8, !tbaa !18
  %67 = call ptr @ossl_ec_nistp384_pre_comp_dup(ptr noundef %66)
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.ec_group_st, ptr %68, i32 0, i32 20
  store ptr %67, ptr %69, align 8, !tbaa !18
  br label %84

70:                                               ; preds = %27
  %71 = load ptr, ptr %5, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.ec_group_st, ptr %71, i32 0, i32 20
  %73 = load ptr, ptr %72, align 8, !tbaa !18
  %74 = call ptr @EC_nistp521_pre_comp_dup(ptr noundef %73)
  %75 = load ptr, ptr %4, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.ec_group_st, ptr %75, i32 0, i32 20
  store ptr %74, ptr %76, align 8, !tbaa !18
  br label %84

77:                                               ; preds = %27
  %78 = load ptr, ptr %5, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.ec_group_st, ptr %78, i32 0, i32 20
  %80 = load ptr, ptr %79, align 8, !tbaa !18
  %81 = call ptr @EC_ec_pre_comp_dup(ptr noundef %80)
  %82 = load ptr, ptr %4, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.ec_group_st, ptr %82, i32 0, i32 20
  store ptr %81, ptr %83, align 8, !tbaa !18
  br label %84

84:                                               ; preds = %77, %70, %63, %56, %49, %46, %27, %27
  %85 = load ptr, ptr %5, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.ec_group_st, ptr %85, i32 0, i32 18
  %87 = load ptr, ptr %86, align 8, !tbaa !19
  %88 = icmp ne ptr %87, null
  br i1 %88, label %89, label %115

89:                                               ; preds = %84
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.ec_group_st, ptr %90, i32 0, i32 18
  %92 = load ptr, ptr %91, align 8, !tbaa !19
  %93 = icmp eq ptr %92, null
  br i1 %93, label %94, label %104

94:                                               ; preds = %89
  %95 = call ptr @BN_MONT_CTX_new()
  %96 = load ptr, ptr %4, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.ec_group_st, ptr %96, i32 0, i32 18
  store ptr %95, ptr %97, align 8, !tbaa !19
  %98 = load ptr, ptr %4, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.ec_group_st, ptr %98, i32 0, i32 18
  %100 = load ptr, ptr %99, align 8, !tbaa !19
  %101 = icmp eq ptr %100, null
  br i1 %101, label %102, label %103

102:                                              ; preds = %94
  store i32 0, ptr %3, align 4
  br label %255

103:                                              ; preds = %94
  br label %104

104:                                              ; preds = %103, %89
  %105 = load ptr, ptr %4, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.ec_group_st, ptr %105, i32 0, i32 18
  %107 = load ptr, ptr %106, align 8, !tbaa !19
  %108 = load ptr, ptr %5, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.ec_group_st, ptr %108, i32 0, i32 18
  %110 = load ptr, ptr %109, align 8, !tbaa !19
  %111 = call ptr @BN_MONT_CTX_copy(ptr noundef %107, ptr noundef %110)
  %112 = icmp ne ptr %111, null
  br i1 %112, label %114, label %113

113:                                              ; preds = %104
  store i32 0, ptr %3, align 4
  br label %255

114:                                              ; preds = %104
  br label %121

115:                                              ; preds = %84
  %116 = load ptr, ptr %4, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.ec_group_st, ptr %116, i32 0, i32 18
  %118 = load ptr, ptr %117, align 8, !tbaa !19
  call void @BN_MONT_CTX_free(ptr noundef %118)
  %119 = load ptr, ptr %4, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.ec_group_st, ptr %119, i32 0, i32 18
  store ptr null, ptr %120, align 8, !tbaa !19
  br label %121

121:                                              ; preds = %115, %114
  %122 = load ptr, ptr %5, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.ec_group_st, ptr %122, i32 0, i32 1
  %124 = load ptr, ptr %123, align 8, !tbaa !20
  %125 = icmp ne ptr %124, null
  br i1 %125, label %126, label %153

126:                                              ; preds = %121
  %127 = load ptr, ptr %4, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.ec_group_st, ptr %127, i32 0, i32 1
  %129 = load ptr, ptr %128, align 8, !tbaa !20
  %130 = icmp eq ptr %129, null
  br i1 %130, label %131, label %142

131:                                              ; preds = %126
  %132 = load ptr, ptr %4, align 8, !tbaa !5
  %133 = call ptr @EC_POINT_new(ptr noundef %132)
  %134 = load ptr, ptr %4, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.ec_group_st, ptr %134, i32 0, i32 1
  store ptr %133, ptr %135, align 8, !tbaa !20
  %136 = load ptr, ptr %4, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.ec_group_st, ptr %136, i32 0, i32 1
  %138 = load ptr, ptr %137, align 8, !tbaa !20
  %139 = icmp eq ptr %138, null
  br i1 %139, label %140, label %141

140:                                              ; preds = %131
  store i32 0, ptr %3, align 4
  br label %255

141:                                              ; preds = %131
  br label %142

142:                                              ; preds = %141, %126
  %143 = load ptr, ptr %4, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.ec_group_st, ptr %143, i32 0, i32 1
  %145 = load ptr, ptr %144, align 8, !tbaa !20
  %146 = load ptr, ptr %5, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.ec_group_st, ptr %146, i32 0, i32 1
  %148 = load ptr, ptr %147, align 8, !tbaa !20
  %149 = call i32 @EC_POINT_copy(ptr noundef %145, ptr noundef %148)
  %150 = icmp ne i32 %149, 0
  br i1 %150, label %152, label %151

151:                                              ; preds = %142
  store i32 0, ptr %3, align 4
  br label %255

152:                                              ; preds = %142
  br label %159

153:                                              ; preds = %121
  %154 = load ptr, ptr %4, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.ec_group_st, ptr %154, i32 0, i32 1
  %156 = load ptr, ptr %155, align 8, !tbaa !20
  call void @EC_POINT_clear_free(ptr noundef %156)
  %157 = load ptr, ptr %4, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.ec_group_st, ptr %157, i32 0, i32 1
  store ptr null, ptr %158, align 8, !tbaa !20
  br label %159

159:                                              ; preds = %153, %152
  %160 = load ptr, ptr %5, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.ec_group_st, ptr %160, i32 0, i32 0
  %162 = load ptr, ptr %161, align 8, !tbaa !9
  %163 = getelementptr inbounds %struct.ec_method_st, ptr %162, i32 0, i32 0
  %164 = load i32, ptr %163, align 8, !tbaa !21
  %165 = and i32 %164, 2
  %166 = icmp eq i32 %165, 0
  br i1 %166, label %167, label %188

167:                                              ; preds = %159
  %168 = load ptr, ptr %4, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.ec_group_st, ptr %168, i32 0, i32 2
  %170 = load ptr, ptr %169, align 8, !tbaa !22
  %171 = load ptr, ptr %5, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.ec_group_st, ptr %171, i32 0, i32 2
  %173 = load ptr, ptr %172, align 8, !tbaa !22
  %174 = call ptr @BN_copy(ptr noundef %170, ptr noundef %173)
  %175 = icmp ne ptr %174, null
  br i1 %175, label %177, label %176

176:                                              ; preds = %167
  store i32 0, ptr %3, align 4
  br label %255

177:                                              ; preds = %167
  %178 = load ptr, ptr %4, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.ec_group_st, ptr %178, i32 0, i32 3
  %180 = load ptr, ptr %179, align 8, !tbaa !23
  %181 = load ptr, ptr %5, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct.ec_group_st, ptr %181, i32 0, i32 3
  %183 = load ptr, ptr %182, align 8, !tbaa !23
  %184 = call ptr @BN_copy(ptr noundef %180, ptr noundef %183)
  %185 = icmp ne ptr %184, null
  br i1 %185, label %187, label %186

186:                                              ; preds = %177
  store i32 0, ptr %3, align 4
  br label %255

187:                                              ; preds = %177
  br label %188

188:                                              ; preds = %187, %159
  %189 = load ptr, ptr %5, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.ec_group_st, ptr %189, i32 0, i32 5
  %191 = load i32, ptr %190, align 4, !tbaa !24
  %192 = load ptr, ptr %4, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.ec_group_st, ptr %192, i32 0, i32 5
  store i32 %191, ptr %193, align 4, !tbaa !24
  %194 = load ptr, ptr %5, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.ec_group_st, ptr %194, i32 0, i32 7
  %196 = load i32, ptr %195, align 4, !tbaa !25
  %197 = load ptr, ptr %4, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.ec_group_st, ptr %197, i32 0, i32 7
  store i32 %196, ptr %198, align 4, !tbaa !25
  %199 = load ptr, ptr %5, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.ec_group_st, ptr %199, i32 0, i32 6
  %201 = load i32, ptr %200, align 8, !tbaa !26
  %202 = load ptr, ptr %4, align 8, !tbaa !5
  %203 = getelementptr inbounds %struct.ec_group_st, ptr %202, i32 0, i32 6
  store i32 %201, ptr %203, align 8, !tbaa !26
  %204 = load ptr, ptr %5, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.ec_group_st, ptr %204, i32 0, i32 8
  %206 = load ptr, ptr %205, align 8, !tbaa !27
  %207 = icmp ne ptr %206, null
  br i1 %207, label %208, label %238

208:                                              ; preds = %188
  %209 = load ptr, ptr %4, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct.ec_group_st, ptr %209, i32 0, i32 8
  %211 = load ptr, ptr %210, align 8, !tbaa !27
  call void @CRYPTO_free(ptr noundef %211, ptr noundef @.str, i32 noundef 254)
  %212 = load ptr, ptr %5, align 8, !tbaa !5
  %213 = getelementptr inbounds %struct.ec_group_st, ptr %212, i32 0, i32 9
  %214 = load i64, ptr %213, align 8, !tbaa !28
  %215 = call ptr @CRYPTO_malloc(i64 noundef %214, ptr noundef @.str, i32 noundef 255)
  %216 = load ptr, ptr %4, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct.ec_group_st, ptr %216, i32 0, i32 8
  store ptr %215, ptr %217, align 8, !tbaa !27
  %218 = icmp eq ptr %215, null
  br i1 %218, label %219, label %220

219:                                              ; preds = %208
  store i32 0, ptr %3, align 4
  br label %255

220:                                              ; preds = %208
  %221 = load ptr, ptr %4, align 8, !tbaa !5
  %222 = getelementptr inbounds %struct.ec_group_st, ptr %221, i32 0, i32 8
  %223 = load ptr, ptr %222, align 8, !tbaa !27
  %224 = load ptr, ptr %5, align 8, !tbaa !5
  %225 = getelementptr inbounds %struct.ec_group_st, ptr %224, i32 0, i32 8
  %226 = load ptr, ptr %225, align 8, !tbaa !27
  %227 = load ptr, ptr %5, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct.ec_group_st, ptr %227, i32 0, i32 9
  %229 = load i64, ptr %228, align 8, !tbaa !28
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %223, ptr align 1 %226, i64 %229, i1 false)
  %230 = icmp ne ptr %223, null
  br i1 %230, label %232, label %231

231:                                              ; preds = %220
  store i32 0, ptr %3, align 4
  br label %255

232:                                              ; preds = %220
  %233 = load ptr, ptr %5, align 8, !tbaa !5
  %234 = getelementptr inbounds %struct.ec_group_st, ptr %233, i32 0, i32 9
  %235 = load i64, ptr %234, align 8, !tbaa !28
  %236 = load ptr, ptr %4, align 8, !tbaa !5
  %237 = getelementptr inbounds %struct.ec_group_st, ptr %236, i32 0, i32 9
  store i64 %235, ptr %237, align 8, !tbaa !28
  br label %246

238:                                              ; preds = %188
  %239 = load ptr, ptr %4, align 8, !tbaa !5
  %240 = getelementptr inbounds %struct.ec_group_st, ptr %239, i32 0, i32 8
  %241 = load ptr, ptr %240, align 8, !tbaa !27
  call void @CRYPTO_free(ptr noundef %241, ptr noundef @.str, i32 noundef 261)
  %242 = load ptr, ptr %4, align 8, !tbaa !5
  %243 = getelementptr inbounds %struct.ec_group_st, ptr %242, i32 0, i32 8
  store ptr null, ptr %243, align 8, !tbaa !27
  %244 = load ptr, ptr %4, align 8, !tbaa !5
  %245 = getelementptr inbounds %struct.ec_group_st, ptr %244, i32 0, i32 9
  store i64 0, ptr %245, align 8, !tbaa !28
  br label %246

246:                                              ; preds = %238, %232
  %247 = load ptr, ptr %4, align 8, !tbaa !5
  %248 = getelementptr inbounds %struct.ec_group_st, ptr %247, i32 0, i32 0
  %249 = load ptr, ptr %248, align 8, !tbaa !9
  %250 = getelementptr inbounds %struct.ec_method_st, ptr %249, i32 0, i32 5
  %251 = load ptr, ptr %250, align 8, !tbaa !13
  %252 = load ptr, ptr %4, align 8, !tbaa !5
  %253 = load ptr, ptr %5, align 8, !tbaa !5
  %254 = call i32 %251(ptr noundef %252, ptr noundef %253)
  store i32 %254, ptr %3, align 4
  br label %255

255:                                              ; preds = %246, %231, %219, %186, %176, %151, %140, %113, %102, %26, %21, %12
  %256 = load i32, ptr %3, align 4
  ret i32 %256
}

declare ptr @EC_nistp224_pre_comp_dup(ptr noundef) #0

declare ptr @EC_nistp256_pre_comp_dup(ptr noundef) #0

declare ptr @ossl_ec_nistp384_pre_comp_dup(ptr noundef) #0

declare ptr @EC_nistp521_pre_comp_dup(ptr noundef) #0

declare ptr @EC_ec_pre_comp_dup(ptr noundef) #0

declare ptr @BN_MONT_CTX_new() #0

declare ptr @BN_MONT_CTX_copy(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @EC_POINT_new(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @EC_POINT_copy(ptr noundef, ptr noundef) #1

declare ptr @BN_copy(ptr noundef, ptr noundef) #0

declare ptr @CRYPTO_malloc(i64 noundef, ptr noundef, i32 noundef) #0

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

attributes #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 = { 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 #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }

!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, !6, i64 0}
!10 = !{!"ec_group_st", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !6, i64 48, !12, i64 56, !6, i64 64, !7, i64 72, !6, i64 96, !6, i64 104, !11, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !11, i64 152, !7, i64 160, !6, i64 168, !6, i64 176}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !6, i64 32}
!14 = !{!"ec_method_st", !11, i64 0, !11, i64 4, !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, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !6, i64 360, !6, i64 368, !6, i64 376, !6, i64 384, !6, i64 392, !6, i64 400, !6, i64 408, !6, i64 416, !6, i64 424, !6, i64 432, !6, i64 440}
!15 = !{!10, !6, i64 168}
!16 = !{!10, !11, i64 32}
!17 = !{!10, !11, i64 152}
!18 = !{!7, !7, i64 0}
!19 = !{!10, !6, i64 144}
!20 = !{!10, !6, i64 8}
!21 = !{!14, !11, i64 0}
!22 = !{!10, !6, i64 16}
!23 = !{!10, !6, i64 24}
!24 = !{!10, !11, i64 36}
!25 = !{!10, !11, i64 44}
!26 = !{!10, !11, i64 40}
!27 = !{!10, !6, i64 48}
!28 = !{!10, !12, i64 56}


; 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 [68 x i8], align 1
@__func__.EC_GROUP_copy = external hidden unnamed_addr constant [14 x i8], align 1

declare void @ERR_new() local_unnamed_addr #0

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

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

declare void @CRYPTO_free(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

declare void @BN_MONT_CTX_free(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @EC_POINT_clear_free(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local i32 @EC_GROUP_copy(ptr noundef %0, ptr noundef %1) local_unnamed_addr #1 {
  %3 = load ptr, ptr %0, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %3, i64 32
  %5 = load ptr, ptr %4, align 8, !tbaa !12
  %6 = icmp eq ptr %5, null
  br i1 %6, label %7, label %8

7:                                                ; preds = %2
  tail call void @ERR_new() #4
  tail call void @ERR_set_debug(ptr noundef nonnull @.str, i32 noundef 165, ptr noundef nonnull @__func__.EC_GROUP_copy) #4
  tail call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 16, i32 noundef 786689, ptr noundef null) #4
  br label %118

8:                                                ; preds = %2
  %9 = load ptr, ptr %1, align 8, !tbaa !5
  %.not = icmp eq ptr %3, %9
  br i1 %.not, label %11, label %10

10:                                               ; preds = %8
  tail call void @ERR_new() #4
  tail call void @ERR_set_debug(ptr noundef nonnull @.str, i32 noundef 169, ptr noundef nonnull @__func__.EC_GROUP_copy) #4
  tail call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 16, i32 noundef 101, ptr noundef null) #4
  br label %118

11:                                               ; preds = %8
  %12 = icmp eq ptr %0, %1
  br i1 %12, label %118, label %13

13:                                               ; preds = %11
  %14 = getelementptr inbounds i8, ptr %1, i64 168
  %15 = load ptr, ptr %14, align 8, !tbaa !14
  %16 = getelementptr inbounds i8, ptr %0, i64 168
  store ptr %15, ptr %16, align 8, !tbaa !14
  %17 = getelementptr inbounds i8, ptr %1, i64 32
  %18 = load i32, ptr %17, align 8, !tbaa !15
  %19 = getelementptr inbounds i8, ptr %0, i64 32
  store i32 %18, ptr %19, align 8, !tbaa !15
  %20 = getelementptr inbounds i8, ptr %1, i64 152
  %21 = load i32, ptr %20, align 8, !tbaa !16
  %22 = getelementptr inbounds i8, ptr %0, i64 152
  store i32 %21, ptr %22, align 8, !tbaa !16
  switch i32 %21, label %44 [
    i32 0, label %.sink.split
    i32 6, label %39
    i32 1, label %23
    i32 2, label %27
    i32 3, label %31
    i32 4, label %35
  ]

23:                                               ; preds = %13
  %24 = getelementptr inbounds i8, ptr %1, i64 160
  %25 = load ptr, ptr %24, align 8, !tbaa !17
  %26 = tail call ptr @EC_nistp224_pre_comp_dup(ptr noundef %25) #4
  br label %.sink.split

27:                                               ; preds = %13
  %28 = getelementptr inbounds i8, ptr %1, i64 160
  %29 = load ptr, ptr %28, align 8, !tbaa !17
  %30 = tail call ptr @EC_nistp256_pre_comp_dup(ptr noundef %29) #4
  br label %.sink.split

31:                                               ; preds = %13
  %32 = getelementptr inbounds i8, ptr %1, i64 160
  %33 = load ptr, ptr %32, align 8, !tbaa !17
  %34 = tail call ptr @ossl_ec_nistp384_pre_comp_dup(ptr noundef %33) #4
  br label %.sink.split

35:                                               ; preds = %13
  %36 = getelementptr inbounds i8, ptr %1, i64 160
  %37 = load ptr, ptr %36, align 8, !tbaa !17
  %38 = tail call ptr @EC_nistp521_pre_comp_dup(ptr noundef %37) #4
  br label %.sink.split

39:                                               ; preds = %13
  %40 = getelementptr inbounds i8, ptr %1, i64 160
  %41 = load ptr, ptr %40, align 8, !tbaa !17
  %42 = tail call ptr @EC_ec_pre_comp_dup(ptr noundef %41) #4
  br label %.sink.split

.sink.split:                                      ; preds = %13, %23, %27, %31, %35, %39
  %.sink = phi ptr [ %42, %39 ], [ %38, %35 ], [ %34, %31 ], [ %30, %27 ], [ %26, %23 ], [ null, %13 ]
  %43 = getelementptr inbounds i8, ptr %0, i64 160
  store ptr %.sink, ptr %43, align 8, !tbaa !17
  br label %44

44:                                               ; preds = %.sink.split, %13
  %45 = getelementptr inbounds i8, ptr %1, i64 144
  %46 = load ptr, ptr %45, align 8, !tbaa !18
  %.not69 = icmp eq ptr %46, null
  %47 = getelementptr inbounds i8, ptr %0, i64 144
  %48 = load ptr, ptr %47, align 8, !tbaa !18
  br i1 %.not69, label %58, label %49

49:                                               ; preds = %44
  %50 = icmp eq ptr %48, null
  br i1 %50, label %51, label %54

51:                                               ; preds = %49
  %52 = tail call ptr @BN_MONT_CTX_new() #4
  store ptr %52, ptr %47, align 8, !tbaa !18
  %53 = icmp eq ptr %52, null
  br i1 %53, label %118, label %._crit_edge

._crit_edge:                                      ; preds = %51
  %.pre = load ptr, ptr %45, align 8, !tbaa !18
  br label %54

54:                                               ; preds = %._crit_edge, %49
  %55 = phi ptr [ %.pre, %._crit_edge ], [ %46, %49 ]
  %56 = phi ptr [ %52, %._crit_edge ], [ %48, %49 ]
  %57 = tail call ptr @BN_MONT_CTX_copy(ptr noundef nonnull %56, ptr noundef %55) #4
  %.not70 = icmp eq ptr %57, null
  br i1 %.not70, label %118, label %59

58:                                               ; preds = %44
  tail call void @BN_MONT_CTX_free(ptr noundef %48) #4
  store ptr null, ptr %47, align 8, !tbaa !18
  br label %59

59:                                               ; preds = %54, %58
  %60 = getelementptr inbounds i8, ptr %1, i64 8
  %61 = load ptr, ptr %60, align 8, !tbaa !19
  %.not71 = icmp eq ptr %61, null
  %62 = getelementptr inbounds i8, ptr %0, i64 8
  %63 = load ptr, ptr %62, align 8, !tbaa !19
  br i1 %.not71, label %73, label %64

64:                                               ; preds = %59
  %65 = icmp eq ptr %63, null
  br i1 %65, label %66, label %69

66:                                               ; preds = %64
  %67 = tail call ptr @EC_POINT_new(ptr noundef nonnull %0)
  store ptr %67, ptr %62, align 8, !tbaa !19
  %68 = icmp eq ptr %67, null
  br i1 %68, label %118, label %._crit_edge76

._crit_edge76:                                    ; preds = %66
  %.pre77 = load ptr, ptr %60, align 8, !tbaa !19
  br label %69

69:                                               ; preds = %._crit_edge76, %64
  %70 = phi ptr [ %.pre77, %._crit_edge76 ], [ %61, %64 ]
  %71 = phi ptr [ %67, %._crit_edge76 ], [ %63, %64 ]
  %72 = tail call i32 @EC_POINT_copy(ptr noundef nonnull %71, ptr noundef %70)
  %.not72 = icmp eq i32 %72, 0
  br i1 %.not72, label %118, label %74

73:                                               ; preds = %59
  tail call void @EC_POINT_clear_free(ptr noundef %63)
  store ptr null, ptr %62, align 8, !tbaa !19
  br label %74

74:                                               ; preds = %69, %73
  %75 = load ptr, ptr %1, align 8, !tbaa !5
  %76 = load i32, ptr %75, align 8, !tbaa !20
  %77 = and i32 %76, 2
  %78 = icmp eq i32 %77, 0
  br i1 %78, label %79, label %91

79:                                               ; preds = %74
  %80 = getelementptr inbounds i8, ptr %0, i64 16
  %81 = load ptr, ptr %80, align 8, !tbaa !21
  %82 = getelementptr inbounds i8, ptr %1, i64 16
  %83 = load ptr, ptr %82, align 8, !tbaa !21
  %84 = tail call ptr @BN_copy(ptr noundef %81, ptr noundef %83) #4
  %.not73 = icmp eq ptr %84, null
  br i1 %.not73, label %118, label %85

85:                                               ; preds = %79
  %86 = getelementptr inbounds i8, ptr %0, i64 24
  %87 = load ptr, ptr %86, align 8, !tbaa !22
  %88 = getelementptr inbounds i8, ptr %1, i64 24
  %89 = load ptr, ptr %88, align 8, !tbaa !22
  %90 = tail call ptr @BN_copy(ptr noundef %87, ptr noundef %89) #4
  %.not74 = icmp eq ptr %90, null
  br i1 %.not74, label %118, label %91

91:                                               ; preds = %85, %74
  %92 = getelementptr inbounds i8, ptr %1, i64 36
  %93 = getelementptr inbounds i8, ptr %0, i64 36
  %94 = getelementptr inbounds i8, ptr %1, i64 44
  %95 = load i32, ptr %94, align 4, !tbaa !23
  %96 = getelementptr inbounds i8, ptr %0, i64 44
  store i32 %95, ptr %96, align 4, !tbaa !23
  %97 = load <2 x i32>, ptr %92, align 4, !tbaa !24
  store <2 x i32> %97, ptr %93, align 4, !tbaa !24
  %98 = getelementptr inbounds i8, ptr %1, i64 48
  %99 = load ptr, ptr %98, align 8, !tbaa !25
  %.not75 = icmp eq ptr %99, null
  %100 = getelementptr inbounds i8, ptr %0, i64 48
  %101 = load ptr, ptr %100, align 8, !tbaa !25
  br i1 %.not75, label %112, label %102

102:                                              ; preds = %91
  tail call void @CRYPTO_free(ptr noundef %101, ptr noundef nonnull @.str, i32 noundef 254) #4
  %103 = getelementptr inbounds i8, ptr %1, i64 56
  %104 = load i64, ptr %103, align 8, !tbaa !26
  %105 = tail call ptr @CRYPTO_malloc(i64 noundef %104, ptr noundef nonnull @.str, i32 noundef 255) #4
  store ptr %105, ptr %100, align 8, !tbaa !25
  %106 = icmp eq ptr %105, null
  br i1 %106, label %118, label %107

107:                                              ; preds = %102
  %108 = load ptr, ptr %98, align 8, !tbaa !25
  %109 = load i64, ptr %103, align 8, !tbaa !26
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %105, ptr align 1 %108, i64 %109, i1 false)
  %110 = load i64, ptr %103, align 8, !tbaa !26
  %111 = getelementptr inbounds i8, ptr %0, i64 56
  store i64 %110, ptr %111, align 8, !tbaa !26
  br label %113

112:                                              ; preds = %91
  tail call void @CRYPTO_free(ptr noundef %101, ptr noundef nonnull @.str, i32 noundef 261) #4
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %100, i8 0, i64 16, i1 false)
  br label %113

113:                                              ; preds = %112, %107
  %114 = load ptr, ptr %0, align 8, !tbaa !5
  %115 = getelementptr inbounds i8, ptr %114, i64 32
  %116 = load ptr, ptr %115, align 8, !tbaa !12
  %117 = tail call i32 %116(ptr noundef nonnull %0, ptr noundef nonnull %1) #4
  br label %118

118:                                              ; preds = %102, %85, %79, %69, %66, %54, %51, %11, %113, %10, %7
  %.0 = phi i32 [ 0, %7 ], [ 0, %10 ], [ %117, %113 ], [ 1, %11 ], [ 0, %51 ], [ 0, %54 ], [ 0, %66 ], [ 0, %69 ], [ 0, %79 ], [ 0, %85 ], [ 0, %102 ]
  ret i32 %.0
}

declare ptr @EC_nistp224_pre_comp_dup(ptr noundef) local_unnamed_addr #0

declare ptr @EC_nistp256_pre_comp_dup(ptr noundef) local_unnamed_addr #0

declare ptr @ossl_ec_nistp384_pre_comp_dup(ptr noundef) local_unnamed_addr #0

declare ptr @EC_nistp521_pre_comp_dup(ptr noundef) local_unnamed_addr #0

declare ptr @EC_ec_pre_comp_dup(ptr noundef) local_unnamed_addr #0

declare ptr @BN_MONT_CTX_new() local_unnamed_addr #0

declare ptr @BN_MONT_CTX_copy(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @EC_POINT_new(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @EC_POINT_copy(ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @BN_copy(ptr noundef, ptr noundef) local_unnamed_addr #0

declare ptr @CRYPTO_malloc(i64 noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

attributes #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 = { 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 #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!"ec_group_st", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !7, i64 48, !11, i64 56, !7, i64 64, !8, i64 72, !7, i64 96, !7, i64 104, !10, i64 112, !7, i64 120, !7, i64 128, !7, i64 136, !7, i64 144, !10, i64 152, !8, i64 160, !7, i64 168, !7, i64 176}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"long", !8, i64 0}
!12 = !{!13, !7, i64 32}
!13 = !{!"ec_method_st", !10, i64 0, !10, i64 4, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !7, i64 120, !7, i64 128, !7, i64 136, !7, i64 144, !7, i64 152, !7, i64 160, !7, i64 168, !7, i64 176, !7, i64 184, !7, i64 192, !7, i64 200, !7, i64 208, !7, i64 216, !7, i64 224, !7, i64 232, !7, i64 240, !7, i64 248, !7, i64 256, !7, i64 264, !7, i64 272, !7, i64 280, !7, i64 288, !7, i64 296, !7, i64 304, !7, i64 312, !7, i64 320, !7, i64 328, !7, i64 336, !7, i64 344, !7, i64 352, !7, i64 360, !7, i64 368, !7, i64 376, !7, i64 384, !7, i64 392, !7, i64 400, !7, i64 408, !7, i64 416, !7, i64 424, !7, i64 432, !7, i64 440}
!14 = !{!6, !7, i64 168}
!15 = !{!6, !10, i64 32}
!16 = !{!6, !10, i64 152}
!17 = !{!8, !8, i64 0}
!18 = !{!6, !7, i64 144}
!19 = !{!6, !7, i64 8}
!20 = !{!13, !10, i64 0}
!21 = !{!6, !7, i64 16}
!22 = !{!6, !7, i64 24}
!23 = !{!6, !10, i64 44}
!24 = !{!10, !10, i64 0}
!25 = !{!6, !7, i64 48}
!26 = !{!6, !11, i64 56}


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