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

%struct.__mpz_struct = type { i32, i32, ptr }

@.str.15 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [26 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: nounwind uwtable
declare dso_local void @mpz_init(ptr noundef) #1

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @mpz_cmpabs_ui(ptr noundef, i64 noundef) #1

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @mpz_rootrem(ptr noundef %0, ptr noundef %1, ptr noundef %2, i64 noundef %3) #1 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca [1 x %struct.__mpz_struct], align 16
  %11 = alloca [1 x %struct.__mpz_struct], align 16
  %12 = alloca i32, align 4
  %13 = alloca [1 x %struct.__mpz_struct], align 16
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store i64 %3, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #2
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #2
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #2
  %14 = load ptr, ptr %7, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.__mpz_struct, ptr %14, i32 0, i32 1
  %16 = load i32, ptr %15, align 4, !tbaa !11
  %17 = icmp slt i32 %16, 0
  %18 = zext i1 %17 to i32
  store i32 %18, ptr %9, align 4, !tbaa !14
  %19 = load i64, ptr %8, align 8, !tbaa !9
  %20 = xor i64 %19, -1
  %21 = load i32, ptr %9, align 4, !tbaa !14
  %22 = sext i32 %21 to i64
  %23 = and i64 %20, %22
  %24 = icmp ne i64 %23, 0
  br i1 %24, label %25, label %26

25:                                               ; preds = %4
  call void @gmp_die(ptr noundef @.str.15)
  br label %26

26:                                               ; preds = %25, %4
  %27 = load i64, ptr %8, align 8, !tbaa !9
  %28 = icmp eq i64 %27, 0
  br i1 %28, label %29, label %30

29:                                               ; preds = %26
  call void @gmp_die(ptr noundef @.str.16)
  br label %30

30:                                               ; preds = %29, %26
  %31 = load ptr, ptr %7, align 8, !tbaa !5
  %32 = call i32 @mpz_cmpabs_ui(ptr noundef %31, i64 noundef 1)
  %33 = icmp sle i32 %32, 0
  br i1 %33, label %34, label %47

34:                                               ; preds = %30
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = icmp ne ptr %35, null
  br i1 %36, label %37, label %40

37:                                               ; preds = %34
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = load ptr, ptr %7, align 8, !tbaa !5
  call void @mpz_set(ptr noundef %38, ptr noundef %39)
  br label %40

40:                                               ; preds = %37, %34
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = icmp ne ptr %41, null
  br i1 %42, label %43, label %46

43:                                               ; preds = %40
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.__mpz_struct, ptr %44, i32 0, i32 1
  store i32 0, ptr %45, align 4, !tbaa !11
  br label %46

46:                                               ; preds = %43, %40
  store i32 1, ptr %12, align 4
  br label %131

47:                                               ; preds = %30
  %48 = getelementptr inbounds [1 x %struct.__mpz_struct], ptr %11, i64 0, i64 0
  call void @mpz_init(ptr noundef %48)
  %49 = getelementptr inbounds [1 x %struct.__mpz_struct], ptr %10, i64 0, i64 0
  call void @mpz_init(ptr noundef %49)
  %50 = getelementptr inbounds [1 x %struct.__mpz_struct], ptr %10, i64 0, i64 0
  %51 = load ptr, ptr %7, align 8, !tbaa !5
  %52 = call i64 @mpz_sizeinbase(ptr noundef %51, i32 noundef 2)
  %53 = load i64, ptr %8, align 8, !tbaa !9
  %54 = udiv i64 %52, %53
  %55 = add i64 %54, 1
  call void @mpz_setbit(ptr noundef %50, i64 noundef %55)
  %56 = load i64, ptr %8, align 8, !tbaa !9
  %57 = icmp eq i64 %56, 2
  br i1 %57, label %58, label %76

58:                                               ; preds = %47
  br label %59

59:                                               ; preds = %70, %58
  %60 = getelementptr inbounds [1 x %struct.__mpz_struct], ptr %11, i64 0, i64 0
  %61 = getelementptr inbounds [1 x %struct.__mpz_struct], ptr %10, i64 0, i64 0
  call void @mpz_swap(ptr noundef %60, ptr noundef %61)
  %62 = getelementptr inbounds [1 x %struct.__mpz_struct], ptr %10, i64 0, i64 0
  %63 = load ptr, ptr %7, align 8, !tbaa !5
  %64 = getelementptr inbounds [1 x %struct.__mpz_struct], ptr %11, i64 0, i64 0
  call void @mpz_tdiv_q(ptr noundef %62, ptr noundef %63, ptr noundef %64)
  %65 = getelementptr inbounds [1 x %struct.__mpz_struct], ptr %10, i64 0, i64 0
  %66 = getelementptr inbounds [1 x %struct.__mpz_struct], ptr %10, i64 0, i64 0
  %67 = getelementptr inbounds [1 x %struct.__mpz_struct], ptr %11, i64 0, i64 0
  call void @mpz_add(ptr noundef %65, ptr noundef %66, ptr noundef %67)
  %68 = getelementptr inbounds [1 x %struct.__mpz_struct], ptr %10, i64 0, i64 0
  %69 = getelementptr inbounds [1 x %struct.__mpz_struct], ptr %10, i64 0, i64 0
  call void @mpz_tdiv_q_2exp(ptr noundef %68, ptr noundef %69, i64 noundef 1)
  br label %70

70:                                               ; preds = %59
  %71 = getelementptr inbounds [1 x %struct.__mpz_struct], ptr %10, i64 0, i64 0
  %72 = getelementptr inbounds [1 x %struct.__mpz_struct], ptr %11, i64 0, i64 0
  %73 = call i32 @mpz_cmpabs(ptr noundef %71, ptr noundef %72)
  %74 = icmp slt i32 %73, 0
  br i1 %74, label %59, label %75, !llvm.loop !15

75:                                               ; preds = %70
  br label %112

76:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #2
  %77 = getelementptr inbounds [1 x %struct.__mpz_struct], ptr %13, i64 0, i64 0
  call void @mpz_init(ptr noundef %77)
  %78 = load i32, ptr %9, align 4, !tbaa !14
  %79 = icmp ne i32 %78, 0
  br i1 %79, label %80, label %83

80:                                               ; preds = %76
  %81 = getelementptr inbounds [1 x %struct.__mpz_struct], ptr %10, i64 0, i64 0
  %82 = getelementptr inbounds [1 x %struct.__mpz_struct], ptr %10, i64 0, i64 0
  call void @mpz_neg(ptr noundef %81, ptr noundef %82)
  br label %83

83:                                               ; preds = %80, %76
  br label %84

84:                                               ; preds = %105, %83
  %85 = getelementptr inbounds [1 x %struct.__mpz_struct], ptr %11, i64 0, i64 0
  %86 = getelementptr inbounds [1 x %struct.__mpz_struct], ptr %10, i64 0, i64 0
  call void @mpz_swap(ptr noundef %85, ptr noundef %86)
  %87 = getelementptr inbounds [1 x %struct.__mpz_struct], ptr %10, i64 0, i64 0
  %88 = getelementptr inbounds [1 x %struct.__mpz_struct], ptr %11, i64 0, i64 0
  %89 = load i64, ptr %8, align 8, !tbaa !9
  %90 = sub i64 %89, 1
  call void @mpz_pow_ui(ptr noundef %87, ptr noundef %88, i64 noundef %90)
  %91 = getelementptr inbounds [1 x %struct.__mpz_struct], ptr %10, i64 0, i64 0
  %92 = load ptr, ptr %7, align 8, !tbaa !5
  %93 = getelementptr inbounds [1 x %struct.__mpz_struct], ptr %10, i64 0, i64 0
  call void @mpz_tdiv_q(ptr noundef %91, ptr noundef %92, ptr noundef %93)
  %94 = getelementptr inbounds [1 x %struct.__mpz_struct], ptr %13, i64 0, i64 0
  %95 = getelementptr inbounds [1 x %struct.__mpz_struct], ptr %11, i64 0, i64 0
  %96 = load i64, ptr %8, align 8, !tbaa !9
  %97 = sub i64 %96, 1
  call void @mpz_mul_ui(ptr noundef %94, ptr noundef %95, i64 noundef %97)
  %98 = getelementptr inbounds [1 x %struct.__mpz_struct], ptr %10, i64 0, i64 0
  %99 = getelementptr inbounds [1 x %struct.__mpz_struct], ptr %10, i64 0, i64 0
  %100 = getelementptr inbounds [1 x %struct.__mpz_struct], ptr %13, i64 0, i64 0
  call void @mpz_add(ptr noundef %98, ptr noundef %99, ptr noundef %100)
  %101 = getelementptr inbounds [1 x %struct.__mpz_struct], ptr %10, i64 0, i64 0
  %102 = getelementptr inbounds [1 x %struct.__mpz_struct], ptr %10, i64 0, i64 0
  %103 = load i64, ptr %8, align 8, !tbaa !9
  %104 = call i64 @mpz_tdiv_q_ui(ptr noundef %101, ptr noundef %102, i64 noundef %103)
  br label %105

105:                                              ; preds = %84
  %106 = getelementptr inbounds [1 x %struct.__mpz_struct], ptr %10, i64 0, i64 0
  %107 = getelementptr inbounds [1 x %struct.__mpz_struct], ptr %11, i64 0, i64 0
  %108 = call i32 @mpz_cmpabs(ptr noundef %106, ptr noundef %107)
  %109 = icmp slt i32 %108, 0
  br i1 %109, label %84, label %110, !llvm.loop !17

110:                                              ; preds = %105
  %111 = getelementptr inbounds [1 x %struct.__mpz_struct], ptr %13, i64 0, i64 0
  call void @mpz_clear(ptr noundef %111)
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #2
  br label %112

112:                                              ; preds = %110, %75
  %113 = load ptr, ptr %6, align 8, !tbaa !5
  %114 = icmp ne ptr %113, null
  br i1 %114, label %115, label %122

115:                                              ; preds = %112
  %116 = getelementptr inbounds [1 x %struct.__mpz_struct], ptr %10, i64 0, i64 0
  %117 = getelementptr inbounds [1 x %struct.__mpz_struct], ptr %11, i64 0, i64 0
  %118 = load i64, ptr %8, align 8, !tbaa !9
  call void @mpz_pow_ui(ptr noundef %116, ptr noundef %117, i64 noundef %118)
  %119 = load ptr, ptr %6, align 8, !tbaa !5
  %120 = load ptr, ptr %7, align 8, !tbaa !5
  %121 = getelementptr inbounds [1 x %struct.__mpz_struct], ptr %10, i64 0, i64 0
  call void @mpz_sub(ptr noundef %119, ptr noundef %120, ptr noundef %121)
  br label %122

122:                                              ; preds = %115, %112
  %123 = load ptr, ptr %5, align 8, !tbaa !5
  %124 = icmp ne ptr %123, null
  br i1 %124, label %125, label %128

125:                                              ; preds = %122
  %126 = load ptr, ptr %5, align 8, !tbaa !5
  %127 = getelementptr inbounds [1 x %struct.__mpz_struct], ptr %11, i64 0, i64 0
  call void @mpz_swap(ptr noundef %126, ptr noundef %127)
  br label %128

128:                                              ; preds = %125, %122
  %129 = getelementptr inbounds [1 x %struct.__mpz_struct], ptr %11, i64 0, i64 0
  call void @mpz_clear(ptr noundef %129)
  %130 = getelementptr inbounds [1 x %struct.__mpz_struct], ptr %10, i64 0, i64 0
  call void @mpz_clear(ptr noundef %130)
  store i32 0, ptr %12, align 4
  br label %131

131:                                              ; preds = %128, %46
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #2
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #2
  %132 = load i32, ptr %12, align 4
  switch i32 %132, label %134 [
    i32 0, label %133
    i32 1, label %133
  ]

133:                                              ; preds = %131, %131
  ret void

134:                                              ; preds = %131
  unreachable
}

; Function Attrs: nounwind uwtable
declare dso_local i64 @mpz_sizeinbase(ptr noundef, i32 noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !13, i64 4}
!12 = !{!"", !13, i64 0, !13, i64 4, !6, i64 8}
!13 = !{!"int", !7, i64 0}
!14 = !{!13, !13, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}


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

%struct.__mpz_struct = type { i32, i32, ptr }

@.str.15 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [26 x i8], align 1

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

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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @mpz_cmpabs_ui(ptr noundef, i64 noundef) local_unnamed_addr #1

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @mpz_rootrem(ptr noundef %0, ptr noundef %1, ptr noundef %2, i64 noundef %3) local_unnamed_addr #1 {
  %5 = alloca [1 x %struct.__mpz_struct], align 16
  %6 = alloca [1 x %struct.__mpz_struct], align 16
  %7 = alloca [1 x %struct.__mpz_struct], align 16
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #2
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #2
  %8 = getelementptr inbounds i8, ptr %2, i64 4
  %9 = load i32, ptr %8, align 4, !tbaa !5
  %10 = icmp slt i32 %9, 0
  %.lobit = lshr i32 %9, 31
  %11 = xor i64 %3, -1
  %12 = zext nneg i32 %.lobit to i64
  %13 = and i64 %12, %11
  %.not = icmp eq i64 %13, 0
  br i1 %.not, label %15, label %14

14:                                               ; preds = %4
  tail call void @gmp_die(ptr noundef nonnull @.str.15)
  br label %15

15:                                               ; preds = %14, %4
  %16 = icmp eq i64 %3, 0
  br i1 %16, label %17, label %18

17:                                               ; preds = %15
  tail call void @gmp_die(ptr noundef nonnull @.str.16)
  br label %18

18:                                               ; preds = %17, %15
  %19 = tail call i32 @mpz_cmpabs_ui(ptr noundef nonnull %2, i64 noundef 1)
  %20 = icmp slt i32 %19, 1
  br i1 %20, label %21, label %26

21:                                               ; preds = %18
  %.not29 = icmp eq ptr %0, null
  br i1 %.not29, label %23, label %22

22:                                               ; preds = %21
  tail call void @mpz_set(ptr noundef nonnull %0, ptr noundef nonnull %2)
  br label %23

23:                                               ; preds = %22, %21
  %.not30 = icmp eq ptr %1, null
  br i1 %.not30, label %46, label %24

24:                                               ; preds = %23
  %25 = getelementptr inbounds i8, ptr %1, i64 4
  store i32 0, ptr %25, align 4, !tbaa !5
  br label %46

26:                                               ; preds = %18
  call void @mpz_init(ptr noundef nonnull %6)
  call void @mpz_init(ptr noundef nonnull %5)
  %27 = call i64 @mpz_sizeinbase(ptr noundef nonnull %2, i32 noundef 2)
  %28 = udiv i64 %27, %3
  %29 = add i64 %28, 1
  call void @mpz_setbit(ptr noundef nonnull %5, i64 noundef %29)
  %30 = icmp eq i64 %3, 2
  br i1 %30, label %.preheader, label %33

.preheader:                                       ; preds = %26, %.preheader
  call void @mpz_swap(ptr noundef nonnull %6, ptr noundef nonnull %5)
  call void @mpz_tdiv_q(ptr noundef nonnull %5, ptr noundef %2, ptr noundef nonnull %6)
  call void @mpz_add(ptr noundef nonnull %5, ptr noundef nonnull %5, ptr noundef nonnull %6)
  call void @mpz_tdiv_q_2exp(ptr noundef nonnull %5, ptr noundef nonnull %5, i64 noundef 1)
  %31 = call i32 @mpz_cmpabs(ptr noundef nonnull %5, ptr noundef nonnull %6)
  %32 = icmp slt i32 %31, 0
  br i1 %32, label %.preheader, label %.loopexit, !llvm.loop !11

33:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #2
  call void @mpz_init(ptr noundef nonnull %7)
  br i1 %10, label %34, label %35

34:                                               ; preds = %33
  call void @mpz_neg(ptr noundef nonnull %5, ptr noundef nonnull %5)
  br label %35

35:                                               ; preds = %34, %33
  %36 = add i64 %3, -1
  br label %37

37:                                               ; preds = %37, %35
  call void @mpz_swap(ptr noundef nonnull %6, ptr noundef nonnull %5)
  call void @mpz_pow_ui(ptr noundef nonnull %5, ptr noundef nonnull %6, i64 noundef %36)
  call void @mpz_tdiv_q(ptr noundef nonnull %5, ptr noundef %2, ptr noundef nonnull %5)
  call void @mpz_mul_ui(ptr noundef nonnull %7, ptr noundef nonnull %6, i64 noundef %36)
  call void @mpz_add(ptr noundef nonnull %5, ptr noundef nonnull %5, ptr noundef nonnull %7)
  %38 = call i64 @mpz_tdiv_q_ui(ptr noundef nonnull %5, ptr noundef nonnull %5, i64 noundef %3)
  %39 = call i32 @mpz_cmpabs(ptr noundef nonnull %5, ptr noundef nonnull %6)
  %40 = icmp slt i32 %39, 0
  br i1 %40, label %37, label %41, !llvm.loop !13

41:                                               ; preds = %37
  call void @mpz_clear(ptr noundef nonnull %7)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #2
  br label %.loopexit

.loopexit:                                        ; preds = %.preheader, %41
  %.not27 = icmp eq ptr %1, null
  br i1 %.not27, label %43, label %42

42:                                               ; preds = %.loopexit
  call void @mpz_pow_ui(ptr noundef nonnull %5, ptr noundef nonnull %6, i64 noundef %3)
  call void @mpz_sub(ptr noundef nonnull %1, ptr noundef %2, ptr noundef nonnull %5)
  br label %43

43:                                               ; preds = %42, %.loopexit
  %.not28 = icmp eq ptr %0, null
  br i1 %.not28, label %45, label %44

44:                                               ; preds = %43
  call void @mpz_swap(ptr noundef nonnull %0, ptr noundef nonnull %6)
  br label %45

45:                                               ; preds = %44, %43
  call void @mpz_clear(ptr noundef nonnull %6)
  call void @mpz_clear(ptr noundef nonnull %5)
  br label %46

46:                                               ; preds = %23, %24, %45
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #2
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #2
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local i64 @mpz_sizeinbase(ptr noundef, i32 noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 4}
!6 = !{!"", !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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


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