; LLVM IR from daanx/mimalloc-bench :: bench/cfrac (cfrac)

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

@verbose = external dso_local global i32, align 4
@debug = external dso_local global i32, align 4
@stdout = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@stderr = external global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [39 x i8], align 1
@primes = external global [0 x i16], align 2
@.str.4 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 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: inlinehint nounwind uwtable
declare hidden ptr @pparmq(ptr noundef) #1

declare ptr @utop(i32 noundef) #2

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

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #3

; 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 float @cfrac_logf(i32 noundef, ptr noundef, i32 noundef) #4

declare ptr @pmul(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind
declare double @log(double noundef) #3

; Function Attrs: nounwind uwtable
define dso_local i32 @findk(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3) #4 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca float, align 4
  %15 = alloca float, align 4
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  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
  store i32 %3, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store float 0xC30C6BF520000000, ptr %15, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = call ptr @pparmq(ptr noundef %19)
  store i32 1, ptr %9, align 4, !tbaa !9
  br label %21

21:                                               ; preds = %119, %4
  %22 = load i32, ptr %9, align 4, !tbaa !9
  %23 = load i32, ptr %8, align 4, !tbaa !9
  %24 = icmp ult i32 %22, %23
  br i1 %24, label %25, label %122

25:                                               ; preds = %21
  %26 = load i32, ptr @debug, align 4, !tbaa !9
  %27 = icmp ne i32 %26, 0
  br i1 %27, label %28, label %39

28:                                               ; preds = %25
  %29 = load ptr, ptr @stdout, align 8, !tbaa !5
  %30 = call i32 @fputs(ptr noundef @.str.2, ptr noundef %29)
  %31 = load ptr, ptr @stdout, align 8, !tbaa !5
  %32 = load i32, ptr %9, align 4, !tbaa !9
  %33 = call ptr @utop(i32 noundef %32)
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = call ptr @pmul(ptr noundef %33, ptr noundef %34)
  %36 = call i32 @fputp(ptr noundef %31, ptr noundef %35)
  %37 = load ptr, ptr @stdout, align 8, !tbaa !5
  %38 = call i32 @putc(i32 noundef 10, ptr noundef %37)
  br label %39

39:                                               ; preds = %28, %25
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = load i32, ptr %40, align 4, !tbaa !9
  store i32 %41, ptr %11, align 4, !tbaa !9
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = load i32, ptr %9, align 4, !tbaa !9
  %44 = load i32, ptr %7, align 4, !tbaa !9
  %45 = call ptr @pfactorbase(ptr noundef %42, i32 noundef %43, ptr noundef %11, i32 noundef %44)
  store ptr %45, ptr %16, align 8, !tbaa !5
  %46 = load ptr, ptr %16, align 8, !tbaa !5
  %47 = icmp eq ptr %46, null
  br i1 %47, label %48, label %51

48:                                               ; preds = %39
  %49 = load ptr, ptr @stderr, align 8, !tbaa !5
  %50 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %49, ptr noundef @.str.3) #7
  call void @exit(i32 noundef 1) #8
  unreachable

51:                                               ; preds = %39
  %52 = load ptr, ptr %16, align 8, !tbaa !5
  %53 = load i32, ptr %11, align 4, !tbaa !9
  %54 = sub i32 %53, 1
  %55 = zext i32 %54 to i64
  %56 = getelementptr inbounds i32, ptr %52, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !9
  store i32 %57, ptr %13, align 4, !tbaa !9
  store float 0.000000e+00, ptr %14, align 4, !tbaa !11
  store ptr @primes, ptr %18, align 8, !tbaa !5
  br label %58

58:                                               ; preds = %64, %51
  %59 = load ptr, ptr %18, align 8, !tbaa !5
  %60 = load i16, ptr %59, align 2, !tbaa !13
  %61 = zext i16 %60 to i32
  %62 = load i32, ptr %13, align 4, !tbaa !9
  %63 = icmp ule i32 %61, %62
  br i1 %63, label %64, label %74

64:                                               ; preds = %58
  %65 = load ptr, ptr %18, align 8, !tbaa !5
  %66 = getelementptr inbounds i16, ptr %65, i32 1
  store ptr %66, ptr %18, align 8, !tbaa !5
  %67 = load i16, ptr %65, align 2, !tbaa !13
  %68 = zext i16 %67 to i32
  %69 = load ptr, ptr %5, align 8, !tbaa !5
  %70 = load i32, ptr %9, align 4, !tbaa !9
  %71 = call float @cfrac_logf(i32 noundef %68, ptr noundef %69, i32 noundef %70)
  %72 = load float, ptr %14, align 4, !tbaa !11
  %73 = fadd float %72, %71
  store float %73, ptr %14, align 4, !tbaa !11
  br label %58, !llvm.loop !15

74:                                               ; preds = %58
  %75 = load i32, ptr %9, align 4, !tbaa !9
  %76 = uitofp i32 %75 to double
  %77 = call double @log(double noundef %76) #7
  %78 = load float, ptr %14, align 4, !tbaa !11
  %79 = fpext float %78 to double
  %80 = fneg double %77
  %81 = call double @llvm.fmuladd.f64(double %80, double 5.000000e-01, double %79)
  %82 = fptrunc double %81 to float
  store float %82, ptr %14, align 4, !tbaa !11
  %83 = load i32, ptr @verbose, align 4, !tbaa !9
  %84 = icmp sgt i32 %83, 2
  br i1 %84, label %85, label %91

85:                                               ; preds = %74
  %86 = load ptr, ptr @stdout, align 8, !tbaa !5
  %87 = load i32, ptr %9, align 4, !tbaa !9
  %88 = load float, ptr %14, align 4, !tbaa !11
  %89 = fpext float %88 to double
  %90 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %86, ptr noundef @.str.4, i32 noundef %87, double noundef %89) #7
  br label %91

91:                                               ; preds = %85, %74
  %92 = load i32, ptr @debug, align 4, !tbaa !9
  %93 = icmp ne i32 %92, 0
  br i1 %93, label %94, label %101

94:                                               ; preds = %91
  %95 = load ptr, ptr @stdout, align 8, !tbaa !5
  %96 = load i32, ptr %9, align 4, !tbaa !9
  %97 = uitofp i32 %96 to double
  %98 = call double @log(double noundef %97) #7
  %99 = fmul double %98, 5.000000e-01
  %100 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %95, ptr noundef @.str.5, double noundef %99) #7
  br label %101

101:                                              ; preds = %94, %91
  %102 = load i32, ptr @verbose, align 4, !tbaa !9
  %103 = icmp sgt i32 %102, 2
  br i1 %103, label %104, label %109

104:                                              ; preds = %101
  %105 = load ptr, ptr @stdout, align 8, !tbaa !5
  %106 = call i32 @fputs(ptr noundef @.str.6, ptr noundef %105)
  %107 = load ptr, ptr @stdout, align 8, !tbaa !5
  %108 = call i32 @fflush(ptr noundef %107)
  br label %109

109:                                              ; preds = %104, %101
  %110 = load float, ptr %14, align 4, !tbaa !11
  %111 = load float, ptr %15, align 4, !tbaa !11
  %112 = fcmp ogt float %110, %111
  br i1 %112, label %113, label %117

113:                                              ; preds = %109
  %114 = load float, ptr %14, align 4, !tbaa !11
  store float %114, ptr %15, align 4, !tbaa !11
  %115 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %115, ptr %10, align 4, !tbaa !9
  %116 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %116, ptr %12, align 4, !tbaa !9
  br label %117

117:                                              ; preds = %113, %109
  %118 = load ptr, ptr %16, align 8, !tbaa !5
  call void @free(ptr noundef %118)
  br label %119

119:                                              ; preds = %117
  %120 = load i32, ptr %9, align 4, !tbaa !9
  %121 = add i32 %120, 1
  store i32 %121, ptr %9, align 4, !tbaa !9
  br label %21, !llvm.loop !17

122:                                              ; preds = %21
  %123 = load i32, ptr %12, align 4, !tbaa !9
  %124 = load ptr, ptr %6, align 8, !tbaa !5
  store i32 %123, ptr %124, align 4, !tbaa !9
  %125 = load ptr, ptr %5, align 8, !tbaa !5
  call void @pdestroy(ptr noundef %125)
  %126 = load i32, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  ret i32 %126
}

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

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

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

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

; Function Attrs: noreturn
declare void @exit(i32 noundef) #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #6

declare i32 @fflush(ptr noundef) #2

declare void @free(ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind "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 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 #5 = { noreturn "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
attributes #8 = { noreturn }

!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, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"short", !7, 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"

@verbose = external dso_local local_unnamed_addr global i32, align 4
@debug = external dso_local local_unnamed_addr global i32, align 4
@stdout = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [39 x i8], align 1
@primes = external local_unnamed_addr global [0 x i16], align 2
@.str.4 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 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: inlinehint nounwind uwtable
declare hidden ptr @pparmq(ptr noundef) local_unnamed_addr #1

declare ptr @utop(i32 noundef) local_unnamed_addr #2

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

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

; 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 float @cfrac_logf(i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

declare ptr @pmul(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @log(double noundef) local_unnamed_addr #5

; Function Attrs: nounwind uwtable
define dso_local i32 @findk(ptr noundef %0, ptr nocapture noundef %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #4 {
  %5 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #9
  %6 = tail call ptr @pparmq(ptr noundef %0)
  %7 = icmp ugt i32 %3, 1
  br i1 %7, label %.lr.ph53, label %._crit_edge54

.lr.ph53:                                         ; preds = %4, %66
  %.03151 = phi i32 [ %69, %66 ], [ 1, %4 ]
  %.03250 = phi i32 [ %.1, %66 ], [ 0, %4 ]
  %.03349 = phi float [ %.134, %66 ], [ 0xC30C6BF520000000, %4 ]
  %.03648 = phi i32 [ %.137, %66 ], [ 0, %4 ]
  %8 = load i32, ptr @debug, align 4, !tbaa !5
  %.not = icmp eq i32 %8, 0
  br i1 %.not, label %18, label %9

9:                                                ; preds = %.lr.ph53
  %10 = load ptr, ptr @stdout, align 8, !tbaa !9
  %11 = call i32 @fputs(ptr noundef nonnull @.str.2, ptr noundef %10)
  %12 = load ptr, ptr @stdout, align 8, !tbaa !9
  %13 = call ptr @utop(i32 noundef %.03151) #9
  %14 = call ptr @pmul(ptr noundef %13, ptr noundef %0) #9
  %15 = call i32 @fputp(ptr noundef %12, ptr noundef %14) #9
  %16 = load ptr, ptr @stdout, align 8, !tbaa !9
  %17 = call i32 @putc(i32 noundef 10, ptr noundef %16)
  br label %18

18:                                               ; preds = %9, %.lr.ph53
  %19 = load i32, ptr %1, align 4, !tbaa !5
  store i32 %19, ptr %5, align 4, !tbaa !5
  %20 = call ptr @pfactorbase(ptr noundef %0, i32 noundef %.03151, ptr noundef nonnull %5, i32 noundef %2) #9
  %21 = icmp eq ptr %20, null
  br i1 %21, label %22, label %25

22:                                               ; preds = %18
  %23 = load ptr, ptr @stderr, align 8, !tbaa !9
  %24 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %23, ptr noundef nonnull @.str.3) #10
  call void @exit(i32 noundef 1) #11
  unreachable

25:                                               ; preds = %18
  %26 = load i32, ptr %5, align 4, !tbaa !5
  %27 = add i32 %26, -1
  %28 = zext i32 %27 to i64
  %29 = getelementptr inbounds i32, ptr %20, i64 %28
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %31 = load i16, ptr @primes, align 2, !tbaa !11
  %32 = zext i16 %31 to i32
  %.not4145 = icmp ult i32 %30, %32
  br i1 %.not4145, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %25, %.lr.ph
  %33 = phi i32 [ %38, %.lr.ph ], [ %32, %25 ]
  %.047 = phi ptr [ %34, %.lr.ph ], [ @primes, %25 ]
  %.03546 = phi float [ %36, %.lr.ph ], [ 0.000000e+00, %25 ]
  %34 = getelementptr inbounds i8, ptr %.047, i64 2
  %35 = call float @cfrac_logf(i32 noundef %33, ptr noundef %0, i32 noundef %.03151)
  %36 = fadd float %.03546, %35
  %37 = load i16, ptr %34, align 2, !tbaa !11
  %38 = zext i16 %37 to i32
  %.not41 = icmp ult i32 %30, %38
  br i1 %.not41, label %._crit_edge, label %.lr.ph, !llvm.loop !13

._crit_edge:                                      ; preds = %.lr.ph, %25
  %.035.lcssa = phi float [ 0.000000e+00, %25 ], [ %36, %.lr.ph ]
  %39 = uitofp i32 %.03151 to double
  %40 = call double @log(double noundef %39) #9
  %41 = fpext float %.035.lcssa to double
  %42 = fneg double %40
  %43 = call double @llvm.fmuladd.f64(double %42, double 5.000000e-01, double %41)
  %44 = fptrunc double %43 to float
  %45 = load i32, ptr @verbose, align 4, !tbaa !5
  %46 = icmp sgt i32 %45, 2
  br i1 %46, label %47, label %51

47:                                               ; preds = %._crit_edge
  %48 = load ptr, ptr @stdout, align 8, !tbaa !9
  %49 = fpext float %44 to double
  %50 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %48, ptr noundef nonnull @.str.4, i32 noundef %.03151, double noundef %49) #9
  br label %51

51:                                               ; preds = %47, %._crit_edge
  %52 = load i32, ptr @debug, align 4, !tbaa !5
  %.not42 = icmp eq i32 %52, 0
  br i1 %.not42, label %58, label %53

53:                                               ; preds = %51
  %54 = load ptr, ptr @stdout, align 8, !tbaa !9
  %55 = call double @log(double noundef %39) #9
  %56 = fmul double %55, 5.000000e-01
  %57 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %54, ptr noundef nonnull @.str.5, double noundef %56) #9
  br label %58

58:                                               ; preds = %53, %51
  %59 = load i32, ptr @verbose, align 4, !tbaa !5
  %60 = icmp sgt i32 %59, 2
  br i1 %60, label %61, label %66

61:                                               ; preds = %58
  %62 = load ptr, ptr @stdout, align 8, !tbaa !9
  %63 = call i32 @fputs(ptr noundef nonnull @.str.6, ptr noundef %62)
  %64 = load ptr, ptr @stdout, align 8, !tbaa !9
  %65 = call i32 @fflush(ptr noundef %64)
  br label %66

66:                                               ; preds = %61, %58
  %67 = fcmp olt float %.03349, %44
  %68 = load i32, ptr %5, align 4
  %.137 = select i1 %67, i32 %68, i32 %.03648
  %.134 = select i1 %67, float %44, float %.03349
  %.1 = select i1 %67, i32 %.03151, i32 %.03250
  call void @free(ptr noundef %20)
  %69 = add nuw i32 %.03151, 1
  %exitcond.not = icmp eq i32 %69, %3
  br i1 %exitcond.not, label %._crit_edge54, label %.lr.ph53, !llvm.loop !15

._crit_edge54:                                    ; preds = %66, %4
  %.036.lcssa = phi i32 [ 0, %4 ], [ %.137, %66 ]
  %.032.lcssa = phi i32 [ 0, %4 ], [ %.1, %66 ]
  store i32 %.036.lcssa, ptr %1, align 4, !tbaa !5
  call void @pdestroy(ptr noundef %0)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #9
  ret i32 %.032.lcssa
}

; Function Attrs: nofree nounwind
declare noundef i32 @fputs(ptr nocapture noundef readonly, ptr nocapture noundef) local_unnamed_addr #3

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

; Function Attrs: nofree nounwind
declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #3

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

; Function Attrs: noreturn
declare void @exit(i32 noundef) local_unnamed_addr #6

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #7

; Function Attrs: nofree nounwind
declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #8

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint 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 = { "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 = { 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 = { 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 #5 = { mustprogress nofree nounwind willreturn memory(write) "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 = { noreturn "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 #7 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #9 = { nounwind }
attributes #10 = { cold nounwind }
attributes #11 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"short", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


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