; LLVM IR from AlgoGenesis/C :: Backtracking Algorithms/Chess-In-Terminal/src (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"

%struct.Game = type { i32, [8 x [8 x i16]], i32, i32, i32 }

@win_board = external dso_local global ptr, align 8
@cursor_x1 = external dso_local global i32, align 4
@cursor_y1 = external dso_local global i32, align 4
@cursor_x2 = external dso_local global i32, align 4
@cursor_y2 = external dso_local global i32, align 4

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @get_piece_owner(i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @transform_to_adj(i32 noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @has_path(ptr noundef, i32 noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @fill_adjacency_matrix(ptr noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef) #1

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

; Function Attrs: nounwind uwtable
declare dso_local void @transform_to_board(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @draw_board_tile(ptr noundef byval(%struct.Game) align 8, i32 noundef, i32 noundef, i1 noundef zeroext, i1 noundef zeroext, i1 noundef zeroext, i32 noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @draw_board(ptr noundef byval(%struct.Game) align 8 %0) #1 {
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i8, align 1
  %5 = alloca i32, align 4
  %6 = alloca [64 x [64 x i32]], align 16
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i8, align 1
  %14 = alloca i8, align 1
  %15 = alloca i8, align 1
  %16 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  %17 = load i32, ptr @cursor_x1, align 4, !tbaa !5
  store i32 %17, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  %18 = load i32, ptr @cursor_y1, align 4, !tbaa !5
  store i32 %18, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #4
  %19 = load i32, ptr @cursor_x1, align 4, !tbaa !5
  %20 = icmp ne i32 %19, -1
  br i1 %20, label %21, label %24

21:                                               ; preds = %1
  %22 = load i32, ptr @cursor_y1, align 4, !tbaa !5
  %23 = icmp ne i32 %22, -1
  br label %24

24:                                               ; preds = %21, %1
  %25 = phi i1 [ false, %1 ], [ %23, %21 ]
  %26 = zext i1 %25 to i8
  store i8 %26, ptr %4, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 -1, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16384, ptr %6) #4
  call void @llvm.memset.p0.i64(ptr align 16 %6, i8 0, i64 16384, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 -1, ptr %7, align 4, !tbaa !5
  %27 = load i8, ptr %4, align 1, !tbaa !9, !range !11, !noundef !12
  %28 = trunc i8 %27 to i1
  br i1 %28, label %29, label %50

29:                                               ; preds = %24
  call void @transform_to_board(ptr noundef %2, ptr noundef %3)
  %30 = getelementptr inbounds %struct.Game, ptr %0, i32 0, i32 1
  %31 = getelementptr inbounds [8 x [8 x i16]], ptr %30, i64 0, i64 0
  %32 = getelementptr inbounds %struct.Game, ptr %0, i32 0, i32 2
  %33 = load i32, ptr %32, align 4, !tbaa !13
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = load i32, ptr %3, align 4, !tbaa !5
  %36 = getelementptr inbounds [64 x [64 x i32]], ptr %6, i64 0, i64 0
  call void @fill_adjacency_matrix(ptr noundef %31, i32 noundef %33, i32 noundef %34, i32 noundef %35, ptr noundef %36)
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = call i32 @transform_to_adj(i32 noundef %37, i32 noundef %38)
  store i32 %39, ptr %7, align 4, !tbaa !5
  %40 = getelementptr inbounds %struct.Game, ptr %0, i32 0, i32 1
  %41 = load i32, ptr %3, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [8 x [8 x i16]], ptr %40, i64 0, i64 %42
  %44 = load i32, ptr %2, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [8 x i16], ptr %43, i64 0, i64 %45
  %47 = load i16, ptr %46, align 2, !tbaa !15
  %48 = sext i16 %47 to i32
  %49 = call i32 @get_piece_owner(i32 noundef %48)
  store i32 %49, ptr %5, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %29, %24
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %51 = load i32, ptr @cursor_x2, align 4, !tbaa !5
  store i32 %51, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %52 = load i32, ptr @cursor_y2, align 4, !tbaa !5
  store i32 %52, ptr %9, align 4, !tbaa !5
  call void @transform_to_board(ptr noundef %8, ptr noundef %9)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %53

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

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

57:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %58

58:                                               ; preds = %105, %57
  %59 = load i32, ptr %12, align 4, !tbaa !5
  %60 = icmp slt i32 %59, 8
  br i1 %60, label %62, label %61

61:                                               ; preds = %58
  store i32 5, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %108

62:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #4
  %63 = load i32, ptr %12, align 4, !tbaa !5
  %64 = load i32, ptr %8, align 4, !tbaa !5
  %65 = icmp eq i32 %63, %64
  br i1 %65, label %66, label %70

66:                                               ; preds = %62
  %67 = load i32, ptr %10, align 4, !tbaa !5
  %68 = load i32, ptr %9, align 4, !tbaa !5
  %69 = icmp eq i32 %67, %68
  br label %70

70:                                               ; preds = %66, %62
  %71 = phi i1 [ false, %62 ], [ %69, %66 ]
  %72 = zext i1 %71 to i8
  store i8 %72, ptr %13, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #4
  %73 = load i32, ptr %12, align 4, !tbaa !5
  %74 = load i32, ptr %2, align 4, !tbaa !5
  %75 = icmp eq i32 %73, %74
  br i1 %75, label %76, label %80

76:                                               ; preds = %70
  %77 = load i32, ptr %10, align 4, !tbaa !5
  %78 = load i32, ptr %3, align 4, !tbaa !5
  %79 = icmp eq i32 %77, %78
  br label %80

80:                                               ; preds = %76, %70
  %81 = phi i1 [ false, %70 ], [ %79, %76 ]
  %82 = zext i1 %81 to i8
  store i8 %82, ptr %14, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #4
  store i8 0, ptr %15, align 1, !tbaa !9
  %83 = load i8, ptr %4, align 1, !tbaa !9, !range !11, !noundef !12
  %84 = trunc i8 %83 to i1
  br i1 %84, label %85, label %95

85:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %86 = load i32, ptr %12, align 4, !tbaa !5
  %87 = load i32, ptr %10, align 4, !tbaa !5
  %88 = call i32 @transform_to_adj(i32 noundef %86, i32 noundef %87)
  store i32 %88, ptr %16, align 4, !tbaa !5
  %89 = getelementptr inbounds [64 x [64 x i32]], ptr %6, i64 0, i64 0
  %90 = load i32, ptr %7, align 4, !tbaa !5
  %91 = load i32, ptr %16, align 4, !tbaa !5
  %92 = call i32 @has_path(ptr noundef %89, i32 noundef %90, i32 noundef %91)
  %93 = icmp ne i32 %92, 0
  %94 = zext i1 %93 to i8
  store i8 %94, ptr %15, align 1, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  br label %95

95:                                               ; preds = %85, %80
  %96 = load i32, ptr %12, align 4, !tbaa !5
  %97 = load i32, ptr %10, align 4, !tbaa !5
  %98 = load i8, ptr %14, align 1, !tbaa !9, !range !11, !noundef !12
  %99 = trunc i8 %98 to i1
  %100 = load i8, ptr %13, align 1, !tbaa !9, !range !11, !noundef !12
  %101 = trunc i8 %100 to i1
  %102 = load i8, ptr %15, align 1, !tbaa !9, !range !11, !noundef !12
  %103 = trunc i8 %102 to i1
  %104 = load i32, ptr %5, align 4, !tbaa !5
  call void @draw_board_tile(ptr noundef byval(%struct.Game) align 8 %0, i32 noundef %96, i32 noundef %97, i1 noundef zeroext %99, i1 noundef zeroext %101, i1 noundef zeroext %103, i32 noundef %104)
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #4
  br label %105

105:                                              ; preds = %95
  %106 = load i32, ptr %12, align 4, !tbaa !5
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %12, align 4, !tbaa !5
  br label %58, !llvm.loop !17

108:                                              ; preds = %61
  br label %109

109:                                              ; preds = %108
  %110 = load i32, ptr %10, align 4, !tbaa !5
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %10, align 4, !tbaa !5
  br label %53, !llvm.loop !19

112:                                              ; preds = %56
  %113 = load ptr, ptr @win_board, align 8, !tbaa !20
  %114 = call i32 @wrefresh(ptr noundef %113)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 16384, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  ret void
}

declare i32 @wrefresh(ptr noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 nounwind willreturn memory(argmem: write) }
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 }

!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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"_Bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!14, !6, i64 132}
!14 = !{!"", !6, i64 0, !7, i64 4, !6, i64 132, !6, i64 136, !6, i64 140}
!15 = !{!16, !16, i64 0}
!16 = !{!"short", !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = !{!21, !21, i64 0}
!21 = !{!"any pointer", !7, i64 0}


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

%struct.Game = type { i32, [8 x [8 x i16]], i32, i32, i32 }

@win_board = external dso_local local_unnamed_addr global ptr, align 8
@cursor_x1 = external dso_local local_unnamed_addr global i32, align 4
@cursor_y1 = external dso_local local_unnamed_addr global i32, align 4
@cursor_x2 = external dso_local local_unnamed_addr global i32, align 4
@cursor_y2 = external dso_local local_unnamed_addr global i32, align 4

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @get_piece_owner(i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @transform_to_adj(i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @has_path(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @fill_adjacency_matrix(ptr noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare dso_local void @transform_to_board(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @draw_board_tile(ptr noundef byval(%struct.Game) align 8, i32 noundef, i32 noundef, i1 noundef zeroext, i1 noundef zeroext, i1 noundef zeroext, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @draw_board(ptr noundef byval(%struct.Game) align 8 %0) local_unnamed_addr #1 {
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca [64 x [64 x i32]], align 16
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  %7 = load i32, ptr @cursor_x1, align 4, !tbaa !5
  store i32 %7, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  %8 = load i32, ptr @cursor_y1, align 4
  store i32 %8, ptr %3, align 4, !tbaa !5
  %9 = icmp ne i32 %7, -1
  %10 = icmp ne i32 %8, -1
  %11 = select i1 %9, i1 %10, i1 false
  call void @llvm.lifetime.start.p0(i64 16384, ptr nonnull %4) #4
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16384) %4, i8 0, i64 16384, i1 false)
  br i1 %11, label %12, label %29

12:                                               ; preds = %1
  call void @transform_to_board(ptr noundef nonnull %2, ptr noundef nonnull %3)
  %13 = getelementptr inbounds i8, ptr %0, i64 4
  %14 = getelementptr inbounds i8, ptr %0, i64 132
  %15 = load i32, ptr %14, align 4, !tbaa !9
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = load i32, ptr %3, align 4, !tbaa !5
  call void @fill_adjacency_matrix(ptr noundef nonnull %13, i32 noundef %15, i32 noundef %16, i32 noundef %17, ptr noundef nonnull %4)
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = load i32, ptr %3, align 4, !tbaa !5
  %20 = call i32 @transform_to_adj(i32 noundef %18, i32 noundef %19)
  %21 = load i32, ptr %3, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [8 x [8 x i16]], ptr %13, i64 0, i64 %22, i64 %24
  %26 = load i16, ptr %25, align 2, !tbaa !11
  %27 = sext i16 %26 to i32
  %28 = call i32 @get_piece_owner(i32 noundef %27)
  br label %29

29:                                               ; preds = %12, %1
  %.021 = phi i32 [ %20, %12 ], [ -1, %1 ]
  %.0 = phi i32 [ %28, %12 ], [ -1, %1 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  %30 = load i32, ptr @cursor_x2, align 4, !tbaa !5
  store i32 %30, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #4
  %31 = load i32, ptr @cursor_y2, align 4, !tbaa !5
  store i32 %31, ptr %6, align 4, !tbaa !5
  call void @transform_to_board(ptr noundef nonnull %5, ptr noundef nonnull %6)
  br i1 %11, label %.preheader.us, label %.preheader

.preheader.us:                                    ; preds = %29, %.preheader.us
  %.02225.us = phi i32 [ %136, %.preheader.us ], [ 0, %29 ]
  %32 = load i32, ptr %5, align 4, !tbaa !5
  %33 = icmp eq i32 %32, 0
  %34 = load i32, ptr %6, align 4
  %35 = icmp eq i32 %.02225.us, %34
  %36 = select i1 %33, i1 %35, i1 false
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = icmp eq i32 %37, 0
  %39 = load i32, ptr %3, align 4
  %40 = icmp eq i32 %.02225.us, %39
  %41 = select i1 %38, i1 %40, i1 false
  %42 = call i32 @transform_to_adj(i32 noundef 0, i32 noundef %.02225.us)
  %43 = call i32 @has_path(ptr noundef nonnull %4, i32 noundef %.021, i32 noundef %42)
  %44 = icmp ne i32 %43, 0
  call void @draw_board_tile(ptr noundef nonnull byval(%struct.Game) align 8 %0, i32 noundef 0, i32 noundef %.02225.us, i1 noundef zeroext %41, i1 noundef zeroext %36, i1 noundef zeroext %44, i32 noundef %.0)
  %45 = load i32, ptr %5, align 4, !tbaa !5
  %46 = icmp eq i32 %45, 1
  %47 = load i32, ptr %6, align 4
  %48 = icmp eq i32 %.02225.us, %47
  %49 = select i1 %46, i1 %48, i1 false
  %50 = load i32, ptr %2, align 4, !tbaa !5
  %51 = icmp eq i32 %50, 1
  %52 = load i32, ptr %3, align 4
  %53 = icmp eq i32 %.02225.us, %52
  %54 = select i1 %51, i1 %53, i1 false
  %55 = call i32 @transform_to_adj(i32 noundef 1, i32 noundef %.02225.us)
  %56 = call i32 @has_path(ptr noundef nonnull %4, i32 noundef %.021, i32 noundef %55)
  %57 = icmp ne i32 %56, 0
  call void @draw_board_tile(ptr noundef nonnull byval(%struct.Game) align 8 %0, i32 noundef 1, i32 noundef %.02225.us, i1 noundef zeroext %54, i1 noundef zeroext %49, i1 noundef zeroext %57, i32 noundef %.0)
  %58 = load i32, ptr %5, align 4, !tbaa !5
  %59 = icmp eq i32 %58, 2
  %60 = load i32, ptr %6, align 4
  %61 = icmp eq i32 %.02225.us, %60
  %62 = select i1 %59, i1 %61, i1 false
  %63 = load i32, ptr %2, align 4, !tbaa !5
  %64 = icmp eq i32 %63, 2
  %65 = load i32, ptr %3, align 4
  %66 = icmp eq i32 %.02225.us, %65
  %67 = select i1 %64, i1 %66, i1 false
  %68 = call i32 @transform_to_adj(i32 noundef 2, i32 noundef %.02225.us)
  %69 = call i32 @has_path(ptr noundef nonnull %4, i32 noundef %.021, i32 noundef %68)
  %70 = icmp ne i32 %69, 0
  call void @draw_board_tile(ptr noundef nonnull byval(%struct.Game) align 8 %0, i32 noundef 2, i32 noundef %.02225.us, i1 noundef zeroext %67, i1 noundef zeroext %62, i1 noundef zeroext %70, i32 noundef %.0)
  %71 = load i32, ptr %5, align 4, !tbaa !5
  %72 = icmp eq i32 %71, 3
  %73 = load i32, ptr %6, align 4
  %74 = icmp eq i32 %.02225.us, %73
  %75 = select i1 %72, i1 %74, i1 false
  %76 = load i32, ptr %2, align 4, !tbaa !5
  %77 = icmp eq i32 %76, 3
  %78 = load i32, ptr %3, align 4
  %79 = icmp eq i32 %.02225.us, %78
  %80 = select i1 %77, i1 %79, i1 false
  %81 = call i32 @transform_to_adj(i32 noundef 3, i32 noundef %.02225.us)
  %82 = call i32 @has_path(ptr noundef nonnull %4, i32 noundef %.021, i32 noundef %81)
  %83 = icmp ne i32 %82, 0
  call void @draw_board_tile(ptr noundef nonnull byval(%struct.Game) align 8 %0, i32 noundef 3, i32 noundef %.02225.us, i1 noundef zeroext %80, i1 noundef zeroext %75, i1 noundef zeroext %83, i32 noundef %.0)
  %84 = load i32, ptr %5, align 4, !tbaa !5
  %85 = icmp eq i32 %84, 4
  %86 = load i32, ptr %6, align 4
  %87 = icmp eq i32 %.02225.us, %86
  %88 = select i1 %85, i1 %87, i1 false
  %89 = load i32, ptr %2, align 4, !tbaa !5
  %90 = icmp eq i32 %89, 4
  %91 = load i32, ptr %3, align 4
  %92 = icmp eq i32 %.02225.us, %91
  %93 = select i1 %90, i1 %92, i1 false
  %94 = call i32 @transform_to_adj(i32 noundef 4, i32 noundef %.02225.us)
  %95 = call i32 @has_path(ptr noundef nonnull %4, i32 noundef %.021, i32 noundef %94)
  %96 = icmp ne i32 %95, 0
  call void @draw_board_tile(ptr noundef nonnull byval(%struct.Game) align 8 %0, i32 noundef 4, i32 noundef %.02225.us, i1 noundef zeroext %93, i1 noundef zeroext %88, i1 noundef zeroext %96, i32 noundef %.0)
  %97 = load i32, ptr %5, align 4, !tbaa !5
  %98 = icmp eq i32 %97, 5
  %99 = load i32, ptr %6, align 4
  %100 = icmp eq i32 %.02225.us, %99
  %101 = select i1 %98, i1 %100, i1 false
  %102 = load i32, ptr %2, align 4, !tbaa !5
  %103 = icmp eq i32 %102, 5
  %104 = load i32, ptr %3, align 4
  %105 = icmp eq i32 %.02225.us, %104
  %106 = select i1 %103, i1 %105, i1 false
  %107 = call i32 @transform_to_adj(i32 noundef 5, i32 noundef %.02225.us)
  %108 = call i32 @has_path(ptr noundef nonnull %4, i32 noundef %.021, i32 noundef %107)
  %109 = icmp ne i32 %108, 0
  call void @draw_board_tile(ptr noundef nonnull byval(%struct.Game) align 8 %0, i32 noundef 5, i32 noundef %.02225.us, i1 noundef zeroext %106, i1 noundef zeroext %101, i1 noundef zeroext %109, i32 noundef %.0)
  %110 = load i32, ptr %5, align 4, !tbaa !5
  %111 = icmp eq i32 %110, 6
  %112 = load i32, ptr %6, align 4
  %113 = icmp eq i32 %.02225.us, %112
  %114 = select i1 %111, i1 %113, i1 false
  %115 = load i32, ptr %2, align 4, !tbaa !5
  %116 = icmp eq i32 %115, 6
  %117 = load i32, ptr %3, align 4
  %118 = icmp eq i32 %.02225.us, %117
  %119 = select i1 %116, i1 %118, i1 false
  %120 = call i32 @transform_to_adj(i32 noundef 6, i32 noundef %.02225.us)
  %121 = call i32 @has_path(ptr noundef nonnull %4, i32 noundef %.021, i32 noundef %120)
  %122 = icmp ne i32 %121, 0
  call void @draw_board_tile(ptr noundef nonnull byval(%struct.Game) align 8 %0, i32 noundef 6, i32 noundef %.02225.us, i1 noundef zeroext %119, i1 noundef zeroext %114, i1 noundef zeroext %122, i32 noundef %.0)
  %123 = load i32, ptr %5, align 4, !tbaa !5
  %124 = icmp eq i32 %123, 7
  %125 = load i32, ptr %6, align 4
  %126 = icmp eq i32 %.02225.us, %125
  %127 = select i1 %124, i1 %126, i1 false
  %128 = load i32, ptr %2, align 4, !tbaa !5
  %129 = icmp eq i32 %128, 7
  %130 = load i32, ptr %3, align 4
  %131 = icmp eq i32 %.02225.us, %130
  %132 = select i1 %129, i1 %131, i1 false
  %133 = call i32 @transform_to_adj(i32 noundef 7, i32 noundef %.02225.us)
  %134 = call i32 @has_path(ptr noundef nonnull %4, i32 noundef %.021, i32 noundef %133)
  %135 = icmp ne i32 %134, 0
  call void @draw_board_tile(ptr noundef nonnull byval(%struct.Game) align 8 %0, i32 noundef 7, i32 noundef %.02225.us, i1 noundef zeroext %132, i1 noundef zeroext %127, i1 noundef zeroext %135, i32 noundef %.0)
  %136 = add nuw nsw i32 %.02225.us, 1
  %exitcond31.not = icmp eq i32 %136, 8
  br i1 %exitcond31.not, label %.split28.us, label %.preheader.us, !llvm.loop !13

.preheader:                                       ; preds = %29, %.preheader
  %.02225 = phi i32 [ %217, %.preheader ], [ 0, %29 ]
  %137 = load i32, ptr %5, align 4, !tbaa !5
  %138 = icmp eq i32 %137, 0
  %139 = load i32, ptr %6, align 4
  %140 = icmp eq i32 %.02225, %139
  %141 = select i1 %138, i1 %140, i1 false
  %142 = load i32, ptr %2, align 4, !tbaa !5
  %143 = icmp eq i32 %142, 0
  %144 = load i32, ptr %3, align 4
  %145 = icmp eq i32 %.02225, %144
  %146 = select i1 %143, i1 %145, i1 false
  call void @draw_board_tile(ptr noundef nonnull byval(%struct.Game) align 8 %0, i32 noundef 0, i32 noundef %.02225, i1 noundef zeroext %146, i1 noundef zeroext %141, i1 noundef zeroext false, i32 noundef %.0)
  %147 = load i32, ptr %5, align 4, !tbaa !5
  %148 = icmp eq i32 %147, 1
  %149 = load i32, ptr %6, align 4
  %150 = icmp eq i32 %.02225, %149
  %151 = select i1 %148, i1 %150, i1 false
  %152 = load i32, ptr %2, align 4, !tbaa !5
  %153 = icmp eq i32 %152, 1
  %154 = load i32, ptr %3, align 4
  %155 = icmp eq i32 %.02225, %154
  %156 = select i1 %153, i1 %155, i1 false
  call void @draw_board_tile(ptr noundef nonnull byval(%struct.Game) align 8 %0, i32 noundef 1, i32 noundef %.02225, i1 noundef zeroext %156, i1 noundef zeroext %151, i1 noundef zeroext false, i32 noundef %.0)
  %157 = load i32, ptr %5, align 4, !tbaa !5
  %158 = icmp eq i32 %157, 2
  %159 = load i32, ptr %6, align 4
  %160 = icmp eq i32 %.02225, %159
  %161 = select i1 %158, i1 %160, i1 false
  %162 = load i32, ptr %2, align 4, !tbaa !5
  %163 = icmp eq i32 %162, 2
  %164 = load i32, ptr %3, align 4
  %165 = icmp eq i32 %.02225, %164
  %166 = select i1 %163, i1 %165, i1 false
  call void @draw_board_tile(ptr noundef nonnull byval(%struct.Game) align 8 %0, i32 noundef 2, i32 noundef %.02225, i1 noundef zeroext %166, i1 noundef zeroext %161, i1 noundef zeroext false, i32 noundef %.0)
  %167 = load i32, ptr %5, align 4, !tbaa !5
  %168 = icmp eq i32 %167, 3
  %169 = load i32, ptr %6, align 4
  %170 = icmp eq i32 %.02225, %169
  %171 = select i1 %168, i1 %170, i1 false
  %172 = load i32, ptr %2, align 4, !tbaa !5
  %173 = icmp eq i32 %172, 3
  %174 = load i32, ptr %3, align 4
  %175 = icmp eq i32 %.02225, %174
  %176 = select i1 %173, i1 %175, i1 false
  call void @draw_board_tile(ptr noundef nonnull byval(%struct.Game) align 8 %0, i32 noundef 3, i32 noundef %.02225, i1 noundef zeroext %176, i1 noundef zeroext %171, i1 noundef zeroext false, i32 noundef %.0)
  %177 = load i32, ptr %5, align 4, !tbaa !5
  %178 = icmp eq i32 %177, 4
  %179 = load i32, ptr %6, align 4
  %180 = icmp eq i32 %.02225, %179
  %181 = select i1 %178, i1 %180, i1 false
  %182 = load i32, ptr %2, align 4, !tbaa !5
  %183 = icmp eq i32 %182, 4
  %184 = load i32, ptr %3, align 4
  %185 = icmp eq i32 %.02225, %184
  %186 = select i1 %183, i1 %185, i1 false
  call void @draw_board_tile(ptr noundef nonnull byval(%struct.Game) align 8 %0, i32 noundef 4, i32 noundef %.02225, i1 noundef zeroext %186, i1 noundef zeroext %181, i1 noundef zeroext false, i32 noundef %.0)
  %187 = load i32, ptr %5, align 4, !tbaa !5
  %188 = icmp eq i32 %187, 5
  %189 = load i32, ptr %6, align 4
  %190 = icmp eq i32 %.02225, %189
  %191 = select i1 %188, i1 %190, i1 false
  %192 = load i32, ptr %2, align 4, !tbaa !5
  %193 = icmp eq i32 %192, 5
  %194 = load i32, ptr %3, align 4
  %195 = icmp eq i32 %.02225, %194
  %196 = select i1 %193, i1 %195, i1 false
  call void @draw_board_tile(ptr noundef nonnull byval(%struct.Game) align 8 %0, i32 noundef 5, i32 noundef %.02225, i1 noundef zeroext %196, i1 noundef zeroext %191, i1 noundef zeroext false, i32 noundef %.0)
  %197 = load i32, ptr %5, align 4, !tbaa !5
  %198 = icmp eq i32 %197, 6
  %199 = load i32, ptr %6, align 4
  %200 = icmp eq i32 %.02225, %199
  %201 = select i1 %198, i1 %200, i1 false
  %202 = load i32, ptr %2, align 4, !tbaa !5
  %203 = icmp eq i32 %202, 6
  %204 = load i32, ptr %3, align 4
  %205 = icmp eq i32 %.02225, %204
  %206 = select i1 %203, i1 %205, i1 false
  call void @draw_board_tile(ptr noundef nonnull byval(%struct.Game) align 8 %0, i32 noundef 6, i32 noundef %.02225, i1 noundef zeroext %206, i1 noundef zeroext %201, i1 noundef zeroext false, i32 noundef %.0)
  %207 = load i32, ptr %5, align 4, !tbaa !5
  %208 = icmp eq i32 %207, 7
  %209 = load i32, ptr %6, align 4
  %210 = icmp eq i32 %.02225, %209
  %211 = select i1 %208, i1 %210, i1 false
  %212 = load i32, ptr %2, align 4, !tbaa !5
  %213 = icmp eq i32 %212, 7
  %214 = load i32, ptr %3, align 4
  %215 = icmp eq i32 %.02225, %214
  %216 = select i1 %213, i1 %215, i1 false
  call void @draw_board_tile(ptr noundef nonnull byval(%struct.Game) align 8 %0, i32 noundef 7, i32 noundef %.02225, i1 noundef zeroext %216, i1 noundef zeroext %211, i1 noundef zeroext false, i32 noundef %.0)
  %217 = add nuw nsw i32 %.02225, 1
  %exitcond.not = icmp eq i32 %217, 8
  br i1 %exitcond.not, label %.split28.us, label %.preheader, !llvm.loop !13

.split28.us:                                      ; preds = %.preheader, %.preheader.us
  %218 = load ptr, ptr @win_board, align 8, !tbaa !15
  %219 = call i32 @wrefresh(ptr noundef %218) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 16384, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  ret void
}

declare i32 @wrefresh(ptr noundef) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 nocallback nofree nounwind willreturn memory(argmem: write) }
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 }

!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/C++ TBAA"}
!9 = !{!10, !6, i64 132}
!10 = !{!"", !6, i64 0, !7, i64 4, !6, i64 132, !6, i64 136, !6, i64 140}
!11 = !{!12, !12, i64 0}
!12 = !{!"short", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !16, i64 0}
!16 = !{!"any pointer", !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass