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

; 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.gf_s = type { [8 x i64] }
%struct.curve448_point_s = type { [1 x %struct.gf_s], [1 x %struct.gf_s], [1 x %struct.gf_s], [1 x %struct.gf_s] }

@ONE = external hidden constant [1 x %struct.gf_s], align 16
@.str = external hidden unnamed_addr constant [38 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [79 x i8], align 1
@__PRETTY_FUNCTION__.ossl_curve448_point_decode_like_eddsa_and_mul_by_ratio = external hidden unnamed_addr constant [112 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 void @ossl_gf_mul(ptr noundef, ptr noundef, ptr noundef) #1

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

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

; Function Attrs: nounwind uwtable
declare dso_local i64 @ossl_curve448_point_valid(ptr noundef) #3

declare void @ossl_gf_sqr(ptr noundef, ptr noundef) #1

declare void @gf_sub(ptr noundef, ptr noundef, ptr noundef) #1

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

declare void @gf_add(ptr noundef, ptr noundef, ptr noundef) #1

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

declare i64 @gf_lobit(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @ossl_curve448_point_decode_like_eddsa_and_mul_by_ratio(ptr noundef %0, ptr noundef %1) #3 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca [57 x i8], align 16
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca [1 x %struct.gf_s], align 16
  %9 = alloca [1 x %struct.gf_s], align 16
  %10 = alloca [1 x %struct.gf_s], align 16
  %11 = alloca [1 x %struct.gf_s], align 16
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 57, ptr %5) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %12 = getelementptr inbounds [57 x i8], ptr %5, i64 0, i64 0
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %12, ptr align 1 %13, i64 57, i1 false)
  %14 = getelementptr inbounds [57 x i8], ptr %5, i64 0, i64 56
  %15 = load i8, ptr %14, align 8, !tbaa !9
  %16 = zext i8 %15 to i32
  %17 = and i32 %16, 128
  %18 = sext i32 %17 to i64
  %19 = call i64 @constant_time_is_zero_64(i64 noundef %18)
  %20 = xor i64 %19, -1
  store i64 %20, ptr %6, align 8, !tbaa !10
  %21 = getelementptr inbounds [57 x i8], ptr %5, i64 0, i64 56
  %22 = load i8, ptr %21, align 8, !tbaa !9
  %23 = zext i8 %22 to i32
  %24 = and i32 %23, -129
  %25 = trunc i32 %24 to i8
  store i8 %25, ptr %21, align 8, !tbaa !9
  %26 = load ptr, ptr %3, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.curve448_point_s, ptr %26, i32 0, i32 1
  %28 = getelementptr inbounds [1 x %struct.gf_s], ptr %27, i64 0, i64 0
  %29 = getelementptr inbounds [57 x i8], ptr %5, i64 0, i64 0
  %30 = call i64 @gf_deserialize(ptr noundef %28, ptr noundef %29, i32 noundef 1, i8 noundef zeroext 0)
  store i64 %30, ptr %7, align 8, !tbaa !10
  %31 = getelementptr inbounds [57 x i8], ptr %5, i64 0, i64 56
  %32 = load i8, ptr %31, align 8, !tbaa !9
  %33 = zext i8 %32 to i64
  %34 = call i64 @constant_time_is_zero_64(i64 noundef %33)
  %35 = load i64, ptr %7, align 8, !tbaa !10
  %36 = and i64 %35, %34
  store i64 %36, ptr %7, align 8, !tbaa !10
  %37 = load ptr, ptr %3, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.curve448_point_s, ptr %37, i32 0, i32 0
  %39 = getelementptr inbounds [1 x %struct.gf_s], ptr %38, i64 0, i64 0
  %40 = load ptr, ptr %3, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.curve448_point_s, ptr %40, i32 0, i32 1
  %42 = getelementptr inbounds [1 x %struct.gf_s], ptr %41, i64 0, i64 0
  call void @ossl_gf_sqr(ptr noundef %39, ptr noundef %42)
  %43 = load ptr, ptr %3, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.curve448_point_s, ptr %43, i32 0, i32 2
  %45 = getelementptr inbounds [1 x %struct.gf_s], ptr %44, i64 0, i64 0
  %46 = load ptr, ptr %3, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.curve448_point_s, ptr %46, i32 0, i32 0
  %48 = getelementptr inbounds [1 x %struct.gf_s], ptr %47, i64 0, i64 0
  call void @gf_sub(ptr noundef %45, ptr noundef @ONE, ptr noundef %48)
  %49 = load ptr, ptr %3, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.curve448_point_s, ptr %49, i32 0, i32 3
  %51 = getelementptr inbounds [1 x %struct.gf_s], ptr %50, i64 0, i64 0
  %52 = load ptr, ptr %3, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.curve448_point_s, ptr %52, i32 0, i32 0
  %54 = getelementptr inbounds [1 x %struct.gf_s], ptr %53, i64 0, i64 0
  call void @gf_mulw(ptr noundef %51, ptr noundef %54, i32 noundef -39081)
  %55 = load ptr, ptr %3, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.curve448_point_s, ptr %55, i32 0, i32 3
  %57 = getelementptr inbounds [1 x %struct.gf_s], ptr %56, i64 0, i64 0
  %58 = load ptr, ptr %3, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.curve448_point_s, ptr %58, i32 0, i32 3
  %60 = getelementptr inbounds [1 x %struct.gf_s], ptr %59, i64 0, i64 0
  call void @gf_sub(ptr noundef %57, ptr noundef @ONE, ptr noundef %60)
  %61 = load ptr, ptr %3, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.curve448_point_s, ptr %61, i32 0, i32 0
  %63 = getelementptr inbounds [1 x %struct.gf_s], ptr %62, i64 0, i64 0
  %64 = load ptr, ptr %3, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.curve448_point_s, ptr %64, i32 0, i32 2
  %66 = getelementptr inbounds [1 x %struct.gf_s], ptr %65, i64 0, i64 0
  %67 = load ptr, ptr %3, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.curve448_point_s, ptr %67, i32 0, i32 3
  %69 = getelementptr inbounds [1 x %struct.gf_s], ptr %68, i64 0, i64 0
  call void @ossl_gf_mul(ptr noundef %63, ptr noundef %66, ptr noundef %69)
  %70 = load ptr, ptr %3, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.curve448_point_s, ptr %70, i32 0, i32 3
  %72 = getelementptr inbounds [1 x %struct.gf_s], ptr %71, i64 0, i64 0
  %73 = load ptr, ptr %3, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.curve448_point_s, ptr %73, i32 0, i32 0
  %75 = getelementptr inbounds [1 x %struct.gf_s], ptr %74, i64 0, i64 0
  %76 = call i64 @gf_isr(ptr noundef %72, ptr noundef %75)
  %77 = load i64, ptr %7, align 8, !tbaa !10
  %78 = and i64 %77, %76
  store i64 %78, ptr %7, align 8, !tbaa !10
  %79 = load ptr, ptr %3, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.curve448_point_s, ptr %79, i32 0, i32 0
  %81 = getelementptr inbounds [1 x %struct.gf_s], ptr %80, i64 0, i64 0
  %82 = load ptr, ptr %3, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.curve448_point_s, ptr %82, i32 0, i32 3
  %84 = getelementptr inbounds [1 x %struct.gf_s], ptr %83, i64 0, i64 0
  %85 = load ptr, ptr %3, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.curve448_point_s, ptr %85, i32 0, i32 2
  %87 = getelementptr inbounds [1 x %struct.gf_s], ptr %86, i64 0, i64 0
  call void @ossl_gf_mul(ptr noundef %81, ptr noundef %84, ptr noundef %87)
  %88 = load ptr, ptr %3, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.curve448_point_s, ptr %88, i32 0, i32 0
  %90 = getelementptr inbounds [1 x %struct.gf_s], ptr %89, i64 0, i64 0
  %91 = load ptr, ptr %3, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.curve448_point_s, ptr %91, i32 0, i32 0
  %93 = getelementptr inbounds [1 x %struct.gf_s], ptr %92, i64 0, i64 0
  %94 = call i64 @gf_lobit(ptr noundef %93)
  %95 = load i64, ptr %6, align 8, !tbaa !10
  %96 = xor i64 %94, %95
  call void @gf_cond_neg(ptr noundef %90, i64 noundef %96)
  %97 = load ptr, ptr %3, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.curve448_point_s, ptr %97, i32 0, i32 2
  %99 = getelementptr inbounds [1 x %struct.gf_s], ptr %98, i64 0, i64 0
  call void @gf_copy(ptr noundef %99, ptr noundef @ONE)
  call void @llvm.lifetime.start.p0(i64 64, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 64, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 64, ptr %10) #7
  call void @llvm.lifetime.start.p0(i64 64, ptr %11) #7
  %100 = getelementptr inbounds [1 x %struct.gf_s], ptr %10, i64 0, i64 0
  %101 = load ptr, ptr %3, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.curve448_point_s, ptr %101, i32 0, i32 0
  %103 = getelementptr inbounds [1 x %struct.gf_s], ptr %102, i64 0, i64 0
  call void @ossl_gf_sqr(ptr noundef %100, ptr noundef %103)
  %104 = getelementptr inbounds [1 x %struct.gf_s], ptr %8, i64 0, i64 0
  %105 = load ptr, ptr %3, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.curve448_point_s, ptr %105, i32 0, i32 1
  %107 = getelementptr inbounds [1 x %struct.gf_s], ptr %106, i64 0, i64 0
  call void @ossl_gf_sqr(ptr noundef %104, ptr noundef %107)
  %108 = getelementptr inbounds [1 x %struct.gf_s], ptr %11, i64 0, i64 0
  %109 = getelementptr inbounds [1 x %struct.gf_s], ptr %10, i64 0, i64 0
  %110 = getelementptr inbounds [1 x %struct.gf_s], ptr %8, i64 0, i64 0
  call void @gf_add(ptr noundef %108, ptr noundef %109, ptr noundef %110)
  %111 = load ptr, ptr %3, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.curve448_point_s, ptr %111, i32 0, i32 3
  %113 = getelementptr inbounds [1 x %struct.gf_s], ptr %112, i64 0, i64 0
  %114 = load ptr, ptr %3, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.curve448_point_s, ptr %114, i32 0, i32 1
  %116 = getelementptr inbounds [1 x %struct.gf_s], ptr %115, i64 0, i64 0
  %117 = load ptr, ptr %3, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.curve448_point_s, ptr %117, i32 0, i32 0
  %119 = getelementptr inbounds [1 x %struct.gf_s], ptr %118, i64 0, i64 0
  call void @gf_add(ptr noundef %113, ptr noundef %116, ptr noundef %119)
  %120 = getelementptr inbounds [1 x %struct.gf_s], ptr %9, i64 0, i64 0
  %121 = load ptr, ptr %3, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.curve448_point_s, ptr %121, i32 0, i32 3
  %123 = getelementptr inbounds [1 x %struct.gf_s], ptr %122, i64 0, i64 0
  call void @ossl_gf_sqr(ptr noundef %120, ptr noundef %123)
  %124 = getelementptr inbounds [1 x %struct.gf_s], ptr %9, i64 0, i64 0
  %125 = getelementptr inbounds [1 x %struct.gf_s], ptr %9, i64 0, i64 0
  %126 = getelementptr inbounds [1 x %struct.gf_s], ptr %11, i64 0, i64 0
  call void @gf_sub(ptr noundef %124, ptr noundef %125, ptr noundef %126)
  %127 = load ptr, ptr %3, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.curve448_point_s, ptr %127, i32 0, i32 3
  %129 = getelementptr inbounds [1 x %struct.gf_s], ptr %128, i64 0, i64 0
  %130 = getelementptr inbounds [1 x %struct.gf_s], ptr %8, i64 0, i64 0
  %131 = getelementptr inbounds [1 x %struct.gf_s], ptr %10, i64 0, i64 0
  call void @gf_sub(ptr noundef %129, ptr noundef %130, ptr noundef %131)
  %132 = load ptr, ptr %3, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.curve448_point_s, ptr %132, i32 0, i32 0
  %134 = getelementptr inbounds [1 x %struct.gf_s], ptr %133, i64 0, i64 0
  %135 = load ptr, ptr %3, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.curve448_point_s, ptr %135, i32 0, i32 2
  %137 = getelementptr inbounds [1 x %struct.gf_s], ptr %136, i64 0, i64 0
  call void @ossl_gf_sqr(ptr noundef %134, ptr noundef %137)
  %138 = load ptr, ptr %3, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.curve448_point_s, ptr %138, i32 0, i32 2
  %140 = getelementptr inbounds [1 x %struct.gf_s], ptr %139, i64 0, i64 0
  %141 = load ptr, ptr %3, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.curve448_point_s, ptr %141, i32 0, i32 0
  %143 = getelementptr inbounds [1 x %struct.gf_s], ptr %142, i64 0, i64 0
  %144 = load ptr, ptr %3, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.curve448_point_s, ptr %144, i32 0, i32 0
  %146 = getelementptr inbounds [1 x %struct.gf_s], ptr %145, i64 0, i64 0
  call void @gf_add(ptr noundef %140, ptr noundef %143, ptr noundef %146)
  %147 = getelementptr inbounds [1 x %struct.gf_s], ptr %8, i64 0, i64 0
  %148 = load ptr, ptr %3, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.curve448_point_s, ptr %148, i32 0, i32 2
  %150 = getelementptr inbounds [1 x %struct.gf_s], ptr %149, i64 0, i64 0
  %151 = getelementptr inbounds [1 x %struct.gf_s], ptr %11, i64 0, i64 0
  call void @gf_sub(ptr noundef %147, ptr noundef %150, ptr noundef %151)
  %152 = load ptr, ptr %3, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.curve448_point_s, ptr %152, i32 0, i32 0
  %154 = getelementptr inbounds [1 x %struct.gf_s], ptr %153, i64 0, i64 0
  %155 = getelementptr inbounds [1 x %struct.gf_s], ptr %8, i64 0, i64 0
  %156 = getelementptr inbounds [1 x %struct.gf_s], ptr %9, i64 0, i64 0
  call void @ossl_gf_mul(ptr noundef %154, ptr noundef %155, ptr noundef %156)
  %157 = load ptr, ptr %3, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.curve448_point_s, ptr %157, i32 0, i32 2
  %159 = getelementptr inbounds [1 x %struct.gf_s], ptr %158, i64 0, i64 0
  %160 = load ptr, ptr %3, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.curve448_point_s, ptr %160, i32 0, i32 3
  %162 = getelementptr inbounds [1 x %struct.gf_s], ptr %161, i64 0, i64 0
  %163 = getelementptr inbounds [1 x %struct.gf_s], ptr %8, i64 0, i64 0
  call void @ossl_gf_mul(ptr noundef %159, ptr noundef %162, ptr noundef %163)
  %164 = load ptr, ptr %3, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.curve448_point_s, ptr %164, i32 0, i32 1
  %166 = getelementptr inbounds [1 x %struct.gf_s], ptr %165, i64 0, i64 0
  %167 = load ptr, ptr %3, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.curve448_point_s, ptr %167, i32 0, i32 3
  %169 = getelementptr inbounds [1 x %struct.gf_s], ptr %168, i64 0, i64 0
  %170 = getelementptr inbounds [1 x %struct.gf_s], ptr %11, i64 0, i64 0
  call void @ossl_gf_mul(ptr noundef %166, ptr noundef %169, ptr noundef %170)
  %171 = load ptr, ptr %3, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.curve448_point_s, ptr %171, i32 0, i32 3
  %173 = getelementptr inbounds [1 x %struct.gf_s], ptr %172, i64 0, i64 0
  %174 = getelementptr inbounds [1 x %struct.gf_s], ptr %9, i64 0, i64 0
  %175 = getelementptr inbounds [1 x %struct.gf_s], ptr %11, i64 0, i64 0
  call void @ossl_gf_mul(ptr noundef %173, ptr noundef %174, ptr noundef %175)
  %176 = getelementptr inbounds [1 x %struct.gf_s], ptr %8, i64 0, i64 0
  call void @OPENSSL_cleanse(ptr noundef %176, i64 noundef 64)
  %177 = getelementptr inbounds [1 x %struct.gf_s], ptr %9, i64 0, i64 0
  call void @OPENSSL_cleanse(ptr noundef %177, i64 noundef 64)
  %178 = getelementptr inbounds [1 x %struct.gf_s], ptr %10, i64 0, i64 0
  call void @OPENSSL_cleanse(ptr noundef %178, i64 noundef 64)
  %179 = getelementptr inbounds [1 x %struct.gf_s], ptr %11, i64 0, i64 0
  call void @OPENSSL_cleanse(ptr noundef %179, i64 noundef 64)
  call void @llvm.lifetime.end.p0(i64 64, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr %8) #7
  %180 = getelementptr inbounds [57 x i8], ptr %5, i64 0, i64 0
  call void @OPENSSL_cleanse(ptr noundef %180, i64 noundef 57)
  %181 = load ptr, ptr %3, align 8, !tbaa !5
  %182 = call i64 @ossl_curve448_point_valid(ptr noundef %181)
  %183 = icmp ne i64 %182, 0
  br i1 %183, label %188, label %184

184:                                              ; preds = %2
  %185 = load i64, ptr %7, align 8, !tbaa !10
  %186 = xor i64 %185, -1
  %187 = icmp ne i64 %186, 0
  br i1 %187, label %188, label %189

188:                                              ; preds = %184, %2
  br label %190

189:                                              ; preds = %184
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 381, ptr noundef @__PRETTY_FUNCTION__.ossl_curve448_point_decode_like_eddsa_and_mul_by_ratio) #8
  unreachable

190:                                              ; preds = %188
  %191 = load i64, ptr %7, align 8, !tbaa !10
  %192 = call i64 @mask_to_bool(i64 noundef %191)
  %193 = call i32 @c448_succeed_if(i64 noundef %192)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 57, ptr %5) #7
  ret i32 %193
}

; 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) #4

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

declare i64 @gf_deserialize(ptr noundef, ptr noundef, i32 noundef, i8 noundef zeroext) #1

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

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

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @gf_copy(ptr noundef, ptr noundef) #5

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #6

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

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 = { 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 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { alwaysinline 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 #6 = { noreturn nounwind "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 #7 = { nounwind }
attributes #8 = { noreturn 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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"long", !7, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.gf_s = type { [8 x i64] }

@ONE = external hidden constant [1 x %struct.gf_s], align 16
@.str = external hidden unnamed_addr constant [38 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [79 x i8], align 1
@__PRETTY_FUNCTION__.ossl_curve448_point_decode_like_eddsa_and_mul_by_ratio = external hidden unnamed_addr constant [112 x i8], align 1

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

declare void @ossl_gf_mul(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @mask_to_bool(i64 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) #0

; Function Attrs: nounwind uwtable
declare dso_local i64 @ossl_curve448_point_valid(ptr noundef) local_unnamed_addr #3

declare void @ossl_gf_sqr(ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @gf_sub(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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

declare void @gf_add(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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

declare i64 @gf_lobit(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local i32 @ossl_curve448_point_decode_like_eddsa_and_mul_by_ratio(ptr noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #3 {
  %3 = alloca [57 x i8], align 16
  %4 = alloca [1 x %struct.gf_s], align 16
  %5 = alloca [1 x %struct.gf_s], align 16
  %6 = alloca [1 x %struct.gf_s], align 16
  %7 = alloca [1 x %struct.gf_s], align 16
  call void @llvm.lifetime.start.p0(i64 57, ptr nonnull %3) #7
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(57) %3, ptr noundef nonnull align 1 dereferenceable(57) %1, i64 57, i1 false)
  %8 = getelementptr inbounds i8, ptr %3, i64 56
  %9 = load i8, ptr %8, align 8, !tbaa !5
  %10 = and i8 %9, -128
  %11 = zext i8 %10 to i64
  %12 = tail call i64 @constant_time_is_zero_64(i64 noundef %11)
  %13 = and i8 %9, 127
  store i8 %13, ptr %8, align 8, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %0, i64 64
  %15 = call i64 @gf_deserialize(ptr noundef nonnull %14, ptr noundef nonnull %3, i32 noundef 1, i8 noundef zeroext 0) #7
  %16 = load i8, ptr %8, align 8, !tbaa !5
  %17 = zext i8 %16 to i64
  %18 = call i64 @constant_time_is_zero_64(i64 noundef %17)
  %19 = and i64 %18, %15
  call void @ossl_gf_sqr(ptr noundef %0, ptr noundef nonnull %14) #7
  %20 = getelementptr inbounds i8, ptr %0, i64 128
  call void @gf_sub(ptr noundef nonnull %20, ptr noundef nonnull @ONE, ptr noundef %0) #7
  %21 = getelementptr inbounds i8, ptr %0, i64 192
  call void @gf_mulw(ptr noundef nonnull %21, ptr noundef %0, i32 noundef -39081)
  call void @gf_sub(ptr noundef nonnull %21, ptr noundef nonnull @ONE, ptr noundef nonnull %21) #7
  call void @ossl_gf_mul(ptr noundef %0, ptr noundef nonnull %20, ptr noundef nonnull %21) #7
  %22 = call i64 @gf_isr(ptr noundef nonnull %21, ptr noundef %0) #7
  %23 = and i64 %19, %22
  call void @ossl_gf_mul(ptr noundef %0, ptr noundef nonnull %21, ptr noundef nonnull %20) #7
  %24 = call i64 @gf_lobit(ptr noundef %0) #7
  %25 = xor i64 %12, %24
  %26 = xor i64 %25, -1
  call void @gf_cond_neg(ptr noundef %0, i64 noundef %26)
  call void @gf_copy(ptr noundef nonnull %20, ptr noundef nonnull @ONE)
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %7) #7
  call void @ossl_gf_sqr(ptr noundef nonnull %6, ptr noundef %0) #7
  call void @ossl_gf_sqr(ptr noundef nonnull %4, ptr noundef nonnull %14) #7
  call void @gf_add(ptr noundef nonnull %7, ptr noundef nonnull %6, ptr noundef nonnull %4) #7
  call void @gf_add(ptr noundef nonnull %21, ptr noundef nonnull %14, ptr noundef %0) #7
  call void @ossl_gf_sqr(ptr noundef nonnull %5, ptr noundef nonnull %21) #7
  call void @gf_sub(ptr noundef nonnull %5, ptr noundef nonnull %5, ptr noundef nonnull %7) #7
  call void @gf_sub(ptr noundef nonnull %21, ptr noundef nonnull %4, ptr noundef nonnull %6) #7
  call void @ossl_gf_sqr(ptr noundef %0, ptr noundef nonnull %20) #7
  call void @gf_add(ptr noundef nonnull %20, ptr noundef %0, ptr noundef %0) #7
  call void @gf_sub(ptr noundef nonnull %4, ptr noundef nonnull %20, ptr noundef nonnull %7) #7
  call void @ossl_gf_mul(ptr noundef %0, ptr noundef nonnull %4, ptr noundef nonnull %5) #7
  call void @ossl_gf_mul(ptr noundef nonnull %20, ptr noundef nonnull %21, ptr noundef nonnull %4) #7
  call void @ossl_gf_mul(ptr noundef nonnull %14, ptr noundef nonnull %21, ptr noundef nonnull %7) #7
  call void @ossl_gf_mul(ptr noundef nonnull %21, ptr noundef nonnull %5, ptr noundef nonnull %7) #7
  call void @OPENSSL_cleanse(ptr noundef nonnull %4, i64 noundef 64) #7
  call void @OPENSSL_cleanse(ptr noundef nonnull %5, i64 noundef 64) #7
  call void @OPENSSL_cleanse(ptr noundef nonnull %6, i64 noundef 64) #7
  call void @OPENSSL_cleanse(ptr noundef nonnull %7, i64 noundef 64) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %4) #7
  call void @OPENSSL_cleanse(ptr noundef nonnull %3, i64 noundef 57) #7
  %27 = call i64 @ossl_curve448_point_valid(ptr noundef %0)
  %.not = icmp eq i64 %27, 0
  %.not45 = icmp eq i64 %23, -1
  %or.cond = select i1 %.not, i1 %.not45, i1 false
  br i1 %or.cond, label %28, label %29

28:                                               ; preds = %2
  call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 381, ptr noundef nonnull @__PRETTY_FUNCTION__.ossl_curve448_point_decode_like_eddsa_and_mul_by_ratio) #8
  unreachable

29:                                               ; preds = %2
  %30 = call i64 @mask_to_bool(i64 noundef %23)
  %31 = call i32 @c448_succeed_if(i64 noundef %30)
  call void @llvm.lifetime.end.p0(i64 57, ptr nonnull %3) #7
  ret i32 %31
}

; 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) #4

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

declare i64 @gf_deserialize(ptr noundef, ptr noundef, i32 noundef, i8 noundef zeroext) local_unnamed_addr #1

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

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

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @gf_copy(ptr noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #6

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { 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 #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { alwaysinline 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 #6 = { noreturn nounwind "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 #7 = { nounwind }
attributes #8 = { noreturn 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"}


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