; LLVM IR from mbrenman/TetrisPlayground :: game/Tetris.ll (ZN6Tetris10placePieceEiiPA20_ib)

; 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.Tetris = type { [10 x [20 x i32]], i32, i8, i8, ptr, ptr }

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #0

declare void @_ZN5PieceC1Ev(ptr noundef nonnull align 4 dereferenceable(20)) unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #2

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

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

declare noundef i32 @_ZN5Piece10getPieceIDEv(ptr noundef nonnull align 4 dereferenceable(20)) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6Tetris10placePieceEiiPA20_ib(ptr noundef nonnull align 8 dereferenceable(824) %0, i32 noundef %1, i32 noundef %2, ptr noundef %3, i1 noundef zeroext %4) #4 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i8, align 1
  %11 = alloca [4 x [4 x i8]], align 16
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  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 ptr %3, ptr %9, align 8, !tbaa !5
  %17 = zext i1 %4 to i8
  store i8 %17, ptr %10, align 1, !tbaa !11
  %18 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #5
  %19 = getelementptr inbounds %class.Tetris, ptr %18, i32 0, i32 4
  %20 = load ptr, ptr %19, align 8, !tbaa !13
  %21 = getelementptr inbounds [4 x [4 x i8]], ptr %11, i64 0, i64 0
  call void @_ZN5Piece9copyPieceEPA4_b(ptr noundef nonnull align 4 dereferenceable(20) %20, ptr noundef %21)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %22

22:                                               ; preds = %71, %5
  %23 = load i32, ptr %12, align 4, !tbaa !9
  %24 = icmp slt i32 %23, 4
  br i1 %24, label %26, label %25

25:                                               ; preds = %22
  store i32 2, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %74

26:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %27

27:                                               ; preds = %67, %26
  %28 = load i32, ptr %14, align 4, !tbaa !9
  %29 = icmp slt i32 %28, 4
  br i1 %29, label %31, label %30

30:                                               ; preds = %27
  store i32 5, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %70

31:                                               ; preds = %27
  %32 = load i32, ptr %12, align 4, !tbaa !9
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [4 x [4 x i8]], ptr %11, i64 0, i64 %33
  %35 = load i32, ptr %14, align 4, !tbaa !9
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [4 x i8], ptr %34, i64 0, i64 %36
  %38 = load i8, ptr %37, align 1, !tbaa !11, !range !15, !noundef !16
  %39 = trunc i8 %38 to i1
  br i1 %39, label %40, label %66

40:                                               ; preds = %31
  %41 = load i32, ptr %14, align 4, !tbaa !9
  %42 = load i32, ptr %8, align 4, !tbaa !9
  %43 = add nsw i32 %41, %42
  %44 = icmp slt i32 %43, 0
  br i1 %44, label %45, label %50

45:                                               ; preds = %40
  %46 = load i8, ptr %10, align 1, !tbaa !11, !range !15, !noundef !16
  %47 = trunc i8 %46 to i1
  br i1 %47, label %48, label %50

48:                                               ; preds = %45
  %49 = getelementptr inbounds %class.Tetris, ptr %18, i32 0, i32 2
  store i8 1, ptr %49, align 4, !tbaa !17
  br label %65

50:                                               ; preds = %45, %40
  %51 = getelementptr inbounds %class.Tetris, ptr %18, i32 0, i32 4
  %52 = load ptr, ptr %51, align 8, !tbaa !13
  %53 = call noundef i32 @_ZN5Piece10getPieceIDEv(ptr noundef nonnull align 4 dereferenceable(20) %52)
  %54 = load ptr, ptr %9, align 8, !tbaa !5
  %55 = load i32, ptr %12, align 4, !tbaa !9
  %56 = load i32, ptr %7, align 4, !tbaa !9
  %57 = add nsw i32 %55, %56
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [20 x i32], ptr %54, i64 %58
  %60 = load i32, ptr %14, align 4, !tbaa !9
  %61 = load i32, ptr %8, align 4, !tbaa !9
  %62 = add nsw i32 %60, %61
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [20 x i32], ptr %59, i64 0, i64 %63
  store i32 %53, ptr %64, align 4, !tbaa !9
  br label %65

65:                                               ; preds = %50, %48
  br label %66

66:                                               ; preds = %65, %31
  br label %67

67:                                               ; preds = %66
  %68 = load i32, ptr %14, align 4, !tbaa !9
  %69 = add nsw i32 %68, 1
  store i32 %69, ptr %14, align 4, !tbaa !9
  br label %27, !llvm.loop !18

70:                                               ; preds = %30
  br label %71

71:                                               ; preds = %70
  %72 = load i32, ptr %12, align 4, !tbaa !9
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %12, align 4, !tbaa !9
  br label %22, !llvm.loop !20

74:                                               ; preds = %25
  %75 = load i8, ptr %10, align 1, !tbaa !11, !range !15, !noundef !16
  %76 = trunc i8 %75 to i1
  br i1 %76, label %77, label %93

77:                                               ; preds = %74
  %78 = getelementptr inbounds %class.Tetris, ptr %18, i32 0, i32 4
  %79 = load ptr, ptr %78, align 8, !tbaa !13
  %80 = icmp eq ptr %79, null
  br i1 %80, label %82, label %81

81:                                               ; preds = %77
  call void @_ZdlPvm(ptr noundef %79, i64 noundef 20) #6
  br label %82

82:                                               ; preds = %81, %77
  %83 = getelementptr inbounds %class.Tetris, ptr %18, i32 0, i32 5
  %84 = load ptr, ptr %83, align 8, !tbaa !21
  %85 = getelementptr inbounds %class.Tetris, ptr %18, i32 0, i32 4
  store ptr %84, ptr %85, align 8, !tbaa !13
  %86 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 20) #7
  invoke void @_ZN5PieceC1Ev(ptr noundef nonnull align 4 dereferenceable(20) %86)
          to label %87 unwind label %89

87:                                               ; preds = %82
  %88 = getelementptr inbounds %class.Tetris, ptr %18, i32 0, i32 5
  store ptr %86, ptr %88, align 8, !tbaa !21
  br label %93

89:                                               ; preds = %82
  %90 = landingpad { ptr, i32 }
          cleanup
  %91 = extractvalue { ptr, i32 } %90, 0
  store ptr %91, ptr %15, align 8
  %92 = extractvalue { ptr, i32 } %90, 1
  store i32 %92, ptr %16, align 4
  call void @_ZdlPvm(ptr noundef %86, i64 noundef 20) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #5
  br label %94

93:                                               ; preds = %87, %74
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #5
  ret void

94:                                               ; preds = %89
  %95 = load ptr, ptr %15, align 8
  %96 = load i32, ptr %16, align 4
  %97 = insertvalue { ptr, i32 } poison, ptr %95, 0
  %98 = insertvalue { ptr, i32 } %97, i32 %96, 1
  resume { ptr, i32 } %98
}

declare void @_ZN5Piece9copyPieceEPA4_b(ptr noundef nonnull align 4 dereferenceable(20), ptr noundef) #1

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

!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 = !{!14, !6, i64 808}
!14 = !{!"_ZTS6Tetris", !7, i64 0, !10, i64 800, !12, i64 804, !12, i64 805, !6, i64 808, !6, i64 816}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!14, !12, i64 804}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = !{!14, !6, i64 816}


; 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: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #0

declare void @_ZN5PieceC1Ev(ptr noundef nonnull align 4 dereferenceable(20)) unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #2

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

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

declare noundef i32 @_ZN5Piece10getPieceIDEv(ptr noundef nonnull align 4 dereferenceable(20)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6Tetris10placePieceEiiPA20_ib(ptr nocapture noundef nonnull align 8 dereferenceable(824) %0, i32 noundef %1, i32 noundef %2, ptr nocapture noundef writeonly %3, i1 noundef zeroext %4) local_unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca [4 x [4 x i8]], align 16
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #5
  %7 = getelementptr inbounds i8, ptr %0, i64 808
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZN5Piece9copyPieceEPA4_b(ptr noundef nonnull align 4 dereferenceable(20) %8, ptr noundef nonnull %6)
  %9 = getelementptr inbounds i8, ptr %0, i64 804
  %10 = sext i32 %2 to i64
  %11 = sext i32 %1 to i64
  %12 = load i8, ptr %6, align 16, !tbaa !12, !range !13, !noundef !14
  %13 = trunc nuw i8 %12 to i1
  br i1 %4, label %.preheader.us.preheader, label %.preheader.preheader

.preheader.preheader:                             ; preds = %5
  br i1 %13, label %198, label %202

.preheader.us.preheader:                          ; preds = %5
  br i1 %13, label %14, label %21

14:                                               ; preds = %.preheader.us.preheader
  %15 = icmp slt i32 %2, 0
  br i1 %15, label %20, label %16

16:                                               ; preds = %14
  %17 = load ptr, ptr %7, align 8, !tbaa !5
  %18 = call noundef i32 @_ZN5Piece10getPieceIDEv(ptr noundef nonnull align 4 dereferenceable(20) %17)
  %19 = getelementptr inbounds [20 x i32], ptr %3, i64 %11, i64 %10
  store i32 %18, ptr %19, align 4, !tbaa !15
  br label %21

20:                                               ; preds = %14
  store i8 1, ptr %9, align 4, !tbaa !16
  br label %21

21:                                               ; preds = %20, %16, %.preheader.us.preheader
  %22 = getelementptr inbounds i8, ptr %6, i64 1
  %23 = load i8, ptr %22, align 1, !tbaa !12, !range !13, !noundef !14
  %24 = trunc nuw i8 %23 to i1
  br i1 %24, label %25, label %33

25:                                               ; preds = %21
  %26 = icmp slt i32 %2, -1
  br i1 %26, label %32, label %27

27:                                               ; preds = %25
  %28 = add nsw i64 %10, 1
  %29 = load ptr, ptr %7, align 8, !tbaa !5
  %30 = call noundef i32 @_ZN5Piece10getPieceIDEv(ptr noundef nonnull align 4 dereferenceable(20) %29)
  %31 = getelementptr inbounds [20 x i32], ptr %3, i64 %11, i64 %28
  store i32 %30, ptr %31, align 4, !tbaa !15
  br label %33

32:                                               ; preds = %25
  store i8 1, ptr %9, align 4, !tbaa !16
  br label %33

33:                                               ; preds = %32, %27, %21
  %34 = getelementptr inbounds i8, ptr %6, i64 2
  %35 = load i8, ptr %34, align 2, !tbaa !12, !range !13, !noundef !14
  %36 = trunc nuw i8 %35 to i1
  br i1 %36, label %37, label %45

37:                                               ; preds = %33
  %38 = icmp slt i32 %2, -2
  br i1 %38, label %44, label %39

39:                                               ; preds = %37
  %40 = add nsw i64 %10, 2
  %41 = load ptr, ptr %7, align 8, !tbaa !5
  %42 = call noundef i32 @_ZN5Piece10getPieceIDEv(ptr noundef nonnull align 4 dereferenceable(20) %41)
  %43 = getelementptr inbounds [20 x i32], ptr %3, i64 %11, i64 %40
  store i32 %42, ptr %43, align 4, !tbaa !15
  br label %45

44:                                               ; preds = %37
  store i8 1, ptr %9, align 4, !tbaa !16
  br label %45

45:                                               ; preds = %44, %39, %33
  %46 = getelementptr inbounds i8, ptr %6, i64 3
  %47 = load i8, ptr %46, align 1, !tbaa !12, !range !13, !noundef !14
  %48 = trunc nuw i8 %47 to i1
  br i1 %48, label %49, label %.split.us23

49:                                               ; preds = %45
  %50 = icmp slt i32 %2, -3
  br i1 %50, label %56, label %51

51:                                               ; preds = %49
  %52 = add nsw i64 %10, 3
  %53 = load ptr, ptr %7, align 8, !tbaa !5
  %54 = call noundef i32 @_ZN5Piece10getPieceIDEv(ptr noundef nonnull align 4 dereferenceable(20) %53)
  %55 = getelementptr inbounds [20 x i32], ptr %3, i64 %11, i64 %52
  store i32 %54, ptr %55, align 4, !tbaa !15
  br label %.split.us23

56:                                               ; preds = %49
  store i8 1, ptr %9, align 4, !tbaa !16
  br label %.split.us23

.split.us23:                                      ; preds = %56, %51, %45
  %57 = add nsw i64 %11, 1
  %58 = getelementptr inbounds i8, ptr %6, i64 4
  %59 = load i8, ptr %58, align 4, !tbaa !12, !range !13, !noundef !14
  %60 = trunc nuw i8 %59 to i1
  br i1 %60, label %61, label %68

61:                                               ; preds = %.split.us23
  %62 = icmp slt i32 %2, 0
  br i1 %62, label %67, label %63

63:                                               ; preds = %61
  %64 = load ptr, ptr %7, align 8, !tbaa !5
  %65 = call noundef i32 @_ZN5Piece10getPieceIDEv(ptr noundef nonnull align 4 dereferenceable(20) %64)
  %66 = getelementptr inbounds [20 x i32], ptr %3, i64 %57, i64 %10
  store i32 %65, ptr %66, align 4, !tbaa !15
  br label %68

67:                                               ; preds = %61
  store i8 1, ptr %9, align 4, !tbaa !16
  br label %68

68:                                               ; preds = %67, %63, %.split.us23
  %69 = getelementptr inbounds i8, ptr %6, i64 5
  %70 = load i8, ptr %69, align 1, !tbaa !12, !range !13, !noundef !14
  %71 = trunc nuw i8 %70 to i1
  br i1 %71, label %72, label %80

72:                                               ; preds = %68
  %73 = icmp slt i32 %2, -1
  br i1 %73, label %79, label %74

74:                                               ; preds = %72
  %75 = add nsw i64 %10, 1
  %76 = load ptr, ptr %7, align 8, !tbaa !5
  %77 = call noundef i32 @_ZN5Piece10getPieceIDEv(ptr noundef nonnull align 4 dereferenceable(20) %76)
  %78 = getelementptr inbounds [20 x i32], ptr %3, i64 %57, i64 %75
  store i32 %77, ptr %78, align 4, !tbaa !15
  br label %80

79:                                               ; preds = %72
  store i8 1, ptr %9, align 4, !tbaa !16
  br label %80

80:                                               ; preds = %79, %74, %68
  %81 = getelementptr inbounds i8, ptr %6, i64 6
  %82 = load i8, ptr %81, align 2, !tbaa !12, !range !13, !noundef !14
  %83 = trunc nuw i8 %82 to i1
  br i1 %83, label %84, label %92

84:                                               ; preds = %80
  %85 = icmp slt i32 %2, -2
  br i1 %85, label %91, label %86

86:                                               ; preds = %84
  %87 = add nsw i64 %10, 2
  %88 = load ptr, ptr %7, align 8, !tbaa !5
  %89 = call noundef i32 @_ZN5Piece10getPieceIDEv(ptr noundef nonnull align 4 dereferenceable(20) %88)
  %90 = getelementptr inbounds [20 x i32], ptr %3, i64 %57, i64 %87
  store i32 %89, ptr %90, align 4, !tbaa !15
  br label %92

91:                                               ; preds = %84
  store i8 1, ptr %9, align 4, !tbaa !16
  br label %92

92:                                               ; preds = %91, %86, %80
  %93 = getelementptr inbounds i8, ptr %6, i64 7
  %94 = load i8, ptr %93, align 1, !tbaa !12, !range !13, !noundef !14
  %95 = trunc nuw i8 %94 to i1
  br i1 %95, label %96, label %.split.us23.1

96:                                               ; preds = %92
  %97 = icmp slt i32 %2, -3
  br i1 %97, label %103, label %98

98:                                               ; preds = %96
  %99 = add nsw i64 %10, 3
  %100 = load ptr, ptr %7, align 8, !tbaa !5
  %101 = call noundef i32 @_ZN5Piece10getPieceIDEv(ptr noundef nonnull align 4 dereferenceable(20) %100)
  %102 = getelementptr inbounds [20 x i32], ptr %3, i64 %57, i64 %99
  store i32 %101, ptr %102, align 4, !tbaa !15
  br label %.split.us23.1

103:                                              ; preds = %96
  store i8 1, ptr %9, align 4, !tbaa !16
  br label %.split.us23.1

.split.us23.1:                                    ; preds = %103, %98, %92
  %104 = add nsw i64 %11, 2
  %105 = getelementptr inbounds i8, ptr %6, i64 8
  %106 = load i8, ptr %105, align 8, !tbaa !12, !range !13, !noundef !14
  %107 = trunc nuw i8 %106 to i1
  br i1 %107, label %108, label %115

108:                                              ; preds = %.split.us23.1
  %109 = icmp slt i32 %2, 0
  br i1 %109, label %114, label %110

110:                                              ; preds = %108
  %111 = load ptr, ptr %7, align 8, !tbaa !5
  %112 = call noundef i32 @_ZN5Piece10getPieceIDEv(ptr noundef nonnull align 4 dereferenceable(20) %111)
  %113 = getelementptr inbounds [20 x i32], ptr %3, i64 %104, i64 %10
  store i32 %112, ptr %113, align 4, !tbaa !15
  br label %115

114:                                              ; preds = %108
  store i8 1, ptr %9, align 4, !tbaa !16
  br label %115

115:                                              ; preds = %114, %110, %.split.us23.1
  %116 = getelementptr inbounds i8, ptr %6, i64 9
  %117 = load i8, ptr %116, align 1, !tbaa !12, !range !13, !noundef !14
  %118 = trunc nuw i8 %117 to i1
  br i1 %118, label %119, label %127

119:                                              ; preds = %115
  %120 = icmp slt i32 %2, -1
  br i1 %120, label %126, label %121

121:                                              ; preds = %119
  %122 = add nsw i64 %10, 1
  %123 = load ptr, ptr %7, align 8, !tbaa !5
  %124 = call noundef i32 @_ZN5Piece10getPieceIDEv(ptr noundef nonnull align 4 dereferenceable(20) %123)
  %125 = getelementptr inbounds [20 x i32], ptr %3, i64 %104, i64 %122
  store i32 %124, ptr %125, align 4, !tbaa !15
  br label %127

126:                                              ; preds = %119
  store i8 1, ptr %9, align 4, !tbaa !16
  br label %127

127:                                              ; preds = %126, %121, %115
  %128 = getelementptr inbounds i8, ptr %6, i64 10
  %129 = load i8, ptr %128, align 2, !tbaa !12, !range !13, !noundef !14
  %130 = trunc nuw i8 %129 to i1
  br i1 %130, label %131, label %139

131:                                              ; preds = %127
  %132 = icmp slt i32 %2, -2
  br i1 %132, label %138, label %133

133:                                              ; preds = %131
  %134 = add nsw i64 %10, 2
  %135 = load ptr, ptr %7, align 8, !tbaa !5
  %136 = call noundef i32 @_ZN5Piece10getPieceIDEv(ptr noundef nonnull align 4 dereferenceable(20) %135)
  %137 = getelementptr inbounds [20 x i32], ptr %3, i64 %104, i64 %134
  store i32 %136, ptr %137, align 4, !tbaa !15
  br label %139

138:                                              ; preds = %131
  store i8 1, ptr %9, align 4, !tbaa !16
  br label %139

139:                                              ; preds = %138, %133, %127
  %140 = getelementptr inbounds i8, ptr %6, i64 11
  %141 = load i8, ptr %140, align 1, !tbaa !12, !range !13, !noundef !14
  %142 = trunc nuw i8 %141 to i1
  br i1 %142, label %143, label %.split.us23.2

143:                                              ; preds = %139
  %144 = icmp slt i32 %2, -3
  br i1 %144, label %150, label %145

145:                                              ; preds = %143
  %146 = add nsw i64 %10, 3
  %147 = load ptr, ptr %7, align 8, !tbaa !5
  %148 = call noundef i32 @_ZN5Piece10getPieceIDEv(ptr noundef nonnull align 4 dereferenceable(20) %147)
  %149 = getelementptr inbounds [20 x i32], ptr %3, i64 %104, i64 %146
  store i32 %148, ptr %149, align 4, !tbaa !15
  br label %.split.us23.2

150:                                              ; preds = %143
  store i8 1, ptr %9, align 4, !tbaa !16
  br label %.split.us23.2

.split.us23.2:                                    ; preds = %150, %145, %139
  %151 = add nsw i64 %11, 3
  %152 = getelementptr inbounds i8, ptr %6, i64 12
  %153 = load i8, ptr %152, align 4, !tbaa !12, !range !13, !noundef !14
  %154 = trunc nuw i8 %153 to i1
  br i1 %154, label %155, label %162

155:                                              ; preds = %.split.us23.2
  %156 = icmp slt i32 %2, 0
  br i1 %156, label %161, label %157

157:                                              ; preds = %155
  %158 = load ptr, ptr %7, align 8, !tbaa !5
  %159 = call noundef i32 @_ZN5Piece10getPieceIDEv(ptr noundef nonnull align 4 dereferenceable(20) %158)
  %160 = getelementptr inbounds [20 x i32], ptr %3, i64 %151, i64 %10
  store i32 %159, ptr %160, align 4, !tbaa !15
  br label %162

161:                                              ; preds = %155
  store i8 1, ptr %9, align 4, !tbaa !16
  br label %162

162:                                              ; preds = %161, %157, %.split.us23.2
  %163 = getelementptr inbounds i8, ptr %6, i64 13
  %164 = load i8, ptr %163, align 1, !tbaa !12, !range !13, !noundef !14
  %165 = trunc nuw i8 %164 to i1
  br i1 %165, label %166, label %174

166:                                              ; preds = %162
  %167 = icmp slt i32 %2, -1
  br i1 %167, label %173, label %168

168:                                              ; preds = %166
  %169 = add nsw i64 %10, 1
  %170 = load ptr, ptr %7, align 8, !tbaa !5
  %171 = call noundef i32 @_ZN5Piece10getPieceIDEv(ptr noundef nonnull align 4 dereferenceable(20) %170)
  %172 = getelementptr inbounds [20 x i32], ptr %3, i64 %151, i64 %169
  store i32 %171, ptr %172, align 4, !tbaa !15
  br label %174

173:                                              ; preds = %166
  store i8 1, ptr %9, align 4, !tbaa !16
  br label %174

174:                                              ; preds = %173, %168, %162
  %175 = getelementptr inbounds i8, ptr %6, i64 14
  %176 = load i8, ptr %175, align 2, !tbaa !12, !range !13, !noundef !14
  %177 = trunc nuw i8 %176 to i1
  br i1 %177, label %178, label %186

178:                                              ; preds = %174
  %179 = icmp slt i32 %2, -2
  br i1 %179, label %185, label %180

180:                                              ; preds = %178
  %181 = add nsw i64 %10, 2
  %182 = load ptr, ptr %7, align 8, !tbaa !5
  %183 = call noundef i32 @_ZN5Piece10getPieceIDEv(ptr noundef nonnull align 4 dereferenceable(20) %182)
  %184 = getelementptr inbounds [20 x i32], ptr %3, i64 %151, i64 %181
  store i32 %183, ptr %184, align 4, !tbaa !15
  br label %186

185:                                              ; preds = %178
  store i8 1, ptr %9, align 4, !tbaa !16
  br label %186

186:                                              ; preds = %185, %180, %174
  %187 = getelementptr inbounds i8, ptr %6, i64 15
  %188 = load i8, ptr %187, align 1, !tbaa !12, !range !13, !noundef !14
  %189 = trunc nuw i8 %188 to i1
  br i1 %189, label %190, label %334

190:                                              ; preds = %186
  %191 = icmp slt i32 %2, -3
  br i1 %191, label %197, label %192

192:                                              ; preds = %190
  %193 = add nsw i64 %10, 3
  %194 = load ptr, ptr %7, align 8, !tbaa !5
  %195 = call noundef i32 @_ZN5Piece10getPieceIDEv(ptr noundef nonnull align 4 dereferenceable(20) %194)
  %196 = getelementptr inbounds [20 x i32], ptr %3, i64 %151, i64 %193
  store i32 %195, ptr %196, align 4, !tbaa !15
  br label %334

197:                                              ; preds = %190
  store i8 1, ptr %9, align 4, !tbaa !16
  br label %334

198:                                              ; preds = %.preheader.preheader
  %199 = load ptr, ptr %7, align 8, !tbaa !5
  %200 = call noundef i32 @_ZN5Piece10getPieceIDEv(ptr noundef nonnull align 4 dereferenceable(20) %199)
  %201 = getelementptr inbounds [20 x i32], ptr %3, i64 %11, i64 %10
  store i32 %200, ptr %201, align 4, !tbaa !15
  br label %202

202:                                              ; preds = %198, %.preheader.preheader
  %203 = getelementptr inbounds i8, ptr %6, i64 1
  %204 = load i8, ptr %203, align 1, !tbaa !12, !range !13, !noundef !14
  %205 = trunc nuw i8 %204 to i1
  br i1 %205, label %206, label %211

206:                                              ; preds = %202
  %207 = add nsw i64 %10, 1
  %208 = load ptr, ptr %7, align 8, !tbaa !5
  %209 = call noundef i32 @_ZN5Piece10getPieceIDEv(ptr noundef nonnull align 4 dereferenceable(20) %208)
  %210 = getelementptr inbounds [20 x i32], ptr %3, i64 %11, i64 %207
  store i32 %209, ptr %210, align 4, !tbaa !15
  br label %211

211:                                              ; preds = %206, %202
  %212 = getelementptr inbounds i8, ptr %6, i64 2
  %213 = load i8, ptr %212, align 2, !tbaa !12, !range !13, !noundef !14
  %214 = trunc nuw i8 %213 to i1
  br i1 %214, label %215, label %220

215:                                              ; preds = %211
  %216 = add nsw i64 %10, 2
  %217 = load ptr, ptr %7, align 8, !tbaa !5
  %218 = call noundef i32 @_ZN5Piece10getPieceIDEv(ptr noundef nonnull align 4 dereferenceable(20) %217)
  %219 = getelementptr inbounds [20 x i32], ptr %3, i64 %11, i64 %216
  store i32 %218, ptr %219, align 4, !tbaa !15
  br label %220

220:                                              ; preds = %215, %211
  %221 = getelementptr inbounds i8, ptr %6, i64 3
  %222 = load i8, ptr %221, align 1, !tbaa !12, !range !13, !noundef !14
  %223 = trunc nuw i8 %222 to i1
  br i1 %223, label %224, label %.split.us

224:                                              ; preds = %220
  %225 = add nsw i64 %10, 3
  %226 = load ptr, ptr %7, align 8, !tbaa !5
  %227 = call noundef i32 @_ZN5Piece10getPieceIDEv(ptr noundef nonnull align 4 dereferenceable(20) %226)
  %228 = getelementptr inbounds [20 x i32], ptr %3, i64 %11, i64 %225
  store i32 %227, ptr %228, align 4, !tbaa !15
  br label %.split.us

.split.us:                                        ; preds = %224, %220
  %229 = add nsw i64 %11, 1
  %230 = getelementptr inbounds i8, ptr %6, i64 4
  %231 = load i8, ptr %230, align 4, !tbaa !12, !range !13, !noundef !14
  %232 = trunc nuw i8 %231 to i1
  br i1 %232, label %233, label %237

233:                                              ; preds = %.split.us
  %234 = load ptr, ptr %7, align 8, !tbaa !5
  %235 = call noundef i32 @_ZN5Piece10getPieceIDEv(ptr noundef nonnull align 4 dereferenceable(20) %234)
  %236 = getelementptr inbounds [20 x i32], ptr %3, i64 %229, i64 %10
  store i32 %235, ptr %236, align 4, !tbaa !15
  br label %237

237:                                              ; preds = %233, %.split.us
  %238 = getelementptr inbounds i8, ptr %6, i64 5
  %239 = load i8, ptr %238, align 1, !tbaa !12, !range !13, !noundef !14
  %240 = trunc nuw i8 %239 to i1
  br i1 %240, label %241, label %246

241:                                              ; preds = %237
  %242 = add nsw i64 %10, 1
  %243 = load ptr, ptr %7, align 8, !tbaa !5
  %244 = call noundef i32 @_ZN5Piece10getPieceIDEv(ptr noundef nonnull align 4 dereferenceable(20) %243)
  %245 = getelementptr inbounds [20 x i32], ptr %3, i64 %229, i64 %242
  store i32 %244, ptr %245, align 4, !tbaa !15
  br label %246

246:                                              ; preds = %241, %237
  %247 = getelementptr inbounds i8, ptr %6, i64 6
  %248 = load i8, ptr %247, align 2, !tbaa !12, !range !13, !noundef !14
  %249 = trunc nuw i8 %248 to i1
  br i1 %249, label %250, label %255

250:                                              ; preds = %246
  %251 = add nsw i64 %10, 2
  %252 = load ptr, ptr %7, align 8, !tbaa !5
  %253 = call noundef i32 @_ZN5Piece10getPieceIDEv(ptr noundef nonnull align 4 dereferenceable(20) %252)
  %254 = getelementptr inbounds [20 x i32], ptr %3, i64 %229, i64 %251
  store i32 %253, ptr %254, align 4, !tbaa !15
  br label %255

255:                                              ; preds = %250, %246
  %256 = getelementptr inbounds i8, ptr %6, i64 7
  %257 = load i8, ptr %256, align 1, !tbaa !12, !range !13, !noundef !14
  %258 = trunc nuw i8 %257 to i1
  br i1 %258, label %259, label %.split.us.1

259:                                              ; preds = %255
  %260 = add nsw i64 %10, 3
  %261 = load ptr, ptr %7, align 8, !tbaa !5
  %262 = call noundef i32 @_ZN5Piece10getPieceIDEv(ptr noundef nonnull align 4 dereferenceable(20) %261)
  %263 = getelementptr inbounds [20 x i32], ptr %3, i64 %229, i64 %260
  store i32 %262, ptr %263, align 4, !tbaa !15
  br label %.split.us.1

.split.us.1:                                      ; preds = %259, %255
  %264 = add nsw i64 %11, 2
  %265 = getelementptr inbounds i8, ptr %6, i64 8
  %266 = load i8, ptr %265, align 8, !tbaa !12, !range !13, !noundef !14
  %267 = trunc nuw i8 %266 to i1
  br i1 %267, label %268, label %272

268:                                              ; preds = %.split.us.1
  %269 = load ptr, ptr %7, align 8, !tbaa !5
  %270 = call noundef i32 @_ZN5Piece10getPieceIDEv(ptr noundef nonnull align 4 dereferenceable(20) %269)
  %271 = getelementptr inbounds [20 x i32], ptr %3, i64 %264, i64 %10
  store i32 %270, ptr %271, align 4, !tbaa !15
  br label %272

272:                                              ; preds = %268, %.split.us.1
  %273 = getelementptr inbounds i8, ptr %6, i64 9
  %274 = load i8, ptr %273, align 1, !tbaa !12, !range !13, !noundef !14
  %275 = trunc nuw i8 %274 to i1
  br i1 %275, label %276, label %281

276:                                              ; preds = %272
  %277 = add nsw i64 %10, 1
  %278 = load ptr, ptr %7, align 8, !tbaa !5
  %279 = call noundef i32 @_ZN5Piece10getPieceIDEv(ptr noundef nonnull align 4 dereferenceable(20) %278)
  %280 = getelementptr inbounds [20 x i32], ptr %3, i64 %264, i64 %277
  store i32 %279, ptr %280, align 4, !tbaa !15
  br label %281

281:                                              ; preds = %276, %272
  %282 = getelementptr inbounds i8, ptr %6, i64 10
  %283 = load i8, ptr %282, align 2, !tbaa !12, !range !13, !noundef !14
  %284 = trunc nuw i8 %283 to i1
  br i1 %284, label %285, label %290

285:                                              ; preds = %281
  %286 = add nsw i64 %10, 2
  %287 = load ptr, ptr %7, align 8, !tbaa !5
  %288 = call noundef i32 @_ZN5Piece10getPieceIDEv(ptr noundef nonnull align 4 dereferenceable(20) %287)
  %289 = getelementptr inbounds [20 x i32], ptr %3, i64 %264, i64 %286
  store i32 %288, ptr %289, align 4, !tbaa !15
  br label %290

290:                                              ; preds = %285, %281
  %291 = getelementptr inbounds i8, ptr %6, i64 11
  %292 = load i8, ptr %291, align 1, !tbaa !12, !range !13, !noundef !14
  %293 = trunc nuw i8 %292 to i1
  br i1 %293, label %294, label %.split.us.2

294:                                              ; preds = %290
  %295 = add nsw i64 %10, 3
  %296 = load ptr, ptr %7, align 8, !tbaa !5
  %297 = call noundef i32 @_ZN5Piece10getPieceIDEv(ptr noundef nonnull align 4 dereferenceable(20) %296)
  %298 = getelementptr inbounds [20 x i32], ptr %3, i64 %264, i64 %295
  store i32 %297, ptr %298, align 4, !tbaa !15
  br label %.split.us.2

.split.us.2:                                      ; preds = %294, %290
  %299 = add nsw i64 %11, 3
  %300 = getelementptr inbounds i8, ptr %6, i64 12
  %301 = load i8, ptr %300, align 4, !tbaa !12, !range !13, !noundef !14
  %302 = trunc nuw i8 %301 to i1
  br i1 %302, label %303, label %307

303:                                              ; preds = %.split.us.2
  %304 = load ptr, ptr %7, align 8, !tbaa !5
  %305 = call noundef i32 @_ZN5Piece10getPieceIDEv(ptr noundef nonnull align 4 dereferenceable(20) %304)
  %306 = getelementptr inbounds [20 x i32], ptr %3, i64 %299, i64 %10
  store i32 %305, ptr %306, align 4, !tbaa !15
  br label %307

307:                                              ; preds = %303, %.split.us.2
  %308 = getelementptr inbounds i8, ptr %6, i64 13
  %309 = load i8, ptr %308, align 1, !tbaa !12, !range !13, !noundef !14
  %310 = trunc nuw i8 %309 to i1
  br i1 %310, label %311, label %316

311:                                              ; preds = %307
  %312 = add nsw i64 %10, 1
  %313 = load ptr, ptr %7, align 8, !tbaa !5
  %314 = call noundef i32 @_ZN5Piece10getPieceIDEv(ptr noundef nonnull align 4 dereferenceable(20) %313)
  %315 = getelementptr inbounds [20 x i32], ptr %3, i64 %299, i64 %312
  store i32 %314, ptr %315, align 4, !tbaa !15
  br label %316

316:                                              ; preds = %311, %307
  %317 = getelementptr inbounds i8, ptr %6, i64 14
  %318 = load i8, ptr %317, align 2, !tbaa !12, !range !13, !noundef !14
  %319 = trunc nuw i8 %318 to i1
  br i1 %319, label %320, label %325

320:                                              ; preds = %316
  %321 = add nsw i64 %10, 2
  %322 = load ptr, ptr %7, align 8, !tbaa !5
  %323 = call noundef i32 @_ZN5Piece10getPieceIDEv(ptr noundef nonnull align 4 dereferenceable(20) %322)
  %324 = getelementptr inbounds [20 x i32], ptr %3, i64 %299, i64 %321
  store i32 %323, ptr %324, align 4, !tbaa !15
  br label %325

325:                                              ; preds = %320, %316
  %326 = getelementptr inbounds i8, ptr %6, i64 15
  %327 = load i8, ptr %326, align 1, !tbaa !12, !range !13, !noundef !14
  %328 = trunc nuw i8 %327 to i1
  br i1 %328, label %329, label %.split27.us

329:                                              ; preds = %325
  %330 = add nsw i64 %10, 3
  %331 = load ptr, ptr %7, align 8, !tbaa !5
  %332 = call noundef i32 @_ZN5Piece10getPieceIDEv(ptr noundef nonnull align 4 dereferenceable(20) %331)
  %333 = getelementptr inbounds [20 x i32], ptr %3, i64 %299, i64 %330
  store i32 %332, ptr %333, align 4, !tbaa !15
  br label %.split27.us

334:                                              ; preds = %186, %192, %197
  %335 = load ptr, ptr %7, align 8, !tbaa !5
  %336 = icmp eq ptr %335, null
  br i1 %336, label %338, label %337

337:                                              ; preds = %334
  call void @_ZdlPvm(ptr noundef nonnull %335, i64 noundef 20) #6
  br label %338

338:                                              ; preds = %337, %334
  %339 = getelementptr inbounds i8, ptr %0, i64 816
  %340 = load ptr, ptr %339, align 8, !tbaa !17
  store ptr %340, ptr %7, align 8, !tbaa !5
  %341 = call noalias noundef nonnull dereferenceable(20) ptr @_Znwm(i64 noundef 20) #7
  invoke void @_ZN5PieceC1Ev(ptr noundef nonnull align 4 dereferenceable(20) %341)
          to label %342 unwind label %343

342:                                              ; preds = %338
  store ptr %341, ptr %339, align 8, !tbaa !17
  br label %.split27.us

343:                                              ; preds = %338
  %344 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %341, i64 noundef 20) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  resume { ptr, i32 } %344

.split27.us:                                      ; preds = %329, %325, %342
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  ret void
}

declare void @_ZN5Piece9copyPieceEPA4_b(ptr noundef nonnull align 4 dereferenceable(20), ptr noundef) local_unnamed_addr #1

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

!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, !11, i64 808}
!6 = !{!"_ZTS6Tetris", !7, i64 0, !9, i64 800, !10, i64 804, !10, i64 805, !11, i64 808, !11, i64 816}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!"int", !7, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!10, !10, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!9, !9, i64 0}
!16 = !{!6, !10, i64 804}
!17 = !{!6, !11, i64 816}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass