; LLVM IR from upupming/algorithm :: acwing/算法竞赛进阶指南/0x29-总结与练习/183. 靶形数独 (main)

; 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 }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@row = external dso_local global [9 x i32], align 16
@col = external dso_local global [9 x i32], align 16
@cell = external dso_local global [9 x [9 x i32]], align 16
@h = external dso_local global [512 x i32], align 16
@cnt = external dso_local global [512 x i32], align 16
@ans = external dso_local global i32, align 4
@g = external dso_local global [9 x [9 x i32]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z8getScoreii(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 uwtable
declare dso_local void @_Z3dfsii(i32 noundef, i32 noundef) #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z4flipiii(i32 noundef, i32 noundef, i32 noundef) #2

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

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

14:                                               ; preds = %11
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %24

15:                                               ; preds = %11
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = shl i32 1, %17
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [512 x i32], ptr @h, i64 0, i64 %19
  store i32 %16, ptr %20, align 4, !tbaa !5
  br label %21

21:                                               ; preds = %15
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = add nsw i32 %22, 1
  store i32 %23, ptr %2, align 4, !tbaa !5
  br label %11, !llvm.loop !9

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

25:                                               ; preds = %49, %24
  %26 = load i32, ptr %3, align 4, !tbaa !5
  %27 = icmp slt i32 %26, 512
  br i1 %27, label %29, label %28

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

29:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %30 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %30, ptr %5, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %41, %29
  %32 = load i32, ptr %5, align 4, !tbaa !5
  %33 = icmp ne i32 %32, 0
  br i1 %33, label %35, label %34

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

35:                                               ; preds = %31
  %36 = load i32, ptr %3, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [512 x i32], ptr @cnt, i64 0, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %38, align 4, !tbaa !5
  br label %41

41:                                               ; preds = %35
  %42 = load i32, ptr %5, align 4, !tbaa !5
  %43 = load i32, ptr %5, align 4, !tbaa !5
  %44 = sub nsw i32 0, %43
  %45 = and i32 %42, %44
  %46 = load i32, ptr %5, align 4, !tbaa !5
  %47 = sub nsw i32 %46, %45
  store i32 %47, ptr %5, align 4, !tbaa !5
  br label %31, !llvm.loop !11

48:                                               ; preds = %34
  br label %49

49:                                               ; preds = %48
  %50 = load i32, ptr %3, align 4, !tbaa !5
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %3, align 4, !tbaa !5
  br label %25, !llvm.loop !12

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

53:                                               ; preds = %72, %52
  %54 = load i32, ptr %8, align 4, !tbaa !5
  %55 = icmp slt i32 %54, 9
  br i1 %55, label %57, label %56

56:                                               ; preds = %53
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %75

57:                                               ; preds = %53
  %58 = load i32, ptr %8, align 4, !tbaa !5
  %59 = sdiv i32 %58, 3
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [9 x [9 x i32]], ptr @cell, i64 0, i64 %60
  %62 = load i32, ptr %8, align 4, !tbaa !5
  %63 = srem i32 %62, 3
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [9 x i32], ptr %61, i64 0, i64 %64
  store i32 511, ptr %65, align 4, !tbaa !5
  %66 = load i32, ptr %8, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [9 x i32], ptr @col, i64 0, i64 %67
  store i32 511, ptr %68, align 4, !tbaa !5
  %69 = load i32, ptr %8, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [9 x i32], ptr @row, i64 0, i64 %70
  store i32 511, ptr %71, align 4, !tbaa !5
  br label %72

72:                                               ; preds = %57
  %73 = load i32, ptr %8, align 4, !tbaa !5
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr %8, align 4, !tbaa !5
  br label %53, !llvm.loop !13

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

76:                                               ; preds = %133, %75
  %77 = load i32, ptr %9, align 4, !tbaa !5
  %78 = icmp slt i32 %77, 9
  br i1 %78, label %80, label %79

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

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

81:                                               ; preds = %129, %80
  %82 = load i32, ptr %10, align 4, !tbaa !5
  %83 = icmp slt i32 %82, 9
  br i1 %83, label %85, label %84

84:                                               ; preds = %81
  store i32 17, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %132

85:                                               ; preds = %81
  %86 = load i32, ptr %9, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [9 x [9 x i32]], ptr @g, i64 0, i64 %87
  %89 = load i32, ptr %10, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [9 x i32], ptr %88, i64 0, i64 %90
  %92 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %91)
  %93 = load i32, ptr %9, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [9 x [9 x i32]], ptr @g, i64 0, i64 %94
  %96 = load i32, ptr %10, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [9 x i32], ptr %95, i64 0, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = icmp ne i32 %99, 0
  br i1 %100, label %101, label %125

101:                                              ; preds = %85
  %102 = load i32, ptr %9, align 4, !tbaa !5
  %103 = load i32, ptr %10, align 4, !tbaa !5
  %104 = call noundef i32 @_Z8getScoreii(i32 noundef %102, i32 noundef %103)
  %105 = load i32, ptr %9, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [9 x [9 x i32]], ptr @g, i64 0, i64 %106
  %108 = load i32, ptr %10, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [9 x i32], ptr %107, i64 0, i64 %109
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %112 = mul nsw i32 %104, %111
  %113 = load i32, ptr %7, align 4, !tbaa !5
  %114 = add nsw i32 %113, %112
  store i32 %114, ptr %7, align 4, !tbaa !5
  %115 = load i32, ptr %9, align 4, !tbaa !5
  %116 = load i32, ptr %10, align 4, !tbaa !5
  %117 = load i32, ptr %9, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [9 x [9 x i32]], ptr @g, i64 0, i64 %118
  %120 = load i32, ptr %10, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [9 x i32], ptr %119, i64 0, i64 %121
  %123 = load i32, ptr %122, align 4, !tbaa !5
  %124 = sub nsw i32 %123, 1
  call void @_Z4flipiii(i32 noundef %115, i32 noundef %116, i32 noundef %124)
  br label %128

125:                                              ; preds = %85
  %126 = load i32, ptr %6, align 4, !tbaa !5
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %6, align 4, !tbaa !5
  br label %128

128:                                              ; preds = %125, %101
  br label %129

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

132:                                              ; preds = %84
  br label %133

133:                                              ; preds = %132
  %134 = load i32, ptr %9, align 4, !tbaa !5
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %9, align 4, !tbaa !5
  br label %76, !llvm.loop !15

136:                                              ; preds = %79
  %137 = load i32, ptr %6, align 4, !tbaa !5
  %138 = load i32, ptr %7, align 4, !tbaa !5
  call void @_Z3dfsii(i32 noundef %137, i32 noundef %138)
  %139 = load i32, ptr @ans, align 4, !tbaa !5
  %140 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %139)
  %141 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %140, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %142 = load i32, ptr %1, align 4
  ret i32 %142
}

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #4

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = 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}


; 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 }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@row = external dso_local local_unnamed_addr global [9 x i32], align 16
@col = external dso_local local_unnamed_addr global [9 x i32], align 16
@cell = external dso_local local_unnamed_addr global [9 x [9 x i32]], align 16
@h = external dso_local local_unnamed_addr global [512 x i32], align 16
@cnt = external dso_local local_unnamed_addr global [512 x i32], align 16
@ans = external dso_local local_unnamed_addr global i32, align 4
@g = external dso_local global [9 x [9 x i32]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z4flipiii(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
.preheader54.preheader:
  store i32 0, ptr getelementptr inbounds (i8, ptr @h, i64 4), align 4, !tbaa !5
  store i32 1, ptr getelementptr inbounds (i8, ptr @h, i64 8), align 8, !tbaa !5
  store i32 2, ptr getelementptr inbounds (i8, ptr @h, i64 16), align 16, !tbaa !5
  store i32 3, ptr getelementptr inbounds (i8, ptr @h, i64 32), align 16, !tbaa !5
  store i32 4, ptr getelementptr inbounds (i8, ptr @h, i64 64), align 16, !tbaa !5
  store i32 5, ptr getelementptr inbounds (i8, ptr @h, i64 128), align 16, !tbaa !5
  store i32 6, ptr getelementptr inbounds (i8, ptr @h, i64 256), align 16, !tbaa !5
  store i32 7, ptr getelementptr inbounds (i8, ptr @h, i64 512), align 16, !tbaa !5
  store i32 8, ptr getelementptr inbounds (i8, ptr @h, i64 1024), align 16, !tbaa !5
  br label %.preheader54

.preheader54:                                     ; preds = %._crit_edge.1, %.preheader54.preheader
  %indvars.iv = phi i64 [ 0, %.preheader54.preheader ], [ %indvars.iv.next.1, %._crit_edge.1 ]
  %.not4857 = icmp eq i64 %indvars.iv, 0
  br i1 %.not4857, label %.lr.ph.1, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader54
  %0 = getelementptr inbounds [512 x i32], ptr @cnt, i64 0, i64 %indvars.iv
  %.promoted = load i32, ptr %0, align 8, !tbaa !5
  %1 = trunc nuw nsw i64 %indvars.iv to i32
  br label %8

._crit_edge:                                      ; preds = %8
  store i32 %10, ptr %0, align 8, !tbaa !5
  br label %.lr.ph.1

.lr.ph.1:                                         ; preds = %.preheader54, %._crit_edge
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %2 = getelementptr inbounds [512 x i32], ptr @cnt, i64 0, i64 %indvars.iv.next
  %.promoted.1 = load i32, ptr %2, align 4, !tbaa !5
  %3 = trunc nuw nsw i64 %indvars.iv.next to i32
  br label %4

4:                                                ; preds = %4, %.lr.ph.1
  %5 = phi i32 [ %.promoted.1, %.lr.ph.1 ], [ %6, %4 ]
  %.04558.1 = phi i32 [ %3, %.lr.ph.1 ], [ %7, %4 ]
  %6 = add nsw i32 %5, 1
  %.not49.1 = add i32 %.04558.1, -1
  %7 = and i32 %.not49.1, %.04558.1
  %.not48.1 = icmp eq i32 %7, 0
  br i1 %.not48.1, label %._crit_edge.1, label %4, !llvm.loop !9

._crit_edge.1:                                    ; preds = %4
  store i32 %6, ptr %2, align 4, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, 512
  br i1 %exitcond.not.1, label %.preheader53.preheader, label %.preheader54, !llvm.loop !11

.preheader53.preheader:                           ; preds = %._crit_edge.1
  store i32 511, ptr @cell, align 16, !tbaa !5
  store i32 511, ptr getelementptr inbounds (i8, ptr @cell, i64 4), align 4, !tbaa !5
  store i32 511, ptr getelementptr inbounds (i8, ptr @cell, i64 8), align 8, !tbaa !5
  store i32 511, ptr getelementptr inbounds (i8, ptr @cell, i64 36), align 4, !tbaa !5
  store <4 x i32> <i32 511, i32 511, i32 511, i32 511>, ptr @col, align 16, !tbaa !5
  store <4 x i32> <i32 511, i32 511, i32 511, i32 511>, ptr @row, align 16, !tbaa !5
  store i32 511, ptr getelementptr inbounds (i8, ptr @cell, i64 40), align 8, !tbaa !5
  store i32 511, ptr getelementptr inbounds (i8, ptr @cell, i64 44), align 4, !tbaa !5
  store i32 511, ptr getelementptr inbounds (i8, ptr @cell, i64 72), align 8, !tbaa !5
  store i32 511, ptr getelementptr inbounds (i8, ptr @cell, i64 76), align 4, !tbaa !5
  store <4 x i32> <i32 511, i32 511, i32 511, i32 511>, ptr getelementptr inbounds (i8, ptr @col, i64 16), align 16, !tbaa !5
  store <4 x i32> <i32 511, i32 511, i32 511, i32 511>, ptr getelementptr inbounds (i8, ptr @row, i64 16), align 16, !tbaa !5
  store i32 511, ptr getelementptr inbounds (i8, ptr @cell, i64 80), align 16, !tbaa !5
  store i32 511, ptr getelementptr inbounds (i8, ptr @col, i64 32), align 16, !tbaa !5
  store i32 511, ptr getelementptr inbounds (i8, ptr @row, i64 32), align 16, !tbaa !5
  br label %.preheader

8:                                                ; preds = %.lr.ph, %8
  %9 = phi i32 [ %.promoted, %.lr.ph ], [ %10, %8 ]
  %.04558 = phi i32 [ %1, %.lr.ph ], [ %11, %8 ]
  %10 = add nsw i32 %9, 1
  %.not49 = add i32 %.04558, -1
  %11 = and i32 %.not49, %.04558
  %.not48 = icmp eq i32 %11, 0
  br i1 %.not48, label %._crit_edge, label %8, !llvm.loop !9

.preheader:                                       ; preds = %.preheader53.preheader, %132
  %indvars.iv76 = phi i64 [ 0, %.preheader53.preheader ], [ %indvars.iv.next77, %132 ]
  %.04165 = phi i32 [ 0, %.preheader53.preheader ], [ %.2.8, %132 ]
  %.04264 = phi i32 [ 0, %.preheader53.preheader ], [ %.244.8, %132 ]
  %12 = getelementptr inbounds [9 x [9 x i32]], ptr @g, i64 0, i64 %indvars.iv76, i64 0
  %13 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %14 = load i32, ptr %12, align 4, !tbaa !5
  %.not = icmp eq i32 %14, 0
  br i1 %.not, label %26, label %19

15:                                               ; preds = %132
  tail call void @_Z3dfsii(i32 noundef %.244.8, i32 noundef %.2.8)
  %16 = load i32, ptr @ans, align 4, !tbaa !5
  %17 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %16)
  %18 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0

19:                                               ; preds = %.preheader
  %20 = trunc nuw nsw i64 %indvars.iv76 to i32
  %21 = tail call noundef i32 @_Z8getScoreii(i32 noundef %20, i32 noundef 0)
  %22 = load i32, ptr %12, align 4, !tbaa !5
  %23 = mul nsw i32 %22, %21
  %24 = add nsw i32 %23, %.04165
  %25 = add nsw i32 %22, -1
  tail call void @_Z4flipiii(i32 noundef %20, i32 noundef 0, i32 noundef %25)
  br label %28

26:                                               ; preds = %.preheader
  %27 = add nsw i32 %.04264, 1
  br label %28

28:                                               ; preds = %19, %26
  %.244 = phi i32 [ %.04264, %19 ], [ %27, %26 ]
  %.2 = phi i32 [ %24, %19 ], [ %.04165, %26 ]
  %29 = getelementptr inbounds [9 x [9 x i32]], ptr @g, i64 0, i64 %indvars.iv76, i64 1
  %30 = tail 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)
  %31 = load i32, ptr %29, align 4, !tbaa !5
  %.not.1 = icmp eq i32 %31, 0
  br i1 %.not.1, label %39, label %32

32:                                               ; preds = %28
  %33 = trunc nuw nsw i64 %indvars.iv76 to i32
  %34 = tail call noundef i32 @_Z8getScoreii(i32 noundef %33, i32 noundef 1)
  %35 = load i32, ptr %29, align 4, !tbaa !5
  %36 = mul nsw i32 %35, %34
  %37 = add nsw i32 %36, %.2
  %38 = add nsw i32 %35, -1
  tail call void @_Z4flipiii(i32 noundef %33, i32 noundef 1, i32 noundef %38)
  br label %41

39:                                               ; preds = %28
  %40 = add nsw i32 %.244, 1
  br label %41

41:                                               ; preds = %39, %32
  %.244.1 = phi i32 [ %.244, %32 ], [ %40, %39 ]
  %.2.1 = phi i32 [ %37, %32 ], [ %.2, %39 ]
  %42 = getelementptr inbounds [9 x [9 x i32]], ptr @g, i64 0, i64 %indvars.iv76, i64 2
  %43 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %42)
  %44 = load i32, ptr %42, align 4, !tbaa !5
  %.not.2 = icmp eq i32 %44, 0
  br i1 %.not.2, label %52, label %45

45:                                               ; preds = %41
  %46 = trunc nuw nsw i64 %indvars.iv76 to i32
  %47 = tail call noundef i32 @_Z8getScoreii(i32 noundef %46, i32 noundef 2)
  %48 = load i32, ptr %42, align 4, !tbaa !5
  %49 = mul nsw i32 %48, %47
  %50 = add nsw i32 %49, %.2.1
  %51 = add nsw i32 %48, -1
  tail call void @_Z4flipiii(i32 noundef %46, i32 noundef 2, i32 noundef %51)
  br label %54

52:                                               ; preds = %41
  %53 = add nsw i32 %.244.1, 1
  br label %54

54:                                               ; preds = %52, %45
  %.244.2 = phi i32 [ %.244.1, %45 ], [ %53, %52 ]
  %.2.2 = phi i32 [ %50, %45 ], [ %.2.1, %52 ]
  %55 = getelementptr inbounds [9 x [9 x i32]], ptr @g, i64 0, i64 %indvars.iv76, i64 3
  %56 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %55)
  %57 = load i32, ptr %55, align 4, !tbaa !5
  %.not.3 = icmp eq i32 %57, 0
  br i1 %.not.3, label %65, label %58

58:                                               ; preds = %54
  %59 = trunc nuw nsw i64 %indvars.iv76 to i32
  %60 = tail call noundef i32 @_Z8getScoreii(i32 noundef %59, i32 noundef 3)
  %61 = load i32, ptr %55, align 4, !tbaa !5
  %62 = mul nsw i32 %61, %60
  %63 = add nsw i32 %62, %.2.2
  %64 = add nsw i32 %61, -1
  tail call void @_Z4flipiii(i32 noundef %59, i32 noundef 3, i32 noundef %64)
  br label %67

65:                                               ; preds = %54
  %66 = add nsw i32 %.244.2, 1
  br label %67

67:                                               ; preds = %65, %58
  %.244.3 = phi i32 [ %.244.2, %58 ], [ %66, %65 ]
  %.2.3 = phi i32 [ %63, %58 ], [ %.2.2, %65 ]
  %68 = getelementptr inbounds [9 x [9 x i32]], ptr @g, i64 0, i64 %indvars.iv76, i64 4
  %69 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %68)
  %70 = load i32, ptr %68, align 4, !tbaa !5
  %.not.4 = icmp eq i32 %70, 0
  br i1 %.not.4, label %78, label %71

71:                                               ; preds = %67
  %72 = trunc nuw nsw i64 %indvars.iv76 to i32
  %73 = tail call noundef i32 @_Z8getScoreii(i32 noundef %72, i32 noundef 4)
  %74 = load i32, ptr %68, align 4, !tbaa !5
  %75 = mul nsw i32 %74, %73
  %76 = add nsw i32 %75, %.2.3
  %77 = add nsw i32 %74, -1
  tail call void @_Z4flipiii(i32 noundef %72, i32 noundef 4, i32 noundef %77)
  br label %80

78:                                               ; preds = %67
  %79 = add nsw i32 %.244.3, 1
  br label %80

80:                                               ; preds = %78, %71
  %.244.4 = phi i32 [ %.244.3, %71 ], [ %79, %78 ]
  %.2.4 = phi i32 [ %76, %71 ], [ %.2.3, %78 ]
  %81 = getelementptr inbounds [9 x [9 x i32]], ptr @g, i64 0, i64 %indvars.iv76, i64 5
  %82 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %81)
  %83 = load i32, ptr %81, align 4, !tbaa !5
  %.not.5 = icmp eq i32 %83, 0
  br i1 %.not.5, label %91, label %84

84:                                               ; preds = %80
  %85 = trunc nuw nsw i64 %indvars.iv76 to i32
  %86 = tail call noundef i32 @_Z8getScoreii(i32 noundef %85, i32 noundef 5)
  %87 = load i32, ptr %81, align 4, !tbaa !5
  %88 = mul nsw i32 %87, %86
  %89 = add nsw i32 %88, %.2.4
  %90 = add nsw i32 %87, -1
  tail call void @_Z4flipiii(i32 noundef %85, i32 noundef 5, i32 noundef %90)
  br label %93

91:                                               ; preds = %80
  %92 = add nsw i32 %.244.4, 1
  br label %93

93:                                               ; preds = %91, %84
  %.244.5 = phi i32 [ %.244.4, %84 ], [ %92, %91 ]
  %.2.5 = phi i32 [ %89, %84 ], [ %.2.4, %91 ]
  %94 = getelementptr inbounds [9 x [9 x i32]], ptr @g, i64 0, i64 %indvars.iv76, i64 6
  %95 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %94)
  %96 = load i32, ptr %94, align 4, !tbaa !5
  %.not.6 = icmp eq i32 %96, 0
  br i1 %.not.6, label %104, label %97

97:                                               ; preds = %93
  %98 = trunc nuw nsw i64 %indvars.iv76 to i32
  %99 = tail call noundef i32 @_Z8getScoreii(i32 noundef %98, i32 noundef 6)
  %100 = load i32, ptr %94, align 4, !tbaa !5
  %101 = mul nsw i32 %100, %99
  %102 = add nsw i32 %101, %.2.5
  %103 = add nsw i32 %100, -1
  tail call void @_Z4flipiii(i32 noundef %98, i32 noundef 6, i32 noundef %103)
  br label %106

104:                                              ; preds = %93
  %105 = add nsw i32 %.244.5, 1
  br label %106

106:                                              ; preds = %104, %97
  %.244.6 = phi i32 [ %.244.5, %97 ], [ %105, %104 ]
  %.2.6 = phi i32 [ %102, %97 ], [ %.2.5, %104 ]
  %107 = getelementptr inbounds [9 x [9 x i32]], ptr @g, i64 0, i64 %indvars.iv76, i64 7
  %108 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %107)
  %109 = load i32, ptr %107, align 4, !tbaa !5
  %.not.7 = icmp eq i32 %109, 0
  br i1 %.not.7, label %117, label %110

110:                                              ; preds = %106
  %111 = trunc nuw nsw i64 %indvars.iv76 to i32
  %112 = tail call noundef i32 @_Z8getScoreii(i32 noundef %111, i32 noundef 7)
  %113 = load i32, ptr %107, align 4, !tbaa !5
  %114 = mul nsw i32 %113, %112
  %115 = add nsw i32 %114, %.2.6
  %116 = add nsw i32 %113, -1
  tail call void @_Z4flipiii(i32 noundef %111, i32 noundef 7, i32 noundef %116)
  br label %119

117:                                              ; preds = %106
  %118 = add nsw i32 %.244.6, 1
  br label %119

119:                                              ; preds = %117, %110
  %.244.7 = phi i32 [ %.244.6, %110 ], [ %118, %117 ]
  %.2.7 = phi i32 [ %115, %110 ], [ %.2.6, %117 ]
  %120 = getelementptr inbounds [9 x [9 x i32]], ptr @g, i64 0, i64 %indvars.iv76, i64 8
  %121 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %120)
  %122 = load i32, ptr %120, align 4, !tbaa !5
  %.not.8 = icmp eq i32 %122, 0
  br i1 %.not.8, label %130, label %123

123:                                              ; preds = %119
  %124 = trunc nuw nsw i64 %indvars.iv76 to i32
  %125 = tail call noundef i32 @_Z8getScoreii(i32 noundef %124, i32 noundef 8)
  %126 = load i32, ptr %120, align 4, !tbaa !5
  %127 = mul nsw i32 %126, %125
  %128 = add nsw i32 %127, %.2.7
  %129 = add nsw i32 %126, -1
  tail call void @_Z4flipiii(i32 noundef %124, i32 noundef 8, i32 noundef %129)
  br label %132

130:                                              ; preds = %119
  %131 = add nsw i32 %.244.7, 1
  br label %132

132:                                              ; preds = %130, %123
  %.244.8 = phi i32 [ %.244.7, %123 ], [ %131, %130 ]
  %.2.8 = phi i32 [ %128, %123 ], [ %.2.7, %130 ]
  %indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
  %exitcond79.not = icmp eq i64 %indvars.iv.next77, 9
  br i1 %exitcond79.not, label %15, label %.preheader, !llvm.loop !12
}

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

attributes #0 = { 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 #1 = { 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 #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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }

!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}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass