; LLVM IR from tangjz/acm-icpc :: codeforces/complete (524B)

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

@n = external dso_local global i32, align 4
@w = external dso_local global [1001 x i32], align 16
@h = external dso_local global [1001 x i32], align 16
@hh = external dso_local global i32, align 4
@ans = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %6

6:                                                ; preds = %48, %0
  %7 = load i32, ptr %2, align 4, !tbaa !5
  %8 = load i32, ptr @n, align 4, !tbaa !5
  %9 = icmp slt i32 %7, %8
  br i1 %9, label %11, label %10

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

11:                                               ; preds = %6
  %12 = load i32, ptr %2, align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  %14 = getelementptr inbounds i32, ptr @w, i64 %13
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds i32, ptr @h, i64 %16
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %14, ptr noundef %17)
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [1001 x i32], ptr @w, i64 0, i64 %20
  %22 = load i32, ptr %21, align 4, !tbaa !5
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [1001 x i32], ptr @h, i64 0, i64 %24
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %27 = icmp sgt i32 %22, %26
  br i1 %27, label %28, label %35

28:                                               ; preds = %11
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [1001 x i32], ptr @w, i64 0, i64 %30
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [1001 x i32], ptr @h, i64 0, i64 %33
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %31, ptr noundef nonnull align 4 dereferenceable(4) %34) #4
  br label %35

35:                                               ; preds = %28, %11
  %36 = load i32, ptr @hh, align 4, !tbaa !5
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [1001 x i32], ptr @w, i64 0, i64 %38
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %41 = icmp slt i32 %36, %40
  br i1 %41, label %42, label %47

42:                                               ; preds = %35
  %43 = load i32, ptr %2, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [1001 x i32], ptr @w, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !5
  store i32 %46, ptr @hh, align 4, !tbaa !5
  br label %47

47:                                               ; preds = %42, %35
  br label %48

48:                                               ; preds = %47
  %49 = load i32, ptr %2, align 4, !tbaa !5
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %2, align 4, !tbaa !5
  br label %6, !llvm.loop !9

51:                                               ; preds = %10
  br label %52

52:                                               ; preds = %97, %51
  %53 = load i32, ptr @hh, align 4, !tbaa !5
  %54 = icmp sle i32 %53, 1000
  br i1 %54, label %55, label %100

55:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %56

56:                                               ; preds = %83, %55
  %57 = load i32, ptr %4, align 4, !tbaa !5
  %58 = load i32, ptr @n, align 4, !tbaa !5
  %59 = icmp slt i32 %57, %58
  br i1 %59, label %61, label %60

60:                                               ; preds = %56
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %86

61:                                               ; preds = %56
  %62 = load i32, ptr @hh, align 4, !tbaa !5
  %63 = load i32, ptr %4, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [1001 x i32], ptr @h, i64 0, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = icmp sge i32 %62, %66
  br i1 %67, label %68, label %75

68:                                               ; preds = %61
  %69 = load i32, ptr %4, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [1001 x i32], ptr @w, i64 0, i64 %70
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = load i32, ptr %3, align 4, !tbaa !5
  %74 = add nsw i32 %73, %72
  store i32 %74, ptr %3, align 4, !tbaa !5
  br label %82

75:                                               ; preds = %61
  %76 = load i32, ptr %4, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [1001 x i32], ptr @h, i64 0, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = load i32, ptr %3, align 4, !tbaa !5
  %81 = add nsw i32 %80, %79
  store i32 %81, ptr %3, align 4, !tbaa !5
  br label %82

82:                                               ; preds = %75, %68
  br label %83

83:                                               ; preds = %82
  %84 = load i32, ptr %4, align 4, !tbaa !5
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %4, align 4, !tbaa !5
  br label %56, !llvm.loop !11

86:                                               ; preds = %60
  %87 = load i32, ptr @ans, align 4, !tbaa !5
  %88 = load i32, ptr @hh, align 4, !tbaa !5
  %89 = load i32, ptr %3, align 4, !tbaa !5
  %90 = mul nsw i32 %88, %89
  %91 = icmp sgt i32 %87, %90
  br i1 %91, label %92, label %96

92:                                               ; preds = %86
  %93 = load i32, ptr @hh, align 4, !tbaa !5
  %94 = load i32, ptr %3, align 4, !tbaa !5
  %95 = mul nsw i32 %93, %94
  store i32 %95, ptr @ans, align 4, !tbaa !5
  br label %96

96:                                               ; preds = %92, %86
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %97

97:                                               ; preds = %96
  %98 = load i32, ptr @hh, align 4, !tbaa !5
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr @hh, align 4, !tbaa !5
  br label %52, !llvm.loop !12

100:                                              ; preds = %52
  %101 = load i32, ptr @ans, align 4, !tbaa !5
  %102 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %101)
  ret i32 0
}

declare i32 @__isoc99_scanf(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: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

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

declare i32 @printf(ptr noundef, ...) #1

attributes #0 = { mustprogress norecurse 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint mustprogress 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 }

!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++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}


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

@n = external dso_local global i32, align 4
@w = external dso_local global [1001 x i32], align 16
@h = external dso_local global [1001 x i32], align 16
@hh = external dso_local local_unnamed_addr global i32, align 4
@ans = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %2 = load i32, ptr @n, align 4, !tbaa !5
  %3 = icmp sgt i32 %2, 0
  br i1 %3, label %.lr.ph, label %.thread-pre-split_crit_edge

.thread-pre-split_crit_edge:                      ; preds = %0
  %.pr.pre = load i32, ptr @hh, align 4, !tbaa !5
  br label %thread-pre-split

.lr.ph:                                           ; preds = %0, %16
  %indvars.iv = phi i64 [ %indvars.iv.next, %16 ], [ 0, %0 ]
  %4 = getelementptr inbounds i32, ptr @w, i64 %indvars.iv
  %5 = getelementptr inbounds i32, ptr @h, i64 %indvars.iv
  %6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %4, ptr noundef nonnull %5)
  %7 = load i32, ptr %4, align 4, !tbaa !5
  %8 = load i32, ptr %5, align 4, !tbaa !5
  %9 = icmp sgt i32 %7, %8
  br i1 %9, label %10, label %11

10:                                               ; preds = %.lr.ph
  tail call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5) #3
  %.pre = load i32, ptr %4, align 4, !tbaa !5
  br label %11

11:                                               ; preds = %10, %.lr.ph
  %12 = phi i32 [ %.pre, %10 ], [ %7, %.lr.ph ]
  %13 = load i32, ptr @hh, align 4, !tbaa !5
  %14 = icmp slt i32 %13, %12
  br i1 %14, label %15, label %16

15:                                               ; preds = %11
  store i32 %12, ptr @hh, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %11, %15
  %.pr42 = phi i32 [ %13, %11 ], [ %12, %15 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %17 = load i32, ptr @n, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = icmp slt i64 %indvars.iv.next, %18
  br i1 %19, label %.lr.ph, label %thread-pre-split, !llvm.loop !9

thread-pre-split:                                 ; preds = %16, %.thread-pre-split_crit_edge
  %.pr = phi i32 [ %.pr.pre, %.thread-pre-split_crit_edge ], [ %.pr42, %16 ]
  %.lcssa = phi i32 [ %2, %.thread-pre-split_crit_edge ], [ %17, %16 ]
  %20 = icmp slt i32 %.pr, 1001
  %ans.promoted = load i32, ptr @ans, align 4, !tbaa !5
  br i1 %20, label %.preheader.lr.ph, label %thread-pre-split._crit_edge

.preheader.lr.ph:                                 ; preds = %thread-pre-split
  %21 = icmp sgt i32 %.lcssa, 0
  br i1 %21, label %.preheader.us.preheader, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.preheader.lr.ph
  %22 = sub i32 1, %.pr
  %xtraiter = and i32 %22, 3
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader.prol.loopexit, label %.preheader.prol

.preheader.prol:                                  ; preds = %.preheader.preheader, %27
  %23 = phi i32 [ %29, %27 ], [ %.pr, %.preheader.preheader ]
  %24 = phi i32 [ %28, %27 ], [ %ans.promoted, %.preheader.preheader ]
  %prol.iter = phi i32 [ %prol.iter.next, %27 ], [ 0, %.preheader.preheader ]
  %25 = icmp sgt i32 %24, 0
  br i1 %25, label %26, label %27

26:                                               ; preds = %.preheader.prol
  store i32 0, ptr @ans, align 4, !tbaa !5
  br label %27

27:                                               ; preds = %26, %.preheader.prol
  %28 = phi i32 [ 0, %26 ], [ %24, %.preheader.prol ]
  %29 = add i32 %23, 1
  %prol.iter.next = add i32 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i32 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %.preheader.prol.loopexit, label %.preheader.prol, !llvm.loop !11

.preheader.prol.loopexit:                         ; preds = %27, %.preheader.preheader
  %.lcssa54.unr = phi i32 [ poison, %.preheader.preheader ], [ %28, %27 ]
  %.unr = phi i32 [ %.pr, %.preheader.preheader ], [ %29, %27 ]
  %.unr56 = phi i32 [ %ans.promoted, %.preheader.preheader ], [ %28, %27 ]
  %30 = add i32 %.pr, -998
  %31 = icmp ult i32 %30, 3
  br i1 %31, label %._crit_edge29, label %.preheader

.preheader.us.preheader:                          ; preds = %.preheader.lr.ph
  %wide.trip.count = zext nneg i32 %.lcssa to i64
  %xtraiter57 = and i64 %wide.trip.count, 1
  %32 = icmp eq i32 %.lcssa, 1
  %unroll_iter = and i64 %wide.trip.count, 2147483646
  %lcmp.mod58.not = icmp eq i64 %xtraiter57, 0
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %36
  %33 = phi i32 [ %38, %36 ], [ %.pr, %.preheader.us.preheader ]
  %34 = phi i32 [ %37, %36 ], [ %ans.promoted, %.preheader.us.preheader ]
  br i1 %32, label %._crit_edge.us.unr-lcssa, label %.preheader.us.new

35:                                               ; preds = %._crit_edge.us
  store i32 %56, ptr @ans, align 4, !tbaa !5
  br label %36

36:                                               ; preds = %35, %._crit_edge.us
  %37 = phi i32 [ %56, %35 ], [ %34, %._crit_edge.us ]
  %38 = add nsw i32 %33, 1
  %exitcond40.not = icmp eq i32 %38, 1001
  br i1 %exitcond40.not, label %._crit_edge29, label %.preheader.us, !llvm.loop !13

.preheader.us.new:                                ; preds = %.preheader.us, %50
  %indvars.iv36 = phi i64 [ %indvars.iv.next37.1, %50 ], [ 0, %.preheader.us ]
  %.01925.us = phi i32 [ %.1.us.1, %50 ], [ 0, %.preheader.us ]
  %niter = phi i64 [ %niter.next.1, %50 ], [ 0, %.preheader.us ]
  %39 = getelementptr inbounds [1001 x i32], ptr @h, i64 0, i64 %indvars.iv36
  %40 = load i32, ptr %39, align 8, !tbaa !5
  %.not.us = icmp slt i32 %33, %40
  br i1 %.not.us, label %44, label %41

41:                                               ; preds = %.preheader.us.new
  %42 = getelementptr inbounds [1001 x i32], ptr @w, i64 0, i64 %indvars.iv36
  %43 = load i32, ptr %42, align 8, !tbaa !5
  br label %44

44:                                               ; preds = %41, %.preheader.us.new
  %.pn.us = phi i32 [ %43, %41 ], [ %40, %.preheader.us.new ]
  %.1.us = add nsw i32 %.pn.us, %.01925.us
  %indvars.iv.next37 = or disjoint i64 %indvars.iv36, 1
  %45 = getelementptr inbounds [1001 x i32], ptr @h, i64 0, i64 %indvars.iv.next37
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %.not.us.1 = icmp slt i32 %33, %46
  br i1 %.not.us.1, label %50, label %47

47:                                               ; preds = %44
  %48 = getelementptr inbounds [1001 x i32], ptr @w, i64 0, i64 %indvars.iv.next37
  %49 = load i32, ptr %48, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %47, %44
  %.pn.us.1 = phi i32 [ %49, %47 ], [ %46, %44 ]
  %.1.us.1 = add nsw i32 %.pn.us.1, %.1.us
  %indvars.iv.next37.1 = add nuw nsw i64 %indvars.iv36, 2
  %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_edge.us.unr-lcssa, label %.preheader.us.new, !llvm.loop !14

._crit_edge.us.unr-lcssa:                         ; preds = %50, %.preheader.us
  %.1.us.lcssa.ph = phi i32 [ poison, %.preheader.us ], [ %.1.us.1, %50 ]
  %indvars.iv36.unr = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next37.1, %50 ]
  %.01925.us.unr = phi i32 [ 0, %.preheader.us ], [ %.1.us.1, %50 ]
  br i1 %lcmp.mod58.not, label %._crit_edge.us, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.us.unr-lcssa
  %51 = getelementptr inbounds [1001 x i32], ptr @h, i64 0, i64 %indvars.iv36.unr
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %.not.us.epil = icmp slt i32 %33, %52
  br i1 %.not.us.epil, label %._crit_edge.us.epilog-lcssa, label %53

53:                                               ; preds = %.epil.preheader
  %54 = getelementptr inbounds [1001 x i32], ptr @w, i64 0, i64 %indvars.iv36.unr
  %55 = load i32, ptr %54, align 4, !tbaa !5
  br label %._crit_edge.us.epilog-lcssa

._crit_edge.us.epilog-lcssa:                      ; preds = %53, %.epil.preheader
  %.pn.us.epil = phi i32 [ %55, %53 ], [ %52, %.epil.preheader ]
  %.1.us.epil = add nsw i32 %.pn.us.epil, %.01925.us.unr
  br label %._crit_edge.us

._crit_edge.us:                                   ; preds = %._crit_edge.us.unr-lcssa, %._crit_edge.us.epilog-lcssa
  %.1.us.lcssa = phi i32 [ %.1.us.lcssa.ph, %._crit_edge.us.unr-lcssa ], [ %.1.us.epil, %._crit_edge.us.epilog-lcssa ]
  %56 = mul nsw i32 %.1.us.lcssa, %33
  %57 = icmp sgt i32 %34, %56
  br i1 %57, label %35, label %36

.preheader:                                       ; preds = %.preheader.prol.loopexit, %82
  %58 = phi i32 [ %83, %82 ], [ %.unr, %.preheader.prol.loopexit ]
  %59 = phi i32 [ %spec.select65, %82 ], [ %.unr56, %.preheader.prol.loopexit ]
  %60 = icmp sgt i32 %59, 0
  %61 = select i1 %60, i32 0, i32 %59
  %62 = icmp sgt i32 %61, 0
  %63 = select i1 %62, i32 0, i32 %61
  %64 = xor i1 %60, true
  %65 = xor i1 %62, true
  %66 = xor i1 %64, true
  %67 = xor i1 %65, true
  %68 = or i1 %66, %67
  %69 = icmp sgt i32 %63, 0
  %spec.select = select i1 %69, i32 0, i32 %63
  %70 = xor i1 %68, true
  %71 = xor i1 %69, true
  %72 = xor i1 %70, true
  %73 = xor i1 %71, true
  %74 = or i1 %72, %73
  %75 = icmp sgt i32 %spec.select, 0
  %spec.select65 = select i1 %75, i32 0, i32 %spec.select
  %76 = xor i1 %74, true
  %77 = xor i1 %75, true
  %78 = xor i1 %76, true
  %79 = xor i1 %77, true
  %80 = or i1 %78, %79
  br i1 %80, label %81, label %82

81:                                               ; preds = %.preheader
  store i32 %spec.select65, ptr @ans, align 4, !tbaa !5
  br label %82

82:                                               ; preds = %.preheader, %81
  %83 = add i32 %58, 4
  %exitcond.not.3 = icmp eq i32 %83, 1001
  br i1 %exitcond.not.3, label %._crit_edge29, label %.preheader, !llvm.loop !13

._crit_edge29:                                    ; preds = %.preheader.prol.loopexit, %82, %36
  %84 = phi i32 [ %37, %36 ], [ %.lcssa54.unr, %.preheader.prol.loopexit ], [ %spec.select65, %82 ]
  store i32 1001, ptr @hh, align 4, !tbaa !5
  br label %thread-pre-split._crit_edge

thread-pre-split._crit_edge:                      ; preds = %thread-pre-split, %._crit_edge29
  %85 = phi i32 [ %84, %._crit_edge29 ], [ %ans.promoted, %thread-pre-split ]
  %86 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %85)
  ret i32 0
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

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

attributes #0 = { mustprogress norecurse 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 = { 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 #2 = { inlinehint mustprogress 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 #3 = { 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++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.unroll.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}


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