; LLVM IR from intel/cryptography-primitives :: sources/ippcp/gfpec (pcpgfp_setgfp)

; 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._cpGFp = type { i32, i32, ptr }
%struct._cpGFpMethod = type { i32, i32, ptr, ptr, ptr }
%struct._gsModEngine = type { ptr, i32, i32, i32, i32, i32, ptr, ptr, ptr, i64, ptr, ptr, ptr, ptr, i32, i32, ptr }

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

32:                                               ; preds = %48, %4
  %33 = load i32, ptr %11, align 4, !tbaa !9
  %34 = load i32, ptr %10, align 4, !tbaa !9
  %35 = icmp slt i32 %33, %34
  br i1 %35, label %36, label %51

36:                                               ; preds = %32
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = load i32, ptr %11, align 4, !tbaa !9
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds i64, ptr %37, i64 %39
  %41 = load i64, ptr %40, align 8, !tbaa !20
  %42 = load ptr, ptr %9, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct._gsModEngine, ptr %42, i32 0, i32 8
  %44 = load ptr, ptr %43, align 8, !tbaa !21
  %45 = load i32, ptr %11, align 4, !tbaa !9
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds i64, ptr %44, i64 %46
  store i64 %41, ptr %47, align 8, !tbaa !20
  br label %48

48:                                               ; preds = %36
  %49 = load i32, ptr %11, align 4, !tbaa !9
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %11, align 4, !tbaa !9
  br label %32, !llvm.loop !22

51:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  %52 = load ptr, ptr %9, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct._gsModEngine, ptr %52, i32 0, i32 8
  %54 = load ptr, ptr %53, align 8, !tbaa !21
  %55 = getelementptr inbounds i64, ptr %54, i64 0
  %56 = load i64, ptr %55, align 8, !tbaa !20
  %57 = call i64 @gsMontFactor(i64 noundef %56)
  %58 = load ptr, ptr %9, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct._gsModEngine, ptr %58, i32 0, i32 9
  store i64 %57, ptr %59, align 8, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %60

60:                                               ; preds = %71, %51
  %61 = load i32, ptr %12, align 4, !tbaa !9
  %62 = load i32, ptr %10, align 4, !tbaa !9
  %63 = icmp slt i32 %61, %62
  br i1 %63, label %64, label %74

64:                                               ; preds = %60
  %65 = load ptr, ptr %9, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct._gsModEngine, ptr %65, i32 0, i32 10
  %67 = load ptr, ptr %66, align 8, !tbaa !25
  %68 = load i32, ptr %12, align 4, !tbaa !9
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds i64, ptr %67, i64 %69
  store i64 0, ptr %70, align 8, !tbaa !20
  br label %71

71:                                               ; preds = %64
  %72 = load i32, ptr %12, align 4, !tbaa !9
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %12, align 4, !tbaa !9
  br label %60, !llvm.loop !26

74:                                               ; preds = %60
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  %75 = load ptr, ptr %9, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct._gsModEngine, ptr %75, i32 0, i32 10
  %77 = load ptr, ptr %76, align 8, !tbaa !25
  %78 = load i32, ptr %10, align 4, !tbaa !9
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds i64, ptr %77, i64 %79
  store i64 1, ptr %80, align 8, !tbaa !20
  %81 = load ptr, ptr %9, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct._gsModEngine, ptr %81, i32 0, i32 10
  %83 = load ptr, ptr %82, align 8, !tbaa !25
  %84 = load i32, ptr %10, align 4, !tbaa !9
  %85 = add nsw i32 %84, 1
  %86 = load ptr, ptr %9, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct._gsModEngine, ptr %86, i32 0, i32 8
  %88 = load ptr, ptr %87, align 8, !tbaa !21
  %89 = load i32, ptr %10, align 4, !tbaa !9
  %90 = call i32 @cpMod_BNU(ptr noundef %83, i32 noundef %85, ptr noundef %88, i32 noundef %89)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %91

91:                                               ; preds = %102, %74
  %92 = load i32, ptr %13, align 4, !tbaa !9
  %93 = load i32, ptr %10, align 4, !tbaa !9
  %94 = icmp slt i32 %92, %93
  br i1 %94, label %95, label %105

95:                                               ; preds = %91
  %96 = load ptr, ptr %9, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct._gsModEngine, ptr %96, i32 0, i32 11
  %98 = load ptr, ptr %97, align 8, !tbaa !27
  %99 = load i32, ptr %13, align 4, !tbaa !9
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds i64, ptr %98, i64 %100
  store i64 0, ptr %101, align 8, !tbaa !20
  br label %102

102:                                              ; preds = %95
  %103 = load i32, ptr %13, align 4, !tbaa !9
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr %13, align 4, !tbaa !9
  br label %91, !llvm.loop !28

105:                                              ; preds = %91
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %106

106:                                              ; preds = %127, %105
  %107 = load i32, ptr %14, align 4, !tbaa !9
  %108 = load i32, ptr %10, align 4, !tbaa !9
  %109 = icmp slt i32 %107, %108
  br i1 %109, label %110, label %130

110:                                              ; preds = %106
  %111 = load ptr, ptr %9, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct._gsModEngine, ptr %111, i32 0, i32 10
  %113 = load ptr, ptr %112, align 8, !tbaa !25
  %114 = load i32, ptr %14, align 4, !tbaa !9
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds i64, ptr %113, i64 %115
  %117 = load i64, ptr %116, align 8, !tbaa !20
  %118 = load ptr, ptr %9, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct._gsModEngine, ptr %118, i32 0, i32 11
  %120 = load ptr, ptr %119, align 8, !tbaa !27
  %121 = load i32, ptr %10, align 4, !tbaa !9
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds i64, ptr %120, i64 %122
  %124 = load i32, ptr %14, align 4, !tbaa !9
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds i64, ptr %123, i64 %125
  store i64 %117, ptr %126, align 8, !tbaa !20
  br label %127

127:                                              ; preds = %110
  %128 = load i32, ptr %14, align 4, !tbaa !9
  %129 = add nsw i32 %128, 1
  store i32 %129, ptr %14, align 4, !tbaa !9
  br label %106, !llvm.loop !29

130:                                              ; preds = %106
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  %131 = load ptr, ptr %9, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct._gsModEngine, ptr %131, i32 0, i32 11
  %133 = load ptr, ptr %132, align 8, !tbaa !27
  %134 = load i32, ptr %10, align 4, !tbaa !9
  %135 = mul nsw i32 2, %134
  %136 = load ptr, ptr %9, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct._gsModEngine, ptr %136, i32 0, i32 8
  %138 = load ptr, ptr %137, align 8, !tbaa !21
  %139 = load i32, ptr %10, align 4, !tbaa !9
  %140 = call i32 @cpMod_BNU(ptr noundef %133, i32 noundef %135, ptr noundef %138, i32 noundef %139)
  %141 = load ptr, ptr %9, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct._gsModEngine, ptr %141, i32 0, i32 12
  %143 = load ptr, ptr %142, align 8, !tbaa !30
  %144 = load ptr, ptr %9, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct._gsModEngine, ptr %144, i32 0, i32 8
  %146 = load ptr, ptr %145, align 8, !tbaa !21
  %147 = load i32, ptr %10, align 4, !tbaa !9
  %148 = call i32 @cpLSR_BNU(ptr noundef %143, ptr noundef %146, i32 noundef %147, i32 noundef 1)
  %149 = load ptr, ptr %9, align 8, !tbaa !5
  call void @cpGFEqnr(ptr noundef %149)
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  ret i32 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

declare i64 @gsMontFactor(i64 noundef) #2

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

declare i32 @cpLSR_BNU(ptr noundef, ptr noundef, i32 noundef, i32 noundef) #2

declare void @cpGFEqnr(ptr noundef) #2

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 = { "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 = { 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 #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 = !{!"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, !6, i64 8}
!12 = !{!"_cpGFp", !10, i64 0, !10, i64 4, !6, i64 8}
!13 = !{!14, !6, i64 16}
!14 = !{!"_cpGFpMethod", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16, !6, i64 24}
!15 = !{!16, !6, i64 32}
!16 = !{!"_gsModEngine", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !17, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !10, i64 96, !10, i64 100, !6, i64 104}
!17 = !{!"long long", !7, i64 0}
!18 = !{!14, !6, i64 24}
!19 = !{!16, !6, i64 40}
!20 = !{!17, !17, i64 0}
!21 = !{!16, !6, i64 48}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!16, !17, i64 56}
!25 = !{!16, !6, i64 64}
!26 = distinct !{!26, !23}
!27 = !{!16, !6, i64 72}
!28 = distinct !{!28, !23}
!29 = distinct !{!29, !23}
!30 = !{!16, !6, i64 80}


; 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
define dso_local noundef i32 @cpGFpSetGFp(ptr nocapture noundef readonly %0, i32 noundef %1, ptr nocapture noundef readonly %2, ptr nocapture noundef readonly %3) local_unnamed_addr #0 {
  %5 = getelementptr inbounds i8, ptr %3, i64 8
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = add nsw i32 %1, 63
  %8 = sdiv i32 %7, 64
  %9 = getelementptr inbounds i8, ptr %2, i64 16
  %10 = getelementptr inbounds i8, ptr %6, i64 32
  %11 = load <2 x ptr>, ptr %9, align 8, !tbaa !11
  store <2 x ptr> %11, ptr %10, align 8, !tbaa !11
  %12 = icmp sgt i32 %1, 0
  %13 = getelementptr inbounds i8, ptr %6, i64 48
  %14 = load ptr, ptr %13, align 8, !tbaa !12
  br i1 %12, label %.lr.ph, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %4
  %15 = getelementptr inbounds i8, ptr %6, i64 48
  %16 = load i64, ptr %14, align 8, !tbaa !15
  %17 = tail call i64 @gsMontFactor(i64 noundef %16) #5
  %18 = getelementptr inbounds i8, ptr %6, i64 56
  store i64 %17, ptr %18, align 8, !tbaa !16
  br label %._crit_edge.._crit_edge54_crit_edge

.lr.ph:                                           ; preds = %4
  %19 = ptrtoint ptr %14 to i64
  %20 = ptrtoint ptr %0 to i64
  %smax = tail call i32 @llvm.smax.i32(i32 %8, i32 1)
  %wide.trip.count = zext nneg i32 %smax to i64
  %min.iters.check = icmp slt i32 %1, 321
  %21 = sub i64 %19, %20
  %diff.check = icmp ult i64 %21, 32
  %or.cond = select i1 %min.iters.check, i1 true, i1 %diff.check
  br i1 %or.cond, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph
  %n.vec = and i64 %wide.trip.count, 33554428
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %22 = getelementptr inbounds i64, ptr %0, i64 %index
  %23 = getelementptr inbounds i8, ptr %22, i64 16
  %wide.load = load <2 x i64>, ptr %22, align 8, !tbaa !15
  %wide.load80 = load <2 x i64>, ptr %23, align 8, !tbaa !15
  %24 = getelementptr inbounds i64, ptr %14, i64 %index
  %25 = getelementptr inbounds i8, ptr %24, i64 16
  store <2 x i64> %wide.load, ptr %24, align 8, !tbaa !15
  store <2 x i64> %wide.load80, ptr %25, align 8, !tbaa !15
  %index.next = add nuw i64 %index, 4
  %26 = icmp eq i64 %index.next, %n.vec
  br i1 %26, label %middle.block, label %vector.body, !llvm.loop !17

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %._crit_edge, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph ], [ %n.vec, %middle.block ]
  %xtraiter = and i64 %wide.trip.count, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader, %scalar.ph.prol
  %indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %scalar.ph.prol ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %scalar.ph.prol ], [ 0, %scalar.ph.preheader ]
  %27 = getelementptr inbounds i64, ptr %0, i64 %indvars.iv.prol
  %28 = load i64, ptr %27, align 8, !tbaa !15
  %29 = getelementptr inbounds i64, ptr %14, i64 %indvars.iv.prol
  store i64 %28, ptr %29, align 8, !tbaa !15
  %indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol, !llvm.loop !21

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %scalar.ph.preheader ], [ %indvars.iv.next.prol, %scalar.ph.prol ]
  %30 = sub nsw i64 %indvars.iv.ph, %wide.trip.count
  %31 = icmp ugt i64 %30, -4
  br i1 %31, label %._crit_edge, label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next.3, %scalar.ph ], [ %indvars.iv.unr, %scalar.ph.prol.loopexit ]
  %32 = getelementptr inbounds i64, ptr %0, i64 %indvars.iv
  %33 = load i64, ptr %32, align 8, !tbaa !15
  %34 = getelementptr inbounds i64, ptr %14, i64 %indvars.iv
  store i64 %33, ptr %34, align 8, !tbaa !15
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %35 = getelementptr inbounds i64, ptr %0, i64 %indvars.iv.next
  %36 = load i64, ptr %35, align 8, !tbaa !15
  %37 = getelementptr inbounds i64, ptr %14, i64 %indvars.iv.next
  store i64 %36, ptr %37, align 8, !tbaa !15
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %38 = getelementptr inbounds i64, ptr %0, i64 %indvars.iv.next.1
  %39 = load i64, ptr %38, align 8, !tbaa !15
  %40 = getelementptr inbounds i64, ptr %14, i64 %indvars.iv.next.1
  store i64 %39, ptr %40, align 8, !tbaa !15
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %41 = getelementptr inbounds i64, ptr %0, i64 %indvars.iv.next.2
  %42 = load i64, ptr %41, align 8, !tbaa !15
  %43 = getelementptr inbounds i64, ptr %14, i64 %indvars.iv.next.2
  store i64 %42, ptr %43, align 8, !tbaa !15
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
  br i1 %exitcond.not.3, label %._crit_edge, label %scalar.ph, !llvm.loop !23

._crit_edge:                                      ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block
  %44 = getelementptr inbounds i8, ptr %6, i64 48
  %45 = load i64, ptr %14, align 8, !tbaa !15
  %46 = tail call i64 @gsMontFactor(i64 noundef %45) #5
  %47 = getelementptr inbounds i8, ptr %6, i64 56
  store i64 %46, ptr %47, align 8, !tbaa !16
  br i1 %12, label %.lr.ph53, label %._crit_edge.._crit_edge54_crit_edge

._crit_edge.._crit_edge54_crit_edge:              ; preds = %._crit_edge.thread, %._crit_edge
  %48 = phi ptr [ %15, %._crit_edge.thread ], [ %44, %._crit_edge ]
  %.phi.trans.insert76 = getelementptr inbounds i8, ptr %6, i64 64
  %.pre77 = load ptr, ptr %.phi.trans.insert76, align 8, !tbaa !24
  br label %._crit_edge54

.lr.ph53:                                         ; preds = %._crit_edge
  %49 = getelementptr inbounds i8, ptr %6, i64 64
  %50 = load ptr, ptr %49, align 8, !tbaa !24
  %smax62 = tail call i32 @llvm.smax.i32(i32 %8, i32 1)
  %51 = shl nuw nsw i32 %smax62, 3
  %52 = zext nneg i32 %51 to i64
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %50, i8 0, i64 %52, i1 false), !tbaa !15
  br label %._crit_edge54

._crit_edge54:                                    ; preds = %._crit_edge.._crit_edge54_crit_edge, %.lr.ph53
  %53 = phi ptr [ %48, %._crit_edge.._crit_edge54_crit_edge ], [ %44, %.lr.ph53 ]
  %54 = phi ptr [ %.pre77, %._crit_edge.._crit_edge54_crit_edge ], [ %50, %.lr.ph53 ]
  %55 = sext i32 %8 to i64
  %56 = getelementptr inbounds i64, ptr %54, i64 %55
  store i64 1, ptr %56, align 8, !tbaa !15
  %57 = add nsw i32 %8, 1
  %58 = load ptr, ptr %53, align 8, !tbaa !12
  %59 = tail call i32 @cpMod_BNU(ptr noundef %54, i32 noundef %57, ptr noundef %58, i32 noundef %8)
  %60 = getelementptr inbounds i8, ptr %6, i64 72
  %61 = load ptr, ptr %60, align 8, !tbaa !25
  br i1 %12, label %.lr.ph59, label %._crit_edge60

.lr.ph59:                                         ; preds = %._crit_edge54
  %62 = getelementptr inbounds i8, ptr %6, i64 64
  %smax66 = tail call i32 @llvm.smax.i32(i32 %8, i32 1)
  %63 = shl nuw nsw i32 %smax66, 3
  %64 = zext nneg i32 %63 to i64
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %61, i8 0, i64 %64, i1 false), !tbaa !15
  %65 = load ptr, ptr %62, align 8, !tbaa !24
  %66 = getelementptr inbounds i8, ptr %6, i64 72
  %67 = load ptr, ptr %66, align 8, !tbaa !25
  %68 = getelementptr inbounds i64, ptr %67, i64 %55
  %smax73 = tail call i32 @llvm.smax.i32(i32 %8, i32 1)
  %wide.trip.count74 = zext nneg i32 %smax73 to i64
  %min.iters.check85 = icmp slt i32 %1, 577
  br i1 %min.iters.check85, label %scalar.ph84.preheader, label %vector.memcheck81

vector.memcheck81:                                ; preds = %.lr.ph59
  %69 = ptrtoint ptr %67 to i64
  %70 = ptrtoint ptr %65 to i64
  %71 = shl nuw nsw i64 %55, 3
  %72 = add i64 %71, %69
  %73 = sub i64 %72, %70
  %diff.check82 = icmp ult i64 %73, 32
  br i1 %diff.check82, label %scalar.ph84.preheader, label %vector.ph86

vector.ph86:                                      ; preds = %vector.memcheck81
  %n.vec88 = and i64 %wide.trip.count74, 33554428
  br label %vector.body90

vector.body90:                                    ; preds = %vector.body90, %vector.ph86
  %index91 = phi i64 [ 0, %vector.ph86 ], [ %index.next94, %vector.body90 ]
  %74 = getelementptr inbounds i64, ptr %65, i64 %index91
  %75 = getelementptr inbounds i8, ptr %74, i64 16
  %wide.load92 = load <2 x i64>, ptr %74, align 8, !tbaa !15
  %wide.load93 = load <2 x i64>, ptr %75, align 8, !tbaa !15
  %76 = getelementptr inbounds i64, ptr %68, i64 %index91
  %77 = getelementptr inbounds i8, ptr %76, i64 16
  store <2 x i64> %wide.load92, ptr %76, align 8, !tbaa !15
  store <2 x i64> %wide.load93, ptr %77, align 8, !tbaa !15
  %index.next94 = add nuw i64 %index91, 4
  %78 = icmp eq i64 %index.next94, %n.vec88
  br i1 %78, label %middle.block83, label %vector.body90, !llvm.loop !26

middle.block83:                                   ; preds = %vector.body90
  %cmp.n95 = icmp eq i64 %n.vec88, %wide.trip.count74
  br i1 %cmp.n95, label %._crit_edge60, label %scalar.ph84.preheader

scalar.ph84.preheader:                            ; preds = %middle.block83, %vector.memcheck81, %.lr.ph59
  %indvars.iv70.ph = phi i64 [ 0, %vector.memcheck81 ], [ 0, %.lr.ph59 ], [ %n.vec88, %middle.block83 ]
  %xtraiter96 = and i64 %wide.trip.count74, 3
  %lcmp.mod97.not = icmp eq i64 %xtraiter96, 0
  br i1 %lcmp.mod97.not, label %scalar.ph84.prol.loopexit, label %scalar.ph84.prol

scalar.ph84.prol:                                 ; preds = %scalar.ph84.preheader, %scalar.ph84.prol
  %indvars.iv70.prol = phi i64 [ %indvars.iv.next71.prol, %scalar.ph84.prol ], [ %indvars.iv70.ph, %scalar.ph84.preheader ]
  %prol.iter98 = phi i64 [ %prol.iter98.next, %scalar.ph84.prol ], [ 0, %scalar.ph84.preheader ]
  %79 = getelementptr inbounds i64, ptr %65, i64 %indvars.iv70.prol
  %80 = load i64, ptr %79, align 8, !tbaa !15
  %81 = getelementptr inbounds i64, ptr %68, i64 %indvars.iv70.prol
  store i64 %80, ptr %81, align 8, !tbaa !15
  %indvars.iv.next71.prol = add nuw nsw i64 %indvars.iv70.prol, 1
  %prol.iter98.next = add i64 %prol.iter98, 1
  %prol.iter98.cmp.not = icmp eq i64 %prol.iter98.next, %xtraiter96
  br i1 %prol.iter98.cmp.not, label %scalar.ph84.prol.loopexit, label %scalar.ph84.prol, !llvm.loop !27

scalar.ph84.prol.loopexit:                        ; preds = %scalar.ph84.prol, %scalar.ph84.preheader
  %indvars.iv70.unr = phi i64 [ %indvars.iv70.ph, %scalar.ph84.preheader ], [ %indvars.iv.next71.prol, %scalar.ph84.prol ]
  %82 = sub nsw i64 %indvars.iv70.ph, %wide.trip.count74
  %83 = icmp ugt i64 %82, -4
  br i1 %83, label %._crit_edge60, label %scalar.ph84

scalar.ph84:                                      ; preds = %scalar.ph84.prol.loopexit, %scalar.ph84
  %indvars.iv70 = phi i64 [ %indvars.iv.next71.3, %scalar.ph84 ], [ %indvars.iv70.unr, %scalar.ph84.prol.loopexit ]
  %84 = getelementptr inbounds i64, ptr %65, i64 %indvars.iv70
  %85 = load i64, ptr %84, align 8, !tbaa !15
  %86 = getelementptr inbounds i64, ptr %68, i64 %indvars.iv70
  store i64 %85, ptr %86, align 8, !tbaa !15
  %indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1
  %87 = getelementptr inbounds i64, ptr %65, i64 %indvars.iv.next71
  %88 = load i64, ptr %87, align 8, !tbaa !15
  %89 = getelementptr inbounds i64, ptr %68, i64 %indvars.iv.next71
  store i64 %88, ptr %89, align 8, !tbaa !15
  %indvars.iv.next71.1 = add nuw nsw i64 %indvars.iv70, 2
  %90 = getelementptr inbounds i64, ptr %65, i64 %indvars.iv.next71.1
  %91 = load i64, ptr %90, align 8, !tbaa !15
  %92 = getelementptr inbounds i64, ptr %68, i64 %indvars.iv.next71.1
  store i64 %91, ptr %92, align 8, !tbaa !15
  %indvars.iv.next71.2 = add nuw nsw i64 %indvars.iv70, 3
  %93 = getelementptr inbounds i64, ptr %65, i64 %indvars.iv.next71.2
  %94 = load i64, ptr %93, align 8, !tbaa !15
  %95 = getelementptr inbounds i64, ptr %68, i64 %indvars.iv.next71.2
  store i64 %94, ptr %95, align 8, !tbaa !15
  %indvars.iv.next71.3 = add nuw nsw i64 %indvars.iv70, 4
  %exitcond75.not.3 = icmp eq i64 %indvars.iv.next71.3, %wide.trip.count74
  br i1 %exitcond75.not.3, label %._crit_edge60, label %scalar.ph84, !llvm.loop !28

._crit_edge60:                                    ; preds = %scalar.ph84.prol.loopexit, %scalar.ph84, %middle.block83, %._crit_edge54
  %96 = phi ptr [ %61, %._crit_edge54 ], [ %67, %middle.block83 ], [ %67, %scalar.ph84 ], [ %67, %scalar.ph84.prol.loopexit ]
  %97 = shl nsw i32 %8, 1
  %98 = load ptr, ptr %53, align 8, !tbaa !12
  %99 = tail call i32 @cpMod_BNU(ptr noundef %96, i32 noundef %97, ptr noundef %98, i32 noundef %8)
  %100 = getelementptr inbounds i8, ptr %6, i64 80
  %101 = load ptr, ptr %100, align 8, !tbaa !29
  %102 = load ptr, ptr %53, align 8, !tbaa !12
  %103 = tail call i32 @cpLSR_BNU(ptr noundef %101, ptr noundef %102, i32 noundef %8, i32 noundef 1) #5
  tail call void @cpGFEqnr(ptr noundef nonnull %6) #5
  ret i32 0
}

declare i64 @gsMontFactor(i64 noundef) local_unnamed_addr #1

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

declare i32 @cpLSR_BNU(ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare void @cpGFEqnr(ptr noundef) local_unnamed_addr #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3

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

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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !10, i64 8}
!6 = !{!"_cpGFp", !7, i64 0, !7, i64 4, !10, i64 8}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!10, !10, i64 0}
!12 = !{!13, !10, i64 48}
!13 = !{!"_gsModEngine", !10, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !14, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !7, i64 96, !7, i64 100, !10, i64 104}
!14 = !{!"long long", !8, i64 0}
!15 = !{!14, !14, i64 0}
!16 = !{!13, !14, i64 56}
!17 = distinct !{!17, !18, !19, !20}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!"llvm.loop.isvectorized", i32 1}
!20 = !{!"llvm.loop.unroll.runtime.disable"}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.unroll.disable"}
!23 = distinct !{!23, !18, !19}
!24 = !{!13, !10, i64 64}
!25 = !{!13, !10, i64 72}
!26 = distinct !{!26, !18, !19, !20}
!27 = distinct !{!27, !22}
!28 = distinct !{!28, !18, !19}
!29 = !{!13, !10, i64 80}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopIdiomRecognizePass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,SCCPPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass