; LLVM IR from clausecker/24puzzle :: catalogue (catalogue_add_transpositions)

; 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.pdb_catalogue = type { [64 x %struct.heuristic], [64 x i32], [64 x i64], i64, i64 }
%struct.heuristic = type { ptr, ptr, ptr, ptr, i32, i32, i32 }

@.str.9 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [65 x i8], align 1
@__PRETTY_FUNCTION__.catalogue_add_transpositions = external hidden unnamed_addr constant [57 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: nounwind willreturn memory(none)
declare ptr @__errno_location() #1

; 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 @catalogue_add_transpositions(ptr noundef %0) #2 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca %struct.pdb_catalogue, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca [64 x i64], align 16
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 3856, ptr %4) #6
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %4, ptr align 8 %14, i64 3856, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 512, 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 4, ptr %12) #6
  %15 = getelementptr inbounds %struct.pdb_catalogue, ptr %4, i32 0, i32 3
  %16 = load i64, ptr %15, align 8, !tbaa !13
  store i64 %16, ptr %10, align 8, !tbaa !11
  store i64 0, ptr %8, align 8, !tbaa !11
  br label %17

17:                                               ; preds = %90, %1
  %18 = load i64, ptr %8, align 8, !tbaa !11
  %19 = load i64, ptr %10, align 8, !tbaa !11
  %20 = icmp ult i64 %18, %19
  br i1 %20, label %21, label %93

21:                                               ; preds = %17
  %22 = getelementptr inbounds %struct.pdb_catalogue, ptr %4, i32 0, i32 1
  %23 = load i64, ptr %8, align 8, !tbaa !11
  %24 = getelementptr inbounds [64 x i32], ptr %22, i64 0, i64 %23
  %25 = load i32, ptr %24, align 4, !tbaa !15
  %26 = call i32 @tileset_transpose(i32 noundef %25)
  store i32 %26, ptr %12, align 4, !tbaa !15
  store i64 0, ptr %9, align 8, !tbaa !11
  br label %27

27:                                               ; preds = %44, %21
  %28 = load i64, ptr %9, align 8, !tbaa !11
  %29 = getelementptr inbounds %struct.pdb_catalogue, ptr %4, i32 0, i32 3
  %30 = load i64, ptr %29, align 8, !tbaa !13
  %31 = icmp ult i64 %28, %30
  br i1 %31, label %32, label %47

32:                                               ; preds = %27
  %33 = getelementptr inbounds %struct.pdb_catalogue, ptr %4, i32 0, i32 1
  %34 = load i64, ptr %9, align 8, !tbaa !11
  %35 = getelementptr inbounds [64 x i32], ptr %33, i64 0, i64 %34
  %36 = load i32, ptr %35, align 4, !tbaa !15
  %37 = load i32, ptr %12, align 4, !tbaa !15
  %38 = icmp eq i32 %36, %37
  br i1 %38, label %39, label %43

39:                                               ; preds = %32
  %40 = load i64, ptr %9, align 8, !tbaa !11
  %41 = load i64, ptr %8, align 8, !tbaa !11
  %42 = getelementptr inbounds [64 x i64], ptr %7, i64 0, i64 %41
  store i64 %40, ptr %42, align 8, !tbaa !11
  br label %89

43:                                               ; preds = %32
  br label %44

44:                                               ; preds = %43
  %45 = load i64, ptr %9, align 8, !tbaa !11
  %46 = add i64 %45, 1
  store i64 %46, ptr %9, align 8, !tbaa !11
  br label %27, !llvm.loop !17

47:                                               ; preds = %27
  %48 = getelementptr inbounds %struct.pdb_catalogue, ptr %4, i32 0, i32 3
  %49 = load i64, ptr %48, align 8, !tbaa !13
  %50 = icmp uge i64 %49, 64
  br i1 %50, label %51, label %53

51:                                               ; preds = %47
  %52 = call ptr @__errno_location() #7
  store i32 12, ptr %52, align 4, !tbaa !15
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %13, align 4
  br label %158

53:                                               ; preds = %47
  %54 = getelementptr inbounds %struct.pdb_catalogue, ptr %4, i32 0, i32 0
  %55 = getelementptr inbounds [64 x %struct.heuristic], ptr %54, i64 0, i64 0
  %56 = getelementptr inbounds %struct.pdb_catalogue, ptr %4, i32 0, i32 3
  %57 = load i64, ptr %56, align 8, !tbaa !13
  %58 = getelementptr inbounds %struct.heuristic, ptr %55, i64 %57
  %59 = getelementptr inbounds %struct.pdb_catalogue, ptr %4, i32 0, i32 0
  %60 = getelementptr inbounds [64 x %struct.heuristic], ptr %59, i64 0, i64 0
  %61 = load i64, ptr %8, align 8, !tbaa !11
  %62 = getelementptr inbounds %struct.heuristic, ptr %60, i64 %61
  call void @heu_morph(ptr noundef %58, ptr noundef %62, i32 noundef 4)
  %63 = getelementptr inbounds %struct.pdb_catalogue, ptr %4, i32 0, i32 0
  %64 = getelementptr inbounds %struct.pdb_catalogue, ptr %4, i32 0, i32 3
  %65 = load i64, ptr %64, align 8, !tbaa !13
  %66 = getelementptr inbounds [64 x %struct.heuristic], ptr %63, i64 0, i64 %65
  %67 = getelementptr inbounds %struct.heuristic, ptr %66, i32 0, i32 4
  %68 = load i32, ptr %67, align 8, !tbaa !19
  %69 = load i32, ptr %12, align 4, !tbaa !15
  %70 = icmp eq i32 %68, %69
  br i1 %70, label %71, label %72

71:                                               ; preds = %53
  br label %73

72:                                               ; preds = %53
  call void @__assert_fail(ptr noundef @.str.9, ptr noundef @.str.10, i32 noundef 321, ptr noundef @__PRETTY_FUNCTION__.catalogue_add_transpositions) #8
  unreachable

73:                                               ; preds = %71
  %74 = getelementptr inbounds %struct.pdb_catalogue, ptr %4, i32 0, i32 0
  %75 = getelementptr inbounds %struct.pdb_catalogue, ptr %4, i32 0, i32 3
  %76 = load i64, ptr %75, align 8, !tbaa !13
  %77 = getelementptr inbounds [64 x %struct.heuristic], ptr %74, i64 0, i64 %76
  %78 = getelementptr inbounds %struct.heuristic, ptr %77, i32 0, i32 4
  %79 = load i32, ptr %78, align 8, !tbaa !19
  %80 = getelementptr inbounds %struct.pdb_catalogue, ptr %4, i32 0, i32 1
  %81 = getelementptr inbounds %struct.pdb_catalogue, ptr %4, i32 0, i32 3
  %82 = load i64, ptr %81, align 8, !tbaa !13
  %83 = getelementptr inbounds [64 x i32], ptr %80, i64 0, i64 %82
  store i32 %79, ptr %83, align 4, !tbaa !15
  %84 = getelementptr inbounds %struct.pdb_catalogue, ptr %4, i32 0, i32 3
  %85 = load i64, ptr %84, align 8, !tbaa !13
  %86 = add i64 %85, 1
  store i64 %86, ptr %84, align 8, !tbaa !13
  %87 = load i64, ptr %8, align 8, !tbaa !11
  %88 = getelementptr inbounds [64 x i64], ptr %7, i64 0, i64 %87
  store i64 %85, ptr %88, align 8, !tbaa !11
  br label %89

89:                                               ; preds = %73, %39
  br label %90

90:                                               ; preds = %89
  %91 = load i64, ptr %8, align 8, !tbaa !11
  %92 = add i64 %91, 1
  store i64 %92, ptr %8, align 8, !tbaa !11
  br label %17, !llvm.loop !21

93:                                               ; preds = %17
  %94 = getelementptr inbounds %struct.pdb_catalogue, ptr %4, i32 0, i32 4
  %95 = load i64, ptr %94, align 8, !tbaa !22
  store i64 %95, ptr %11, align 8, !tbaa !11
  store i64 0, ptr %8, align 8, !tbaa !11
  br label %96

96:                                               ; preds = %153, %93
  %97 = load i64, ptr %8, align 8, !tbaa !11
  %98 = load i64, ptr %11, align 8, !tbaa !11
  %99 = icmp ult i64 %97, %98
  br i1 %99, label %100, label %156

100:                                              ; preds = %96
  store i64 0, ptr %6, align 8, !tbaa !23
  %101 = getelementptr inbounds %struct.pdb_catalogue, ptr %4, i32 0, i32 2
  %102 = load i64, ptr %8, align 8, !tbaa !11
  %103 = getelementptr inbounds [64 x i64], ptr %101, i64 0, i64 %102
  %104 = load i64, ptr %103, align 8, !tbaa !23
  store i64 %104, ptr %5, align 8, !tbaa !23
  br label %105

105:                                              ; preds = %116, %100
  %106 = load i64, ptr %5, align 8, !tbaa !23
  %107 = icmp ne i64 %106, 0
  br i1 %107, label %108, label %121

108:                                              ; preds = %105
  %109 = load i64, ptr %5, align 8, !tbaa !23
  %110 = call i32 @ctzll(i64 noundef %109)
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [64 x i64], ptr %7, i64 0, i64 %111
  %113 = load i64, ptr %112, align 8, !tbaa !11
  %114 = load i64, ptr %6, align 8, !tbaa !23
  %115 = or i64 %114, %113
  store i64 %115, ptr %6, align 8, !tbaa !23
  br label %116

116:                                              ; preds = %108
  %117 = load i64, ptr %5, align 8, !tbaa !23
  %118 = sub i64 %117, 1
  %119 = load i64, ptr %5, align 8, !tbaa !23
  %120 = and i64 %119, %118
  store i64 %120, ptr %5, align 8, !tbaa !23
  br label %105, !llvm.loop !25

121:                                              ; preds = %105
  store i64 0, ptr %9, align 8, !tbaa !11
  br label %122

122:                                              ; preds = %136, %121
  %123 = load i64, ptr %9, align 8, !tbaa !11
  %124 = getelementptr inbounds %struct.pdb_catalogue, ptr %4, i32 0, i32 4
  %125 = load i64, ptr %124, align 8, !tbaa !22
  %126 = icmp ult i64 %123, %125
  br i1 %126, label %127, label %139

127:                                              ; preds = %122
  %128 = getelementptr inbounds %struct.pdb_catalogue, ptr %4, i32 0, i32 2
  %129 = load i64, ptr %9, align 8, !tbaa !11
  %130 = getelementptr inbounds [64 x i64], ptr %128, i64 0, i64 %129
  %131 = load i64, ptr %130, align 8, !tbaa !23
  %132 = load i64, ptr %6, align 8, !tbaa !23
  %133 = icmp eq i64 %131, %132
  br i1 %133, label %134, label %135

134:                                              ; preds = %127
  br label %152

135:                                              ; preds = %127
  br label %136

136:                                              ; preds = %135
  %137 = load i64, ptr %9, align 8, !tbaa !11
  %138 = add i64 %137, 1
  store i64 %138, ptr %9, align 8, !tbaa !11
  br label %122, !llvm.loop !26

139:                                              ; preds = %122
  %140 = getelementptr inbounds %struct.pdb_catalogue, ptr %4, i32 0, i32 4
  %141 = load i64, ptr %140, align 8, !tbaa !22
  %142 = icmp uge i64 %141, 64
  br i1 %142, label %143, label %145

143:                                              ; preds = %139
  %144 = call ptr @__errno_location() #7
  store i32 12, ptr %144, align 4, !tbaa !15
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %13, align 4
  br label %158

145:                                              ; preds = %139
  %146 = load i64, ptr %6, align 8, !tbaa !23
  %147 = getelementptr inbounds %struct.pdb_catalogue, ptr %4, i32 0, i32 2
  %148 = getelementptr inbounds %struct.pdb_catalogue, ptr %4, i32 0, i32 4
  %149 = load i64, ptr %148, align 8, !tbaa !22
  %150 = add i64 %149, 1
  store i64 %150, ptr %148, align 8, !tbaa !22
  %151 = getelementptr inbounds [64 x i64], ptr %147, i64 0, i64 %149
  store i64 %146, ptr %151, align 8, !tbaa !23
  br label %152

152:                                              ; preds = %145, %134
  br label %153

153:                                              ; preds = %152
  %154 = load i64, ptr %8, align 8, !tbaa !11
  %155 = add i64 %154, 1
  store i64 %155, ptr %8, align 8, !tbaa !11
  br label %96, !llvm.loop !27

156:                                              ; preds = %96
  %157 = load ptr, ptr %3, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %157, ptr align 8 %4, i64 3856, i1 false), !tbaa.struct !9
  store i32 0, ptr %2, align 4
  store i32 1, ptr %13, align 4
  br label %158

158:                                              ; preds = %156, %143, %51
  call void @llvm.lifetime.end.p0(i64 4, 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 512, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 3856, ptr %4) #6
  %159 = load i32, ptr %2, align 4
  ret i32 %159
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @tileset_transpose(i32 noundef) #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @heu_morph(ptr noundef, ptr noundef, i32 noundef) #4

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @ctzll(i64 noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind willreturn memory(none) "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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { 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 #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(none) }
attributes #8 = { 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 = !{i64 0, i64 3072, !10, i64 3072, i64 256, !10, i64 3328, i64 512, !10, i64 3840, i64 8, !11, i64 3848, i64 8, !11}
!10 = !{!7, !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !12, i64 3840}
!14 = !{!"pdb_catalogue", !7, i64 0, !7, i64 3072, !7, i64 3328, !12, i64 3840, !12, i64 3848}
!15 = !{!16, !16, i64 0}
!16 = !{!"int", !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!20, !16, i64 32}
!20 = !{!"heuristic", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !16, i64 32, !16, i64 36, !16, i64 40}
!21 = distinct !{!21, !18}
!22 = !{!14, !12, i64 3848}
!23 = !{!24, !24, i64 0}
!24 = !{!"long long", !7, i64 0}
!25 = distinct !{!25, !18}
!26 = distinct !{!26, !18}
!27 = distinct !{!27, !18}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.pdb_catalogue = type { [64 x %struct.heuristic], [64 x i32], [64 x i64], i64, i64 }
%struct.heuristic = type { ptr, ptr, ptr, ptr, i32, i32, i32 }

@.str.9 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [65 x i8], align 1
@__PRETTY_FUNCTION__.catalogue_add_transpositions = external hidden unnamed_addr constant [57 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: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__errno_location() local_unnamed_addr #1

; 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 range(i32 -1, 1) i32 @catalogue_add_transpositions(ptr nocapture noundef %0) local_unnamed_addr #2 {
  %2 = alloca %struct.pdb_catalogue, align 8
  %3 = alloca [64 x i64], align 16
  call void @llvm.lifetime.start.p0(i64 3856, ptr nonnull %2) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(3856) %2, ptr noundef nonnull align 8 dereferenceable(3856) %0, i64 3856, i1 false), !tbaa.struct !5
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %3) #6
  %4 = getelementptr inbounds i8, ptr %2, i64 3840
  %5 = load i64, ptr %4, align 8, !tbaa !11
  %.not60 = icmp eq i64 %5, 0
  br i1 %.not60, label %._crit_edge46, label %.lr.ph45

.lr.ph45:                                         ; preds = %1
  %6 = getelementptr inbounds i8, ptr %2, i64 3072
  br label %7

7:                                                ; preds = %.lr.ph45, %.loopexit69
  %.03242 = phi i64 [ 0, %.lr.ph45 ], [ %31, %.loopexit69 ]
  %8 = getelementptr inbounds [64 x i32], ptr %6, i64 0, i64 %.03242
  %9 = load i32, ptr %8, align 4, !tbaa !13
  %10 = call i32 @tileset_transpose(i32 noundef %9)
  %11 = load i64, ptr %4, align 8, !tbaa !11
  %.not61 = icmp eq i64 %11, 0
  br i1 %.not61, label %._crit_edge.thread, label %.lr.ph

.lr.ph:                                           ; preds = %7, %15
  %.03141 = phi i64 [ %16, %15 ], [ 0, %7 ]
  %12 = getelementptr inbounds [64 x i32], ptr %6, i64 0, i64 %.03141
  %13 = load i32, ptr %12, align 4, !tbaa !13
  %14 = icmp eq i32 %13, %10
  br i1 %14, label %.loopexit69, label %15

15:                                               ; preds = %.lr.ph
  %16 = add nuw i64 %.03141, 1
  %exitcond.not = icmp eq i64 %16, %11
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !15

._crit_edge:                                      ; preds = %15
  %17 = icmp ugt i64 %11, 63
  br i1 %17, label %18, label %._crit_edge.thread

18:                                               ; preds = %._crit_edge
  %19 = tail call ptr @__errno_location() #7
  store i32 12, ptr %19, align 4, !tbaa !13
  br label %59

._crit_edge.thread:                               ; preds = %7, %._crit_edge
  %20 = getelementptr inbounds %struct.heuristic, ptr %2, i64 %11
  %21 = getelementptr inbounds %struct.heuristic, ptr %2, i64 %.03242
  call void @heu_morph(ptr noundef nonnull %20, ptr noundef nonnull %21, i32 noundef 4)
  %22 = load i64, ptr %4, align 8, !tbaa !11
  %23 = getelementptr inbounds [64 x %struct.heuristic], ptr %2, i64 0, i64 %22, i32 4
  %24 = load i32, ptr %23, align 8, !tbaa !17
  %25 = icmp eq i32 %24, %10
  br i1 %25, label %27, label %26

26:                                               ; preds = %._crit_edge.thread
  call void @__assert_fail(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.10, i32 noundef 321, ptr noundef nonnull @__PRETTY_FUNCTION__.catalogue_add_transpositions) #8
  unreachable

27:                                               ; preds = %._crit_edge.thread
  %28 = getelementptr inbounds [64 x i32], ptr %6, i64 0, i64 %22
  store i32 %10, ptr %28, align 4, !tbaa !13
  %29 = add i64 %22, 1
  store i64 %29, ptr %4, align 8, !tbaa !11
  br label %.loopexit69

.loopexit69:                                      ; preds = %.lr.ph, %27
  %.03141.lcssa.sink = phi i64 [ %22, %27 ], [ %.03141, %.lr.ph ]
  %30 = getelementptr inbounds [64 x i64], ptr %3, i64 0, i64 %.03242
  store i64 %.03141.lcssa.sink, ptr %30, align 8, !tbaa !9
  %31 = add nuw i64 %.03242, 1
  %exitcond65.not = icmp eq i64 %31, %5
  br i1 %exitcond65.not, label %._crit_edge46, label %7, !llvm.loop !20

._crit_edge46:                                    ; preds = %.loopexit69, %1
  %32 = getelementptr inbounds i8, ptr %2, i64 3848
  %33 = load i64, ptr %32, align 8, !tbaa !21
  %.not62 = icmp eq i64 %33, 0
  br i1 %.not62, label %._crit_edge59, label %.lr.ph58

.lr.ph58:                                         ; preds = %._crit_edge46
  %34 = getelementptr inbounds i8, ptr %2, i64 3328
  br label %35

35:                                               ; preds = %.lr.ph58, %.loopexit
  %36 = phi i64 [ %33, %.lr.ph58 ], [ %57, %.loopexit ]
  %.13356 = phi i64 [ 0, %.lr.ph58 ], [ %58, %.loopexit ]
  %37 = getelementptr inbounds [64 x i64], ptr %34, i64 0, i64 %.13356
  %38 = load i64, ptr %37, align 8, !tbaa !22
  %.not47 = icmp eq i64 %38, 0
  br i1 %.not47, label %.preheader, label %.lr.ph51

.preheader.loopexit:                              ; preds = %.lr.ph51
  %.pre = load i64, ptr %32, align 8, !tbaa !21
  br label %.preheader

.preheader:                                       ; preds = %.preheader.loopexit, %35
  %39 = phi i64 [ %36, %35 ], [ %.pre, %.preheader.loopexit ]
  %.030.lcssa = phi i64 [ 0, %35 ], [ %44, %.preheader.loopexit ]
  %.not63 = icmp eq i64 %39, 0
  br i1 %.not63, label %._crit_edge54.thread, label %.lr.ph53

.lr.ph51:                                         ; preds = %35, %.lr.ph51
  %.02949 = phi i64 [ %46, %.lr.ph51 ], [ %38, %35 ]
  %.03048 = phi i64 [ %44, %.lr.ph51 ], [ 0, %35 ]
  %40 = call i32 @ctzll(i64 noundef %.02949)
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [64 x i64], ptr %3, i64 0, i64 %41
  %43 = load i64, ptr %42, align 8, !tbaa !9
  %44 = or i64 %43, %.03048
  %45 = add i64 %.02949, -1
  %46 = and i64 %45, %.02949
  %.not = icmp eq i64 %46, 0
  br i1 %.not, label %.preheader.loopexit, label %.lr.ph51, !llvm.loop !24

47:                                               ; preds = %.lr.ph53
  %48 = add nuw i64 %.152, 1
  %exitcond66.not = icmp eq i64 %48, %39
  br i1 %exitcond66.not, label %._crit_edge54, label %.lr.ph53, !llvm.loop !25

.lr.ph53:                                         ; preds = %.preheader, %47
  %.152 = phi i64 [ %48, %47 ], [ 0, %.preheader ]
  %49 = getelementptr inbounds [64 x i64], ptr %34, i64 0, i64 %.152
  %50 = load i64, ptr %49, align 8, !tbaa !22
  %51 = icmp eq i64 %50, %.030.lcssa
  br i1 %51, label %.loopexit, label %47

._crit_edge54:                                    ; preds = %47
  %52 = icmp ugt i64 %39, 63
  br i1 %52, label %53, label %._crit_edge54.thread

53:                                               ; preds = %._crit_edge54
  %54 = tail call ptr @__errno_location() #7
  store i32 12, ptr %54, align 4, !tbaa !13
  br label %59

._crit_edge54.thread:                             ; preds = %.preheader, %._crit_edge54
  %55 = add nuw nsw i64 %39, 1
  store i64 %55, ptr %32, align 8, !tbaa !21
  %56 = getelementptr inbounds [64 x i64], ptr %34, i64 0, i64 %39
  store i64 %.030.lcssa, ptr %56, align 8, !tbaa !22
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph53, %._crit_edge54.thread
  %57 = phi i64 [ %55, %._crit_edge54.thread ], [ %39, %.lr.ph53 ]
  %58 = add nuw i64 %.13356, 1
  %exitcond67.not = icmp eq i64 %58, %33
  br i1 %exitcond67.not, label %._crit_edge59, label %35, !llvm.loop !26

._crit_edge59:                                    ; preds = %.loopexit, %._crit_edge46
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(3856) %0, ptr noundef nonnull align 8 dereferenceable(3856) %2, i64 3856, i1 false), !tbaa.struct !5
  br label %59

59:                                               ; preds = %._crit_edge59, %53, %18
  %.0 = phi i32 [ -1, %18 ], [ -1, %53 ], [ 0, %._crit_edge59 ]
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 3856, ptr nonnull %2) #6
  ret i32 %.0
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @heu_morph(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @ctzll(i64 noundef) local_unnamed_addr #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nofree nosync nounwind willreturn memory(none) "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 = { 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { 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 #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(none) }
attributes #8 = { 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 = !{i64 0, i64 3072, !6, i64 3072, i64 256, !6, i64 3328, i64 512, !6, i64 3840, i64 8, !9, i64 3848, i64 8, !9}
!6 = !{!7, !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !10, i64 3840}
!12 = !{!"pdb_catalogue", !7, i64 0, !7, i64 3072, !7, i64 3328, !10, i64 3840, !10, i64 3848}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!18, !14, i64 32}
!18 = !{!"heuristic", !19, i64 0, !19, i64 8, !19, i64 16, !19, i64 24, !14, i64 32, !14, i64 36, !14, i64 40}
!19 = !{!"any pointer", !7, i64 0}
!20 = distinct !{!20, !16}
!21 = !{!12, !10, i64 3848}
!22 = !{!23, !23, i64 0}
!23 = !{!"long long", !7, i64 0}
!24 = distinct !{!24, !16}
!25 = distinct !{!25, !16}
!26 = distinct !{!26, !16}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass