; LLVM IR from holzschu/ios_system :: curl/curl/docs/examples (ephiperfifo)

; 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._GlobalInfo = type { i32, i32, i32, ptr, i32, ptr }
%struct.itimerspec = type { %struct.timespec, %struct.timespec }
%struct.timespec = type { i64, i64 }
%struct.epoll_event = type <{ i32, %union.epoll_data }>
%union.epoll_data = type { ptr }

@g_should_exit_ = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [21 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [22 x i8], align 1
@stdout = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [19 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @sigint_handler(i32 noundef) #0

; 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._GlobalInfo, align 8
  %7 = alloca %struct.itimerspec, align 8
  %8 = alloca %struct.epoll_event, align 1
  %9 = alloca [10 x %struct.epoll_event], align 16
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = 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 40, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 120, ptr %9) #7
  %13 = load i32, ptr %4, align 4, !tbaa !5
  %14 = load ptr, ptr %5, align 8, !tbaa !9
  store i32 0, ptr @g_should_exit_, align 4, !tbaa !5
  %15 = call ptr @signal(i32 noundef 2, ptr noundef @sigint_handler) #7
  call void @llvm.memset.p0.i64(ptr align 8 %6, i8 0, i64 40, i1 false)
  %16 = call i32 @epoll_create1(i32 noundef 524288) #7
  %17 = getelementptr inbounds %struct._GlobalInfo, ptr %6, i32 0, i32 0
  store i32 %16, ptr %17, align 8, !tbaa !11
  %18 = getelementptr inbounds %struct._GlobalInfo, ptr %6, i32 0, i32 0
  %19 = load i32, ptr %18, align 8, !tbaa !11
  %20 = icmp eq i32 %19, -1
  br i1 %20, label %21, label %22

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

22:                                               ; preds = %2
  %23 = call i32 @timerfd_create(i32 noundef 1, i32 noundef 526336) #7
  %24 = getelementptr inbounds %struct._GlobalInfo, ptr %6, i32 0, i32 1
  store i32 %23, ptr %24, align 4, !tbaa !13
  %25 = getelementptr inbounds %struct._GlobalInfo, ptr %6, i32 0, i32 1
  %26 = load i32, ptr %25, align 4, !tbaa !13
  %27 = icmp eq i32 %26, -1
  br i1 %27, label %28, label %29

28:                                               ; preds = %22
  call void @perror(ptr noundef @.str.1)
  call void @exit(i32 noundef 1) #8
  unreachable

29:                                               ; preds = %22
  call void @llvm.memset.p0.i64(ptr align 8 %7, i8 0, i64 32, i1 false)
  %30 = getelementptr inbounds %struct.itimerspec, ptr %7, i32 0, i32 0
  %31 = getelementptr inbounds %struct.timespec, ptr %30, i32 0, i32 0
  store i64 0, ptr %31, align 8, !tbaa !14
  %32 = getelementptr inbounds %struct.itimerspec, ptr %7, i32 0, i32 1
  %33 = getelementptr inbounds %struct.timespec, ptr %32, i32 0, i32 0
  store i64 1, ptr %33, align 8, !tbaa !18
  %34 = getelementptr inbounds %struct._GlobalInfo, ptr %6, i32 0, i32 1
  %35 = load i32, ptr %34, align 4, !tbaa !13
  %36 = call i32 @timerfd_settime(i32 noundef %35, i32 noundef 0, ptr noundef %7, ptr noundef null) #7
  %37 = getelementptr inbounds %struct.epoll_event, ptr %8, i32 0, i32 0
  store i32 1, ptr %37, align 1, !tbaa !19
  %38 = getelementptr inbounds %struct._GlobalInfo, ptr %6, i32 0, i32 1
  %39 = load i32, ptr %38, align 4, !tbaa !13
  %40 = getelementptr inbounds %struct.epoll_event, ptr %8, i32 0, i32 1
  store i32 %39, ptr %40, align 1, !tbaa !21
  %41 = getelementptr inbounds %struct._GlobalInfo, ptr %6, i32 0, i32 0
  %42 = load i32, ptr %41, align 8, !tbaa !11
  %43 = getelementptr inbounds %struct._GlobalInfo, ptr %6, i32 0, i32 1
  %44 = load i32, ptr %43, align 4, !tbaa !13
  %45 = call i32 @epoll_ctl(i32 noundef %42, i32 noundef 1, i32 noundef %44, ptr noundef %8) #7
  %46 = call i32 @init_fifo(ptr noundef %6)
  %47 = call ptr @curl_multi_init()
  %48 = getelementptr inbounds %struct._GlobalInfo, ptr %6, i32 0, i32 3
  store ptr %47, ptr %48, align 8, !tbaa !22
  %49 = getelementptr inbounds %struct._GlobalInfo, ptr %6, i32 0, i32 3
  %50 = load ptr, ptr %49, align 8, !tbaa !22
  %51 = call i32 (ptr, i32, ...) @curl_multi_setopt(ptr noundef %50, i32 noundef 20001, ptr noundef @sock_cb)
  %52 = getelementptr inbounds %struct._GlobalInfo, ptr %6, i32 0, i32 3
  %53 = load ptr, ptr %52, align 8, !tbaa !22
  %54 = call i32 (ptr, i32, ...) @curl_multi_setopt(ptr noundef %53, i32 noundef 10002, ptr noundef %6)
  %55 = getelementptr inbounds %struct._GlobalInfo, ptr %6, i32 0, i32 3
  %56 = load ptr, ptr %55, align 8, !tbaa !22
  %57 = call i32 (ptr, i32, ...) @curl_multi_setopt(ptr noundef %56, i32 noundef 20004, ptr noundef @multi_timer_cb)
  %58 = getelementptr inbounds %struct._GlobalInfo, ptr %6, i32 0, i32 3
  %59 = load ptr, ptr %58, align 8, !tbaa !22
  %60 = call i32 (ptr, i32, ...) @curl_multi_setopt(ptr noundef %59, i32 noundef 10005, ptr noundef %6)
  %61 = load ptr, ptr @stdout, align 8, !tbaa !9
  %62 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %61, ptr noundef @.str.2) #7
  %63 = load ptr, ptr @stdout, align 8, !tbaa !9
  %64 = call i32 @fflush(ptr noundef %63)
  br label %65

65:                                               ; preds = %138, %136, %29
  %66 = load i32, ptr @g_should_exit_, align 4, !tbaa !5
  %67 = icmp ne i32 %66, 0
  %68 = xor i1 %67, true
  br i1 %68, label %69, label %139

69:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %70 = getelementptr inbounds %struct._GlobalInfo, ptr %6, i32 0, i32 0
  %71 = load i32, ptr %70, align 8, !tbaa !11
  %72 = getelementptr inbounds [10 x %struct.epoll_event], ptr %9, i64 0, i64 0
  %73 = call i32 @epoll_wait(i32 noundef %71, ptr noundef %72, i32 noundef 10, i32 noundef 10000)
  store i32 %73, ptr %11, align 4, !tbaa !5
  %74 = load i32, ptr %11, align 4, !tbaa !5
  %75 = icmp eq i32 %74, -1
  br i1 %75, label %76, label %84

76:                                               ; preds = %69
  %77 = call ptr @__errno_location() #9
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = icmp eq i32 %78, 4
  br i1 %79, label %80, label %83

80:                                               ; preds = %76
  %81 = load ptr, ptr @stdout, align 8, !tbaa !9
  %82 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %81, ptr noundef @.str.3) #7
  store i32 2, ptr %12, align 4
  br label %136, !llvm.loop !23

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

84:                                               ; preds = %69
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %85

85:                                               ; preds = %132, %84
  %86 = load i32, ptr %10, align 4, !tbaa !5
  %87 = load i32, ptr %11, align 4, !tbaa !5
  %88 = icmp slt i32 %86, %87
  br i1 %88, label %89, label %135

89:                                               ; preds = %85
  %90 = load i32, ptr %10, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [10 x %struct.epoll_event], ptr %9, i64 0, i64 %91
  %93 = getelementptr inbounds %struct.epoll_event, ptr %92, i32 0, i32 1
  %94 = load i32, ptr %93, align 4, !tbaa !21
  %95 = getelementptr inbounds %struct._GlobalInfo, ptr %6, i32 0, i32 2
  %96 = load i32, ptr %95, align 8, !tbaa !25
  %97 = icmp eq i32 %94, %96
  br i1 %97, label %98, label %104

98:                                               ; preds = %89
  %99 = load i32, ptr %10, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [10 x %struct.epoll_event], ptr %9, i64 0, i64 %100
  %102 = getelementptr inbounds %struct.epoll_event, ptr %101, i32 0, i32 0
  %103 = load i32, ptr %102, align 4, !tbaa !19
  call void @fifo_cb(ptr noundef %6, i32 noundef %103)
  br label %131

104:                                              ; preds = %89
  %105 = load i32, ptr %10, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [10 x %struct.epoll_event], ptr %9, i64 0, i64 %106
  %108 = getelementptr inbounds %struct.epoll_event, ptr %107, i32 0, i32 1
  %109 = load i32, ptr %108, align 4, !tbaa !21
  %110 = getelementptr inbounds %struct._GlobalInfo, ptr %6, i32 0, i32 1
  %111 = load i32, ptr %110, align 4, !tbaa !13
  %112 = icmp eq i32 %109, %111
  br i1 %112, label %113, label %119

113:                                              ; preds = %104
  %114 = load i32, ptr %10, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [10 x %struct.epoll_event], ptr %9, i64 0, i64 %115
  %117 = getelementptr inbounds %struct.epoll_event, ptr %116, i32 0, i32 0
  %118 = load i32, ptr %117, align 4, !tbaa !19
  call void @timer_cb(ptr noundef %6, i32 noundef %118)
  br label %130

119:                                              ; preds = %104
  %120 = load i32, ptr %10, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [10 x %struct.epoll_event], ptr %9, i64 0, i64 %121
  %123 = getelementptr inbounds %struct.epoll_event, ptr %122, i32 0, i32 1
  %124 = load i32, ptr %123, align 4, !tbaa !21
  %125 = load i32, ptr %10, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [10 x %struct.epoll_event], ptr %9, i64 0, i64 %126
  %128 = getelementptr inbounds %struct.epoll_event, ptr %127, i32 0, i32 0
  %129 = load i32, ptr %128, align 4, !tbaa !19
  call void @event_cb(ptr noundef %6, i32 noundef %124, i32 noundef %129)
  br label %130

130:                                              ; preds = %119, %113
  br label %131

131:                                              ; preds = %130, %98
  br label %132

132:                                              ; preds = %131
  %133 = load i32, ptr %10, align 4, !tbaa !5
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %10, align 4, !tbaa !5
  br label %85, !llvm.loop !26

135:                                              ; preds = %85
  store i32 0, ptr %12, align 4
  br label %136

136:                                              ; preds = %135, %80
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  %137 = load i32, ptr %12, align 4
  switch i32 %137, label %148 [
    i32 0, label %138
    i32 2, label %65
  ]

138:                                              ; preds = %136
  br label %65, !llvm.loop !23

139:                                              ; preds = %65
  %140 = load ptr, ptr @stdout, align 8, !tbaa !9
  %141 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %140, ptr noundef @.str.5) #7
  %142 = load ptr, ptr @stdout, align 8, !tbaa !9
  %143 = call i32 @fflush(ptr noundef %142)
  %144 = getelementptr inbounds %struct._GlobalInfo, ptr %6, i32 0, i32 3
  %145 = load ptr, ptr %144, align 8, !tbaa !22
  %146 = call i32 @curl_multi_cleanup(ptr noundef %145)
  call void @clean_fifo(ptr noundef %6)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 120, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr %6) #7
  %147 = load i32, ptr %3, align 4
  ret i32 %147

148:                                              ; preds = %136
  unreachable
}

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

; Function Attrs: nounwind
declare i32 @epoll_create1(i32 noundef) #2

declare void @perror(ptr noundef) #4

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

; Function Attrs: nounwind
declare i32 @timerfd_create(i32 noundef, i32 noundef) #2

; Function Attrs: nounwind
declare i32 @timerfd_settime(i32 noundef, i32 noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind
declare i32 @epoll_ctl(i32 noundef, i32 noundef, i32 noundef, ptr noundef) #2

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

declare ptr @curl_multi_init() #4

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

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

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

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

declare i32 @fflush(ptr noundef) #4

declare i32 @epoll_wait(i32 noundef, ptr noundef, i32 noundef, i32 noundef) #4

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__errno_location() #6

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

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

; Function Attrs: nounwind uwtable
declare hidden void @event_cb(ptr noundef, i32 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

declare i32 @curl_multi_cleanup(ptr noundef) #4

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

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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { 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 #6 = { nounwind willreturn memory(none) "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 }
attributes #9 = { nounwind willreturn memory(none) }

!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, !6, i64 0}
!12 = !{!"_GlobalInfo", !6, i64 0, !6, i64 4, !6, i64 8, !10, i64 16, !6, i64 24, !10, i64 32}
!13 = !{!12, !6, i64 4}
!14 = !{!15, !17, i64 0}
!15 = !{!"itimerspec", !16, i64 0, !16, i64 16}
!16 = !{!"timespec", !17, i64 0, !17, i64 8}
!17 = !{!"long", !7, i64 0}
!18 = !{!15, !17, i64 16}
!19 = !{!20, !6, i64 0}
!20 = !{!"epoll_event", !6, i64 0, !7, i64 4}
!21 = !{!7, !7, i64 0}
!22 = !{!12, !10, i64 16}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!12, !6, i64 8}
!26 = distinct !{!26, !24}


; 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._GlobalInfo = type { i32, i32, i32, ptr, i32, ptr }
%struct.itimerspec = type { %struct.timespec, %struct.timespec }
%struct.timespec = type { i64, i64 }
%struct.epoll_event = type <{ i32, %union.epoll_data }>
%union.epoll_data = type { ptr }

@g_should_exit_ = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [21 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [22 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [19 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @sigint_handler(i32 noundef) #0

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #0 {
  %3 = alloca %struct._GlobalInfo, align 8
  %4 = alloca %struct.itimerspec, align 8
  %5 = alloca %struct.epoll_event, align 4
  %6 = alloca [10 x %struct.epoll_event], align 16
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %3) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #8
  call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %6) #8
  store i32 0, ptr @g_should_exit_, align 4, !tbaa !5
  %7 = tail call ptr @signal(i32 noundef 2, ptr noundef nonnull @sigint_handler) #8
  %8 = getelementptr inbounds i8, ptr %3, i64 8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %8, i8 0, i64 32, i1 false)
  %9 = tail call i32 @epoll_create1(i32 noundef 524288) #8
  store i32 %9, ptr %3, align 8, !tbaa !9
  %10 = icmp eq i32 %9, -1
  br i1 %10, label %11, label %12

11:                                               ; preds = %2
  tail call void @perror(ptr noundef nonnull @.str) #9
  tail call void @exit(i32 noundef 1) #10
  unreachable

12:                                               ; preds = %2
  %13 = tail call i32 @timerfd_create(i32 noundef 1, i32 noundef 526336) #8
  %14 = getelementptr inbounds i8, ptr %3, i64 4
  store i32 %13, ptr %14, align 4, !tbaa !12
  %15 = icmp eq i32 %13, -1
  br i1 %15, label %16, label %17

16:                                               ; preds = %12
  tail call void @perror(ptr noundef nonnull @.str.1) #9
  tail call void @exit(i32 noundef 1) #10
  unreachable

17:                                               ; preds = %12
  %18 = getelementptr inbounds i8, ptr %4, i64 16
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %4, i8 0, i64 32, i1 false)
  store i64 1, ptr %18, align 8, !tbaa !13
  %19 = call i32 @timerfd_settime(i32 noundef %13, i32 noundef 0, ptr noundef nonnull %4, ptr noundef null) #8
  store i32 1, ptr %5, align 4, !tbaa !17
  %20 = getelementptr inbounds i8, ptr %5, i64 4
  store i32 %13, ptr %20, align 4, !tbaa !19
  %21 = call i32 @epoll_ctl(i32 noundef %9, i32 noundef 1, i32 noundef %13, ptr noundef nonnull %5) #8
  %22 = call i32 @init_fifo(ptr noundef nonnull %3)
  %23 = call ptr @curl_multi_init() #8
  %24 = getelementptr inbounds i8, ptr %3, i64 16
  store ptr %23, ptr %24, align 8, !tbaa !20
  %25 = call i32 (ptr, i32, ...) @curl_multi_setopt(ptr noundef %23, i32 noundef 20001, ptr noundef nonnull @sock_cb) #8
  %26 = load ptr, ptr %24, align 8, !tbaa !20
  %27 = call i32 (ptr, i32, ...) @curl_multi_setopt(ptr noundef %26, i32 noundef 10002, ptr noundef nonnull %3) #8
  %28 = load ptr, ptr %24, align 8, !tbaa !20
  %29 = call i32 (ptr, i32, ...) @curl_multi_setopt(ptr noundef %28, i32 noundef 20004, ptr noundef nonnull @multi_timer_cb) #8
  %30 = load ptr, ptr %24, align 8, !tbaa !20
  %31 = call i32 (ptr, i32, ...) @curl_multi_setopt(ptr noundef %30, i32 noundef 10005, ptr noundef nonnull %3) #8
  %32 = load ptr, ptr @stdout, align 8, !tbaa !21
  %33 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %32, ptr noundef nonnull @.str.2) #8
  %34 = load ptr, ptr @stdout, align 8, !tbaa !21
  %35 = call i32 @fflush(ptr noundef %34)
  %36 = load i32, ptr @g_should_exit_, align 4, !tbaa !5
  %.not15 = icmp eq i32 %36, 0
  br i1 %.not15, label %.lr.ph16, label %._crit_edge

.lr.ph16:                                         ; preds = %17
  %37 = getelementptr inbounds i8, ptr %3, i64 8
  br label %38

38:                                               ; preds = %.lr.ph16, %.loopexit
  %39 = load i32, ptr %3, align 8, !tbaa !9
  %40 = call i32 @epoll_wait(i32 noundef %39, ptr noundef nonnull %6, i32 noundef 10, i32 noundef 10000) #8
  %41 = icmp eq i32 %40, -1
  br i1 %41, label %43, label %.preheader

.preheader:                                       ; preds = %38
  %42 = icmp sgt i32 %40, 0
  br i1 %42, label %.lr.ph.preheader, label %.loopexit

.lr.ph.preheader:                                 ; preds = %.preheader
  %wide.trip.count = zext nneg i32 %40 to i64
  br label %.lr.ph

43:                                               ; preds = %38
  %44 = tail call ptr @__errno_location() #11
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = icmp eq i32 %45, 4
  br i1 %46, label %47, label %50

47:                                               ; preds = %43
  %48 = load ptr, ptr @stdout, align 8, !tbaa !21
  %49 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %48, ptr noundef nonnull @.str.3) #8
  br label %.loopexit, !llvm.loop !22

50:                                               ; preds = %43
  call void @perror(ptr noundef nonnull @.str.4) #9
  call void @exit(i32 noundef 1) #10
  unreachable

.lr.ph:                                           ; preds = %.lr.ph.preheader, %64
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %64 ]
  %51 = getelementptr inbounds [10 x %struct.epoll_event], ptr %6, i64 0, i64 %indvars.iv
  %52 = getelementptr inbounds i8, ptr %51, i64 4
  %53 = load i32, ptr %52, align 4, !tbaa !19
  %54 = load i32, ptr %37, align 8, !tbaa !24
  %55 = icmp eq i32 %53, %54
  br i1 %55, label %56, label %58

56:                                               ; preds = %.lr.ph
  %57 = load i32, ptr %51, align 4, !tbaa !17
  call void @fifo_cb(ptr noundef nonnull %3, i32 noundef %57)
  br label %64

58:                                               ; preds = %.lr.ph
  %59 = load i32, ptr %14, align 4, !tbaa !12
  %60 = icmp eq i32 %53, %59
  %61 = load i32, ptr %51, align 4, !tbaa !17
  br i1 %60, label %62, label %63

62:                                               ; preds = %58
  call void @timer_cb(ptr noundef nonnull %3, i32 noundef %61)
  br label %64

63:                                               ; preds = %58
  call void @event_cb(ptr noundef nonnull %3, i32 noundef %53, i32 noundef %61)
  br label %64

64:                                               ; preds = %56, %63, %62
  %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 %.loopexit, label %.lr.ph, !llvm.loop !25

.loopexit:                                        ; preds = %64, %.preheader, %47
  %65 = load i32, ptr @g_should_exit_, align 4, !tbaa !5
  %.not = icmp eq i32 %65, 0
  br i1 %.not, label %38, label %._crit_edge

._crit_edge:                                      ; preds = %.loopexit, %17
  %66 = load ptr, ptr @stdout, align 8, !tbaa !21
  %67 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %66, ptr noundef nonnull @.str.5) #8
  %68 = load ptr, ptr @stdout, align 8, !tbaa !21
  %69 = call i32 @fflush(ptr noundef %68)
  %70 = load ptr, ptr %24, align 8, !tbaa !20
  %71 = call i32 @curl_multi_cleanup(ptr noundef %70) #8
  call void @clean_fifo(ptr noundef nonnull %3)
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %3) #8
  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 ptr @signal(i32 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

; Function Attrs: nounwind
declare i32 @epoll_create1(i32 noundef) local_unnamed_addr #2

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

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

; Function Attrs: nounwind
declare i32 @timerfd_create(i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind
declare i32 @timerfd_settime(i32 noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind
declare i32 @epoll_ctl(i32 noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

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

declare ptr @curl_multi_init() local_unnamed_addr #6

declare i32 @curl_multi_setopt(ptr noundef, i32 noundef, ...) local_unnamed_addr #6

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

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

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

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

declare i32 @epoll_wait(i32 noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #6

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__errno_location() local_unnamed_addr #7

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

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

; Function Attrs: nounwind uwtable
declare hidden void @event_cb(ptr noundef, i32 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

declare i32 @curl_multi_cleanup(ptr noundef) local_unnamed_addr #6

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

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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 "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 = { "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 = { mustprogress nofree nosync nounwind willreturn memory(none) "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 = { cold }
attributes #10 = { noreturn nounwind }
attributes #11 = { nounwind willreturn memory(none) }

!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, !6, i64 0}
!10 = !{!"_GlobalInfo", !6, i64 0, !6, i64 4, !6, i64 8, !11, i64 16, !6, i64 24, !11, i64 32}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!10, !6, i64 4}
!13 = !{!14, !16, i64 16}
!14 = !{!"itimerspec", !15, i64 0, !15, i64 16}
!15 = !{!"timespec", !16, i64 0, !16, i64 8}
!16 = !{!"long", !7, i64 0}
!17 = !{!18, !6, i64 0}
!18 = !{!"epoll_event", !6, i64 0, !7, i64 4}
!19 = !{!7, !7, i64 0}
!20 = !{!10, !11, i64 16}
!21 = !{!11, !11, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!10, !6, i64 8}
!25 = distinct !{!25, !23}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass