; LLVM IR from jingweizhanghuai/Morn :: src/math (morn_large_integer)

; 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.MArray = type { i32, i16, %union.anon }
%union.anon = type { ptr }
%struct.HandleLIntBuff = type { ptr, ptr, ptr, ptr }

@.str.1 = external hidden unnamed_addr constant [85 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [14 x i8], align 1
@__FUNCTION__.mLIntToString = external hidden unnamed_addr constant [14 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [9 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @LIntIint() #0

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

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

declare void @ArrayRedefine(ptr noundef, i32 noundef, i32 noundef, ptr noundef) #2

declare void @m_Exception(i32 noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ...) #2

; Function Attrs: nounwind uwtable
declare dso_local void @LIntCaculate(ptr noundef) #0

; 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 ptr @m_Malloc(i32 noundef) #2

declare void @m_Free(ptr noundef) #2

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

; Function Attrs: nounwind uwtable
define dso_local void @mLIntToString(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i128, align 16
  %14 = alloca i64, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  br label %15

15:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %16 = load ptr, ptr %3, align 8, !tbaa !5
  %17 = icmp eq ptr %16, null
  br i1 %17, label %22, label %18

18:                                               ; preds = %15
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %20 = ptrtoint ptr %19 to i64
  %21 = icmp eq i64 %20, -1
  br label %22

22:                                               ; preds = %18, %15
  %23 = phi i1 [ true, %15 ], [ %21, %18 ]
  %24 = zext i1 %23 to i32
  store i32 %24, ptr %5, align 4, !tbaa !9
  %25 = load i32, ptr %5, align 4, !tbaa !9
  %26 = icmp ne i32 %25, 0
  br i1 %26, label %27, label %29

27:                                               ; preds = %22
  %28 = load i32, ptr %5, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %28, i32 noundef -1, ptr noundef @.str.1, i32 noundef 537, ptr noundef @__FUNCTION__.mLIntToString, ptr noundef @.str.4)
  br label %29

29:                                               ; preds = %27, %22
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %30

30:                                               ; preds = %29
  %31 = load ptr, ptr %3, align 8, !tbaa !5
  call void @LIntCaculate(ptr noundef %31)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %32 = load ptr, ptr %3, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.MArray, ptr %32, i32 0, i32 0
  %34 = load i32, ptr %33, align 8, !tbaa !11
  store i32 %34, ptr %6, align 4, !tbaa !9
  %35 = load i32, ptr %6, align 4, !tbaa !9
  %36 = icmp sle i32 %35, 2
  br i1 %36, label %37, label %42

37:                                               ; preds = %30
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = getelementptr inbounds i8, ptr %38, i64 0
  store i8 48, ptr %39, align 1, !tbaa !14
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = getelementptr inbounds i8, ptr %40, i64 1
  store i8 0, ptr %41, align 1, !tbaa !14
  store i32 1, ptr %7, align 4
  br label %181

42:                                               ; preds = %30
  %43 = load ptr, ptr %3, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.MArray, ptr %43, i32 0, i32 2
  %45 = load ptr, ptr %44, align 8, !tbaa !14
  %46 = getelementptr inbounds i64, ptr %45, i64 1
  %47 = load i64, ptr %46, align 8, !tbaa !15
  %48 = icmp ult i64 %47, 0
  br i1 %48, label %49, label %54

49:                                               ; preds = %42
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  %51 = getelementptr inbounds i8, ptr %50, i64 0
  store i8 45, ptr %51, align 1, !tbaa !14
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = getelementptr inbounds i8, ptr %52, i32 1
  store ptr %53, ptr %4, align 8, !tbaa !5
  br label %54

54:                                               ; preds = %49, %42
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %55 = call ptr @LIntIint()
  %56 = getelementptr inbounds %struct.HandleLIntBuff, ptr %55, i32 0, i32 0
  %57 = load ptr, ptr %56, align 8, !tbaa !17
  store ptr %57, ptr %8, align 8, !tbaa !5
  br label %58

58:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 2, ptr %9, align 4, !tbaa !9
  %59 = load i32, ptr %9, align 4, !tbaa !9
  %60 = icmp eq i32 %59, 1
  br i1 %60, label %61, label %65

61:                                               ; preds = %58
  %62 = load ptr, ptr %8, align 8, !tbaa !5
  %63 = load i32, ptr %6, align 4, !tbaa !9
  %64 = add nsw i32 %63, 0
  call void @ArrayRedefine(ptr noundef %62, i32 noundef %64, i32 noundef -1, ptr noundef null)
  br label %90

65:                                               ; preds = %58
  %66 = load i32, ptr %9, align 4, !tbaa !9
  %67 = icmp eq i32 %66, 2
  br i1 %67, label %68, label %72

68:                                               ; preds = %65
  %69 = load ptr, ptr %8, align 8, !tbaa !5
  %70 = load i32, ptr %6, align 4, !tbaa !9
  %71 = add nsw i32 %70, 0
  call void @ArrayRedefine(ptr noundef %69, i32 noundef %71, i32 noundef 8, ptr noundef null)
  br label %89

72:                                               ; preds = %65
  %73 = load i32, ptr %9, align 4, !tbaa !9
  %74 = icmp eq i32 %73, 3
  br i1 %74, label %75, label %79

75:                                               ; preds = %72
  %76 = load ptr, ptr %8, align 8, !tbaa !5
  %77 = load i32, ptr %6, align 4, !tbaa !9
  %78 = add nsw i32 %77, 0
  call void @ArrayRedefine(ptr noundef %76, i32 noundef %78, i32 noundef 8, ptr noundef inttoptr (i64 -1 to ptr))
  br label %88

79:                                               ; preds = %72
  br label %80

80:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 1, ptr %10, align 4, !tbaa !9
  %81 = load i32, ptr %10, align 4, !tbaa !9
  %82 = icmp ne i32 %81, 0
  br i1 %82, label %83, label %85

83:                                               ; preds = %80
  %84 = load i32, ptr %10, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %84, i32 noundef -1, ptr noundef @.str.1, i32 noundef 545, ptr noundef @__FUNCTION__.mLIntToString, ptr noundef @.str.2)
  br label %85

85:                                               ; preds = %83, %80
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %86

86:                                               ; preds = %85
  br label %87

87:                                               ; preds = %86
  br label %88

88:                                               ; preds = %87, %75
  br label %89

89:                                               ; preds = %88, %68
  br label %90

90:                                               ; preds = %89, %61
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %91

91:                                               ; preds = %90
  br label %92

92:                                               ; preds = %91
  %93 = load ptr, ptr %8, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.MArray, ptr %93, i32 0, i32 2
  %95 = load ptr, ptr %94, align 8, !tbaa !14
  %96 = getelementptr inbounds i64, ptr %95, i64 2
  %97 = load ptr, ptr %3, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.MArray, ptr %97, i32 0, i32 2
  %99 = load ptr, ptr %98, align 8, !tbaa !14
  %100 = getelementptr inbounds i64, ptr %99, i64 2
  %101 = load i32, ptr %6, align 4, !tbaa !9
  %102 = sub nsw i32 %101, 2
  %103 = sext i32 %102 to i64
  %104 = mul i64 %103, 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %96, ptr align 8 %100, i64 %104, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %105 = load i32, ptr %6, align 4, !tbaa !9
  %106 = mul nsw i32 %105, 2
  %107 = sext i32 %106 to i64
  %108 = mul i64 %107, 16
  %109 = trunc i64 %108 to i32
  %110 = call ptr @m_Malloc(i32 noundef %109)
  store ptr %110, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %111 = load i32, ptr %6, align 4, !tbaa !9
  %112 = load i32, ptr %6, align 4, !tbaa !9
  %113 = add nsw i32 %111, %112
  %114 = sub nsw i32 %113, 1
  store i32 %114, ptr %12, align 4, !tbaa !9
  br label %115

115:                                              ; preds = %134, %92
  br label %116

116:                                              ; preds = %115
  %117 = load ptr, ptr %8, align 8, !tbaa !5
  %118 = load ptr, ptr %8, align 8, !tbaa !5
  %119 = load ptr, ptr %11, align 8, !tbaa !5
  %120 = load i32, ptr %12, align 4, !tbaa !9
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds i128, ptr %119, i64 %121
  store i128 100000000000000000, ptr %13, align 16, !tbaa !19
  %123 = getelementptr inbounds { i64, i64 }, ptr %13, i32 0, i32 0
  %124 = load i64, ptr %123, align 16
  %125 = getelementptr inbounds { i64, i64 }, ptr %13, i32 0, i32 1
  %126 = load i64, ptr %125, align 8
  call void @LIntDivInt(ptr noundef %117, i64 noundef %124, i64 noundef %126, ptr noundef %118, ptr noundef %122)
  %127 = load i32, ptr %12, align 4, !tbaa !9
  %128 = add nsw i32 %127, -1
  store i32 %128, ptr %12, align 4, !tbaa !9
  %129 = load ptr, ptr %8, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.MArray, ptr %129, i32 0, i32 0
  %131 = load i32, ptr %130, align 8, !tbaa !11
  %132 = icmp eq i32 %131, 2
  br i1 %132, label %133, label %134

133:                                              ; preds = %116
  br label %135

134:                                              ; preds = %116
  br label %115

135:                                              ; preds = %133
  %136 = load i32, ptr %12, align 4, !tbaa !9
  %137 = add nsw i32 %136, 1
  store i32 %137, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %138 = load ptr, ptr %11, align 8, !tbaa !5
  %139 = load i32, ptr %12, align 4, !tbaa !9
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds i128, ptr %138, i64 %140
  %142 = load i128, ptr %141, align 16, !tbaa !19
  %143 = trunc i128 %142 to i64
  store i64 %143, ptr %14, align 8, !tbaa !15
  %144 = load ptr, ptr %4, align 8, !tbaa !5
  %145 = load i64, ptr %14, align 8, !tbaa !15
  %146 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %144, ptr noundef @.str.5, i64 noundef %145) #6
  %147 = load ptr, ptr %4, align 8, !tbaa !5
  %148 = call i64 @strlen(ptr noundef %147) #7
  %149 = load ptr, ptr %4, align 8, !tbaa !5
  %150 = getelementptr inbounds i8, ptr %149, i64 %148
  store ptr %150, ptr %4, align 8, !tbaa !5
  %151 = load i32, ptr %12, align 4, !tbaa !9
  %152 = add nsw i32 %151, 1
  store i32 %152, ptr %12, align 4, !tbaa !9
  br label %153

153:                                              ; preds = %174, %135
  %154 = load i32, ptr %12, align 4, !tbaa !9
  %155 = load i32, ptr %6, align 4, !tbaa !9
  %156 = load i32, ptr %6, align 4, !tbaa !9
  %157 = add nsw i32 %155, %156
  %158 = icmp slt i32 %154, %157
  br i1 %158, label %159, label %177

159:                                              ; preds = %153
  %160 = load ptr, ptr %11, align 8, !tbaa !5
  %161 = load i32, ptr %12, align 4, !tbaa !9
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds i128, ptr %160, i64 %162
  %164 = load i128, ptr %163, align 16, !tbaa !19
  %165 = trunc i128 %164 to i64
  store i64 %165, ptr %14, align 8, !tbaa !15
  %166 = load ptr, ptr %4, align 8, !tbaa !5
  %167 = load i64, ptr %14, align 8, !tbaa !15
  %168 = udiv i64 %167, 100000000
  %169 = load i64, ptr %14, align 8, !tbaa !15
  %170 = urem i64 %169, 100000000
  %171 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %166, ptr noundef @.str.6, i64 noundef %168, i64 noundef %170) #6
  %172 = load ptr, ptr %4, align 8, !tbaa !5
  %173 = getelementptr inbounds i8, ptr %172, i64 17
  store ptr %173, ptr %4, align 8, !tbaa !5
  br label %174

174:                                              ; preds = %159
  %175 = load i32, ptr %12, align 4, !tbaa !9
  %176 = add nsw i32 %175, 1
  store i32 %176, ptr %12, align 4, !tbaa !9
  br label %153, !llvm.loop !21

177:                                              ; preds = %153
  %178 = load ptr, ptr %4, align 8, !tbaa !5
  %179 = getelementptr inbounds i8, ptr %178, i64 0
  store i8 0, ptr %179, align 1, !tbaa !14
  %180 = load ptr, ptr %11, align 8, !tbaa !5
  call void @m_Free(ptr noundef %180)
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  store i32 0, ptr %7, align 4
  br label %181

181:                                              ; preds = %177, %37
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %182 = load i32, ptr %7, align 4
  switch i32 %182, label %184 [
    i32 0, label %183
    i32 1, label %183
  ]

183:                                              ; preds = %181, %181
  ret void

184:                                              ; preds = %181
  unreachable
}

; Function Attrs: nounwind
declare i32 @sprintf(ptr noundef, ptr noundef, ...) #4

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #5

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 "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 #5 = { nounwind willreturn memory(read) "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 #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"MArray", !10, i64 0, !13, i64 4, !7, i64 8}
!13 = !{!"short", !7, i64 0}
!14 = !{!7, !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = !{!18, !6, i64 0}
!18 = !{!"HandleLIntBuff", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!19 = !{!20, !20, i64 0}
!20 = !{!"__int128", !7, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"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 [85 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [14 x i8], align 1
@__FUNCTION__.mLIntToString = external hidden unnamed_addr constant [14 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [9 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @LIntIint() local_unnamed_addr #0

declare void @ArrayRedefine(ptr noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

declare void @m_Exception(i32 noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ...) local_unnamed_addr #1

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

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

declare ptr @m_Malloc(i32 noundef) local_unnamed_addr #1

declare void @m_Free(ptr noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
define dso_local void @mLIntToString(ptr noundef %0, ptr nocapture noundef %1) local_unnamed_addr #0 {
  %magicptr = ptrtoint ptr %0 to i64
  switch i64 %magicptr, label %8 [
    i64 -1, label %3
    i64 0, label %3
  ]

3:                                                ; preds = %2, %2
  %4 = icmp eq ptr %0, null
  %5 = icmp eq ptr %0, inttoptr (i64 -1 to ptr)
  %6 = or i1 %4, %5
  %7 = zext i1 %6 to i32
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %7, i32 noundef -1, ptr noundef nonnull @.str.1, i32 noundef 537, ptr noundef nonnull @__FUNCTION__.mLIntToString, ptr noundef nonnull @.str.4) #5
  br label %8

8:                                                ; preds = %2, %3
  tail call void @LIntCaculate(ptr noundef %0)
  %9 = load i32, ptr %0, align 8, !tbaa !5
  %10 = icmp slt i32 %9, 3
  br i1 %10, label %11, label %13

11:                                               ; preds = %8
  store i8 48, ptr %1, align 1, !tbaa !11
  %12 = getelementptr inbounds i8, ptr %1, i64 1
  store i8 0, ptr %12, align 1, !tbaa !11
  br label %48

13:                                               ; preds = %8
  %14 = getelementptr inbounds i8, ptr %0, i64 8
  %15 = tail call ptr @LIntIint()
  %16 = load ptr, ptr %15, align 8, !tbaa !12
  tail call void @ArrayRedefine(ptr noundef %16, i32 noundef %9, i32 noundef 8, ptr noundef null) #5
  %17 = getelementptr inbounds i8, ptr %16, i64 8
  %18 = load ptr, ptr %17, align 8, !tbaa !11
  %19 = getelementptr inbounds i8, ptr %18, i64 16
  %20 = load ptr, ptr %14, align 8, !tbaa !11
  %21 = getelementptr inbounds i8, ptr %20, i64 16
  %22 = add nsw i32 %9, -2
  %23 = zext nneg i32 %22 to i64
  %24 = shl nuw nsw i64 %23, 3
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 8 %19, ptr nonnull align 8 %21, i64 %24, i1 false)
  %25 = shl i32 %9, 5
  %26 = tail call ptr @m_Malloc(i32 noundef %25) #5
  %27 = shl nuw i32 %9, 1
  %28 = sext i32 %27 to i64
  br label %29

29:                                               ; preds = %29, %13
  %indvars.iv = phi i64 [ %indvars.iv.next, %29 ], [ %28, %13 ]
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %30 = getelementptr inbounds i128, ptr %26, i64 %indvars.iv.next
  tail call void @LIntDivInt(ptr noundef nonnull %16, i64 noundef 100000000000000000, i64 noundef 0, ptr noundef nonnull %16, ptr noundef %30)
  %31 = load i32, ptr %16, align 8, !tbaa !5
  %32 = icmp eq i32 %31, 2
  br i1 %32, label %33, label %29

33:                                               ; preds = %29
  %34 = trunc nsw i64 %indvars.iv to i32
  %35 = load i128, ptr %30, align 16, !tbaa !15
  %36 = trunc i128 %35 to i64
  %37 = tail call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %1, ptr noundef nonnull dereferenceable(1) @.str.5, i64 noundef %36) #5
  %38 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %1) #6
  %39 = getelementptr inbounds i8, ptr %1, i64 %38
  %40 = icmp sgt i32 %27, %34
  br i1 %40, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %33, %.lr.ph
  %indvars.iv61 = phi i64 [ %indvars.iv.next62, %.lr.ph ], [ %indvars.iv, %33 ]
  %.158 = phi ptr [ %47, %.lr.ph ], [ %39, %33 ]
  %41 = getelementptr inbounds i128, ptr %26, i64 %indvars.iv61
  %42 = load i128, ptr %41, align 16, !tbaa !15
  %43 = trunc i128 %42 to i64
  %44 = udiv i64 %43, 100000000
  %45 = urem i64 %43, 100000000
  %46 = tail call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %.158, ptr noundef nonnull dereferenceable(1) @.str.6, i64 noundef %44, i64 noundef %45) #5
  %47 = getelementptr inbounds i8, ptr %.158, i64 17
  %indvars.iv.next62 = add nsw i64 %indvars.iv61, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next62 to i32
  %exitcond.not = icmp eq i32 %27, %lftr.wideiv
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !17

._crit_edge:                                      ; preds = %.lr.ph, %33
  %.1.lcssa = phi ptr [ %39, %33 ], [ %47, %.lr.ph ]
  store i8 0, ptr %.1.lcssa, align 1, !tbaa !11
  tail call void @m_Free(ptr noundef nonnull %26) #5
  br label %48

48:                                               ; preds = %._crit_edge, %11
  ret void
}

; Function Attrs: nofree nounwind
declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4

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

!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 0}
!6 = !{!"MArray", !7, i64 0, !10, i64 4, !8, i64 8}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"short", !8, i64 0}
!11 = !{!8, !8, i64 0}
!12 = !{!13, !14, i64 0}
!13 = !{!"HandleLIntBuff", !14, i64 0, !14, i64 8, !14, i64 16, !14, i64 24}
!14 = !{!"any pointer", !8, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"__int128", !8, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}


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