; LLVM IR from Bousk/Net :: NetworkLib/Samples/Games/TicTacToe/Game.ll (ZN9TicTacToe4Grid4playEjjNS_4CaseE)

; 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.TicTacToe::Grid" = type <{ %"struct.std::array", i32, i8, [3 x i8] }>
%"struct.std::array" = type { [3 x %"struct.std::array.0"] }
%"struct.std::array.0" = type { [3 x i32] }

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN9TicTacToe4Grid4playEjjNS_4CaseE(ptr noundef nonnull align 4 dereferenceable(41) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) #0 align 2 {
  %5 = alloca i1, align 1
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i8, align 1
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store i32 %2, ptr %8, align 4, !tbaa !9
  store i32 %3, ptr %9, align 4, !tbaa !11
  %11 = load ptr, ptr %6, align 8
  %12 = load i32, ptr %7, align 4, !tbaa !9
  %13 = icmp ugt i32 %12, 2
  br i1 %13, label %17, label %14

14:                                               ; preds = %4
  %15 = load i32, ptr %8, align 4, !tbaa !9
  %16 = icmp ugt i32 %15, 2
  br i1 %16, label %17, label %18

17:                                               ; preds = %14, %4
  store i1 false, ptr %5, align 1
  br label %183

18:                                               ; preds = %14
  %19 = getelementptr inbounds %"class.TicTacToe::Grid", ptr %11, i32 0, i32 0
  %20 = load i32, ptr %7, align 4, !tbaa !9
  %21 = zext i32 %20 to i64
  %22 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5arrayIS_IN9TicTacToe4CaseELm3EELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(36) %19, i64 noundef %21) #3
  %23 = load i32, ptr %8, align 4, !tbaa !9
  %24 = zext i32 %23 to i64
  %25 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIN9TicTacToe4CaseELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %22, i64 noundef %24) #3
  %26 = load i32, ptr %25, align 4, !tbaa !11
  %27 = icmp ne i32 %26, 0
  br i1 %27, label %28, label %29

28:                                               ; preds = %18
  store i1 false, ptr %5, align 1
  br label %183

29:                                               ; preds = %18
  %30 = load i32, ptr %9, align 4, !tbaa !11
  %31 = getelementptr inbounds %"class.TicTacToe::Grid", ptr %11, i32 0, i32 0
  %32 = load i32, ptr %7, align 4, !tbaa !9
  %33 = zext i32 %32 to i64
  %34 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5arrayIS_IN9TicTacToe4CaseELm3EELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(36) %31, i64 noundef %33) #3
  %35 = load i32, ptr %8, align 4, !tbaa !9
  %36 = zext i32 %35 to i64
  %37 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIN9TicTacToe4CaseELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %34, i64 noundef %36) #3
  store i32 %30, ptr %37, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #3
  %38 = getelementptr inbounds %"class.TicTacToe::Grid", ptr %11, i32 0, i32 0
  %39 = load i32, ptr %7, align 4, !tbaa !9
  %40 = zext i32 %39 to i64
  %41 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5arrayIS_IN9TicTacToe4CaseELm3EELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(36) %38, i64 noundef %40) #3
  %42 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIN9TicTacToe4CaseELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %41, i64 noundef 0) #3
  %43 = load i32, ptr %42, align 4, !tbaa !11
  %44 = getelementptr inbounds %"class.TicTacToe::Grid", ptr %11, i32 0, i32 0
  %45 = load i32, ptr %7, align 4, !tbaa !9
  %46 = zext i32 %45 to i64
  %47 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5arrayIS_IN9TicTacToe4CaseELm3EELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(36) %44, i64 noundef %46) #3
  %48 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIN9TicTacToe4CaseELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %47, i64 noundef 1) #3
  %49 = load i32, ptr %48, align 4, !tbaa !11
  %50 = icmp eq i32 %43, %49
  br i1 %50, label %51, label %65

51:                                               ; preds = %29
  %52 = getelementptr inbounds %"class.TicTacToe::Grid", ptr %11, i32 0, i32 0
  %53 = load i32, ptr %7, align 4, !tbaa !9
  %54 = zext i32 %53 to i64
  %55 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5arrayIS_IN9TicTacToe4CaseELm3EELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(36) %52, i64 noundef %54) #3
  %56 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIN9TicTacToe4CaseELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %55, i64 noundef 1) #3
  %57 = load i32, ptr %56, align 4, !tbaa !11
  %58 = getelementptr inbounds %"class.TicTacToe::Grid", ptr %11, i32 0, i32 0
  %59 = load i32, ptr %7, align 4, !tbaa !9
  %60 = zext i32 %59 to i64
  %61 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5arrayIS_IN9TicTacToe4CaseELm3EELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(36) %58, i64 noundef %60) #3
  %62 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIN9TicTacToe4CaseELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %61, i64 noundef 2) #3
  %63 = load i32, ptr %62, align 4, !tbaa !11
  %64 = icmp eq i32 %57, %63
  br label %65

65:                                               ; preds = %51, %29
  %66 = phi i1 [ false, %29 ], [ %64, %51 ]
  %67 = zext i1 %66 to i8
  store i8 %67, ptr %10, align 1, !tbaa !13
  %68 = getelementptr inbounds %"class.TicTacToe::Grid", ptr %11, i32 0, i32 0
  %69 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5arrayIS_IN9TicTacToe4CaseELm3EELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(36) %68, i64 noundef 0) #3
  %70 = load i32, ptr %8, align 4, !tbaa !9
  %71 = zext i32 %70 to i64
  %72 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIN9TicTacToe4CaseELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %69, i64 noundef %71) #3
  %73 = load i32, ptr %72, align 4, !tbaa !11
  %74 = getelementptr inbounds %"class.TicTacToe::Grid", ptr %11, i32 0, i32 0
  %75 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5arrayIS_IN9TicTacToe4CaseELm3EELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(36) %74, i64 noundef 1) #3
  %76 = load i32, ptr %8, align 4, !tbaa !9
  %77 = zext i32 %76 to i64
  %78 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIN9TicTacToe4CaseELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %75, i64 noundef %77) #3
  %79 = load i32, ptr %78, align 4, !tbaa !11
  %80 = icmp eq i32 %73, %79
  br i1 %80, label %81, label %95

81:                                               ; preds = %65
  %82 = getelementptr inbounds %"class.TicTacToe::Grid", ptr %11, i32 0, i32 0
  %83 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5arrayIS_IN9TicTacToe4CaseELm3EELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(36) %82, i64 noundef 1) #3
  %84 = load i32, ptr %8, align 4, !tbaa !9
  %85 = zext i32 %84 to i64
  %86 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIN9TicTacToe4CaseELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %83, i64 noundef %85) #3
  %87 = load i32, ptr %86, align 4, !tbaa !11
  %88 = getelementptr inbounds %"class.TicTacToe::Grid", ptr %11, i32 0, i32 0
  %89 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5arrayIS_IN9TicTacToe4CaseELm3EELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(36) %88, i64 noundef 2) #3
  %90 = load i32, ptr %8, align 4, !tbaa !9
  %91 = zext i32 %90 to i64
  %92 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIN9TicTacToe4CaseELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %89, i64 noundef %91) #3
  %93 = load i32, ptr %92, align 4, !tbaa !11
  %94 = icmp eq i32 %87, %93
  br label %95

95:                                               ; preds = %81, %65
  %96 = phi i1 [ false, %65 ], [ %94, %81 ]
  %97 = zext i1 %96 to i32
  %98 = load i8, ptr %10, align 1, !tbaa !13, !range !15, !noundef !16
  %99 = trunc i8 %98 to i1
  %100 = zext i1 %99 to i32
  %101 = or i32 %100, %97
  %102 = icmp ne i32 %101, 0
  %103 = zext i1 %102 to i8
  store i8 %103, ptr %10, align 1, !tbaa !13
  %104 = load i32, ptr %7, align 4, !tbaa !9
  %105 = load i32, ptr %8, align 4, !tbaa !9
  %106 = icmp eq i32 %104, %105
  br i1 %106, label %107, label %136

107:                                              ; preds = %95
  %108 = getelementptr inbounds %"class.TicTacToe::Grid", ptr %11, i32 0, i32 0
  %109 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5arrayIS_IN9TicTacToe4CaseELm3EELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(36) %108, i64 noundef 0) #3
  %110 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIN9TicTacToe4CaseELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %109, i64 noundef 0) #3
  %111 = load i32, ptr %110, align 4, !tbaa !11
  %112 = getelementptr inbounds %"class.TicTacToe::Grid", ptr %11, i32 0, i32 0
  %113 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5arrayIS_IN9TicTacToe4CaseELm3EELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(36) %112, i64 noundef 1) #3
  %114 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIN9TicTacToe4CaseELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %113, i64 noundef 1) #3
  %115 = load i32, ptr %114, align 4, !tbaa !11
  %116 = icmp eq i32 %111, %115
  br i1 %116, label %117, label %127

117:                                              ; preds = %107
  %118 = getelementptr inbounds %"class.TicTacToe::Grid", ptr %11, i32 0, i32 0
  %119 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5arrayIS_IN9TicTacToe4CaseELm3EELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(36) %118, i64 noundef 1) #3
  %120 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIN9TicTacToe4CaseELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %119, i64 noundef 1) #3
  %121 = load i32, ptr %120, align 4, !tbaa !11
  %122 = getelementptr inbounds %"class.TicTacToe::Grid", ptr %11, i32 0, i32 0
  %123 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5arrayIS_IN9TicTacToe4CaseELm3EELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(36) %122, i64 noundef 2) #3
  %124 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIN9TicTacToe4CaseELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %123, i64 noundef 2) #3
  %125 = load i32, ptr %124, align 4, !tbaa !11
  %126 = icmp eq i32 %121, %125
  br label %127

127:                                              ; preds = %117, %107
  %128 = phi i1 [ false, %107 ], [ %126, %117 ]
  %129 = zext i1 %128 to i32
  %130 = load i8, ptr %10, align 1, !tbaa !13, !range !15, !noundef !16
  %131 = trunc i8 %130 to i1
  %132 = zext i1 %131 to i32
  %133 = or i32 %132, %129
  %134 = icmp ne i32 %133, 0
  %135 = zext i1 %134 to i8
  store i8 %135, ptr %10, align 1, !tbaa !13
  br label %136

136:                                              ; preds = %127, %95
  %137 = load i32, ptr %7, align 4, !tbaa !9
  %138 = load i32, ptr %8, align 4, !tbaa !9
  %139 = add i32 %137, %138
  %140 = icmp eq i32 %139, 2
  br i1 %140, label %141, label %170

141:                                              ; preds = %136
  %142 = getelementptr inbounds %"class.TicTacToe::Grid", ptr %11, i32 0, i32 0
  %143 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5arrayIS_IN9TicTacToe4CaseELm3EELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(36) %142, i64 noundef 2) #3
  %144 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIN9TicTacToe4CaseELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %143, i64 noundef 0) #3
  %145 = load i32, ptr %144, align 4, !tbaa !11
  %146 = getelementptr inbounds %"class.TicTacToe::Grid", ptr %11, i32 0, i32 0
  %147 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5arrayIS_IN9TicTacToe4CaseELm3EELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(36) %146, i64 noundef 1) #3
  %148 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIN9TicTacToe4CaseELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %147, i64 noundef 1) #3
  %149 = load i32, ptr %148, align 4, !tbaa !11
  %150 = icmp eq i32 %145, %149
  br i1 %150, label %151, label %161

151:                                              ; preds = %141
  %152 = getelementptr inbounds %"class.TicTacToe::Grid", ptr %11, i32 0, i32 0
  %153 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5arrayIS_IN9TicTacToe4CaseELm3EELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(36) %152, i64 noundef 1) #3
  %154 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIN9TicTacToe4CaseELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %153, i64 noundef 1) #3
  %155 = load i32, ptr %154, align 4, !tbaa !11
  %156 = getelementptr inbounds %"class.TicTacToe::Grid", ptr %11, i32 0, i32 0
  %157 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5arrayIS_IN9TicTacToe4CaseELm3EELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(36) %156, i64 noundef 0) #3
  %158 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIN9TicTacToe4CaseELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %157, i64 noundef 2) #3
  %159 = load i32, ptr %158, align 4, !tbaa !11
  %160 = icmp eq i32 %155, %159
  br label %161

161:                                              ; preds = %151, %141
  %162 = phi i1 [ false, %141 ], [ %160, %151 ]
  %163 = zext i1 %162 to i32
  %164 = load i8, ptr %10, align 1, !tbaa !13, !range !15, !noundef !16
  %165 = trunc i8 %164 to i1
  %166 = zext i1 %165 to i32
  %167 = or i32 %166, %163
  %168 = icmp ne i32 %167, 0
  %169 = zext i1 %168 to i8
  store i8 %169, ptr %10, align 1, !tbaa !13
  br label %170

170:                                              ; preds = %161, %136
  %171 = load i8, ptr %10, align 1, !tbaa !13, !range !15, !noundef !16
  %172 = trunc i8 %171 to i1
  br i1 %172, label %173, label %177

173:                                              ; preds = %170
  %174 = load i32, ptr %9, align 4, !tbaa !11
  %175 = getelementptr inbounds %"class.TicTacToe::Grid", ptr %11, i32 0, i32 1
  store i32 %174, ptr %175, align 4, !tbaa !17
  %176 = getelementptr inbounds %"class.TicTacToe::Grid", ptr %11, i32 0, i32 2
  store i8 1, ptr %176, align 4, !tbaa !20
  br label %182

177:                                              ; preds = %170
  %178 = call noundef zeroext i1 @_ZNK9TicTacToe4Grid10isGridFullEv(ptr noundef nonnull align 4 dereferenceable(41) %11)
  br i1 %178, label %179, label %181

179:                                              ; preds = %177
  %180 = getelementptr inbounds %"class.TicTacToe::Grid", ptr %11, i32 0, i32 2
  store i8 1, ptr %180, align 4, !tbaa !20
  br label %181

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

182:                                              ; preds = %181, %173
  store i1 true, ptr %5, align 1
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #3
  br label %183

183:                                              ; preds = %182, %28, %17
  %184 = load i1, ptr %5, align 1
  ret i1 %184
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5arrayIS_IN9TicTacToe4CaseELm3EELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(36), i64 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIN9TicTacToe4CaseELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12), i64 noundef) #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK9TicTacToe4Grid10isGridFullEv(ptr noundef nonnull align 4 dereferenceable(41)) #1 align 2

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

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 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_ZTSN9TicTacToe4CaseE", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!18, !12, i64 36}
!18 = !{!"_ZTSN9TicTacToe4GridE", !19, i64 0, !12, i64 36, !14, i64 40}
!19 = !{!"_ZTSSt5arrayIS_IN9TicTacToe4CaseELm3EELm3EE", !7, i64 0}
!20 = !{!18, !14, i64 40}


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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef zeroext i1 @_ZN9TicTacToe4Grid4playEjjNS_4CaseE(ptr noundef nonnull align 4 dereferenceable(41) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #0 align 2 {
  %5 = icmp ugt i32 %1, 2
  %6 = icmp ugt i32 %2, 2
  %or.cond = or i1 %5, %6
  br i1 %or.cond, label %99, label %7

7:                                                ; preds = %4
  %8 = zext nneg i32 %1 to i64
  %9 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5arrayIS_IN9TicTacToe4CaseELm3EELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(36) %0, i64 noundef %8) #1
  %10 = zext nneg i32 %2 to i64
  %11 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIN9TicTacToe4CaseELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %9, i64 noundef %10) #1
  %12 = load i32, ptr %11, align 4, !tbaa !5
  %.not = icmp eq i32 %12, 0
  br i1 %.not, label %13, label %99

13:                                               ; preds = %7
  %14 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5arrayIS_IN9TicTacToe4CaseELm3EELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(36) %0, i64 noundef %8) #1
  %15 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIN9TicTacToe4CaseELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %14, i64 noundef %10) #1
  store i32 %3, ptr %15, align 4, !tbaa !5
  %16 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5arrayIS_IN9TicTacToe4CaseELm3EELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(36) %0, i64 noundef %8) #1
  %17 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIN9TicTacToe4CaseELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %16, i64 noundef 0) #1
  %18 = load i32, ptr %17, align 4, !tbaa !5
  %19 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5arrayIS_IN9TicTacToe4CaseELm3EELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(36) %0, i64 noundef %8) #1
  %20 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIN9TicTacToe4CaseELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %19, i64 noundef 1) #1
  %21 = load i32, ptr %20, align 4, !tbaa !5
  %22 = icmp eq i32 %18, %21
  br i1 %22, label %23, label %31

23:                                               ; preds = %13
  %24 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5arrayIS_IN9TicTacToe4CaseELm3EELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(36) %0, i64 noundef %8) #1
  %25 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIN9TicTacToe4CaseELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %24, i64 noundef 1) #1
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %27 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5arrayIS_IN9TicTacToe4CaseELm3EELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(36) %0, i64 noundef %8) #1
  %28 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIN9TicTacToe4CaseELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %27, i64 noundef 2) #1
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = icmp eq i32 %26, %29
  br label %31

31:                                               ; preds = %23, %13
  %32 = phi i1 [ false, %13 ], [ %30, %23 ]
  %33 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5arrayIS_IN9TicTacToe4CaseELm3EELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(36) %0, i64 noundef 0) #1
  %34 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIN9TicTacToe4CaseELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %33, i64 noundef %10) #1
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %36 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5arrayIS_IN9TicTacToe4CaseELm3EELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(36) %0, i64 noundef 1) #1
  %37 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIN9TicTacToe4CaseELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %36, i64 noundef %10) #1
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = icmp eq i32 %35, %38
  br i1 %39, label %40, label %48

40:                                               ; preds = %31
  %41 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5arrayIS_IN9TicTacToe4CaseELm3EELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(36) %0, i64 noundef 1) #1
  %42 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIN9TicTacToe4CaseELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %41, i64 noundef %10) #1
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5arrayIS_IN9TicTacToe4CaseELm3EELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(36) %0, i64 noundef 2) #1
  %45 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIN9TicTacToe4CaseELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %44, i64 noundef %10) #1
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = icmp eq i32 %43, %46
  br label %48

48:                                               ; preds = %40, %31
  %49 = phi i1 [ false, %31 ], [ %47, %40 ]
  %50 = or i1 %32, %49
  %51 = icmp eq i32 %1, %2
  br i1 %51, label %52, label %71

52:                                               ; preds = %48
  %53 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5arrayIS_IN9TicTacToe4CaseELm3EELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(36) %0, i64 noundef 0) #1
  %54 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIN9TicTacToe4CaseELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %53, i64 noundef 0) #1
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5arrayIS_IN9TicTacToe4CaseELm3EELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(36) %0, i64 noundef 1) #1
  %57 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIN9TicTacToe4CaseELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %56, i64 noundef 1) #1
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = icmp eq i32 %55, %58
  br i1 %59, label %60, label %68

60:                                               ; preds = %52
  %61 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5arrayIS_IN9TicTacToe4CaseELm3EELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(36) %0, i64 noundef 1) #1
  %62 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIN9TicTacToe4CaseELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %61, i64 noundef 1) #1
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5arrayIS_IN9TicTacToe4CaseELm3EELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(36) %0, i64 noundef 2) #1
  %65 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIN9TicTacToe4CaseELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %64, i64 noundef 2) #1
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = icmp eq i32 %63, %66
  br label %68

68:                                               ; preds = %60, %52
  %69 = phi i1 [ false, %52 ], [ %67, %60 ]
  %70 = or i1 %50, %69
  br label %71

71:                                               ; preds = %68, %48
  %.0.in = phi i1 [ %70, %68 ], [ %50, %48 ]
  %72 = add nuw nsw i32 %2, %1
  %73 = icmp eq i32 %72, 2
  br i1 %73, label %74, label %93

74:                                               ; preds = %71
  %75 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5arrayIS_IN9TicTacToe4CaseELm3EELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(36) %0, i64 noundef 2) #1
  %76 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIN9TicTacToe4CaseELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %75, i64 noundef 0) #1
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5arrayIS_IN9TicTacToe4CaseELm3EELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(36) %0, i64 noundef 1) #1
  %79 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIN9TicTacToe4CaseELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %78, i64 noundef 1) #1
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = icmp eq i32 %77, %80
  br i1 %81, label %82, label %90

82:                                               ; preds = %74
  %83 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5arrayIS_IN9TicTacToe4CaseELm3EELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(36) %0, i64 noundef 1) #1
  %84 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIN9TicTacToe4CaseELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %83, i64 noundef 1) #1
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5arrayIS_IN9TicTacToe4CaseELm3EELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(36) %0, i64 noundef 0) #1
  %87 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIN9TicTacToe4CaseELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %86, i64 noundef 2) #1
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = icmp eq i32 %85, %88
  br label %90

90:                                               ; preds = %82, %74
  %91 = phi i1 [ false, %74 ], [ %89, %82 ]
  %92 = or i1 %.0.in, %91
  br i1 %92, label %94, label %96

93:                                               ; preds = %71
  br i1 %.0.in, label %94, label %96

94:                                               ; preds = %90, %93
  %95 = getelementptr inbounds i8, ptr %0, i64 36
  store i32 %3, ptr %95, align 4, !tbaa !9
  br label %.sink.split

96:                                               ; preds = %90, %93
  %97 = tail call noundef zeroext i1 @_ZNK9TicTacToe4Grid10isGridFullEv(ptr noundef nonnull align 4 dereferenceable(41) %0)
  br i1 %97, label %.sink.split, label %99

.sink.split:                                      ; preds = %96, %94
  %98 = getelementptr inbounds i8, ptr %0, i64 40
  store i8 1, ptr %98, align 4, !tbaa !13
  br label %99

99:                                               ; preds = %.sink.split, %96, %7, %4
  %.026 = phi i1 [ false, %4 ], [ false, %7 ], [ true, %96 ], [ true, %.sink.split ]
  ret i1 %.026
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5arrayIS_IN9TicTacToe4CaseELm3EELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(36), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIN9TicTacToe4CaseELm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK9TicTacToe4Grid10isGridFullEv(ptr noundef nonnull align 4 dereferenceable(41)) local_unnamed_addr #0 align 2

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 = { 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 = !{!"_ZTSN9TicTacToe4CaseE", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 36}
!10 = !{!"_ZTSN9TicTacToe4GridE", !11, i64 0, !6, i64 36, !12, i64 40}
!11 = !{!"_ZTSSt5arrayIS_IN9TicTacToe4CaseELm3EELm3EE", !7, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!10, !12, i64 40}


; Effective O3 passes: AggressiveInstCombinePass,CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass