; LLVM IR from tangjz/acm-icpc :: lydsy (2904)

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

@cnt = external dso_local global i32, align 4
@p = external dso_local global [65 x i64], align 16
@.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 [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.5 = 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z13decompositionx(i64 noundef) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt4sqrtIxEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i64 noundef) #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca i8, align 1
  %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
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  br label %13

13:                                               ; preds = %125, %123, %0
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = add nsw i32 %14, -1
  store i32 %15, ptr %2, align 4, !tbaa !5
  %16 = icmp ne i32 %14, 0
  br i1 %16, label %17, label %126

17:                                               ; preds = %13
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %3)
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %19 = load i64, ptr %3, align 8, !tbaa !9
  %20 = call noundef double @_ZSt4sqrtIxEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i64 noundef %19)
  %21 = fptosi double %20 to i64
  store i64 %21, ptr %4, align 8, !tbaa !9
  %22 = load i64, ptr %4, align 8, !tbaa !9
  %23 = load i64, ptr %4, align 8, !tbaa !9
  %24 = mul nsw i64 %22, %23
  %25 = load i64, ptr %3, align 8, !tbaa !9
  %26 = icmp eq i64 %24, %25
  br i1 %26, label %27, label %29

27:                                               ; preds = %17
  %28 = call i32 @puts(ptr noundef @.str.2)
  store i32 2, ptr %5, align 4
  br label %123, !llvm.loop !11

29:                                               ; preds = %17
  store i32 0, ptr @cnt, align 4, !tbaa !5
  %30 = load i64, ptr %3, align 8, !tbaa !9
  call void @_Z13decompositionx(i64 noundef %30)
  %31 = load i32, ptr @cnt, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds i64, ptr @p, i64 %32
  call void @_ZSt4sortIPxEvT_S1_(ptr noundef @p, ptr noundef %33)
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #6
  store i8 1, ptr %6, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  br label %34

34:                                               ; preds = %72, %29
  %35 = load i32, ptr %7, align 4, !tbaa !5
  %36 = load i32, ptr @cnt, align 4, !tbaa !5
  %37 = icmp sle i32 %35, %36
  br i1 %37, label %39, label %38

38:                                               ; preds = %34
  store i32 4, ptr %5, align 4
  br label %75

39:                                               ; preds = %34
  %40 = load i32, ptr %7, align 4, !tbaa !5
  %41 = icmp ne i32 %40, 0
  br i1 %41, label %42, label %56

42:                                               ; preds = %39
  %43 = load i32, ptr %7, align 4, !tbaa !5
  %44 = sub nsw i32 %43, 1
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [65 x i64], ptr @p, i64 0, i64 %45
  %47 = load i64, ptr %46, align 8, !tbaa !9
  %48 = load i32, ptr %7, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [65 x i64], ptr @p, i64 0, i64 %49
  %51 = load i64, ptr %50, align 8, !tbaa !9
  %52 = icmp eq i64 %47, %51
  br i1 %52, label %53, label %56

53:                                               ; preds = %42
  %54 = load i32, ptr %8, align 4, !tbaa !5
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr %8, align 4, !tbaa !5
  br label %71

56:                                               ; preds = %42, %39
  %57 = load i32, ptr %7, align 4, !tbaa !5
  %58 = sub nsw i32 %57, 1
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [65 x i64], ptr @p, i64 0, i64 %59
  %61 = load i64, ptr %60, align 8, !tbaa !9
  %62 = and i64 %61, 3
  %63 = icmp eq i64 %62, 3
  br i1 %63, label %64, label %69

64:                                               ; preds = %56
  %65 = load i32, ptr %8, align 4, !tbaa !5
  %66 = and i32 %65, 1
  %67 = icmp ne i32 %66, 0
  br i1 %67, label %68, label %69

68:                                               ; preds = %64
  store i8 0, ptr %6, align 1, !tbaa !13
  store i32 4, ptr %5, align 4
  br label %75

69:                                               ; preds = %64, %56
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %70

70:                                               ; preds = %69
  br label %71

71:                                               ; preds = %70, %53
  br label %72

72:                                               ; preds = %71
  %73 = load i32, ptr %7, align 4, !tbaa !5
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr %7, align 4, !tbaa !5
  br label %34, !llvm.loop !15

75:                                               ; preds = %68, %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %76

76:                                               ; preds = %75
  %77 = load i8, ptr %6, align 1, !tbaa !13, !range !16, !noundef !17
  %78 = trunc i8 %77 to i1
  br i1 %78, label %79, label %81

79:                                               ; preds = %76
  %80 = call i32 @puts(ptr noundef @.str.3)
  store i32 2, ptr %5, align 4
  br label %122, !llvm.loop !11

81:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 1, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %82

82:                                               ; preds = %108, %81
  %83 = load i32, ptr %11, align 4, !tbaa !5
  %84 = load i32, ptr @cnt, align 4, !tbaa !5
  %85 = icmp slt i32 %83, %84
  br i1 %85, label %87, label %86

86:                                               ; preds = %82
  store i32 7, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %111

87:                                               ; preds = %82
  %88 = load i32, ptr %11, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [65 x i64], ptr @p, i64 0, i64 %89
  %91 = load i64, ptr %90, align 8, !tbaa !9
  %92 = icmp eq i64 %91, 2
  br i1 %92, label %93, label %96

93:                                               ; preds = %87
  %94 = load i32, ptr %9, align 4, !tbaa !5
  %95 = xor i32 %94, 1
  store i32 %95, ptr %9, align 4, !tbaa !5
  br label %107

96:                                               ; preds = %87
  %97 = load i32, ptr %10, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = load i32, ptr %11, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [65 x i64], ptr @p, i64 0, i64 %100
  %102 = load i64, ptr %101, align 8, !tbaa !9
  %103 = and i64 %102, 7
  %104 = mul nsw i64 %98, %103
  %105 = and i64 %104, 7
  %106 = trunc i64 %105 to i32
  store i32 %106, ptr %10, align 4, !tbaa !5
  br label %107

107:                                              ; preds = %96, %93
  br label %108

108:                                              ; preds = %107
  %109 = load i32, ptr %11, align 4, !tbaa !5
  %110 = add nsw i32 %109, 1
  store i32 %110, ptr %11, align 4, !tbaa !5
  br label %82, !llvm.loop !18

111:                                              ; preds = %86
  %112 = load i32, ptr %9, align 4, !tbaa !5
  %113 = icmp ne i32 %112, 0
  br i1 %113, label %117, label %114

114:                                              ; preds = %111
  %115 = load i32, ptr %10, align 4, !tbaa !5
  %116 = icmp slt i32 %115, 7
  br i1 %116, label %117, label %119

117:                                              ; preds = %114, %111
  %118 = call i32 @puts(ptr noundef @.str.4)
  br label %121

119:                                              ; preds = %114
  %120 = call i32 @puts(ptr noundef @.str.5)
  br label %121

121:                                              ; preds = %119, %117
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  store i32 0, ptr %5, align 4
  br label %122

122:                                              ; preds = %121, %79
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #6
  br label %123

123:                                              ; preds = %122, %27
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  %124 = load i32, ptr %5, align 4
  switch i32 %124, label %128 [
    i32 0, label %125
    i32 2, label %13
  ]

125:                                              ; preds = %123
  br label %13, !llvm.loop !11

126:                                              ; preds = %13
  store i32 0, ptr %1, align 4
  store i32 1, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %127 = load i32, ptr %1, align 4
  ret i32 %127

128:                                              ; preds = %123
  unreachable
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #4

declare i32 @puts(ptr noundef) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPxEvT_S1_(ptr noundef, ptr noundef) #5

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { 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 = { 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 #4 = { "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 = { inlinehint mustprogress 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 #6 = { 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 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = distinct !{!15, !12}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = distinct !{!18, !12}


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

@cnt = external dso_local local_unnamed_addr global i32, align 4
@p = external dso_local global [65 x i64], align 16
@.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 [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.5 = 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z13decompositionx(i64 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt4sqrtIxEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  %3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %4 = load i32, ptr %1, align 4, !tbaa !5
  %5 = add nsw i32 %4, -1
  store i32 %5, ptr %1, align 4, !tbaa !5
  %.not44 = icmp eq i32 %4, 0
  br i1 %.not44, label %._crit_edge48, label %.lr.ph47

.lr.ph47:                                         ; preds = %0, %._crit_edge.thread
  %.02445 = phi i32 [ %.3, %._crit_edge.thread ], [ undef, %0 ]
  %6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %2)
  %7 = load i64, ptr %2, align 8, !tbaa !9
  %8 = call noundef double @_ZSt4sqrtIxEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i64 noundef %7)
  %9 = fptosi double %8 to i64
  %10 = mul nsw i64 %9, %9
  %11 = load i64, ptr %2, align 8, !tbaa !9
  %12 = icmp eq i64 %10, %11
  br i1 %12, label %._crit_edge.thread, label %13, !llvm.loop !11

13:                                               ; preds = %.lr.ph47
  store i32 0, ptr @cnt, align 4, !tbaa !5
  call void @_Z13decompositionx(i64 noundef %11)
  %14 = load i32, ptr @cnt, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds i64, ptr @p, i64 %15
  call void @_ZSt4sortIPxEvT_S1_(ptr noundef nonnull @p, ptr noundef nonnull %16)
  %17 = load i32, ptr @cnt, align 4, !tbaa !5
  %.not2935 = icmp slt i32 %17, 0
  br i1 %.not2935, label %.critedge, label %18

18:                                               ; preds = %13
  %19 = add nuw i32 %17, 1
  %wide.trip.count = zext i32 %19 to i64
  %.pre = load i64, ptr getelementptr inbounds (i8, ptr @p, i64 -8), align 8, !tbaa !9
  %20 = and i64 %.pre, 3
  %21 = icmp ne i64 %20, 3
  %22 = and i32 %.02445, 1
  %.not31.peel = icmp eq i32 %22, 0
  %or.cond32.peel = select i1 %21, i1 true, i1 %.not31.peel
  br i1 %or.cond32.peel, label %23, label %.preheader

23:                                               ; preds = %18
  %exitcond.peel.not = icmp eq i32 %17, 0
  br i1 %exitcond.peel.not, label %.critedge, label %.lr.ph.peel.next

.lr.ph.peel.next:                                 ; preds = %23, %37
  %indvars.iv = phi i64 [ %indvars.iv.next, %37 ], [ 1, %23 ]
  %.12537 = phi i32 [ %.2, %37 ], [ 1, %23 ]
  %24 = add nsw i64 %indvars.iv, -1
  %25 = getelementptr inbounds [65 x i64], ptr @p, i64 0, i64 %24
  %26 = load i64, ptr %25, align 8, !tbaa !9
  %27 = getelementptr inbounds [65 x i64], ptr @p, i64 0, i64 %indvars.iv
  %28 = load i64, ptr %27, align 8, !tbaa !9
  %29 = icmp eq i64 %26, %28
  br i1 %29, label %30, label %32

30:                                               ; preds = %.lr.ph.peel.next
  %31 = add nsw i32 %.12537, 1
  br label %37

32:                                               ; preds = %.lr.ph.peel.next
  %33 = and i64 %26, 3
  %34 = icmp ne i64 %33, 3
  %35 = and i32 %.12537, 1
  %.not31 = icmp eq i32 %35, 0
  %or.cond32 = select i1 %34, i1 true, i1 %.not31
  br i1 %or.cond32, label %37, label %.preheader

.preheader:                                       ; preds = %32, %18
  %.12537.lcssa = phi i32 [ %.02445, %18 ], [ %.12537, %32 ]
  %.not49 = icmp eq i32 %17, 0
  br i1 %.not49, label %._crit_edge.thread, label %.lr.ph41.preheader

.lr.ph41.preheader:                               ; preds = %.preheader
  %smax = call i32 @llvm.smax.i32(i32 %17, i32 1)
  %wide.trip.count56 = zext nneg i32 %smax to i64
  %xtraiter = and i64 %wide.trip.count56, 1
  %36 = icmp slt i32 %17, 2
  br i1 %36, label %._crit_edge.unr-lcssa, label %.lr.ph41.preheader.new

.lr.ph41.preheader.new:                           ; preds = %.lr.ph41.preheader
  %unroll_iter = and i64 %wide.trip.count56, 2147483646
  br label %.lr.ph41

37:                                               ; preds = %32, %30
  %.2 = phi i32 [ %31, %30 ], [ 1, %32 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.critedge, label %.lr.ph.peel.next, !llvm.loop !13

.critedge:                                        ; preds = %37, %23, %13
  %.125.lcssa = phi i32 [ %.02445, %13 ], [ 1, %23 ], [ %.2, %37 ]
  br label %._crit_edge.thread, !llvm.loop !11

._crit_edge.unr-lcssa:                            ; preds = %.lr.ph41, %.lr.ph41.preheader
  %.02238.lcssa.ph = phi i32 [ poison, %.lr.ph41.preheader ], [ %.123, %.lr.ph41 ]
  %.lcssa.ph = phi i32 [ poison, %.lr.ph41.preheader ], [ %60, %.lr.ph41 ]
  %.1.lcssa.ph = phi i32 [ poison, %.lr.ph41.preheader ], [ %.1.1, %.lr.ph41 ]
  %indvars.iv53.unr = phi i64 [ 0, %.lr.ph41.preheader ], [ %indvars.iv.next54.1, %.lr.ph41 ]
  %.02139.unr = phi i32 [ 1, %.lr.ph41.preheader ], [ %.1.1, %.lr.ph41 ]
  %.02238.unr = phi i32 [ 0, %.lr.ph41.preheader ], [ %.123.1, %.lr.ph41 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph41.epil

.lr.ph41.epil:                                    ; preds = %._crit_edge.unr-lcssa
  %38 = getelementptr inbounds [65 x i64], ptr @p, i64 0, i64 %indvars.iv53.unr
  %39 = load i64, ptr %38, align 8, !tbaa !9
  %40 = icmp eq i64 %39, 2
  %41 = trunc i64 %39 to i32
  %42 = mul i32 %.02139.unr, %41
  %43 = and i32 %42, 7
  %44 = zext i1 %40 to i32
  %.1.epil = select i1 %40, i32 %.02139.unr, i32 %43
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.unr-lcssa, %.lr.ph41.epil
  %.02238.lcssa = phi i32 [ %.02238.lcssa.ph, %._crit_edge.unr-lcssa ], [ %.02238.unr, %.lr.ph41.epil ]
  %.lcssa = phi i32 [ %.lcssa.ph, %._crit_edge.unr-lcssa ], [ %44, %.lr.ph41.epil ]
  %.1.lcssa = phi i32 [ %.1.lcssa.ph, %._crit_edge.unr-lcssa ], [ %.1.epil, %.lr.ph41.epil ]
  %45 = icmp ne i32 %.02238.lcssa, %.lcssa
  %46 = icmp slt i32 %.1.lcssa, 7
  %or.cond = select i1 %45, i1 true, i1 %46
  %spec.select = select i1 %or.cond, ptr @.str.4, ptr @.str.5
  br label %._crit_edge.thread

.lr.ph41:                                         ; preds = %.lr.ph41, %.lr.ph41.preheader.new
  %indvars.iv53 = phi i64 [ 0, %.lr.ph41.preheader.new ], [ %indvars.iv.next54.1, %.lr.ph41 ]
  %.02139 = phi i32 [ 1, %.lr.ph41.preheader.new ], [ %.1.1, %.lr.ph41 ]
  %.02238 = phi i32 [ 0, %.lr.ph41.preheader.new ], [ %.123.1, %.lr.ph41 ]
  %niter = phi i64 [ 0, %.lr.ph41.preheader.new ], [ %niter.next.1, %.lr.ph41 ]
  %47 = getelementptr inbounds [65 x i64], ptr @p, i64 0, i64 %indvars.iv53
  %48 = load i64, ptr %47, align 16, !tbaa !9
  %49 = icmp eq i64 %48, 2
  %50 = trunc i64 %48 to i32
  %51 = mul i32 %.02139, %50
  %52 = and i32 %51, 7
  %53 = zext i1 %49 to i32
  %.123 = xor i32 %.02238, %53
  %.1 = select i1 %49, i32 %.02139, i32 %52
  %indvars.iv.next54 = or disjoint i64 %indvars.iv53, 1
  %54 = getelementptr inbounds [65 x i64], ptr @p, i64 0, i64 %indvars.iv.next54
  %55 = load i64, ptr %54, align 8, !tbaa !9
  %56 = icmp eq i64 %55, 2
  %57 = trunc i64 %55 to i32
  %58 = mul i32 %.1, %57
  %59 = and i32 %58, 7
  %60 = zext i1 %56 to i32
  %.123.1 = xor i32 %.123, %60
  %.1.1 = select i1 %56, i32 %.1, i32 %59
  %indvars.iv.next54.1 = add nuw nsw i64 %indvars.iv53, 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.unr-lcssa, label %.lr.ph41, !llvm.loop !15

._crit_edge.thread:                               ; preds = %._crit_edge, %.preheader, %.lr.ph47, %.critedge
  %.str.3.sink = phi ptr [ @.str.3, %.critedge ], [ @.str.2, %.lr.ph47 ], [ @.str.4, %.preheader ], [ %spec.select, %._crit_edge ]
  %.3 = phi i32 [ %.125.lcssa, %.critedge ], [ %.02445, %.lr.ph47 ], [ %.12537.lcssa, %.preheader ], [ %.12537.lcssa, %._crit_edge ]
  %61 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.3.sink)
  %62 = load i32, ptr %1, align 4, !tbaa !5
  %63 = add nsw i32 %62, -1
  store i32 %63, ptr %1, align 4, !tbaa !5
  %.not = icmp eq i32 %62, 0
  br i1 %.not, label %._crit_edge48, label %.lr.ph47

._crit_edge48:                                    ; preds = %._crit_edge.thread, %0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0
}

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

; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPxEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #5

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { 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 = { 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 #4 = { 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 #5 = { inlinehint mustprogress 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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { 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 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12, !14}
!14 = !{!"llvm.loop.peeled.count", i32 1}
!15 = distinct !{!15, !12}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopFullUnrollPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass