; LLVM IR from Water-Melon/Melon :: src (mln_rsa)

; 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.mln_bignum_t = type { i32, i32, [257 x i64] }
%struct.mln_rsa_key_t = type { %struct.mln_bignum_t, %struct.mln_bignum_t, %struct.mln_bignum_t, %struct.mln_bignum_t, %struct.mln_bignum_t, %struct.mln_bignum_t, %struct.mln_bignum_t, i8 }

@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @mln_rsa_key_generate(ptr noundef %0, ptr noundef %1, i32 noundef %2) #0 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %struct.mln_bignum_t, align 8
  %9 = alloca %struct.mln_bignum_t, align 8
  %10 = alloca %struct.mln_bignum_t, align 8
  %11 = alloca %struct.mln_bignum_t, align 8
  %12 = alloca %struct.mln_bignum_t, align 8
  %13 = alloca %struct.mln_bignum_t, align 8
  %14 = alloca %struct.mln_bignum_t, align 8
  %15 = alloca %struct.mln_bignum_t, align 8
  %16 = alloca %struct.mln_bignum_t, align 8
  %17 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  %18 = load i32, ptr %7, align 4, !tbaa !9
  %19 = icmp ule i32 %18, 88
  br i1 %19, label %23, label %20

20:                                               ; preds = %3
  %21 = load i32, ptr %7, align 4, !tbaa !9
  %22 = icmp ugt i32 %21, 8224
  br i1 %22, label %23, label %24

23:                                               ; preds = %20, %3
  store i32 -1, ptr %4, align 4
  br label %149

24:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 2064, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 2064, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 2064, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 2064, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 2064, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 2064, ptr %13) #4
  %25 = call i32 @mln_bignum_assign(ptr noundef %12, ptr noundef @.str, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 2064, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 2064, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 2064, ptr %16) #4
  br label %26

26:                                               ; preds = %100, %96, %90, %84, %70, %64, %51, %24
  br label %27

27:                                               ; preds = %45, %26
  br label %28

28:                                               ; preds = %27
  %29 = load i32, ptr %7, align 4, !tbaa !9
  %30 = lshr i32 %29, 1
  %31 = add i32 %30, 1
  %32 = call i32 @mln_bignum_prime(ptr noundef %8, i32 noundef %31)
  %33 = icmp slt i32 %32, 0
  br i1 %33, label %34, label %35

34:                                               ; preds = %28
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %148

35:                                               ; preds = %28
  %36 = load i32, ptr %7, align 4, !tbaa !9
  %37 = lshr i32 %36, 1
  %38 = call i32 @mln_bignum_prime(ptr noundef %9, i32 noundef %37)
  %39 = icmp slt i32 %38, 0
  br i1 %39, label %40, label %41

40:                                               ; preds = %35
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %148

41:                                               ; preds = %35
  %42 = call i32 @mln_bignum_compare(ptr noundef %8, ptr noundef %9)
  %43 = icmp ne i32 %42, 0
  br i1 %43, label %44, label %45

44:                                               ; preds = %41
  br label %46

45:                                               ; preds = %41
  br label %27

46:                                               ; preds = %44
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %10, ptr align 8 %8, i64 2064, i1 false), !tbaa.struct !11
  call void @mln_bignum_mul(ptr noundef %10, ptr noundef %9)
  %47 = load i32, ptr %7, align 4, !tbaa !9
  %48 = sub i32 %47, 1
  %49 = call i32 @mln_bignum_bit_test(ptr noundef %10, i32 noundef %48)
  %50 = icmp ne i32 %49, 0
  br i1 %50, label %52, label %51

51:                                               ; preds = %46
  br label %26

52:                                               ; preds = %46
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = icmp ne ptr %53, null
  br i1 %54, label %55, label %72

55:                                               ; preds = %52
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.mln_rsa_key_t, ptr %56, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %57, ptr align 8 %8, i64 2064, i1 false), !tbaa.struct !11
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.mln_rsa_key_t, ptr %58, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %59, ptr align 8 %9, i64 2064, i1 false), !tbaa.struct !11
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.mln_rsa_key_t, ptr %60, i32 0, i32 6
  %62 = call i32 @mln_bignum_extend_eulid(ptr noundef %9, ptr noundef %8, ptr noundef %61, ptr noundef null)
  %63 = icmp slt i32 %62, 0
  br i1 %63, label %64, label %65

64:                                               ; preds = %55
  br label %26

65:                                               ; preds = %55
  %66 = load ptr, ptr %5, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.mln_rsa_key_t, ptr %66, i32 0, i32 6
  %68 = call i32 @mln_bignum_compare(ptr noundef %67, ptr noundef %12)
  %69 = icmp slt i32 %68, 0
  br i1 %69, label %70, label %71

70:                                               ; preds = %65
  br label %26

71:                                               ; preds = %65
  br label %72

72:                                               ; preds = %71, %52
  %73 = load ptr, ptr %6, align 8, !tbaa !5
  %74 = icmp ne ptr %73, null
  br i1 %74, label %75, label %92

75:                                               ; preds = %72
  %76 = load ptr, ptr %6, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.mln_rsa_key_t, ptr %76, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %77, ptr align 8 %8, i64 2064, i1 false), !tbaa.struct !11
  %78 = load ptr, ptr %6, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.mln_rsa_key_t, ptr %78, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %79, ptr align 8 %9, i64 2064, i1 false), !tbaa.struct !11
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.mln_rsa_key_t, ptr %80, i32 0, i32 6
  %82 = call i32 @mln_bignum_extend_eulid(ptr noundef %9, ptr noundef %8, ptr noundef %81, ptr noundef null)
  %83 = icmp slt i32 %82, 0
  br i1 %83, label %84, label %85

84:                                               ; preds = %75
  br label %26

85:                                               ; preds = %75
  %86 = load ptr, ptr %6, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.mln_rsa_key_t, ptr %86, i32 0, i32 6
  %88 = call i32 @mln_bignum_compare(ptr noundef %87, ptr noundef %12)
  %89 = icmp slt i32 %88, 0
  br i1 %89, label %90, label %91

90:                                               ; preds = %85
  br label %26

91:                                               ; preds = %85
  br label %92

92:                                               ; preds = %91, %72
  call void @mln_bignum_sub(ptr noundef %8, ptr noundef %12)
  call void @mln_bignum_sub(ptr noundef %9, ptr noundef %12)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %15, ptr align 8 %8, i64 2064, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %16, ptr align 8 %9, i64 2064, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %11, ptr align 8 %8, i64 2064, i1 false), !tbaa.struct !11
  call void @mln_bignum_mul(ptr noundef %11, ptr noundef %9)
  %93 = call i32 @mln_bignum_assign(ptr noundef %14, ptr noundef @.str.1, i32 noundef 7)
  %94 = call i32 @mln_bignum_extend_eulid(ptr noundef %14, ptr noundef %11, ptr noundef %13, ptr noundef null)
  %95 = icmp slt i32 %94, 0
  br i1 %95, label %96, label %97

96:                                               ; preds = %92
  br label %26

97:                                               ; preds = %92
  %98 = call i32 @mln_bignum_compare(ptr noundef %13, ptr noundef %14)
  %99 = icmp sle i32 %98, 0
  br i1 %99, label %100, label %101

100:                                              ; preds = %97
  br label %26

101:                                              ; preds = %97
  %102 = load ptr, ptr %5, align 8, !tbaa !5
  %103 = icmp ne ptr %102, null
  br i1 %103, label %104, label %124

104:                                              ; preds = %101
  %105 = load ptr, ptr %5, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.mln_rsa_key_t, ptr %105, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %106, ptr align 8 %10, i64 2064, i1 false), !tbaa.struct !11
  %107 = load ptr, ptr %5, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.mln_rsa_key_t, ptr %107, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %108, ptr align 8 %14, i64 2064, i1 false), !tbaa.struct !11
  %109 = load ptr, ptr %5, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.mln_rsa_key_t, ptr %109, i32 0, i32 4
  %111 = load ptr, ptr %5, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.mln_rsa_key_t, ptr %111, i32 0, i32 5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %112, ptr align 8 %14, i64 2064, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %110, ptr align 8 %112, i64 2064, i1 false), !tbaa.struct !11
  %113 = load ptr, ptr %5, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.mln_rsa_key_t, ptr %113, i32 0, i32 4
  %115 = call i32 @mln_bignum_div(ptr noundef %114, ptr noundef %15, ptr noundef null)
  %116 = load ptr, ptr %5, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.mln_rsa_key_t, ptr %116, i32 0, i32 5
  %118 = call i32 @mln_bignum_div(ptr noundef %117, ptr noundef %16, ptr noundef null)
  %119 = load ptr, ptr %5, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.mln_rsa_key_t, ptr %119, i32 0, i32 7
  %121 = load i8, ptr %120, align 8
  %122 = and i8 %121, -2
  %123 = or i8 %122, 0
  store i8 %123, ptr %120, align 8
  br label %124

124:                                              ; preds = %104, %101
  %125 = load ptr, ptr %6, align 8, !tbaa !5
  %126 = icmp ne ptr %125, null
  br i1 %126, label %127, label %147

127:                                              ; preds = %124
  %128 = load ptr, ptr %6, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.mln_rsa_key_t, ptr %128, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %129, ptr align 8 %10, i64 2064, i1 false), !tbaa.struct !11
  %130 = load ptr, ptr %6, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.mln_rsa_key_t, ptr %130, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %131, ptr align 8 %13, i64 2064, i1 false), !tbaa.struct !11
  %132 = load ptr, ptr %6, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.mln_rsa_key_t, ptr %132, i32 0, i32 4
  %134 = load ptr, ptr %6, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.mln_rsa_key_t, ptr %134, i32 0, i32 5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %135, ptr align 8 %13, i64 2064, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %133, ptr align 8 %135, i64 2064, i1 false), !tbaa.struct !11
  %136 = load ptr, ptr %6, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.mln_rsa_key_t, ptr %136, i32 0, i32 4
  %138 = call i32 @mln_bignum_div(ptr noundef %137, ptr noundef %15, ptr noundef null)
  %139 = load ptr, ptr %6, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.mln_rsa_key_t, ptr %139, i32 0, i32 5
  %141 = call i32 @mln_bignum_div(ptr noundef %140, ptr noundef %16, ptr noundef null)
  %142 = load ptr, ptr %6, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.mln_rsa_key_t, ptr %142, i32 0, i32 7
  %144 = load i8, ptr %143, align 8
  %145 = and i8 %144, -2
  %146 = or i8 %145, 0
  store i8 %146, ptr %143, align 8
  br label %147

147:                                              ; preds = %127, %124
  store i32 0, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %148

148:                                              ; preds = %147, %40, %34
  call void @llvm.lifetime.end.p0(i64 2064, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 2064, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 2064, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 2064, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 2064, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 2064, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 2064, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 2064, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 2064, ptr %8) #4
  br label %149

149:                                              ; preds = %148, %23
  %150 = load i32, ptr %4, align 4
  ret i32 %150
}

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

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

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

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

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

declare void @mln_bignum_mul(ptr noundef, ptr noundef) #2

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

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

declare void @mln_bignum_sub(ptr noundef, ptr noundef) #2

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

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

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{i64 0, i64 4, !9, i64 4, i64 4, !9, i64 8, i64 2056, !12}
!12 = !{!7, !7, i64 0}


; 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.mln_bignum_t = type { i32, i32, [257 x i64] }

@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @mln_rsa_key_generate(ptr noundef %0, ptr noundef %1, i32 noundef %2) local_unnamed_addr #0 {
  %4 = alloca %struct.mln_bignum_t, align 8
  %5 = alloca %struct.mln_bignum_t, align 8
  %6 = alloca %struct.mln_bignum_t, align 8
  %7 = alloca %struct.mln_bignum_t, align 8
  %8 = alloca %struct.mln_bignum_t, align 8
  %9 = alloca %struct.mln_bignum_t, align 8
  %10 = alloca %struct.mln_bignum_t, align 8
  %11 = alloca %struct.mln_bignum_t, align 8
  %12 = alloca %struct.mln_bignum_t, align 8
  %13 = add i32 %2, -8225
  %or.cond = icmp ult i32 %13, -8136
  br i1 %or.cond, label %75, label %14

14:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 2064, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 2064, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 2064, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 2064, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 2064, ptr nonnull %8) #4
  call void @llvm.lifetime.start.p0(i64 2064, ptr nonnull %9) #4
  %15 = call i32 @mln_bignum_assign(ptr noundef nonnull %8, ptr noundef nonnull @.str, i32 noundef 1) #4
  call void @llvm.lifetime.start.p0(i64 2064, ptr nonnull %10) #4
  call void @llvm.lifetime.start.p0(i64 2064, ptr nonnull %11) #4
  call void @llvm.lifetime.start.p0(i64 2064, ptr nonnull %12) #4
  %16 = lshr i32 %2, 1
  %17 = add nuw nsw i32 %16, 1
  %18 = add nsw i32 %2, -1
  %.not38 = icmp eq ptr %0, null
  %19 = getelementptr inbounds i8, ptr %0, i64 4128
  %20 = getelementptr inbounds i8, ptr %0, i64 6192
  %21 = getelementptr inbounds i8, ptr %0, i64 12384
  %.not39 = icmp eq ptr %1, null
  %22 = getelementptr inbounds i8, ptr %1, i64 4128
  %23 = getelementptr inbounds i8, ptr %1, i64 6192
  %24 = getelementptr inbounds i8, ptr %1, i64 12384
  br label %.backedge

.backedge:                                        ; preds = %.backedge.backedge, %14
  %25 = call i32 @mln_bignum_prime(ptr noundef nonnull %4, i32 noundef %17) #4
  %26 = icmp slt i32 %25, 0
  br i1 %26, label %.loopexit, label %27

27:                                               ; preds = %.backedge
  %28 = call i32 @mln_bignum_prime(ptr noundef nonnull %5, i32 noundef %16) #4
  %29 = icmp slt i32 %28, 0
  br i1 %29, label %.loopexit, label %30

30:                                               ; preds = %27
  %31 = call i32 @mln_bignum_compare(ptr noundef nonnull %4, ptr noundef nonnull %5) #4
  %.not = icmp eq i32 %31, 0
  br i1 %.not, label %.backedge.backedge, label %32

.backedge.backedge:                               ; preds = %30, %32, %35, %38, %42, %45, %48, %52
  br label %.backedge

32:                                               ; preds = %30
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(2064) %6, ptr noundef nonnull align 8 dereferenceable(2064) %4, i64 2064, i1 false), !tbaa.struct !5
  call void @mln_bignum_mul(ptr noundef nonnull %6, ptr noundef nonnull %5) #4
  %33 = call i32 @mln_bignum_bit_test(ptr noundef nonnull %6, i32 noundef %18) #4
  %.not37 = icmp eq i32 %33, 0
  br i1 %.not37, label %.backedge.backedge, label %34

34:                                               ; preds = %32
  br i1 %.not38, label %41, label %35

35:                                               ; preds = %34
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(2064) %19, ptr noundef nonnull align 8 dereferenceable(2064) %4, i64 2064, i1 false), !tbaa.struct !5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(2064) %20, ptr noundef nonnull align 8 dereferenceable(2064) %5, i64 2064, i1 false), !tbaa.struct !5
  %36 = call i32 @mln_bignum_extend_eulid(ptr noundef nonnull %5, ptr noundef nonnull %4, ptr noundef nonnull %21, ptr noundef null) #4
  %37 = icmp slt i32 %36, 0
  br i1 %37, label %.backedge.backedge, label %38

38:                                               ; preds = %35
  %39 = call i32 @mln_bignum_compare(ptr noundef nonnull %21, ptr noundef nonnull %8) #4
  %40 = icmp slt i32 %39, 0
  br i1 %40, label %.backedge.backedge, label %41

41:                                               ; preds = %38, %34
  br i1 %.not39, label %48, label %42

42:                                               ; preds = %41
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(2064) %22, ptr noundef nonnull align 8 dereferenceable(2064) %4, i64 2064, i1 false), !tbaa.struct !5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(2064) %23, ptr noundef nonnull align 8 dereferenceable(2064) %5, i64 2064, i1 false), !tbaa.struct !5
  %43 = call i32 @mln_bignum_extend_eulid(ptr noundef nonnull %5, ptr noundef nonnull %4, ptr noundef nonnull %24, ptr noundef null) #4
  %44 = icmp slt i32 %43, 0
  br i1 %44, label %.backedge.backedge, label %45

45:                                               ; preds = %42
  %46 = call i32 @mln_bignum_compare(ptr noundef nonnull %24, ptr noundef nonnull %8) #4
  %47 = icmp slt i32 %46, 0
  br i1 %47, label %.backedge.backedge, label %48

48:                                               ; preds = %45, %41
  call void @mln_bignum_sub(ptr noundef nonnull %4, ptr noundef nonnull %8) #4
  call void @mln_bignum_sub(ptr noundef nonnull %5, ptr noundef nonnull %8) #4
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(2064) %11, ptr noundef nonnull align 8 dereferenceable(2064) %4, i64 2064, i1 false), !tbaa.struct !5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(2064) %12, ptr noundef nonnull align 8 dereferenceable(2064) %5, i64 2064, i1 false), !tbaa.struct !5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(2064) %7, ptr noundef nonnull align 8 dereferenceable(2064) %4, i64 2064, i1 false), !tbaa.struct !5
  call void @mln_bignum_mul(ptr noundef nonnull %7, ptr noundef nonnull %5) #4
  %49 = call i32 @mln_bignum_assign(ptr noundef nonnull %10, ptr noundef nonnull @.str.1, i32 noundef 7) #4
  %50 = call i32 @mln_bignum_extend_eulid(ptr noundef nonnull %10, ptr noundef nonnull %7, ptr noundef nonnull %9, ptr noundef null) #4
  %51 = icmp slt i32 %50, 0
  br i1 %51, label %.backedge.backedge, label %52

52:                                               ; preds = %48
  %53 = call i32 @mln_bignum_compare(ptr noundef nonnull %9, ptr noundef nonnull %10) #4
  %54 = icmp slt i32 %53, 1
  br i1 %54, label %.backedge.backedge, label %55

55:                                               ; preds = %52
  br i1 %.not38, label %65, label %56

56:                                               ; preds = %55
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(2064) %0, ptr noundef nonnull align 8 dereferenceable(2064) %6, i64 2064, i1 false), !tbaa.struct !5
  %57 = getelementptr inbounds i8, ptr %0, i64 2064
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(2064) %57, ptr noundef nonnull align 8 dereferenceable(2064) %10, i64 2064, i1 false), !tbaa.struct !5
  %58 = getelementptr inbounds i8, ptr %0, i64 8256
  %59 = getelementptr inbounds i8, ptr %0, i64 10320
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(2064) %59, ptr noundef nonnull align 8 dereferenceable(2064) %10, i64 2064, i1 false), !tbaa.struct !5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(2064) %58, ptr noundef nonnull align 8 dereferenceable(2064) %10, i64 2064, i1 false)
  %60 = call i32 @mln_bignum_div(ptr noundef nonnull %58, ptr noundef nonnull %11, ptr noundef null) #4
  %61 = call i32 @mln_bignum_div(ptr noundef nonnull %59, ptr noundef nonnull %12, ptr noundef null) #4
  %62 = getelementptr inbounds i8, ptr %0, i64 14448
  %63 = load i8, ptr %62, align 8
  %64 = and i8 %63, -2
  store i8 %64, ptr %62, align 8
  br label %65

65:                                               ; preds = %56, %55
  br i1 %.not39, label %.loopexit, label %66

66:                                               ; preds = %65
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(2064) %1, ptr noundef nonnull align 8 dereferenceable(2064) %6, i64 2064, i1 false), !tbaa.struct !5
  %67 = getelementptr inbounds i8, ptr %1, i64 2064
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(2064) %67, ptr noundef nonnull align 8 dereferenceable(2064) %9, i64 2064, i1 false), !tbaa.struct !5
  %68 = getelementptr inbounds i8, ptr %1, i64 8256
  %69 = getelementptr inbounds i8, ptr %1, i64 10320
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(2064) %69, ptr noundef nonnull align 8 dereferenceable(2064) %9, i64 2064, i1 false), !tbaa.struct !5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(2064) %68, ptr noundef nonnull align 8 dereferenceable(2064) %9, i64 2064, i1 false)
  %70 = call i32 @mln_bignum_div(ptr noundef nonnull %68, ptr noundef nonnull %11, ptr noundef null) #4
  %71 = call i32 @mln_bignum_div(ptr noundef nonnull %69, ptr noundef nonnull %12, ptr noundef null) #4
  %72 = getelementptr inbounds i8, ptr %1, i64 14448
  %73 = load i8, ptr %72, align 8
  %74 = and i8 %73, -2
  store i8 %74, ptr %72, align 8
  br label %.loopexit

.loopexit:                                        ; preds = %27, %.backedge, %65, %66
  %.0 = phi i32 [ 0, %66 ], [ 0, %65 ], [ -1, %.backedge ], [ -1, %27 ]
  call void @llvm.lifetime.end.p0(i64 2064, ptr nonnull %12) #4
  call void @llvm.lifetime.end.p0(i64 2064, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 2064, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 2064, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 2064, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 2064, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 2064, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 2064, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 2064, ptr nonnull %4) #4
  br label %75

75:                                               ; preds = %3, %.loopexit
  %.1 = phi i32 [ %.0, %.loopexit ], [ -1, %3 ]
  ret i32 %.1
}

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

declare i32 @mln_bignum_assign(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare i32 @mln_bignum_prime(ptr noundef, i32 noundef) local_unnamed_addr #2

declare i32 @mln_bignum_compare(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress 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) #3

declare void @mln_bignum_mul(ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @mln_bignum_bit_test(ptr noundef, i32 noundef) local_unnamed_addr #2

declare i32 @mln_bignum_extend_eulid(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @mln_bignum_sub(ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @mln_bignum_div(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

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 = { mustprogress 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{i64 0, i64 4, !6, i64 4, i64 4, !6, i64 8, i64 2056, !10}
!6 = !{!7, !7, i64 0}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!8, !8, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,SROAPass,SimplifyCFGPass