; LLVM IR from machinefi/psa-crypto-esp32 :: crypto (ecc)

; 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.uECC_Curve_t = type { i8, i8, i16, [8 x i32], [8 x i32], [16 x i32], [8 x i32], ptr, ptr, ptr }

; Function Attrs: nounwind uwtable
declare dso_local i32 @uECC_get_curve_type(ptr noundef) #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @uECC_vli_isZero(ptr noundef, i8 noundef signext) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @uECC_vli_testBit(ptr noundef, i16 noundef signext) #0

; Function Attrs: nounwind uwtable
declare dso_local void @uECC_vli_set(ptr noundef, ptr noundef, i8 noundef signext) #0

; Function Attrs: nounwind uwtable
declare dso_local void @uECC_vli_modAdd(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i8 noundef signext) #0

; Function Attrs: nounwind uwtable
declare hidden i32 @uECC_vli_add(ptr noundef, ptr noundef, ptr noundef, i8 noundef signext) #0

; Function Attrs: nounwind uwtable
declare dso_local void @uECC_vli_modSub(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i8 noundef signext) #0

; Function Attrs: nounwind uwtable
declare hidden void @uECC_vli_rshift1(ptr noundef, i8 noundef signext) #0

; Function Attrs: nounwind uwtable
declare dso_local void @uECC_vli_modMult_fast(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
define dso_local void @double_jacobian_default(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca [8 x i32], align 16
  %11 = alloca [8 x i32], align 16
  %12 = alloca i8, align 1
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #2
  store i32 0, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr %10) #2
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #2
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #2
  %15 = load ptr, ptr %8, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.uECC_Curve_t, ptr %15, i32 0, i32 0
  %17 = load i8, ptr %16, align 8, !tbaa !11
  store i8 %17, ptr %12, align 1, !tbaa !14
  %18 = load ptr, ptr %7, align 8, !tbaa !5
  %19 = load i8, ptr %12, align 1, !tbaa !14
  %20 = call i32 @uECC_vli_isZero(ptr noundef %18, i8 noundef signext %19)
  %21 = icmp ne i32 %20, 0
  br i1 %21, label %22, label %23

22:                                               ; preds = %4
  store i32 1, ptr %13, align 4
  br label %175

23:                                               ; preds = %4
  %24 = getelementptr inbounds [8 x i32], ptr %10, i64 0, i64 0
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = load ptr, ptr %8, align 8, !tbaa !5
  call void @uECC_vli_modSquare_fast(ptr noundef %24, ptr noundef %25, ptr noundef %26)
  %27 = getelementptr inbounds [8 x i32], ptr %11, i64 0, i64 0
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = getelementptr inbounds [8 x i32], ptr %10, i64 0, i64 0
  %30 = load ptr, ptr %8, align 8, !tbaa !5
  call void @uECC_vli_modMult_fast(ptr noundef %27, ptr noundef %28, ptr noundef %29, ptr noundef %30)
  %31 = getelementptr inbounds [8 x i32], ptr %10, i64 0, i64 0
  %32 = getelementptr inbounds [8 x i32], ptr %10, i64 0, i64 0
  %33 = load ptr, ptr %8, align 8, !tbaa !5
  call void @uECC_vli_modSquare_fast(ptr noundef %31, ptr noundef %32, ptr noundef %33)
  %34 = load ptr, ptr %6, align 8, !tbaa !5
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = load ptr, ptr %7, align 8, !tbaa !5
  %37 = load ptr, ptr %8, align 8, !tbaa !5
  call void @uECC_vli_modMult_fast(ptr noundef %34, ptr noundef %35, ptr noundef %36, ptr noundef %37)
  %38 = load ptr, ptr %7, align 8, !tbaa !5
  %39 = load ptr, ptr %7, align 8, !tbaa !5
  %40 = load ptr, ptr %8, align 8, !tbaa !5
  call void @uECC_vli_modSquare_fast(ptr noundef %38, ptr noundef %39, ptr noundef %40)
  %41 = load ptr, ptr %8, align 8, !tbaa !5
  %42 = call i32 @uECC_get_curve_type(ptr noundef %41)
  store i32 %42, ptr %9, align 4, !tbaa !9
  %43 = load i32, ptr %9, align 4, !tbaa !9
  switch i32 %43, label %102 [
    i32 1, label %44
    i32 2, label %84
  ]

44:                                               ; preds = %23
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  %47 = load ptr, ptr %7, align 8, !tbaa !5
  %48 = load ptr, ptr %8, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.uECC_Curve_t, ptr %48, i32 0, i32 3
  %50 = getelementptr inbounds [8 x i32], ptr %49, i64 0, i64 0
  %51 = load i8, ptr %12, align 1, !tbaa !14
  call void @uECC_vli_modAdd(ptr noundef %45, ptr noundef %46, ptr noundef %47, ptr noundef %50, i8 noundef signext %51)
  %52 = load ptr, ptr %7, align 8, !tbaa !5
  %53 = load ptr, ptr %7, align 8, !tbaa !5
  %54 = load ptr, ptr %7, align 8, !tbaa !5
  %55 = load ptr, ptr %8, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.uECC_Curve_t, ptr %55, i32 0, i32 3
  %57 = getelementptr inbounds [8 x i32], ptr %56, i64 0, i64 0
  %58 = load i8, ptr %12, align 1, !tbaa !14
  call void @uECC_vli_modAdd(ptr noundef %52, ptr noundef %53, ptr noundef %54, ptr noundef %57, i8 noundef signext %58)
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  %62 = load ptr, ptr %8, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.uECC_Curve_t, ptr %62, i32 0, i32 3
  %64 = getelementptr inbounds [8 x i32], ptr %63, i64 0, i64 0
  %65 = load i8, ptr %12, align 1, !tbaa !14
  call void @uECC_vli_modSub(ptr noundef %59, ptr noundef %60, ptr noundef %61, ptr noundef %64, i8 noundef signext %65)
  %66 = load ptr, ptr %5, align 8, !tbaa !5
  %67 = load ptr, ptr %5, align 8, !tbaa !5
  %68 = load ptr, ptr %7, align 8, !tbaa !5
  %69 = load ptr, ptr %8, align 8, !tbaa !5
  call void @uECC_vli_modMult_fast(ptr noundef %66, ptr noundef %67, ptr noundef %68, ptr noundef %69)
  %70 = load ptr, ptr %7, align 8, !tbaa !5
  %71 = load ptr, ptr %5, align 8, !tbaa !5
  %72 = load ptr, ptr %5, align 8, !tbaa !5
  %73 = load ptr, ptr %8, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.uECC_Curve_t, ptr %73, i32 0, i32 3
  %75 = getelementptr inbounds [8 x i32], ptr %74, i64 0, i64 0
  %76 = load i8, ptr %12, align 1, !tbaa !14
  call void @uECC_vli_modAdd(ptr noundef %70, ptr noundef %71, ptr noundef %72, ptr noundef %75, i8 noundef signext %76)
  %77 = load ptr, ptr %5, align 8, !tbaa !5
  %78 = load ptr, ptr %5, align 8, !tbaa !5
  %79 = load ptr, ptr %7, align 8, !tbaa !5
  %80 = load ptr, ptr %8, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.uECC_Curve_t, ptr %80, i32 0, i32 3
  %82 = getelementptr inbounds [8 x i32], ptr %81, i64 0, i64 0
  %83 = load i8, ptr %12, align 1, !tbaa !14
  call void @uECC_vli_modAdd(ptr noundef %77, ptr noundef %78, ptr noundef %79, ptr noundef %82, i8 noundef signext %83)
  br label %103

84:                                               ; preds = %23
  %85 = load ptr, ptr %5, align 8, !tbaa !5
  %86 = load ptr, ptr %5, align 8, !tbaa !5
  %87 = load ptr, ptr %8, align 8, !tbaa !5
  call void @uECC_vli_modSquare_fast(ptr noundef %85, ptr noundef %86, ptr noundef %87)
  %88 = load ptr, ptr %7, align 8, !tbaa !5
  %89 = load ptr, ptr %5, align 8, !tbaa !5
  %90 = load ptr, ptr %5, align 8, !tbaa !5
  %91 = load ptr, ptr %8, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.uECC_Curve_t, ptr %91, i32 0, i32 3
  %93 = getelementptr inbounds [8 x i32], ptr %92, i64 0, i64 0
  %94 = load i8, ptr %12, align 1, !tbaa !14
  call void @uECC_vli_modAdd(ptr noundef %88, ptr noundef %89, ptr noundef %90, ptr noundef %93, i8 noundef signext %94)
  %95 = load ptr, ptr %5, align 8, !tbaa !5
  %96 = load ptr, ptr %5, align 8, !tbaa !5
  %97 = load ptr, ptr %7, align 8, !tbaa !5
  %98 = load ptr, ptr %8, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.uECC_Curve_t, ptr %98, i32 0, i32 3
  %100 = getelementptr inbounds [8 x i32], ptr %99, i64 0, i64 0
  %101 = load i8, ptr %12, align 1, !tbaa !14
  call void @uECC_vli_modAdd(ptr noundef %95, ptr noundef %96, ptr noundef %97, ptr noundef %100, i8 noundef signext %101)
  br label %103

102:                                              ; preds = %23
  store i32 1, ptr %13, align 4
  br label %175

103:                                              ; preds = %84, %44
  %104 = load ptr, ptr %5, align 8, !tbaa !5
  %105 = call i32 @uECC_vli_testBit(ptr noundef %104, i16 noundef signext 0)
  %106 = icmp ne i32 %105, 0
  br i1 %106, label %107, label %127

107:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #2
  %108 = load ptr, ptr %5, align 8, !tbaa !5
  %109 = load ptr, ptr %5, align 8, !tbaa !5
  %110 = load ptr, ptr %8, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.uECC_Curve_t, ptr %110, i32 0, i32 3
  %112 = getelementptr inbounds [8 x i32], ptr %111, i64 0, i64 0
  %113 = load i8, ptr %12, align 1, !tbaa !14
  %114 = call i32 @uECC_vli_add(ptr noundef %108, ptr noundef %109, ptr noundef %112, i8 noundef signext %113)
  store i32 %114, ptr %14, align 4, !tbaa !9
  %115 = load ptr, ptr %5, align 8, !tbaa !5
  %116 = load i8, ptr %12, align 1, !tbaa !14
  call void @uECC_vli_rshift1(ptr noundef %115, i8 noundef signext %116)
  %117 = load i32, ptr %14, align 4, !tbaa !9
  %118 = shl i32 %117, 31
  %119 = load ptr, ptr %5, align 8, !tbaa !5
  %120 = load i8, ptr %12, align 1, !tbaa !14
  %121 = sext i8 %120 to i32
  %122 = sub nsw i32 %121, 1
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds i32, ptr %119, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !9
  %126 = or i32 %125, %118
  store i32 %126, ptr %124, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #2
  br label %130

127:                                              ; preds = %103
  %128 = load ptr, ptr %5, align 8, !tbaa !5
  %129 = load i8, ptr %12, align 1, !tbaa !14
  call void @uECC_vli_rshift1(ptr noundef %128, i8 noundef signext %129)
  br label %130

130:                                              ; preds = %127, %107
  %131 = load ptr, ptr %7, align 8, !tbaa !5
  %132 = load ptr, ptr %5, align 8, !tbaa !5
  %133 = load ptr, ptr %8, align 8, !tbaa !5
  call void @uECC_vli_modSquare_fast(ptr noundef %131, ptr noundef %132, ptr noundef %133)
  %134 = load ptr, ptr %7, align 8, !tbaa !5
  %135 = load ptr, ptr %7, align 8, !tbaa !5
  %136 = getelementptr inbounds [8 x i32], ptr %11, i64 0, i64 0
  %137 = load ptr, ptr %8, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.uECC_Curve_t, ptr %137, i32 0, i32 3
  %139 = getelementptr inbounds [8 x i32], ptr %138, i64 0, i64 0
  %140 = load i8, ptr %12, align 1, !tbaa !14
  call void @uECC_vli_modSub(ptr noundef %134, ptr noundef %135, ptr noundef %136, ptr noundef %139, i8 noundef signext %140)
  %141 = load ptr, ptr %7, align 8, !tbaa !5
  %142 = load ptr, ptr %7, align 8, !tbaa !5
  %143 = getelementptr inbounds [8 x i32], ptr %11, i64 0, i64 0
  %144 = load ptr, ptr %8, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.uECC_Curve_t, ptr %144, i32 0, i32 3
  %146 = getelementptr inbounds [8 x i32], ptr %145, i64 0, i64 0
  %147 = load i8, ptr %12, align 1, !tbaa !14
  call void @uECC_vli_modSub(ptr noundef %141, ptr noundef %142, ptr noundef %143, ptr noundef %146, i8 noundef signext %147)
  %148 = getelementptr inbounds [8 x i32], ptr %11, i64 0, i64 0
  %149 = getelementptr inbounds [8 x i32], ptr %11, i64 0, i64 0
  %150 = load ptr, ptr %7, align 8, !tbaa !5
  %151 = load ptr, ptr %8, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.uECC_Curve_t, ptr %151, i32 0, i32 3
  %153 = getelementptr inbounds [8 x i32], ptr %152, i64 0, i64 0
  %154 = load i8, ptr %12, align 1, !tbaa !14
  call void @uECC_vli_modSub(ptr noundef %148, ptr noundef %149, ptr noundef %150, ptr noundef %153, i8 noundef signext %154)
  %155 = load ptr, ptr %5, align 8, !tbaa !5
  %156 = load ptr, ptr %5, align 8, !tbaa !5
  %157 = getelementptr inbounds [8 x i32], ptr %11, i64 0, i64 0
  %158 = load ptr, ptr %8, align 8, !tbaa !5
  call void @uECC_vli_modMult_fast(ptr noundef %155, ptr noundef %156, ptr noundef %157, ptr noundef %158)
  %159 = getelementptr inbounds [8 x i32], ptr %10, i64 0, i64 0
  %160 = load ptr, ptr %5, align 8, !tbaa !5
  %161 = getelementptr inbounds [8 x i32], ptr %10, i64 0, i64 0
  %162 = load ptr, ptr %8, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.uECC_Curve_t, ptr %162, i32 0, i32 3
  %164 = getelementptr inbounds [8 x i32], ptr %163, i64 0, i64 0
  %165 = load i8, ptr %12, align 1, !tbaa !14
  call void @uECC_vli_modSub(ptr noundef %159, ptr noundef %160, ptr noundef %161, ptr noundef %164, i8 noundef signext %165)
  %166 = load ptr, ptr %5, align 8, !tbaa !5
  %167 = load ptr, ptr %7, align 8, !tbaa !5
  %168 = load i8, ptr %12, align 1, !tbaa !14
  call void @uECC_vli_set(ptr noundef %166, ptr noundef %167, i8 noundef signext %168)
  %169 = load ptr, ptr %7, align 8, !tbaa !5
  %170 = load ptr, ptr %6, align 8, !tbaa !5
  %171 = load i8, ptr %12, align 1, !tbaa !14
  call void @uECC_vli_set(ptr noundef %169, ptr noundef %170, i8 noundef signext %171)
  %172 = load ptr, ptr %6, align 8, !tbaa !5
  %173 = getelementptr inbounds [8 x i32], ptr %10, i64 0, i64 0
  %174 = load i8, ptr %12, align 1, !tbaa !14
  call void @uECC_vli_set(ptr noundef %172, ptr noundef %173, i8 noundef signext %174)
  store i32 0, ptr %13, align 4
  br label %175

175:                                              ; preds = %130, %102, %22
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #2
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #2
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #2
  %176 = load i32, ptr %13, align 4
  switch i32 %176, label %178 [
    i32 0, label %177
    i32 1, label %177
  ]

177:                                              ; preds = %175, %175
  ret void

178:                                              ; preds = %175
  unreachable
}

; Function Attrs: nounwind uwtable
declare hidden void @uECC_vli_modSquare_fast(ptr noundef, ptr noundef, ptr noundef) #0

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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, !7, i64 0}
!12 = !{!"uECC_Curve_t", !7, i64 0, !7, i64 1, !13, i64 2, !7, i64 4, !7, i64 36, !7, i64 68, !7, i64 132, !6, i64 168, !6, i64 176, !6, i64 184}
!13 = !{!"short", !7, i64 0}
!14 = !{!7, !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"

; Function Attrs: nounwind uwtable
declare dso_local i32 @uECC_get_curve_type(ptr noundef) local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @uECC_vli_isZero(ptr noundef, i8 noundef signext) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @uECC_vli_testBit(ptr noundef, i16 noundef signext) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @uECC_vli_set(ptr noundef, ptr noundef, i8 noundef signext) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @uECC_vli_modAdd(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i8 noundef signext) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden i32 @uECC_vli_add(ptr noundef, ptr noundef, ptr noundef, i8 noundef signext) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @uECC_vli_modSub(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i8 noundef signext) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden void @uECC_vli_rshift1(ptr noundef, i8 noundef signext) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @uECC_vli_modMult_fast(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @double_jacobian_default(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #0 {
  %5 = alloca [8 x i32], align 16
  %6 = alloca [8 x i32], align 16
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #2
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #2
  %7 = load i8, ptr %3, align 8, !tbaa !5
  %8 = tail call i32 @uECC_vli_isZero(ptr noundef %2, i8 noundef signext %7)
  %.not = icmp eq i32 %8, 0
  br i1 %.not, label %9, label %29

9:                                                ; preds = %4
  call void @uECC_vli_modSquare_fast(ptr noundef nonnull %5, ptr noundef %1, ptr noundef nonnull %3)
  call void @uECC_vli_modMult_fast(ptr noundef nonnull %6, ptr noundef %0, ptr noundef nonnull %5, ptr noundef nonnull %3)
  call void @uECC_vli_modSquare_fast(ptr noundef nonnull %5, ptr noundef nonnull %5, ptr noundef nonnull %3)
  call void @uECC_vli_modMult_fast(ptr noundef %1, ptr noundef %1, ptr noundef %2, ptr noundef nonnull %3)
  call void @uECC_vli_modSquare_fast(ptr noundef %2, ptr noundef %2, ptr noundef nonnull %3)
  %10 = call i32 @uECC_get_curve_type(ptr noundef nonnull %3)
  switch i32 %10, label %29 [
    i32 1, label %11
    i32 2, label %13
  ]

11:                                               ; preds = %9
  %12 = getelementptr inbounds i8, ptr %3, i64 4
  call void @uECC_vli_modAdd(ptr noundef %0, ptr noundef %0, ptr noundef %2, ptr noundef nonnull %12, i8 noundef signext %7)
  call void @uECC_vli_modAdd(ptr noundef %2, ptr noundef %2, ptr noundef %2, ptr noundef nonnull %12, i8 noundef signext %7)
  call void @uECC_vli_modSub(ptr noundef %2, ptr noundef %0, ptr noundef %2, ptr noundef nonnull %12, i8 noundef signext %7)
  call void @uECC_vli_modMult_fast(ptr noundef %0, ptr noundef %0, ptr noundef %2, ptr noundef nonnull %3)
  br label %15

13:                                               ; preds = %9
  call void @uECC_vli_modSquare_fast(ptr noundef %0, ptr noundef %0, ptr noundef nonnull %3)
  %14 = getelementptr inbounds i8, ptr %3, i64 4
  br label %15

15:                                               ; preds = %13, %11
  %.sink99 = phi ptr [ %14, %13 ], [ %12, %11 ]
  call void @uECC_vli_modAdd(ptr noundef %2, ptr noundef %0, ptr noundef %0, ptr noundef nonnull %.sink99, i8 noundef signext %7)
  call void @uECC_vli_modAdd(ptr noundef %0, ptr noundef %0, ptr noundef %2, ptr noundef nonnull %.sink99, i8 noundef signext %7)
  %16 = call i32 @uECC_vli_testBit(ptr noundef %0, i16 noundef signext 0)
  %.not98 = icmp eq i32 %16, 0
  br i1 %.not98, label %26, label %17

17:                                               ; preds = %15
  %18 = getelementptr inbounds i8, ptr %3, i64 4
  %19 = call i32 @uECC_vli_add(ptr noundef %0, ptr noundef %0, ptr noundef nonnull %18, i8 noundef signext %7)
  call void @uECC_vli_rshift1(ptr noundef %0, i8 noundef signext %7)
  %20 = shl i32 %19, 31
  %21 = sext i8 %7 to i64
  %22 = getelementptr i32, ptr %0, i64 %21
  %23 = getelementptr i8, ptr %22, i64 -4
  %24 = load i32, ptr %23, align 4, !tbaa !11
  %25 = or i32 %24, %20
  store i32 %25, ptr %23, align 4, !tbaa !11
  br label %27

26:                                               ; preds = %15
  call void @uECC_vli_rshift1(ptr noundef %0, i8 noundef signext %7)
  br label %27

27:                                               ; preds = %26, %17
  call void @uECC_vli_modSquare_fast(ptr noundef %2, ptr noundef %0, ptr noundef nonnull %3)
  %28 = getelementptr inbounds i8, ptr %3, i64 4
  call void @uECC_vli_modSub(ptr noundef %2, ptr noundef %2, ptr noundef nonnull %6, ptr noundef nonnull %28, i8 noundef signext %7)
  call void @uECC_vli_modSub(ptr noundef %2, ptr noundef %2, ptr noundef nonnull %6, ptr noundef nonnull %28, i8 noundef signext %7)
  call void @uECC_vli_modSub(ptr noundef nonnull %6, ptr noundef nonnull %6, ptr noundef %2, ptr noundef nonnull %28, i8 noundef signext %7)
  call void @uECC_vli_modMult_fast(ptr noundef %0, ptr noundef %0, ptr noundef nonnull %6, ptr noundef nonnull %3)
  call void @uECC_vli_modSub(ptr noundef nonnull %5, ptr noundef %0, ptr noundef nonnull %5, ptr noundef nonnull %28, i8 noundef signext %7)
  call void @uECC_vli_set(ptr noundef %0, ptr noundef %2, i8 noundef signext %7)
  call void @uECC_vli_set(ptr noundef %2, ptr noundef %1, i8 noundef signext %7)
  call void @uECC_vli_set(ptr noundef %1, ptr noundef nonnull %5, i8 noundef signext %7)
  br label %29

29:                                               ; preds = %9, %4, %27
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #2
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #2
  ret void
}

; Function Attrs: nounwind uwtable
declare hidden void @uECC_vli_modSquare_fast(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"uECC_Curve_t", !7, i64 0, !7, i64 1, !9, i64 2, !7, i64 4, !7, i64 36, !7, i64 68, !7, i64 132, !10, i64 168, !10, i64 176, !10, i64 184}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"short", !7, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}


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