; LLVM IR from lzyrapx/Competitive-Programming :: HDUOJ (4152)

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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@goal = external dso_local global [30 x i32], align 16
@f = external dso_local global [25 x [25 x i32]], align 16
@g = external dso_local global [30 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 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
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  br label %16

16:                                               ; preds = %187, %0
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  %18 = xor i32 %17, -1
  %19 = icmp ne i32 %18, 0
  br i1 %19, label %20, label %188

20:                                               ; preds = %16
  store i32 -1, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %21

21:                                               ; preds = %31, %20
  %22 = load i32, ptr %6, align 4, !tbaa !5
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = icmp slt i32 %22, %23
  br i1 %24, label %26, label %25

25:                                               ; preds = %21
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %34

26:                                               ; preds = %21
  %27 = load i32, ptr %6, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [30 x i32], ptr @goal, i64 0, i64 %28
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %29)
  br label %31

31:                                               ; preds = %26
  %32 = load i32, ptr %6, align 4, !tbaa !5
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr %6, align 4, !tbaa !5
  br label %21, !llvm.loop !9

34:                                               ; preds = %25
  %35 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %36

36:                                               ; preds = %59, %34
  %37 = load i32, ptr %7, align 4, !tbaa !5
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %41, label %40

40:                                               ; preds = %36
  store i32 7, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %62

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

42:                                               ; preds = %55, %41
  %43 = load i32, ptr %9, align 4, !tbaa !5
  %44 = load i32, ptr %2, align 4, !tbaa !5
  %45 = icmp slt i32 %43, %44
  br i1 %45, label %47, label %46

46:                                               ; preds = %42
  store i32 10, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %58

47:                                               ; preds = %42
  %48 = load i32, ptr %7, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [25 x [25 x i32]], ptr @f, i64 0, i64 %49
  %51 = load i32, ptr %9, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [25 x i32], ptr %50, i64 0, i64 %52
  %54 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %53)
  br label %55

55:                                               ; preds = %47
  %56 = load i32, ptr %9, align 4, !tbaa !5
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %9, align 4, !tbaa !5
  br label %42, !llvm.loop !11

58:                                               ; preds = %46
  br label %59

59:                                               ; preds = %58
  %60 = load i32, ptr %7, align 4, !tbaa !5
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %7, align 4, !tbaa !5
  br label %36, !llvm.loop !12

62:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %63

63:                                               ; preds = %155, %62
  %64 = load i32, ptr %10, align 4, !tbaa !5
  %65 = load i32, ptr %3, align 4, !tbaa !5
  %66 = shl i32 1, %65
  %67 = icmp slt i32 %64, %66
  br i1 %67, label %69, label %68

68:                                               ; preds = %63
  store i32 13, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %158

69:                                               ; preds = %63
  call void @llvm.memset.p0.i64(ptr align 16 @g, i8 0, i64 120, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %70

70:                                               ; preds = %107, %69
  %71 = load i32, ptr %12, align 4, !tbaa !5
  %72 = load i32, ptr %3, align 4, !tbaa !5
  %73 = icmp slt i32 %71, %72
  br i1 %73, label %75, label %74

74:                                               ; preds = %70
  store i32 16, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %110

75:                                               ; preds = %70
  %76 = load i32, ptr %10, align 4, !tbaa !5
  %77 = load i32, ptr %12, align 4, !tbaa !5
  %78 = shl i32 1, %77
  %79 = and i32 %76, %78
  %80 = icmp ne i32 %79, 0
  br i1 %80, label %81, label %106

81:                                               ; preds = %75
  %82 = load i32, ptr %11, align 4, !tbaa !5
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %84

84:                                               ; preds = %102, %81
  %85 = load i32, ptr %13, align 4, !tbaa !5
  %86 = load i32, ptr %2, align 4, !tbaa !5
  %87 = icmp slt i32 %85, %86
  br i1 %87, label %89, label %88

88:                                               ; preds = %84
  store i32 19, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %105

89:                                               ; preds = %84
  %90 = load i32, ptr %12, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [25 x [25 x i32]], ptr @f, i64 0, i64 %91
  %93 = load i32, ptr %13, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [25 x i32], ptr %92, i64 0, i64 %94
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %97 = load i32, ptr %13, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [30 x i32], ptr @g, i64 0, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !5
  %101 = add nsw i32 %100, %96
  store i32 %101, ptr %99, align 4, !tbaa !5
  br label %102

102:                                              ; preds = %89
  %103 = load i32, ptr %13, align 4, !tbaa !5
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr %13, align 4, !tbaa !5
  br label %84, !llvm.loop !13

105:                                              ; preds = %88
  br label %106

106:                                              ; preds = %105, %75
  br label %107

107:                                              ; preds = %106
  %108 = load i32, ptr %12, align 4, !tbaa !5
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %12, align 4, !tbaa !5
  br label %70, !llvm.loop !14

110:                                              ; preds = %74
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %111

111:                                              ; preds = %127, %110
  %112 = load i32, ptr %14, align 4, !tbaa !5
  %113 = load i32, ptr %2, align 4, !tbaa !5
  %114 = icmp slt i32 %112, %113
  br i1 %114, label %115, label %130

115:                                              ; preds = %111
  %116 = load i32, ptr %14, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [30 x i32], ptr @g, i64 0, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !5
  %120 = load i32, ptr %14, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [30 x i32], ptr @goal, i64 0, i64 %121
  %123 = load i32, ptr %122, align 4, !tbaa !5
  %124 = icmp slt i32 %119, %123
  br i1 %124, label %125, label %126

125:                                              ; preds = %115
  br label %130

126:                                              ; preds = %115
  br label %127

127:                                              ; preds = %126
  %128 = load i32, ptr %14, align 4, !tbaa !5
  %129 = add nsw i32 %128, 1
  store i32 %129, ptr %14, align 4, !tbaa !5
  br label %111, !llvm.loop !15

130:                                              ; preds = %125, %111
  %131 = load i32, ptr %14, align 4, !tbaa !5
  %132 = load i32, ptr %2, align 4, !tbaa !5
  %133 = icmp sge i32 %131, %132
  br i1 %133, label %134, label %154

134:                                              ; preds = %130
  %135 = load i32, ptr %11, align 4, !tbaa !5
  %136 = load i32, ptr %4, align 4, !tbaa !5
  %137 = icmp sgt i32 %135, %136
  br i1 %137, label %138, label %141

138:                                              ; preds = %134
  %139 = load i32, ptr %11, align 4, !tbaa !5
  store i32 %139, ptr %4, align 4, !tbaa !5
  %140 = load i32, ptr %10, align 4, !tbaa !5
  store i32 %140, ptr %5, align 4, !tbaa !5
  br label %153

141:                                              ; preds = %134
  %142 = load i32, ptr %11, align 4, !tbaa !5
  %143 = load i32, ptr %4, align 4, !tbaa !5
  %144 = icmp eq i32 %142, %143
  br i1 %144, label %145, label %152

145:                                              ; preds = %141
  %146 = load i32, ptr %5, align 4, !tbaa !5
  %147 = load i32, ptr %10, align 4, !tbaa !5
  %148 = icmp sgt i32 %146, %147
  br i1 %148, label %149, label %152

149:                                              ; preds = %145
  %150 = load i32, ptr %11, align 4, !tbaa !5
  store i32 %150, ptr %4, align 4, !tbaa !5
  %151 = load i32, ptr %10, align 4, !tbaa !5
  store i32 %151, ptr %5, align 4, !tbaa !5
  br label %152

152:                                              ; preds = %149, %145, %141
  br label %153

153:                                              ; preds = %152, %138
  br label %154

154:                                              ; preds = %153, %130
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %155

155:                                              ; preds = %154
  %156 = load i32, ptr %10, align 4, !tbaa !5
  %157 = add nsw i32 %156, 1
  store i32 %157, ptr %10, align 4, !tbaa !5
  br label %63, !llvm.loop !16

158:                                              ; preds = %68
  %159 = load i32, ptr %4, align 4, !tbaa !5
  %160 = icmp eq i32 %159, -1
  br i1 %160, label %161, label %163

161:                                              ; preds = %158
  %162 = call i32 @puts(ptr noundef @.str.1)
  br label %187

163:                                              ; preds = %158
  %164 = load i32, ptr %4, align 4, !tbaa !5
  %165 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %164)
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %166

166:                                              ; preds = %182, %163
  %167 = load i32, ptr %15, align 4, !tbaa !5
  %168 = load i32, ptr %2, align 4, !tbaa !5
  %169 = icmp slt i32 %167, %168
  br i1 %169, label %171, label %170

170:                                              ; preds = %166
  store i32 25, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %185

171:                                              ; preds = %166
  %172 = load i32, ptr %5, align 4, !tbaa !5
  %173 = load i32, ptr %15, align 4, !tbaa !5
  %174 = shl i32 1, %173
  %175 = and i32 %172, %174
  %176 = icmp ne i32 %175, 0
  br i1 %176, label %177, label %181

177:                                              ; preds = %171
  %178 = load i32, ptr %15, align 4, !tbaa !5
  %179 = add nsw i32 %178, 1
  %180 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %179)
  br label %181

181:                                              ; preds = %177, %171
  br label %182

182:                                              ; preds = %181
  %183 = load i32, ptr %15, align 4, !tbaa !5
  %184 = add nsw i32 %183, 1
  store i32 %184, ptr %15, align 4, !tbaa !5
  br label %166, !llvm.loop !17

185:                                              ; preds = %170
  %186 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  br label %187

187:                                              ; preds = %185, %161
  br label %16, !llvm.loop !18

188:                                              ; preds = %16
  store i32 0, ptr %1, align 4
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  %189 = load i32, ptr %1, align 4
  ret i32 %189
}

; 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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

declare i32 @puts(ptr noundef) #2

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

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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !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"

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@goal = external dso_local global [30 x i32], align 16
@f = external dso_local global [25 x [25 x i32]], align 16
@g = external dso_local local_unnamed_addr global [30 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %.not93 = icmp eq i32 %3, -1
  br i1 %.not93, label %._crit_edge95, label %.preheader62

.preheader62:                                     ; preds = %0, %87
  %.05294 = phi i32 [ %.153.lcssa127, %87 ], [ undef, %0 ]
  %4 = load i32, ptr %1, align 4, !tbaa !5
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.preheader62
  %6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2)
  %7 = load i32, ptr %2, align 4, !tbaa !5
  %8 = icmp sgt i32 %7, 0
  %9 = load i32, ptr %1, align 4
  %10 = icmp sgt i32 %9, 0
  %or.cond133 = select i1 %8, i1 %10, i1 false
  br i1 %or.cond133, label %.preheader60, label %.preheader61

.lr.ph:                                           ; preds = %.preheader62, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader62 ]
  %11 = getelementptr inbounds [30 x i32], ptr @goal, i64 0, i64 %indvars.iv
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %13 = load i32, ptr %1, align 4, !tbaa !5
  %14 = sext i32 %13 to i64
  %15 = icmp slt i64 %indvars.iv.next, %14
  br i1 %15, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.preheader61:                                     ; preds = %._crit_edge66, %._crit_edge
  %.lcssa = phi i32 [ %7, %._crit_edge ], [ %25, %._crit_edge66 ]
  %16 = shl nuw i32 1, %.lcssa
  %17 = icmp sgt i32 %16, 1
  br i1 %17, label %.lr.ph85, label %._crit_edge86.thread

.lr.ph85:                                         ; preds = %.preheader61
  %18 = icmp sgt i32 %.lcssa, 0
  %19 = load i32, ptr %1, align 4
  %.fr97 = freeze i32 %19
  %20 = icmp sgt i32 %.fr97, 0
  %21 = icmp sgt i32 %.fr97, 0
  %wide.trip.count115 = zext nneg i32 %.lcssa to i64
  %wide.trip.count = zext i32 %.fr97 to i64
  %wide.trip.count120 = zext nneg i32 %.fr97 to i64
  %min.iters.check142 = icmp ult i32 %.lcssa, 8
  %n.vec145 = and i32 %.lcssa, 2147483640
  %cmp.n152 = icmp eq i32 %.lcssa, %n.vec145
  %min.iters.check = icmp ult i32 %.fr97, 8
  %n.vec = and i64 %wide.trip.count, 2147483640
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br label %35

.preheader60:                                     ; preds = %._crit_edge, %._crit_edge66
  %22 = phi i32 [ %25, %._crit_edge66 ], [ %7, %._crit_edge ]
  %23 = phi i32 [ %26, %._crit_edge66 ], [ %9, %._crit_edge ]
  %indvars.iv105 = phi i64 [ %indvars.iv.next106, %._crit_edge66 ], [ 0, %._crit_edge ]
  %24 = icmp sgt i32 %23, 0
  br i1 %24, label %.lr.ph65, label %._crit_edge66

._crit_edge66.loopexit:                           ; preds = %.lr.ph65
  %.pre = load i32, ptr %2, align 4, !tbaa !5
  br label %._crit_edge66

._crit_edge66:                                    ; preds = %._crit_edge66.loopexit, %.preheader60
  %25 = phi i32 [ %.pre, %._crit_edge66.loopexit ], [ %22, %.preheader60 ]
  %26 = phi i32 [ %31, %._crit_edge66.loopexit ], [ %23, %.preheader60 ]
  %indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1
  %27 = sext i32 %25 to i64
  %28 = icmp slt i64 %indvars.iv.next106, %27
  br i1 %28, label %.preheader60, label %.preheader61, !llvm.loop !11

.lr.ph65:                                         ; preds = %.preheader60, %.lr.ph65
  %indvars.iv102 = phi i64 [ %indvars.iv.next103, %.lr.ph65 ], [ 0, %.preheader60 ]
  %29 = getelementptr inbounds [25 x [25 x i32]], ptr @f, i64 0, i64 %indvars.iv105, i64 %indvars.iv102
  %30 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %29)
  %indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1
  %31 = load i32, ptr %1, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = icmp slt i64 %indvars.iv.next103, %32
  br i1 %33, label %.lr.ph65, label %._crit_edge66.loopexit, !llvm.loop !13

._crit_edge86:                                    ; preds = %.thread
  %34 = icmp eq i32 %.155, -1
  br i1 %34, label %._crit_edge86.thread, label %75

35:                                               ; preds = %.lr.ph85, %.thread
  %.04883 = phi i32 [ 1, %.lr.ph85 ], [ %73, %.thread ]
  %.15382 = phi i32 [ %.05294, %.lr.ph85 ], [ %.2, %.thread ]
  %.05481 = phi i32 [ -1, %.lr.ph85 ], [ %.155, %.thread ]
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(120) @g, i8 0, i64 120, i1 false)
  br i1 %18, label %.lr.ph75, label %.preheader

.lr.ph75:                                         ; preds = %35
  br i1 %20, label %.lr.ph75.split.us, label %.lr.ph75.split.preheader

.lr.ph75.split.preheader:                         ; preds = %.lr.ph75
  br i1 %min.iters.check142, label %.lr.ph75.split.preheader154, label %vector.ph143

.lr.ph75.split.preheader154:                      ; preds = %middle.block140, %.lr.ph75.split.preheader
  %.04672.ph = phi i32 [ 0, %.lr.ph75.split.preheader ], [ %n.vec145, %middle.block140 ]
  %.04771.ph = phi i32 [ 0, %.lr.ph75.split.preheader ], [ %43, %middle.block140 ]
  br label %.lr.ph75.split

vector.ph143:                                     ; preds = %.lr.ph75.split.preheader
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %.04883, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body147

vector.body147:                                   ; preds = %vector.body147, %vector.ph143
  %index148 = phi i32 [ 0, %vector.ph143 ], [ %index.next151, %vector.body147 ]
  %vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph143 ], [ %vec.ind.next, %vector.body147 ]
  %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph143 ], [ %40, %vector.body147 ]
  %vec.phi150 = phi <4 x i32> [ zeroinitializer, %vector.ph143 ], [ %41, %vector.body147 ]
  %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
  %36 = lshr <4 x i32> %broadcast.splat, %vec.ind
  %37 = lshr <4 x i32> %broadcast.splat, %step.add
  %38 = and <4 x i32> %36, <i32 1, i32 1, i32 1, i32 1>
  %39 = and <4 x i32> %37, <i32 1, i32 1, i32 1, i32 1>
  %40 = add <4 x i32> %vec.phi, %38
  %41 = add <4 x i32> %vec.phi150, %39
  %index.next151 = add nuw i32 %index148, 8
  %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
  %42 = icmp eq i32 %index.next151, %n.vec145
  br i1 %42, label %middle.block140, label %vector.body147, !llvm.loop !14

middle.block140:                                  ; preds = %vector.body147
  %bin.rdx = add <4 x i32> %41, %40
  %43 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  br i1 %cmp.n152, label %.preheader, label %.lr.ph75.split.preheader154

.lr.ph75.split.us:                                ; preds = %.lr.ph75, %..loopexit_crit_edge.us
  %indvars.iv112 = phi i64 [ %indvars.iv.next113, %..loopexit_crit_edge.us ], [ 0, %.lr.ph75 ]
  %.04771.us = phi i32 [ %.1.us, %..loopexit_crit_edge.us ], [ 0, %.lr.ph75 ]
  %44 = trunc nuw nsw i64 %indvars.iv112 to i32
  %45 = shl nuw i32 1, %44
  %46 = and i32 %45, %.04883
  %.not58.us = icmp eq i32 %46, 0
  br i1 %.not58.us, label %..loopexit_crit_edge.us, label %.lr.ph70.us.preheader

.lr.ph70.us.preheader:                            ; preds = %.lr.ph75.split.us
  br i1 %min.iters.check, label %.lr.ph70.us.preheader153, label %vector.body

vector.body:                                      ; preds = %.lr.ph70.us.preheader, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %.lr.ph70.us.preheader ]
  %47 = getelementptr inbounds [25 x [25 x i32]], ptr @f, i64 0, i64 %indvars.iv112, i64 %index
  %48 = getelementptr inbounds i8, ptr %47, i64 16
  %wide.load = load <4 x i32>, ptr %47, align 4, !tbaa !5
  %wide.load137 = load <4 x i32>, ptr %48, align 4, !tbaa !5
  %49 = getelementptr inbounds [30 x i32], ptr @g, i64 0, i64 %index
  %50 = getelementptr inbounds i8, ptr %49, i64 16
  %wide.load138 = load <4 x i32>, ptr %49, align 16, !tbaa !5
  %wide.load139 = load <4 x i32>, ptr %50, align 16, !tbaa !5
  %51 = add nsw <4 x i32> %wide.load138, %wide.load
  %52 = add nsw <4 x i32> %wide.load139, %wide.load137
  store <4 x i32> %51, ptr %49, align 16, !tbaa !5
  store <4 x i32> %52, ptr %50, align 16, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %53 = icmp eq i64 %index.next, %n.vec
  br i1 %53, label %middle.block, label %vector.body, !llvm.loop !17

middle.block:                                     ; preds = %vector.body
  br i1 %cmp.n, label %..loopexit_crit_edge.us.loopexit, label %.lr.ph70.us.preheader153

.lr.ph70.us.preheader153:                         ; preds = %middle.block, %.lr.ph70.us.preheader
  %indvars.iv108.ph = phi i64 [ 0, %.lr.ph70.us.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph70.us

.lr.ph70.us:                                      ; preds = %.lr.ph70.us.preheader153, %.lr.ph70.us
  %indvars.iv108 = phi i64 [ %indvars.iv.next109, %.lr.ph70.us ], [ %indvars.iv108.ph, %.lr.ph70.us.preheader153 ]
  %54 = getelementptr inbounds [25 x [25 x i32]], ptr @f, i64 0, i64 %indvars.iv112, i64 %indvars.iv108
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = getelementptr inbounds [30 x i32], ptr @g, i64 0, i64 %indvars.iv108
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = add nsw i32 %57, %55
  store i32 %58, ptr %56, align 4, !tbaa !5
  %indvars.iv.next109 = add nuw nsw i64 %indvars.iv108, 1
  %exitcond111.not = icmp eq i64 %indvars.iv.next109, %wide.trip.count
  br i1 %exitcond111.not, label %..loopexit_crit_edge.us.loopexit, label %.lr.ph70.us, !llvm.loop !18

..loopexit_crit_edge.us.loopexit:                 ; preds = %.lr.ph70.us, %middle.block
  %59 = add nsw i32 %.04771.us, 1
  br label %..loopexit_crit_edge.us

..loopexit_crit_edge.us:                          ; preds = %..loopexit_crit_edge.us.loopexit, %.lr.ph75.split.us
  %.1.us = phi i32 [ %.04771.us, %.lr.ph75.split.us ], [ %59, %..loopexit_crit_edge.us.loopexit ]
  %indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
  %exitcond116.not = icmp eq i64 %indvars.iv.next113, %wide.trip.count115
  br i1 %exitcond116.not, label %.preheader, label %.lr.ph75.split.us, !llvm.loop !19

.preheader:                                       ; preds = %.lr.ph75.split, %..loopexit_crit_edge.us, %middle.block140, %35
  %.047.lcssa = phi i32 [ 0, %35 ], [ %43, %middle.block140 ], [ %.1.us, %..loopexit_crit_edge.us ], [ %spec.select96, %.lr.ph75.split ]
  br i1 %21, label %.lr.ph79, label %._crit_edge80

.lr.ph75.split:                                   ; preds = %.lr.ph75.split.preheader154, %.lr.ph75.split
  %.04672 = phi i32 [ %62, %.lr.ph75.split ], [ %.04672.ph, %.lr.ph75.split.preheader154 ]
  %.04771 = phi i32 [ %spec.select96, %.lr.ph75.split ], [ %.04771.ph, %.lr.ph75.split.preheader154 ]
  %60 = lshr i32 %.04883, %.04672
  %61 = and i32 %60, 1
  %spec.select96 = add nuw nsw i32 %.04771, %61
  %62 = add nuw nsw i32 %.04672, 1
  %exitcond.not = icmp eq i32 %62, %.lcssa
  br i1 %exitcond.not, label %.preheader, label %.lr.ph75.split, !llvm.loop !20

63:                                               ; preds = %.lr.ph79
  %indvars.iv.next118 = add nuw nsw i64 %indvars.iv117, 1
  %exitcond121.not = icmp eq i64 %indvars.iv.next118, %wide.trip.count120
  br i1 %exitcond121.not, label %._crit_edge80, label %.lr.ph79, !llvm.loop !21

.lr.ph79:                                         ; preds = %.preheader, %63
  %indvars.iv117 = phi i64 [ %indvars.iv.next118, %63 ], [ 0, %.preheader ]
  %64 = getelementptr inbounds [30 x i32], ptr @g, i64 0, i64 %indvars.iv117
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = getelementptr inbounds [30 x i32], ptr @goal, i64 0, i64 %indvars.iv117
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = icmp slt i32 %65, %67
  br i1 %68, label %.thread, label %63

._crit_edge80:                                    ; preds = %63, %.preheader
  %69 = icmp sgt i32 %.047.lcssa, %.05481
  br i1 %69, label %.thread, label %70

70:                                               ; preds = %._crit_edge80
  %71 = icmp eq i32 %.047.lcssa, %.05481
  %72 = icmp sgt i32 %.15382, %.04883
  %or.cond = select i1 %71, i1 %72, i1 false
  %spec.select = select i1 %or.cond, i32 %.047.lcssa, i32 %.05481
  %spec.select59 = select i1 %or.cond, i32 %.04883, i32 %.15382
  br label %.thread

.thread:                                          ; preds = %.lr.ph79, %70, %._crit_edge80
  %.155 = phi i32 [ %.047.lcssa, %._crit_edge80 ], [ %spec.select, %70 ], [ %.05481, %.lr.ph79 ]
  %.2 = phi i32 [ %.04883, %._crit_edge80 ], [ %spec.select59, %70 ], [ %.15382, %.lr.ph79 ]
  %73 = add nuw nsw i32 %.04883, 1
  %exitcond122.not = icmp eq i32 %73, %16
  br i1 %exitcond122.not, label %._crit_edge86, label %35, !llvm.loop !22

._crit_edge86.thread:                             ; preds = %.preheader61, %._crit_edge86
  %.153.lcssa128 = phi i32 [ %.2, %._crit_edge86 ], [ %.05294, %.preheader61 ]
  %74 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %87

75:                                               ; preds = %._crit_edge86
  %76 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.155)
  %77 = load i32, ptr %1, align 4, !tbaa !5
  %78 = icmp sgt i32 %77, 0
  br i1 %78, label %.lr.ph91, label %._crit_edge92

._crit_edge92:                                    ; preds = %.lr.ph91._crit_edge, %75
  %79 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  br label %87

.lr.ph91:                                         ; preds = %75, %.lr.ph91._crit_edge
  %80 = phi i32 [ %85, %.lr.ph91._crit_edge ], [ %77, %75 ]
  %.089 = phi i32 [ %.pre124, %.lr.ph91._crit_edge ], [ 0, %75 ]
  %81 = shl nuw i32 1, %.089
  %82 = and i32 %81, %.2
  %.not56 = icmp eq i32 %82, 0
  %.pre124 = add nuw nsw i32 %.089, 1
  br i1 %.not56, label %.lr.ph91._crit_edge, label %83

83:                                               ; preds = %.lr.ph91
  %84 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.pre124)
  %.pre123 = load i32, ptr %1, align 4, !tbaa !5
  br label %.lr.ph91._crit_edge

.lr.ph91._crit_edge:                              ; preds = %.lr.ph91, %83
  %85 = phi i32 [ %.pre123, %83 ], [ %80, %.lr.ph91 ]
  %86 = icmp slt i32 %.pre124, %85
  br i1 %86, label %.lr.ph91, label %._crit_edge92, !llvm.loop !23

87:                                               ; preds = %._crit_edge92, %._crit_edge86.thread
  %.153.lcssa127 = phi i32 [ %.2, %._crit_edge92 ], [ %.153.lcssa128, %._crit_edge86.thread ]
  %88 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %.not = icmp eq i32 %88, -1
  br i1 %.not, label %._crit_edge95, label %.preheader62, !llvm.loop !24

._crit_edge95:                                    ; preds = %87, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

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

; 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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5

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 = { "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12}
!12 = !{!"llvm.loop.unswitch.partial.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !15, !16}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !10, !15, !16}
!18 = distinct !{!18, !10, !16, !15}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10, !16, !15}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10}


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