; LLVM IR from DionysiosB/CodeForces :: 0001-0099 (96B-LuckyNumbersEasy)

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

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  store i64 0, ptr %2, align 8, !tbaa !5
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  %18 = load i64, ptr %2, align 8, !tbaa !5
  %19 = sitofp i64 %18 to double
  %20 = call double @log10(double noundef %19) #7
  %21 = fadd double 1.000000e+00, %20
  %22 = fptosi double %21 to i32
  store i32 %22, ptr %3, align 4, !tbaa !9
  %23 = load i32, ptr %3, align 4, !tbaa !9
  %24 = srem i32 %23, 2
  %25 = icmp eq i32 %24, 1
  br i1 %25, label %26, label %53

26:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 0, ptr %4, align 4, !tbaa !9
  br label %27

27:                                               ; preds = %36, %26
  %28 = load i32, ptr %4, align 4, !tbaa !9
  %29 = load i32, ptr %3, align 4, !tbaa !9
  %30 = add nsw i32 %29, 1
  %31 = sdiv i32 %30, 2
  %32 = icmp slt i32 %28, %31
  br i1 %32, label %34, label %33

33:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %39

34:                                               ; preds = %27
  %35 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  br label %36

36:                                               ; preds = %34
  %37 = load i32, ptr %4, align 4, !tbaa !9
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %4, align 4, !tbaa !9
  br label %27, !llvm.loop !11

39:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %40

40:                                               ; preds = %49, %39
  %41 = load i32, ptr %5, align 4, !tbaa !9
  %42 = load i32, ptr %3, align 4, !tbaa !9
  %43 = add nsw i32 %42, 1
  %44 = sdiv i32 %43, 2
  %45 = icmp slt i32 %41, %44
  br i1 %45, label %47, label %46

46:                                               ; preds = %40
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %52

47:                                               ; preds = %40
  %48 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  br label %49

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

52:                                               ; preds = %46
  br label %195

53:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  store i64 0, ptr %6, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %54

54:                                               ; preds = %64, %53
  %55 = load i32, ptr %7, align 4, !tbaa !9
  %56 = load i32, ptr %3, align 4, !tbaa !9
  %57 = sdiv i32 %56, 2
  %58 = icmp slt i32 %55, %57
  br i1 %58, label %60, label %59

59:                                               ; preds = %54
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %67

60:                                               ; preds = %54
  %61 = load i64, ptr %6, align 8, !tbaa !14
  %62 = mul nsw i64 10, %61
  %63 = add nsw i64 %62, 7
  store i64 %63, ptr %6, align 8, !tbaa !14
  br label %64

64:                                               ; preds = %60
  %65 = load i32, ptr %7, align 4, !tbaa !9
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %7, align 4, !tbaa !9
  br label %54, !llvm.loop !16

67:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %68

68:                                               ; preds = %78, %67
  %69 = load i32, ptr %8, align 4, !tbaa !9
  %70 = load i32, ptr %3, align 4, !tbaa !9
  %71 = sdiv i32 %70, 2
  %72 = icmp slt i32 %69, %71
  br i1 %72, label %74, label %73

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

74:                                               ; preds = %68
  %75 = load i64, ptr %6, align 8, !tbaa !14
  %76 = mul nsw i64 10, %75
  %77 = add nsw i64 %76, 4
  store i64 %77, ptr %6, align 8, !tbaa !14
  br label %78

78:                                               ; preds = %74
  %79 = load i32, ptr %8, align 4, !tbaa !9
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %8, align 4, !tbaa !9
  br label %68, !llvm.loop !17

81:                                               ; preds = %73
  %82 = load i64, ptr %2, align 8, !tbaa !5
  %83 = load i64, ptr %6, align 8, !tbaa !14
  %84 = icmp sgt i64 %82, %83
  br i1 %84, label %85, label %114

85:                                               ; preds = %81
  %86 = load i32, ptr %3, align 4, !tbaa !9
  %87 = add nsw i32 %86, 2
  store i32 %87, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %88

88:                                               ; preds = %97, %85
  %89 = load i32, ptr %9, align 4, !tbaa !9
  %90 = load i32, ptr %3, align 4, !tbaa !9
  %91 = add nsw i32 %90, 1
  %92 = sdiv i32 %91, 2
  %93 = icmp slt i32 %89, %92
  br i1 %93, label %95, label %94

94:                                               ; preds = %88
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %100

95:                                               ; preds = %88
  %96 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  br label %97

97:                                               ; preds = %95
  %98 = load i32, ptr %9, align 4, !tbaa !9
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %9, align 4, !tbaa !9
  br label %88, !llvm.loop !18

100:                                              ; preds = %94
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %101

101:                                              ; preds = %110, %100
  %102 = load i32, ptr %10, align 4, !tbaa !9
  %103 = load i32, ptr %3, align 4, !tbaa !9
  %104 = add nsw i32 %103, 1
  %105 = sdiv i32 %104, 2
  %106 = icmp slt i32 %102, %105
  br i1 %106, label %108, label %107

107:                                              ; preds = %101
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %113

108:                                              ; preds = %101
  %109 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  br label %110

110:                                              ; preds = %108
  %111 = load i32, ptr %10, align 4, !tbaa !9
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %10, align 4, !tbaa !9
  br label %101, !llvm.loop !19

113:                                              ; preds = %107
  br label %194

114:                                              ; preds = %81
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %115 = load i32, ptr %3, align 4, !tbaa !9
  %116 = sext i32 %115 to i64
  %117 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %116, i64 4)
  %118 = extractvalue { i64, i1 } %117, 1
  %119 = extractvalue { i64, i1 } %117, 0
  %120 = select i1 %118, i64 -1, i64 %119
  %121 = call noalias noundef nonnull ptr @_Znam(i64 noundef %120) #8
  store ptr %121, ptr %11, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %122

122:                                              ; preds = %133, %114
  %123 = load i32, ptr %12, align 4, !tbaa !9
  %124 = load i32, ptr %3, align 4, !tbaa !9
  %125 = sdiv i32 %124, 2
  %126 = icmp slt i32 %123, %125
  br i1 %126, label %128, label %127

127:                                              ; preds = %122
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %136

128:                                              ; preds = %122
  %129 = load ptr, ptr %11, align 8, !tbaa !20
  %130 = load i32, ptr %12, align 4, !tbaa !9
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds i32, ptr %129, i64 %131
  store i32 4, ptr %132, align 4, !tbaa !9
  br label %133

133:                                              ; preds = %128
  %134 = load i32, ptr %12, align 4, !tbaa !9
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %12, align 4, !tbaa !9
  br label %122, !llvm.loop !22

136:                                              ; preds = %127
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %137 = load i32, ptr %3, align 4, !tbaa !9
  %138 = sdiv i32 %137, 2
  store i32 %138, ptr %13, align 4, !tbaa !9
  br label %139

139:                                              ; preds = %149, %136
  %140 = load i32, ptr %13, align 4, !tbaa !9
  %141 = load i32, ptr %3, align 4, !tbaa !9
  %142 = icmp slt i32 %140, %141
  br i1 %142, label %144, label %143

143:                                              ; preds = %139
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %152

144:                                              ; preds = %139
  %145 = load ptr, ptr %11, align 8, !tbaa !20
  %146 = load i32, ptr %13, align 4, !tbaa !9
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds i32, ptr %145, i64 %147
  store i32 7, ptr %148, align 4, !tbaa !9
  br label %149

149:                                              ; preds = %144
  %150 = load i32, ptr %13, align 4, !tbaa !9
  %151 = add nsw i32 %150, 1
  store i32 %151, ptr %13, align 4, !tbaa !9
  br label %139, !llvm.loop !23

152:                                              ; preds = %143
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %153 = load i64, ptr %6, align 8, !tbaa !14
  store i64 %153, ptr %14, align 8, !tbaa !14
  br label %154

154:                                              ; preds = %184, %152
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  store i64 0, ptr %15, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %155

155:                                              ; preds = %170, %154
  %156 = load i32, ptr %16, align 4, !tbaa !9
  %157 = load i32, ptr %3, align 4, !tbaa !9
  %158 = icmp slt i32 %156, %157
  br i1 %158, label %160, label %159

159:                                              ; preds = %155
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %173

160:                                              ; preds = %155
  %161 = load i64, ptr %15, align 8, !tbaa !14
  %162 = mul nsw i64 10, %161
  %163 = load ptr, ptr %11, align 8, !tbaa !20
  %164 = load i32, ptr %16, align 4, !tbaa !9
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds i32, ptr %163, i64 %165
  %167 = load i32, ptr %166, align 4, !tbaa !9
  %168 = sext i32 %167 to i64
  %169 = add nsw i64 %162, %168
  store i64 %169, ptr %15, align 8, !tbaa !14
  br label %170

170:                                              ; preds = %160
  %171 = load i32, ptr %16, align 4, !tbaa !9
  %172 = add nsw i32 %171, 1
  store i32 %172, ptr %16, align 4, !tbaa !9
  br label %155, !llvm.loop !24

173:                                              ; preds = %159
  %174 = load i64, ptr %15, align 8, !tbaa !14
  %175 = load i64, ptr %2, align 8, !tbaa !5
  %176 = icmp sge i64 %174, %175
  br i1 %176, label %177, label %183

177:                                              ; preds = %173
  %178 = load i64, ptr %15, align 8, !tbaa !14
  %179 = load i64, ptr %14, align 8, !tbaa !14
  %180 = icmp slt i64 %178, %179
  br i1 %180, label %181, label %183

181:                                              ; preds = %177
  %182 = load i64, ptr %15, align 8, !tbaa !14
  store i64 %182, ptr %14, align 8, !tbaa !14
  br label %183

183:                                              ; preds = %181, %177, %173
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %184

184:                                              ; preds = %183
  %185 = load ptr, ptr %11, align 8, !tbaa !20
  %186 = load ptr, ptr %11, align 8, !tbaa !20
  %187 = load i32, ptr %3, align 4, !tbaa !9
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds i32, ptr %186, i64 %188
  %190 = call noundef zeroext i1 @_ZSt16next_permutationIPiEbT_S1_(ptr noundef %185, ptr noundef %189)
  br i1 %190, label %154, label %191, !llvm.loop !25

191:                                              ; preds = %184
  %192 = load i64, ptr %14, align 8, !tbaa !14
  %193 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i64 noundef %192)
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %194

194:                                              ; preds = %191, %113
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  br label %195

195:                                              ; preds = %194, %52
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  ret i32 0
}

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

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #4

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZSt16next_permutationIPiEbT_S1_(ptr noundef, ptr noundef) #6

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 = { 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 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nobuiltin allocsize(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 = { 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 #7 = { nounwind }
attributes #8 = { builtin allocsize(0) }

!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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !15, i64 0}
!15 = !{!"long long", !7, i64 0}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = !{!21, !21, i64 0}
!21 = !{!"any pointer", !7, i64 0}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !12}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !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"

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  store i64 0, ptr %1, align 8, !tbaa !5
  %2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %3 = load i64, ptr %1, align 8, !tbaa !5
  %4 = sitofp i64 %3 to double
  %5 = call double @log10(double noundef %4) #7
  %6 = fadd double %5, 1.000000e+00
  %7 = fptosi double %6 to i32
  %8 = and i32 %7, -2147483647
  %9 = icmp eq i32 %8, 1
  br i1 %9, label %.preheader65, label %.preheader72

.preheader72:                                     ; preds = %0
  %10 = sdiv i32 %7, 2
  %11 = icmp sgt i32 %7, 1
  br i1 %11, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %.preheader72
  %12 = add nsw i32 %10, -1
  %xtraiter = and i32 %10, 7
  %13 = icmp ult i32 %12, 7
  br i1 %13, label %.preheader71.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i32 %10, 1073741816
  br label %.lr.ph

.preheader65:                                     ; preds = %0
  %14 = add nuw i32 %7, 1
  %15 = lshr exact i32 %14, 1
  br label %16

16:                                               ; preds = %.preheader65, %16
  %.06098 = phi i32 [ 0, %.preheader65 ], [ %18, %16 ]
  %17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %18 = add nuw nsw i32 %.06098, 1
  %exitcond118.not = icmp eq i32 %18, %15
  br i1 %exitcond118.not, label %.preheader, label %16, !llvm.loop !9

.preheader:                                       ; preds = %16, %.preheader
  %.05999 = phi i32 [ %20, %.preheader ], [ 0, %16 ]
  %19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  %20 = add nuw nsw i32 %.05999, 1
  %exitcond119.not = icmp eq i32 %20, %15
  br i1 %exitcond119.not, label %.loopexit, label %.preheader, !llvm.loop !11

.preheader71.unr-lcssa:                           ; preds = %.lr.ph, %.lr.ph.preheader
  %.lcssa146.ph = phi i64 [ poison, %.lr.ph.preheader ], [ %25, %.lr.ph ]
  %.05775.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %25, %.lr.ph ]
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader71, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %.preheader71.unr-lcssa, %.lr.ph.epil
  %.05775.epil = phi i64 [ %22, %.lr.ph.epil ], [ %.05775.unr, %.preheader71.unr-lcssa ]
  %epil.iter = phi i32 [ %epil.iter.next, %.lr.ph.epil ], [ 0, %.preheader71.unr-lcssa ]
  %21 = mul nsw i64 %.05775.epil, 10
  %22 = add nsw i64 %21, 7
  %epil.iter.next = add i32 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i32 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.preheader71, label %.lr.ph.epil, !llvm.loop !12

.preheader71:                                     ; preds = %.lr.ph.epil, %.preheader71.unr-lcssa
  %.lcssa146 = phi i64 [ %.lcssa146.ph, %.preheader71.unr-lcssa ], [ %22, %.lr.ph.epil ]
  br i1 %11, label %.lr.ph80.preheader, label %._crit_edge

.lr.ph80.preheader:                               ; preds = %.preheader71
  %xtraiter148 = and i32 %10, 7
  %23 = icmp ult i32 %12, 7
  br i1 %23, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph80.preheader.new

.lr.ph80.preheader.new:                           ; preds = %.lr.ph80.preheader
  %unroll_iter152 = and i32 %10, 1073741816
  br label %.lr.ph80

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %.05775 = phi i64 [ 0, %.lr.ph.preheader.new ], [ %25, %.lr.ph ]
  %niter = phi i32 [ 0, %.lr.ph.preheader.new ], [ %niter.next.7, %.lr.ph ]
  %24 = mul i64 %.05775, 100000000
  %25 = add i64 %24, 77777777
  %niter.next.7 = add i32 %niter, 8
  %niter.ncmp.7 = icmp eq i32 %niter.next.7, %unroll_iter
  br i1 %niter.ncmp.7, label %.preheader71.unr-lcssa, label %.lr.ph, !llvm.loop !14

._crit_edge.loopexit.unr-lcssa:                   ; preds = %.lr.ph80, %.lr.ph80.preheader
  %.lcssa145.ph = phi i64 [ poison, %.lr.ph80.preheader ], [ %34, %.lr.ph80 ]
  %.15878.unr = phi i64 [ %.lcssa146, %.lr.ph80.preheader ], [ %34, %.lr.ph80 ]
  %lcmp.mod150.not = icmp eq i32 %xtraiter148, 0
  br i1 %lcmp.mod150.not, label %._crit_edge, label %.lr.ph80.epil

.lr.ph80.epil:                                    ; preds = %._crit_edge.loopexit.unr-lcssa, %.lr.ph80.epil
  %.15878.epil = phi i64 [ %27, %.lr.ph80.epil ], [ %.15878.unr, %._crit_edge.loopexit.unr-lcssa ]
  %epil.iter149 = phi i32 [ %epil.iter149.next, %.lr.ph80.epil ], [ 0, %._crit_edge.loopexit.unr-lcssa ]
  %26 = mul nsw i64 %.15878.epil, 10
  %27 = add nsw i64 %26, 4
  %epil.iter149.next = add i32 %epil.iter149, 1
  %epil.iter149.cmp.not = icmp eq i32 %epil.iter149.next, %xtraiter148
  br i1 %epil.iter149.cmp.not, label %._crit_edge, label %.lr.ph80.epil, !llvm.loop !15

._crit_edge:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %.lr.ph80.epil, %.preheader72, %.preheader71
  %.158.lcssa = phi i64 [ %.lcssa146, %.preheader71 ], [ 0, %.preheader72 ], [ %.lcssa145.ph, %._crit_edge.loopexit.unr-lcssa ], [ %27, %.lr.ph80.epil ]
  %28 = load i64, ptr %1, align 8, !tbaa !5
  %29 = icmp sgt i64 %28, %.158.lcssa
  br i1 %29, label %.preheader68, label %39

.preheader68:                                     ; preds = %._crit_edge
  %30 = add nsw i32 %7, 3
  %31 = sdiv i32 %30, 2
  %32 = icmp sgt i32 %7, -2
  br i1 %32, label %.lr.ph94.preheader, label %.loopexit

.lr.ph94.preheader:                               ; preds = %.preheader68
  %smax = call i32 @llvm.smax.i32(i32 %31, i32 1)
  br label %.lr.ph94

.lr.ph80:                                         ; preds = %.lr.ph80, %.lr.ph80.preheader.new
  %.15878 = phi i64 [ %.lcssa146, %.lr.ph80.preheader.new ], [ %34, %.lr.ph80 ]
  %niter153 = phi i32 [ 0, %.lr.ph80.preheader.new ], [ %niter153.next.7, %.lr.ph80 ]
  %33 = mul i64 %.15878, 100000000
  %34 = add i64 %33, 44444444
  %niter153.next.7 = add i32 %niter153, 8
  %niter153.ncmp.7 = icmp eq i32 %niter153.next.7, %unroll_iter152
  br i1 %niter153.ncmp.7, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph80, !llvm.loop !16

.preheader66:                                     ; preds = %.lr.ph94
  br i1 %32, label %.lr.ph97.preheader, label %.loopexit

.lr.ph97.preheader:                               ; preds = %.preheader66
  %smax116 = call i32 @llvm.smax.i32(i32 %31, i32 1)
  br label %.lr.ph97

.lr.ph94:                                         ; preds = %.lr.ph94.preheader, %.lr.ph94
  %.05493 = phi i32 [ %36, %.lr.ph94 ], [ 0, %.lr.ph94.preheader ]
  %35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %36 = add nuw nsw i32 %.05493, 1
  %exitcond115.not = icmp eq i32 %36, %smax
  br i1 %exitcond115.not, label %.preheader66, label %.lr.ph94, !llvm.loop !17

.lr.ph97:                                         ; preds = %.lr.ph97.preheader, %.lr.ph97
  %.05396 = phi i32 [ %38, %.lr.ph97 ], [ 0, %.lr.ph97.preheader ]
  %37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  %38 = add nuw nsw i32 %.05396, 1
  %exitcond117.not = icmp eq i32 %38, %smax116
  br i1 %exitcond117.not, label %.loopexit, label %.lr.ph97, !llvm.loop !18

39:                                               ; preds = %._crit_edge
  %40 = sext i32 %7 to i64
  %41 = icmp slt i32 %7, 0
  %42 = shl nsw i64 %40, 2
  %43 = select i1 %41, i64 -1, i64 %42
  %44 = call noalias noundef nonnull ptr @_Znam(i64 noundef %43) #8
  br i1 %11, label %.lr.ph84.preheader, label %.preheader70

.lr.ph84.preheader:                               ; preds = %39
  %wide.trip.count = zext nneg i32 %10 to i64
  %min.iters.check = icmp ult i32 %10, 8
  br i1 %min.iters.check, label %.lr.ph84.preheader144, label %vector.ph

.lr.ph84.preheader144:                            ; preds = %middle.block, %.lr.ph84.preheader
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph84.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph84

vector.ph:                                        ; preds = %.lr.ph84.preheader
  %n.vec = and i64 %wide.trip.count, 1073741816
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %45 = getelementptr inbounds i32, ptr %44, i64 %index
  %46 = getelementptr inbounds i8, ptr %45, i64 16
  store <4 x i32> <i32 4, i32 4, i32 4, i32 4>, ptr %45, align 4, !tbaa !19
  store <4 x i32> <i32 4, i32 4, i32 4, i32 4>, ptr %46, align 4, !tbaa !19
  %index.next = add nuw i64 %index, 8
  %47 = icmp eq i64 %index.next, %n.vec
  br i1 %47, label %middle.block, label %vector.body, !llvm.loop !21

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %.preheader70, label %.lr.ph84.preheader144

.preheader70:                                     ; preds = %.lr.ph84, %middle.block, %39
  %48 = icmp sgt i32 %7, 0
  br i1 %48, label %.lr.ph86.preheader, label %.preheader69.thread

.preheader69.thread:                              ; preds = %.preheader70
  %49 = getelementptr inbounds i32, ptr %44, i64 %40
  br label %.preheader69.split.preheader

.lr.ph86.preheader:                               ; preds = %.preheader70
  %50 = zext nneg i32 %10 to i64
  %51 = add nuw nsw i64 %50, 1
  %smax129 = call i64 @llvm.smax.i64(i64 %51, i64 %40)
  %52 = sub nsw i64 %smax129, %50
  %min.iters.check132 = icmp ult i64 %52, 8
  br i1 %min.iters.check132, label %.lr.ph86.preheader143, label %vector.ph133

.lr.ph86.preheader143:                            ; preds = %middle.block130, %.lr.ph86.preheader
  %indvars.iv107.ph = phi i64 [ %50, %.lr.ph86.preheader ], [ %ind.end, %middle.block130 ]
  br label %.lr.ph86

vector.ph133:                                     ; preds = %.lr.ph86.preheader
  %n.vec135 = and i64 %52, -8
  %ind.end = add nsw i64 %n.vec135, %50
  %invariant.gep = getelementptr i32, ptr %44, i64 %50
  br label %vector.body137

vector.body137:                                   ; preds = %vector.body137, %vector.ph133
  %index138 = phi i64 [ 0, %vector.ph133 ], [ %index.next139, %vector.body137 ]
  %gep = getelementptr i32, ptr %invariant.gep, i64 %index138
  %53 = getelementptr inbounds i8, ptr %gep, i64 16
  store <4 x i32> <i32 7, i32 7, i32 7, i32 7>, ptr %gep, align 4, !tbaa !19
  store <4 x i32> <i32 7, i32 7, i32 7, i32 7>, ptr %53, align 4, !tbaa !19
  %index.next139 = add nuw i64 %index138, 8
  %54 = icmp eq i64 %index.next139, %n.vec135
  br i1 %54, label %middle.block130, label %vector.body137, !llvm.loop !24

middle.block130:                                  ; preds = %vector.body137
  %cmp.n140 = icmp eq i64 %52, %n.vec135
  br i1 %cmp.n140, label %.preheader69, label %.lr.ph86.preheader143

.lr.ph84:                                         ; preds = %.lr.ph84.preheader144, %.lr.ph84
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph84 ], [ %indvars.iv.ph, %.lr.ph84.preheader144 ]
  %55 = getelementptr inbounds i32, ptr %44, i64 %indvars.iv
  store i32 4, ptr %55, align 4, !tbaa !19
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond106.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond106.not, label %.preheader70, label %.lr.ph84, !llvm.loop !25

.preheader69:                                     ; preds = %.lr.ph86, %middle.block130
  %56 = getelementptr inbounds i32, ptr %44, i64 %40
  br i1 %48, label %.lr.ph90.us.preheader, label %.preheader69.split.preheader

.preheader69.split.preheader:                     ; preds = %.preheader69.thread, %.preheader69
  %57 = phi ptr [ %49, %.preheader69.thread ], [ %56, %.preheader69 ]
  br label %.preheader69.split

.lr.ph90.us.preheader:                            ; preds = %.preheader69
  %wide.trip.count113 = zext nneg i32 %7 to i64
  %xtraiter154 = and i64 %wide.trip.count113, 3
  %58 = icmp ult i32 %7, 4
  %unroll_iter158 = and i64 %wide.trip.count113, 2147483644
  %lcmp.mod156.not = icmp eq i64 %xtraiter154, 0
  br label %.lr.ph90.us

.lr.ph90.us:                                      ; preds = %.lr.ph90.us.preheader, %._crit_edge91.us
  %.050.us = phi i64 [ %.1.us, %._crit_edge91.us ], [ %.158.lcssa, %.lr.ph90.us.preheader ]
  br i1 %58, label %._crit_edge91.us.unr-lcssa, label %.lr.ph90.us.new

.lr.ph90.us.new:                                  ; preds = %.lr.ph90.us, %.lr.ph90.us.new
  %indvars.iv110 = phi i64 [ %indvars.iv.next111.3, %.lr.ph90.us.new ], [ 0, %.lr.ph90.us ]
  %.04987.us = phi i64 [ %78, %.lr.ph90.us.new ], [ 0, %.lr.ph90.us ]
  %niter159 = phi i64 [ %niter159.next.3, %.lr.ph90.us.new ], [ 0, %.lr.ph90.us ]
  %59 = mul nsw i64 %.04987.us, 10
  %60 = getelementptr inbounds i32, ptr %44, i64 %indvars.iv110
  %61 = load i32, ptr %60, align 4, !tbaa !19
  %62 = sext i32 %61 to i64
  %63 = add nsw i64 %59, %62
  %indvars.iv.next111 = or disjoint i64 %indvars.iv110, 1
  %64 = mul nsw i64 %63, 10
  %65 = getelementptr inbounds i32, ptr %44, i64 %indvars.iv.next111
  %66 = load i32, ptr %65, align 4, !tbaa !19
  %67 = sext i32 %66 to i64
  %68 = add nsw i64 %64, %67
  %indvars.iv.next111.1 = or disjoint i64 %indvars.iv110, 2
  %69 = mul nsw i64 %68, 10
  %70 = getelementptr inbounds i32, ptr %44, i64 %indvars.iv.next111.1
  %71 = load i32, ptr %70, align 4, !tbaa !19
  %72 = sext i32 %71 to i64
  %73 = add nsw i64 %69, %72
  %indvars.iv.next111.2 = or disjoint i64 %indvars.iv110, 3
  %74 = mul nsw i64 %73, 10
  %75 = getelementptr inbounds i32, ptr %44, i64 %indvars.iv.next111.2
  %76 = load i32, ptr %75, align 4, !tbaa !19
  %77 = sext i32 %76 to i64
  %78 = add nsw i64 %74, %77
  %indvars.iv.next111.3 = add nuw nsw i64 %indvars.iv110, 4
  %niter159.next.3 = add i64 %niter159, 4
  %niter159.ncmp.3 = icmp eq i64 %niter159.next.3, %unroll_iter158
  br i1 %niter159.ncmp.3, label %._crit_edge91.us.unr-lcssa, label %.lr.ph90.us.new, !llvm.loop !26

._crit_edge91.us.unr-lcssa:                       ; preds = %.lr.ph90.us.new, %.lr.ph90.us
  %.lcssa.ph = phi i64 [ poison, %.lr.ph90.us ], [ %78, %.lr.ph90.us.new ]
  %indvars.iv110.unr = phi i64 [ 0, %.lr.ph90.us ], [ %indvars.iv.next111.3, %.lr.ph90.us.new ]
  %.04987.us.unr = phi i64 [ 0, %.lr.ph90.us ], [ %78, %.lr.ph90.us.new ]
  br i1 %lcmp.mod156.not, label %._crit_edge91.us, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge91.us.unr-lcssa, %.epil.preheader
  %indvars.iv110.epil = phi i64 [ %indvars.iv.next111.epil, %.epil.preheader ], [ %indvars.iv110.unr, %._crit_edge91.us.unr-lcssa ]
  %.04987.us.epil = phi i64 [ %83, %.epil.preheader ], [ %.04987.us.unr, %._crit_edge91.us.unr-lcssa ]
  %epil.iter155 = phi i64 [ %epil.iter155.next, %.epil.preheader ], [ 0, %._crit_edge91.us.unr-lcssa ]
  %79 = mul nsw i64 %.04987.us.epil, 10
  %80 = getelementptr inbounds i32, ptr %44, i64 %indvars.iv110.epil
  %81 = load i32, ptr %80, align 4, !tbaa !19
  %82 = sext i32 %81 to i64
  %83 = add nsw i64 %79, %82
  %indvars.iv.next111.epil = add nuw nsw i64 %indvars.iv110.epil, 1
  %epil.iter155.next = add i64 %epil.iter155, 1
  %epil.iter155.cmp.not = icmp eq i64 %epil.iter155.next, %xtraiter154
  br i1 %epil.iter155.cmp.not, label %._crit_edge91.us, label %.epil.preheader, !llvm.loop !27

._crit_edge91.us:                                 ; preds = %.epil.preheader, %._crit_edge91.us.unr-lcssa
  %.lcssa = phi i64 [ %.lcssa.ph, %._crit_edge91.us.unr-lcssa ], [ %83, %.epil.preheader ]
  %84 = load i64, ptr %1, align 8, !tbaa !5
  %.not.not.us = icmp slt i64 %.lcssa, %84
  %85 = call i64 @llvm.smin.i64(i64 %.lcssa, i64 %.050.us)
  %.1.us = select i1 %.not.not.us, i64 %.050.us, i64 %85
  %86 = call noundef zeroext i1 @_ZSt16next_permutationIPiEbT_S1_(ptr noundef nonnull %44, ptr noundef nonnull %56)
  br i1 %86, label %.lr.ph90.us, label %.split.us, !llvm.loop !28

.lr.ph86:                                         ; preds = %.lr.ph86.preheader143, %.lr.ph86
  %indvars.iv107 = phi i64 [ %indvars.iv.next108, %.lr.ph86 ], [ %indvars.iv107.ph, %.lr.ph86.preheader143 ]
  %87 = getelementptr inbounds i32, ptr %44, i64 %indvars.iv107
  store i32 7, ptr %87, align 4, !tbaa !19
  %indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1
  %88 = icmp slt i64 %indvars.iv.next108, %40
  br i1 %88, label %.lr.ph86, label %.preheader69, !llvm.loop !29

.preheader69.split:                               ; preds = %.preheader69.split.preheader, %.preheader69.split
  %.050 = phi i64 [ %.1, %.preheader69.split ], [ %.158.lcssa, %.preheader69.split.preheader ]
  %89 = load i64, ptr %1, align 8, !tbaa !5
  %.not.not = icmp sgt i64 %89, 0
  %90 = call i64 @llvm.smin.i64(i64 %.050, i64 0)
  %.1 = select i1 %.not.not, i64 %.050, i64 %90
  %91 = call noundef zeroext i1 @_ZSt16next_permutationIPiEbT_S1_(ptr noundef nonnull %44, ptr noundef nonnull %57)
  br i1 %91, label %.preheader69.split, label %.split.us, !llvm.loop !28

.split.us:                                        ; preds = %.preheader69.split, %._crit_edge91.us
  %.us-phi = phi i64 [ %.1.us, %._crit_edge91.us ], [ %.1, %.preheader69.split ]
  %92 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %.us-phi)
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph97, %.preheader, %.preheader68, %.preheader66, %.split.us
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  ret i32 0
}

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

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

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

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

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZSt16next_permutationIPiEbT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #5

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

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

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

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { nobuiltin allocsize(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 = { 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 }
attributes #8 = { builtin allocsize(0) }

!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 = !{!"long", !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, !13}
!13 = !{!"llvm.loop.unroll.disable"}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = !{!20, !20, i64 0}
!20 = !{!"int", !7, i64 0}
!21 = distinct !{!21, !10, !22, !23}
!22 = !{!"llvm.loop.isvectorized", i32 1}
!23 = !{!"llvm.loop.unroll.runtime.disable"}
!24 = distinct !{!24, !10, !22, !23}
!25 = distinct !{!25, !10, !23, !22}
!26 = distinct !{!26, !10}
!27 = distinct !{!27, !13}
!28 = distinct !{!28, !10}
!29 = distinct !{!29, !10, !23, !22}


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