; LLVM IR from Tiramisu-Compiler/tiramisu :: 3rdParty/isl/imath (gmp_compat)

; 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 = type { i32, ptr, i32, i32, i8 }

@.str.2 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [26 x i8], align 1
@endian_test = external hidden constant i16, align 2
@__PRETTY_FUNCTION__.impz_import = external hidden unnamed_addr constant [73 x i8], align 1

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

declare void @mp_int_clear(ptr noundef) #1

declare i32 @mp_int_copy(ptr noundef, ptr noundef) #1

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

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

; Function Attrs: nounwind uwtable
define dso_local void @impz_import(ptr noundef %0, i64 noundef %1, i32 noundef %2, i64 noundef %3, i32 noundef %4, i64 noundef %5, ptr noundef %6) #3 {
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca i64, align 8
  %14 = alloca ptr, align 8
  %15 = alloca %struct.mpz, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca ptr, align 8
  store ptr %0, ptr %8, align 8, !tbaa !5
  store i64 %1, ptr %9, align 8, !tbaa !9
  store i32 %2, ptr %10, align 4, !tbaa !11
  store i64 %3, ptr %11, align 8, !tbaa !9
  store i32 %4, ptr %12, align 4, !tbaa !11
  store i64 %5, ptr %13, align 8, !tbaa !9
  store ptr %6, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  store ptr %15, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #4
  %28 = load i64, ptr %9, align 8, !tbaa !9
  %29 = icmp eq i64 %28, 0
  br i1 %29, label %33, label %30

30:                                               ; preds = %7
  %31 = load ptr, ptr %14, align 8, !tbaa !5
  %32 = icmp eq ptr %31, null
  br i1 %32, label %33, label %34

33:                                               ; preds = %30, %7
  store i32 1, ptr %25, align 4
  br label %216

34:                                               ; preds = %30
  %35 = load i64, ptr %13, align 8, !tbaa !9
  %36 = icmp eq i64 %35, 0
  br i1 %36, label %37, label %39

37:                                               ; preds = %34
  br i1 true, label %38, label %39

38:                                               ; preds = %37
  br label %40

39:                                               ; preds = %37, %34
  call void @__assert_fail(ptr noundef @.str.49, ptr noundef @.str.2, i32 noundef 780, ptr noundef @__PRETTY_FUNCTION__.impz_import) #5
  unreachable

40:                                               ; preds = %38
  %41 = load i32, ptr %12, align 4, !tbaa !11
  %42 = icmp eq i32 %41, 1
  br i1 %42, label %49, label %43

43:                                               ; preds = %40
  %44 = load i32, ptr %12, align 4, !tbaa !11
  %45 = icmp eq i32 %44, 0
  br i1 %45, label %49, label %46

46:                                               ; preds = %43
  %47 = load i32, ptr %12, align 4, !tbaa !11
  %48 = icmp eq i32 %47, -1
  br i1 %48, label %49, label %50

49:                                               ; preds = %46, %43, %40
  br label %51

50:                                               ; preds = %46
  call void @__assert_fail(ptr noundef @.str.50, ptr noundef @.str.2, i32 noundef 781, ptr noundef @__PRETTY_FUNCTION__.impz_import) #5
  unreachable

51:                                               ; preds = %49
  %52 = load i32, ptr %10, align 4, !tbaa !11
  %53 = icmp eq i32 %52, 1
  br i1 %53, label %57, label %54

54:                                               ; preds = %51
  %55 = load i32, ptr %10, align 4, !tbaa !11
  %56 = icmp eq i32 %55, -1
  br i1 %56, label %57, label %58

57:                                               ; preds = %54, %51
  br label %59

58:                                               ; preds = %54
  call void @__assert_fail(ptr noundef @.str.51, ptr noundef @.str.2, i32 noundef 782, ptr noundef @__PRETTY_FUNCTION__.impz_import) #5
  unreachable

59:                                               ; preds = %57
  %60 = load i32, ptr %12, align 4, !tbaa !11
  %61 = icmp eq i32 %60, 0
  br i1 %61, label %62, label %65

62:                                               ; preds = %59
  %63 = load i8, ptr @endian_test, align 2, !tbaa !13
  %64 = sext i8 %63 to i32
  store i32 %64, ptr %12, align 4, !tbaa !11
  br label %65

65:                                               ; preds = %62, %59
  %66 = load i64, ptr %9, align 8, !tbaa !9
  %67 = load i64, ptr %11, align 8, !tbaa !9
  %68 = mul i64 %66, %67
  store i64 %68, ptr %17, align 8, !tbaa !9
  %69 = load i64, ptr %17, align 8, !tbaa !9
  %70 = add i64 %69, 4
  %71 = sub i64 %70, 1
  %72 = udiv i64 %71, 4
  store i64 %72, ptr %18, align 8, !tbaa !9
  %73 = load ptr, ptr %16, align 8, !tbaa !5
  %74 = load i64, ptr %18, align 8, !tbaa !9
  %75 = trunc i64 %74 to i32
  %76 = call i32 @mp_int_init_size(ptr noundef %73, i32 noundef %75)
  store i32 0, ptr %23, align 4, !tbaa !11
  br label %77

77:                                               ; preds = %89, %65
  %78 = load i32, ptr %23, align 4, !tbaa !11
  %79 = sext i32 %78 to i64
  %80 = load i64, ptr %18, align 8, !tbaa !9
  %81 = icmp ult i64 %79, %80
  br i1 %81, label %82, label %92

82:                                               ; preds = %77
  %83 = load ptr, ptr %16, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.mpz, ptr %83, i32 0, i32 1
  %85 = load ptr, ptr %84, align 8, !tbaa !14
  %86 = load i32, ptr %23, align 4, !tbaa !11
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds i32, ptr %85, i64 %87
  store i32 0, ptr %88, align 4, !tbaa !11
  br label %89

89:                                               ; preds = %82
  %90 = load i32, ptr %23, align 4, !tbaa !11
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %23, align 4, !tbaa !11
  br label %77, !llvm.loop !16

92:                                               ; preds = %77
  %93 = load ptr, ptr %14, align 8, !tbaa !5
  %94 = load i32, ptr %10, align 4, !tbaa !11
  %95 = icmp sge i32 %94, 0
  br i1 %95, label %96, label %101

96:                                               ; preds = %92
  %97 = load i64, ptr %9, align 8, !tbaa !9
  %98 = sub i64 %97, 1
  %99 = load i64, ptr %11, align 8, !tbaa !9
  %100 = mul i64 %98, %99
  br label %102

101:                                              ; preds = %92
  br label %102

102:                                              ; preds = %101, %96
  %103 = phi i64 [ %100, %96 ], [ 0, %101 ]
  %104 = getelementptr inbounds i8, ptr %93, i64 %103
  %105 = load i32, ptr %12, align 4, !tbaa !11
  %106 = icmp sge i32 %105, 0
  br i1 %106, label %107, label %110

107:                                              ; preds = %102
  %108 = load i64, ptr %11, align 8, !tbaa !9
  %109 = sub i64 %108, 1
  br label %111

110:                                              ; preds = %102
  br label %111

111:                                              ; preds = %110, %107
  %112 = phi i64 [ %109, %107 ], [ 0, %110 ]
  %113 = getelementptr inbounds i8, ptr %104, i64 %112
  store ptr %113, ptr %20, align 8, !tbaa !5
  %114 = load ptr, ptr %16, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.mpz, ptr %114, i32 0, i32 1
  %116 = load ptr, ptr %115, align 8, !tbaa !14
  store ptr %116, ptr %21, align 8, !tbaa !5
  store i32 0, ptr %22, align 4, !tbaa !11
  %117 = load i32, ptr %12, align 4, !tbaa !11
  %118 = icmp sge i32 %117, 0
  br i1 %118, label %119, label %121

119:                                              ; preds = %111
  %120 = load i64, ptr %11, align 8, !tbaa !9
  br label %124

121:                                              ; preds = %111
  %122 = load i64, ptr %11, align 8, !tbaa !9
  %123 = sub i64 0, %122
  br label %124

124:                                              ; preds = %121, %119
  %125 = phi i64 [ %120, %119 ], [ %123, %121 ]
  %126 = load i32, ptr %10, align 4, !tbaa !11
  %127 = icmp slt i32 %126, 0
  br i1 %127, label %128, label %130

128:                                              ; preds = %124
  %129 = load i64, ptr %11, align 8, !tbaa !9
  br label %133

130:                                              ; preds = %124
  %131 = load i64, ptr %11, align 8, !tbaa !9
  %132 = sub i64 0, %131
  br label %133

133:                                              ; preds = %130, %128
  %134 = phi i64 [ %129, %128 ], [ %132, %130 ]
  %135 = add i64 %125, %134
  store i64 %135, ptr %19, align 8, !tbaa !9
  store i32 0, ptr %23, align 4, !tbaa !11
  br label %136

136:                                              ; preds = %177, %133
  %137 = load i32, ptr %23, align 4, !tbaa !11
  %138 = sext i32 %137 to i64
  %139 = load i64, ptr %9, align 8, !tbaa !9
  %140 = icmp ult i64 %138, %139
  br i1 %140, label %141, label %180

141:                                              ; preds = %136
  store i32 0, ptr %24, align 4, !tbaa !11
  br label %142

142:                                              ; preds = %170, %141
  %143 = load i32, ptr %24, align 4, !tbaa !11
  %144 = sext i32 %143 to i64
  %145 = load i64, ptr %11, align 8, !tbaa !9
  %146 = icmp ult i64 %144, %145
  br i1 %146, label %147, label %173

147:                                              ; preds = %142
  %148 = load i32, ptr %22, align 4, !tbaa !11
  %149 = sext i32 %148 to i64
  %150 = icmp eq i64 %149, 32
  br i1 %150, label %151, label %154

151:                                              ; preds = %147
  %152 = load ptr, ptr %21, align 8, !tbaa !5
  %153 = getelementptr inbounds i32, ptr %152, i32 1
  store ptr %153, ptr %21, align 8, !tbaa !5
  store i32 0, ptr %22, align 4, !tbaa !11
  br label %154

154:                                              ; preds = %151, %147
  %155 = load ptr, ptr %20, align 8, !tbaa !5
  %156 = load i8, ptr %155, align 1, !tbaa !13
  %157 = zext i8 %156 to i32
  %158 = load i32, ptr %22, align 4, !tbaa !11
  %159 = shl i32 %157, %158
  %160 = load ptr, ptr %21, align 8, !tbaa !5
  %161 = load i32, ptr %160, align 4, !tbaa !11
  %162 = or i32 %161, %159
  store i32 %162, ptr %160, align 4, !tbaa !11
  %163 = load i32, ptr %22, align 4, !tbaa !11
  %164 = add nsw i32 %163, 8
  store i32 %164, ptr %22, align 4, !tbaa !11
  %165 = load i32, ptr %12, align 4, !tbaa !11
  %166 = load ptr, ptr %20, align 8, !tbaa !5
  %167 = sext i32 %165 to i64
  %168 = sub i64 0, %167
  %169 = getelementptr inbounds i8, ptr %166, i64 %168
  store ptr %169, ptr %20, align 8, !tbaa !5
  br label %170

170:                                              ; preds = %154
  %171 = load i32, ptr %24, align 4, !tbaa !11
  %172 = add nsw i32 %171, 1
  store i32 %172, ptr %24, align 4, !tbaa !11
  br label %142, !llvm.loop !18

173:                                              ; preds = %142
  %174 = load i64, ptr %19, align 8, !tbaa !9
  %175 = load ptr, ptr %20, align 8, !tbaa !5
  %176 = getelementptr inbounds i8, ptr %175, i64 %174
  store ptr %176, ptr %20, align 8, !tbaa !5
  br label %177

177:                                              ; preds = %173
  %178 = load i32, ptr %23, align 4, !tbaa !11
  %179 = add nsw i32 %178, 1
  store i32 %179, ptr %23, align 4, !tbaa !11
  br label %136, !llvm.loop !19

180:                                              ; preds = %136
  %181 = load i64, ptr %18, align 8, !tbaa !9
  %182 = trunc i64 %181 to i32
  %183 = load ptr, ptr %16, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.mpz, ptr %183, i32 0, i32 3
  store i32 %182, ptr %184, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #4
  %185 = load ptr, ptr %16, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.mpz, ptr %185, i32 0, i32 3
  %187 = load i32, ptr %186, align 4, !tbaa !20
  store i32 %187, ptr %26, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #4
  %188 = load ptr, ptr %16, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.mpz, ptr %188, i32 0, i32 1
  %190 = load ptr, ptr %189, align 8, !tbaa !14
  %191 = load i32, ptr %26, align 4, !tbaa !11
  %192 = zext i32 %191 to i64
  %193 = getelementptr inbounds i32, ptr %190, i64 %192
  %194 = getelementptr inbounds i32, ptr %193, i64 -1
  store ptr %194, ptr %27, align 8, !tbaa !5
  br label %195

195:                                              ; preds = %205, %180
  %196 = load i32, ptr %26, align 4, !tbaa !11
  %197 = icmp ugt i32 %196, 1
  br i1 %197, label %198, label %203

198:                                              ; preds = %195
  %199 = load ptr, ptr %27, align 8, !tbaa !5
  %200 = getelementptr inbounds i32, ptr %199, i32 -1
  store ptr %200, ptr %27, align 8, !tbaa !5
  %201 = load i32, ptr %199, align 4, !tbaa !11
  %202 = icmp eq i32 %201, 0
  br label %203

203:                                              ; preds = %198, %195
  %204 = phi i1 [ false, %195 ], [ %202, %198 ]
  br i1 %204, label %205, label %208

205:                                              ; preds = %203
  %206 = load i32, ptr %26, align 4, !tbaa !11
  %207 = add i32 %206, -1
  store i32 %207, ptr %26, align 4, !tbaa !11
  br label %195, !llvm.loop !21

208:                                              ; preds = %203
  %209 = load i32, ptr %26, align 4, !tbaa !11
  %210 = load ptr, ptr %16, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.mpz, ptr %210, i32 0, i32 3
  store i32 %209, ptr %211, align 4, !tbaa !20
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #4
  %212 = load ptr, ptr %16, align 8, !tbaa !5
  %213 = load ptr, ptr %8, align 8, !tbaa !5
  %214 = call i32 @mp_int_copy(ptr noundef %212, ptr noundef %213)
  %215 = load ptr, ptr %16, align 8, !tbaa !5
  call void @mp_int_clear(ptr noundef %215)
  store i32 0, ptr %25, align 4
  br label %216

216:                                              ; preds = %208, %33
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #4
  %217 = load i32, ptr %25, align 4
  switch i32 %217, label %219 [
    i32 0, label %218
    i32 1, label %218
  ]

218:                                              ; preds = %216, %216
  ret void

219:                                              ; preds = %216
  unreachable
}

declare i32 @mp_int_init_size(ptr noundef, i32 noundef) #1

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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { 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 = !{!7, !7, i64 0}
!14 = !{!15, !6, i64 8}
!15 = !{!"mpz", !12, i64 0, !6, i64 8, !12, i64 16, !12, i64 20, !7, i64 24}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
!19 = distinct !{!19, !17}
!20 = !{!15, !12, i64 20}
!21 = distinct !{!21, !17}


; 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 = type { i32, ptr, i32, i32, i8 }

@.str.2 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [26 x i8], align 1
@endian_test = external hidden local_unnamed_addr constant i16, align 2
@__PRETTY_FUNCTION__.impz_import = external hidden unnamed_addr constant [73 x i8], align 1

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

declare void @mp_int_clear(ptr noundef) local_unnamed_addr #1

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @impz_import(ptr noundef %0, i64 noundef %1, i32 noundef %2, i64 noundef %3, i32 noundef %4, i64 noundef %5, ptr noundef readonly %6) local_unnamed_addr #3 {
  %8 = alloca %struct.mpz, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #6
  %9 = icmp eq i64 %1, 0
  %10 = icmp eq ptr %6, null
  %or.cond = or i1 %9, %10
  br i1 %or.cond, label %81, label %11

11:                                               ; preds = %7
  %12 = icmp eq i64 %5, 0
  br i1 %12, label %14, label %13

13:                                               ; preds = %11
  tail call void @__assert_fail(ptr noundef nonnull @.str.49, ptr noundef nonnull @.str.2, i32 noundef 780, ptr noundef nonnull @__PRETTY_FUNCTION__.impz_import) #7
  unreachable

14:                                               ; preds = %11
  %15 = icmp eq i32 %4, 0
  %16 = add i32 %4, 1
  %or.cond5 = icmp ult i32 %16, 3
  br i1 %or.cond5, label %18, label %17

17:                                               ; preds = %14
  tail call void @__assert_fail(ptr noundef nonnull @.str.50, ptr noundef nonnull @.str.2, i32 noundef 781, ptr noundef nonnull @__PRETTY_FUNCTION__.impz_import) #7
  unreachable

18:                                               ; preds = %14
  switch i32 %2, label %19 [
    i32 -1, label %20
    i32 1, label %20
  ]

19:                                               ; preds = %18
  tail call void @__assert_fail(ptr noundef nonnull @.str.51, ptr noundef nonnull @.str.2, i32 noundef 782, ptr noundef nonnull @__PRETTY_FUNCTION__.impz_import) #7
  unreachable

20:                                               ; preds = %18, %18
  %21 = load i8, ptr @endian_test, align 2
  %22 = sext i8 %21 to i32
  %.077 = select i1 %15, i32 %22, i32 %4
  %23 = mul i64 %3, %1
  %24 = add i64 %23, 3
  %25 = lshr i64 %24, 2
  %26 = trunc i64 %25 to i32
  %27 = call i32 @mp_int_init_size(ptr noundef nonnull %8, i32 noundef %26) #6
  %.not = icmp ult i64 %24, 4
  %.phi.trans.insert = getelementptr inbounds i8, ptr %8, i64 8
  %.pre = load ptr, ptr %.phi.trans.insert, align 8, !tbaa !5
  br i1 %.not, label %.preheader.lr.ph, label %.lr.ph

.lr.ph:                                           ; preds = %20
  %umax = call i64 @llvm.umax.i64(i64 %25, i64 1)
  %28 = shl nuw i64 %umax, 2
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %.pre, i8 0, i64 %28, i1 false), !tbaa !11
  br label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %20, %.lr.ph
  %29 = icmp sgt i32 %.077, -1
  %30 = sub i64 0, %3
  %31 = select i1 %29, i64 %3, i64 %30
  %32 = icmp slt i32 %2, 0
  %33 = select i1 %32, i64 %3, i64 %30
  %.not105 = icmp eq i64 %3, 0
  %34 = sext i32 %.077 to i64
  %35 = sub nsw i64 0, %34
  br i1 %.not105, label %._crit_edge96, label %.preheader.us.preheader

.preheader.us.preheader:                          ; preds = %.preheader.lr.ph
  %36 = icmp sgt i32 %2, -1
  %37 = add i64 %1, -1
  %38 = mul i64 %37, %3
  %39 = select i1 %36, i64 %38, i64 0
  %40 = getelementptr inbounds i8, ptr %6, i64 %39
  %41 = add i64 %3, -1
  %42 = select i1 %29, i64 %41, i64 0
  %43 = getelementptr inbounds i8, ptr %40, i64 %42
  %xtraiter = and i64 %3, 1
  %44 = icmp eq i64 %41, 0
  %unroll_iter = and i64 %3, -2
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge89.us
  %indvars.iv110 = phi i64 [ 0, %.preheader.us.preheader ], [ %indvars.iv.next111, %._crit_edge89.us ]
  %.07094.us = phi i32 [ 0, %.preheader.us.preheader ], [ %.lcssa119, %._crit_edge89.us ]
  %.07293.us = phi ptr [ %.pre, %.preheader.us.preheader ], [ %spec.select.us.lcssa, %._crit_edge89.us ]
  %.07592.us = phi ptr [ %43, %.preheader.us.preheader ], [ %70, %._crit_edge89.us ]
  br i1 %44, label %._crit_edge89.us.unr-lcssa, label %.preheader.us.new

.preheader.us.new:                                ; preds = %.preheader.us, %.preheader.us.new
  %.17186.us = phi i32 [ %59, %.preheader.us.new ], [ %.07094.us, %.preheader.us ]
  %.17385.us = phi ptr [ %spec.select.us.1, %.preheader.us.new ], [ %.07293.us, %.preheader.us ]
  %.17684.us = phi ptr [ %60, %.preheader.us.new ], [ %.07592.us, %.preheader.us ]
  %niter = phi i64 [ %niter.next.1, %.preheader.us.new ], [ 0, %.preheader.us ]
  %45 = icmp eq i32 %.17186.us, 32
  %spec.select.idx.us = select i1 %45, i64 4, i64 0
  %spec.select.us = getelementptr inbounds i8, ptr %.17385.us, i64 %spec.select.idx.us
  %spec.select82.us = select i1 %45, i32 0, i32 %.17186.us
  %46 = load i8, ptr %.17684.us, align 1, !tbaa !12
  %47 = zext i8 %46 to i32
  %48 = shl i32 %47, %spec.select82.us
  %49 = load i32, ptr %spec.select.us, align 4, !tbaa !11
  %50 = or i32 %48, %49
  store i32 %50, ptr %spec.select.us, align 4, !tbaa !11
  %51 = add nsw i32 %spec.select82.us, 8
  %52 = getelementptr inbounds i8, ptr %.17684.us, i64 %35
  %53 = icmp eq i32 %51, 32
  %spec.select.idx.us.1 = select i1 %53, i64 4, i64 0
  %spec.select.us.1 = getelementptr inbounds i8, ptr %spec.select.us, i64 %spec.select.idx.us.1
  %spec.select82.us.1 = select i1 %53, i32 0, i32 %51
  %54 = load i8, ptr %52, align 1, !tbaa !12
  %55 = zext i8 %54 to i32
  %56 = shl i32 %55, %spec.select82.us.1
  %57 = load i32, ptr %spec.select.us.1, align 4, !tbaa !11
  %58 = or i32 %56, %57
  store i32 %58, ptr %spec.select.us.1, align 4, !tbaa !11
  %59 = add nsw i32 %spec.select82.us.1, 8
  %60 = getelementptr inbounds i8, ptr %52, i64 %35
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge89.us.unr-lcssa, label %.preheader.us.new, !llvm.loop !13

._crit_edge89.us.unr-lcssa:                       ; preds = %.preheader.us.new, %.preheader.us
  %spec.select.us.lcssa.ph = phi ptr [ poison, %.preheader.us ], [ %spec.select.us.1, %.preheader.us.new ]
  %.lcssa119.ph = phi i32 [ poison, %.preheader.us ], [ %59, %.preheader.us.new ]
  %.lcssa.ph = phi ptr [ poison, %.preheader.us ], [ %60, %.preheader.us.new ]
  %.17186.us.unr = phi i32 [ %.07094.us, %.preheader.us ], [ %59, %.preheader.us.new ]
  %.17385.us.unr = phi ptr [ %.07293.us, %.preheader.us ], [ %spec.select.us.1, %.preheader.us.new ]
  %.17684.us.unr = phi ptr [ %.07592.us, %.preheader.us ], [ %60, %.preheader.us.new ]
  br i1 %lcmp.mod.not, label %._crit_edge89.us, label %._crit_edge89.us.epilog-lcssa

._crit_edge89.us.epilog-lcssa:                    ; preds = %._crit_edge89.us.unr-lcssa
  %61 = icmp eq i32 %.17186.us.unr, 32
  %spec.select.idx.us.epil = select i1 %61, i64 4, i64 0
  %spec.select.us.epil = getelementptr inbounds i8, ptr %.17385.us.unr, i64 %spec.select.idx.us.epil
  %spec.select82.us.epil = select i1 %61, i32 0, i32 %.17186.us.unr
  %62 = load i8, ptr %.17684.us.unr, align 1, !tbaa !12
  %63 = zext i8 %62 to i32
  %64 = shl i32 %63, %spec.select82.us.epil
  %65 = load i32, ptr %spec.select.us.epil, align 4, !tbaa !11
  %66 = or i32 %64, %65
  store i32 %66, ptr %spec.select.us.epil, align 4, !tbaa !11
  %67 = add nsw i32 %spec.select82.us.epil, 8
  %68 = getelementptr inbounds i8, ptr %.17684.us.unr, i64 %35
  br label %._crit_edge89.us

._crit_edge89.us:                                 ; preds = %._crit_edge89.us.unr-lcssa, %._crit_edge89.us.epilog-lcssa
  %spec.select.us.lcssa = phi ptr [ %spec.select.us.lcssa.ph, %._crit_edge89.us.unr-lcssa ], [ %spec.select.us.epil, %._crit_edge89.us.epilog-lcssa ]
  %.lcssa119 = phi i32 [ %.lcssa119.ph, %._crit_edge89.us.unr-lcssa ], [ %67, %._crit_edge89.us.epilog-lcssa ]
  %.lcssa = phi ptr [ %.lcssa.ph, %._crit_edge89.us.unr-lcssa ], [ %68, %._crit_edge89.us.epilog-lcssa ]
  %69 = getelementptr i8, ptr %.lcssa, i64 %31
  %70 = getelementptr i8, ptr %69, i64 %33
  %indvars.iv.next111 = add nuw nsw i64 %indvars.iv110, 1
  %exitcond113.not = icmp eq i64 %indvars.iv.next111, %1
  br i1 %exitcond113.not, label %._crit_edge96, label %.preheader.us, !llvm.loop !15

._crit_edge96:                                    ; preds = %._crit_edge89.us, %.preheader.lr.ph
  %71 = getelementptr inbounds i8, ptr %8, i64 20
  store i32 %26, ptr %71, align 4, !tbaa !16
  %72 = icmp ugt i32 %26, 1
  br i1 %72, label %.lr.ph101.preheader, label %.critedge

.lr.ph101.preheader:                              ; preds = %._crit_edge96
  %73 = and i64 %25, 4294967295
  %74 = getelementptr inbounds i32, ptr %.pre, i64 %73
  br label %.lr.ph101

.lr.ph101:                                        ; preds = %.lr.ph101.preheader, %77
  %.099.pn = phi ptr [ %.099, %77 ], [ %74, %.lr.ph101.preheader ]
  %.06798 = phi i32 [ %78, %77 ], [ %26, %.lr.ph101.preheader ]
  %.099 = getelementptr inbounds i8, ptr %.099.pn, i64 -4
  %75 = load i32, ptr %.099, align 4, !tbaa !11
  %76 = icmp eq i32 %75, 0
  br i1 %76, label %77, label %.critedge

77:                                               ; preds = %.lr.ph101
  %78 = add i32 %.06798, -1
  %79 = icmp ugt i32 %78, 1
  br i1 %79, label %.lr.ph101, label %.critedge, !llvm.loop !17

.critedge:                                        ; preds = %.lr.ph101, %77, %._crit_edge96
  %.067.lcssa = phi i32 [ %26, %._crit_edge96 ], [ 1, %77 ], [ %.06798, %.lr.ph101 ]
  store i32 %.067.lcssa, ptr %71, align 4, !tbaa !16
  %80 = call i32 @mp_int_copy(ptr noundef nonnull %8, ptr noundef %0) #6
  call void @mp_int_clear(ptr noundef nonnull %8) #6
  br label %81

81:                                               ; preds = %7, %.critedge
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #6
  ret void
}

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umax.i64(i64, i64) #4

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

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 = { "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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind }
attributes #7 = { 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, !10, i64 8}
!6 = !{!"mpz", !7, i64 0, !10, i64 8, !7, i64 16, !7, i64 20, !8, i64 24}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!8, !8, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = !{!6, !7, i64 20}
!17 = distinct !{!17, !14}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopIdiomRecognizePass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass