; LLVM IR from golems/ach :: src (ach-poll-example)

; 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.ach_channel = type { %union.anon }
%union.anon = type { [16 x i64] }
%struct.pollfd = type { i32, i16, i16 }

@__const.main.names = external hidden unnamed_addr constant [2 x ptr], align 16
@stderr = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [34 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 ptr], align 16
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca [512 x i8], align 16
  %13 = alloca i64, align 8
  %14 = alloca i32, align 4
  %15 = alloca i64, 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
  %16 = load i32, ptr %4, align 4, !tbaa !5
  %17 = load ptr, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %6, ptr align 16 @__const.main.names, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  store i64 2, ptr %7, align 8, !tbaa !11
  %18 = call ptr @llvm.stacksave.p0()
  store ptr %18, ptr %8, align 8
  %19 = alloca %struct.ach_channel, i64 2, align 16
  %20 = alloca %struct.pollfd, i64 2, align 16
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  store i64 0, ptr %9, align 8, !tbaa !11
  br label %21

21:                                               ; preds = %62, %2
  %22 = load i64, ptr %9, align 8, !tbaa !11
  %23 = icmp ult i64 %22, 2
  br i1 %23, label %24, label %65

24:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %25 = load i64, ptr %9, align 8, !tbaa !11
  %26 = getelementptr inbounds %struct.ach_channel, ptr %19, i64 %25
  %27 = load i64, ptr %9, align 8, !tbaa !11
  %28 = getelementptr inbounds [2 x ptr], ptr %6, i64 0, i64 %27
  %29 = load ptr, ptr %28, align 8, !tbaa !9
  %30 = call i32 @ach_open(ptr noundef %26, ptr noundef %29, ptr noundef null)
  store i32 %30, ptr %10, align 4, !tbaa !5
  %31 = load i32, ptr %10, align 4, !tbaa !5
  %32 = icmp ne i32 0, %31
  br i1 %32, label %33, label %41

33:                                               ; preds = %24
  %34 = load ptr, ptr @stderr, align 8, !tbaa !9
  %35 = load i64, ptr %9, align 8, !tbaa !11
  %36 = getelementptr inbounds [2 x ptr], ptr %6, i64 0, i64 %35
  %37 = load ptr, ptr %36, align 8, !tbaa !9
  %38 = load i32, ptr %10, align 4, !tbaa !5
  %39 = call ptr @ach_result_to_string(i32 noundef %38)
  %40 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %34, ptr noundef @.str.2, ptr noundef %37, ptr noundef %39) #7
  call void @exit(i32 noundef 1) #8
  unreachable

41:                                               ; preds = %24
  %42 = load i64, ptr %9, align 8, !tbaa !11
  %43 = getelementptr inbounds %struct.ach_channel, ptr %19, i64 %42
  %44 = load i64, ptr %9, align 8, !tbaa !11
  %45 = getelementptr inbounds %struct.pollfd, ptr %20, i64 %44
  %46 = getelementptr inbounds %struct.pollfd, ptr %45, i32 0, i32 0
  %47 = call i32 @ach_channel_fd(ptr noundef %43, ptr noundef %46)
  store i32 %47, ptr %10, align 4, !tbaa !5
  %48 = load i32, ptr %10, align 4, !tbaa !5
  %49 = icmp ne i32 0, %48
  br i1 %49, label %50, label %58

50:                                               ; preds = %41
  %51 = load ptr, ptr @stderr, align 8, !tbaa !9
  %52 = load i64, ptr %9, align 8, !tbaa !11
  %53 = getelementptr inbounds [2 x ptr], ptr %6, i64 0, i64 %52
  %54 = load ptr, ptr %53, align 8, !tbaa !9
  %55 = load i32, ptr %10, align 4, !tbaa !5
  %56 = call ptr @ach_result_to_string(i32 noundef %55)
  %57 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %51, ptr noundef @.str.3, ptr noundef %54, ptr noundef %56) #7
  call void @exit(i32 noundef 1) #8
  unreachable

58:                                               ; preds = %41
  %59 = load i64, ptr %9, align 8, !tbaa !11
  %60 = getelementptr inbounds %struct.pollfd, ptr %20, i64 %59
  %61 = getelementptr inbounds %struct.pollfd, ptr %60, i32 0, i32 1
  store i16 1, ptr %61, align 4, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %62

62:                                               ; preds = %58
  %63 = load i64, ptr %9, align 8, !tbaa !11
  %64 = add i64 %63, 1
  store i64 %64, ptr %9, align 8, !tbaa !11
  br label %21, !llvm.loop !16

65:                                               ; preds = %21
  br label %66

66:                                               ; preds = %117, %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %67 = call i32 @poll(ptr noundef %20, i64 noundef 2, i32 noundef -1)
  store i32 %67, ptr %11, align 4, !tbaa !5
  %68 = load i32, ptr %11, align 4, !tbaa !5
  %69 = icmp slt i32 %68, 0
  br i1 %69, label %70, label %71

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

71:                                               ; preds = %66
  store i64 0, ptr %9, align 8, !tbaa !11
  br label %72

72:                                               ; preds = %114, %71
  %73 = load i64, ptr %9, align 8, !tbaa !11
  %74 = icmp ult i64 %73, 2
  br i1 %74, label %75, label %78

75:                                               ; preds = %72
  %76 = load i32, ptr %11, align 4, !tbaa !5
  %77 = icmp sgt i32 %76, 0
  br label %78

78:                                               ; preds = %75, %72
  %79 = phi i1 [ false, %72 ], [ %77, %75 ]
  br i1 %79, label %80, label %117

80:                                               ; preds = %78
  %81 = load i64, ptr %9, align 8, !tbaa !11
  %82 = getelementptr inbounds %struct.pollfd, ptr %20, i64 %81
  %83 = getelementptr inbounds %struct.pollfd, ptr %82, i32 0, i32 2
  %84 = load i16, ptr %83, align 2, !tbaa !18
  %85 = sext i16 %84 to i32
  %86 = and i32 %85, 1
  %87 = icmp ne i32 %86, 0
  br i1 %87, label %88, label %113

88:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 512, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %89 = load i64, ptr %9, align 8, !tbaa !11
  %90 = getelementptr inbounds %struct.ach_channel, ptr %19, i64 %89
  %91 = getelementptr inbounds [512 x i8], ptr %12, i64 0, i64 0
  %92 = call i32 @ach_get(ptr noundef %90, ptr noundef %91, i64 noundef 512, ptr noundef %13, ptr noundef null, i32 noundef 0)
  store i32 %92, ptr %14, align 4, !tbaa !5
  %93 = load i32, ptr %14, align 4, !tbaa !5
  switch i32 %93, label %102 [
    i32 0, label %94
    i32 6, label %94
  ]

94:                                               ; preds = %88, %88
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %95 = getelementptr inbounds [512 x i8], ptr %12, i64 0, i64 0
  %96 = load i64, ptr %13, align 8, !tbaa !11
  %97 = call i64 @write(i32 noundef 1, ptr noundef %95, i64 noundef %96)
  store i64 %97, ptr %15, align 8, !tbaa !11
  %98 = load i64, ptr %15, align 8, !tbaa !11
  %99 = icmp slt i64 %98, 0
  br i1 %99, label %100, label %101

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

101:                                              ; preds = %94
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %110

102:                                              ; preds = %88
  %103 = load ptr, ptr @stderr, align 8, !tbaa !9
  %104 = load i64, ptr %9, align 8, !tbaa !11
  %105 = getelementptr inbounds [2 x ptr], ptr %6, i64 0, i64 %104
  %106 = load ptr, ptr %105, align 8, !tbaa !9
  %107 = load i32, ptr %14, align 4, !tbaa !5
  %108 = call ptr @ach_result_to_string(i32 noundef %107)
  %109 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %103, ptr noundef @.str.6, ptr noundef %106, ptr noundef %108) #7
  call void @exit(i32 noundef 1) #8
  unreachable

110:                                              ; preds = %101
  %111 = load i32, ptr %11, align 4, !tbaa !5
  %112 = add nsw i32 %111, -1
  store i32 %112, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 512, ptr %12) #7
  br label %113

113:                                              ; preds = %110, %80
  br label %114

114:                                              ; preds = %113
  %115 = load i64, ptr %9, align 8, !tbaa !11
  %116 = add i64 %115, 1
  store i64 %116, ptr %9, align 8, !tbaa !11
  br label %72, !llvm.loop !19

117:                                              ; preds = %78
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %66
}

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3

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

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

declare ptr @ach_result_to_string(i32 noundef) #4

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

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

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

declare i32 @poll(ptr noundef, i64 noundef, i32 noundef) #4

declare void @perror(ptr noundef) #4

declare i32 @ach_get(ptr noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef, i32 noundef) #4

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

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nosync nounwind willreturn }
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 = { 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 = { 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !15, i64 4}
!14 = !{!"pollfd", !6, i64 0, !15, i64 4, !15, i64 6}
!15 = !{!"short", !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!14, !15, i64 6}
!19 = distinct !{!19, !17}


; 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.ach_channel = type { %union.anon }
%union.anon = type { [16 x i64] }
%struct.pollfd = type { i32, i16, i16 }

@__const.main.names = external hidden unnamed_addr constant [2 x ptr], align 16
@stderr = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [34 x i8], align 1

; Function Attrs: noreturn nounwind uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #0 {
  %3 = alloca [512 x i8], align 16
  %4 = alloca i64, align 8
  %5 = alloca [2 x %struct.ach_channel], align 16
  %6 = alloca [2 x %struct.pollfd], align 16
  %7 = load ptr, ptr @__const.main.names, align 16, !tbaa !5
  %8 = call i32 @ach_open(ptr noundef nonnull %5, ptr noundef %7, ptr noundef null) #6
  %.not30 = icmp eq i32 %8, 0
  br i1 %.not30, label %13, label %9

9:                                                ; preds = %19, %2
  %.lcssa51 = phi ptr [ %7, %2 ], [ %22, %19 ]
  %.lcssa48 = phi i32 [ %8, %2 ], [ %23, %19 ]
  %10 = load ptr, ptr @stderr, align 8, !tbaa !5
  %11 = call ptr @ach_result_to_string(i32 noundef %.lcssa48) #6
  %12 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.2, ptr noundef %.lcssa51, ptr noundef %11) #7
  call void @exit(i32 noundef 1) #8
  unreachable

13:                                               ; preds = %2
  %14 = call i32 @ach_channel_fd(ptr noundef nonnull %5, ptr noundef nonnull %6) #6
  %.not31 = icmp eq i32 %14, 0
  br i1 %.not31, label %19, label %15

15:                                               ; preds = %24, %13
  %.lcssa54 = phi i32 [ %14, %13 ], [ %26, %24 ]
  %.lcssa52 = phi ptr [ %7, %13 ], [ %22, %24 ]
  %16 = load ptr, ptr @stderr, align 8, !tbaa !5
  %17 = call ptr @ach_result_to_string(i32 noundef %.lcssa54) #6
  %18 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %16, ptr noundef nonnull @.str.3, ptr noundef %.lcssa52, ptr noundef %17) #7
  call void @exit(i32 noundef 1) #8
  unreachable

19:                                               ; preds = %13
  %20 = getelementptr inbounds i8, ptr %6, i64 4
  store i16 1, ptr %20, align 4, !tbaa !9
  %21 = getelementptr inbounds i8, ptr %5, i64 128
  %22 = load ptr, ptr getelementptr inbounds (i8, ptr @__const.main.names, i64 8), align 8, !tbaa !5
  %23 = call i32 @ach_open(ptr noundef nonnull %21, ptr noundef %22, ptr noundef null) #6
  %.not30.1 = icmp eq i32 %23, 0
  br i1 %.not30.1, label %24, label %9

24:                                               ; preds = %19
  %25 = getelementptr inbounds i8, ptr %6, i64 8
  %26 = call i32 @ach_channel_fd(ptr noundef nonnull %21, ptr noundef nonnull %25) #6
  %.not31.1 = icmp eq i32 %26, 0
  br i1 %.not31.1, label %.preheader32, label %15

.preheader32:                                     ; preds = %24
  %27 = getelementptr inbounds i8, ptr %6, i64 12
  store i16 1, ptr %27, align 4, !tbaa !9
  %28 = call i32 @poll(ptr noundef nonnull %6, i64 noundef 2, i32 noundef -1) #6
  %29 = icmp slt i32 %28, 0
  br i1 %29, label %._crit_edge, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.preheader32
  %30 = getelementptr inbounds i8, ptr %6, i64 6
  %31 = getelementptr inbounds i8, ptr %6, i64 14
  %32 = getelementptr inbounds i8, ptr %5, i64 128
  br label %.preheader

.loopexit:                                        ; preds = %56, %.lr.ph, %46, %.preheader
  %33 = call i32 @poll(ptr noundef nonnull %6, i64 noundef 2, i32 noundef -1) #6
  %34 = icmp slt i32 %33, 0
  br i1 %34, label %._crit_edge, label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %.loopexit
  %35 = phi i32 [ %33, %.loopexit ], [ %28, %.preheader.preheader ]
  %.not44 = icmp eq i32 %35, 0
  br i1 %.not44, label %.loopexit, label %.lr.ph.peel

.lr.ph.peel:                                      ; preds = %.preheader
  %36 = load i16, ptr %30, align 2, !tbaa !13
  %37 = and i16 %36, 1
  %.not.peel = icmp eq i16 %37, 0
  br i1 %.not.peel, label %46, label %38

38:                                               ; preds = %.lr.ph.peel
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %39 = call i32 @ach_get(ptr noundef nonnull %5, ptr noundef nonnull %3, i64 noundef 512, ptr noundef nonnull %4, ptr noundef null, i32 noundef 0) #6
  switch i32 %39, label %.loopexit66 [
    i32 0, label %40
    i32 6, label %40
  ]

40:                                               ; preds = %38, %38
  %41 = load i64, ptr %4, align 8, !tbaa !14
  %42 = call i64 @write(i32 noundef 1, ptr noundef nonnull %3, i64 noundef %41) #6
  %43 = icmp slt i64 %42, 0
  br i1 %43, label %.loopexit67, label %44

44:                                               ; preds = %40
  %45 = add nsw i32 %35, -1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %3) #6
  br label %46

46:                                               ; preds = %44, %.lr.ph.peel
  %.126.peel = phi i32 [ %45, %44 ], [ %35, %.lr.ph.peel ]
  %47 = icmp sgt i32 %.126.peel, 0
  br i1 %47, label %.lr.ph, label %.loopexit

._crit_edge:                                      ; preds = %.loopexit, %.preheader32
  call void @perror(ptr noundef nonnull @.str.4) #9
  call void @exit(i32 noundef 1) #8
  unreachable

.lr.ph:                                           ; preds = %46
  %48 = load i16, ptr %31, align 2, !tbaa !13
  %49 = and i16 %48, 1
  %.not = icmp eq i16 %49, 0
  br i1 %.not, label %.loopexit, label %50

50:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %51 = call i32 @ach_get(ptr noundef nonnull %32, ptr noundef nonnull %3, i64 noundef 512, ptr noundef nonnull %4, ptr noundef null, i32 noundef 0) #6
  switch i32 %51, label %.loopexit66 [
    i32 0, label %52
    i32 6, label %52
  ]

52:                                               ; preds = %50, %50
  %53 = load i64, ptr %4, align 8, !tbaa !14
  %54 = call i64 @write(i32 noundef 1, ptr noundef nonnull %3, i64 noundef %53) #6
  %55 = icmp slt i64 %54, 0
  br i1 %55, label %.loopexit67, label %56

.loopexit67:                                      ; preds = %40, %52
  call void @perror(ptr noundef nonnull @.str.5) #9
  call void @exit(i32 noundef 1) #8
  unreachable

56:                                               ; preds = %52
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %3) #6
  br label %.loopexit

.loopexit66:                                      ; preds = %38, %50
  %.143.lcssa = phi i64 [ 1, %50 ], [ 0, %38 ]
  %.lcssa = phi i32 [ %51, %50 ], [ %39, %38 ]
  %57 = load ptr, ptr @stderr, align 8, !tbaa !5
  %58 = getelementptr inbounds [2 x ptr], ptr @__const.main.names, i64 0, i64 %.143.lcssa
  %59 = load ptr, ptr %58, align 8, !tbaa !5
  %60 = call ptr @ach_result_to_string(i32 noundef %.lcssa) #6
  %61 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %57, ptr noundef nonnull @.str.6, ptr noundef %59, ptr noundef %60) #7
  call void @exit(i32 noundef 1) #8
  unreachable
}

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

declare i32 @ach_open(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

declare ptr @ach_result_to_string(i32 noundef) local_unnamed_addr #2

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

declare i32 @ach_channel_fd(ptr noundef, ptr noundef) local_unnamed_addr #2

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

declare i32 @poll(ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #2

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

declare i32 @ach_get(ptr noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

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

attributes #0 = { noreturn nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress 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 = { 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 #4 = { 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 #5 = { 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 #6 = { nounwind }
attributes #7 = { cold nounwind }
attributes #8 = { noreturn nounwind }
attributes #9 = { 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 = !{!10, !12, i64 4}
!10 = !{!"pollfd", !11, i64 0, !12, i64 4, !12, i64 6}
!11 = !{!"int", !7, i64 0}
!12 = !{!"short", !7, i64 0}
!13 = !{!10, !12, i64 6}
!14 = !{!15, !15, i64 0}
!15 = !{!"long", !7, i64 0}


; Effective O3 passes: ADCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass