; LLVM IR from clausecker/24puzzle :: cmd (pdbmatch)

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

@.str = external hidden unnamed_addr constant [6 x i8], align 1
@optarg = external global ptr, align 8
@optind = external global i32, align 4
@stdin = external global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [16 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 ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca [4096 x i8], align 16
  %16 = alloca ptr, align 8
  %17 = 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 null, 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 8, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  store ptr null, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  store ptr null, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4096, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  br label %18

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

24:                                               ; preds = %18
  %25 = load i32, ptr %11, align 4, !tbaa !5
  switch i32 %25, label %31 [
    i32 100, label %26
    i32 109, label %28
    i32 114, label %30
  ]

26:                                               ; preds = %24
  %27 = load ptr, ptr @optarg, align 8, !tbaa !9
  store ptr %27, ptr %13, align 8, !tbaa !9
  br label %35

28:                                               ; preds = %24
  %29 = load ptr, ptr @optarg, align 8, !tbaa !9
  store ptr %29, ptr %14, align 8, !tbaa !9
  br label %35

30:                                               ; preds = %24
  store i32 1, ptr %12, align 4, !tbaa !5
  br label %35

31:                                               ; preds = %24
  %32 = load ptr, ptr %5, align 8, !tbaa !9
  %33 = getelementptr inbounds ptr, ptr %32, i64 0
  %34 = load ptr, ptr %33, align 8, !tbaa !9
  call void @usage(ptr noundef %34)
  br label %35

35:                                               ; preds = %31, %30, %28, %26
  br label %18, !llvm.loop !11

36:                                               ; preds = %18
  %37 = load i32, ptr %4, align 4, !tbaa !5
  %38 = load i32, ptr @optind, align 4, !tbaa !5
  %39 = sub nsw i32 %37, %38
  switch i32 %39, label %58 [
    i32 0, label %40
    i32 1, label %42
  ]

40:                                               ; preds = %36
  %41 = load ptr, ptr @stdin, align 8, !tbaa !9
  store ptr %41, ptr %6, align 8, !tbaa !9
  br label %62

42:                                               ; preds = %36
  %43 = load ptr, ptr %5, align 8, !tbaa !9
  %44 = load i32, ptr @optind, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds ptr, ptr %43, i64 %45
  %47 = load ptr, ptr %46, align 8, !tbaa !9
  %48 = call noalias ptr @fopen(ptr noundef %47, ptr noundef @.str.1)
  store ptr %48, ptr %6, align 8, !tbaa !9
  %49 = load ptr, ptr %6, align 8, !tbaa !9
  %50 = icmp eq ptr %49, null
  br i1 %50, label %51, label %57

51:                                               ; preds = %42
  %52 = load ptr, ptr %5, align 8, !tbaa !9
  %53 = load i32, ptr @optind, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds ptr, ptr %52, i64 %54
  %56 = load ptr, ptr %55, align 8, !tbaa !9
  call void @perror(ptr noundef %56)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %17, align 4
  br label %130

57:                                               ; preds = %42
  br label %62

58:                                               ; preds = %36
  %59 = load ptr, ptr %5, align 8, !tbaa !9
  %60 = getelementptr inbounds ptr, ptr %59, i64 0
  %61 = load ptr, ptr %60, align 8, !tbaa !9
  call void @usage(ptr noundef %61)
  br label %62

62:                                               ; preds = %58, %57, %40
  %63 = load ptr, ptr %6, align 8, !tbaa !9
  %64 = call ptr @read_puzzles(ptr noundef %10, ptr noundef %63)
  store ptr %64, ptr %7, align 8, !tbaa !9
  %65 = load ptr, ptr %6, align 8, !tbaa !9
  %66 = call i32 @fclose(ptr noundef %65)
  %67 = load i64, ptr %10, align 8, !tbaa !13
  %68 = mul i64 %67, 40
  %69 = call noalias ptr @malloc(i64 noundef %68) #7
  store ptr %69, ptr %8, align 8, !tbaa !9
  %70 = load ptr, ptr %8, align 8, !tbaa !9
  %71 = icmp eq ptr %70, null
  br i1 %71, label %72, label %73

72:                                               ; preds = %62
  call void @perror(ptr noundef @.str.2)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %17, align 4
  br label %130

73:                                               ; preds = %62
  %74 = load i32, ptr %12, align 4, !tbaa !5
  %75 = icmp ne i32 %74, 0
  br i1 %75, label %95, label %76

76:                                               ; preds = %73
  %77 = load ptr, ptr %13, align 8, !tbaa !9
  %78 = icmp eq ptr %77, null
  br i1 %78, label %79, label %83

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

83:                                               ; preds = %79, %76
  %84 = load ptr, ptr %7, align 8, !tbaa !9
  %85 = load i64, ptr %10, align 8, !tbaa !13
  %86 = load ptr, ptr %13, align 8, !tbaa !9
  %87 = call ptr @lookup_puzzles(ptr noundef %84, i64 noundef %85, ptr noundef %86)
  store ptr %87, ptr %16, align 8, !tbaa !9
  %88 = load ptr, ptr %14, align 8, !tbaa !9
  %89 = icmp ne ptr %88, null
  br i1 %89, label %90, label %94

90:                                               ; preds = %83
  %91 = load ptr, ptr %14, align 8, !tbaa !9
  %92 = load ptr, ptr %16, align 8, !tbaa !9
  %93 = load i64, ptr %10, align 8, !tbaa !13
  call void @store_match_vector(ptr noundef %91, ptr noundef %92, i64 noundef %93)
  br label %94

94:                                               ; preds = %90, %83
  br label %106

95:                                               ; preds = %73
  %96 = load ptr, ptr %14, align 8, !tbaa !9
  %97 = icmp eq ptr %96, null
  br i1 %97, label %98, label %102

98:                                               ; preds = %95
  %99 = load ptr, ptr %5, align 8, !tbaa !9
  %100 = getelementptr inbounds ptr, ptr %99, i64 0
  %101 = load ptr, ptr %100, align 8, !tbaa !9
  call void @usage(ptr noundef %101)
  br label %102

102:                                              ; preds = %98, %95
  %103 = load ptr, ptr %14, align 8, !tbaa !9
  %104 = load i64, ptr %10, align 8, !tbaa !13
  %105 = call ptr @load_match_vector(ptr noundef %103, i64 noundef %104)
  store ptr %105, ptr %16, align 8, !tbaa !9
  br label %106

106:                                              ; preds = %102, %94
  %107 = getelementptr inbounds [4096 x i8], ptr %15, i64 0, i64 0
  %108 = load ptr, ptr %13, align 8, !tbaa !9
  %109 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %107, i64 noundef 4096, ptr noundef @.str.3, ptr noundef %108, ptr noundef @.str.4) #6
  %110 = getelementptr inbounds [4096 x i8], ptr %15, i64 0, i64 0
  %111 = call ptr @qualities_load(ptr noundef %110)
  store ptr %111, ptr %9, align 8, !tbaa !9
  %112 = load ptr, ptr %9, align 8, !tbaa !9
  %113 = icmp eq ptr %112, null
  br i1 %113, label %114, label %121

114:                                              ; preds = %106
  %115 = getelementptr inbounds [4096 x i8], ptr %15, i64 0, i64 0
  call void @perror(ptr noundef %115)
  %116 = call ptr @qualities_dummy()
  store ptr %116, ptr %9, align 8, !tbaa !9
  %117 = load ptr, ptr %9, align 8, !tbaa !9
  %118 = icmp eq ptr %117, null
  br i1 %118, label %119, label %120

119:                                              ; preds = %114
  call void @perror(ptr noundef @.str.5)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %17, align 4
  br label %130

120:                                              ; preds = %114
  br label %121

121:                                              ; preds = %120, %106
  %122 = load ptr, ptr %9, align 8, !tbaa !9
  %123 = load ptr, ptr %8, align 8, !tbaa !9
  %124 = load ptr, ptr %7, align 8, !tbaa !9
  %125 = load ptr, ptr %16, align 8, !tbaa !9
  %126 = load i64, ptr %10, align 8, !tbaa !13
  call void @find_matches(ptr noundef %122, ptr noundef %123, ptr noundef %124, ptr noundef %125, i64 noundef %126)
  %127 = load ptr, ptr %8, align 8, !tbaa !9
  %128 = load ptr, ptr %7, align 8, !tbaa !9
  %129 = load i64, ptr %10, align 8, !tbaa !13
  call void @print_matches(ptr noundef %127, ptr noundef %128, i64 noundef %129)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %17, align 4
  br label %130

130:                                              ; preds = %121, %119, %72, %51
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4096, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, 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
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  %131 = load i32, ptr %3, align 4
  ret i32 %131
}

; 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: nounwind uwtable
declare hidden void @usage(ptr noundef) #0

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

declare void @perror(ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden ptr @read_puzzles(ptr noundef, ptr noundef) #0

declare i32 @fclose(ptr noundef) #3

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #4

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

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

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

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

declare ptr @qualities_load(ptr noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @qualities_dummy() #5

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

; Function Attrs: nounwind uwtable
declare hidden void @print_matches(ptr noundef, ptr 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind 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 #5 = { 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 #6 = { nounwind }
attributes #7 = { nounwind 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 = !{!"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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}


; 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 = external hidden unnamed_addr constant [6 x i8], align 1
@optarg = external local_unnamed_addr global ptr, align 8
@optind = external local_unnamed_addr global i32, align 4
@stdin = external local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [16 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 i64, align 8
  %4 = alloca [4096 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 4096, ptr nonnull %4) #7
  br label %.outer

.outer:                                           ; preds = %5, %2
  %.not46 = phi i1 [ true, %2 ], [ false, %5 ]
  %.034.ph = phi ptr [ null, %2 ], [ %.034.ph50, %5 ]
  %.033.ph = phi ptr [ null, %2 ], [ %.033.ph53, %5 ]
  br label %.outer49

.outer49:                                         ; preds = %.outer, %7
  %.034.ph50 = phi ptr [ %.034.ph, %.outer ], [ %8, %7 ]
  %.033.ph51 = phi ptr [ %.033.ph, %.outer ], [ %.033.ph53, %7 ]
  br label %.outer52

.outer52:                                         ; preds = %.outer49, %9
  %.033.ph53 = phi ptr [ %.033.ph51, %.outer49 ], [ %10, %9 ]
  br label %5

5:                                                ; preds = %.outer52, %11
  %6 = tail call i32 @__posix_getopt(i32 noundef %0, ptr noundef %1, ptr noundef nonnull @.str) #7
  switch i32 %6, label %11 [
    i32 -1, label %13
    i32 100, label %7
    i32 109, label %9
    i32 114, label %.outer
  ], !llvm.loop !5

7:                                                ; preds = %5
  %8 = load ptr, ptr @optarg, align 8, !tbaa !7
  br label %.outer49, !llvm.loop !5

9:                                                ; preds = %5
  %10 = load ptr, ptr @optarg, align 8, !tbaa !7
  br label %.outer52, !llvm.loop !5

11:                                               ; preds = %5
  %12 = load ptr, ptr %1, align 8, !tbaa !7
  tail call void @usage(ptr noundef %12)
  br label %5, !llvm.loop !5

13:                                               ; preds = %5
  %14 = load i32, ptr @optind, align 4, !tbaa !11
  %15 = sub nsw i32 %0, %14
  switch i32 %15, label %29 [
    i32 0, label %16
    i32 1, label %18
  ]

16:                                               ; preds = %13
  %17 = load ptr, ptr @stdin, align 8, !tbaa !7
  br label %31

18:                                               ; preds = %13
  %19 = sext i32 %14 to i64
  %20 = getelementptr inbounds ptr, ptr %1, i64 %19
  %21 = load ptr, ptr %20, align 8, !tbaa !7
  %22 = tail call noalias ptr @fopen(ptr noundef %21, ptr noundef nonnull @.str.1)
  %23 = icmp eq ptr %22, null
  br i1 %23, label %24, label %31

24:                                               ; preds = %18
  %25 = load i32, ptr @optind, align 4, !tbaa !11
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds ptr, ptr %1, i64 %26
  %28 = load ptr, ptr %27, align 8, !tbaa !7
  tail call void @perror(ptr noundef %28) #8
  br label %67

29:                                               ; preds = %13
  %30 = load ptr, ptr %1, align 8, !tbaa !7
  tail call void @usage(ptr noundef %30)
  br label %31

31:                                               ; preds = %18, %29, %16
  %.040 = phi ptr [ null, %29 ], [ %22, %18 ], [ %17, %16 ]
  %32 = call ptr @read_puzzles(ptr noundef nonnull %3, ptr noundef %.040)
  %33 = call i32 @fclose(ptr noundef %.040)
  %34 = load i64, ptr %3, align 8, !tbaa !13
  %35 = mul i64 %34, 40
  %36 = call noalias ptr @malloc(i64 noundef %35) #9
  %37 = icmp eq ptr %36, null
  br i1 %37, label %38, label %39

38:                                               ; preds = %31
  call void @perror(ptr noundef nonnull @.str.2) #8
  br label %67

39:                                               ; preds = %31
  br i1 %.not46, label %40, label %49

40:                                               ; preds = %39
  %41 = icmp eq ptr %.034.ph50, null
  br i1 %41, label %42, label %44

42:                                               ; preds = %40
  %43 = load ptr, ptr %1, align 8, !tbaa !7
  call void @usage(ptr noundef %43)
  %.pre48 = load i64, ptr %3, align 8, !tbaa !13
  br label %44

44:                                               ; preds = %42, %40
  %45 = phi i64 [ %.pre48, %42 ], [ %34, %40 ]
  %46 = call ptr @lookup_puzzles(ptr noundef %32, i64 noundef %45, ptr noundef %.034.ph50)
  %.not47 = icmp eq ptr %.033.ph53, null
  br i1 %.not47, label %56, label %47

47:                                               ; preds = %44
  %48 = load i64, ptr %3, align 8, !tbaa !13
  call void @store_match_vector(ptr noundef nonnull %.033.ph53, ptr noundef %46, i64 noundef %48)
  br label %56

49:                                               ; preds = %39
  %50 = icmp eq ptr %.033.ph53, null
  br i1 %50, label %51, label %53

51:                                               ; preds = %49
  %52 = load ptr, ptr %1, align 8, !tbaa !7
  call void @usage(ptr noundef %52)
  %.pre = load i64, ptr %3, align 8, !tbaa !13
  br label %53

53:                                               ; preds = %51, %49
  %54 = phi i64 [ %.pre, %51 ], [ %34, %49 ]
  %55 = call ptr @load_match_vector(ptr noundef %.033.ph53, i64 noundef %54)
  br label %56

56:                                               ; preds = %44, %47, %53
  %.0 = phi ptr [ %55, %53 ], [ %46, %47 ], [ %46, %44 ]
  %57 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %4, i64 noundef 4096, ptr noundef nonnull @.str.3, ptr noundef %.034.ph50, ptr noundef nonnull @.str.4) #7
  %58 = call ptr @qualities_load(ptr noundef nonnull %4) #7
  %59 = icmp eq ptr %58, null
  br i1 %59, label %60, label %64

60:                                               ; preds = %56
  call void @perror(ptr noundef nonnull %4) #8
  %61 = call ptr @qualities_dummy()
  %62 = icmp eq ptr %61, null
  br i1 %62, label %63, label %64

63:                                               ; preds = %60
  call void @perror(ptr noundef nonnull @.str.5) #8
  br label %67

64:                                               ; preds = %60, %56
  %.039 = phi ptr [ %61, %60 ], [ %58, %56 ]
  %65 = load i64, ptr %3, align 8, !tbaa !13
  call void @find_matches(ptr noundef nonnull %.039, ptr noundef nonnull %36, ptr noundef %32, ptr noundef %.0, i64 noundef %65)
  %66 = load i64, ptr %3, align 8, !tbaa !13
  call void @print_matches(ptr noundef nonnull %36, ptr noundef %32, i64 noundef %66)
  br label %67

67:                                               ; preds = %64, %63, %38, %24
  %.038 = phi i32 [ 1, %38 ], [ 1, %63 ], [ 0, %64 ], [ 1, %24 ]
  call void @llvm.lifetime.end.p0(i64 4096, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  ret i32 %.038
}

; 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: nounwind uwtable
declare hidden void @usage(ptr noundef) local_unnamed_addr #0

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

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

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

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

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #4

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

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @snprintf(ptr noalias nocapture noundef writeonly, i64 noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #3

declare ptr @qualities_load(ptr noundef) local_unnamed_addr #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @qualities_dummy() local_unnamed_addr #6

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

; Function Attrs: nounwind uwtable
declare hidden void @print_matches(ptr noundef, ptr 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 = { 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 #4 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { 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 #7 = { nounwind }
attributes #8 = { cold }
attributes #9 = { nounwind 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !9, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !9, i64 0}


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