; LLVM IR from clausecker/24puzzle :: match (match_find_best)

; 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.match = type { [4 x i32], [4 x i8], i64, i64 }

@.str.3 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [13 x i8], align 1
@__PRETTY_FUNCTION__.match_find_best = external hidden unnamed_addr constant [83 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [13 x i8], align 1

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @tileset_ranknz(i32 noundef) #2

; 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
define dso_local i32 @match_find_best(ptr noundef %0, ptr noundef %1, ptr noundef %2) #3 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i32, align 4
  %14 = alloca [4 x i32], align 16
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  call void @tileset_unrank_init(i64 noundef 6)
  call void @tileset_unrank_init(i64 noundef 12)
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %18, i8 0, i64 40, i1 false)
  store i32 0, ptr %15, align 4, !tbaa !9
  store i64 0, ptr %11, align 8, !tbaa !11
  br label %19

19:                                               ; preds = %117, %3
  %20 = load i64, ptr %11, align 8, !tbaa !11
  %21 = icmp ult i64 %20, 1352078
  br i1 %21, label %22, label %120

22:                                               ; preds = %19
  %23 = load i64, ptr %11, align 8, !tbaa !11
  %24 = trunc i64 %23 to i32
  %25 = call i32 @tileset_unranknz(i64 noundef 12, i32 noundef %24)
  store i32 %25, ptr %13, align 4, !tbaa !9
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = load i32, ptr %13, align 4, !tbaa !9
  %29 = getelementptr inbounds [4 x i32], ptr %14, i64 0, i64 0
  %30 = call i32 @match_half_best(ptr noundef %26, ptr noundef %27, i32 noundef %28, ptr noundef %29, ptr noundef %7, ptr noundef %9)
  store i32 %30, ptr %16, align 4, !tbaa !9
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = load i32, ptr %13, align 4, !tbaa !9
  %34 = call i32 @tileset_difference(i32 noundef 33554430, i32 noundef %33)
  %35 = getelementptr inbounds [4 x i32], ptr %14, i64 0, i64 0
  %36 = getelementptr inbounds i32, ptr %35, i64 2
  %37 = call i32 @match_half_best(ptr noundef %31, ptr noundef %32, i32 noundef %34, ptr noundef %36, ptr noundef %8, ptr noundef %10)
  store i32 %37, ptr %17, align 4, !tbaa !9
  %38 = load i64, ptr %7, align 8, !tbaa !13
  %39 = icmp ne i64 %38, 0
  br i1 %39, label %40, label %41

40:                                               ; preds = %22
  br label %42

41:                                               ; preds = %22
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.3, i32 noundef 166, ptr noundef @__PRETTY_FUNCTION__.match_find_best) #7
  unreachable

42:                                               ; preds = %40
  %43 = load i64, ptr %8, align 8, !tbaa !13
  %44 = icmp ne i64 %43, 0
  br i1 %44, label %45, label %46

45:                                               ; preds = %42
  br label %47

46:                                               ; preds = %42
  call void @__assert_fail(ptr noundef @.str.6, ptr noundef @.str.3, i32 noundef 167, ptr noundef @__PRETTY_FUNCTION__.match_find_best) #7
  unreachable

47:                                               ; preds = %45
  %48 = load i32, ptr %16, align 4, !tbaa !9
  %49 = load i32, ptr %17, align 4, !tbaa !9
  %50 = add nsw i32 %48, %49
  %51 = load i32, ptr %15, align 4, !tbaa !9
  %52 = icmp sgt i32 %50, %51
  br i1 %52, label %53, label %61

53:                                               ; preds = %47
  %54 = load i32, ptr %16, align 4, !tbaa !9
  %55 = load i32, ptr %17, align 4, !tbaa !9
  %56 = add nsw i32 %54, %55
  store i32 %56, ptr %15, align 4, !tbaa !9
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.match, ptr %57, i32 0, i32 2
  store i64 0, ptr %58, align 8, !tbaa !15
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.match, ptr %59, i32 0, i32 3
  store i64 0, ptr %60, align 8, !tbaa !17
  br label %61

61:                                               ; preds = %53, %47
  %62 = load i32, ptr %16, align 4, !tbaa !9
  %63 = load i32, ptr %17, align 4, !tbaa !9
  %64 = add nsw i32 %62, %63
  %65 = load i32, ptr %15, align 4, !tbaa !9
  %66 = icmp sge i32 %64, %65
  br i1 %66, label %67, label %116

67:                                               ; preds = %61
  %68 = load i64, ptr %7, align 8, !tbaa !13
  %69 = load i64, ptr %8, align 8, !tbaa !13
  %70 = mul i64 %68, %69
  %71 = load ptr, ptr %4, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.match, ptr %71, i32 0, i32 2
  %73 = load i64, ptr %72, align 8, !tbaa !15
  %74 = add i64 %73, %70
  store i64 %74, ptr %72, align 8, !tbaa !15
  %75 = load i64, ptr %9, align 8, !tbaa !13
  %76 = load i64, ptr %10, align 8, !tbaa !13
  %77 = add i64 %75, %76
  %78 = load ptr, ptr %4, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.match, ptr %78, i32 0, i32 3
  %80 = load i64, ptr %79, align 8, !tbaa !17
  %81 = icmp uge i64 %77, %80
  br i1 %81, label %82, label %115

82:                                               ; preds = %67
  %83 = load i64, ptr %9, align 8, !tbaa !13
  %84 = load i64, ptr %10, align 8, !tbaa !13
  %85 = add i64 %83, %84
  %86 = load ptr, ptr %4, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.match, ptr %86, i32 0, i32 3
  store i64 %85, ptr %87, align 8, !tbaa !17
  store i64 0, ptr %12, align 8, !tbaa !11
  br label %88

88:                                               ; preds = %111, %82
  %89 = load i64, ptr %12, align 8, !tbaa !11
  %90 = icmp ult i64 %89, 4
  br i1 %90, label %91, label %114

91:                                               ; preds = %88
  %92 = load i64, ptr %12, align 8, !tbaa !11
  %93 = getelementptr inbounds [4 x i32], ptr %14, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !9
  %95 = load ptr, ptr %4, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.match, ptr %95, i32 0, i32 0
  %97 = load i64, ptr %12, align 8, !tbaa !11
  %98 = getelementptr inbounds [4 x i32], ptr %96, i64 0, i64 %97
  store i32 %94, ptr %98, align 4, !tbaa !9
  %99 = load ptr, ptr %5, align 8, !tbaa !5
  %100 = load i64, ptr %12, align 8, !tbaa !11
  %101 = getelementptr inbounds [4 x i32], ptr %14, i64 0, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !9
  %103 = call i32 @tileset_ranknz(i32 noundef %102)
  %104 = zext i32 %103 to i64
  %105 = getelementptr inbounds i8, ptr %99, i64 %104
  %106 = load i8, ptr %105, align 1, !tbaa !18
  %107 = load ptr, ptr %4, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.match, ptr %107, i32 0, i32 1
  %109 = load i64, ptr %12, align 8, !tbaa !11
  %110 = getelementptr inbounds [4 x i8], ptr %108, i64 0, i64 %109
  store i8 %106, ptr %110, align 1, !tbaa !18
  br label %111

111:                                              ; preds = %91
  %112 = load i64, ptr %12, align 8, !tbaa !11
  %113 = add i64 %112, 1
  store i64 %113, ptr %12, align 8, !tbaa !11
  br label %88, !llvm.loop !19

114:                                              ; preds = %88
  br label %115

115:                                              ; preds = %114, %67
  br label %116

116:                                              ; preds = %115, %61
  br label %117

117:                                              ; preds = %116
  %118 = load i64, ptr %11, align 8, !tbaa !11
  %119 = add i64 %118, 1
  store i64 %119, ptr %11, align 8, !tbaa !11
  br label %19, !llvm.loop !21

120:                                              ; preds = %19
  %121 = load ptr, ptr %4, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.match, ptr %121, i32 0, i32 2
  %123 = load i64, ptr %122, align 8, !tbaa !15
  %124 = udiv i64 %123, 2
  store i64 %124, ptr %122, align 8, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  ret i32 1
}

declare void @tileset_unrank_init(i64 noundef) #4

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @tileset_unranknz(i64 noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden i32 @match_half_best(ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @tileset_difference(i32 noundef, i32 noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn 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 #2 = { inlinehint 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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind }
attributes #7 = { noreturn 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"long long", !7, i64 0}
!15 = !{!16, !14, i64 24}
!16 = !{!"match", !7, i64 0, !7, i64 16, !14, i64 24, !14, i64 32}
!17 = !{!16, !14, i64 32}
!18 = !{!7, !7, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = distinct !{!21, !20}


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

@.str.3 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [13 x i8], align 1
@__PRETTY_FUNCTION__.match_find_best = external hidden unnamed_addr constant [83 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [13 x i8], align 1

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @tileset_ranknz(i32 noundef) local_unnamed_addr #2

; 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
define dso_local noundef i32 @match_find_best(ptr nocapture noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #3 {
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca [4 x i32], align 16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #6
  tail call void @tileset_unrank_init(i64 noundef 6) #6
  tail call void @tileset_unrank_init(i64 noundef 12) #6
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %0, i8 0, i64 40, i1 false)
  %9 = getelementptr inbounds i8, ptr %8, i64 8
  %10 = getelementptr inbounds i8, ptr %0, i64 24
  %11 = getelementptr inbounds i8, ptr %0, i64 32
  %12 = getelementptr inbounds i8, ptr %0, i64 16
  %13 = getelementptr inbounds i8, ptr %0, i64 32
  %14 = getelementptr inbounds i8, ptr %8, i64 4
  %15 = getelementptr inbounds i8, ptr %0, i64 4
  %16 = getelementptr inbounds i8, ptr %0, i64 17
  %17 = getelementptr inbounds i8, ptr %0, i64 8
  %18 = getelementptr inbounds i8, ptr %0, i64 18
  %19 = getelementptr inbounds i8, ptr %8, i64 12
  %20 = getelementptr inbounds i8, ptr %0, i64 12
  %21 = getelementptr inbounds i8, ptr %0, i64 19
  br label %22

22:                                               ; preds = %3, %.loopexit
  %.045 = phi i64 [ 0, %3 ], [ %65, %.loopexit ]
  %.03344 = phi i32 [ 0, %3 ], [ %.142, %.loopexit ]
  %23 = trunc nuw nsw i64 %.045 to i32
  %24 = call i32 @tileset_unranknz(i64 noundef 12, i32 noundef %23)
  %25 = call i32 @match_half_best(ptr noundef %1, ptr noundef %2, i32 noundef %24, ptr noundef nonnull %8, ptr noundef nonnull %4, ptr noundef nonnull %6)
  %26 = call i32 @tileset_difference(i32 noundef 33554430, i32 noundef %24)
  %27 = call i32 @match_half_best(ptr noundef %1, ptr noundef %2, i32 noundef %26, ptr noundef nonnull %9, ptr noundef nonnull %5, ptr noundef nonnull %7)
  %28 = load i64, ptr %4, align 8, !tbaa !5
  %.not = icmp eq i64 %28, 0
  br i1 %.not, label %29, label %30

29:                                               ; preds = %22
  call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.3, i32 noundef 166, ptr noundef nonnull @__PRETTY_FUNCTION__.match_find_best) #7
  unreachable

30:                                               ; preds = %22
  %31 = load i64, ptr %5, align 8, !tbaa !5
  %.not36 = icmp eq i64 %31, 0
  br i1 %.not36, label %32, label %33

32:                                               ; preds = %30
  call void @__assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.3, i32 noundef 167, ptr noundef nonnull @__PRETTY_FUNCTION__.match_find_best) #7
  unreachable

33:                                               ; preds = %30
  %34 = add nsw i32 %27, %25
  %35 = icmp sgt i32 %34, %.03344
  br i1 %35, label %.thread, label %36

.thread:                                          ; preds = %33
  store i64 0, ptr %13, align 8
  br label %37

36:                                               ; preds = %33
  %.not37 = icmp slt i32 %34, %.03344
  br i1 %.not37, label %.loopexit, label %._crit_edge

._crit_edge:                                      ; preds = %36
  %.pre = load i64, ptr %10, align 8, !tbaa !9
  %.pre46 = load i64, ptr %11, align 8, !tbaa !11
  br label %37

37:                                               ; preds = %._crit_edge, %.thread
  %38 = phi i64 [ 0, %.thread ], [ %.pre46, %._crit_edge ]
  %39 = phi i64 [ 0, %.thread ], [ %.pre, %._crit_edge ]
  %.141 = phi i32 [ %34, %.thread ], [ %.03344, %._crit_edge ]
  %40 = mul i64 %31, %28
  %41 = add i64 %39, %40
  store i64 %41, ptr %10, align 8, !tbaa !9
  %42 = load i64, ptr %6, align 8, !tbaa !5
  %43 = load i64, ptr %7, align 8, !tbaa !5
  %44 = add i64 %43, %42
  %.not38 = icmp ult i64 %44, %38
  br i1 %.not38, label %.loopexit, label %.loopexit.loopexit

.loopexit.loopexit:                               ; preds = %37
  store i64 %44, ptr %11, align 8, !tbaa !11
  %45 = load i32, ptr %8, align 16, !tbaa !12
  store i32 %45, ptr %0, align 4, !tbaa !12
  %46 = call i32 @tileset_ranknz(i32 noundef %45)
  %47 = zext i32 %46 to i64
  %48 = getelementptr inbounds i8, ptr %1, i64 %47
  %49 = load i8, ptr %48, align 1, !tbaa !14
  store i8 %49, ptr %12, align 1, !tbaa !14
  %50 = load i32, ptr %14, align 4, !tbaa !12
  store i32 %50, ptr %15, align 4, !tbaa !12
  %51 = call i32 @tileset_ranknz(i32 noundef %50)
  %52 = zext i32 %51 to i64
  %53 = getelementptr inbounds i8, ptr %1, i64 %52
  %54 = load i8, ptr %53, align 1, !tbaa !14
  store i8 %54, ptr %16, align 1, !tbaa !14
  %55 = load i32, ptr %9, align 8, !tbaa !12
  store i32 %55, ptr %17, align 4, !tbaa !12
  %56 = call i32 @tileset_ranknz(i32 noundef %55)
  %57 = zext i32 %56 to i64
  %58 = getelementptr inbounds i8, ptr %1, i64 %57
  %59 = load i8, ptr %58, align 1, !tbaa !14
  store i8 %59, ptr %18, align 1, !tbaa !14
  %60 = load i32, ptr %19, align 4, !tbaa !12
  store i32 %60, ptr %20, align 4, !tbaa !12
  %61 = call i32 @tileset_ranknz(i32 noundef %60)
  %62 = zext i32 %61 to i64
  %63 = getelementptr inbounds i8, ptr %1, i64 %62
  %64 = load i8, ptr %63, align 1, !tbaa !14
  store i8 %64, ptr %21, align 1, !tbaa !14
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %36, %37
  %.142 = phi i32 [ %.03344, %36 ], [ %.141, %37 ], [ %.141, %.loopexit.loopexit ]
  %65 = add nuw nsw i64 %.045, 1
  %exitcond.not = icmp eq i64 %65, 1352078
  br i1 %exitcond.not, label %66, label %22, !llvm.loop !15

66:                                               ; preds = %.loopexit
  %67 = load i64, ptr %10, align 8, !tbaa !9
  %68 = lshr i64 %67, 1
  store i64 %68, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  ret i32 1
}

declare void @tileset_unrank_init(i64 noundef) local_unnamed_addr #4

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @tileset_unranknz(i64 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden i32 @match_half_best(ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @tileset_difference(i32 noundef, i32 noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn 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 #2 = { inlinehint 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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind }
attributes #7 = { noreturn 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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 24}
!10 = !{!"match", !7, i64 0, !7, i64 16, !6, i64 24, !6, i64 32}
!11 = !{!10, !6, i64 32}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}


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