; LLVM IR from rigtorp/ipc-bench :: src (unix_lat)

; 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.timespec = type { i64, i64 }

@.str = external hidden unnamed_addr constant [50 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [25 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 [2 x i32], align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca %struct.timespec, align 8
  %13 = alloca %struct.timespec, align 8
  %14 = 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
  call void @llvm.lifetime.start.p0(i64 4, 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 8, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #6
  %15 = load i32, ptr %4, align 4, !tbaa !5
  %16 = icmp ne i32 %15, 3
  br i1 %16, label %17, label %19

17:                                               ; preds = %2
  %18 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %136

19:                                               ; preds = %2
  %20 = load ptr, ptr %5, align 8, !tbaa !9
  %21 = getelementptr inbounds ptr, ptr %20, i64 1
  %22 = load ptr, ptr %21, align 8, !tbaa !9
  %23 = call i32 @atoi(ptr noundef %22) #7
  store i32 %23, ptr %7, align 4, !tbaa !5
  %24 = load ptr, ptr %5, align 8, !tbaa !9
  %25 = getelementptr inbounds ptr, ptr %24, i64 2
  %26 = load ptr, ptr %25, align 8, !tbaa !9
  %27 = call i64 @atol(ptr noundef %26) #7
  store i64 %27, ptr %9, align 8, !tbaa !11
  %28 = load i32, ptr %7, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = call noalias ptr @malloc(i64 noundef %29) #8
  store ptr %30, ptr %8, align 8, !tbaa !9
  %31 = load ptr, ptr %8, align 8, !tbaa !9
  %32 = icmp eq ptr %31, null
  br i1 %32, label %33, label %34

33:                                               ; preds = %19
  call void @perror(ptr noundef @.str.1)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %136

34:                                               ; preds = %19
  %35 = load i32, ptr %7, align 4, !tbaa !5
  %36 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %35)
  %37 = load i64, ptr %9, align 8, !tbaa !11
  %38 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i64 noundef %37)
  %39 = getelementptr inbounds [2 x i32], ptr %6, i64 0, i64 0
  %40 = call i32 @socketpair(i32 noundef 1, i32 noundef 1, i32 noundef 0, ptr noundef %39) #6
  %41 = icmp eq i32 %40, -1
  br i1 %41, label %42, label %43

42:                                               ; preds = %34
  call void @perror(ptr noundef @.str.4)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %136

43:                                               ; preds = %34
  %44 = call i32 @fork() #6
  %45 = icmp ne i32 %44, 0
  br i1 %45, label %78, label %46

46:                                               ; preds = %43
  store i64 0, ptr %10, align 8, !tbaa !11
  br label %47

47:                                               ; preds = %74, %46
  %48 = load i64, ptr %10, align 8, !tbaa !11
  %49 = load i64, ptr %9, align 8, !tbaa !11
  %50 = icmp slt i64 %48, %49
  br i1 %50, label %51, label %77

51:                                               ; preds = %47
  %52 = getelementptr inbounds [2 x i32], ptr %6, i64 0, i64 1
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = load ptr, ptr %8, align 8, !tbaa !9
  %55 = load i32, ptr %7, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = call i64 @read(i32 noundef %53, ptr noundef %54, i64 noundef %56)
  %58 = load i32, ptr %7, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = icmp ne i64 %57, %59
  br i1 %60, label %61, label %62

61:                                               ; preds = %51
  call void @perror(ptr noundef @.str.5)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %136

62:                                               ; preds = %51
  %63 = getelementptr inbounds [2 x i32], ptr %6, i64 0, i64 1
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = load ptr, ptr %8, align 8, !tbaa !9
  %66 = load i32, ptr %7, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = call i64 @write(i32 noundef %64, ptr noundef %65, i64 noundef %67)
  %69 = load i32, ptr %7, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = icmp ne i64 %68, %70
  br i1 %71, label %72, label %73

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

73:                                               ; preds = %62
  br label %74

74:                                               ; preds = %73
  %75 = load i64, ptr %10, align 8, !tbaa !11
  %76 = add nsw i64 %75, 1
  store i64 %76, ptr %10, align 8, !tbaa !11
  br label %47, !llvm.loop !13

77:                                               ; preds = %47
  br label %135

78:                                               ; preds = %43
  %79 = call i32 @clock_gettime(i32 noundef 1, ptr noundef %12) #6
  %80 = icmp eq i32 %79, -1
  br i1 %80, label %81, label %82

81:                                               ; preds = %78
  call void @perror(ptr noundef @.str.7)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %136

82:                                               ; preds = %78
  store i64 0, ptr %10, align 8, !tbaa !11
  br label %83

83:                                               ; preds = %110, %82
  %84 = load i64, ptr %10, align 8, !tbaa !11
  %85 = load i64, ptr %9, align 8, !tbaa !11
  %86 = icmp slt i64 %84, %85
  br i1 %86, label %87, label %113

87:                                               ; preds = %83
  %88 = getelementptr inbounds [2 x i32], ptr %6, i64 0, i64 0
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %90 = load ptr, ptr %8, align 8, !tbaa !9
  %91 = load i32, ptr %7, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = call i64 @write(i32 noundef %89, ptr noundef %90, i64 noundef %92)
  %94 = load i32, ptr %7, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = icmp ne i64 %93, %95
  br i1 %96, label %97, label %98

97:                                               ; preds = %87
  call void @perror(ptr noundef @.str.6)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %136

98:                                               ; preds = %87
  %99 = getelementptr inbounds [2 x i32], ptr %6, i64 0, i64 0
  %100 = load i32, ptr %99, align 4, !tbaa !5
  %101 = load ptr, ptr %8, align 8, !tbaa !9
  %102 = load i32, ptr %7, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = call i64 @read(i32 noundef %100, ptr noundef %101, i64 noundef %103)
  %105 = load i32, ptr %7, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = icmp ne i64 %104, %106
  br i1 %107, label %108, label %109

108:                                              ; preds = %98
  call void @perror(ptr noundef @.str.5)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %136

109:                                              ; preds = %98
  br label %110

110:                                              ; preds = %109
  %111 = load i64, ptr %10, align 8, !tbaa !11
  %112 = add nsw i64 %111, 1
  store i64 %112, ptr %10, align 8, !tbaa !11
  br label %83, !llvm.loop !15

113:                                              ; preds = %83
  %114 = call i32 @clock_gettime(i32 noundef 1, ptr noundef %13) #6
  %115 = icmp eq i32 %114, -1
  br i1 %115, label %116, label %117

116:                                              ; preds = %113
  call void @perror(ptr noundef @.str.7)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %136

117:                                              ; preds = %113
  %118 = getelementptr inbounds %struct.timespec, ptr %13, i32 0, i32 0
  %119 = load i64, ptr %118, align 8, !tbaa !16
  %120 = getelementptr inbounds %struct.timespec, ptr %12, i32 0, i32 0
  %121 = load i64, ptr %120, align 8, !tbaa !16
  %122 = sub nsw i64 %119, %121
  %123 = mul nsw i64 %122, 1000000000
  %124 = getelementptr inbounds %struct.timespec, ptr %13, i32 0, i32 1
  %125 = load i64, ptr %124, align 8, !tbaa !18
  %126 = getelementptr inbounds %struct.timespec, ptr %12, i32 0, i32 1
  %127 = load i64, ptr %126, align 8, !tbaa !18
  %128 = sub nsw i64 %125, %127
  %129 = add nsw i64 %123, %128
  store i64 %129, ptr %11, align 8, !tbaa !11
  %130 = load i64, ptr %11, align 8, !tbaa !11
  %131 = load i64, ptr %9, align 8, !tbaa !11
  %132 = mul nsw i64 %131, 2
  %133 = sdiv i64 %130, %132
  %134 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, i64 noundef %133)
  br label %135

135:                                              ; preds = %117, %77
  store i32 0, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %136

136:                                              ; preds = %135, %116, %108, %97, %81, %72, %61, %42, %33, %17
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  %137 = load i32, ptr %3, align 4
  ret i32 %137
}

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

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

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

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

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

declare void @perror(ptr noundef) #2

; Function Attrs: nounwind
declare i32 @socketpair(i32 noundef, i32 noundef, i32 noundef, ptr noundef) #5

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

declare i64 @read(i32 noundef, ptr noundef, i64 noundef) #2

declare i64 @write(i32 noundef, ptr noundef, i64 noundef) #2

; Function Attrs: nounwind
declare i32 @clock_gettime(i32 noundef, 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 = { "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 = { 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 = { 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 #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }
attributes #8 = { 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 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = !{!17, !12, i64 0}
!17 = !{!"timespec", !12, i64 0, !12, i64 8}
!18 = !{!17, !12, i64 8}


; 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.timespec = type { i64, i64 }

@.str = external hidden unnamed_addr constant [50 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [25 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = alloca [2 x i32], align 4
  %4 = alloca %struct.timespec, align 8
  %5 = alloca %struct.timespec, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #7
  %.not = icmp eq i32 %0, 3
  br i1 %.not, label %8, label %6

6:                                                ; preds = %2
  %7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  br label %.loopexit

8:                                                ; preds = %2
  %9 = getelementptr inbounds i8, ptr %1, i64 8
  %10 = load ptr, ptr %9, align 8, !tbaa !5
  %11 = tail call i32 @atoi(ptr nocapture noundef %10) #8
  %12 = getelementptr inbounds i8, ptr %1, i64 16
  %13 = load ptr, ptr %12, align 8, !tbaa !5
  %14 = tail call i64 @atol(ptr nocapture noundef %13) #8
  %15 = sext i32 %11 to i64
  %16 = tail call noalias ptr @malloc(i64 noundef %15) #9
  %17 = icmp eq ptr %16, null
  br i1 %17, label %18, label %19

18:                                               ; preds = %8
  tail call void @perror(ptr noundef nonnull @.str.1) #10
  br label %.loopexit

19:                                               ; preds = %8
  %20 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %11)
  %21 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %14)
  %22 = call i32 @socketpair(i32 noundef 1, i32 noundef 1, i32 noundef 0, ptr noundef nonnull %3) #7
  %23 = icmp eq i32 %22, -1
  br i1 %23, label %24, label %25

24:                                               ; preds = %19
  call void @perror(ptr noundef nonnull @.str.4) #10
  br label %.loopexit

25:                                               ; preds = %19
  %26 = call i32 @fork() #7
  %.not32 = icmp eq i32 %26, 0
  br i1 %.not32, label %.preheader, label %39

.preheader:                                       ; preds = %25
  %27 = icmp sgt i64 %14, 0
  br i1 %27, label %.lr.ph40, label %.loopexit

.lr.ph40:                                         ; preds = %.preheader
  %28 = getelementptr inbounds i8, ptr %3, i64 4
  br label %31

29:                                               ; preds = %35
  %30 = add nuw nsw i64 %.02739, 1
  %exitcond41.not = icmp eq i64 %30, %14
  br i1 %exitcond41.not, label %.loopexit, label %31, !llvm.loop !9

31:                                               ; preds = %.lr.ph40, %29
  %.02739 = phi i64 [ 0, %.lr.ph40 ], [ %30, %29 ]
  %32 = load i32, ptr %28, align 4, !tbaa !11
  %33 = call i64 @read(i32 noundef %32, ptr noundef nonnull %16, i64 noundef %15) #7
  %.not33 = icmp eq i64 %33, %15
  br i1 %.not33, label %35, label %34

34:                                               ; preds = %31
  call void @perror(ptr noundef nonnull @.str.5) #10
  br label %.loopexit

35:                                               ; preds = %31
  %36 = load i32, ptr %28, align 4, !tbaa !11
  %37 = call i64 @write(i32 noundef %36, ptr noundef nonnull %16, i64 noundef %15) #7
  %.not34 = icmp eq i64 %37, %15
  br i1 %.not34, label %29, label %38

38:                                               ; preds = %35
  call void @perror(ptr noundef nonnull @.str.6) #10
  br label %.loopexit

39:                                               ; preds = %25
  %40 = call i32 @clock_gettime(i32 noundef 1, ptr noundef nonnull %4) #7
  %41 = icmp eq i32 %40, -1
  br i1 %41, label %43, label %.preheader37

.preheader37:                                     ; preds = %39
  %42 = icmp sgt i64 %14, 0
  br i1 %42, label %.lr.ph, label %._crit_edge

43:                                               ; preds = %39
  call void @perror(ptr noundef nonnull @.str.7) #10
  br label %.loopexit

44:                                               ; preds = %49
  %45 = add nuw nsw i64 %.138, 1
  %exitcond.not = icmp eq i64 %45, %14
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !13

.lr.ph:                                           ; preds = %.preheader37, %44
  %.138 = phi i64 [ %45, %44 ], [ 0, %.preheader37 ]
  %46 = load i32, ptr %3, align 4, !tbaa !11
  %47 = call i64 @write(i32 noundef %46, ptr noundef nonnull %16, i64 noundef %15) #7
  %.not35 = icmp eq i64 %47, %15
  br i1 %.not35, label %49, label %48

48:                                               ; preds = %.lr.ph
  call void @perror(ptr noundef nonnull @.str.6) #10
  br label %.loopexit

49:                                               ; preds = %.lr.ph
  %50 = load i32, ptr %3, align 4, !tbaa !11
  %51 = call i64 @read(i32 noundef %50, ptr noundef nonnull %16, i64 noundef %15) #7
  %.not36 = icmp eq i64 %51, %15
  br i1 %.not36, label %44, label %52

52:                                               ; preds = %49
  call void @perror(ptr noundef nonnull @.str.5) #10
  br label %.loopexit

._crit_edge:                                      ; preds = %44, %.preheader37
  %53 = call i32 @clock_gettime(i32 noundef 1, ptr noundef nonnull %5) #7
  %54 = icmp eq i32 %53, -1
  br i1 %54, label %55, label %56

55:                                               ; preds = %._crit_edge
  call void @perror(ptr noundef nonnull @.str.7) #10
  br label %.loopexit

56:                                               ; preds = %._crit_edge
  %57 = load i64, ptr %5, align 8, !tbaa !14
  %58 = load i64, ptr %4, align 8, !tbaa !14
  %59 = sub nsw i64 %57, %58
  %60 = mul nsw i64 %59, 1000000000
  %61 = getelementptr inbounds i8, ptr %5, i64 8
  %62 = load i64, ptr %61, align 8, !tbaa !17
  %63 = getelementptr inbounds i8, ptr %4, i64 8
  %64 = load i64, ptr %63, align 8, !tbaa !17
  %65 = sub i64 %62, %64
  %66 = add nsw i64 %65, %60
  %67 = shl nsw i64 %14, 1
  %68 = sdiv i64 %66, %67
  %69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i64 noundef %68)
  br label %.loopexit

.loopexit:                                        ; preds = %29, %.preheader, %56, %55, %52, %48, %43, %38, %34, %24, %18, %6
  %.0 = phi i32 [ 1, %6 ], [ 1, %18 ], [ 1, %24 ], [ 1, %43 ], [ 1, %48 ], [ 1, %52 ], [ 1, %55 ], [ 1, %34 ], [ 1, %38 ], [ 0, %56 ], [ 0, %.preheader ], [ 0, %29 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare i64 @atol(ptr nocapture noundef nonnull) 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: nofree nounwind
declare void @perror(ptr nocapture noundef readonly) local_unnamed_addr #2

; Function Attrs: nounwind
declare i32 @socketpair(i32 noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #5

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

; Function Attrs: nofree
declare noundef i64 @read(i32 noundef, ptr nocapture noundef, i64 noundef) local_unnamed_addr #6

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

; Function Attrs: nounwind
declare i32 @clock_gettime(i32 noundef, ptr noundef) local_unnamed_addr #5

; 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 = { 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 #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 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 = { 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 #6 = { 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 #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }
attributes #9 = { nounwind allocsize(0) }
attributes #10 = { cold }

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

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


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