; LLVM IR from AliveToolkit/alive2 :: tools (alive-jobserver)

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

%"class.std::basic_string_view" = type { i64, ptr }

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@_ZL13fifo_filename = external hidden global [1024 x i8], align 16
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [22 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef 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 i32, align 4
  %7 = alloca %"class.std::basic_string_view", align 8
  %8 = alloca %"class.std::basic_string_view", align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = 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
  %12 = call ptr @signal(i32 noundef 2, ptr noundef @_ZL14sigint_handleri) #7
  %13 = load i32, ptr %4, align 4, !tbaa !5
  %14 = icmp slt i32 %13, 2
  br i1 %14, label %15, label %16

15:                                               ; preds = %2
  call void @_ZL5usagev()
  br label %16

16:                                               ; preds = %15, %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 -1, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #7
  %17 = load ptr, ptr %5, align 8, !tbaa !9
  %18 = getelementptr inbounds ptr, ptr %17, i64 1
  %19 = load ptr, ptr %18, align 8, !tbaa !9
  call void @_ZNSt17basic_string_viewIcSt11char_traitsIcEEC2EPKc(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef %19) #7
  %20 = call noundef i32 @_ZNKSt17basic_string_viewIcSt11char_traitsIcEE7compareEmmPKc(ptr noundef nonnull align 8 dereferenceable(16) %7, i64 noundef 0, i64 noundef 2, ptr noundef @.str)
  %21 = icmp eq i32 %20, 0
  br i1 %21, label %22, label %34

22:                                               ; preds = %16
  %23 = call noundef i64 @_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %7) #7
  %24 = icmp ugt i64 %23, 2
  br i1 %24, label %25, label %34

25:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #7
  %26 = call { i64, ptr } @_ZNKSt17basic_string_viewIcSt11char_traitsIcEE6substrEmm(ptr noundef nonnull align 8 dereferenceable(16) %7, i64 noundef 2, i64 noundef -1)
  %27 = getelementptr inbounds { i64, ptr }, ptr %8, i32 0, i32 0
  %28 = extractvalue { i64, ptr } %26, 0
  store i64 %28, ptr %27, align 8
  %29 = getelementptr inbounds { i64, ptr }, ptr %8, i32 0, i32 1
  %30 = extractvalue { i64, ptr } %26, 1
  store ptr %30, ptr %29, align 8
  %31 = call noundef ptr @_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4dataEv(ptr noundef nonnull align 8 dereferenceable(16) %8) #7
  %32 = call i64 @strtol(ptr noundef %31, ptr noundef null, i32 noundef 10) #7
  %33 = trunc i64 %32 to i32
  store i32 %33, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #7
  br label %34

34:                                               ; preds = %25, %22, %16
  %35 = load i32, ptr %6, align 4, !tbaa !5
  %36 = icmp slt i32 %35, 1
  br i1 %36, label %40, label %37

37:                                               ; preds = %34
  %38 = load i32, ptr %6, align 4, !tbaa !5
  %39 = icmp sgt i32 %38, 16384
  br i1 %39, label %40, label %41

40:                                               ; preds = %37, %34
  call void @_ZL5usagev()
  br label %41

41:                                               ; preds = %40, %37
  %42 = load i32, ptr %4, align 4, !tbaa !5
  %43 = icmp sgt i32 %42, 2
  br i1 %43, label %44, label %47

44:                                               ; preds = %41
  %45 = load i32, ptr %6, align 4, !tbaa !5
  %46 = add nsw i32 %45, -1
  store i32 %46, ptr %6, align 4, !tbaa !5
  br label %47

47:                                               ; preds = %44, %41
  %48 = call i32 @getpid() #7
  %49 = sext i32 %48 to i64
  %50 = call i64 @time(ptr noundef null) #7
  %51 = add nsw i64 %49, %50
  %52 = trunc i64 %51 to i32
  call void @srand(i32 noundef %52) #7
  br label %53

53:                                               ; preds = %57, %47
  %54 = call i32 @rand() #7
  %55 = sext i32 %54 to i64
  %56 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef @_ZL13fifo_filename, i64 noundef 1024, ptr noundef @.str.1, i64 noundef %55) #7
  br label %57

57:                                               ; preds = %53
  %58 = call i32 @access(ptr noundef @_ZL13fifo_filename, i32 noundef 0) #7
  %59 = icmp eq i32 %58, 0
  br i1 %59, label %53, label %60, !llvm.loop !11

60:                                               ; preds = %57
  %61 = call i32 @mkfifo(ptr noundef @_ZL13fifo_filename, i32 noundef 438) #7
  %62 = icmp ne i32 %61, 0
  br i1 %62, label %63, label %64

63:                                               ; preds = %60
  call void @perror(ptr noundef @.str.2)
  call void @exit(i32 noundef -1) #8
  unreachable

64:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %65 = call i32 (ptr, i32, ...) @open(ptr noundef @_ZL13fifo_filename, i32 noundef 2)
  store i32 %65, ptr %9, align 4, !tbaa !5
  %66 = load i32, ptr %9, align 4, !tbaa !5
  %67 = icmp slt i32 %66, 0
  br i1 %67, label %68, label %69

68:                                               ; preds = %64
  call void @perror(ptr noundef @.str.3)
  call void @exit(i32 noundef -1) #8
  unreachable

69:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %70

70:                                               ; preds = %77, %69
  %71 = load i32, ptr %10, align 4, !tbaa !5
  %72 = load i32, ptr %6, align 4, !tbaa !5
  %73 = icmp slt i32 %71, %72
  br i1 %73, label %75, label %74

74:                                               ; preds = %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %80

75:                                               ; preds = %70
  %76 = load i32, ptr %9, align 4, !tbaa !5
  call void @_ZL9add_tokeni(i32 noundef %76)
  br label %77

77:                                               ; preds = %75
  %78 = load i32, ptr %10, align 4, !tbaa !5
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %10, align 4, !tbaa !5
  br label %70, !llvm.loop !13

80:                                               ; preds = %74
  %81 = call i32 @fflush(ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %82 = call i32 @fork() #7
  store i32 %82, ptr %11, align 4, !tbaa !5
  %83 = load i32, ptr %11, align 4, !tbaa !5
  %84 = icmp eq i32 %83, -1
  br i1 %84, label %85, label %86

85:                                               ; preds = %80
  call void @perror(ptr noundef @.str.4)
  call void @exit(i32 noundef -1) #8
  unreachable

86:                                               ; preds = %80
  %87 = load i32, ptr %11, align 4, !tbaa !5
  %88 = icmp eq i32 %87, 0
  br i1 %88, label %89, label %105

89:                                               ; preds = %86
  %90 = call ptr @signal(i32 noundef 2, ptr noundef null) #7
  %91 = call i32 @setenv(ptr noundef @.str.5, ptr noundef @_ZL13fifo_filename, i32 noundef 1) #7
  %92 = icmp ne i32 %91, 0
  br i1 %92, label %93, label %94

93:                                               ; preds = %89
  call void @perror(ptr noundef @.str.6)
  call void @exit(i32 noundef -1) #8
  unreachable

94:                                               ; preds = %89
  %95 = call i32 @setenv(ptr noundef @.str.7, ptr noundef @.str.8, i32 noundef 1) #7
  %96 = icmp ne i32 %95, 0
  br i1 %96, label %97, label %98

97:                                               ; preds = %94
  call void @perror(ptr noundef @.str.6)
  call void @exit(i32 noundef -1) #8
  unreachable

98:                                               ; preds = %94
  %99 = load ptr, ptr %5, align 8, !tbaa !9
  %100 = getelementptr inbounds ptr, ptr %99, i64 2
  %101 = load ptr, ptr %100, align 8, !tbaa !9
  %102 = load ptr, ptr %5, align 8, !tbaa !9
  %103 = getelementptr inbounds ptr, ptr %102, i64 2
  %104 = call i32 @execvp(ptr noundef %101, ptr noundef %103) #7
  call void @perror(ptr noundef @.str.9)
  call void @exit(i32 noundef -1) #8
  unreachable

105:                                              ; preds = %86
  br label %106

106:                                              ; preds = %111, %105
  br label %107

107:                                              ; preds = %106
  %108 = call i32 @waitpid(i32 noundef -1, ptr noundef null, i32 noundef 1)
  %109 = icmp eq i32 %108, -1
  br i1 %109, label %110, label %111

110:                                              ; preds = %107
  br label %115

111:                                              ; preds = %107
  %112 = load i32, ptr %6, align 4, !tbaa !5
  %113 = load i32, ptr %9, align 4, !tbaa !5
  call void @_ZL13refill_tokensii(i32 noundef %112, i32 noundef %113)
  %114 = call i32 @sleep(i32 noundef 1)
  br label %106, !llvm.loop !14

115:                                              ; preds = %110
  call void @_ZL11remove_fifov()
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  ret i32 0
}

; Function Attrs: nounwind
declare ptr @signal(i32 noundef, ptr noundef) #1

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL14sigint_handleri(i32 noundef) #2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL5usagev() #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt17basic_string_viewIcSt11char_traitsIcEEC2EPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNKSt17basic_string_viewIcSt11char_traitsIcEE7compareEmmPKc(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, i64 noundef, ptr noundef nonnull) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16)) #4 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, ptr } @_ZNKSt17basic_string_viewIcSt11char_traitsIcEE6substrEmm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, i64 noundef) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4dataEv(ptr noundef nonnull align 8 dereferenceable(16)) #4 align 2

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

; Function Attrs: nounwind
declare void @srand(i32 noundef) #1

; Function Attrs: nounwind
declare i32 @getpid() #1

; Function Attrs: nounwind
declare i64 @time(ptr noundef) #1

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

; Function Attrs: nounwind
declare i32 @rand() #1

; Function Attrs: nounwind
declare i32 @access(ptr noundef, i32 noundef) #1

; Function Attrs: nounwind
declare i32 @mkfifo(ptr noundef, i32 noundef) #1

declare void @perror(ptr noundef) #5

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #6

declare i32 @open(ptr noundef, i32 noundef, ...) #5

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL9add_tokeni(i32 noundef) #2

declare i32 @fflush(ptr noundef) #5

; Function Attrs: nounwind
declare i32 @fork() #1

; Function Attrs: nounwind
declare i32 @setenv(ptr noundef, ptr noundef, i32 noundef) #1

; Function Attrs: nounwind
declare i32 @execvp(ptr noundef, ptr noundef) #1

declare i32 @waitpid(i32 noundef, ptr noundef, i32 noundef) #5

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL13refill_tokensii(i32 noundef, i32 noundef) #2

declare i32 @sleep(i32 noundef) #5

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL11remove_fifov() #2

attributes #0 = { mustprogress norecurse 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 = { 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 #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress 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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }
attributes #8 = { noreturn nounwind }

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

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

%"class.std::basic_string_view" = type { i64, ptr }

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@_ZL13fifo_filename = external hidden global [1024 x i8], align 16
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [22 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca %"class.std::basic_string_view", align 8
  %4 = alloca %"class.std::basic_string_view", align 8
  %5 = tail call ptr @signal(i32 noundef 2, ptr noundef nonnull @_ZL14sigint_handleri) #10
  %6 = icmp slt i32 %0, 2
  br i1 %6, label %7, label %8

7:                                                ; preds = %2
  tail call void @_ZL5usagev()
  br label %8

8:                                                ; preds = %7, %2
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #10
  %9 = getelementptr inbounds i8, ptr %1, i64 8
  %10 = load ptr, ptr %9, align 8, !tbaa !5
  call void @_ZNSt17basic_string_viewIcSt11char_traitsIcEEC2EPKc(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef %10) #10
  %11 = call noundef i32 @_ZNKSt17basic_string_viewIcSt11char_traitsIcEE7compareEmmPKc(ptr noundef nonnull align 8 dereferenceable(16) %3, i64 noundef 0, i64 noundef 2, ptr noundef @.str)
  %12 = icmp eq i32 %11, 0
  br i1 %12, label %13, label %.thread

13:                                               ; preds = %8
  %14 = call noundef i64 @_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %3) #10
  %15 = icmp ugt i64 %14, 2
  br i1 %15, label %16, label %.thread

16:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #10
  %17 = call { i64, ptr } @_ZNKSt17basic_string_viewIcSt11char_traitsIcEE6substrEmm(ptr noundef nonnull align 8 dereferenceable(16) %3, i64 noundef 2, i64 noundef -1)
  %18 = extractvalue { i64, ptr } %17, 0
  store i64 %18, ptr %4, align 8
  %19 = getelementptr inbounds i8, ptr %4, i64 8
  %20 = extractvalue { i64, ptr } %17, 1
  store ptr %20, ptr %19, align 8
  %21 = call noundef ptr @_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4dataEv(ptr noundef nonnull align 8 dereferenceable(16) %4) #10
  %22 = call i64 @strtol(ptr nocapture noundef %21, ptr noundef null, i32 noundef 10) #10
  %23 = trunc i64 %22 to i32
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #10
  %24 = add i32 %23, -16385
  %or.cond = icmp ult i32 %24, -16384
  br i1 %or.cond, label %.thread, label %25

.thread:                                          ; preds = %8, %13, %16
  %.025 = phi i32 [ %23, %16 ], [ -1, %13 ], [ -1, %8 ]
  call void @_ZL5usagev()
  br label %25

25:                                               ; preds = %16, %.thread
  %.024 = phi i32 [ %23, %16 ], [ %.025, %.thread ]
  %26 = icmp sgt i32 %0, 2
  %27 = sext i1 %26 to i32
  %28 = call i32 @getpid() #10
  %29 = call i64 @time(ptr noundef null) #10
  %30 = trunc i64 %29 to i32
  %31 = add i32 %28, %30
  call void @srand(i32 noundef %31) #10
  br label %32

32:                                               ; preds = %32, %25
  %33 = call i32 @rand() #10
  %34 = sext i32 %33 to i64
  %35 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) @_ZL13fifo_filename, i64 noundef 1024, ptr noundef nonnull @.str.1, i64 noundef %34) #10
  %36 = call i32 @access(ptr noundef nonnull @_ZL13fifo_filename, i32 noundef 0) #10
  %37 = icmp eq i32 %36, 0
  br i1 %37, label %32, label %38, !llvm.loop !9

38:                                               ; preds = %32
  %spec.select = add i32 %.024, %27
  %39 = call i32 @mkfifo(ptr noundef nonnull @_ZL13fifo_filename, i32 noundef 438) #10
  %.not = icmp eq i32 %39, 0
  br i1 %.not, label %41, label %40

40:                                               ; preds = %38
  call void @perror(ptr noundef nonnull @.str.2) #11
  call void @exit(i32 noundef -1) #12
  unreachable

41:                                               ; preds = %38
  %42 = call i32 (ptr, i32, ...) @open(ptr noundef nonnull @_ZL13fifo_filename, i32 noundef 2)
  %43 = icmp slt i32 %42, 0
  br i1 %43, label %45, label %.preheader26

.preheader26:                                     ; preds = %41
  %44 = icmp sgt i32 %spec.select, 0
  br i1 %44, label %.lr.ph, label %._crit_edge

45:                                               ; preds = %41
  call void @perror(ptr noundef nonnull @.str.3) #11
  call void @exit(i32 noundef -1) #12
  unreachable

._crit_edge:                                      ; preds = %.lr.ph, %.preheader26
  %46 = call i32 @fflush(ptr noundef null)
  %47 = call i32 @fork() #10
  switch i32 %47, label %.preheader [
    i32 -1, label %51
    i32 0, label %52
  ]

.preheader:                                       ; preds = %._crit_edge
  %48 = call i32 @waitpid(i32 noundef -1, ptr noundef null, i32 noundef 1)
  %49 = icmp eq i32 %48, -1
  br i1 %49, label %._crit_edge29, label %.lr.ph28

.lr.ph:                                           ; preds = %.preheader26, %.lr.ph
  %.01727 = phi i32 [ %50, %.lr.ph ], [ 0, %.preheader26 ]
  call void @_ZL9add_tokeni(i32 noundef %42)
  %50 = add nuw nsw i32 %.01727, 1
  %exitcond.not = icmp eq i32 %50, %spec.select
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !11

51:                                               ; preds = %._crit_edge
  call void @perror(ptr noundef nonnull @.str.4) #11
  call void @exit(i32 noundef -1) #12
  unreachable

52:                                               ; preds = %._crit_edge
  %53 = call ptr @signal(i32 noundef 2, ptr noundef null) #10
  %54 = call i32 @setenv(ptr noundef nonnull @.str.5, ptr noundef nonnull @_ZL13fifo_filename, i32 noundef 1) #10
  %.not20 = icmp eq i32 %54, 0
  br i1 %.not20, label %56, label %55

55:                                               ; preds = %52
  call void @perror(ptr noundef nonnull @.str.6) #11
  call void @exit(i32 noundef -1) #12
  unreachable

56:                                               ; preds = %52
  %57 = call i32 @setenv(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.8, i32 noundef 1) #10
  %.not21 = icmp eq i32 %57, 0
  br i1 %.not21, label %59, label %58

58:                                               ; preds = %56
  call void @perror(ptr noundef nonnull @.str.6) #11
  call void @exit(i32 noundef -1) #12
  unreachable

59:                                               ; preds = %56
  %60 = getelementptr inbounds i8, ptr %1, i64 16
  %61 = load ptr, ptr %60, align 8, !tbaa !5
  %62 = call i32 @execvp(ptr noundef %61, ptr noundef nonnull %60) #10
  call void @perror(ptr noundef nonnull @.str.9) #11
  call void @exit(i32 noundef -1) #12
  unreachable

.lr.ph28:                                         ; preds = %.preheader, %.lr.ph28
  call void @_ZL13refill_tokensii(i32 noundef %spec.select, i32 noundef %42)
  %63 = call i32 @sleep(i32 noundef 1)
  %64 = call i32 @waitpid(i32 noundef -1, ptr noundef null, i32 noundef 1)
  %65 = icmp eq i32 %64, -1
  br i1 %65, label %._crit_edge29, label %.lr.ph28, !llvm.loop !12

._crit_edge29:                                    ; preds = %.lr.ph28, %.preheader
  call void @_ZL11remove_fifov()
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #10
  ret i32 0
}

; Function Attrs: nounwind
declare ptr @signal(i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL14sigint_handleri(i32 noundef) #2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL5usagev() local_unnamed_addr #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt17basic_string_viewIcSt11char_traitsIcEEC2EPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNKSt17basic_string_viewIcSt11char_traitsIcEE7compareEmmPKc(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, i64 noundef, ptr noundef nonnull) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #4 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, ptr } @_ZNKSt17basic_string_viewIcSt11char_traitsIcEE6substrEmm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4dataEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #4 align 2

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

; Function Attrs: nounwind
declare void @srand(i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind
declare i32 @getpid() local_unnamed_addr #1

; Function Attrs: nounwind
declare i64 @time(ptr noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind
declare i32 @rand() local_unnamed_addr #1

; Function Attrs: nofree nounwind
declare noundef i32 @access(ptr nocapture noundef readonly, i32 noundef) local_unnamed_addr #6

; Function Attrs: nounwind
declare i32 @mkfifo(ptr noundef, i32 noundef) local_unnamed_addr #1

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #7

; Function Attrs: nofree
declare noundef i32 @open(ptr nocapture noundef readonly, i32 noundef, ...) local_unnamed_addr #8

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL9add_tokeni(i32 noundef) local_unnamed_addr #2

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

; Function Attrs: nofree nounwind
declare i32 @fork() local_unnamed_addr #6

; Function Attrs: nounwind
declare i32 @setenv(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nofree nounwind
declare i32 @execvp(ptr noundef, ptr noundef) local_unnamed_addr #6

declare i32 @waitpid(i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #9

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL13refill_tokensii(i32 noundef, i32 noundef) local_unnamed_addr #2

declare i32 @sleep(i32 noundef) local_unnamed_addr #9

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL11remove_fifov() local_unnamed_addr #2

attributes #0 = { mustprogress norecurse 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 = { 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 #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress 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 = { 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 #6 = { 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 #7 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nofree "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 = { "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 #10 = { nounwind }
attributes #11 = { cold }
attributes #12 = { noreturn nounwind }

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

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


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass