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

; 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.puzzle = type { [25 x i8], [7 x i8], [25 x i8], [7 x i8] }
%struct.compact_puzzle = type { i64, i64 }
%struct.cp_slice = type { ptr, i64, i64 }

@.str = external hidden unnamed_addr constant [6 x i8], align 1
@optarg = external global ptr, align 8
@stderr = external global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [55 x i8], align 1
@optind = external global i32, align 4
@stdout = external global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@solved_puzzle = external constant %struct.puzzle, align 8

; 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 %struct.puzzle, align 8
  %8 = alloca %struct.compact_puzzle, align 8
  %9 = alloca [256 x %struct.cp_slice], align 16
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = 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) #8
  call void @llvm.lifetime.start.p0(i64 64, ptr %7) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #8
  call void @llvm.lifetime.start.p0(i64 6144, ptr %9) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  store i32 256, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %63, %2
  %17 = load i32, ptr %4, align 4, !tbaa !5
  %18 = load ptr, ptr %5, align 8, !tbaa !9
  %19 = call i32 @__posix_getopt(i32 noundef %17, ptr noundef %18, ptr noundef @.str) #8
  store i32 %19, ptr %12, align 4, !tbaa !5
  %20 = load i32, ptr %12, align 4, !tbaa !5
  %21 = icmp ne i32 %20, -1
  br i1 %21, label %22, label %64

22:                                               ; preds = %16
  %23 = load i32, ptr %12, align 4, !tbaa !5
  switch i32 %23, label %59 [
    i32 97, label %24
    i32 108, label %25
    i32 115, label %43
  ]

24:                                               ; preds = %22
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %63

25:                                               ; preds = %22
  %26 = load ptr, ptr @optarg, align 8, !tbaa !9
  %27 = call i32 @atoi(ptr noundef %26) #9
  store i32 %27, ptr %13, align 4, !tbaa !5
  %28 = load i32, ptr %13, align 4, !tbaa !5
  %29 = icmp sgt i32 %28, 256
  br i1 %29, label %30, label %31

30:                                               ; preds = %25
  store i32 256, ptr %13, align 4, !tbaa !5
  br label %42

31:                                               ; preds = %25
  %32 = load i32, ptr %13, align 4, !tbaa !5
  %33 = icmp slt i32 %32, 0
  br i1 %33, label %34, label %41

34:                                               ; preds = %31
  %35 = load ptr, ptr @stderr, align 8, !tbaa !9
  %36 = load ptr, ptr @optarg, align 8, !tbaa !9
  %37 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %35, ptr noundef @.str.1, ptr noundef %36) #8
  %38 = load ptr, ptr %5, align 8, !tbaa !9
  %39 = getelementptr inbounds ptr, ptr %38, i64 0
  %40 = load ptr, ptr %39, align 8, !tbaa !9
  call void @usage(ptr noundef %40) #10
  unreachable

41:                                               ; preds = %31
  br label %42

42:                                               ; preds = %41, %30
  br label %63

43:                                               ; preds = %22
  %44 = load ptr, ptr @optarg, align 8, !tbaa !9
  %45 = call i32 @atoi(ptr noundef %44) #9
  store i32 %45, ptr %14, align 4, !tbaa !5
  %46 = load i32, ptr %14, align 4, !tbaa !5
  %47 = icmp slt i32 %46, 0
  br i1 %47, label %51, label %48

48:                                               ; preds = %43
  %49 = load i32, ptr %14, align 4, !tbaa !5
  %50 = icmp sge i32 %49, 25
  br i1 %50, label %51, label %58

51:                                               ; preds = %48, %43
  %52 = load ptr, ptr @stderr, align 8, !tbaa !9
  %53 = load ptr, ptr @optarg, align 8, !tbaa !9
  %54 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %52, ptr noundef @.str.2, ptr noundef %53) #8
  %55 = load ptr, ptr %5, align 8, !tbaa !9
  %56 = getelementptr inbounds ptr, ptr %55, i64 0
  %57 = load ptr, ptr %56, align 8, !tbaa !9
  call void @usage(ptr noundef %57) #10
  unreachable

58:                                               ; preds = %48
  br label %63

59:                                               ; preds = %22
  %60 = load ptr, ptr %5, align 8, !tbaa !9
  %61 = getelementptr inbounds ptr, ptr %60, i64 0
  %62 = load ptr, ptr %61, align 8, !tbaa !9
  call void @usage(ptr noundef %62) #10
  unreachable

63:                                               ; preds = %58, %42, %24
  br label %16, !llvm.loop !11

64:                                               ; preds = %16
  %65 = load i32, ptr %4, align 4, !tbaa !5
  %66 = load i32, ptr @optind, align 4, !tbaa !5
  %67 = sub nsw i32 %65, %66
  switch i32 %67, label %86 [
    i32 0, label %68
    i32 1, label %70
  ]

68:                                               ; preds = %64
  %69 = load ptr, ptr @stdout, align 8, !tbaa !9
  store ptr %69, ptr %6, align 8, !tbaa !9
  br label %90

70:                                               ; preds = %64
  %71 = load ptr, ptr %5, align 8, !tbaa !9
  %72 = load i32, ptr @optind, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds ptr, ptr %71, i64 %73
  %75 = load ptr, ptr %74, align 8, !tbaa !9
  %76 = call noalias ptr @fopen(ptr noundef %75, ptr noundef @.str.3)
  store ptr %76, ptr %6, align 8, !tbaa !9
  %77 = load ptr, ptr %6, align 8, !tbaa !9
  %78 = icmp eq ptr %77, null
  br i1 %78, label %79, label %85

79:                                               ; preds = %70
  %80 = load ptr, ptr %5, align 8, !tbaa !9
  %81 = load i32, ptr @optind, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds ptr, ptr %80, i64 %82
  %84 = load ptr, ptr %83, align 8, !tbaa !9
  call void @perror(ptr noundef %84)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %133

85:                                               ; preds = %70
  br label %90

86:                                               ; preds = %64
  %87 = load ptr, ptr %5, align 8, !tbaa !9
  %88 = getelementptr inbounds ptr, ptr %87, i64 0
  %89 = load ptr, ptr %88, align 8, !tbaa !9
  call void @usage(ptr noundef %89) #10
  unreachable

90:                                               ; preds = %85, %68
  %91 = load ptr, ptr %6, align 8, !tbaa !9
  %92 = load i32, ptr %14, align 4, !tbaa !5
  call void @trivial_loops(ptr noundef %91, i32 noundef %92)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %7, ptr align 8 @solved_puzzle, i64 64, i1 false), !tbaa.struct !13
  %93 = load i32, ptr %14, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  call void @move(ptr noundef %7, i64 noundef %94)
  call void @pack_puzzle(ptr noundef %8, ptr noundef %7)
  %95 = getelementptr inbounds [256 x %struct.cp_slice], ptr %9, i64 0, i64 0
  %96 = getelementptr inbounds %struct.cp_slice, ptr %95, i64 0
  call void @cps_init(ptr noundef %96)
  %97 = getelementptr inbounds [256 x %struct.cp_slice], ptr %9, i64 0, i64 0
  %98 = getelementptr inbounds %struct.cp_slice, ptr %97, i64 0
  call void @cps_append(ptr noundef %98, ptr noundef %8)
  store i32 1, ptr %11, align 4, !tbaa !5
  br label %99

99:                                               ; preds = %124, %90
  %100 = load i32, ptr %11, align 4, !tbaa !5
  %101 = load i32, ptr %13, align 4, !tbaa !5
  %102 = icmp sle i32 %100, %101
  br i1 %102, label %103, label %127

103:                                              ; preds = %99
  %104 = load ptr, ptr @stdout, align 8, !tbaa !9
  %105 = call i32 @fflush(ptr noundef %104)
  %106 = getelementptr inbounds [256 x %struct.cp_slice], ptr %9, i64 0, i64 0
  %107 = load i32, ptr %11, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds %struct.cp_slice, ptr %106, i64 %108
  call void @cps_init(ptr noundef %109)
  %110 = getelementptr inbounds [256 x %struct.cp_slice], ptr %9, i64 0, i64 0
  %111 = load i32, ptr %11, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds %struct.cp_slice, ptr %110, i64 %112
  %114 = getelementptr inbounds [256 x %struct.cp_slice], ptr %9, i64 0, i64 0
  %115 = load i32, ptr %11, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds %struct.cp_slice, ptr %114, i64 %116
  %118 = getelementptr inbounds %struct.cp_slice, ptr %117, i64 -1
  call void @cps_round(ptr noundef %113, ptr noundef %118)
  %119 = load ptr, ptr %6, align 8, !tbaa !9
  %120 = getelementptr inbounds [256 x %struct.cp_slice], ptr %9, i64 0, i64 0
  %121 = load i32, ptr %11, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = load i32, ptr %10, align 4, !tbaa !5
  call void @do_loops(ptr noundef %119, ptr noundef %120, i64 noundef %122, i32 noundef %123)
  br label %124

124:                                              ; preds = %103
  %125 = load i32, ptr %11, align 4, !tbaa !5
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr %11, align 4, !tbaa !5
  br label %99, !llvm.loop !15

127:                                              ; preds = %99
  %128 = load ptr, ptr %6, align 8, !tbaa !9
  %129 = getelementptr inbounds [256 x %struct.cp_slice], ptr %9, i64 0, i64 0
  %130 = load i32, ptr %11, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = load i32, ptr %10, align 4, !tbaa !5
  call void @do_loops(ptr noundef %128, ptr noundef %129, i64 noundef %131, i32 noundef %132)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %133

133:                                              ; preds = %127, %79
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 6144, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 64, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  %134 = load i32, ptr %3, align 4
  ret i32 %134
}

; 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

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

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

declare void @perror(ptr noundef) #5

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

; 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) #6

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @move(ptr noundef, i64 noundef) #7

declare void @pack_puzzle(ptr noundef, ptr noundef) #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @cps_init(ptr noundef) #7

declare void @cps_append(ptr noundef, ptr noundef) #5

declare i32 @fflush(ptr noundef) #5

declare void @cps_round(ptr noundef, ptr noundef) #5

; Function Attrs: nounwind uwtable
declare hidden void @do_loops(ptr noundef, ptr noundef, i64 noundef, i32 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 = { noreturn 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 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { 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 #8 = { nounwind }
attributes #9 = { nounwind willreturn memory(read) }
attributes #10 = { noreturn }

!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 = !{i64 0, i64 25, !14, i64 32, i64 25, !14}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !12}


; 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.puzzle = type { [25 x i8], [7 x i8], [25 x i8], [7 x i8] }
%struct.compact_puzzle = type { i64, i64 }
%struct.cp_slice = type { ptr, i64, i64 }

@.str = external hidden unnamed_addr constant [6 x i8], align 1
@optarg = external local_unnamed_addr global ptr, align 8
@stderr = external local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [55 x i8], align 1
@optind = external local_unnamed_addr global i32, align 4
@stdout = external local_unnamed_addr global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@solved_puzzle = external local_unnamed_addr constant %struct.puzzle, align 8

; 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 %struct.puzzle, align 8
  %4 = alloca %struct.compact_puzzle, align 8
  %5 = alloca [256 x %struct.cp_slice], align 16
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %3) #9
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 6144, ptr nonnull %5) #9
  br label %.outer

.outer:                                           ; preds = %6, %2
  %.036.ph = phi i32 [ 0, %2 ], [ 1, %6 ]
  %.032.ph = phi i32 [ 256, %2 ], [ %.032.ph89, %6 ]
  %.0.ph = phi i32 [ 0, %2 ], [ %.0, %6 ]
  br label %.outer88

.outer88:                                         ; preds = %.outer88.backedge, %.outer
  %.032.ph89 = phi i32 [ %.032.ph, %.outer ], [ %.032.ph89.be, %.outer88.backedge ]
  %.0.ph90 = phi i32 [ %.0.ph, %.outer ], [ %.0, %.outer88.backedge ]
  br label %6

6:                                                ; preds = %.outer88, %18
  %.0 = phi i32 [ %20, %18 ], [ %.0.ph90, %.outer88 ]
  %7 = tail call i32 @__posix_getopt(i32 noundef %0, ptr noundef %1, ptr noundef nonnull @.str) #9
  switch i32 %7, label %25 [
    i32 -1, label %27
    i32 97, label %.outer
    i32 108, label %8
    i32 115, label %18
  ], !llvm.loop !5

8:                                                ; preds = %6
  %9 = load ptr, ptr @optarg, align 8, !tbaa !7
  %10 = tail call i32 @atoi(ptr nocapture noundef %9) #10
  %11 = icmp sgt i32 %10, 256
  br i1 %11, label %.outer88.backedge, label %12

12:                                               ; preds = %8
  %13 = icmp slt i32 %10, 0
  br i1 %13, label %14, label %.outer88.backedge

.outer88.backedge:                                ; preds = %12, %8
  %.032.ph89.be = phi i32 [ 256, %8 ], [ %10, %12 ]
  br label %.outer88, !llvm.loop !5

14:                                               ; preds = %12
  %15 = load ptr, ptr @stderr, align 8, !tbaa !7
  %16 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %15, ptr noundef nonnull @.str.1, ptr noundef nonnull %9) #11
  %17 = load ptr, ptr %1, align 8, !tbaa !7
  tail call void @usage(ptr noundef %17) #12
  unreachable

18:                                               ; preds = %6
  %19 = load ptr, ptr @optarg, align 8, !tbaa !7
  %20 = tail call i32 @atoi(ptr nocapture noundef %19) #10
  %or.cond = icmp ugt i32 %20, 24
  br i1 %or.cond, label %21, label %6, !llvm.loop !5

21:                                               ; preds = %18
  %22 = load ptr, ptr @stderr, align 8, !tbaa !7
  %23 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %22, ptr noundef nonnull @.str.2, ptr noundef nonnull %19) #11
  %24 = load ptr, ptr %1, align 8, !tbaa !7
  tail call void @usage(ptr noundef %24) #12
  unreachable

25:                                               ; preds = %6
  %26 = load ptr, ptr %1, align 8, !tbaa !7
  tail call void @usage(ptr noundef %26) #12
  unreachable

27:                                               ; preds = %6
  %28 = load i32, ptr @optind, align 4, !tbaa !11
  %29 = sub nsw i32 %0, %28
  switch i32 %29, label %43 [
    i32 0, label %30
    i32 1, label %32
  ]

30:                                               ; preds = %27
  %31 = load ptr, ptr @stdout, align 8, !tbaa !7
  br label %45

32:                                               ; preds = %27
  %33 = sext i32 %28 to i64
  %34 = getelementptr inbounds ptr, ptr %1, i64 %33
  %35 = load ptr, ptr %34, align 8, !tbaa !7
  %36 = tail call noalias ptr @fopen(ptr noundef %35, ptr noundef nonnull @.str.3)
  %37 = icmp eq ptr %36, null
  br i1 %37, label %38, label %45

38:                                               ; preds = %32
  %39 = load i32, ptr @optind, align 4, !tbaa !11
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds ptr, ptr %1, i64 %40
  %42 = load ptr, ptr %41, align 8, !tbaa !7
  tail call void @perror(ptr noundef %42) #13
  br label %53

43:                                               ; preds = %27
  %44 = load ptr, ptr %1, align 8, !tbaa !7
  tail call void @usage(ptr noundef %44) #12
  unreachable

45:                                               ; preds = %32, %30
  %.038 = phi ptr [ %36, %32 ], [ %31, %30 ]
  tail call void @trivial_loops(ptr noundef %.038, i32 noundef %.0)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %3, ptr noundef nonnull align 8 dereferenceable(64) @solved_puzzle, i64 64, i1 false), !tbaa.struct !13
  %46 = zext nneg i32 %.0 to i64
  call void @move(ptr noundef nonnull %3, i64 noundef %46)
  call void @pack_puzzle(ptr noundef nonnull %4, ptr noundef nonnull %3) #9
  call void @cps_init(ptr noundef nonnull %5)
  call void @cps_append(ptr noundef nonnull %5, ptr noundef nonnull %4) #9
  %.not4354 = icmp eq i32 %.032.ph89, 0
  br i1 %.not4354, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %45
  %47 = add nuw i32 %.032.ph89, 1
  %wide.trip.count = zext i32 %47 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %48 = load ptr, ptr @stdout, align 8, !tbaa !7
  %49 = call i32 @fflush(ptr noundef %48)
  %50 = getelementptr inbounds %struct.cp_slice, ptr %5, i64 %indvars.iv
  call void @cps_init(ptr noundef nonnull %50)
  %51 = getelementptr inbounds i8, ptr %50, i64 -24
  call void @cps_round(ptr noundef nonnull %50, ptr noundef nonnull %51) #9
  call void @do_loops(ptr noundef %.038, ptr noundef nonnull %5, i64 noundef %indvars.iv, i32 noundef %.036.ph)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge.loopexit, label %.lr.ph, !llvm.loop !15

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %52 = zext nneg i32 %47 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %45, %._crit_edge.loopexit
  %.035.lcssa = phi i64 [ %52, %._crit_edge.loopexit ], [ 1, %45 ]
  call void @do_loops(ptr noundef %.038, ptr noundef nonnull %5, i64 noundef %.035.lcssa, i32 noundef %.036.ph)
  br label %53

53:                                               ; preds = %._crit_edge, %38
  %.034 = phi i32 [ 1, %38 ], [ 0, %._crit_edge ]
  call void @llvm.lifetime.end.p0(i64 6144, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %3) #9
  ret i32 %.034
}

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

; 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

; Function Attrs: nounwind uwtable
declare hidden void @trivial_loops(ptr noundef, i32 noundef) local_unnamed_addr #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) #6

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @move(ptr noundef, i64 noundef) local_unnamed_addr #7

declare void @pack_puzzle(ptr noundef, ptr noundef) local_unnamed_addr #8

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @cps_init(ptr noundef) local_unnamed_addr #7

declare void @cps_append(ptr noundef, ptr noundef) local_unnamed_addr #8

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

declare void @cps_round(ptr noundef, ptr noundef) local_unnamed_addr #8

; Function Attrs: nounwind uwtable
declare hidden void @do_loops(ptr noundef, ptr noundef, i64 noundef, i32 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 = { noreturn 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { 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 #8 = { "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 #9 = { nounwind }
attributes #10 = { nounwind willreturn memory(read) }
attributes #11 = { cold nounwind }
attributes #12 = { noreturn }
attributes #13 = { 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 = 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 = !{i64 0, i64 25, !14, i64 32, i64 25, !14}
!14 = !{!9, !9, i64 0}
!15 = distinct !{!15, !6}


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