; LLVM IR from cryspen/libcrux :: sys/hacl/c/src (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 [80 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
declare ptr @llvm.stacksave.p0() #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
declare void @llvm.stackrestore.p0(ptr) #2

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

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

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

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

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

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

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

40:                                               ; preds = %34
  br label %41

41:                                               ; preds = %40
  br label %42

42:                                               ; preds = %41
  %43 = load i32, ptr %8, align 4, !tbaa !10
  %44 = zext i32 %43 to i64
  %45 = call ptr @llvm.stacksave.p0()
  store ptr %45, ptr %10, align 8
  %46 = alloca i32, i64 %44, align 16
  store i64 %44, ptr %11, align 8
  %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 16 %46, i8 0, i64 %49, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  %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 = call i32 @Hacl_IntTypes_Intrinsics_sub_borrow_u32(i32 noundef 0, i32 noundef %53, i32 noundef 2, ptr noundef %46)
  store i32 %54, ptr %12, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  %55 = load i32, ptr %8, align 4, !tbaa !10
  %56 = icmp ult i32 1, %55
  br i1 %56, label %57, label %171

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

63:                                               ; preds = %137, %57
  %64 = load i32, ptr %17, align 4, !tbaa !10
  %65 = load i32, ptr %8, align 4, !tbaa !10
  %66 = sub i32 %65, 1
  %67 = udiv i32 %66, 4
  %68 = icmp ult i32 %64, %67
  br i1 %68, label %70, label %69

69:                                               ; preds = %63
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  br label %140

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

137:                                              ; preds = %70
  %138 = load i32, ptr %17, align 4, !tbaa !10
  %139 = add i32 %138, 1
  store i32 %139, ptr %17, align 4, !tbaa !10
  br label %63, !llvm.loop !15

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

145:                                              ; preds = %165, %140
  %146 = load i32, ptr %26, align 4, !tbaa !10
  %147 = load i32, ptr %8, align 4, !tbaa !10
  %148 = sub i32 %147, 1
  %149 = icmp ult i32 %146, %148
  br i1 %149, label %151, label %150

150:                                              ; preds = %145
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #8
  br label %168

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

165:                                              ; preds = %151
  %166 = load i32, ptr %26, align 4, !tbaa !10
  %167 = add i32 %166, 1
  store i32 %167, ptr %26, align 4, !tbaa !10
  br label %145, !llvm.loop !17

168:                                              ; preds = %150
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #8
  %169 = load i32, ptr %16, align 4, !tbaa !10
  store i32 %169, ptr %29, align 4, !tbaa !10
  %170 = load i32, ptr %29, align 4, !tbaa !10
  store i32 %170, ptr %13, align 4, !tbaa !10
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  br label %173

171:                                              ; preds = %42
  %172 = load i32, ptr %12, align 4, !tbaa !10
  store i32 %172, ptr %13, align 4, !tbaa !10
  br label %173

173:                                              ; preds = %171, %168
  %174 = load i32, ptr %13, align 4, !tbaa !10
  %175 = load i32, ptr %8, align 4, !tbaa !10
  %176 = getelementptr inbounds %struct.Hacl_Bignum_MontArithmetic_bn_mont_ctx_u32_s, ptr %9, i32 0, i32 1
  %177 = load ptr, ptr %176, align 8, !tbaa !14
  %178 = getelementptr inbounds %struct.Hacl_Bignum_MontArithmetic_bn_mont_ctx_u32_s, ptr %9, i32 0, i32 2
  %179 = load i32, ptr %178, align 8, !tbaa !18
  %180 = getelementptr inbounds %struct.Hacl_Bignum_MontArithmetic_bn_mont_ctx_u32_s, ptr %9, i32 0, i32 3
  %181 = load ptr, ptr %180, align 8, !tbaa !19
  %182 = load ptr, ptr %5, align 8, !tbaa !5
  %183 = load i32, ptr %8, align 4, !tbaa !10
  %184 = mul i32 32, %183
  %185 = load ptr, ptr %6, align 8, !tbaa !5
  call void @Hacl_Bignum_Exponentiation_bn_mod_exp_vartime_precomp_u32(i32 noundef %175, ptr noundef %177, i32 noundef %179, ptr noundef %181, ptr noundef %182, i32 noundef %184, ptr noundef %46, ptr noundef %185)
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  %186 = load ptr, ptr %10, align 8
  call void @llvm.stackrestore.p0(ptr %186)
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #8
  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 }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { 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 #8 = { nounwind }
attributes #9 = { 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.056.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.746.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 24
  %.sroa.746.0.copyload = load ptr, ptr %.sroa.746.0..sroa_idx, align 8, !tbaa !9
  %4 = zext i32 %.sroa.056.0.copyload to i64
  %5 = alloca i32, i64 %4, align 16
  %6 = shl nuw nsw i64 %4, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 16 %5, i8 0, i64 %6, 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 %5)
  %9 = icmp ugt i32 %.sroa.056.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 %5, i64 4
  %13 = add i32 %.sroa.056.0.copyload, -1
  %.not = icmp ult i32 %.sroa.056.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
  %.061.lcssa = phi i32 [ %8, %10 ], [ %37, %.lr.ph ]
  %15 = and i32 %13, 3
  %.not71 = icmp eq i32 %15, 0
  br i1 %.not71, label %.loopexit, label %.lr.ph70.preheader

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

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %.06165 = 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 %.06165, 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.ph70:                                         ; preds = %.lr.ph70.preheader, %.lr.ph70
  %indvars.iv73 = phi i64 [ %17, %.lr.ph70.preheader ], [ %indvars.iv.next74, %.lr.ph70 ]
  %.168 = phi i32 [ %.061.lcssa, %.lr.ph70.preheader ], [ %41, %.lr.ph70 ]
  %38 = getelementptr inbounds i32, ptr %11, i64 %indvars.iv73
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = getelementptr inbounds i32, ptr %12, i64 %indvars.iv73
  %41 = call i32 @Hacl_IntTypes_Intrinsics_sub_borrow_u32(i32 noundef %.168, i32 noundef %39, i32 noundef 0, ptr noundef nonnull %40)
  %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
  %42 = icmp ult i64 %indvars.iv.next74, %16
  br i1 %42, label %.lr.ph70, label %.loopexit, !llvm.loop !13

.loopexit:                                        ; preds = %.lr.ph70, %._crit_edge, %3
  %43 = shl i32 %.sroa.056.0.copyload, 5
  call void @Hacl_Bignum_Exponentiation_bn_mod_exp_vartime_precomp_u32(i32 noundef %.sroa.056.0.copyload, ptr noundef nonnull %.sroa.3.0.copyload, i32 noundef %.sroa.6.0.copyload, ptr noundef %.sroa.746.0.copyload, ptr noundef %1, i32 noundef %43, ptr noundef nonnull %5, 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