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

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

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

declare ptr @BN_CTX_new() #1

declare void @BN_CTX_start(ptr noundef) #1

declare ptr @BN_CTX_get(ptr noundef) #1

declare i32 @BN_is_zero(ptr noundef) #1

declare void @ERR_new() #1

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

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

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

declare i32 @BN_is_odd(ptr noundef) #1

declare void @BN_CTX_end(ptr noundef) #1

declare void @BN_CTX_free(ptr noundef) #1

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

26:                                               ; preds = %6
  %27 = load i32, ptr %10, align 4, !tbaa !9
  %28 = icmp ne i32 %27, 4
  br i1 %28, label %29, label %33

29:                                               ; preds = %26
  %30 = load i32, ptr %10, align 4, !tbaa !9
  %31 = icmp ne i32 %30, 6
  br i1 %31, label %32, label %33

32:                                               ; preds = %29
  call void @ERR_new()
  call void @ERR_set_debug(ptr noundef @.str, i32 noundef 141, ptr noundef @__func__.ossl_ec_GF2m_simple_point2oct)
  call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 16, i32 noundef 104, ptr noundef null)
  br label %228

33:                                               ; preds = %29, %26, %6
  %34 = load ptr, ptr %8, align 8, !tbaa !5
  %35 = load ptr, ptr %9, align 8, !tbaa !5
  %36 = call i32 @EC_POINT_is_at_infinity(ptr noundef %34, ptr noundef %35)
  %37 = icmp ne i32 %36, 0
  br i1 %37, label %38, label %49

38:                                               ; preds = %33
  %39 = load ptr, ptr %11, align 8, !tbaa !5
  %40 = icmp ne ptr %39, null
  br i1 %40, label %41, label %48

41:                                               ; preds = %38
  %42 = load i64, ptr %12, align 8, !tbaa !11
  %43 = icmp ult i64 %42, 1
  br i1 %43, label %44, label %45

44:                                               ; preds = %41
  call void @ERR_new()
  call void @ERR_set_debug(ptr noundef @.str, i32 noundef 149, ptr noundef @__func__.ossl_ec_GF2m_simple_point2oct)
  call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 16, i32 noundef 100, ptr noundef null)
  store i64 0, ptr %7, align 8
  store i32 1, ptr %23, align 4
  br label %235

45:                                               ; preds = %41
  %46 = load ptr, ptr %11, align 8, !tbaa !5
  %47 = getelementptr inbounds i8, ptr %46, i64 0
  store i8 0, ptr %47, align 1, !tbaa !13
  br label %48

48:                                               ; preds = %45, %38
  store i64 1, ptr %7, align 8
  store i32 1, ptr %23, align 4
  br label %235

49:                                               ; preds = %33
  %50 = load ptr, ptr %8, align 8, !tbaa !5
  %51 = call i32 @EC_GROUP_get_degree(ptr noundef %50)
  %52 = add nsw i32 %51, 7
  %53 = sdiv i32 %52, 8
  %54 = sext i32 %53 to i64
  store i64 %54, ptr %19, align 8, !tbaa !11
  %55 = load i32, ptr %10, align 4, !tbaa !9
  %56 = icmp eq i32 %55, 2
  br i1 %56, label %57, label %60

57:                                               ; preds = %49
  %58 = load i64, ptr %19, align 8, !tbaa !11
  %59 = add i64 1, %58
  br label %64

60:                                               ; preds = %49
  %61 = load i64, ptr %19, align 8, !tbaa !11
  %62 = mul i64 2, %61
  %63 = add i64 1, %62
  br label %64

64:                                               ; preds = %60, %57
  %65 = phi i64 [ %59, %57 ], [ %63, %60 ]
  store i64 %65, ptr %14, align 8, !tbaa !11
  %66 = load ptr, ptr %11, align 8, !tbaa !5
  %67 = icmp ne ptr %66, null
  br i1 %67, label %68, label %220

68:                                               ; preds = %64
  %69 = load i64, ptr %12, align 8, !tbaa !11
  %70 = load i64, ptr %14, align 8, !tbaa !11
  %71 = icmp ult i64 %69, %70
  br i1 %71, label %72, label %73

72:                                               ; preds = %68
  call void @ERR_new()
  call void @ERR_set_debug(ptr noundef @.str, i32 noundef 166, ptr noundef @__func__.ossl_ec_GF2m_simple_point2oct)
  call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 16, i32 noundef 100, ptr noundef null)
  br label %228

73:                                               ; preds = %68
  %74 = load ptr, ptr %13, align 8, !tbaa !5
  %75 = icmp eq ptr %74, null
  br i1 %75, label %76, label %82

76:                                               ; preds = %73
  %77 = call ptr @BN_CTX_new()
  store ptr %77, ptr %22, align 8, !tbaa !5
  store ptr %77, ptr %13, align 8, !tbaa !5
  %78 = load ptr, ptr %13, align 8, !tbaa !5
  %79 = icmp eq ptr %78, null
  br i1 %79, label %80, label %81

80:                                               ; preds = %76
  store i64 0, ptr %7, align 8
  store i32 1, ptr %23, align 4
  br label %235

81:                                               ; preds = %76
  br label %82

82:                                               ; preds = %81, %73
  %83 = load ptr, ptr %13, align 8, !tbaa !5
  call void @BN_CTX_start(ptr noundef %83)
  store i32 1, ptr %15, align 4, !tbaa !9
  %84 = load ptr, ptr %13, align 8, !tbaa !5
  %85 = call ptr @BN_CTX_get(ptr noundef %84)
  store ptr %85, ptr %16, align 8, !tbaa !5
  %86 = load ptr, ptr %13, align 8, !tbaa !5
  %87 = call ptr @BN_CTX_get(ptr noundef %86)
  store ptr %87, ptr %17, align 8, !tbaa !5
  %88 = load ptr, ptr %13, align 8, !tbaa !5
  %89 = call ptr @BN_CTX_get(ptr noundef %88)
  store ptr %89, ptr %18, align 8, !tbaa !5
  %90 = load ptr, ptr %18, align 8, !tbaa !5
  %91 = icmp eq ptr %90, null
  br i1 %91, label %92, label %93

92:                                               ; preds = %82
  br label %228

93:                                               ; preds = %82
  %94 = load ptr, ptr %8, align 8, !tbaa !5
  %95 = load ptr, ptr %9, align 8, !tbaa !5
  %96 = load ptr, ptr %16, align 8, !tbaa !5
  %97 = load ptr, ptr %17, align 8, !tbaa !5
  %98 = load ptr, ptr %13, align 8, !tbaa !5
  %99 = call i32 @EC_POINT_get_affine_coordinates(ptr noundef %94, ptr noundef %95, ptr noundef %96, ptr noundef %97, ptr noundef %98)
  %100 = icmp ne i32 %99, 0
  br i1 %100, label %102, label %101

101:                                              ; preds = %93
  br label %228

102:                                              ; preds = %93
  %103 = load i32, ptr %10, align 4, !tbaa !9
  %104 = trunc i32 %103 to i8
  %105 = load ptr, ptr %11, align 8, !tbaa !5
  %106 = getelementptr inbounds i8, ptr %105, i64 0
  store i8 %104, ptr %106, align 1, !tbaa !13
  %107 = load i32, ptr %10, align 4, !tbaa !9
  %108 = icmp ne i32 %107, 4
  br i1 %108, label %109, label %137

109:                                              ; preds = %102
  %110 = load ptr, ptr %16, align 8, !tbaa !5
  %111 = call i32 @BN_is_zero(ptr noundef %110)
  %112 = icmp ne i32 %111, 0
  br i1 %112, label %137, label %113

113:                                              ; preds = %109
  %114 = load ptr, ptr %8, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.ec_group_st, ptr %114, i32 0, i32 0
  %116 = load ptr, ptr %115, align 8, !tbaa !14
  %117 = getelementptr inbounds %struct.ec_method_st, ptr %116, i32 0, i32 34
  %118 = load ptr, ptr %117, align 8, !tbaa !16
  %119 = load ptr, ptr %8, align 8, !tbaa !5
  %120 = load ptr, ptr %18, align 8, !tbaa !5
  %121 = load ptr, ptr %17, align 8, !tbaa !5
  %122 = load ptr, ptr %16, align 8, !tbaa !5
  %123 = load ptr, ptr %13, align 8, !tbaa !5
  %124 = call i32 %118(ptr noundef %119, ptr noundef %120, ptr noundef %121, ptr noundef %122, ptr noundef %123)
  %125 = icmp ne i32 %124, 0
  br i1 %125, label %127, label %126

126:                                              ; preds = %113
  br label %228

127:                                              ; preds = %113
  %128 = load ptr, ptr %18, align 8, !tbaa !5
  %129 = call i32 @BN_is_odd(ptr noundef %128)
  %130 = icmp ne i32 %129, 0
  br i1 %130, label %131, label %136

131:                                              ; preds = %127
  %132 = load ptr, ptr %11, align 8, !tbaa !5
  %133 = getelementptr inbounds i8, ptr %132, i64 0
  %134 = load i8, ptr %133, align 1, !tbaa !13
  %135 = add i8 %134, 1
  store i8 %135, ptr %133, align 1, !tbaa !13
  br label %136

136:                                              ; preds = %131, %127
  br label %137

137:                                              ; preds = %136, %109, %102
  store i64 1, ptr %20, align 8, !tbaa !11
  %138 = load i64, ptr %19, align 8, !tbaa !11
  %139 = load ptr, ptr %16, align 8, !tbaa !5
  %140 = call i32 @BN_num_bits(ptr noundef %139)
  %141 = add nsw i32 %140, 7
  %142 = sdiv i32 %141, 8
  %143 = sext i32 %142 to i64
  %144 = sub i64 %138, %143
  store i64 %144, ptr %21, align 8, !tbaa !11
  %145 = load i64, ptr %21, align 8, !tbaa !11
  %146 = load i64, ptr %19, align 8, !tbaa !11
  %147 = icmp ugt i64 %145, %146
  br i1 %147, label %148, label %149

148:                                              ; preds = %137
  call void @ERR_new()
  call void @ERR_set_debug(ptr noundef @.str, i32 noundef 201, ptr noundef @__func__.ossl_ec_GF2m_simple_point2oct)
  call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 16, i32 noundef 786691, ptr noundef null)
  br label %228

149:                                              ; preds = %137
  br label %150

150:                                              ; preds = %153, %149
  %151 = load i64, ptr %21, align 8, !tbaa !11
  %152 = icmp ugt i64 %151, 0
  br i1 %152, label %153, label %160

153:                                              ; preds = %150
  %154 = load ptr, ptr %11, align 8, !tbaa !5
  %155 = load i64, ptr %20, align 8, !tbaa !11
  %156 = add i64 %155, 1
  store i64 %156, ptr %20, align 8, !tbaa !11
  %157 = getelementptr inbounds i8, ptr %154, i64 %155
  store i8 0, ptr %157, align 1, !tbaa !13
  %158 = load i64, ptr %21, align 8, !tbaa !11
  %159 = add i64 %158, -1
  store i64 %159, ptr %21, align 8, !tbaa !11
  br label %150, !llvm.loop !18

160:                                              ; preds = %150
  %161 = load ptr, ptr %16, align 8, !tbaa !5
  %162 = load ptr, ptr %11, align 8, !tbaa !5
  %163 = load i64, ptr %20, align 8, !tbaa !11
  %164 = getelementptr inbounds i8, ptr %162, i64 %163
  %165 = call i32 @BN_bn2bin(ptr noundef %161, ptr noundef %164)
  %166 = sext i32 %165 to i64
  store i64 %166, ptr %21, align 8, !tbaa !11
  %167 = load i64, ptr %21, align 8, !tbaa !11
  %168 = load i64, ptr %20, align 8, !tbaa !11
  %169 = add i64 %168, %167
  store i64 %169, ptr %20, align 8, !tbaa !11
  %170 = load i64, ptr %20, align 8, !tbaa !11
  %171 = load i64, ptr %19, align 8, !tbaa !11
  %172 = add i64 1, %171
  %173 = icmp ne i64 %170, %172
  br i1 %173, label %174, label %175

174:                                              ; preds = %160
  call void @ERR_new()
  call void @ERR_set_debug(ptr noundef @.str, i32 noundef 211, ptr noundef @__func__.ossl_ec_GF2m_simple_point2oct)
  call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 16, i32 noundef 786691, ptr noundef null)
  br label %228

175:                                              ; preds = %160
  %176 = load i32, ptr %10, align 4, !tbaa !9
  %177 = icmp eq i32 %176, 4
  br i1 %177, label %181, label %178

178:                                              ; preds = %175
  %179 = load i32, ptr %10, align 4, !tbaa !9
  %180 = icmp eq i32 %179, 6
  br i1 %180, label %181, label %214

181:                                              ; preds = %178, %175
  %182 = load i64, ptr %19, align 8, !tbaa !11
  %183 = load ptr, ptr %17, align 8, !tbaa !5
  %184 = call i32 @BN_num_bits(ptr noundef %183)
  %185 = add nsw i32 %184, 7
  %186 = sdiv i32 %185, 8
  %187 = sext i32 %186 to i64
  %188 = sub i64 %182, %187
  store i64 %188, ptr %21, align 8, !tbaa !11
  %189 = load i64, ptr %21, align 8, !tbaa !11
  %190 = load i64, ptr %19, align 8, !tbaa !11
  %191 = icmp ugt i64 %189, %190
  br i1 %191, label %192, label %193

192:                                              ; preds = %181
  call void @ERR_new()
  call void @ERR_set_debug(ptr noundef @.str, i32 noundef 219, ptr noundef @__func__.ossl_ec_GF2m_simple_point2oct)
  call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 16, i32 noundef 786691, ptr noundef null)
  br label %228

193:                                              ; preds = %181
  br label %194

194:                                              ; preds = %197, %193
  %195 = load i64, ptr %21, align 8, !tbaa !11
  %196 = icmp ugt i64 %195, 0
  br i1 %196, label %197, label %204

197:                                              ; preds = %194
  %198 = load ptr, ptr %11, align 8, !tbaa !5
  %199 = load i64, ptr %20, align 8, !tbaa !11
  %200 = add i64 %199, 1
  store i64 %200, ptr %20, align 8, !tbaa !11
  %201 = getelementptr inbounds i8, ptr %198, i64 %199
  store i8 0, ptr %201, align 1, !tbaa !13
  %202 = load i64, ptr %21, align 8, !tbaa !11
  %203 = add i64 %202, -1
  store i64 %203, ptr %21, align 8, !tbaa !11
  br label %194, !llvm.loop !20

204:                                              ; preds = %194
  %205 = load ptr, ptr %17, align 8, !tbaa !5
  %206 = load ptr, ptr %11, align 8, !tbaa !5
  %207 = load i64, ptr %20, align 8, !tbaa !11
  %208 = getelementptr inbounds i8, ptr %206, i64 %207
  %209 = call i32 @BN_bn2bin(ptr noundef %205, ptr noundef %208)
  %210 = sext i32 %209 to i64
  store i64 %210, ptr %21, align 8, !tbaa !11
  %211 = load i64, ptr %21, align 8, !tbaa !11
  %212 = load i64, ptr %20, align 8, !tbaa !11
  %213 = add i64 %212, %211
  store i64 %213, ptr %20, align 8, !tbaa !11
  br label %214

214:                                              ; preds = %204, %178
  %215 = load i64, ptr %20, align 8, !tbaa !11
  %216 = load i64, ptr %14, align 8, !tbaa !11
  %217 = icmp ne i64 %215, %216
  br i1 %217, label %218, label %219

218:                                              ; preds = %214
  call void @ERR_new()
  call void @ERR_set_debug(ptr noundef @.str, i32 noundef 231, ptr noundef @__func__.ossl_ec_GF2m_simple_point2oct)
  call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 16, i32 noundef 786691, ptr noundef null)
  br label %228

219:                                              ; preds = %214
  br label %220

220:                                              ; preds = %219, %64
  %221 = load i32, ptr %15, align 4, !tbaa !9
  %222 = icmp ne i32 %221, 0
  br i1 %222, label %223, label %225

223:                                              ; preds = %220
  %224 = load ptr, ptr %13, align 8, !tbaa !5
  call void @BN_CTX_end(ptr noundef %224)
  br label %225

225:                                              ; preds = %223, %220
  %226 = load ptr, ptr %22, align 8, !tbaa !5
  call void @BN_CTX_free(ptr noundef %226)
  %227 = load i64, ptr %14, align 8, !tbaa !11
  store i64 %227, ptr %7, align 8
  store i32 1, ptr %23, align 4
  br label %235

228:                                              ; preds = %218, %192, %174, %148, %126, %101, %92, %72, %32
  %229 = load i32, ptr %15, align 4, !tbaa !9
  %230 = icmp ne i32 %229, 0
  br i1 %230, label %231, label %233

231:                                              ; preds = %228
  %232 = load ptr, ptr %13, align 8, !tbaa !5
  call void @BN_CTX_end(ptr noundef %232)
  br label %233

233:                                              ; preds = %231, %228
  %234 = load ptr, ptr %22, align 8, !tbaa !5
  call void @BN_CTX_free(ptr noundef %234)
  store i64 0, ptr %7, align 8
  store i32 1, ptr %23, align 4
  br label %235

235:                                              ; preds = %233, %225, %80, %48, %44
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  %236 = load i64, ptr %7, align 8
  ret i64 %236
}

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

declare i32 @EC_GROUP_get_degree(ptr noundef) #1

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

declare i32 @BN_num_bits(ptr noundef) #1

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !6, i64 0}
!15 = !{!"ec_group_st", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !6, i64 48, !12, i64 56, !6, i64 64, !7, i64 72, !6, i64 96, !6, i64 104, !10, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !10, i64 152, !7, i64 160, !6, i64 168, !6, i64 176}
!16 = !{!17, !6, i64 264}
!17 = !{!"ec_method_st", !10, i64 0, !10, 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}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}


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

declare ptr @BN_CTX_new() local_unnamed_addr #0

declare void @BN_CTX_start(ptr noundef) local_unnamed_addr #0

declare ptr @BN_CTX_get(ptr noundef) local_unnamed_addr #0

declare i32 @BN_is_zero(ptr noundef) local_unnamed_addr #0

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 i32 @BN_is_odd(ptr noundef) local_unnamed_addr #0

declare void @BN_CTX_end(ptr noundef) local_unnamed_addr #0

declare void @BN_CTX_free(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local range(i64 -536870909, 536870912) i64 @ossl_ec_GF2m_simple_point2oct(ptr noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, i64 noundef %4, ptr noundef %5) local_unnamed_addr #1 {
  %.not127 = icmp eq i32 %2, 4
  switch i32 %2, label %7 [
    i32 6, label %8
    i32 4, label %8
    i32 2, label %8
  ]

7:                                                ; preds = %6
  tail call void @ERR_new() #3
  tail call void @ERR_set_debug(ptr noundef nonnull @.str, i32 noundef 141, ptr noundef nonnull @__func__.ossl_ec_GF2m_simple_point2oct) #3
  tail call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 16, i32 noundef 104, ptr noundef null) #3
  br label %81

8:                                                ; preds = %6, %6, %6
  %9 = tail call i32 @EC_POINT_is_at_infinity(ptr noundef %0, ptr noundef %1) #3
  %.not = icmp eq i32 %9, 0
  br i1 %.not, label %15, label %10

10:                                               ; preds = %8
  %.not115 = icmp eq ptr %3, null
  br i1 %.not115, label %82, label %11

11:                                               ; preds = %10
  %12 = icmp eq i64 %4, 0
  br i1 %12, label %13, label %14

13:                                               ; preds = %11
  tail call void @ERR_new() #3
  tail call void @ERR_set_debug(ptr noundef nonnull @.str, i32 noundef 149, ptr noundef nonnull @__func__.ossl_ec_GF2m_simple_point2oct) #3
  tail call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 16, i32 noundef 100, ptr noundef null) #3
  br label %82

14:                                               ; preds = %11
  store i8 0, ptr %3, align 1, !tbaa !5
  br label %82

15:                                               ; preds = %8
  %16 = tail call i32 @EC_GROUP_get_degree(ptr noundef %0) #3
  %17 = add nsw i32 %16, 7
  %18 = sdiv i32 %17, 8
  %19 = sext i32 %18 to i64
  %20 = icmp eq i32 %2, 2
  %21 = add nsw i64 %19, 1
  %22 = shl nsw i64 %19, 1
  %23 = or disjoint i64 %22, 1
  %24 = select i1 %20, i64 %21, i64 %23
  %.not103 = icmp eq ptr %3, null
  br i1 %.not103, label %.thread, label %25

25:                                               ; preds = %15
  %26 = icmp ugt i64 %24, %4
  br i1 %26, label %27, label %28

27:                                               ; preds = %25
  tail call void @ERR_new() #3
  tail call void @ERR_set_debug(ptr noundef nonnull @.str, i32 noundef 166, ptr noundef nonnull @__func__.ossl_ec_GF2m_simple_point2oct) #3
  tail call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 16, i32 noundef 100, ptr noundef null) #3
  br label %81

28:                                               ; preds = %25
  %29 = icmp eq ptr %5, null
  br i1 %29, label %30, label %33

30:                                               ; preds = %28
  %31 = tail call ptr @BN_CTX_new() #3
  %32 = icmp eq ptr %31, null
  br i1 %32, label %82, label %33

33:                                               ; preds = %30, %28
  %.089 = phi ptr [ %31, %30 ], [ %5, %28 ]
  %.0 = phi ptr [ %31, %30 ], [ null, %28 ]
  tail call void @BN_CTX_start(ptr noundef nonnull %.089) #3
  %34 = tail call ptr @BN_CTX_get(ptr noundef nonnull %.089) #3
  %35 = tail call ptr @BN_CTX_get(ptr noundef nonnull %.089) #3
  %36 = tail call ptr @BN_CTX_get(ptr noundef nonnull %.089) #3
  %37 = icmp eq ptr %36, null
  br i1 %37, label %80, label %38

38:                                               ; preds = %33
  %39 = tail call i32 @EC_POINT_get_affine_coordinates(ptr noundef %0, ptr noundef %1, ptr noundef %34, ptr noundef %35, ptr noundef nonnull %.089) #3
  %.not104 = icmp eq i32 %39, 0
  br i1 %.not104, label %80, label %40

40:                                               ; preds = %38
  %41 = trunc nuw i32 %2 to i8
  store i8 %41, ptr %3, align 1, !tbaa !5
  br i1 %.not127, label %54, label %42

42:                                               ; preds = %40
  %43 = tail call i32 @BN_is_zero(ptr noundef %34) #3
  %.not105 = icmp eq i32 %43, 0
  br i1 %.not105, label %44, label %54

44:                                               ; preds = %42
  %45 = load ptr, ptr %0, align 8, !tbaa !8
  %46 = getelementptr inbounds i8, ptr %45, i64 264
  %47 = load ptr, ptr %46, align 8, !tbaa !13
  %48 = tail call i32 %47(ptr noundef nonnull %0, ptr noundef nonnull %36, ptr noundef %35, ptr noundef %34, ptr noundef nonnull %.089) #3
  %.not106 = icmp eq i32 %48, 0
  br i1 %.not106, label %80, label %49

49:                                               ; preds = %44
  %50 = tail call i32 @BN_is_odd(ptr noundef nonnull %36) #3
  %.not107 = icmp eq i32 %50, 0
  br i1 %.not107, label %54, label %51

51:                                               ; preds = %49
  %52 = load i8, ptr %3, align 1, !tbaa !5
  %53 = add i8 %52, 1
  store i8 %53, ptr %3, align 1, !tbaa !5
  br label %54

54:                                               ; preds = %49, %51, %42, %40
  %55 = tail call i32 @BN_num_bits(ptr noundef %34) #3
  %56 = add nsw i32 %55, 7
  %.neg = sdiv i32 %56, -8
  %narrow = add nsw i32 %.neg, %18
  %57 = icmp ugt i32 %narrow, %18
  br i1 %57, label %.sink.split, label %.preheader128

.preheader128:                                    ; preds = %54
  %.not108129 = icmp eq i32 %narrow, 0
  br i1 %.not108129, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.preheader128
  %58 = sext i32 %narrow to i64
  %scevgep = getelementptr i8, ptr %3, i64 1
  tail call void @llvm.memset.p0.i64(ptr align 1 %scevgep, i8 0, i64 %58, i1 false), !tbaa !5
  %narrow140 = add nsw i32 %18, %.neg
  %59 = sext i32 %narrow140 to i64
  %60 = add nsw i64 %59, 1
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph.preheader, %.preheader128
  %.085.lcssa = phi i64 [ 1, %.preheader128 ], [ %60, %.lr.ph.preheader ]
  %61 = getelementptr inbounds i8, ptr %3, i64 %.085.lcssa
  %62 = tail call i32 @BN_bn2bin(ptr noundef %34, ptr noundef nonnull %61) #3
  %63 = sext i32 %62 to i64
  %64 = add nsw i64 %.085.lcssa, %63
  %.not109 = icmp eq i64 %64, %21
  br i1 %.not109, label %65, label %.sink.split

65:                                               ; preds = %._crit_edge
  %or.cond5.not = icmp ult i32 %2, 4
  br i1 %or.cond5.not, label %78, label %66

66:                                               ; preds = %65
  %67 = tail call i32 @BN_num_bits(ptr noundef %35) #3
  %68 = add nsw i32 %67, 7
  %.neg111 = sdiv i32 %68, -8
  %narrow110 = add nsw i32 %.neg111, %18
  %69 = icmp ugt i32 %narrow110, %18
  br i1 %69, label %.sink.split, label %.preheader

.preheader:                                       ; preds = %66
  %.not112132 = icmp eq i32 %narrow110, 0
  br i1 %.not112132, label %._crit_edge136, label %.lr.ph135.preheader

.lr.ph135.preheader:                              ; preds = %.preheader
  %70 = sext i32 %narrow110 to i64
  %scevgep139 = getelementptr i8, ptr %3, i64 %21
  tail call void @llvm.memset.p0.i64(ptr align 1 %scevgep139, i8 0, i64 %70, i1 false), !tbaa !5
  %71 = sext i32 %.neg111 to i64
  %72 = add nsw i64 %21, %19
  %73 = add nsw i64 %72, %71
  br label %._crit_edge136

._crit_edge136:                                   ; preds = %.lr.ph135.preheader, %.preheader
  %.186.lcssa = phi i64 [ %21, %.preheader ], [ %73, %.lr.ph135.preheader ]
  %74 = getelementptr inbounds i8, ptr %3, i64 %.186.lcssa
  %75 = tail call i32 @BN_bn2bin(ptr noundef %35, ptr noundef nonnull %74) #3
  %76 = sext i32 %75 to i64
  %77 = add nsw i64 %.186.lcssa, %76
  br label %78

78:                                               ; preds = %65, %._crit_edge136
  %.287 = phi i64 [ %77, %._crit_edge136 ], [ %21, %65 ]
  %.not113 = icmp eq i64 %.287, %24
  br i1 %.not113, label %79, label %.sink.split

79:                                               ; preds = %78
  tail call void @BN_CTX_end(ptr noundef nonnull %.089) #3
  br label %.thread

.thread:                                          ; preds = %15, %79
  %.1119 = phi ptr [ %.0, %79 ], [ null, %15 ]
  tail call void @BN_CTX_free(ptr noundef %.1119) #3
  br label %82

.sink.split:                                      ; preds = %78, %66, %._crit_edge, %54
  %.sink = phi i32 [ 201, %54 ], [ 211, %._crit_edge ], [ 219, %66 ], [ 231, %78 ]
  tail call void @ERR_new() #3
  tail call void @ERR_set_debug(ptr noundef nonnull @.str, i32 noundef %.sink, ptr noundef nonnull @__func__.ossl_ec_GF2m_simple_point2oct) #3
  tail call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 16, i32 noundef 786691, ptr noundef null) #3
  br label %80

80:                                               ; preds = %.sink.split, %33, %44, %38
  tail call void @BN_CTX_end(ptr noundef nonnull %.089) #3
  br label %81

81:                                               ; preds = %7, %27, %80
  %.2126 = phi ptr [ %.0, %80 ], [ null, %7 ], [ null, %27 ]
  tail call void @BN_CTX_free(ptr noundef %.2126) #3
  br label %82

82:                                               ; preds = %30, %10, %14, %81, %.thread, %13
  %.088 = phi i64 [ 0, %81 ], [ 0, %13 ], [ %24, %.thread ], [ 1, %14 ], [ 1, %10 ], [ 0, %30 ]
  ret i64 %.088
}

declare i32 @EC_POINT_is_at_infinity(ptr noundef, ptr noundef) local_unnamed_addr #0

declare i32 @EC_GROUP_get_degree(ptr noundef) local_unnamed_addr #0

declare i32 @EC_POINT_get_affine_coordinates(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

declare i32 @BN_num_bits(ptr noundef) local_unnamed_addr #0

declare i32 @BN_bn2bin(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, 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: write) }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !10, i64 0}
!9 = !{!"ec_group_st", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !10, i64 48, !12, i64 56, !10, i64 64, !6, i64 72, !10, i64 96, !10, i64 104, !11, i64 112, !10, i64 120, !10, i64 128, !10, i64 136, !10, i64 144, !11, i64 152, !6, i64 160, !10, i64 168, !10, i64 176}
!10 = !{!"any pointer", !6, i64 0}
!11 = !{!"int", !6, i64 0}
!12 = !{!"long", !6, i64 0}
!13 = !{!14, !10, i64 264}
!14 = !{!"ec_method_st", !11, i64 0, !11, i64 4, !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, !10, i64 88, !10, i64 96, !10, i64 104, !10, i64 112, !10, i64 120, !10, i64 128, !10, i64 136, !10, i64 144, !10, i64 152, !10, i64 160, !10, i64 168, !10, i64 176, !10, i64 184, !10, i64 192, !10, i64 200, !10, i64 208, !10, i64 216, !10, i64 224, !10, i64 232, !10, i64 240, !10, i64 248, !10, i64 256, !10, i64 264, !10, i64 272, !10, i64 280, !10, i64 288, !10, i64 296, !10, i64 304, !10, i64 312, !10, i64 320, !10, i64 328, !10, i64 336, !10, i64 344, !10, i64 352, !10, i64 360, !10, i64 368, !10, i64 376, !10, i64 384, !10, i64 392, !10, i64 400, !10, i64 408, !10, i64 416, !10, i64 424, !10, i64 432, !10, i64 440}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LoopIdiomRecognizePass,LoopRotatePass,LoopSimplifyPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass