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

; 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.cp_slice = type { ptr, i64, i64 }
%struct.compact_puzzle = type { i64, i64 }

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

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

21:                                               ; preds = %15
  %22 = load i32, ptr %9, align 4, !tbaa !5
  switch i32 %22, label %35 [
    i32 102, label %23
    i32 108, label %25
    i32 110, label %28
    i32 115, label %31
    i32 83, label %34
  ]

23:                                               ; preds = %21
  %24 = load ptr, ptr @optarg, align 8, !tbaa !9
  store ptr %24, ptr %14, align 8, !tbaa !9
  br label %39

25:                                               ; preds = %21
  %26 = load ptr, ptr @optarg, align 8, !tbaa !9
  %27 = call i32 @atoi(ptr noundef %26) #8
  store i32 %27, ptr %11, align 4, !tbaa !5
  br label %39

28:                                               ; preds = %21
  %29 = load ptr, ptr @optarg, align 8, !tbaa !9
  %30 = call i64 @strtoull(ptr noundef %29, ptr noundef null, i32 noundef 0) #7
  store i64 %30, ptr %13, align 8, !tbaa !11
  br label %39

31:                                               ; preds = %21
  %32 = load ptr, ptr @optarg, align 8, !tbaa !9
  %33 = call i64 @strtoull(ptr noundef %32, ptr noundef null, i32 noundef 0) #7
  call void @set_seed(i64 noundef %33)
  br label %39

34:                                               ; preds = %21
  store i32 1, ptr %12, align 4, !tbaa !5
  br label %39

35:                                               ; preds = %21
  %36 = load ptr, ptr %5, align 8, !tbaa !9
  %37 = getelementptr inbounds ptr, ptr %36, i64 0
  %38 = load ptr, ptr %37, align 8, !tbaa !9
  call void @usage(ptr noundef %38)
  br label %39

39:                                               ; preds = %35, %34, %31, %28, %25, %23
  br label %15, !llvm.loop !13

40:                                               ; preds = %15
  %41 = load i32, ptr %4, align 4, !tbaa !5
  %42 = load i32, ptr @optind, align 4, !tbaa !5
  %43 = icmp ne i32 %41, %42
  br i1 %43, label %44, label %48

44:                                               ; preds = %40
  %45 = load ptr, ptr %5, align 8, !tbaa !9
  %46 = getelementptr inbounds ptr, ptr %45, i64 0
  %47 = load ptr, ptr %46, align 8, !tbaa !9
  call void @usage(ptr noundef %47)
  br label %48

48:                                               ; preds = %44, %40
  call void @cps_init(ptr noundef %7)
  call void @pack_puzzle(ptr noundef %8, ptr noundef @solved_puzzle)
  call void @cps_append(ptr noundef %7, ptr noundef %8)
  %49 = load ptr, ptr %14, align 8, !tbaa !9
  %50 = icmp ne ptr %49, null
  br i1 %50, label %51, label %55

51:                                               ; preds = %48
  %52 = load ptr, ptr %14, align 8, !tbaa !9
  %53 = load i64, ptr %13, align 8, !tbaa !11
  %54 = load i32, ptr %12, align 4, !tbaa !5
  call void @do_sampling(ptr noundef %52, ptr noundef %7, i32 noundef 0, i64 noundef %53, i32 noundef %54)
  br label %55

55:                                               ; preds = %51, %48
  %56 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, ptr noundef @.str.2)
  %57 = getelementptr inbounds %struct.cp_slice, ptr %7, i32 0, i32 1
  %58 = load i64, ptr %57, align 8, !tbaa !15
  %59 = getelementptr inbounds %struct.cp_slice, ptr %7, i32 0, i32 1
  %60 = load i64, ptr %59, align 8, !tbaa !15
  %61 = uitofp i64 %60 to double
  %62 = fdiv double %61, 0x4519A940C33F6121
  %63 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef 0, i64 noundef %58, ptr noundef @.str.2, double noundef %62)
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %87, %55
  %65 = load i32, ptr %10, align 4, !tbaa !5
  %66 = load i32, ptr %11, align 4, !tbaa !5
  %67 = icmp sle i32 %65, %66
  br i1 %67, label %68, label %90

68:                                               ; preds = %64
  %69 = load ptr, ptr @stdout, align 8, !tbaa !9
  %70 = call i32 @fflush(ptr noundef %69)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %6, ptr align 8 %7, i64 24, i1 false), !tbaa.struct !17
  call void @cps_init(ptr noundef %7)
  call void @cps_round(ptr noundef %7, ptr noundef %6)
  %71 = load ptr, ptr %14, align 8, !tbaa !9
  %72 = icmp ne ptr %71, null
  br i1 %72, label %73, label %78

73:                                               ; preds = %68
  %74 = load ptr, ptr %14, align 8, !tbaa !9
  %75 = load i32, ptr %10, align 4, !tbaa !5
  %76 = load i64, ptr %13, align 8, !tbaa !11
  %77 = load i32, ptr %12, align 4, !tbaa !5
  call void @do_sampling(ptr noundef %74, ptr noundef %7, i32 noundef %75, i64 noundef %76, i32 noundef %77)
  br label %78

78:                                               ; preds = %73, %68
  call void @cps_free(ptr noundef %6)
  %79 = load i32, ptr %10, align 4, !tbaa !5
  %80 = getelementptr inbounds %struct.cp_slice, ptr %7, i32 0, i32 1
  %81 = load i64, ptr %80, align 8, !tbaa !15
  %82 = getelementptr inbounds %struct.cp_slice, ptr %7, i32 0, i32 1
  %83 = load i64, ptr %82, align 8, !tbaa !15
  %84 = uitofp i64 %83 to double
  %85 = fdiv double %84, 0x4519A940C33F6121
  %86 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %79, i64 noundef %81, ptr noundef @.str.2, double noundef %85)
  br label %87

87:                                               ; preds = %78
  %88 = load i32, ptr %10, align 4, !tbaa !5
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %10, align 4, !tbaa !5
  br label %64, !llvm.loop !18

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

; 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 i64 @strtoull(ptr noundef, ptr noundef, i32 noundef) #2

declare void @set_seed(i64 noundef) #4

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

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

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

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

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

declare i32 @printf(ptr noundef, ...) #4

declare i32 @fflush(ptr noundef) #4

; 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

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

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

; 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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nounwind }
attributes #8 = { 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"}
!15 = !{!16, !12, i64 8}
!16 = !{!"cp_slice", !10, i64 0, !12, i64 8, !12, i64 16}
!17 = !{i64 0, i64 8, !9, i64 8, i64 8, !11, i64 16, i64 8, !11}
!18 = distinct !{!18, !14}


; 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.cp_slice = type { ptr, i64, i64 }
%struct.compact_puzzle = type { i64, i64 }

@.str = external hidden unnamed_addr constant [10 x i8], align 1
@optarg = external local_unnamed_addr global ptr, align 8
@optind = external local_unnamed_addr global i32, align 4
@solved_puzzle = external constant %struct.puzzle, align 8
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [25 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca %struct.cp_slice, align 8
  %4 = alloca %struct.cp_slice, align 8
  %5 = alloca %struct.compact_puzzle, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #9
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #9
  br label %.outer

.outer:                                           ; preds = %10, %2
  %.024.ph = phi i32 [ %12, %10 ], [ 2147483647, %2 ]
  %.022.ph = phi i32 [ %.022.ph39, %10 ], [ 0, %2 ]
  %.020.ph = phi i64 [ %.020.ph43, %10 ], [ 1048576, %2 ]
  %.0.ph = phi ptr [ %.0.ph46, %10 ], [ null, %2 ]
  br label %.outer38

.outer38:                                         ; preds = %6, %.outer
  %.022.ph39 = phi i32 [ %.022.ph, %.outer ], [ 1, %6 ]
  %.020.ph40 = phi i64 [ %.020.ph, %.outer ], [ %.020.ph43, %6 ]
  %.0.ph41 = phi ptr [ %.0.ph, %.outer ], [ %.0.ph46, %6 ]
  br label %.outer42

.outer42:                                         ; preds = %.outer38, %13
  %.020.ph43 = phi i64 [ %.020.ph40, %.outer38 ], [ %15, %13 ]
  %.0.ph44 = phi ptr [ %.0.ph41, %.outer38 ], [ %.0.ph46, %13 ]
  br label %.outer45

.outer45:                                         ; preds = %.outer42, %8
  %.0.ph46 = phi ptr [ %.0.ph44, %.outer42 ], [ %9, %8 ]
  br label %6

6:                                                ; preds = %.backedge, %.outer45
  %7 = tail call i32 @__posix_getopt(i32 noundef %0, ptr noundef %1, ptr noundef nonnull @.str) #9
  switch i32 %7, label %19 [
    i32 -1, label %21
    i32 102, label %8
    i32 108, label %10
    i32 110, label %13
    i32 115, label %16
    i32 83, label %.outer38
  ], !llvm.loop !5

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

10:                                               ; preds = %6
  %11 = load ptr, ptr @optarg, align 8, !tbaa !7
  %12 = tail call i32 @atoi(ptr nocapture noundef %11) #10
  br label %.outer, !llvm.loop !5

13:                                               ; preds = %6
  %14 = load ptr, ptr @optarg, align 8, !tbaa !7
  %15 = tail call i64 @strtoull(ptr nocapture noundef %14, ptr noundef null, i32 noundef 0) #9
  br label %.outer42, !llvm.loop !5

16:                                               ; preds = %6
  %17 = load ptr, ptr @optarg, align 8, !tbaa !7
  %18 = tail call i64 @strtoull(ptr nocapture noundef %17, ptr noundef null, i32 noundef 0) #9
  tail call void @set_seed(i64 noundef %18) #9
  br label %.backedge

19:                                               ; preds = %6
  %20 = load ptr, ptr %1, align 8, !tbaa !7
  tail call void @usage(ptr noundef %20)
  br label %.backedge

.backedge:                                        ; preds = %19, %16
  br label %6, !llvm.loop !5

21:                                               ; preds = %6
  %22 = load i32, ptr @optind, align 4, !tbaa !11
  %.not28 = icmp eq i32 %22, %0
  br i1 %.not28, label %25, label %23

23:                                               ; preds = %21
  %24 = load ptr, ptr %1, align 8, !tbaa !7
  tail call void @usage(ptr noundef %24)
  br label %25

25:                                               ; preds = %23, %21
  call void @cps_init(ptr noundef nonnull %4)
  call void @pack_puzzle(ptr noundef nonnull %5, ptr noundef nonnull @solved_puzzle) #9
  call void @cps_append(ptr noundef nonnull %4, ptr noundef nonnull %5) #9
  %.not29 = icmp eq ptr %.0.ph46, null
  br i1 %.not29, label %27, label %26

26:                                               ; preds = %25
  call void @do_sampling(ptr noundef nonnull %.0.ph46, ptr noundef nonnull %4, i32 noundef 0, i64 noundef %.020.ph43, i32 noundef %.022.ph39)
  br label %27

27:                                               ; preds = %26, %25
  %28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull @.str.2)
  %29 = getelementptr inbounds i8, ptr %4, i64 8
  %30 = load i64, ptr %29, align 8, !tbaa !13
  %31 = uitofp i64 %30 to double
  %32 = fdiv double %31, 0x4519A940C33F6121
  %33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 0, i64 noundef %30, ptr noundef nonnull @.str.2, double noundef %32)
  %.not3031 = icmp slt i32 %.024.ph, 1
  br i1 %.not3031, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %27
  br i1 %.not29, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph, %.lr.ph.split.us
  %.02632.us = phi i32 [ %40, %.lr.ph.split.us ], [ 1, %.lr.ph ]
  %34 = load ptr, ptr @stdout, align 8, !tbaa !7
  %35 = call i32 @fflush(ptr noundef %34)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %4, i64 24, i1 false), !tbaa.struct !16
  call void @cps_init(ptr noundef nonnull %4)
  call void @cps_round(ptr noundef nonnull %4, ptr noundef nonnull %3) #9
  call void @cps_free(ptr noundef nonnull %3)
  %36 = load i64, ptr %29, align 8, !tbaa !13
  %37 = uitofp i64 %36 to double
  %38 = fdiv double %37, 0x4519A940C33F6121
  %39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %.02632.us, i64 noundef %36, ptr noundef nonnull @.str.2, double noundef %38)
  %40 = add nuw i32 %.02632.us, 1
  %exitcond34.not = icmp eq i32 %.02632.us, %.024.ph
  br i1 %exitcond34.not, label %._crit_edge, label %.lr.ph.split.us, !llvm.loop !18

.lr.ph.split:                                     ; preds = %.lr.ph, %.lr.ph.split
  %.02632 = phi i32 [ %47, %.lr.ph.split ], [ 1, %.lr.ph ]
  %41 = load ptr, ptr @stdout, align 8, !tbaa !7
  %42 = call i32 @fflush(ptr noundef %41)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %4, i64 24, i1 false), !tbaa.struct !16
  call void @cps_init(ptr noundef nonnull %4)
  call void @cps_round(ptr noundef nonnull %4, ptr noundef nonnull %3) #9
  call void @do_sampling(ptr noundef nonnull %.0.ph46, ptr noundef nonnull %4, i32 noundef %.02632, i64 noundef %.020.ph43, i32 noundef %.022.ph39)
  call void @cps_free(ptr noundef nonnull %3)
  %43 = load i64, ptr %29, align 8, !tbaa !13
  %44 = uitofp i64 %43 to double
  %45 = fdiv double %44, 0x4519A940C33F6121
  %46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %.02632, i64 noundef %43, ptr noundef nonnull @.str.2, double noundef %45)
  %47 = add nuw i32 %.02632, 1
  %exitcond.not = icmp eq i32 %.02632, %.024.ph
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph.split, !llvm.loop !18

._crit_edge:                                      ; preds = %.lr.ph.split, %.lr.ph.split.us, %27
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #9
  ret i32 0
}

; 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: mustprogress nofree nounwind willreturn
declare i64 @strtoull(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #4

declare void @set_seed(i64 noundef) local_unnamed_addr #5

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

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

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

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

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

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

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

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

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

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

; 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 = { 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 #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 = { 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 #8 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #9 = { nounwind }
attributes #10 = { 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 = 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, !15, i64 8}
!14 = !{!"cp_slice", !8, i64 0, !15, i64 8, !15, i64 16}
!15 = !{!"long", !9, i64 0}
!16 = !{i64 0, i64 8, !7, i64 8, i64 8, !17, i64 16, i64 8, !17}
!17 = !{!15, !15, i64 0}
!18 = distinct !{!18, !6}


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