; LLVM IR from cryspen/libcrux :: sys/hacl/c/src/msvc (Hacl_Bignum32)

; 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.Hacl_Bignum_MontArithmetic_bn_mont_ctx_u32_s = type { i32, ptr, i32, ptr }

@.str = external hidden unnamed_addr constant [70 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [85 x i8], align 1

declare i32 @printf(ptr noundef, ...) #0

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #1

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @Hacl_IntTypes_Intrinsics_sub_borrow_u32(i32 noundef, i32 noundef, i32 noundef, ptr noundef) #4

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

declare void @Hacl_Bignum_Exponentiation_bn_mod_exp_vartime_precomp_u32(i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
define dso_local void @Hacl_Bignum32_mod_inv_prime_vartime_precomp(ptr noundef %0, ptr noundef %1, ptr noundef %2) #6 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %struct.Hacl_Bignum_MontArithmetic_bn_mont_ctx_u32_s, align 8
  %8 = alloca i32, align 4
  %9 = alloca %struct.Hacl_Bignum_MontArithmetic_bn_mont_ctx_u32_s, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca ptr, align 8
  %21 = alloca i32, align 4
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  %24 = alloca ptr, align 8
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca ptr, align 8
  %28 = alloca i32, align 4
  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 32, ptr %7) #7
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %7, ptr align 8 %29, i64 32, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %30 = getelementptr inbounds %struct.Hacl_Bignum_MontArithmetic_bn_mont_ctx_u32_s, ptr %7, i32 0, i32 0
  %31 = load i32, ptr %30, align 8, !tbaa !12
  store i32 %31, ptr %8, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #7
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %9, ptr align 8 %32, i64 32, i1 false), !tbaa.struct !9
  br label %33

33:                                               ; preds = %3
  %34 = load i32, ptr %8, align 4, !tbaa !10
  %35 = zext i32 %34 to i64
  %36 = icmp ugt i64 %35, 4611686018427387903
  br i1 %36, label %37, label %39

37:                                               ; preds = %33
  %38 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 568)
  call void @exit(i32 noundef 253) #8
  unreachable

39:                                               ; preds = %33
  br label %40

40:                                               ; preds = %39
  br label %41

41:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %42 = load i32, ptr %8, align 4, !tbaa !10
  %43 = zext i32 %42 to i64
  %44 = mul i64 %43, 4
  %45 = alloca i8, i64 %44, align 16
  store ptr %45, ptr %10, align 8, !tbaa !5
  %46 = load ptr, ptr %10, align 8, !tbaa !5
  %47 = load i32, ptr %8, align 4, !tbaa !10
  %48 = zext i32 %47 to i64
  %49 = mul i64 %48, 4
  call void @llvm.memset.p0.i64(ptr align 4 %46, i8 0, i64 %49, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %50 = getelementptr inbounds %struct.Hacl_Bignum_MontArithmetic_bn_mont_ctx_u32_s, ptr %9, i32 0, i32 1
  %51 = load ptr, ptr %50, align 8, !tbaa !14
  %52 = getelementptr inbounds i32, ptr %51, i64 0
  %53 = load i32, ptr %52, align 4, !tbaa !10
  %54 = load ptr, ptr %10, align 8, !tbaa !5
  %55 = call i32 @Hacl_IntTypes_Intrinsics_sub_borrow_u32(i32 noundef 0, i32 noundef %53, i32 noundef 2, ptr noundef %54)
  store i32 %55, ptr %11, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %56 = load i32, ptr %8, align 4, !tbaa !10
  %57 = icmp ult i32 1, %56
  br i1 %57, label %58, label %173

58:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %59 = getelementptr inbounds %struct.Hacl_Bignum_MontArithmetic_bn_mont_ctx_u32_s, ptr %9, i32 0, i32 1
  %60 = load ptr, ptr %59, align 8, !tbaa !14
  %61 = getelementptr inbounds i32, ptr %60, i64 1
  store ptr %61, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %62 = load ptr, ptr %10, align 8, !tbaa !5
  %63 = getelementptr inbounds i32, ptr %62, i64 1
  store ptr %63, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %64 = load i32, ptr %11, align 4, !tbaa !10
  store i32 %64, ptr %15, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  store i32 0, ptr %16, align 4, !tbaa !10
  br label %65

65:                                               ; preds = %139, %58
  %66 = load i32, ptr %16, align 4, !tbaa !10
  %67 = load i32, ptr %8, align 4, !tbaa !10
  %68 = sub i32 %67, 1
  %69 = udiv i32 %68, 4
  %70 = icmp ult i32 %66, %69
  br i1 %70, label %72, label %71

71:                                               ; preds = %65
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %142

72:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %73 = load ptr, ptr %13, align 8, !tbaa !5
  %74 = load i32, ptr %16, align 4, !tbaa !10
  %75 = mul i32 4, %74
  %76 = zext i32 %75 to i64
  %77 = getelementptr inbounds i32, ptr %73, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !10
  store i32 %78, ptr %17, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %79 = load ptr, ptr %14, align 8, !tbaa !5
  %80 = load i32, ptr %16, align 4, !tbaa !10
  %81 = mul i32 4, %80
  %82 = zext i32 %81 to i64
  %83 = getelementptr inbounds i32, ptr %79, i64 %82
  store ptr %83, ptr %18, align 8, !tbaa !5
  %84 = load i32, ptr %15, align 4, !tbaa !10
  %85 = load i32, ptr %17, align 4, !tbaa !10
  %86 = load ptr, ptr %18, align 8, !tbaa !5
  %87 = call i32 @Hacl_IntTypes_Intrinsics_sub_borrow_u32(i32 noundef %84, i32 noundef %85, i32 noundef 0, ptr noundef %86)
  store i32 %87, ptr %15, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %88 = load ptr, ptr %13, align 8, !tbaa !5
  %89 = load i32, ptr %16, align 4, !tbaa !10
  %90 = mul i32 4, %89
  %91 = add i32 %90, 1
  %92 = zext i32 %91 to i64
  %93 = getelementptr inbounds i32, ptr %88, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !10
  store i32 %94, ptr %19, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %95 = load ptr, ptr %14, align 8, !tbaa !5
  %96 = load i32, ptr %16, align 4, !tbaa !10
  %97 = mul i32 4, %96
  %98 = zext i32 %97 to i64
  %99 = getelementptr inbounds i32, ptr %95, i64 %98
  %100 = getelementptr inbounds i32, ptr %99, i64 1
  store ptr %100, ptr %20, align 8, !tbaa !5
  %101 = load i32, ptr %15, align 4, !tbaa !10
  %102 = load i32, ptr %19, align 4, !tbaa !10
  %103 = load ptr, ptr %20, align 8, !tbaa !5
  %104 = call i32 @Hacl_IntTypes_Intrinsics_sub_borrow_u32(i32 noundef %101, i32 noundef %102, i32 noundef 0, ptr noundef %103)
  store i32 %104, ptr %15, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  %105 = load ptr, ptr %13, align 8, !tbaa !5
  %106 = load i32, ptr %16, align 4, !tbaa !10
  %107 = mul i32 4, %106
  %108 = add i32 %107, 2
  %109 = zext i32 %108 to i64
  %110 = getelementptr inbounds i32, ptr %105, i64 %109
  %111 = load i32, ptr %110, align 4, !tbaa !10
  store i32 %111, ptr %21, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %112 = load ptr, ptr %14, align 8, !tbaa !5
  %113 = load i32, ptr %16, align 4, !tbaa !10
  %114 = mul i32 4, %113
  %115 = zext i32 %114 to i64
  %116 = getelementptr inbounds i32, ptr %112, i64 %115
  %117 = getelementptr inbounds i32, ptr %116, i64 2
  store ptr %117, ptr %22, align 8, !tbaa !5
  %118 = load i32, ptr %15, align 4, !tbaa !10
  %119 = load i32, ptr %21, align 4, !tbaa !10
  %120 = load ptr, ptr %22, align 8, !tbaa !5
  %121 = call i32 @Hacl_IntTypes_Intrinsics_sub_borrow_u32(i32 noundef %118, i32 noundef %119, i32 noundef 0, ptr noundef %120)
  store i32 %121, ptr %15, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  %122 = load ptr, ptr %13, align 8, !tbaa !5
  %123 = load i32, ptr %16, align 4, !tbaa !10
  %124 = mul i32 4, %123
  %125 = add i32 %124, 3
  %126 = zext i32 %125 to i64
  %127 = getelementptr inbounds i32, ptr %122, i64 %126
  %128 = load i32, ptr %127, align 4, !tbaa !10
  store i32 %128, ptr %23, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  %129 = load ptr, ptr %14, align 8, !tbaa !5
  %130 = load i32, ptr %16, align 4, !tbaa !10
  %131 = mul i32 4, %130
  %132 = zext i32 %131 to i64
  %133 = getelementptr inbounds i32, ptr %129, i64 %132
  %134 = getelementptr inbounds i32, ptr %133, i64 3
  store ptr %134, ptr %24, align 8, !tbaa !5
  %135 = load i32, ptr %15, align 4, !tbaa !10
  %136 = load i32, ptr %23, align 4, !tbaa !10
  %137 = load ptr, ptr %24, align 8, !tbaa !5
  %138 = call i32 @Hacl_IntTypes_Intrinsics_sub_borrow_u32(i32 noundef %135, i32 noundef %136, i32 noundef 0, ptr noundef %137)
  store i32 %138, ptr %15, align 4, !tbaa !10
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %139

139:                                              ; preds = %72
  %140 = load i32, ptr %16, align 4, !tbaa !10
  %141 = add i32 %140, 1
  store i32 %141, ptr %16, align 4, !tbaa !10
  br label %65, !llvm.loop !15

142:                                              ; preds = %71
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  %143 = load i32, ptr %8, align 4, !tbaa !10
  %144 = sub i32 %143, 1
  %145 = udiv i32 %144, 4
  %146 = mul i32 %145, 4
  store i32 %146, ptr %25, align 4, !tbaa !10
  br label %147

147:                                              ; preds = %167, %142
  %148 = load i32, ptr %25, align 4, !tbaa !10
  %149 = load i32, ptr %8, align 4, !tbaa !10
  %150 = sub i32 %149, 1
  %151 = icmp ult i32 %148, %150
  br i1 %151, label %153, label %152

152:                                              ; preds = %147
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  br label %170

153:                                              ; preds = %147
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  %154 = load ptr, ptr %13, align 8, !tbaa !5
  %155 = load i32, ptr %25, align 4, !tbaa !10
  %156 = zext i32 %155 to i64
  %157 = getelementptr inbounds i32, ptr %154, i64 %156
  %158 = load i32, ptr %157, align 4, !tbaa !10
  store i32 %158, ptr %26, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  %159 = load ptr, ptr %14, align 8, !tbaa !5
  %160 = load i32, ptr %25, align 4, !tbaa !10
  %161 = zext i32 %160 to i64
  %162 = getelementptr inbounds i32, ptr %159, i64 %161
  store ptr %162, ptr %27, align 8, !tbaa !5
  %163 = load i32, ptr %15, align 4, !tbaa !10
  %164 = load i32, ptr %26, align 4, !tbaa !10
  %165 = load ptr, ptr %27, align 8, !tbaa !5
  %166 = call i32 @Hacl_IntTypes_Intrinsics_sub_borrow_u32(i32 noundef %163, i32 noundef %164, i32 noundef 0, ptr noundef %165)
  store i32 %166, ptr %15, align 4, !tbaa !10
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  br label %167

167:                                              ; preds = %153
  %168 = load i32, ptr %25, align 4, !tbaa !10
  %169 = add i32 %168, 1
  store i32 %169, ptr %25, align 4, !tbaa !10
  br label %147, !llvm.loop !17

170:                                              ; preds = %152
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #7
  %171 = load i32, ptr %15, align 4, !tbaa !10
  store i32 %171, ptr %28, align 4, !tbaa !10
  %172 = load i32, ptr %28, align 4, !tbaa !10
  store i32 %172, ptr %12, align 4, !tbaa !10
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %175

173:                                              ; preds = %41
  %174 = load i32, ptr %11, align 4, !tbaa !10
  store i32 %174, ptr %12, align 4, !tbaa !10
  br label %175

175:                                              ; preds = %173, %170
  %176 = load i32, ptr %12, align 4, !tbaa !10
  %177 = load i32, ptr %8, align 4, !tbaa !10
  %178 = getelementptr inbounds %struct.Hacl_Bignum_MontArithmetic_bn_mont_ctx_u32_s, ptr %9, i32 0, i32 1
  %179 = load ptr, ptr %178, align 8, !tbaa !14
  %180 = getelementptr inbounds %struct.Hacl_Bignum_MontArithmetic_bn_mont_ctx_u32_s, ptr %9, i32 0, i32 2
  %181 = load i32, ptr %180, align 8, !tbaa !18
  %182 = getelementptr inbounds %struct.Hacl_Bignum_MontArithmetic_bn_mont_ctx_u32_s, ptr %9, i32 0, i32 3
  %183 = load ptr, ptr %182, align 8, !tbaa !19
  %184 = load ptr, ptr %5, align 8, !tbaa !5
  %185 = load i32, ptr %8, align 4, !tbaa !10
  %186 = mul i32 32, %185
  %187 = load ptr, ptr %10, align 8, !tbaa !5
  %188 = load ptr, ptr %6, align 8, !tbaa !5
  call void @Hacl_Bignum_Exponentiation_bn_mod_exp_vartime_precomp_u32(i32 noundef %177, ptr noundef %179, i32 noundef %181, ptr noundef %183, ptr noundef %184, i32 noundef %186, ptr noundef %187, ptr noundef %188)
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #7
  ret void
}

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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 #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 #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 = !{i64 0, i64 4, !10, i64 8, i64 8, !5, i64 16, i64 4, !10, i64 24, i64 8, !5}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !11, i64 0}
!13 = !{!"Hacl_Bignum_MontArithmetic_bn_mont_ctx_u32_s", !11, i64 0, !6, i64 8, !11, i64 16, !6, i64 24}
!14 = !{!13, !6, i64 8}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = !{!13, !11, i64 16}
!19 = !{!13, !6, i64 24}


; 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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @Hacl_IntTypes_Intrinsics_sub_borrow_u32(i32 noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

declare void @Hacl_Bignum_Exponentiation_bn_mod_exp_vartime_precomp_u32(i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local void @Hacl_Bignum32_mod_inv_prime_vartime_precomp(ptr nocapture noundef readonly %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #3 {
  %.sroa.059.0.copyload = load i32, ptr %0, align 8, !tbaa !5
  %.sroa.3.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 8
  %.sroa.3.0.copyload = load ptr, ptr %.sroa.3.0..sroa_idx, align 8, !tbaa !9
  %.sroa.6.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 16
  %.sroa.6.0.copyload = load i32, ptr %.sroa.6.0..sroa_idx, align 8, !tbaa !5
  %.sroa.749.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 24
  %.sroa.749.0.copyload = load ptr, ptr %.sroa.749.0..sroa_idx, align 8, !tbaa !9
  %4 = zext i32 %.sroa.059.0.copyload to i64
  %5 = shl nuw nsw i64 %4, 2
  %6 = alloca i8, i64 %5, align 16
  call void @llvm.memset.p0.i64(ptr nonnull align 16 %6, i8 0, i64 %5, i1 false)
  %7 = load i32, ptr %.sroa.3.0.copyload, align 4, !tbaa !5
  %8 = call i32 @Hacl_IntTypes_Intrinsics_sub_borrow_u32(i32 noundef 0, i32 noundef %7, i32 noundef 2, ptr noundef nonnull %6)
  %9 = icmp ugt i32 %.sroa.059.0.copyload, 1
  br i1 %9, label %10, label %.loopexit

10:                                               ; preds = %3
  %11 = getelementptr inbounds i8, ptr %.sroa.3.0.copyload, i64 4
  %12 = getelementptr inbounds i8, ptr %6, i64 4
  %13 = add i32 %.sroa.059.0.copyload, -1
  %.not = icmp ult i32 %.sroa.059.0.copyload, 5
  br i1 %.not, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %10
  %14 = lshr i32 %13, 2
  %wide.trip.count = zext nneg i32 %14 to i64
  br label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %10
  %.064.lcssa = phi i32 [ %8, %10 ], [ %37, %.lr.ph ]
  %15 = and i32 %13, 3
  %.not74 = icmp eq i32 %15, 0
  br i1 %.not74, label %.loopexit, label %.lr.ph73.preheader

.lr.ph73.preheader:                               ; preds = %._crit_edge
  %16 = zext i32 %13 to i64
  %17 = and i64 %16, 4294967292
  br label %.lr.ph73

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %.06468 = phi i32 [ %8, %.lr.ph.preheader ], [ %37, %.lr.ph ]
  %18 = shl nuw i64 %indvars.iv, 2
  %19 = getelementptr inbounds i32, ptr %11, i64 %18
  %20 = load i32, ptr %19, align 4, !tbaa !5
  %21 = getelementptr inbounds i32, ptr %12, i64 %18
  %22 = call i32 @Hacl_IntTypes_Intrinsics_sub_borrow_u32(i32 noundef %.06468, i32 noundef %20, i32 noundef 0, ptr noundef nonnull %21)
  %23 = or disjoint i64 %18, 1
  %24 = getelementptr inbounds i32, ptr %11, i64 %23
  %25 = load i32, ptr %24, align 4, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %21, i64 4
  %27 = call i32 @Hacl_IntTypes_Intrinsics_sub_borrow_u32(i32 noundef %22, i32 noundef %25, i32 noundef 0, ptr noundef nonnull %26)
  %28 = or disjoint i64 %18, 2
  %29 = getelementptr inbounds i32, ptr %11, i64 %28
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %31 = getelementptr inbounds i8, ptr %21, i64 8
  %32 = call i32 @Hacl_IntTypes_Intrinsics_sub_borrow_u32(i32 noundef %27, i32 noundef %30, i32 noundef 0, ptr noundef nonnull %31)
  %33 = or disjoint i64 %18, 3
  %34 = getelementptr inbounds i32, ptr %11, i64 %33
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %36 = getelementptr inbounds i8, ptr %21, i64 12
  %37 = call i32 @Hacl_IntTypes_Intrinsics_sub_borrow_u32(i32 noundef %32, i32 noundef %35, i32 noundef 0, ptr noundef nonnull %36)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !11

.lr.ph73:                                         ; preds = %.lr.ph73.preheader, %.lr.ph73
  %indvars.iv76 = phi i64 [ %17, %.lr.ph73.preheader ], [ %indvars.iv.next77, %.lr.ph73 ]
  %.171 = phi i32 [ %.064.lcssa, %.lr.ph73.preheader ], [ %41, %.lr.ph73 ]
  %38 = getelementptr inbounds i32, ptr %11, i64 %indvars.iv76
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = getelementptr inbounds i32, ptr %12, i64 %indvars.iv76
  %41 = call i32 @Hacl_IntTypes_Intrinsics_sub_borrow_u32(i32 noundef %.171, i32 noundef %39, i32 noundef 0, ptr noundef nonnull %40)
  %indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
  %42 = icmp ult i64 %indvars.iv.next77, %16
  br i1 %42, label %.lr.ph73, label %.loopexit, !llvm.loop !13

.loopexit:                                        ; preds = %.lr.ph73, %._crit_edge, %3
  %43 = shl i32 %.sroa.059.0.copyload, 5
  call void @Hacl_Bignum_Exponentiation_bn_mod_exp_vartime_precomp_u32(i32 noundef %.sroa.059.0.copyload, ptr noundef nonnull %.sroa.3.0.copyload, i32 noundef %.sroa.6.0.copyload, ptr noundef %.sroa.749.0.copyload, ptr noundef %1, i32 noundef %43, ptr noundef nonnull %6, ptr noundef %2) #4
  ret void
}

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #1 = { 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 #2 = { "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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


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