; LLVM IR from tangjz/acm-icpc :: projecteuler (593)

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

@tot = external dso_local global i32, align 4
@pr = external dso_local global [10000001 x i32], align 16
@d = external dso_local global [179424675 x i32], align 16
@s = external dso_local global [2 x [10000001 x i32]], align 16
@bit = external dso_local global [20013 x i32], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z7mod_powii(i32 noundef, i32 noundef) #0

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z7bit_addii(i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z7bit_quei(i32 noundef) #0

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

12:                                               ; preds = %86, %0
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = icmp slt i32 %13, 179424675
  br i1 %14, label %16, label %15

15:                                               ; preds = %12
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %89

16:                                               ; preds = %12
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [179424675 x i32], ptr @d, i64 0, i64 %18
  %20 = load i32, ptr %19, align 4, !tbaa !5
  %21 = icmp ne i32 %20, 0
  br i1 %21, label %51, label %22

22:                                               ; preds = %16
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [179424675 x i32], ptr @d, i64 0, i64 %25
  store i32 %23, ptr %26, align 4, !tbaa !5
  %27 = load i32, ptr @tot, align 4, !tbaa !5
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr @tot, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [10000001 x i32], ptr @pr, i64 0, i64 %29
  store i32 %23, ptr %30, align 4, !tbaa !5
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = load i32, ptr @tot, align 4, !tbaa !5
  %33 = call noundef i32 @_Z7mod_powii(i32 noundef %31, i32 noundef %32)
  %34 = load i32, ptr @tot, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [10000001 x i32], ptr @s, i64 0, i64 %35
  store i32 %33, ptr %36, align 4, !tbaa !5
  %37 = load i32, ptr @tot, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [10000001 x i32], ptr @s, i64 0, i64 %38
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %41 = load i32, ptr @tot, align 4, !tbaa !5
  %42 = sdiv i32 %41, 10000
  %43 = add nsw i32 %42, 1
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [10000001 x i32], ptr @s, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = add nsw i32 %40, %46
  %48 = load i32, ptr @tot, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [10000001 x i32], ptr getelementptr inbounds ([2 x [10000001 x i32]], ptr @s, i64 0, i64 1), i64 0, i64 %49
  store i32 %47, ptr %50, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %22, %16
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %52

52:                                               ; preds = %81, %51
  %53 = load i32, ptr %2, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = load i32, ptr %5, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [10000001 x i32], ptr @pr, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = mul nsw i64 %54, %59
  store i64 %60, ptr %4, align 8, !tbaa !9
  %61 = icmp slt i64 %60, 179424675
  br i1 %61, label %63, label %62

62:                                               ; preds = %52
  store i32 5, ptr %3, align 4
  br label %84

63:                                               ; preds = %52
  %64 = load i32, ptr %5, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [10000001 x i32], ptr @pr, i64 0, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = load i64, ptr %4, align 8, !tbaa !9
  %69 = getelementptr inbounds [179424675 x i32], ptr @d, i64 0, i64 %68
  store i32 %67, ptr %69, align 4, !tbaa !5
  %70 = load i32, ptr %2, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [179424675 x i32], ptr @d, i64 0, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = load i32, ptr %5, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [10000001 x i32], ptr @pr, i64 0, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = icmp eq i32 %73, %77
  br i1 %78, label %79, label %80

79:                                               ; preds = %63
  store i32 5, ptr %3, align 4
  br label %84

80:                                               ; preds = %63
  br label %81

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

84:                                               ; preds = %79, %62
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %85

85:                                               ; preds = %84
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  br label %86

86:                                               ; preds = %85
  %87 = load i32, ptr %2, align 4, !tbaa !5
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr %2, align 4, !tbaa !5
  br label %12, !llvm.loop !13

89:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  br label %90

90:                                               ; preds = %142, %89
  %91 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %6, ptr noundef %7)
  %92 = icmp eq i32 %91, 2
  br i1 %92, label %93, label %151

93:                                               ; preds = %90
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  store i64 0, ptr %8, align 8, !tbaa !9
  call void @llvm.memset.p0.i64(ptr align 16 @bit, i8 0, i64 80052, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %94

94:                                               ; preds = %104, %93
  %95 = load i32, ptr %9, align 4, !tbaa !5
  %96 = load i32, ptr %7, align 4, !tbaa !5
  %97 = icmp slt i32 %95, %96
  br i1 %97, label %99, label %98

98:                                               ; preds = %94
  store i32 10, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %107

99:                                               ; preds = %94
  %100 = load i32, ptr %9, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [10000001 x i32], ptr getelementptr inbounds ([2 x [10000001 x i32]], ptr @s, i64 0, i64 1), i64 0, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !5
  call void @_Z7bit_addii(i32 noundef %103, i32 noundef 1)
  br label %104

104:                                              ; preds = %99
  %105 = load i32, ptr %9, align 4, !tbaa !5
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %9, align 4, !tbaa !5
  br label %94, !llvm.loop !14

107:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %108 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %108, ptr %10, align 4, !tbaa !5
  br label %109

109:                                              ; preds = %139, %107
  %110 = load i32, ptr %10, align 4, !tbaa !5
  %111 = load i32, ptr %6, align 4, !tbaa !5
  %112 = icmp sle i32 %110, %111
  br i1 %112, label %114, label %113

113:                                              ; preds = %109
  store i32 13, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %142

114:                                              ; preds = %109
  %115 = load i32, ptr %10, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [10000001 x i32], ptr getelementptr inbounds ([2 x [10000001 x i32]], ptr @s, i64 0, i64 1), i64 0, i64 %116
  %118 = load i32, ptr %117, align 4, !tbaa !5
  call void @_Z7bit_addii(i32 noundef %118, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %119 = load i64, ptr %8, align 8, !tbaa !9
  store i64 %119, ptr %11, align 8, !tbaa !9
  %120 = load i32, ptr %7, align 4, !tbaa !5
  %121 = add nsw i32 %120, 1
  %122 = ashr i32 %121, 1
  %123 = call noundef i32 @_Z7bit_quei(i32 noundef %122)
  %124 = load i32, ptr %7, align 4, !tbaa !5
  %125 = add nsw i32 %124, 2
  %126 = ashr i32 %125, 1
  %127 = call noundef i32 @_Z7bit_quei(i32 noundef %126)
  %128 = add nsw i32 %123, %127
  %129 = sext i32 %128 to i64
  %130 = load i64, ptr %8, align 8, !tbaa !9
  %131 = add nsw i64 %130, %129
  store i64 %131, ptr %8, align 8, !tbaa !9
  %132 = load i32, ptr %10, align 4, !tbaa !5
  %133 = load i32, ptr %7, align 4, !tbaa !5
  %134 = sub nsw i32 %132, %133
  %135 = add nsw i32 %134, 1
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [10000001 x i32], ptr getelementptr inbounds ([2 x [10000001 x i32]], ptr @s, i64 0, i64 1), i64 0, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !5
  call void @_Z7bit_addii(i32 noundef %138, i32 noundef -1)
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %139

139:                                              ; preds = %114
  %140 = load i32, ptr %10, align 4, !tbaa !5
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %10, align 4, !tbaa !5
  br label %109, !llvm.loop !15

142:                                              ; preds = %113
  %143 = load i64, ptr %8, align 8, !tbaa !9
  %144 = ashr i64 %143, 1
  %145 = load i64, ptr %8, align 8, !tbaa !9
  %146 = and i64 %145, 1
  %147 = getelementptr inbounds [3 x i8], ptr @.str.2, i64 0, i64 %146
  %148 = load i8, ptr %147, align 1, !tbaa !16
  %149 = sext i8 %148 to i32
  %150 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %144, i32 noundef %149)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %90, !llvm.loop !17

151:                                              ; preds = %90
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  %152 = load i32, ptr %1, align 4
  ret i32 %152
}

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { "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 nounwind willreturn memory(argmem: write) }
attributes #5 = { 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 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = !{!7, !7, i64 0}
!17 = distinct !{!17, !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"

@tot = external dso_local local_unnamed_addr global i32, align 4
@pr = external dso_local local_unnamed_addr global [10000001 x i32], align 16
@d = external dso_local local_unnamed_addr global [179424675 x i32], align 16
@s = external dso_local local_unnamed_addr global [2 x [10000001 x i32]], align 16
@bit = external dso_local local_unnamed_addr global [20013 x i32], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z7mod_powii(i32 noundef, i32 noundef) local_unnamed_addr #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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z7bit_addii(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z7bit_quei(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  br label %6

3:                                                ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %5 = icmp eq i32 %4, 2
  br i1 %5, label %.lr.ph45, label %._crit_edge46

6:                                                ; preds = %0, %._crit_edge
  %indvars.iv50 = phi i64 [ 2, %0 ], [ %indvars.iv.next51, %._crit_edge ]
  %7 = getelementptr inbounds [179424675 x i32], ptr @d, i64 0, i64 %indvars.iv50
  %8 = load i32, ptr %7, align 4, !tbaa !5
  %.not31 = icmp eq i32 %8, 0
  br i1 %.not31, label %9, label %26

9:                                                ; preds = %6
  %10 = trunc nuw nsw i64 %indvars.iv50 to i32
  store i32 %10, ptr %7, align 4, !tbaa !5
  %11 = load i32, ptr @tot, align 4, !tbaa !5
  %12 = add nsw i32 %11, 1
  store i32 %12, ptr @tot, align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  %14 = getelementptr inbounds [10000001 x i32], ptr @pr, i64 0, i64 %13
  store i32 %10, ptr %14, align 4, !tbaa !5
  %15 = tail call noundef i32 @_Z7mod_powii(i32 noundef %10, i32 noundef %12)
  %16 = load i32, ptr @tot, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds [10000001 x i32], ptr @s, i64 0, i64 %17
  store i32 %15, ptr %18, align 4, !tbaa !5
  %19 = sdiv i32 %16, 10000
  %20 = add nsw i32 %19, 1
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [10000001 x i32], ptr @s, i64 0, i64 %21
  %23 = load i32, ptr %22, align 4, !tbaa !5
  %24 = add nsw i32 %23, %15
  %25 = getelementptr inbounds [10000001 x i32], ptr getelementptr inbounds (i8, ptr @s, i64 40000004), i64 0, i64 %17
  store i32 %24, ptr %25, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %9, %6
  %27 = load i32, ptr getelementptr inbounds (i8, ptr @pr, i64 4), align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = mul nsw i64 %indvars.iv50, %28
  %30 = icmp slt i64 %29, 179424675
  br i1 %30, label %.lr.ph, label %._crit_edge

31:                                               ; preds = %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %32 = getelementptr inbounds [10000001 x i32], ptr @pr, i64 0, i64 %indvars.iv.next
  %33 = load i32, ptr %32, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = mul nsw i64 %indvars.iv50, %34
  %36 = icmp slt i64 %35, 179424675
  br i1 %36, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.lr.ph:                                           ; preds = %26, %31
  %indvars.iv = phi i64 [ %indvars.iv.next, %31 ], [ 1, %26 ]
  %37 = phi i64 [ %35, %31 ], [ %29, %26 ]
  %38 = phi i32 [ %33, %31 ], [ %27, %26 ]
  %39 = getelementptr inbounds [179424675 x i32], ptr @d, i64 0, i64 %37
  store i32 %38, ptr %39, align 4, !tbaa !5
  %40 = load i32, ptr %7, align 4, !tbaa !5
  %41 = icmp eq i32 %40, %38
  br i1 %41, label %._crit_edge, label %31

._crit_edge:                                      ; preds = %31, %.lr.ph, %26
  %indvars.iv.next51 = add nuw nsw i64 %indvars.iv50, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next51, 179424675
  br i1 %exitcond.not, label %3, label %6, !llvm.loop !11

.lr.ph45:                                         ; preds = %3, %._crit_edge42
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(80052) @bit, i8 0, i64 80052, i1 false)
  %42 = load i32, ptr %2, align 4, !tbaa !5
  %43 = icmp sgt i32 %42, 1
  br i1 %43, label %.lr.ph37, label %.preheader

.preheader:                                       ; preds = %.lr.ph37, %.lr.ph45
  %.lcssa = phi i32 [ %42, %.lr.ph45 ], [ %48, %.lr.ph37 ]
  %44 = load i32, ptr %1, align 4, !tbaa !5
  %.not38 = icmp sgt i32 %.lcssa, %44
  br i1 %.not38, label %._crit_edge42, label %.lr.ph41.preheader

.lr.ph41.preheader:                               ; preds = %.preheader
  %45 = sext i32 %.lcssa to i64
  br label %.lr.ph41

.lr.ph37:                                         ; preds = %.lr.ph45, %.lr.ph37
  %indvars.iv53 = phi i64 [ %indvars.iv.next54, %.lr.ph37 ], [ 1, %.lr.ph45 ]
  %46 = getelementptr inbounds [10000001 x i32], ptr getelementptr inbounds (i8, ptr @s, i64 40000004), i64 0, i64 %indvars.iv53
  %47 = load i32, ptr %46, align 4, !tbaa !5
  call void @_Z7bit_addii(i32 noundef %47, i32 noundef 1)
  %indvars.iv.next54 = add nuw nsw i64 %indvars.iv53, 1
  %48 = load i32, ptr %2, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = icmp slt i64 %indvars.iv.next54, %49
  br i1 %50, label %.lr.ph37, label %.preheader, !llvm.loop !12

._crit_edge42:                                    ; preds = %.lr.ph41, %.preheader
  %.026.lcssa = phi i64 [ 0, %.preheader ], [ %71, %.lr.ph41 ]
  %51 = ashr i64 %.026.lcssa, 1
  %52 = and i64 %.026.lcssa, 1
  %53 = getelementptr inbounds [3 x i8], ptr @.str.2, i64 0, i64 %52
  %54 = load i8, ptr %53, align 1, !tbaa !13
  %55 = sext i8 %54 to i32
  %56 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %51, i32 noundef %55)
  %57 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %58 = icmp eq i32 %57, 2
  br i1 %58, label %.lr.ph45, label %._crit_edge46, !llvm.loop !14

.lr.ph41:                                         ; preds = %.lr.ph41.preheader, %.lr.ph41
  %indvars.iv56 = phi i64 [ %45, %.lr.ph41.preheader ], [ %indvars.iv.next57, %.lr.ph41 ]
  %.02639 = phi i64 [ 0, %.lr.ph41.preheader ], [ %71, %.lr.ph41 ]
  %59 = getelementptr inbounds [10000001 x i32], ptr getelementptr inbounds (i8, ptr @s, i64 40000004), i64 0, i64 %indvars.iv56
  %60 = load i32, ptr %59, align 4, !tbaa !5
  call void @_Z7bit_addii(i32 noundef %60, i32 noundef 1)
  %61 = load i32, ptr %2, align 4, !tbaa !5
  %62 = add nsw i32 %61, 1
  %63 = ashr i32 %62, 1
  %64 = call noundef i32 @_Z7bit_quei(i32 noundef %63)
  %65 = load i32, ptr %2, align 4, !tbaa !5
  %66 = add nsw i32 %65, 2
  %67 = ashr i32 %66, 1
  %68 = call noundef i32 @_Z7bit_quei(i32 noundef %67)
  %69 = add nsw i32 %68, %64
  %70 = sext i32 %69 to i64
  %71 = add nsw i64 %.02639, %70
  %72 = load i32, ptr %2, align 4, !tbaa !5
  %73 = trunc nsw i64 %indvars.iv56 to i32
  %74 = add i32 %73, 1
  %75 = sub i32 %74, %72
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [10000001 x i32], ptr getelementptr inbounds (i8, ptr @s, i64 40000004), i64 0, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !5
  call void @_Z7bit_addii(i32 noundef %78, i32 noundef -1)
  %indvars.iv.next57 = add nsw i64 %indvars.iv56, 1
  %79 = load i32, ptr %1, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %.not.not = icmp slt i64 %indvars.iv56, %80
  br i1 %.not.not, label %.lr.ph41, label %._crit_edge42, !llvm.loop !15

._crit_edge46:                                    ; preds = %._crit_edge42, %3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret i32 0
}

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}


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