; 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; 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 i32 @uECC_vli_testBit(ptr noundef, i16 noundef signext) #1

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @EccPoint_mult(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i16 noundef signext %4, ptr noundef %5) #1 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i16, align 2
  %12 = alloca ptr, align 8
  %13 = alloca [2 x [8 x i32]], align 16
  %14 = alloca [2 x [8 x i32]], align 16
  %15 = alloca [8 x i32], align 16
  %16 = alloca i16, align 2
  %17 = alloca i32, align 4
  %18 = alloca i8, align 1
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store i16 %4, ptr %11, align 2, !tbaa !9
  store ptr %5, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 64, ptr %13) #2
  call void @llvm.lifetime.start.p0(i64 64, ptr %14) #2
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #2
  call void @llvm.lifetime.start.p0(i64 2, ptr %16) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #2
  call void @llvm.lifetime.start.p0(i64 1, ptr %18) #2
  %19 = load ptr, ptr %12, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.uECC_Curve_t, ptr %19, i32 0, i32 0
  %21 = load i8, ptr %20, align 8, !tbaa !11
  store i8 %21, ptr %18, align 1, !tbaa !13
  %22 = getelementptr inbounds [2 x [8 x i32]], ptr %13, i64 0, i64 1
  %23 = getelementptr inbounds [8 x i32], ptr %22, i64 0, i64 0
  %24 = load ptr, ptr %8, align 8, !tbaa !5
  %25 = load i8, ptr %18, align 1, !tbaa !13
  call void @uECC_vli_set(ptr noundef %23, ptr noundef %24, i8 noundef signext %25)
  %26 = getelementptr inbounds [2 x [8 x i32]], ptr %14, i64 0, i64 1
  %27 = getelementptr inbounds [8 x i32], ptr %26, i64 0, i64 0
  %28 = load ptr, ptr %8, align 8, !tbaa !5
  %29 = load i8, ptr %18, align 1, !tbaa !13
  %30 = sext i8 %29 to i32
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds i32, ptr %28, i64 %31
  %33 = load i8, ptr %18, align 1, !tbaa !13
  call void @uECC_vli_set(ptr noundef %27, ptr noundef %32, i8 noundef signext %33)
  %34 = getelementptr inbounds [2 x [8 x i32]], ptr %13, i64 0, i64 1
  %35 = getelementptr inbounds [8 x i32], ptr %34, i64 0, i64 0
  %36 = getelementptr inbounds [2 x [8 x i32]], ptr %14, i64 0, i64 1
  %37 = getelementptr inbounds [8 x i32], ptr %36, i64 0, i64 0
  %38 = getelementptr inbounds [2 x [8 x i32]], ptr %13, i64 0, i64 0
  %39 = getelementptr inbounds [8 x i32], ptr %38, i64 0, i64 0
  %40 = getelementptr inbounds [2 x [8 x i32]], ptr %14, i64 0, i64 0
  %41 = getelementptr inbounds [8 x i32], ptr %40, i64 0, i64 0
  %42 = load ptr, ptr %10, align 8, !tbaa !5
  %43 = load ptr, ptr %12, align 8, !tbaa !5
  call void @XYcZ_initial_double(ptr noundef %35, ptr noundef %37, ptr noundef %39, ptr noundef %41, ptr noundef %42, ptr noundef %43)
  %44 = load i16, ptr %11, align 2, !tbaa !9
  %45 = sext i16 %44 to i32
  %46 = sub nsw i32 %45, 2
  %47 = trunc i32 %46 to i16
  store i16 %47, ptr %16, align 2, !tbaa !9
  br label %48

48:                                               ; preds = %97, %6
  %49 = load i16, ptr %16, align 2, !tbaa !9
  %50 = sext i16 %49 to i32
  %51 = icmp sgt i32 %50, 0
  br i1 %51, label %52, label %100

52:                                               ; preds = %48
  %53 = load ptr, ptr %9, align 8, !tbaa !5
  %54 = load i16, ptr %16, align 2, !tbaa !9
  %55 = call i32 @uECC_vli_testBit(ptr noundef %53, i16 noundef signext %54)
  %56 = icmp ne i32 %55, 0
  %57 = xor i1 %56, true
  %58 = zext i1 %57 to i32
  store i32 %58, ptr %17, align 4, !tbaa !14
  %59 = load i32, ptr %17, align 4, !tbaa !14
  %60 = sub i32 1, %59
  %61 = zext i32 %60 to i64
  %62 = getelementptr inbounds [2 x [8 x i32]], ptr %13, i64 0, i64 %61
  %63 = getelementptr inbounds [8 x i32], ptr %62, i64 0, i64 0
  %64 = load i32, ptr %17, align 4, !tbaa !14
  %65 = sub i32 1, %64
  %66 = zext i32 %65 to i64
  %67 = getelementptr inbounds [2 x [8 x i32]], ptr %14, i64 0, i64 %66
  %68 = getelementptr inbounds [8 x i32], ptr %67, i64 0, i64 0
  %69 = load i32, ptr %17, align 4, !tbaa !14
  %70 = zext i32 %69 to i64
  %71 = getelementptr inbounds [2 x [8 x i32]], ptr %13, i64 0, i64 %70
  %72 = getelementptr inbounds [8 x i32], ptr %71, i64 0, i64 0
  %73 = load i32, ptr %17, align 4, !tbaa !14
  %74 = zext i32 %73 to i64
  %75 = getelementptr inbounds [2 x [8 x i32]], ptr %14, i64 0, i64 %74
  %76 = getelementptr inbounds [8 x i32], ptr %75, i64 0, i64 0
  %77 = load ptr, ptr %12, align 8, !tbaa !5
  call void @XYcZ_addC(ptr noundef %63, ptr noundef %68, ptr noundef %72, ptr noundef %76, ptr noundef %77)
  %78 = load i32, ptr %17, align 4, !tbaa !14
  %79 = zext i32 %78 to i64
  %80 = getelementptr inbounds [2 x [8 x i32]], ptr %13, i64 0, i64 %79
  %81 = getelementptr inbounds [8 x i32], ptr %80, i64 0, i64 0
  %82 = load i32, ptr %17, align 4, !tbaa !14
  %83 = zext i32 %82 to i64
  %84 = getelementptr inbounds [2 x [8 x i32]], ptr %14, i64 0, i64 %83
  %85 = getelementptr inbounds [8 x i32], ptr %84, i64 0, i64 0
  %86 = load i32, ptr %17, align 4, !tbaa !14
  %87 = sub i32 1, %86
  %88 = zext i32 %87 to i64
  %89 = getelementptr inbounds [2 x [8 x i32]], ptr %13, i64 0, i64 %88
  %90 = getelementptr inbounds [8 x i32], ptr %89, i64 0, i64 0
  %91 = load i32, ptr %17, align 4, !tbaa !14
  %92 = sub i32 1, %91
  %93 = zext i32 %92 to i64
  %94 = getelementptr inbounds [2 x [8 x i32]], ptr %14, i64 0, i64 %93
  %95 = getelementptr inbounds [8 x i32], ptr %94, i64 0, i64 0
  %96 = load ptr, ptr %12, align 8, !tbaa !5
  call void @XYcZ_add(ptr noundef %81, ptr noundef %85, ptr noundef %90, ptr noundef %95, ptr noundef %96)
  br label %97

97:                                               ; preds = %52
  %98 = load i16, ptr %16, align 2, !tbaa !9
  %99 = add i16 %98, -1
  store i16 %99, ptr %16, align 2, !tbaa !9
  br label %48, !llvm.loop !16

100:                                              ; preds = %48
  %101 = load ptr, ptr %9, align 8, !tbaa !5
  %102 = call i32 @uECC_vli_testBit(ptr noundef %101, i16 noundef signext 0)
  %103 = icmp ne i32 %102, 0
  %104 = xor i1 %103, true
  %105 = zext i1 %104 to i32
  store i32 %105, ptr %17, align 4, !tbaa !14
  %106 = load i32, ptr %17, align 4, !tbaa !14
  %107 = sub i32 1, %106
  %108 = zext i32 %107 to i64
  %109 = getelementptr inbounds [2 x [8 x i32]], ptr %13, i64 0, i64 %108
  %110 = getelementptr inbounds [8 x i32], ptr %109, i64 0, i64 0
  %111 = load i32, ptr %17, align 4, !tbaa !14
  %112 = sub i32 1, %111
  %113 = zext i32 %112 to i64
  %114 = getelementptr inbounds [2 x [8 x i32]], ptr %14, i64 0, i64 %113
  %115 = getelementptr inbounds [8 x i32], ptr %114, i64 0, i64 0
  %116 = load i32, ptr %17, align 4, !tbaa !14
  %117 = zext i32 %116 to i64
  %118 = getelementptr inbounds [2 x [8 x i32]], ptr %13, i64 0, i64 %117
  %119 = getelementptr inbounds [8 x i32], ptr %118, i64 0, i64 0
  %120 = load i32, ptr %17, align 4, !tbaa !14
  %121 = zext i32 %120 to i64
  %122 = getelementptr inbounds [2 x [8 x i32]], ptr %14, i64 0, i64 %121
  %123 = getelementptr inbounds [8 x i32], ptr %122, i64 0, i64 0
  %124 = load ptr, ptr %12, align 8, !tbaa !5
  call void @XYcZ_addC(ptr noundef %110, ptr noundef %115, ptr noundef %119, ptr noundef %123, ptr noundef %124)
  %125 = getelementptr inbounds [8 x i32], ptr %15, i64 0, i64 0
  %126 = getelementptr inbounds [2 x [8 x i32]], ptr %13, i64 0, i64 1
  %127 = getelementptr inbounds [8 x i32], ptr %126, i64 0, i64 0
  %128 = getelementptr inbounds [2 x [8 x i32]], ptr %13, i64 0, i64 0
  %129 = getelementptr inbounds [8 x i32], ptr %128, i64 0, i64 0
  %130 = load ptr, ptr %12, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.uECC_Curve_t, ptr %130, i32 0, i32 3
  %132 = getelementptr inbounds [8 x i32], ptr %131, i64 0, i64 0
  %133 = load i8, ptr %18, align 1, !tbaa !13
  call void @uECC_vli_modSub(ptr noundef %125, ptr noundef %127, ptr noundef %129, ptr noundef %132, i8 noundef signext %133)
  %134 = getelementptr inbounds [8 x i32], ptr %15, i64 0, i64 0
  %135 = getelementptr inbounds [8 x i32], ptr %15, i64 0, i64 0
  %136 = load i32, ptr %17, align 4, !tbaa !14
  %137 = sub i32 1, %136
  %138 = zext i32 %137 to i64
  %139 = getelementptr inbounds [2 x [8 x i32]], ptr %14, i64 0, i64 %138
  %140 = getelementptr inbounds [8 x i32], ptr %139, i64 0, i64 0
  %141 = load ptr, ptr %12, align 8, !tbaa !5
  call void @uECC_vli_modMult_fast(ptr noundef %134, ptr noundef %135, ptr noundef %140, ptr noundef %141)
  %142 = getelementptr inbounds [8 x i32], ptr %15, i64 0, i64 0
  %143 = getelementptr inbounds [8 x i32], ptr %15, i64 0, i64 0
  %144 = load ptr, ptr %8, align 8, !tbaa !5
  %145 = load ptr, ptr %12, align 8, !tbaa !5
  call void @uECC_vli_modMult_fast(ptr noundef %142, ptr noundef %143, ptr noundef %144, ptr noundef %145)
  %146 = getelementptr inbounds [8 x i32], ptr %15, i64 0, i64 0
  %147 = getelementptr inbounds [8 x i32], ptr %15, i64 0, i64 0
  %148 = load ptr, ptr %12, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.uECC_Curve_t, ptr %148, i32 0, i32 3
  %150 = getelementptr inbounds [8 x i32], ptr %149, i64 0, i64 0
  %151 = load i8, ptr %18, align 1, !tbaa !13
  call void @uECC_vli_modInv(ptr noundef %146, ptr noundef %147, ptr noundef %150, i8 noundef signext %151)
  %152 = getelementptr inbounds [8 x i32], ptr %15, i64 0, i64 0
  %153 = getelementptr inbounds [8 x i32], ptr %15, i64 0, i64 0
  %154 = load ptr, ptr %8, align 8, !tbaa !5
  %155 = load i8, ptr %18, align 1, !tbaa !13
  %156 = sext i8 %155 to i32
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds i32, ptr %154, i64 %157
  %159 = load ptr, ptr %12, align 8, !tbaa !5
  call void @uECC_vli_modMult_fast(ptr noundef %152, ptr noundef %153, ptr noundef %158, ptr noundef %159)
  %160 = getelementptr inbounds [8 x i32], ptr %15, i64 0, i64 0
  %161 = getelementptr inbounds [8 x i32], ptr %15, i64 0, i64 0
  %162 = load i32, ptr %17, align 4, !tbaa !14
  %163 = sub i32 1, %162
  %164 = zext i32 %163 to i64
  %165 = getelementptr inbounds [2 x [8 x i32]], ptr %13, i64 0, i64 %164
  %166 = getelementptr inbounds [8 x i32], ptr %165, i64 0, i64 0
  %167 = load ptr, ptr %12, align 8, !tbaa !5
  call void @uECC_vli_modMult_fast(ptr noundef %160, ptr noundef %161, ptr noundef %166, ptr noundef %167)
  %168 = load i32, ptr %17, align 4, !tbaa !14
  %169 = zext i32 %168 to i64
  %170 = getelementptr inbounds [2 x [8 x i32]], ptr %13, i64 0, i64 %169
  %171 = getelementptr inbounds [8 x i32], ptr %170, i64 0, i64 0
  %172 = load i32, ptr %17, align 4, !tbaa !14
  %173 = zext i32 %172 to i64
  %174 = getelementptr inbounds [2 x [8 x i32]], ptr %14, i64 0, i64 %173
  %175 = getelementptr inbounds [8 x i32], ptr %174, i64 0, i64 0
  %176 = load i32, ptr %17, align 4, !tbaa !14
  %177 = sub i32 1, %176
  %178 = zext i32 %177 to i64
  %179 = getelementptr inbounds [2 x [8 x i32]], ptr %13, i64 0, i64 %178
  %180 = getelementptr inbounds [8 x i32], ptr %179, i64 0, i64 0
  %181 = load i32, ptr %17, align 4, !tbaa !14
  %182 = sub i32 1, %181
  %183 = zext i32 %182 to i64
  %184 = getelementptr inbounds [2 x [8 x i32]], ptr %14, i64 0, i64 %183
  %185 = getelementptr inbounds [8 x i32], ptr %184, i64 0, i64 0
  %186 = load ptr, ptr %12, align 8, !tbaa !5
  call void @XYcZ_add(ptr noundef %171, ptr noundef %175, ptr noundef %180, ptr noundef %185, ptr noundef %186)
  %187 = getelementptr inbounds [2 x [8 x i32]], ptr %13, i64 0, i64 0
  %188 = getelementptr inbounds [8 x i32], ptr %187, i64 0, i64 0
  %189 = getelementptr inbounds [2 x [8 x i32]], ptr %14, i64 0, i64 0
  %190 = getelementptr inbounds [8 x i32], ptr %189, i64 0, i64 0
  %191 = getelementptr inbounds [8 x i32], ptr %15, i64 0, i64 0
  %192 = load ptr, ptr %12, align 8, !tbaa !5
  call void @apply_z(ptr noundef %188, ptr noundef %190, ptr noundef %191, ptr noundef %192)
  %193 = load ptr, ptr %7, align 8, !tbaa !5
  %194 = getelementptr inbounds [2 x [8 x i32]], ptr %13, i64 0, i64 0
  %195 = getelementptr inbounds [8 x i32], ptr %194, i64 0, i64 0
  %196 = load i8, ptr %18, align 1, !tbaa !13
  call void @uECC_vli_set(ptr noundef %193, ptr noundef %195, i8 noundef signext %196)
  %197 = load ptr, ptr %7, align 8, !tbaa !5
  %198 = load i8, ptr %18, align 1, !tbaa !13
  %199 = sext i8 %198 to i32
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds i32, ptr %197, i64 %200
  %202 = getelementptr inbounds [2 x [8 x i32]], ptr %14, i64 0, i64 0
  %203 = getelementptr inbounds [8 x i32], ptr %202, i64 0, i64 0
  %204 = load i8, ptr %18, align 1, !tbaa !13
  call void @uECC_vli_set(ptr noundef %201, ptr noundef %203, i8 noundef signext %204)
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #2
  call void @llvm.lifetime.end.p0(i64 2, ptr %16) #2
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #2
  call void @llvm.lifetime.end.p0(i64 64, ptr %14) #2
  call void @llvm.lifetime.end.p0(i64 64, ptr %13) #2
  ret void
}

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = !{!"short", !7, i64 0}
!11 = !{!12, !7, i64 0}
!12 = !{!"uECC_Curve_t", !7, i64 0, !7, i64 1, !10, i64 2, !7, i64 4, !7, i64 36, !7, i64 68, !7, i64 132, !6, i64 168, !6, i64 176, !6, i64 184}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"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"

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

; 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 i32 @uECC_vli_testBit(ptr noundef, i16 noundef signext) local_unnamed_addr #1

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

; 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 #1

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @EccPoint_mult(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i16 noundef signext %4, ptr noundef %5) local_unnamed_addr #1 {
  %7 = alloca [2 x [8 x i32]], align 16
  %8 = alloca [2 x [8 x i32]], align 16
  %9 = alloca [8 x i32], align 16
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %7) #2
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %8) #2
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #2
  %10 = load i8, ptr %5, align 8, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %7, i64 32
  call void @uECC_vli_set(ptr noundef nonnull %11, ptr noundef %1, i8 noundef signext %10)
  %12 = getelementptr inbounds i8, ptr %8, i64 32
  %13 = sext i8 %10 to i64
  %14 = getelementptr inbounds i32, ptr %1, i64 %13
  call void @uECC_vli_set(ptr noundef nonnull %12, ptr noundef %14, i8 noundef signext %10)
  call void @XYcZ_initial_double(ptr noundef nonnull %11, ptr noundef nonnull %12, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef %3, ptr noundef nonnull %5)
  %15 = add i16 %4, -2
  %16 = icmp sgt i16 %15, 0
  br i1 %16, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %6, %.lr.ph
  %.053 = phi i16 [ %24, %.lr.ph ], [ %15, %6 ]
  %17 = call i32 @uECC_vli_testBit(ptr noundef %2, i16 noundef signext %.053)
  %.not52 = icmp eq i32 %17, 0
  %not..not52 = xor i1 %.not52, true
  %18 = zext i1 %not..not52 to i64
  %19 = getelementptr inbounds [2 x [8 x i32]], ptr %7, i64 0, i64 %18
  %20 = getelementptr inbounds [2 x [8 x i32]], ptr %8, i64 0, i64 %18
  %21 = zext i1 %.not52 to i64
  %22 = getelementptr inbounds [2 x [8 x i32]], ptr %7, i64 0, i64 %21
  %23 = getelementptr inbounds [2 x [8 x i32]], ptr %8, i64 0, i64 %21
  call void @XYcZ_addC(ptr noundef nonnull %19, ptr noundef nonnull %20, ptr noundef nonnull %22, ptr noundef nonnull %23, ptr noundef nonnull %5)
  call void @XYcZ_add(ptr noundef nonnull %22, ptr noundef nonnull %23, ptr noundef nonnull %19, ptr noundef nonnull %20, ptr noundef nonnull %5)
  %24 = add nsw i16 %.053, -1
  %25 = icmp ugt i16 %.053, 1
  br i1 %25, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge:                                      ; preds = %.lr.ph, %6
  %26 = call i32 @uECC_vli_testBit(ptr noundef %2, i16 noundef signext 0)
  %.not = icmp eq i32 %26, 0
  %not..not = xor i1 %.not, true
  %27 = zext i1 %not..not to i64
  %28 = getelementptr inbounds [2 x [8 x i32]], ptr %7, i64 0, i64 %27
  %29 = getelementptr inbounds [2 x [8 x i32]], ptr %8, i64 0, i64 %27
  %30 = zext i1 %.not to i64
  %31 = getelementptr inbounds [2 x [8 x i32]], ptr %7, i64 0, i64 %30
  %32 = getelementptr inbounds [2 x [8 x i32]], ptr %8, i64 0, i64 %30
  call void @XYcZ_addC(ptr noundef nonnull %28, ptr noundef nonnull %29, ptr noundef nonnull %31, ptr noundef nonnull %32, ptr noundef nonnull %5)
  %33 = getelementptr inbounds i8, ptr %5, i64 4
  call void @uECC_vli_modSub(ptr noundef nonnull %9, ptr noundef nonnull %11, ptr noundef nonnull %7, ptr noundef nonnull %33, i8 noundef signext %10)
  call void @uECC_vli_modMult_fast(ptr noundef nonnull %9, ptr noundef nonnull %9, ptr noundef nonnull %29, ptr noundef nonnull %5)
  call void @uECC_vli_modMult_fast(ptr noundef nonnull %9, ptr noundef nonnull %9, ptr noundef %1, ptr noundef nonnull %5)
  call void @uECC_vli_modInv(ptr noundef nonnull %9, ptr noundef nonnull %9, ptr noundef nonnull %33, i8 noundef signext %10)
  call void @uECC_vli_modMult_fast(ptr noundef nonnull %9, ptr noundef nonnull %9, ptr noundef %14, ptr noundef nonnull %5)
  call void @uECC_vli_modMult_fast(ptr noundef nonnull %9, ptr noundef nonnull %9, ptr noundef nonnull %28, ptr noundef nonnull %5)
  call void @XYcZ_add(ptr noundef nonnull %31, ptr noundef nonnull %32, ptr noundef nonnull %28, ptr noundef nonnull %29, ptr noundef nonnull %5)
  call void @apply_z(ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef nonnull %9, ptr noundef nonnull %5)
  call void @uECC_vli_set(ptr noundef %0, ptr noundef nonnull %7, i8 noundef signext %10)
  %34 = getelementptr inbounds i32, ptr %0, i64 %13
  call void @uECC_vli_set(ptr noundef %34, ptr noundef nonnull %8, i8 noundef signext %10)
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #2
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %8) #2
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %7) #2
  ret void
}

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass