; LLVM IR from cryptid-org/cryptid-native :: dependencies/gmp/src (mini-gmp)

; 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"

@.str.1 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@__PRETTY_FUNCTION__.mpn_lshift = external hidden unnamed_addr constant [65 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [20 x i8], align 1

; 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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i64 @mpn_lshift(ptr noundef %0, ptr noundef %1, i64 noundef %2, i32 noundef %3) #2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i64 %2, ptr %7, align 8, !tbaa !9
  store i32 %3, ptr %8, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %13 = load i64, ptr %7, align 8, !tbaa !9
  %14 = icmp sge i64 %13, 1
  br i1 %14, label %15, label %16

15:                                               ; preds = %4
  br label %17

16:                                               ; preds = %4
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 614, ptr noundef @__PRETTY_FUNCTION__.mpn_lshift) #4
  unreachable

17:                                               ; preds = %15
  %18 = load i32, ptr %8, align 4, !tbaa !11
  %19 = icmp uge i32 %18, 1
  br i1 %19, label %20, label %21

20:                                               ; preds = %17
  br label %22

21:                                               ; preds = %17
  call void @__assert_fail(ptr noundef @.str.6, ptr noundef @.str.1, i32 noundef 615, ptr noundef @__PRETTY_FUNCTION__.mpn_lshift) #4
  unreachable

22:                                               ; preds = %20
  %23 = load i32, ptr %8, align 4, !tbaa !11
  %24 = zext i32 %23 to i64
  %25 = icmp ult i64 %24, 64
  br i1 %25, label %26, label %27

26:                                               ; preds = %22
  br label %28

27:                                               ; preds = %22
  call void @__assert_fail(ptr noundef @.str.7, ptr noundef @.str.1, i32 noundef 616, ptr noundef @__PRETTY_FUNCTION__.mpn_lshift) #4
  unreachable

28:                                               ; preds = %26
  %29 = load i64, ptr %7, align 8, !tbaa !9
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = getelementptr inbounds i64, ptr %30, i64 %29
  store ptr %31, ptr %6, align 8, !tbaa !5
  %32 = load i64, ptr %7, align 8, !tbaa !9
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = getelementptr inbounds i64, ptr %33, i64 %32
  store ptr %34, ptr %5, align 8, !tbaa !5
  %35 = load i32, ptr %8, align 4, !tbaa !11
  %36 = zext i32 %35 to i64
  %37 = sub i64 64, %36
  %38 = trunc i64 %37 to i32
  store i32 %38, ptr %11, align 4, !tbaa !11
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  %40 = getelementptr inbounds i64, ptr %39, i32 -1
  store ptr %40, ptr %6, align 8, !tbaa !5
  %41 = load i64, ptr %40, align 8, !tbaa !9
  store i64 %41, ptr %10, align 8, !tbaa !9
  %42 = load i64, ptr %10, align 8, !tbaa !9
  %43 = load i32, ptr %11, align 4, !tbaa !11
  %44 = zext i32 %43 to i64
  %45 = lshr i64 %42, %44
  store i64 %45, ptr %12, align 8, !tbaa !9
  %46 = load i64, ptr %10, align 8, !tbaa !9
  %47 = load i32, ptr %8, align 4, !tbaa !11
  %48 = zext i32 %47 to i64
  %49 = shl i64 %46, %48
  store i64 %49, ptr %9, align 8, !tbaa !9
  br label %50

50:                                               ; preds = %54, %28
  %51 = load i64, ptr %7, align 8, !tbaa !9
  %52 = add nsw i64 %51, -1
  store i64 %52, ptr %7, align 8, !tbaa !9
  %53 = icmp ne i64 %52, 0
  br i1 %53, label %54, label %70

54:                                               ; preds = %50
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  %56 = getelementptr inbounds i64, ptr %55, i32 -1
  store ptr %56, ptr %6, align 8, !tbaa !5
  %57 = load i64, ptr %56, align 8, !tbaa !9
  store i64 %57, ptr %10, align 8, !tbaa !9
  %58 = load i64, ptr %9, align 8, !tbaa !9
  %59 = load i64, ptr %10, align 8, !tbaa !9
  %60 = load i32, ptr %11, align 4, !tbaa !11
  %61 = zext i32 %60 to i64
  %62 = lshr i64 %59, %61
  %63 = or i64 %58, %62
  %64 = load ptr, ptr %5, align 8, !tbaa !5
  %65 = getelementptr inbounds i64, ptr %64, i32 -1
  store ptr %65, ptr %5, align 8, !tbaa !5
  store i64 %63, ptr %65, align 8, !tbaa !9
  %66 = load i64, ptr %10, align 8, !tbaa !9
  %67 = load i32, ptr %8, align 4, !tbaa !11
  %68 = zext i32 %67 to i64
  %69 = shl i64 %66, %68
  store i64 %69, ptr %9, align 8, !tbaa !9
  br label %50, !llvm.loop !13

70:                                               ; preds = %50
  %71 = load i64, ptr %9, align 8, !tbaa !9
  %72 = load ptr, ptr %5, align 8, !tbaa !5
  %73 = getelementptr inbounds i64, ptr %72, i32 -1
  store ptr %73, ptr %5, align 8, !tbaa !5
  store i64 %71, ptr %73, align 8, !tbaa !9
  %74 = load i64, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  ret i64 %74
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { nounwind }
attributes #4 = { 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 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"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"

@.str.1 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@__PRETTY_FUNCTION__.mpn_lshift = external hidden unnamed_addr constant [65 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [20 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local range(i64 0, -9223372036854775808) i64 @mpn_lshift(ptr nocapture noundef writeonly %0, ptr nocapture noundef readonly %1, i64 noundef %2, i32 noundef %3) local_unnamed_addr #1 {
  %5 = icmp sgt i64 %2, 0
  br i1 %5, label %7, label %6

6:                                                ; preds = %4
  tail call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 614, ptr noundef nonnull @__PRETTY_FUNCTION__.mpn_lshift) #2
  unreachable

7:                                                ; preds = %4
  %.not = icmp eq i32 %3, 0
  br i1 %.not, label %8, label %9

8:                                                ; preds = %7
  tail call void @__assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.1, i32 noundef 615, ptr noundef nonnull @__PRETTY_FUNCTION__.mpn_lshift) #2
  unreachable

9:                                                ; preds = %7
  %10 = zext nneg i32 %3 to i64
  %11 = icmp ult i32 %3, 64
  br i1 %11, label %13, label %12

12:                                               ; preds = %9
  tail call void @__assert_fail(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.1, i32 noundef 616, ptr noundef nonnull @__PRETTY_FUNCTION__.mpn_lshift) #2
  unreachable

13:                                               ; preds = %9
  %14 = getelementptr inbounds i64, ptr %1, i64 %2
  %15 = getelementptr inbounds i64, ptr %0, i64 %2
  %16 = sub nuw nsw i32 64, %3
  %17 = getelementptr inbounds i8, ptr %14, i64 -8
  %18 = load i64, ptr %17, align 8, !tbaa !5
  %19 = zext nneg i32 %16 to i64
  %.02431 = shl i64 %18, %10
  %20 = add nsw i64 %2, -1
  %.not3032 = icmp eq i64 %20, 0
  br i1 %.not3032, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %13
  %21 = add nsw i64 %2, -2
  %xtraiter = and i64 %20, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph.prol.loopexit, label %.lr.ph.prol

.lr.ph.prol:                                      ; preds = %.lr.ph.preheader, %.lr.ph.prol
  %22 = phi i64 [ %28, %.lr.ph.prol ], [ %20, %.lr.ph.preheader ]
  %.02435.prol = phi i64 [ %.024.prol, %.lr.ph.prol ], [ %.02431, %.lr.ph.preheader ]
  %.034.prol = phi ptr [ %27, %.lr.ph.prol ], [ %15, %.lr.ph.preheader ]
  %.02333.prol = phi ptr [ %23, %.lr.ph.prol ], [ %17, %.lr.ph.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %.lr.ph.prol ], [ 0, %.lr.ph.preheader ]
  %23 = getelementptr inbounds i8, ptr %.02333.prol, i64 -8
  %24 = load i64, ptr %23, align 8, !tbaa !5
  %25 = lshr i64 %24, %19
  %26 = or i64 %25, %.02435.prol
  %27 = getelementptr inbounds i8, ptr %.034.prol, i64 -8
  store i64 %26, ptr %27, align 8, !tbaa !5
  %.024.prol = shl i64 %24, %10
  %28 = add nsw i64 %22, -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 %.lr.ph.prol.loopexit, label %.lr.ph.prol, !llvm.loop !9

.lr.ph.prol.loopexit:                             ; preds = %.lr.ph.prol, %.lr.ph.preheader
  %.lcssa.unr = phi ptr [ poison, %.lr.ph.preheader ], [ %27, %.lr.ph.prol ]
  %.024.lcssa40.unr = phi i64 [ poison, %.lr.ph.preheader ], [ %.024.prol, %.lr.ph.prol ]
  %.unr = phi i64 [ %20, %.lr.ph.preheader ], [ %28, %.lr.ph.prol ]
  %.02435.unr = phi i64 [ %.02431, %.lr.ph.preheader ], [ %.024.prol, %.lr.ph.prol ]
  %.034.unr = phi ptr [ %15, %.lr.ph.preheader ], [ %27, %.lr.ph.prol ]
  %.02333.unr = phi ptr [ %17, %.lr.ph.preheader ], [ %23, %.lr.ph.prol ]
  %29 = icmp ult i64 %21, 3
  br i1 %29, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.prol.loopexit, %.lr.ph
  %30 = phi i64 [ %51, %.lr.ph ], [ %.unr, %.lr.ph.prol.loopexit ]
  %.02435 = phi i64 [ %.024.3, %.lr.ph ], [ %.02435.unr, %.lr.ph.prol.loopexit ]
  %.034 = phi ptr [ %50, %.lr.ph ], [ %.034.unr, %.lr.ph.prol.loopexit ]
  %.02333 = phi ptr [ %46, %.lr.ph ], [ %.02333.unr, %.lr.ph.prol.loopexit ]
  %31 = getelementptr inbounds i8, ptr %.02333, i64 -8
  %32 = load i64, ptr %31, align 8, !tbaa !5
  %33 = lshr i64 %32, %19
  %34 = or i64 %33, %.02435
  %35 = getelementptr inbounds i8, ptr %.034, i64 -8
  store i64 %34, ptr %35, align 8, !tbaa !5
  %.024 = shl i64 %32, %10
  %36 = getelementptr inbounds i8, ptr %.02333, i64 -16
  %37 = load i64, ptr %36, align 8, !tbaa !5
  %38 = lshr i64 %37, %19
  %39 = or i64 %38, %.024
  %40 = getelementptr inbounds i8, ptr %.034, i64 -16
  store i64 %39, ptr %40, align 8, !tbaa !5
  %.024.1 = shl i64 %37, %10
  %41 = getelementptr inbounds i8, ptr %.02333, i64 -24
  %42 = load i64, ptr %41, align 8, !tbaa !5
  %43 = lshr i64 %42, %19
  %44 = or i64 %43, %.024.1
  %45 = getelementptr inbounds i8, ptr %.034, i64 -24
  store i64 %44, ptr %45, align 8, !tbaa !5
  %.024.2 = shl i64 %42, %10
  %46 = getelementptr inbounds i8, ptr %.02333, i64 -32
  %47 = load i64, ptr %46, align 8, !tbaa !5
  %48 = lshr i64 %47, %19
  %49 = or i64 %48, %.024.2
  %50 = getelementptr inbounds i8, ptr %.034, i64 -32
  store i64 %49, ptr %50, align 8, !tbaa !5
  %.024.3 = shl i64 %47, %10
  %51 = add nsw i64 %30, -4
  %.not30.3 = icmp eq i64 %51, 0
  br i1 %.not30.3, label %._crit_edge, label %.lr.ph, !llvm.loop !11

._crit_edge:                                      ; preds = %.lr.ph.prol.loopexit, %.lr.ph, %13
  %.0.lcssa = phi ptr [ %15, %13 ], [ %.lcssa.unr, %.lr.ph.prol.loopexit ], [ %50, %.lr.ph ]
  %.024.lcssa = phi i64 [ %.02431, %13 ], [ %.024.lcssa40.unr, %.lr.ph.prol.loopexit ], [ %.024.3, %.lr.ph ]
  %52 = lshr i64 %18, %19
  %53 = getelementptr inbounds i8, ptr %.0.lcssa, i64 -8
  store i64 %.024.lcssa, ptr %53, align 8, !tbaa !5
  ret i64 %52
}

attributes #0 = { 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 #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 = { 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.unroll.disable"}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


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