; LLVM IR from VAR-solutions/Algorithms :: Combinatorial Game Theory/Tic-Tac-Toe Optimal Move/Cpp/Tic-Tac-Toe.ll (Z7minimaxPA3_cib)

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

@player = external dso_local global i8, align 1
@opponent = external dso_local global i8, align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z11isMovesLeftPA3_c(ptr 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 nounwind uwtable
declare dso_local noundef i32 @_Z8evaluatePA3_c(ptr noundef) #0

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z7minimaxPA3_cib(ptr noundef %0, i32 noundef %1, i1 noundef zeroext %2) #2 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i8, align 1
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  %18 = zext i1 %2 to i8
  store i8 %18, ptr %7, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = call noundef i32 @_Z8evaluatePA3_c(ptr noundef %19)
  store i32 %20, ptr %8, align 4, !tbaa !9
  %21 = load i32, ptr %8, align 4, !tbaa !9
  %22 = icmp eq i32 %21, 10
  br i1 %22, label %23, label %25

23:                                               ; preds = %3
  %24 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %24, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %151

25:                                               ; preds = %3
  %26 = load i32, ptr %8, align 4, !tbaa !9
  %27 = icmp eq i32 %26, -10
  br i1 %27, label %28, label %30

28:                                               ; preds = %25
  %29 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %29, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %151

30:                                               ; preds = %25
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = call noundef zeroext i1 @_Z11isMovesLeftPA3_c(ptr noundef %31)
  %33 = zext i1 %32 to i32
  %34 = icmp eq i32 %33, 0
  br i1 %34, label %35, label %36

35:                                               ; preds = %30
  store i32 0, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %151

36:                                               ; preds = %30
  %37 = load i8, ptr %7, align 1, !tbaa !11, !range !13, !noundef !14
  %38 = trunc i8 %37 to i1
  br i1 %38, label %39, label %95

39:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 -1000, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %40

40:                                               ; preds = %90, %39
  %41 = load i32, ptr %11, align 4, !tbaa !9
  %42 = icmp slt i32 %41, 3
  br i1 %42, label %44, label %43

43:                                               ; preds = %40
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %93

44:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %45

45:                                               ; preds = %86, %44
  %46 = load i32, ptr %12, align 4, !tbaa !9
  %47 = icmp slt i32 %46, 3
  br i1 %47, label %49, label %48

48:                                               ; preds = %45
  store i32 5, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %89

49:                                               ; preds = %45
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  %51 = load i32, ptr %11, align 4, !tbaa !9
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [3 x i8], ptr %50, i64 %52
  %54 = load i32, ptr %12, align 4, !tbaa !9
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [3 x i8], ptr %53, i64 0, i64 %55
  %57 = load i8, ptr %56, align 1, !tbaa !15
  %58 = sext i8 %57 to i32
  %59 = icmp eq i32 %58, 95
  br i1 %59, label %60, label %85

60:                                               ; preds = %49
  %61 = load i8, ptr @player, align 1, !tbaa !15
  %62 = load ptr, ptr %5, align 8, !tbaa !5
  %63 = load i32, ptr %11, align 4, !tbaa !9
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [3 x i8], ptr %62, i64 %64
  %66 = load i32, ptr %12, align 4, !tbaa !9
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [3 x i8], ptr %65, i64 0, i64 %67
  store i8 %61, ptr %68, align 1, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %69 = load ptr, ptr %5, align 8, !tbaa !5
  %70 = load i32, ptr %6, align 4, !tbaa !9
  %71 = add nsw i32 %70, 1
  %72 = load i8, ptr %7, align 1, !tbaa !11, !range !13, !noundef !14
  %73 = trunc i8 %72 to i1
  %74 = xor i1 %73, true
  %75 = call noundef i32 @_Z7minimaxPA3_cib(ptr noundef %69, i32 noundef %71, i1 noundef zeroext %74)
  store i32 %75, ptr %13, align 4, !tbaa !9
  %76 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %77 = load i32, ptr %76, align 4, !tbaa !9
  store i32 %77, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  %78 = load ptr, ptr %5, align 8, !tbaa !5
  %79 = load i32, ptr %11, align 4, !tbaa !9
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [3 x i8], ptr %78, i64 %80
  %82 = load i32, ptr %12, align 4, !tbaa !9
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [3 x i8], ptr %81, i64 0, i64 %83
  store i8 95, ptr %84, align 1, !tbaa !15
  br label %85

85:                                               ; preds = %60, %49
  br label %86

86:                                               ; preds = %85
  %87 = load i32, ptr %12, align 4, !tbaa !9
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr %12, align 4, !tbaa !9
  br label %45, !llvm.loop !16

89:                                               ; preds = %48
  br label %90

90:                                               ; preds = %89
  %91 = load i32, ptr %11, align 4, !tbaa !9
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %11, align 4, !tbaa !9
  br label %40, !llvm.loop !18

93:                                               ; preds = %43
  %94 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %94, ptr %4, align 4
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %151

95:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  store i32 1000, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %96

96:                                               ; preds = %146, %95
  %97 = load i32, ptr %15, align 4, !tbaa !9
  %98 = icmp slt i32 %97, 3
  br i1 %98, label %100, label %99

99:                                               ; preds = %96
  store i32 8, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %149

100:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %101

101:                                              ; preds = %142, %100
  %102 = load i32, ptr %16, align 4, !tbaa !9
  %103 = icmp slt i32 %102, 3
  br i1 %103, label %105, label %104

104:                                              ; preds = %101
  store i32 11, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  br label %145

105:                                              ; preds = %101
  %106 = load ptr, ptr %5, align 8, !tbaa !5
  %107 = load i32, ptr %15, align 4, !tbaa !9
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [3 x i8], ptr %106, i64 %108
  %110 = load i32, ptr %16, align 4, !tbaa !9
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [3 x i8], ptr %109, i64 0, i64 %111
  %113 = load i8, ptr %112, align 1, !tbaa !15
  %114 = sext i8 %113 to i32
  %115 = icmp eq i32 %114, 95
  br i1 %115, label %116, label %141

116:                                              ; preds = %105
  %117 = load i8, ptr @opponent, align 1, !tbaa !15
  %118 = load ptr, ptr %5, align 8, !tbaa !5
  %119 = load i32, ptr %15, align 4, !tbaa !9
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [3 x i8], ptr %118, i64 %120
  %122 = load i32, ptr %16, align 4, !tbaa !9
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [3 x i8], ptr %121, i64 0, i64 %123
  store i8 %117, ptr %124, align 1, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  %125 = load ptr, ptr %5, align 8, !tbaa !5
  %126 = load i32, ptr %6, align 4, !tbaa !9
  %127 = add nsw i32 %126, 1
  %128 = load i8, ptr %7, align 1, !tbaa !11, !range !13, !noundef !14
  %129 = trunc i8 %128 to i1
  %130 = xor i1 %129, true
  %131 = call noundef i32 @_Z7minimaxPA3_cib(ptr noundef %125, i32 noundef %127, i1 noundef zeroext %130)
  store i32 %131, ptr %17, align 4, !tbaa !9
  %132 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %17)
  %133 = load i32, ptr %132, align 4, !tbaa !9
  store i32 %133, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  %134 = load ptr, ptr %5, align 8, !tbaa !5
  %135 = load i32, ptr %15, align 4, !tbaa !9
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [3 x i8], ptr %134, i64 %136
  %138 = load i32, ptr %16, align 4, !tbaa !9
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [3 x i8], ptr %137, i64 0, i64 %139
  store i8 95, ptr %140, align 1, !tbaa !15
  br label %141

141:                                              ; preds = %116, %105
  br label %142

142:                                              ; preds = %141
  %143 = load i32, ptr %16, align 4, !tbaa !9
  %144 = add nsw i32 %143, 1
  store i32 %144, ptr %16, align 4, !tbaa !9
  br label %101, !llvm.loop !19

145:                                              ; preds = %104
  br label %146

146:                                              ; preds = %145
  %147 = load i32, ptr %15, align 4, !tbaa !9
  %148 = add nsw i32 %147, 1
  store i32 %148, ptr %15, align 4, !tbaa !9
  br label %96, !llvm.loop !20

149:                                              ; preds = %99
  %150 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %150, ptr %4, align 4
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %151

151:                                              ; preds = %149, %93, %35, %28, %23
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  %152 = load i32, ptr %4, align 4
  ret i32 %152
}

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

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

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #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 = !{!"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 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
!19 = distinct !{!19, !17}
!20 = distinct !{!20, !17}


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

@player = external dso_local local_unnamed_addr global i8, align 1
@opponent = external dso_local local_unnamed_addr global i8, align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z11isMovesLeftPA3_c(ptr noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z8evaluatePA3_c(ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i32 @_Z7minimaxPA3_cib(ptr noundef %0, i32 noundef %1, i1 noundef zeroext %2) local_unnamed_addr #0 {
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = tail call noundef i32 @_Z8evaluatePA3_c(ptr noundef %0)
  switch i32 %8, label %9 [
    i32 10, label %187
    i32 -10, label %187
  ]

9:                                                ; preds = %3
  %10 = tail call noundef zeroext i1 @_Z11isMovesLeftPA3_c(ptr noundef %0)
  br i1 %10, label %11, label %187

11:                                               ; preds = %9
  %12 = add nsw i32 %1, 1
  br i1 %2, label %.preheader, label %.preheader46

.preheader:                                       ; preds = %11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #3
  store i32 -1000, ptr %4, align 4, !tbaa !5
  %13 = load i8, ptr %0, align 1, !tbaa !9
  %14 = icmp eq i8 %13, 95
  br i1 %14, label %15, label %20

15:                                               ; preds = %.preheader
  %16 = load i8, ptr @player, align 1, !tbaa !9
  store i8 %16, ptr %0, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #3
  %17 = tail call noundef i32 @_Z7minimaxPA3_cib(ptr noundef nonnull %0, i32 noundef %12, i1 noundef zeroext false)
  store i32 %17, ptr %5, align 4, !tbaa !5
  %18 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %19 = load i32, ptr %18, align 4, !tbaa !5
  store i32 %19, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #3
  store i8 95, ptr %0, align 1, !tbaa !9
  br label %20

20:                                               ; preds = %.preheader, %15
  %21 = phi i32 [ -1000, %.preheader ], [ %19, %15 ]
  %22 = getelementptr inbounds i8, ptr %0, i64 1
  %23 = load i8, ptr %22, align 1, !tbaa !9
  %24 = icmp eq i8 %23, 95
  br i1 %24, label %25, label %30

25:                                               ; preds = %20
  %26 = load i8, ptr @player, align 1, !tbaa !9
  store i8 %26, ptr %22, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #3
  %27 = call noundef i32 @_Z7minimaxPA3_cib(ptr noundef nonnull %0, i32 noundef %12, i1 noundef zeroext false)
  store i32 %27, ptr %5, align 4, !tbaa !5
  %28 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %29 = load i32, ptr %28, align 4, !tbaa !5
  store i32 %29, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #3
  store i8 95, ptr %22, align 1, !tbaa !9
  br label %30

30:                                               ; preds = %25, %20
  %31 = phi i32 [ %29, %25 ], [ %21, %20 ]
  %32 = getelementptr inbounds i8, ptr %0, i64 2
  %33 = load i8, ptr %32, align 1, !tbaa !9
  %34 = icmp eq i8 %33, 95
  br i1 %34, label %35, label %.preheader.1

35:                                               ; preds = %30
  %36 = load i8, ptr @player, align 1, !tbaa !9
  store i8 %36, ptr %32, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #3
  %37 = call noundef i32 @_Z7minimaxPA3_cib(ptr noundef nonnull %0, i32 noundef %12, i1 noundef zeroext false)
  store i32 %37, ptr %5, align 4, !tbaa !5
  %38 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %39 = load i32, ptr %38, align 4, !tbaa !5
  store i32 %39, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #3
  store i8 95, ptr %32, align 1, !tbaa !9
  br label %.preheader.1

.preheader.1:                                     ; preds = %35, %30
  %40 = phi i32 [ %39, %35 ], [ %31, %30 ]
  %41 = getelementptr inbounds i8, ptr %0, i64 3
  %42 = load i8, ptr %41, align 1, !tbaa !9
  %43 = icmp eq i8 %42, 95
  br i1 %43, label %44, label %49

44:                                               ; preds = %.preheader.1
  %45 = load i8, ptr @player, align 1, !tbaa !9
  store i8 %45, ptr %41, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #3
  %46 = call noundef i32 @_Z7minimaxPA3_cib(ptr noundef nonnull %0, i32 noundef %12, i1 noundef zeroext false)
  store i32 %46, ptr %5, align 4, !tbaa !5
  %47 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %48 = load i32, ptr %47, align 4, !tbaa !5
  store i32 %48, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #3
  store i8 95, ptr %41, align 1, !tbaa !9
  br label %49

49:                                               ; preds = %44, %.preheader.1
  %50 = phi i32 [ %48, %44 ], [ %40, %.preheader.1 ]
  %51 = getelementptr inbounds i8, ptr %0, i64 4
  %52 = load i8, ptr %51, align 1, !tbaa !9
  %53 = icmp eq i8 %52, 95
  br i1 %53, label %54, label %59

54:                                               ; preds = %49
  %55 = load i8, ptr @player, align 1, !tbaa !9
  store i8 %55, ptr %51, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #3
  %56 = call noundef i32 @_Z7minimaxPA3_cib(ptr noundef nonnull %0, i32 noundef %12, i1 noundef zeroext false)
  store i32 %56, ptr %5, align 4, !tbaa !5
  %57 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %58 = load i32, ptr %57, align 4, !tbaa !5
  store i32 %58, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #3
  store i8 95, ptr %51, align 1, !tbaa !9
  br label %59

59:                                               ; preds = %54, %49
  %60 = phi i32 [ %58, %54 ], [ %50, %49 ]
  %61 = getelementptr inbounds i8, ptr %0, i64 5
  %62 = load i8, ptr %61, align 1, !tbaa !9
  %63 = icmp eq i8 %62, 95
  br i1 %63, label %64, label %.preheader.2

64:                                               ; preds = %59
  %65 = load i8, ptr @player, align 1, !tbaa !9
  store i8 %65, ptr %61, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #3
  %66 = call noundef i32 @_Z7minimaxPA3_cib(ptr noundef nonnull %0, i32 noundef %12, i1 noundef zeroext false)
  store i32 %66, ptr %5, align 4, !tbaa !5
  %67 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %68 = load i32, ptr %67, align 4, !tbaa !5
  store i32 %68, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #3
  store i8 95, ptr %61, align 1, !tbaa !9
  br label %.preheader.2

.preheader.2:                                     ; preds = %64, %59
  %69 = phi i32 [ %68, %64 ], [ %60, %59 ]
  %70 = getelementptr inbounds i8, ptr %0, i64 6
  %71 = load i8, ptr %70, align 1, !tbaa !9
  %72 = icmp eq i8 %71, 95
  br i1 %72, label %73, label %78

73:                                               ; preds = %.preheader.2
  %74 = load i8, ptr @player, align 1, !tbaa !9
  store i8 %74, ptr %70, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #3
  %75 = call noundef i32 @_Z7minimaxPA3_cib(ptr noundef nonnull %0, i32 noundef %12, i1 noundef zeroext false)
  store i32 %75, ptr %5, align 4, !tbaa !5
  %76 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %77 = load i32, ptr %76, align 4, !tbaa !5
  store i32 %77, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #3
  store i8 95, ptr %70, align 1, !tbaa !9
  br label %78

78:                                               ; preds = %73, %.preheader.2
  %79 = phi i32 [ %77, %73 ], [ %69, %.preheader.2 ]
  %80 = getelementptr inbounds i8, ptr %0, i64 7
  %81 = load i8, ptr %80, align 1, !tbaa !9
  %82 = icmp eq i8 %81, 95
  br i1 %82, label %83, label %88

83:                                               ; preds = %78
  %84 = load i8, ptr @player, align 1, !tbaa !9
  store i8 %84, ptr %80, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #3
  %85 = call noundef i32 @_Z7minimaxPA3_cib(ptr noundef nonnull %0, i32 noundef %12, i1 noundef zeroext false)
  store i32 %85, ptr %5, align 4, !tbaa !5
  %86 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %87 = load i32, ptr %86, align 4, !tbaa !5
  store i32 %87, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #3
  store i8 95, ptr %80, align 1, !tbaa !9
  br label %88

88:                                               ; preds = %83, %78
  %89 = phi i32 [ %87, %83 ], [ %79, %78 ]
  %90 = getelementptr inbounds i8, ptr %0, i64 8
  %91 = load i8, ptr %90, align 1, !tbaa !9
  %92 = icmp eq i8 %91, 95
  br i1 %92, label %93, label %98

93:                                               ; preds = %88
  %94 = load i8, ptr @player, align 1, !tbaa !9
  store i8 %94, ptr %90, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #3
  %95 = call noundef i32 @_Z7minimaxPA3_cib(ptr noundef nonnull %0, i32 noundef %12, i1 noundef zeroext false)
  store i32 %95, ptr %5, align 4, !tbaa !5
  %96 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %97 = load i32, ptr %96, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #3
  store i8 95, ptr %90, align 1, !tbaa !9
  br label %98

98:                                               ; preds = %93, %88
  %99 = phi i32 [ %97, %93 ], [ %89, %88 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #3
  br label %187

.preheader46:                                     ; preds = %11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #3
  store i32 1000, ptr %6, align 4, !tbaa !5
  %100 = load i8, ptr %0, align 1, !tbaa !9
  %101 = icmp eq i8 %100, 95
  br i1 %101, label %102, label %107

102:                                              ; preds = %.preheader46
  %103 = load i8, ptr @opponent, align 1, !tbaa !9
  store i8 %103, ptr %0, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #3
  %104 = tail call noundef i32 @_Z7minimaxPA3_cib(ptr noundef nonnull %0, i32 noundef %12, i1 noundef zeroext true)
  store i32 %104, ptr %7, align 4, !tbaa !5
  %105 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %106 = load i32, ptr %105, align 4, !tbaa !5
  store i32 %106, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #3
  store i8 95, ptr %0, align 1, !tbaa !9
  br label %107

107:                                              ; preds = %.preheader46, %102
  %108 = phi i32 [ 1000, %.preheader46 ], [ %106, %102 ]
  %109 = getelementptr inbounds i8, ptr %0, i64 1
  %110 = load i8, ptr %109, align 1, !tbaa !9
  %111 = icmp eq i8 %110, 95
  br i1 %111, label %112, label %117

112:                                              ; preds = %107
  %113 = load i8, ptr @opponent, align 1, !tbaa !9
  store i8 %113, ptr %109, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #3
  %114 = call noundef i32 @_Z7minimaxPA3_cib(ptr noundef nonnull %0, i32 noundef %12, i1 noundef zeroext true)
  store i32 %114, ptr %7, align 4, !tbaa !5
  %115 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %116 = load i32, ptr %115, align 4, !tbaa !5
  store i32 %116, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #3
  store i8 95, ptr %109, align 1, !tbaa !9
  br label %117

117:                                              ; preds = %112, %107
  %118 = phi i32 [ %116, %112 ], [ %108, %107 ]
  %119 = getelementptr inbounds i8, ptr %0, i64 2
  %120 = load i8, ptr %119, align 1, !tbaa !9
  %121 = icmp eq i8 %120, 95
  br i1 %121, label %122, label %.preheader46.1

122:                                              ; preds = %117
  %123 = load i8, ptr @opponent, align 1, !tbaa !9
  store i8 %123, ptr %119, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #3
  %124 = call noundef i32 @_Z7minimaxPA3_cib(ptr noundef nonnull %0, i32 noundef %12, i1 noundef zeroext true)
  store i32 %124, ptr %7, align 4, !tbaa !5
  %125 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %126 = load i32, ptr %125, align 4, !tbaa !5
  store i32 %126, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #3
  store i8 95, ptr %119, align 1, !tbaa !9
  br label %.preheader46.1

.preheader46.1:                                   ; preds = %122, %117
  %127 = phi i32 [ %126, %122 ], [ %118, %117 ]
  %128 = getelementptr inbounds i8, ptr %0, i64 3
  %129 = load i8, ptr %128, align 1, !tbaa !9
  %130 = icmp eq i8 %129, 95
  br i1 %130, label %131, label %136

131:                                              ; preds = %.preheader46.1
  %132 = load i8, ptr @opponent, align 1, !tbaa !9
  store i8 %132, ptr %128, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #3
  %133 = call noundef i32 @_Z7minimaxPA3_cib(ptr noundef nonnull %0, i32 noundef %12, i1 noundef zeroext true)
  store i32 %133, ptr %7, align 4, !tbaa !5
  %134 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %135 = load i32, ptr %134, align 4, !tbaa !5
  store i32 %135, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #3
  store i8 95, ptr %128, align 1, !tbaa !9
  br label %136

136:                                              ; preds = %131, %.preheader46.1
  %137 = phi i32 [ %135, %131 ], [ %127, %.preheader46.1 ]
  %138 = getelementptr inbounds i8, ptr %0, i64 4
  %139 = load i8, ptr %138, align 1, !tbaa !9
  %140 = icmp eq i8 %139, 95
  br i1 %140, label %141, label %146

141:                                              ; preds = %136
  %142 = load i8, ptr @opponent, align 1, !tbaa !9
  store i8 %142, ptr %138, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #3
  %143 = call noundef i32 @_Z7minimaxPA3_cib(ptr noundef nonnull %0, i32 noundef %12, i1 noundef zeroext true)
  store i32 %143, ptr %7, align 4, !tbaa !5
  %144 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %145 = load i32, ptr %144, align 4, !tbaa !5
  store i32 %145, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #3
  store i8 95, ptr %138, align 1, !tbaa !9
  br label %146

146:                                              ; preds = %141, %136
  %147 = phi i32 [ %145, %141 ], [ %137, %136 ]
  %148 = getelementptr inbounds i8, ptr %0, i64 5
  %149 = load i8, ptr %148, align 1, !tbaa !9
  %150 = icmp eq i8 %149, 95
  br i1 %150, label %151, label %.preheader46.2

151:                                              ; preds = %146
  %152 = load i8, ptr @opponent, align 1, !tbaa !9
  store i8 %152, ptr %148, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #3
  %153 = call noundef i32 @_Z7minimaxPA3_cib(ptr noundef nonnull %0, i32 noundef %12, i1 noundef zeroext true)
  store i32 %153, ptr %7, align 4, !tbaa !5
  %154 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %155 = load i32, ptr %154, align 4, !tbaa !5
  store i32 %155, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #3
  store i8 95, ptr %148, align 1, !tbaa !9
  br label %.preheader46.2

.preheader46.2:                                   ; preds = %151, %146
  %156 = phi i32 [ %155, %151 ], [ %147, %146 ]
  %157 = getelementptr inbounds i8, ptr %0, i64 6
  %158 = load i8, ptr %157, align 1, !tbaa !9
  %159 = icmp eq i8 %158, 95
  br i1 %159, label %160, label %165

160:                                              ; preds = %.preheader46.2
  %161 = load i8, ptr @opponent, align 1, !tbaa !9
  store i8 %161, ptr %157, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #3
  %162 = call noundef i32 @_Z7minimaxPA3_cib(ptr noundef nonnull %0, i32 noundef %12, i1 noundef zeroext true)
  store i32 %162, ptr %7, align 4, !tbaa !5
  %163 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %164 = load i32, ptr %163, align 4, !tbaa !5
  store i32 %164, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #3
  store i8 95, ptr %157, align 1, !tbaa !9
  br label %165

165:                                              ; preds = %160, %.preheader46.2
  %166 = phi i32 [ %164, %160 ], [ %156, %.preheader46.2 ]
  %167 = getelementptr inbounds i8, ptr %0, i64 7
  %168 = load i8, ptr %167, align 1, !tbaa !9
  %169 = icmp eq i8 %168, 95
  br i1 %169, label %170, label %175

170:                                              ; preds = %165
  %171 = load i8, ptr @opponent, align 1, !tbaa !9
  store i8 %171, ptr %167, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #3
  %172 = call noundef i32 @_Z7minimaxPA3_cib(ptr noundef nonnull %0, i32 noundef %12, i1 noundef zeroext true)
  store i32 %172, ptr %7, align 4, !tbaa !5
  %173 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %174 = load i32, ptr %173, align 4, !tbaa !5
  store i32 %174, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #3
  store i8 95, ptr %167, align 1, !tbaa !9
  br label %175

175:                                              ; preds = %170, %165
  %176 = phi i32 [ %174, %170 ], [ %166, %165 ]
  %177 = getelementptr inbounds i8, ptr %0, i64 8
  %178 = load i8, ptr %177, align 1, !tbaa !9
  %179 = icmp eq i8 %178, 95
  br i1 %179, label %180, label %185

180:                                              ; preds = %175
  %181 = load i8, ptr @opponent, align 1, !tbaa !9
  store i8 %181, ptr %177, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #3
  %182 = call noundef i32 @_Z7minimaxPA3_cib(ptr noundef nonnull %0, i32 noundef %12, i1 noundef zeroext true)
  store i32 %182, ptr %7, align 4, !tbaa !5
  %183 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %184 = load i32, ptr %183, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #3
  store i8 95, ptr %177, align 1, !tbaa !9
  br label %185

185:                                              ; preds = %180, %175
  %186 = phi i32 [ %184, %180 ], [ %176, %175 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #3
  br label %187

187:                                              ; preds = %3, %9, %3, %185, %98
  %.042 = phi i32 [ %99, %98 ], [ %186, %185 ], [ %8, %3 ], [ 0, %9 ], [ %8, %3 ]
  ret i32 %.042
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #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 = { mustprogress 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 = { 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 = !{!7, !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,LoopSimplifyPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass