; 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] }

@ZERO = external hidden constant [1 x %struct.gf_s], align 16
@ONE = external hidden constant [1 x %struct.gf_s], align 16

; 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

declare i64 @gf_eq(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

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

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

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

; Function Attrs: nounwind uwtable
declare hidden void @gf_invert(ptr noundef, ptr noundef, i32 noundef) #3

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @ossl_x448_int(ptr noundef %0, ptr noundef %1, ptr noundef %2) #3 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca [1 x %struct.gf_s], align 16
  %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
  %12 = alloca [1 x %struct.gf_s], align 16
  %13 = alloca [1 x %struct.gf_s], align 16
  %14 = alloca i32, align 4
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i8, align 1
  %18 = alloca i64, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 64, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  store i64 0, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %19 = getelementptr inbounds [1 x %struct.gf_s], ptr %7, i64 0, i64 0
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = call i64 @gf_deserialize(ptr noundef %19, ptr noundef %20, i32 noundef 1, i8 noundef zeroext 0)
  %22 = getelementptr inbounds [1 x %struct.gf_s], ptr %8, i64 0, i64 0
  call void @gf_copy(ptr noundef %22, ptr noundef @ONE)
  %23 = getelementptr inbounds [1 x %struct.gf_s], ptr %9, i64 0, i64 0
  call void @gf_copy(ptr noundef %23, ptr noundef @ZERO)
  %24 = getelementptr inbounds [1 x %struct.gf_s], ptr %10, i64 0, i64 0
  %25 = getelementptr inbounds [1 x %struct.gf_s], ptr %7, i64 0, i64 0
  call void @gf_copy(ptr noundef %24, ptr noundef %25)
  %26 = getelementptr inbounds [1 x %struct.gf_s], ptr %11, i64 0, i64 0
  call void @gf_copy(ptr noundef %26, ptr noundef @ONE)
  store i32 447, ptr %14, align 4, !tbaa !11
  br label %27

27:                                               ; preds = %119, %3
  %28 = load i32, ptr %14, align 4, !tbaa !11
  %29 = icmp sge i32 %28, 0
  br i1 %29, label %30, label %122

30:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #5
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = load i32, ptr %14, align 4, !tbaa !11
  %33 = sdiv i32 %32, 8
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds i8, ptr %31, i64 %34
  %36 = load i8, ptr %35, align 1, !tbaa !13
  store i8 %36, ptr %17, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %37 = load i32, ptr %14, align 4, !tbaa !11
  %38 = sdiv i32 %37, 8
  %39 = icmp eq i32 %38, 0
  br i1 %39, label %40, label %45

40:                                               ; preds = %30
  %41 = load i8, ptr %17, align 1, !tbaa !13
  %42 = zext i8 %41 to i32
  %43 = and i32 %42, -4
  %44 = trunc i32 %43 to i8
  store i8 %44, ptr %17, align 1, !tbaa !13
  br label %50

45:                                               ; preds = %30
  %46 = load i32, ptr %14, align 4, !tbaa !11
  %47 = icmp eq i32 %46, 447
  br i1 %47, label %48, label %49

48:                                               ; preds = %45
  store i8 -1, ptr %17, align 1, !tbaa !13
  br label %49

49:                                               ; preds = %48, %45
  br label %50

50:                                               ; preds = %49, %40
  %51 = load i8, ptr %17, align 1, !tbaa !13
  %52 = zext i8 %51 to i32
  %53 = load i32, ptr %14, align 4, !tbaa !11
  %54 = srem i32 %53, 8
  %55 = ashr i32 %52, %54
  %56 = and i32 %55, 1
  %57 = sext i32 %56 to i64
  store i64 %57, ptr %18, align 8, !tbaa !9
  %58 = load i64, ptr %18, align 8, !tbaa !9
  %59 = sub i64 0, %58
  store i64 %59, ptr %18, align 8, !tbaa !9
  %60 = load i64, ptr %18, align 8, !tbaa !9
  %61 = load i64, ptr %15, align 8, !tbaa !9
  %62 = xor i64 %61, %60
  store i64 %62, ptr %15, align 8, !tbaa !9
  %63 = getelementptr inbounds [1 x %struct.gf_s], ptr %8, i64 0, i64 0
  %64 = getelementptr inbounds [1 x %struct.gf_s], ptr %10, i64 0, i64 0
  %65 = load i64, ptr %15, align 8, !tbaa !9
  call void @gf_cond_swap(ptr noundef %63, ptr noundef %64, i64 noundef %65)
  %66 = getelementptr inbounds [1 x %struct.gf_s], ptr %9, i64 0, i64 0
  %67 = getelementptr inbounds [1 x %struct.gf_s], ptr %11, i64 0, i64 0
  %68 = load i64, ptr %15, align 8, !tbaa !9
  call void @gf_cond_swap(ptr noundef %66, ptr noundef %67, i64 noundef %68)
  %69 = load i64, ptr %18, align 8, !tbaa !9
  store i64 %69, ptr %15, align 8, !tbaa !9
  %70 = getelementptr inbounds [1 x %struct.gf_s], ptr %12, i64 0, i64 0
  %71 = getelementptr inbounds [1 x %struct.gf_s], ptr %8, i64 0, i64 0
  %72 = getelementptr inbounds [1 x %struct.gf_s], ptr %9, i64 0, i64 0
  call void @gf_add_RAW(ptr noundef %70, ptr noundef %71, ptr noundef %72)
  %73 = getelementptr inbounds [1 x %struct.gf_s], ptr %13, i64 0, i64 0
  %74 = getelementptr inbounds [1 x %struct.gf_s], ptr %8, i64 0, i64 0
  %75 = getelementptr inbounds [1 x %struct.gf_s], ptr %9, i64 0, i64 0
  call void @gf_sub_nr(ptr noundef %73, ptr noundef %74, ptr noundef %75)
  %76 = getelementptr inbounds [1 x %struct.gf_s], ptr %9, i64 0, i64 0
  %77 = getelementptr inbounds [1 x %struct.gf_s], ptr %10, i64 0, i64 0
  %78 = getelementptr inbounds [1 x %struct.gf_s], ptr %11, i64 0, i64 0
  call void @gf_sub_nr(ptr noundef %76, ptr noundef %77, ptr noundef %78)
  %79 = getelementptr inbounds [1 x %struct.gf_s], ptr %8, i64 0, i64 0
  %80 = getelementptr inbounds [1 x %struct.gf_s], ptr %12, i64 0, i64 0
  %81 = getelementptr inbounds [1 x %struct.gf_s], ptr %9, i64 0, i64 0
  call void @ossl_gf_mul(ptr noundef %79, ptr noundef %80, ptr noundef %81)
  %82 = getelementptr inbounds [1 x %struct.gf_s], ptr %9, i64 0, i64 0
  %83 = getelementptr inbounds [1 x %struct.gf_s], ptr %11, i64 0, i64 0
  %84 = getelementptr inbounds [1 x %struct.gf_s], ptr %10, i64 0, i64 0
  call void @gf_add_RAW(ptr noundef %82, ptr noundef %83, ptr noundef %84)
  %85 = getelementptr inbounds [1 x %struct.gf_s], ptr %10, i64 0, i64 0
  %86 = getelementptr inbounds [1 x %struct.gf_s], ptr %13, i64 0, i64 0
  %87 = getelementptr inbounds [1 x %struct.gf_s], ptr %9, i64 0, i64 0
  call void @ossl_gf_mul(ptr noundef %85, ptr noundef %86, ptr noundef %87)
  %88 = getelementptr inbounds [1 x %struct.gf_s], ptr %11, i64 0, i64 0
  %89 = getelementptr inbounds [1 x %struct.gf_s], ptr %8, i64 0, i64 0
  %90 = getelementptr inbounds [1 x %struct.gf_s], ptr %10, i64 0, i64 0
  call void @gf_sub_nr(ptr noundef %88, ptr noundef %89, ptr noundef %90)
  %91 = getelementptr inbounds [1 x %struct.gf_s], ptr %9, i64 0, i64 0
  %92 = getelementptr inbounds [1 x %struct.gf_s], ptr %11, i64 0, i64 0
  call void @ossl_gf_sqr(ptr noundef %91, ptr noundef %92)
  %93 = getelementptr inbounds [1 x %struct.gf_s], ptr %11, i64 0, i64 0
  %94 = getelementptr inbounds [1 x %struct.gf_s], ptr %7, i64 0, i64 0
  %95 = getelementptr inbounds [1 x %struct.gf_s], ptr %9, i64 0, i64 0
  call void @ossl_gf_mul(ptr noundef %93, ptr noundef %94, ptr noundef %95)
  %96 = getelementptr inbounds [1 x %struct.gf_s], ptr %9, i64 0, i64 0
  %97 = getelementptr inbounds [1 x %struct.gf_s], ptr %8, i64 0, i64 0
  %98 = getelementptr inbounds [1 x %struct.gf_s], ptr %10, i64 0, i64 0
  call void @gf_add_RAW(ptr noundef %96, ptr noundef %97, ptr noundef %98)
  %99 = getelementptr inbounds [1 x %struct.gf_s], ptr %10, i64 0, i64 0
  %100 = getelementptr inbounds [1 x %struct.gf_s], ptr %9, i64 0, i64 0
  call void @ossl_gf_sqr(ptr noundef %99, ptr noundef %100)
  %101 = getelementptr inbounds [1 x %struct.gf_s], ptr %9, i64 0, i64 0
  %102 = getelementptr inbounds [1 x %struct.gf_s], ptr %12, i64 0, i64 0
  call void @ossl_gf_sqr(ptr noundef %101, ptr noundef %102)
  %103 = getelementptr inbounds [1 x %struct.gf_s], ptr %12, i64 0, i64 0
  %104 = getelementptr inbounds [1 x %struct.gf_s], ptr %13, i64 0, i64 0
  call void @ossl_gf_sqr(ptr noundef %103, ptr noundef %104)
  %105 = getelementptr inbounds [1 x %struct.gf_s], ptr %8, i64 0, i64 0
  %106 = getelementptr inbounds [1 x %struct.gf_s], ptr %9, i64 0, i64 0
  %107 = getelementptr inbounds [1 x %struct.gf_s], ptr %12, i64 0, i64 0
  call void @ossl_gf_mul(ptr noundef %105, ptr noundef %106, ptr noundef %107)
  %108 = getelementptr inbounds [1 x %struct.gf_s], ptr %13, i64 0, i64 0
  %109 = getelementptr inbounds [1 x %struct.gf_s], ptr %9, i64 0, i64 0
  %110 = getelementptr inbounds [1 x %struct.gf_s], ptr %12, i64 0, i64 0
  call void @gf_sub_nr(ptr noundef %108, ptr noundef %109, ptr noundef %110)
  %111 = getelementptr inbounds [1 x %struct.gf_s], ptr %12, i64 0, i64 0
  %112 = getelementptr inbounds [1 x %struct.gf_s], ptr %13, i64 0, i64 0
  call void @gf_mulw(ptr noundef %111, ptr noundef %112, i32 noundef 39081)
  %113 = getelementptr inbounds [1 x %struct.gf_s], ptr %12, i64 0, i64 0
  %114 = getelementptr inbounds [1 x %struct.gf_s], ptr %12, i64 0, i64 0
  %115 = getelementptr inbounds [1 x %struct.gf_s], ptr %9, i64 0, i64 0
  call void @gf_add_RAW(ptr noundef %113, ptr noundef %114, ptr noundef %115)
  %116 = getelementptr inbounds [1 x %struct.gf_s], ptr %9, i64 0, i64 0
  %117 = getelementptr inbounds [1 x %struct.gf_s], ptr %13, i64 0, i64 0
  %118 = getelementptr inbounds [1 x %struct.gf_s], ptr %12, i64 0, i64 0
  call void @ossl_gf_mul(ptr noundef %116, ptr noundef %117, ptr noundef %118)
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #5
  br label %119

119:                                              ; preds = %50
  %120 = load i32, ptr %14, align 4, !tbaa !11
  %121 = add nsw i32 %120, -1
  store i32 %121, ptr %14, align 4, !tbaa !11
  br label %27, !llvm.loop !14

122:                                              ; preds = %27
  %123 = getelementptr inbounds [1 x %struct.gf_s], ptr %8, i64 0, i64 0
  %124 = getelementptr inbounds [1 x %struct.gf_s], ptr %10, i64 0, i64 0
  %125 = load i64, ptr %15, align 8, !tbaa !9
  call void @gf_cond_swap(ptr noundef %123, ptr noundef %124, i64 noundef %125)
  %126 = getelementptr inbounds [1 x %struct.gf_s], ptr %9, i64 0, i64 0
  %127 = getelementptr inbounds [1 x %struct.gf_s], ptr %11, i64 0, i64 0
  %128 = load i64, ptr %15, align 8, !tbaa !9
  call void @gf_cond_swap(ptr noundef %126, ptr noundef %127, i64 noundef %128)
  %129 = getelementptr inbounds [1 x %struct.gf_s], ptr %9, i64 0, i64 0
  %130 = getelementptr inbounds [1 x %struct.gf_s], ptr %9, i64 0, i64 0
  call void @gf_invert(ptr noundef %129, ptr noundef %130, i32 noundef 0)
  %131 = getelementptr inbounds [1 x %struct.gf_s], ptr %7, i64 0, i64 0
  %132 = getelementptr inbounds [1 x %struct.gf_s], ptr %8, i64 0, i64 0
  %133 = getelementptr inbounds [1 x %struct.gf_s], ptr %9, i64 0, i64 0
  call void @ossl_gf_mul(ptr noundef %131, ptr noundef %132, ptr noundef %133)
  %134 = load ptr, ptr %4, align 8, !tbaa !5
  %135 = getelementptr inbounds [1 x %struct.gf_s], ptr %7, i64 0, i64 0
  call void @gf_serialize(ptr noundef %134, ptr noundef %135, i32 noundef 1)
  %136 = getelementptr inbounds [1 x %struct.gf_s], ptr %7, i64 0, i64 0
  %137 = call i64 @gf_eq(ptr noundef %136, ptr noundef @ZERO)
  %138 = xor i64 %137, -1
  store i64 %138, ptr %16, align 8, !tbaa !9
  %139 = getelementptr inbounds [1 x %struct.gf_s], ptr %7, i64 0, i64 0
  call void @OPENSSL_cleanse(ptr noundef %139, i64 noundef 64)
  %140 = getelementptr inbounds [1 x %struct.gf_s], ptr %8, i64 0, i64 0
  call void @OPENSSL_cleanse(ptr noundef %140, i64 noundef 64)
  %141 = getelementptr inbounds [1 x %struct.gf_s], ptr %9, i64 0, i64 0
  call void @OPENSSL_cleanse(ptr noundef %141, i64 noundef 64)
  %142 = getelementptr inbounds [1 x %struct.gf_s], ptr %10, i64 0, i64 0
  call void @OPENSSL_cleanse(ptr noundef %142, i64 noundef 64)
  %143 = getelementptr inbounds [1 x %struct.gf_s], ptr %11, i64 0, i64 0
  call void @OPENSSL_cleanse(ptr noundef %143, i64 noundef 64)
  %144 = getelementptr inbounds [1 x %struct.gf_s], ptr %12, i64 0, i64 0
  call void @OPENSSL_cleanse(ptr noundef %144, i64 noundef 64)
  %145 = getelementptr inbounds [1 x %struct.gf_s], ptr %13, i64 0, i64 0
  call void @OPENSSL_cleanse(ptr noundef %145, i64 noundef 64)
  %146 = load i64, ptr %16, align 8, !tbaa !9
  %147 = call i64 @mask_to_bool(i64 noundef %146)
  %148 = call i32 @c448_succeed_if(i64 noundef %147)
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %7) #5
  ret i32 %148
}

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @gf_sub_nr(ptr noundef, ptr noundef, ptr 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 = { 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 #5 = { 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 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}


; 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] }

@ZERO = external hidden constant [1 x %struct.gf_s], align 16
@ONE = external hidden constant [1 x %struct.gf_s], align 16

; 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

declare i64 @gf_eq(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

declare void @ossl_gf_sqr(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 @OPENSSL_cleanse(ptr noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @gf_invert(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

declare void @gf_serialize(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @ossl_x448_int(ptr noundef %0, ptr noundef %1, ptr nocapture noundef readonly %2) local_unnamed_addr #3 {
.peel.next:
  %3 = alloca [1 x %struct.gf_s], 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
  %8 = alloca [1 x %struct.gf_s], align 16
  %9 = alloca [1 x %struct.gf_s], align 16
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %8) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %9) #5
  %10 = call i64 @gf_deserialize(ptr noundef nonnull %3, ptr noundef %1, i32 noundef 1, i8 noundef zeroext 0) #5
  call void @gf_copy(ptr noundef nonnull %4, ptr noundef nonnull @ONE)
  call void @gf_copy(ptr noundef nonnull %5, ptr noundef nonnull @ZERO)
  call void @gf_copy(ptr noundef nonnull %6, ptr noundef nonnull %3)
  call void @gf_copy(ptr noundef nonnull %7, ptr noundef nonnull @ONE)
  call void @gf_cond_swap(ptr noundef nonnull %4, ptr noundef nonnull %6, i64 noundef -1)
  call void @gf_cond_swap(ptr noundef nonnull %5, ptr noundef nonnull %7, i64 noundef -1)
  call void @gf_add_RAW(ptr noundef nonnull %8, ptr noundef nonnull %4, ptr noundef nonnull %5)
  call void @gf_sub_nr(ptr noundef nonnull %9, ptr noundef nonnull %4, ptr noundef nonnull %5)
  call void @gf_sub_nr(ptr noundef nonnull %5, ptr noundef nonnull %6, ptr noundef nonnull %7)
  call void @ossl_gf_mul(ptr noundef nonnull %4, ptr noundef nonnull %8, ptr noundef nonnull %5) #5
  call void @gf_add_RAW(ptr noundef nonnull %5, ptr noundef nonnull %7, ptr noundef nonnull %6)
  call void @ossl_gf_mul(ptr noundef nonnull %6, ptr noundef nonnull %9, ptr noundef nonnull %5) #5
  call void @gf_sub_nr(ptr noundef nonnull %7, ptr noundef nonnull %4, ptr noundef nonnull %6)
  call void @ossl_gf_sqr(ptr noundef nonnull %5, ptr noundef nonnull %7) #5
  call void @ossl_gf_mul(ptr noundef nonnull %7, ptr noundef nonnull %3, ptr noundef nonnull %5) #5
  call void @gf_add_RAW(ptr noundef nonnull %5, ptr noundef nonnull %4, ptr noundef nonnull %6)
  call void @ossl_gf_sqr(ptr noundef nonnull %6, ptr noundef nonnull %5) #5
  call void @ossl_gf_sqr(ptr noundef nonnull %5, ptr noundef nonnull %8) #5
  call void @ossl_gf_sqr(ptr noundef nonnull %8, ptr noundef nonnull %9) #5
  call void @ossl_gf_mul(ptr noundef nonnull %4, ptr noundef nonnull %5, ptr noundef nonnull %8) #5
  call void @gf_sub_nr(ptr noundef nonnull %9, ptr noundef nonnull %5, ptr noundef nonnull %8)
  call void @gf_mulw(ptr noundef nonnull %8, ptr noundef nonnull %9, i32 noundef 39081)
  call void @gf_add_RAW(ptr noundef nonnull %8, ptr noundef nonnull %8, ptr noundef nonnull %5)
  call void @ossl_gf_mul(ptr noundef nonnull %5, ptr noundef nonnull %9, ptr noundef nonnull %8) #5
  br label %11

11:                                               ; preds = %.peel.next, %11
  %.022 = phi i32 [ 446, %.peel.next ], [ %25, %11 ]
  %.02021 = phi i64 [ -1, %.peel.next ], [ %23, %11 ]
  %12 = lshr i32 %.022, 3
  %13 = zext nneg i32 %12 to i64
  %14 = getelementptr inbounds i8, ptr %2, i64 %13
  %15 = load i8, ptr %14, align 1, !tbaa !5
  %16 = icmp ult i32 %.022, 8
  %17 = and i8 %15, -4
  %.019 = select i1 %16, i8 %17, i8 %15
  %18 = zext i8 %.019 to i32
  %19 = and i32 %.022, 7
  %20 = lshr i32 %18, %19
  %21 = and i32 %20, 1
  %22 = zext nneg i32 %21 to i64
  %23 = sub nsw i64 0, %22
  %24 = xor i64 %.02021, %23
  call void @gf_cond_swap(ptr noundef nonnull %4, ptr noundef nonnull %6, i64 noundef %24)
  call void @gf_cond_swap(ptr noundef nonnull %5, ptr noundef nonnull %7, i64 noundef %24)
  call void @gf_add_RAW(ptr noundef nonnull %8, ptr noundef nonnull %4, ptr noundef nonnull %5)
  call void @gf_sub_nr(ptr noundef nonnull %9, ptr noundef nonnull %4, ptr noundef nonnull %5)
  call void @gf_sub_nr(ptr noundef nonnull %5, ptr noundef nonnull %6, ptr noundef nonnull %7)
  call void @ossl_gf_mul(ptr noundef nonnull %4, ptr noundef nonnull %8, ptr noundef nonnull %5) #5
  call void @gf_add_RAW(ptr noundef nonnull %5, ptr noundef nonnull %7, ptr noundef nonnull %6)
  call void @ossl_gf_mul(ptr noundef nonnull %6, ptr noundef nonnull %9, ptr noundef nonnull %5) #5
  call void @gf_sub_nr(ptr noundef nonnull %7, ptr noundef nonnull %4, ptr noundef nonnull %6)
  call void @ossl_gf_sqr(ptr noundef nonnull %5, ptr noundef nonnull %7) #5
  call void @ossl_gf_mul(ptr noundef nonnull %7, ptr noundef nonnull %3, ptr noundef nonnull %5) #5
  call void @gf_add_RAW(ptr noundef nonnull %5, ptr noundef nonnull %4, ptr noundef nonnull %6)
  call void @ossl_gf_sqr(ptr noundef nonnull %6, ptr noundef nonnull %5) #5
  call void @ossl_gf_sqr(ptr noundef nonnull %5, ptr noundef nonnull %8) #5
  call void @ossl_gf_sqr(ptr noundef nonnull %8, ptr noundef nonnull %9) #5
  call void @ossl_gf_mul(ptr noundef nonnull %4, ptr noundef nonnull %5, ptr noundef nonnull %8) #5
  call void @gf_sub_nr(ptr noundef nonnull %9, ptr noundef nonnull %5, ptr noundef nonnull %8)
  call void @gf_mulw(ptr noundef nonnull %8, ptr noundef nonnull %9, i32 noundef 39081)
  call void @gf_add_RAW(ptr noundef nonnull %8, ptr noundef nonnull %8, ptr noundef nonnull %5)
  call void @ossl_gf_mul(ptr noundef nonnull %5, ptr noundef nonnull %9, ptr noundef nonnull %8) #5
  %25 = add nsw i32 %.022, -1
  %.not = icmp eq i32 %.022, 0
  br i1 %.not, label %.loopexit, label %11, !llvm.loop !8

.loopexit:                                        ; preds = %11
  call void @gf_cond_swap(ptr noundef nonnull %4, ptr noundef nonnull %6, i64 noundef %23)
  call void @gf_cond_swap(ptr noundef nonnull %5, ptr noundef nonnull %7, i64 noundef %23)
  call void @gf_invert(ptr noundef nonnull %5, ptr noundef nonnull %5, i32 noundef 0)
  call void @ossl_gf_mul(ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef nonnull %5) #5
  call void @gf_serialize(ptr noundef %0, ptr noundef nonnull %3, i32 noundef 1) #5
  %26 = call i64 @gf_eq(ptr noundef nonnull %3, ptr noundef nonnull @ZERO) #5
  %27 = xor i64 %26, -1
  call void @OPENSSL_cleanse(ptr noundef nonnull %3, i64 noundef 64) #5
  call void @OPENSSL_cleanse(ptr noundef nonnull %4, i64 noundef 64) #5
  call void @OPENSSL_cleanse(ptr noundef nonnull %5, i64 noundef 64) #5
  call void @OPENSSL_cleanse(ptr noundef nonnull %6, i64 noundef 64) #5
  call void @OPENSSL_cleanse(ptr noundef nonnull %7, i64 noundef 64) #5
  call void @OPENSSL_cleanse(ptr noundef nonnull %8, i64 noundef 64) #5
  call void @OPENSSL_cleanse(ptr noundef nonnull %9, i64 noundef 64) #5
  %28 = call i64 @mask_to_bool(i64 noundef %27)
  %29 = call i32 @c448_succeed_if(i64 noundef %28)
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %3) #5
  ret i32 %29
}

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @gf_sub_nr(ptr noundef, ptr noundef, ptr 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 = { 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 #5 = { 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 = distinct !{!8, !9, !10}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!"llvm.loop.peeled.count", i32 1}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopFullUnrollPass,LoopRotatePass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass