; LLVM IR from clausecker/24puzzle :: test (walkdist)

; 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.fsm = type { [25 x i32], [25 x ptr], [25 x ptr] }

@fsm_simple = external constant %struct.fsm, align 8
@.str = external hidden unnamed_addr constant [14 x i8], align 1
@optarg = external global ptr, align 8
@pdb_jobs = external global i32, align 4
@stderr = external global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [9 x i8], align 1
@optind = external global i32, align 4
@.str.5 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [22 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca [256 x i64], align 16
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %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 ptr, align 8
  %18 = alloca i32, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  store ptr @fsm_simple, ptr %6, align 8, !tbaa !9
  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 2048, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store i64 1000, ptr %10, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  store i64 0, ptr %11, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  store ptr null, ptr %17, align 8, !tbaa !9
  br label %19

19:                                               ; preds = %75, %2
  %20 = load i32, ptr %4, align 4, !tbaa !5
  %21 = load ptr, ptr %5, align 8, !tbaa !9
  %22 = call i32 @__posix_getopt(i32 noundef %20, ptr noundef %21, ptr noundef @.str) #6
  store i32 %22, ptr %12, align 4, !tbaa !5
  %23 = load i32, ptr %12, align 4, !tbaa !5
  %24 = icmp ne i32 %23, -1
  br i1 %24, label %25, label %76

25:                                               ; preds = %19
  %26 = load i32, ptr %12, align 4, !tbaa !5
  switch i32 %26, label %71 [
    i32 100, label %27
    i32 105, label %29
    i32 106, label %32
    i32 104, label %44
    i32 109, label %45
    i32 110, label %64
    i32 115, label %67
    i32 116, label %70
  ]

27:                                               ; preds = %25
  %28 = load ptr, ptr @optarg, align 8, !tbaa !9
  store ptr %28, ptr %17, align 8, !tbaa !9
  br label %75

29:                                               ; preds = %25
  %30 = load i32, ptr %13, align 4, !tbaa !5
  %31 = or i32 %30, 1
  store i32 %31, ptr %13, align 4, !tbaa !5
  br label %75

32:                                               ; preds = %25
  %33 = load ptr, ptr @optarg, align 8, !tbaa !9
  %34 = call i32 @atoi(ptr noundef %33) #7
  store i32 %34, ptr @pdb_jobs, align 4, !tbaa !5
  %35 = load i32, ptr @pdb_jobs, align 4, !tbaa !5
  %36 = icmp slt i32 %35, 1
  br i1 %36, label %40, label %37

37:                                               ; preds = %32
  %38 = load i32, ptr @pdb_jobs, align 4, !tbaa !5
  %39 = icmp sgt i32 %38, 256
  br i1 %39, label %40, label %43

40:                                               ; preds = %37, %32
  %41 = load ptr, ptr @stderr, align 8, !tbaa !9
  %42 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %41, ptr noundef @.str.1, i32 noundef 256) #6
  store i32 1, ptr %3, align 4
  store i32 1, ptr %18, align 4
  br label %143

43:                                               ; preds = %37
  br label %75

44:                                               ; preds = %25
  store i32 1, ptr %14, align 4, !tbaa !5
  br label %75

45:                                               ; preds = %25
  %46 = load ptr, ptr @stderr, align 8, !tbaa !9
  %47 = load ptr, ptr @optarg, align 8, !tbaa !9
  %48 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %46, ptr noundef @.str.2, ptr noundef %47) #6
  %49 = load ptr, ptr @optarg, align 8, !tbaa !9
  %50 = call noalias ptr @fopen(ptr noundef %49, ptr noundef @.str.3)
  store ptr %50, ptr %8, align 8, !tbaa !9
  %51 = load ptr, ptr %8, align 8, !tbaa !9
  %52 = icmp eq ptr %51, null
  br i1 %52, label %53, label %55

53:                                               ; preds = %45
  %54 = load ptr, ptr @optarg, align 8, !tbaa !9
  call void @perror(ptr noundef %54)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %18, align 4
  br label %143

55:                                               ; preds = %45
  %56 = load ptr, ptr %8, align 8, !tbaa !9
  %57 = call ptr @fsm_load(ptr noundef %56)
  store ptr %57, ptr %6, align 8, !tbaa !9
  %58 = load ptr, ptr %6, align 8, !tbaa !9
  %59 = icmp eq ptr %58, null
  br i1 %59, label %60, label %61

60:                                               ; preds = %55
  call void @perror(ptr noundef @.str.4)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %18, align 4
  br label %143

61:                                               ; preds = %55
  %62 = load ptr, ptr %8, align 8, !tbaa !9
  %63 = call i32 @fclose(ptr noundef %62)
  br label %75

64:                                               ; preds = %25
  %65 = load ptr, ptr @optarg, align 8, !tbaa !9
  %66 = call i64 @strtol(ptr noundef %65, ptr noundef null, i32 noundef 0) #6
  store i64 %66, ptr %10, align 8, !tbaa !11
  br label %75

67:                                               ; preds = %25
  %68 = load ptr, ptr @optarg, align 8, !tbaa !9
  %69 = call i64 @strtoll(ptr noundef %68, ptr noundef null, i32 noundef 0) #6
  call void @set_seed(i64 noundef %69)
  br label %75

70:                                               ; preds = %25
  store i32 1, ptr %16, align 4, !tbaa !5
  br label %75

71:                                               ; preds = %25
  %72 = load ptr, ptr %5, align 8, !tbaa !9
  %73 = getelementptr inbounds ptr, ptr %72, i64 0
  %74 = load ptr, ptr %73, align 8, !tbaa !9
  call void @usage(ptr noundef %74)
  br label %75

75:                                               ; preds = %71, %70, %67, %64, %61, %44, %43, %29, %27
  br label %19, !llvm.loop !13

76:                                               ; preds = %19
  %77 = load i32, ptr %4, align 4, !tbaa !5
  %78 = load i32, ptr @optind, align 4, !tbaa !5
  %79 = add nsw i32 %78, 2
  %80 = icmp ne i32 %77, %79
  br i1 %80, label %81, label %85

81:                                               ; preds = %76
  %82 = load ptr, ptr %5, align 8, !tbaa !9
  %83 = getelementptr inbounds ptr, ptr %82, i64 0
  %84 = load ptr, ptr %83, align 8, !tbaa !9
  call void @usage(ptr noundef %84)
  br label %85

85:                                               ; preds = %81, %76
  %86 = load ptr, ptr %5, align 8, !tbaa !9
  %87 = load i32, ptr @optind, align 4, !tbaa !5
  %88 = add nsw i32 %87, 1
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds ptr, ptr %86, i64 %89
  %91 = load ptr, ptr %90, align 8, !tbaa !9
  %92 = call i64 @strtol(ptr noundef %91, ptr noundef null, i32 noundef 0) #6
  %93 = trunc i64 %92 to i32
  store i32 %93, ptr %15, align 4, !tbaa !5
  %94 = load i32, ptr %15, align 4, !tbaa !5
  %95 = icmp slt i32 %94, 0
  br i1 %95, label %96, label %108

96:                                               ; preds = %85
  %97 = load ptr, ptr @stderr, align 8, !tbaa !9
  %98 = load ptr, ptr %5, align 8, !tbaa !9
  %99 = load i32, ptr @optind, align 4, !tbaa !5
  %100 = add nsw i32 %99, 1
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds ptr, ptr %98, i64 %101
  %103 = load ptr, ptr %102, align 8, !tbaa !9
  %104 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %97, ptr noundef @.str.5, ptr noundef %103) #6
  %105 = load ptr, ptr %5, align 8, !tbaa !9
  %106 = getelementptr inbounds ptr, ptr %105, i64 0
  %107 = load ptr, ptr %106, align 8, !tbaa !9
  call void @usage(ptr noundef %107)
  br label %108

108:                                              ; preds = %96, %85
  %109 = load ptr, ptr %5, align 8, !tbaa !9
  %110 = load i32, ptr @optind, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds ptr, ptr %109, i64 %111
  %113 = load ptr, ptr %112, align 8, !tbaa !9
  %114 = load ptr, ptr %17, align 8, !tbaa !9
  %115 = load i32, ptr %13, align 4, !tbaa !5
  %116 = load ptr, ptr @stderr, align 8, !tbaa !9
  %117 = call ptr @catalogue_load(ptr noundef %113, ptr noundef %114, i32 noundef %115, ptr noundef %116)
  store ptr %117, ptr %7, align 8, !tbaa !9
  %118 = load ptr, ptr %7, align 8, !tbaa !9
  %119 = icmp eq ptr %118, null
  br i1 %119, label %120, label %121

120:                                              ; preds = %108
  call void @perror(ptr noundef @.str.6)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %18, align 4
  br label %143

121:                                              ; preds = %108
  %122 = load i32, ptr %16, align 4, !tbaa !5
  %123 = icmp ne i32 %122, 0
  br i1 %123, label %124, label %131

124:                                              ; preds = %121
  %125 = load ptr, ptr %7, align 8, !tbaa !9
  %126 = call i32 @catalogue_add_transpositions(ptr noundef %125)
  %127 = icmp ne i32 %126, 0
  br i1 %127, label %128, label %131

128:                                              ; preds = %124
  call void @perror(ptr noundef @.str.7)
  %129 = load ptr, ptr @stderr, align 8, !tbaa !9
  %130 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %129, ptr noundef @.str.8) #6
  br label %131

131:                                              ; preds = %128, %124, %121
  %132 = getelementptr inbounds [256 x i64], ptr %9, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %132, i8 0, i64 2048, i1 false)
  %133 = getelementptr inbounds [256 x i64], ptr %9, i64 0, i64 0
  %134 = load i32, ptr %15, align 4, !tbaa !5
  %135 = load i64, ptr %10, align 8, !tbaa !11
  %136 = load ptr, ptr %7, align 8, !tbaa !9
  %137 = load ptr, ptr %6, align 8, !tbaa !9
  %138 = load i32, ptr %14, align 4, !tbaa !5
  call void @collect_walks(ptr noundef %133, ptr noundef %11, i32 noundef %134, i64 noundef %135, ptr noundef %136, ptr noundef %137, i32 noundef %138)
  %139 = getelementptr inbounds [256 x i64], ptr %9, i64 0, i64 0
  %140 = load i64, ptr %11, align 8, !tbaa !11
  %141 = load i32, ptr %15, align 4, !tbaa !5
  %142 = load i64, ptr %10, align 8, !tbaa !11
  call void @print_statistics(ptr noundef %139, i64 noundef %140, i32 noundef %141, i64 noundef %142)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %18, align 4
  br label %143

143:                                              ; preds = %131, %120, %60, %53, %40
  call void @llvm.lifetime.end.p0(i64 8, 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 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  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 2048, 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
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  %144 = load i32, ptr %3, align 4
  ret i32 %144
}

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

; Function Attrs: nounwind
declare i32 @__posix_getopt(i32 noundef, ptr noundef, ptr noundef) #2

; Function Attrs: inlinehint nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr noundef nonnull) #3

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #2

declare noalias ptr @fopen(ptr noundef, ptr noundef) #4

declare void @perror(ptr noundef) #4

declare ptr @fsm_load(ptr noundef) #4

declare i32 @fclose(ptr noundef) #4

; Function Attrs: nounwind
declare i64 @strtol(ptr noundef, ptr noundef, i32 noundef) #2

declare void @set_seed(i64 noundef) #4

; Function Attrs: nounwind
declare i64 @strtoll(ptr noundef, ptr noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @usage(ptr noundef) #0

declare ptr @catalogue_load(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #4

declare i32 @catalogue_add_transpositions(ptr 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: nounwind uwtable
declare hidden void @collect_walks(ptr noundef, ptr noundef, i32 noundef, i64 noundef, ptr noundef, ptr noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @print_statistics(ptr noundef, i64 noundef, i32 noundef, i64 noundef) #0

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

attributes #0 = { 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 = { 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 = { inlinehint nounwind willreturn memory(read) 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 = { nounwind willreturn memory(read) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


; 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.fsm = type { [25 x i32], [25 x ptr], [25 x ptr] }

@fsm_simple = external constant %struct.fsm, align 8
@.str = external hidden unnamed_addr constant [14 x i8], align 1
@optarg = external local_unnamed_addr global ptr, align 8
@pdb_jobs = external local_unnamed_addr global i32, align 4
@stderr = external local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [9 x i8], align 1
@optind = external local_unnamed_addr global i32, align 4
@.str.5 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [22 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @main(i32 noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca [256 x i64], align 16
  %4 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %3) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  store i64 0, ptr %4, align 8, !tbaa !5
  br label %5

5:                                                ; preds = %.backedge, %2
  %.039 = phi i64 [ 1000, %2 ], [ %.039.be, %.backedge ]
  %.037 = phi ptr [ @fsm_simple, %2 ], [ %.037.be, %.backedge ]
  %.035 = phi i32 [ 0, %2 ], [ %.035.be, %.backedge ]
  %.033 = phi i32 [ 0, %2 ], [ %.033.be, %.backedge ]
  %.030 = phi i32 [ 0, %2 ], [ %.030.be, %.backedge ]
  %.0 = phi ptr [ null, %2 ], [ %.0.be, %.backedge ]
  %6 = tail call i32 @__posix_getopt(i32 noundef %0, ptr noundef %1, ptr noundef nonnull @.str) #8
  switch i32 %6, label %39 [
    i32 -1, label %41
    i32 100, label %7
    i32 105, label %.backedge
    i32 106, label %9
    i32 104, label %16
    i32 109, label %17
    i32 110, label %32
    i32 115, label %35
    i32 116, label %38
  ]

.backedge:                                        ; preds = %5, %9, %39, %38, %35, %32, %30, %16, %7
  %.039.be = phi i64 [ %.039, %39 ], [ %.039, %38 ], [ %.039, %35 ], [ %34, %32 ], [ %.039, %30 ], [ %.039, %16 ], [ %.039, %9 ], [ %.039, %7 ], [ %.039, %5 ]
  %.037.be = phi ptr [ %.037, %39 ], [ %.037, %38 ], [ %.037, %35 ], [ %.037, %32 ], [ %27, %30 ], [ %.037, %16 ], [ %.037, %9 ], [ %.037, %7 ], [ %.037, %5 ]
  %.035.be = phi i32 [ %.035, %39 ], [ %.035, %38 ], [ %.035, %35 ], [ %.035, %32 ], [ %.035, %30 ], [ %.035, %16 ], [ %.035, %9 ], [ %.035, %7 ], [ 1, %5 ]
  %.033.be = phi i32 [ %.033, %39 ], [ %.033, %38 ], [ %.033, %35 ], [ %.033, %32 ], [ %.033, %30 ], [ 1, %16 ], [ %.033, %9 ], [ %.033, %7 ], [ %.033, %5 ]
  %.030.be = phi i32 [ %.030, %39 ], [ 1, %38 ], [ %.030, %35 ], [ %.030, %32 ], [ %.030, %30 ], [ %.030, %16 ], [ %.030, %9 ], [ %.030, %7 ], [ %.030, %5 ]
  %.0.be = phi ptr [ %.0, %39 ], [ %.0, %38 ], [ %.0, %35 ], [ %.0, %32 ], [ %.0, %30 ], [ %.0, %16 ], [ %.0, %9 ], [ %8, %7 ], [ %.0, %5 ]
  br label %5, !llvm.loop !9

7:                                                ; preds = %5
  %8 = load ptr, ptr @optarg, align 8, !tbaa !11
  br label %.backedge

9:                                                ; preds = %5
  %10 = load ptr, ptr @optarg, align 8, !tbaa !11
  %11 = tail call i32 @atoi(ptr nocapture noundef %10) #9
  store i32 %11, ptr @pdb_jobs, align 4, !tbaa !13
  %12 = add i32 %11, -257
  %or.cond = icmp ult i32 %12, -256
  br i1 %or.cond, label %13, label %.backedge

13:                                               ; preds = %9
  %14 = load ptr, ptr @stderr, align 8, !tbaa !11
  %15 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %14, ptr noundef nonnull @.str.1, i32 noundef 256) #10
  br label %81

16:                                               ; preds = %5
  br label %.backedge

17:                                               ; preds = %5
  %18 = load ptr, ptr @stderr, align 8, !tbaa !11
  %19 = load ptr, ptr @optarg, align 8, !tbaa !11
  %20 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %18, ptr noundef nonnull @.str.2, ptr noundef %19) #10
  %21 = load ptr, ptr @optarg, align 8, !tbaa !11
  %22 = tail call noalias ptr @fopen(ptr noundef %21, ptr noundef nonnull @.str.3)
  %23 = icmp eq ptr %22, null
  br i1 %23, label %24, label %26

24:                                               ; preds = %17
  %25 = load ptr, ptr @optarg, align 8, !tbaa !11
  tail call void @perror(ptr noundef %25) #11
  br label %81

26:                                               ; preds = %17
  %27 = tail call ptr @fsm_load(ptr noundef nonnull %22) #8
  %28 = icmp eq ptr %27, null
  br i1 %28, label %29, label %30

29:                                               ; preds = %26
  tail call void @perror(ptr noundef nonnull @.str.4) #11
  br label %81

30:                                               ; preds = %26
  %31 = tail call i32 @fclose(ptr noundef nonnull %22)
  br label %.backedge

32:                                               ; preds = %5
  %33 = load ptr, ptr @optarg, align 8, !tbaa !11
  %34 = tail call i64 @strtol(ptr nocapture noundef %33, ptr noundef null, i32 noundef 0) #8
  br label %.backedge

35:                                               ; preds = %5
  %36 = load ptr, ptr @optarg, align 8, !tbaa !11
  %37 = tail call i64 @strtoll(ptr nocapture noundef %36, ptr noundef null, i32 noundef 0) #8
  tail call void @set_seed(i64 noundef %37) #8
  br label %.backedge

38:                                               ; preds = %5
  br label %.backedge

39:                                               ; preds = %5
  %40 = load ptr, ptr %1, align 8, !tbaa !11
  tail call void @usage(ptr noundef %40)
  br label %.backedge

41:                                               ; preds = %5
  %42 = load i32, ptr @optind, align 4, !tbaa !13
  %43 = add nsw i32 %42, 2
  %.not45 = icmp eq i32 %43, %0
  br i1 %.not45, label %46, label %44

44:                                               ; preds = %41
  %45 = load ptr, ptr %1, align 8, !tbaa !11
  tail call void @usage(ptr noundef %45)
  %.pre = load i32, ptr @optind, align 4, !tbaa !13
  br label %46

46:                                               ; preds = %44, %41
  %47 = phi i32 [ %.pre, %44 ], [ %42, %41 ]
  %48 = sext i32 %47 to i64
  %49 = getelementptr ptr, ptr %1, i64 %48
  %50 = getelementptr i8, ptr %49, i64 8
  %51 = load ptr, ptr %50, align 8, !tbaa !11
  %52 = tail call i64 @strtol(ptr nocapture noundef %51, ptr noundef null, i32 noundef 0) #8
  %53 = trunc i64 %52 to i32
  %54 = icmp slt i32 %53, 0
  br i1 %54, label %55, label %64

55:                                               ; preds = %46
  %56 = load ptr, ptr @stderr, align 8, !tbaa !11
  %57 = load i32, ptr @optind, align 4, !tbaa !13
  %58 = sext i32 %57 to i64
  %59 = getelementptr ptr, ptr %1, i64 %58
  %60 = getelementptr i8, ptr %59, i64 8
  %61 = load ptr, ptr %60, align 8, !tbaa !11
  %62 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %56, ptr noundef nonnull @.str.5, ptr noundef %61) #10
  %63 = load ptr, ptr %1, align 8, !tbaa !11
  tail call void @usage(ptr noundef %63)
  br label %64

64:                                               ; preds = %55, %46
  %65 = load i32, ptr @optind, align 4, !tbaa !13
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds ptr, ptr %1, i64 %66
  %68 = load ptr, ptr %67, align 8, !tbaa !11
  %69 = load ptr, ptr @stderr, align 8, !tbaa !11
  %70 = tail call ptr @catalogue_load(ptr noundef %68, ptr noundef %.0, i32 noundef %.035, ptr noundef %69) #8
  %71 = icmp eq ptr %70, null
  br i1 %71, label %72, label %73

72:                                               ; preds = %64
  tail call void @perror(ptr noundef nonnull @.str.6) #11
  br label %81

73:                                               ; preds = %64
  %.not46 = icmp eq i32 %.030, 0
  br i1 %.not46, label %79, label %74

74:                                               ; preds = %73
  %75 = tail call i32 @catalogue_add_transpositions(ptr noundef nonnull %70) #8
  %.not47 = icmp eq i32 %75, 0
  br i1 %.not47, label %79, label %76

76:                                               ; preds = %74
  tail call void @perror(ptr noundef nonnull @.str.7) #11
  %77 = load ptr, ptr @stderr, align 8, !tbaa !11
  %78 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %77, ptr noundef nonnull @.str.8) #10
  br label %79

79:                                               ; preds = %76, %74, %73
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(2048) %3, i8 0, i64 2048, i1 false)
  call void @collect_walks(ptr noundef nonnull %3, ptr noundef nonnull %4, i32 noundef %53, i64 noundef %.039, ptr noundef nonnull %70, ptr noundef nonnull %.037, i32 noundef %.033)
  %80 = load i64, ptr %4, align 8, !tbaa !5
  call void @print_statistics(ptr noundef nonnull %3, i64 noundef %80, i32 noundef %53, i64 noundef %.039)
  br label %81

81:                                               ; preds = %79, %72, %29, %24, %13
  %.032 = phi i32 [ 1, %24 ], [ 1, %29 ], [ 1, %13 ], [ 1, %72 ], [ 0, %79 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %3) #8
  ret i32 %.032
}

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

; Function Attrs: nounwind
declare i32 @__posix_getopt(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr nocapture noundef nonnull) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare void @perror(ptr nocapture noundef readonly) local_unnamed_addr #4

declare ptr @fsm_load(ptr noundef) local_unnamed_addr #5

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nofree nounwind willreturn
declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #6

declare void @set_seed(i64 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nofree nounwind willreturn
declare i64 @strtoll(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #6

; Function Attrs: nounwind uwtable
declare hidden void @usage(ptr noundef) local_unnamed_addr #0

declare ptr @catalogue_load(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #5

declare i32 @catalogue_add_transpositions(ptr noundef) local_unnamed_addr #5

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

; Function Attrs: nounwind uwtable
declare hidden void @collect_walks(ptr noundef, ptr noundef, i32 noundef, i64 noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden void @print_statistics(ptr noundef, i64 noundef, i32 noundef, i64 noundef) local_unnamed_addr #0

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

attributes #0 = { 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 = { 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 = { inlinehint mustprogress nofree nounwind willreturn memory(read) 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 = { nofree 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 #5 = { "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 = { mustprogress nofree nounwind willreturn "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 #7 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { nounwind }
attributes #9 = { nounwind willreturn memory(read) }
attributes #10 = { cold nounwind }
attributes #11 = { cold }

!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", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass