; LLVM IR from VastoLorde95/Competitive-Programming :: Hackerrank/Codesprints 2016/Codesprint Aug/Problem D/D.ll (Z5solvev)

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

@cost = external dso_local global [1010 x [1010 x i64]], align 16
@a = external dso_local global [1010 x i8], align 16
@b = external dso_local global [1010 x i8], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z12reinitializei(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 uwtable
declare dso_local noundef i64 @_Z24minCostBipartiteMatchingv() #2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() #2 {
  %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 i64, align 8
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @a)
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @b)
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #6
  %13 = call i64 @strlen(ptr noundef @a) #7
  %14 = trunc i64 %13 to i32
  store i32 %14, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  %15 = call i64 @strlen(ptr noundef @b) #7
  %16 = trunc i64 %15 to i32
  store i32 %16, ptr %2, align 4, !tbaa !5
  %17 = load i32, ptr %1, align 4, !tbaa !5
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = icmp slt i32 %17, %18
  br i1 %19, label %20, label %22

20:                                               ; preds = %0
  %21 = call i32 @puts(ptr noundef @.str.1)
  store i32 1, ptr %3, align 4
  br label %177

22:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %23 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %24 = load i32, ptr %23, align 4, !tbaa !5
  store i32 %24, ptr %4, align 4, !tbaa !5
  %25 = load i32, ptr %4, align 4, !tbaa !5
  call void @_Z12reinitializei(i32 noundef %25)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %153, %22
  %27 = load i32, ptr %6, align 4, !tbaa !5
  %28 = load i32, ptr %1, align 4, !tbaa !5
  %29 = icmp slt i32 %27, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %26
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %156

31:                                               ; preds = %26
  %32 = load i32, ptr %6, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [1010 x i8], ptr @a, i64 0, i64 %33
  %35 = load i8, ptr %34, align 1, !tbaa !9
  %36 = sext i8 %35 to i32
  %37 = icmp sge i32 %36, 65
  br i1 %37, label %38, label %91

38:                                               ; preds = %31
  %39 = load i32, ptr %6, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [1010 x i8], ptr @a, i64 0, i64 %40
  %42 = load i8, ptr %41, align 1, !tbaa !9
  %43 = sext i8 %42 to i32
  %44 = icmp sle i32 %43, 90
  br i1 %44, label %45, label %91

45:                                               ; preds = %38
  %46 = load i32, ptr %5, align 4, !tbaa !5
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %87, %45
  %49 = load i32, ptr %7, align 4, !tbaa !5
  %50 = load i32, ptr %2, align 4, !tbaa !5
  %51 = icmp slt i32 %49, %50
  br i1 %51, label %53, label %52

52:                                               ; preds = %48
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %90

53:                                               ; preds = %48
  %54 = load i32, ptr %6, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [1010 x i8], ptr @a, i64 0, i64 %55
  %57 = load i8, ptr %56, align 1, !tbaa !9
  %58 = sext i8 %57 to i32
  %59 = load i32, ptr %7, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [1010 x i8], ptr @b, i64 0, i64 %60
  %62 = load i8, ptr %61, align 1, !tbaa !9
  %63 = sext i8 %62 to i32
  %64 = icmp eq i32 %58, %63
  br i1 %64, label %65, label %77

65:                                               ; preds = %53
  %66 = load i32, ptr %1, align 4, !tbaa !5
  %67 = sub nsw i32 0, %66
  %68 = sext i32 %67 to i64
  %69 = load i32, ptr %6, align 4, !tbaa !5
  %70 = add nsw i32 %69, 1
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [1010 x [1010 x i64]], ptr @cost, i64 0, i64 %71
  %73 = load i32, ptr %7, align 4, !tbaa !5
  %74 = add nsw i32 %73, 1
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [1010 x i64], ptr %72, i64 0, i64 %75
  store i64 %68, ptr %76, align 8, !tbaa !10
  br label %86

77:                                               ; preds = %53
  %78 = load i32, ptr %6, align 4, !tbaa !5
  %79 = add nsw i32 %78, 1
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [1010 x [1010 x i64]], ptr @cost, i64 0, i64 %80
  %82 = load i32, ptr %7, align 4, !tbaa !5
  %83 = add nsw i32 %82, 1
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [1010 x i64], ptr %81, i64 0, i64 %84
  store i64 1099511627776, ptr %85, align 8, !tbaa !10
  br label %86

86:                                               ; preds = %77, %65
  br label %87

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

90:                                               ; preds = %52
  br label %133

91:                                               ; preds = %38, %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %92

92:                                               ; preds = %129, %91
  %93 = load i32, ptr %8, align 4, !tbaa !5
  %94 = load i32, ptr %2, align 4, !tbaa !5
  %95 = icmp slt i32 %93, %94
  br i1 %95, label %97, label %96

96:                                               ; preds = %92
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %132

97:                                               ; preds = %92
  %98 = load i32, ptr %6, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [1010 x i8], ptr @a, i64 0, i64 %99
  %101 = load i8, ptr %100, align 1, !tbaa !9
  %102 = sext i8 %101 to i32
  %103 = sub nsw i32 %102, 32
  %104 = load i32, ptr %8, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [1010 x i8], ptr @b, i64 0, i64 %105
  %107 = load i8, ptr %106, align 1, !tbaa !9
  %108 = sext i8 %107 to i32
  %109 = icmp eq i32 %103, %108
  br i1 %109, label %110, label %119

110:                                              ; preds = %97
  %111 = load i32, ptr %6, align 4, !tbaa !5
  %112 = add nsw i32 %111, 1
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [1010 x [1010 x i64]], ptr @cost, i64 0, i64 %113
  %115 = load i32, ptr %8, align 4, !tbaa !5
  %116 = add nsw i32 %115, 1
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [1010 x i64], ptr %114, i64 0, i64 %117
  store i64 0, ptr %118, align 8, !tbaa !10
  br label %128

119:                                              ; preds = %97
  %120 = load i32, ptr %6, align 4, !tbaa !5
  %121 = add nsw i32 %120, 1
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [1010 x [1010 x i64]], ptr @cost, i64 0, i64 %122
  %124 = load i32, ptr %8, align 4, !tbaa !5
  %125 = add nsw i32 %124, 1
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [1010 x i64], ptr %123, i64 0, i64 %126
  store i64 1099511627776, ptr %127, align 8, !tbaa !10
  br label %128

128:                                              ; preds = %119, %110
  br label %129

129:                                              ; preds = %128
  %130 = load i32, ptr %8, align 4, !tbaa !5
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %8, align 4, !tbaa !5
  br label %92, !llvm.loop !14

132:                                              ; preds = %96
  br label %133

133:                                              ; preds = %132, %90
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %134 = load i32, ptr %2, align 4, !tbaa !5
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %9, align 4, !tbaa !5
  br label %136

136:                                              ; preds = %149, %133
  %137 = load i32, ptr %9, align 4, !tbaa !5
  %138 = load i32, ptr %4, align 4, !tbaa !5
  %139 = icmp sle i32 %137, %138
  br i1 %139, label %141, label %140

140:                                              ; preds = %136
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %152

141:                                              ; preds = %136
  %142 = load i32, ptr %6, align 4, !tbaa !5
  %143 = add nsw i32 %142, 1
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [1010 x [1010 x i64]], ptr @cost, i64 0, i64 %144
  %146 = load i32, ptr %9, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [1010 x i64], ptr %145, i64 0, i64 %147
  store i64 1099511627776, ptr %148, align 8, !tbaa !10
  br label %149

149:                                              ; preds = %141
  %150 = load i32, ptr %9, align 4, !tbaa !5
  %151 = add nsw i32 %150, 1
  store i32 %151, ptr %9, align 4, !tbaa !5
  br label %136, !llvm.loop !15

152:                                              ; preds = %140
  br label %153

153:                                              ; preds = %152
  %154 = load i32, ptr %6, align 4, !tbaa !5
  %155 = add nsw i32 %154, 1
  store i32 %155, ptr %6, align 4, !tbaa !5
  br label %26, !llvm.loop !16

156:                                              ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %157 = call noundef i64 @_Z24minCostBipartiteMatchingv()
  store i64 %157, ptr %10, align 8, !tbaa !10
  %158 = load i64, ptr %10, align 8, !tbaa !10
  %159 = load i32, ptr %1, align 4, !tbaa !5
  %160 = load i32, ptr %2, align 4, !tbaa !5
  %161 = sub nsw i32 %159, %160
  %162 = sext i32 %161 to i64
  %163 = mul nsw i64 1099511627776, %162
  %164 = sub nsw i64 %158, %163
  %165 = load i32, ptr %5, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = mul nsw i64 -1, %166
  %168 = load i32, ptr %1, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = mul nsw i64 %167, %169
  %171 = icmp eq i64 %164, %170
  br i1 %171, label %172, label %174

172:                                              ; preds = %156
  %173 = call i32 @puts(ptr noundef @.str.2)
  br label %176

174:                                              ; preds = %156
  %175 = call i32 @puts(ptr noundef @.str.1)
  br label %176

176:                                              ; preds = %174, %172
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  store i32 0, ptr %3, align 4
  br label %177

177:                                              ; preds = %176, %20
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #6
  %178 = load i32, ptr %3, align 4
  switch i32 %178, label %180 [
    i32 0, label %179
    i32 1, label %179
  ]

179:                                              ; preds = %177, %177
  ret void

180:                                              ; preds = %177
  unreachable
}

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

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #4

declare i32 @puts(ptr noundef) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #5

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 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 = { nounwind willreturn memory(read) "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 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 #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }

!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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"long long", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}


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

@cost = external dso_local local_unnamed_addr global [1010 x [1010 x i64]], align 16
@a = external dso_local global [1010 x i8], align 16
@b = external dso_local global [1010 x i8], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z12reinitializei(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 uwtable
declare dso_local noundef i64 @_Z24minCostBipartiteMatchingv() local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @a)
  %4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @b)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %5 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @a) #8
  %6 = trunc i64 %5 to i32
  store i32 %6, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %7 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @b) #8
  %8 = trunc i64 %7 to i32
  store i32 %8, ptr %2, align 4, !tbaa !5
  %9 = icmp slt i32 %6, %8
  br i1 %9, label %10, label %12

10:                                               ; preds = %0
  %11 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %117

12:                                               ; preds = %0
  %13 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %14 = load i32, ptr %13, align 4, !tbaa !5
  call void @_Z12reinitializei(i32 noundef %14)
  %15 = load i32, ptr %1, align 4, !tbaa !5
  %16 = icmp sgt i32 %15, 0
  br i1 %16, label %.lr.ph45, label %._crit_edge46

.lr.ph45:                                         ; preds = %12
  %17 = load i32, ptr %2, align 4
  %.fr77 = freeze i32 %17
  %18 = icmp sgt i32 %.fr77, 0
  %19 = sub nsw i32 0, %15
  %20 = sext i32 %19 to i64
  %.not.not38 = icmp slt i32 %.fr77, %14
  br i1 %18, label %.lr.ph45.split.us.preheader, label %.lr.ph45.split.split

.lr.ph45.split.us.preheader:                      ; preds = %.lr.ph45
  %21 = zext nneg i32 %.fr77 to i64
  %wide.trip.count122 = zext nneg i32 %15 to i64
  %22 = xor i32 %.fr77, -1
  %23 = add i32 %14, %22
  %24 = zext i32 %23 to i64
  %25 = add nuw nsw i64 %24, 1
  %min.iters.check176 = icmp ult i32 %.fr77, 4
  %n.vec179 = and i64 %21, 2147483644
  %cmp.n188 = icmp eq i64 %n.vec179, %21
  %min.iters.check161 = icmp ult i32 %.fr77, 4
  %n.vec164 = and i64 %21, 2147483644
  %broadcast.splatinsert170 = insertelement <2 x i64> poison, i64 %20, i64 0
  %broadcast.splat171 = shufflevector <2 x i64> %broadcast.splatinsert170, <2 x i64> poison, <2 x i32> zeroinitializer
  %cmp.n173 = icmp eq i64 %n.vec164, %21
  %min.iters.check148 = icmp ult i32 %23, 3
  %n.vec151 = and i64 %25, 8589934588
  %ind.end152 = add nuw nsw i64 %n.vec151, %21
  %cmp.n158 = icmp eq i64 %25, %n.vec151
  br label %.lr.ph45.split.us

.lr.ph45.split.us:                                ; preds = %.lr.ph45.split.us.preheader, %._crit_edge.us
  %indvars.iv119 = phi i64 [ 0, %.lr.ph45.split.us.preheader ], [ %35, %._crit_edge.us ]
  %.03241.us = phi i32 [ 0, %.lr.ph45.split.us.preheader ], [ %.1.us, %._crit_edge.us ]
  %26 = getelementptr inbounds [1010 x i8], ptr @a, i64 0, i64 %indvars.iv119
  %27 = load i8, ptr %26, align 1, !tbaa !9
  %28 = add i8 %27, -65
  %or.cond.us = icmp ult i8 %28, 26
  br i1 %or.cond.us, label %.lr.ph37.us, label %.preheader.us

scalar.ph175:                                     ; preds = %scalar.ph175.preheader, %scalar.ph175
  %indvars.iv106 = phi i64 [ %33, %scalar.ph175 ], [ %indvars.iv106.ph, %scalar.ph175.preheader ]
  %29 = getelementptr inbounds [1010 x i8], ptr @b, i64 0, i64 %indvars.iv106
  %30 = load i8, ptr %29, align 1, !tbaa !9
  %31 = sext i8 %30 to i32
  %32 = icmp eq i32 %48, %31
  %33 = add nuw nsw i64 %indvars.iv106, 1
  %34 = getelementptr inbounds [1010 x [1010 x i64]], ptr @cost, i64 0, i64 %49, i64 %33
  %. = select i1 %32, i64 0, i64 1099511627776
  store i64 %., ptr %34, align 8, !tbaa !10
  %exitcond110.not = icmp eq i64 %33, %21
  br i1 %exitcond110.not, label %.loopexit.us, label %scalar.ph175, !llvm.loop !12

.loopexit.us:                                     ; preds = %scalar.ph175, %scalar.ph160, %middle.block174, %middle.block159
  %.1.us = phi i32 [ %62, %middle.block159 ], [ %.03241.us, %middle.block174 ], [ %62, %scalar.ph160 ], [ %.03241.us, %scalar.ph175 ]
  %35 = add nuw nsw i64 %indvars.iv119, 1
  br i1 %.not.not38, label %.lr.ph40.us.preheader, label %._crit_edge.us

.lr.ph40.us.preheader:                            ; preds = %.loopexit.us
  br i1 %min.iters.check148, label %.lr.ph40.us.preheader189, label %vector.body154

.lr.ph40.us.preheader189:                         ; preds = %middle.block146, %.lr.ph40.us.preheader
  %indvars.iv116.ph = phi i64 [ %21, %.lr.ph40.us.preheader ], [ %ind.end152, %middle.block146 ]
  br label %.lr.ph40.us

vector.body154:                                   ; preds = %.lr.ph40.us.preheader, %vector.body154
  %index155 = phi i64 [ %index.next157, %vector.body154 ], [ 0, %.lr.ph40.us.preheader ]
  %offset.idx156 = add i64 %index155, %21
  %36 = add nuw nsw i64 %offset.idx156, 1
  %37 = getelementptr inbounds [1010 x [1010 x i64]], ptr @cost, i64 0, i64 %35, i64 %36
  %38 = getelementptr inbounds i8, ptr %37, i64 16
  store <2 x i64> <i64 1099511627776, i64 1099511627776>, ptr %37, align 8, !tbaa !10
  store <2 x i64> <i64 1099511627776, i64 1099511627776>, ptr %38, align 8, !tbaa !10
  %index.next157 = add nuw i64 %index155, 4
  %39 = icmp eq i64 %index.next157, %n.vec151
  br i1 %39, label %middle.block146, label %vector.body154, !llvm.loop !16

middle.block146:                                  ; preds = %vector.body154
  br i1 %cmp.n158, label %._crit_edge.us, label %.lr.ph40.us.preheader189

._crit_edge.us:                                   ; preds = %.lr.ph40.us, %middle.block146, %.loopexit.us
  %exitcond123.not = icmp eq i64 %35, %wide.trip.count122
  br i1 %exitcond123.not, label %._crit_edge46, label %.lr.ph45.split.us, !llvm.loop !17

.lr.ph40.us:                                      ; preds = %.lr.ph40.us.preheader189, %.lr.ph40.us
  %indvars.iv116 = phi i64 [ %indvars.iv.next117, %.lr.ph40.us ], [ %indvars.iv116.ph, %.lr.ph40.us.preheader189 ]
  %indvars.iv.next117 = add nuw nsw i64 %indvars.iv116, 1
  %40 = getelementptr inbounds [1010 x [1010 x i64]], ptr @cost, i64 0, i64 %35, i64 %indvars.iv.next117
  store i64 1099511627776, ptr %40, align 8, !tbaa !10
  %41 = trunc nuw i64 %indvars.iv.next117 to i32
  %.not.not.us = icmp sgt i32 %14, %41
  br i1 %.not.not.us, label %.lr.ph40.us, label %._crit_edge.us, !llvm.loop !18

scalar.ph160:                                     ; preds = %scalar.ph160.preheader, %scalar.ph160
  %indvars.iv111 = phi i64 [ %45, %scalar.ph160 ], [ %indvars.iv111.ph, %scalar.ph160.preheader ]
  %42 = getelementptr inbounds [1010 x i8], ptr @b, i64 0, i64 %indvars.iv111
  %43 = load i8, ptr %42, align 1, !tbaa !9
  %44 = icmp eq i8 %27, %43
  %45 = add nuw nsw i64 %indvars.iv111, 1
  %46 = getelementptr inbounds [1010 x [1010 x i64]], ptr @cost, i64 0, i64 %63, i64 %45
  %.129 = select i1 %44, i64 %20, i64 1099511627776
  store i64 %.129, ptr %46, align 8, !tbaa !10
  %exitcond115.not = icmp eq i64 %45, %21
  br i1 %exitcond115.not, label %.loopexit.us, label %scalar.ph160, !llvm.loop !19

.preheader.us:                                    ; preds = %.lr.ph45.split.us
  %47 = sext i8 %27 to i32
  %48 = add nsw i32 %47, -32
  %49 = add nuw nsw i64 %indvars.iv119, 1
  br i1 %min.iters.check176, label %scalar.ph175.preheader, label %vector.ph177

scalar.ph175.preheader:                           ; preds = %middle.block174, %.preheader.us
  %indvars.iv106.ph = phi i64 [ 0, %.preheader.us ], [ %n.vec179, %middle.block174 ]
  br label %scalar.ph175

vector.ph177:                                     ; preds = %.preheader.us
  %broadcast.splatinsert185 = insertelement <2 x i32> poison, i32 %48, i64 0
  %broadcast.splat186 = shufflevector <2 x i32> %broadcast.splatinsert185, <2 x i32> poison, <2 x i32> zeroinitializer
  br label %vector.body181

vector.body181:                                   ; preds = %vector.body181, %vector.ph177
  %index182 = phi i64 [ 0, %vector.ph177 ], [ %index.next187, %vector.body181 ]
  %50 = getelementptr inbounds [1010 x i8], ptr @b, i64 0, i64 %index182
  %51 = getelementptr inbounds i8, ptr %50, i64 2
  %wide.load183 = load <2 x i8>, ptr %50, align 4, !tbaa !9
  %wide.load184 = load <2 x i8>, ptr %51, align 2, !tbaa !9
  %52 = sext <2 x i8> %wide.load183 to <2 x i32>
  %53 = sext <2 x i8> %wide.load184 to <2 x i32>
  %54 = icmp eq <2 x i32> %broadcast.splat186, %52
  %55 = icmp eq <2 x i32> %broadcast.splat186, %53
  %56 = or disjoint i64 %index182, 1
  %57 = getelementptr inbounds [1010 x [1010 x i64]], ptr @cost, i64 0, i64 %49, i64 %56
  %58 = select <2 x i1> %54, <2 x i64> zeroinitializer, <2 x i64> <i64 1099511627776, i64 1099511627776>
  %59 = select <2 x i1> %55, <2 x i64> zeroinitializer, <2 x i64> <i64 1099511627776, i64 1099511627776>
  %60 = getelementptr inbounds i8, ptr %57, i64 16
  store <2 x i64> %58, ptr %57, align 8, !tbaa !10
  store <2 x i64> %59, ptr %60, align 8, !tbaa !10
  %index.next187 = add nuw i64 %index182, 4
  %61 = icmp eq i64 %index.next187, %n.vec179
  br i1 %61, label %middle.block174, label %vector.body181, !llvm.loop !20

middle.block174:                                  ; preds = %vector.body181
  br i1 %cmp.n188, label %.loopexit.us, label %scalar.ph175.preheader

.lr.ph37.us:                                      ; preds = %.lr.ph45.split.us
  %62 = add nsw i32 %.03241.us, 1
  %63 = add nuw nsw i64 %indvars.iv119, 1
  br i1 %min.iters.check161, label %scalar.ph160.preheader, label %vector.ph162

scalar.ph160.preheader:                           ; preds = %middle.block159, %.lr.ph37.us
  %indvars.iv111.ph = phi i64 [ 0, %.lr.ph37.us ], [ %n.vec164, %middle.block159 ]
  br label %scalar.ph160

vector.ph162:                                     ; preds = %.lr.ph37.us
  %broadcast.splatinsert = insertelement <2 x i8> poison, i8 %27, i64 0
  %broadcast.splat = shufflevector <2 x i8> %broadcast.splatinsert, <2 x i8> poison, <2 x i32> zeroinitializer
  br label %vector.body166

vector.body166:                                   ; preds = %vector.body166, %vector.ph162
  %index167 = phi i64 [ 0, %vector.ph162 ], [ %index.next172, %vector.body166 ]
  %64 = getelementptr inbounds [1010 x i8], ptr @b, i64 0, i64 %index167
  %65 = getelementptr inbounds i8, ptr %64, i64 2
  %wide.load168 = load <2 x i8>, ptr %64, align 4, !tbaa !9
  %wide.load169 = load <2 x i8>, ptr %65, align 2, !tbaa !9
  %66 = icmp eq <2 x i8> %broadcast.splat, %wide.load168
  %67 = icmp eq <2 x i8> %broadcast.splat, %wide.load169
  %68 = or disjoint i64 %index167, 1
  %69 = getelementptr inbounds [1010 x [1010 x i64]], ptr @cost, i64 0, i64 %63, i64 %68
  %70 = select <2 x i1> %66, <2 x i64> %broadcast.splat171, <2 x i64> <i64 1099511627776, i64 1099511627776>
  %71 = select <2 x i1> %67, <2 x i64> %broadcast.splat171, <2 x i64> <i64 1099511627776, i64 1099511627776>
  %72 = getelementptr inbounds i8, ptr %69, i64 16
  store <2 x i64> %70, ptr %69, align 8, !tbaa !10
  store <2 x i64> %71, ptr %72, align 8, !tbaa !10
  %index.next172 = add nuw i64 %index167, 4
  %73 = icmp eq i64 %index.next172, %n.vec164
  br i1 %73, label %middle.block159, label %vector.body166, !llvm.loop !21

middle.block159:                                  ; preds = %vector.body166
  br i1 %cmp.n173, label %.loopexit.us, label %scalar.ph160.preheader

.lr.ph45.split.split:                             ; preds = %.lr.ph45
  br i1 %.not.not38, label %.lr.ph45.split.split.split.us.preheader, label %.lr.ph45.split.split.split.preheader

.lr.ph45.split.split.split.preheader:             ; preds = %.lr.ph45.split.split
  %wide.trip.count = zext nneg i32 %15 to i64
  %min.iters.check = icmp ult i32 %15, 8
  br i1 %min.iters.check, label %.lr.ph45.split.split.split.preheader192, label %vector.ph

.lr.ph45.split.split.split.preheader192:          ; preds = %middle.block, %.lr.ph45.split.split.split.preheader
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph45.split.split.split.preheader ], [ %n.vec, %middle.block ]
  %.03241.ph = phi i32 [ 0, %.lr.ph45.split.split.split.preheader ], [ %85, %middle.block ]
  br label %.lr.ph45.split.split.split

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

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %82, %vector.body ]
  %vec.phi133 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %83, %vector.body ]
  %74 = getelementptr inbounds [1010 x i8], ptr @a, i64 0, i64 %index
  %75 = getelementptr inbounds i8, ptr %74, i64 4
  %wide.load = load <4 x i8>, ptr %74, align 8, !tbaa !9
  %wide.load134 = load <4 x i8>, ptr %75, align 4, !tbaa !9
  %76 = add <4 x i8> %wide.load, <i8 -65, i8 -65, i8 -65, i8 -65>
  %77 = add <4 x i8> %wide.load134, <i8 -65, i8 -65, i8 -65, i8 -65>
  %78 = icmp ult <4 x i8> %76, <i8 26, i8 26, i8 26, i8 26>
  %79 = icmp ult <4 x i8> %77, <i8 26, i8 26, i8 26, i8 26>
  %80 = zext <4 x i1> %78 to <4 x i32>
  %81 = zext <4 x i1> %79 to <4 x i32>
  %82 = add <4 x i32> %vec.phi, %80
  %83 = add <4 x i32> %vec.phi133, %81
  %index.next = add nuw i64 %index, 8
  %84 = icmp eq i64 %index.next, %n.vec
  br i1 %84, label %middle.block, label %vector.body, !llvm.loop !22

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %83, %82
  %85 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %._crit_edge46, label %.lr.ph45.split.split.split.preheader192

.lr.ph45.split.split.split.us.preheader:          ; preds = %.lr.ph45.split.split
  %86 = sext i32 %.fr77 to i64
  %wide.trip.count91 = zext nneg i32 %15 to i64
  %wide.trip.count86 = sext i32 %14 to i64
  %87 = sub nsw i64 %wide.trip.count86, %86
  %min.iters.check137 = icmp ult i64 %87, 4
  %n.vec140 = and i64 %87, -4
  %ind.end = add nsw i64 %n.vec140, %86
  %cmp.n145 = icmp eq i64 %87, %n.vec140
  br label %.lr.ph45.split.split.split.us

.lr.ph45.split.split.split.us:                    ; preds = %.lr.ph45.split.split.split.us.preheader, %._crit_edge.us74
  %indvars.iv88 = phi i64 [ 0, %.lr.ph45.split.split.split.us.preheader ], [ %indvars.iv.next89, %._crit_edge.us74 ]
  %.03241.us65 = phi i32 [ 0, %.lr.ph45.split.split.split.us.preheader ], [ %.1.us68, %._crit_edge.us74 ]
  %88 = getelementptr inbounds [1010 x i8], ptr @a, i64 0, i64 %indvars.iv88
  %89 = load i8, ptr %88, align 1, !tbaa !9
  %90 = add i8 %89, -65
  %or.cond.us66 = icmp ult i8 %90, 26
  %91 = zext i1 %or.cond.us66 to i32
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  br i1 %min.iters.check137, label %scalar.ph136.preheader, label %vector.body142

vector.body142:                                   ; preds = %.lr.ph45.split.split.split.us, %vector.body142
  %index143 = phi i64 [ %index.next144, %vector.body142 ], [ 0, %.lr.ph45.split.split.split.us ]
  %offset.idx = add i64 %index143, %86
  %92 = add nsw i64 %offset.idx, 1
  %93 = getelementptr inbounds [1010 x [1010 x i64]], ptr @cost, i64 0, i64 %indvars.iv.next89, i64 %92
  %94 = getelementptr inbounds i8, ptr %93, i64 16
  store <2 x i64> <i64 1099511627776, i64 1099511627776>, ptr %93, align 8, !tbaa !10
  store <2 x i64> <i64 1099511627776, i64 1099511627776>, ptr %94, align 8, !tbaa !10
  %index.next144 = add nuw i64 %index143, 4
  %95 = icmp eq i64 %index.next144, %n.vec140
  br i1 %95, label %middle.block135, label %vector.body142, !llvm.loop !23

middle.block135:                                  ; preds = %vector.body142
  br i1 %cmp.n145, label %._crit_edge.us74, label %scalar.ph136.preheader

scalar.ph136.preheader:                           ; preds = %middle.block135, %.lr.ph45.split.split.split.us
  %indvars.iv83.ph = phi i64 [ %86, %.lr.ph45.split.split.split.us ], [ %ind.end, %middle.block135 ]
  br label %scalar.ph136

scalar.ph136:                                     ; preds = %scalar.ph136.preheader, %scalar.ph136
  %indvars.iv83 = phi i64 [ %indvars.iv.next84, %scalar.ph136 ], [ %indvars.iv83.ph, %scalar.ph136.preheader ]
  %indvars.iv.next84 = add nsw i64 %indvars.iv83, 1
  %96 = getelementptr inbounds [1010 x [1010 x i64]], ptr @cost, i64 0, i64 %indvars.iv.next89, i64 %indvars.iv.next84
  store i64 1099511627776, ptr %96, align 8, !tbaa !10
  %exitcond87.not = icmp eq i64 %indvars.iv.next84, %wide.trip.count86
  br i1 %exitcond87.not, label %._crit_edge.us74, label %scalar.ph136, !llvm.loop !24

._crit_edge.us74:                                 ; preds = %scalar.ph136, %middle.block135
  %.1.us68 = add nuw nsw i32 %.03241.us65, %91
  %exitcond92.not = icmp eq i64 %indvars.iv.next89, %wide.trip.count91
  br i1 %exitcond92.not, label %._crit_edge46, label %.lr.ph45.split.split.split.us, !llvm.loop !17

._crit_edge46:                                    ; preds = %.lr.ph45.split.split.split, %._crit_edge.us74, %._crit_edge.us, %middle.block, %12
  %.032.lcssa = phi i32 [ 0, %12 ], [ %85, %middle.block ], [ %.1.us, %._crit_edge.us ], [ %.1.us68, %._crit_edge.us74 ], [ %.1, %.lr.ph45.split.split.split ]
  %97 = call noundef i64 @_Z24minCostBipartiteMatchingv()
  %98 = load i32, ptr %1, align 4, !tbaa !5
  %99 = load i32, ptr %2, align 4, !tbaa !5
  %100 = sub nsw i32 %98, %99
  %101 = sext i32 %100 to i64
  %102 = shl nsw i64 %101, 40
  %103 = sub nsw i64 %97, %102
  %104 = sext i32 %.032.lcssa to i64
  %105 = sext i32 %98 to i64
  %106 = mul nsw i64 %104, %105
  %107 = sub nsw i64 0, %106
  %108 = icmp eq i64 %103, %107
  br i1 %108, label %113, label %115

.lr.ph45.split.split.split:                       ; preds = %.lr.ph45.split.split.split.preheader192, %.lr.ph45.split.split.split
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph45.split.split.split ], [ %indvars.iv.ph, %.lr.ph45.split.split.split.preheader192 ]
  %.03241 = phi i32 [ %.1, %.lr.ph45.split.split.split ], [ %.03241.ph, %.lr.ph45.split.split.split.preheader192 ]
  %109 = getelementptr inbounds [1010 x i8], ptr @a, i64 0, i64 %indvars.iv
  %110 = load i8, ptr %109, align 1, !tbaa !9
  %111 = add i8 %110, -65
  %or.cond = icmp ult i8 %111, 26
  %112 = zext i1 %or.cond to i32
  %.1 = add nuw nsw i32 %.03241, %112
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge46, label %.lr.ph45.split.split.split, !llvm.loop !25

113:                                              ; preds = %._crit_edge46
  %114 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %117

115:                                              ; preds = %._crit_edge46
  %116 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %117

117:                                              ; preds = %113, %115, %10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret void
}

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4

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

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

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

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 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 nofree nounwind willreturn memory(argmem: read) "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 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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }

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


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