; LLVM IR from aap/pdp6 :: fe6 (netmem)

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

@netmemfd = external dso_local global i32, align 4
@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [27 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 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 [27 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [18 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local ptr @netmemthread(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i16, align 2
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca [9 x i8], align 1
  %8 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 9, ptr %7) #5
  br label %9

9:                                                ; preds = %149, %1
  %10 = load i32, ptr @netmemfd, align 4, !tbaa !9
  %11 = getelementptr inbounds [9 x i8], ptr %7, i64 0, i64 0
  %12 = call i32 @readn(i32 noundef %10, ptr noundef %11, i32 noundef 2)
  %13 = icmp eq i32 %12, 0
  br i1 %13, label %14, label %150

14:                                               ; preds = %9
  %15 = getelementptr inbounds [9 x i8], ptr %7, i64 0, i64 0
  %16 = load i8, ptr %15, align 1, !tbaa !11
  %17 = zext i8 %16 to i32
  %18 = shl i32 %17, 8
  %19 = getelementptr inbounds [9 x i8], ptr %7, i64 0, i64 1
  %20 = load i8, ptr %19, align 1, !tbaa !11
  %21 = zext i8 %20 to i32
  %22 = or i32 %18, %21
  %23 = trunc i32 %22 to i16
  store i16 %23, ptr %4, align 2, !tbaa !12
  %24 = load i16, ptr %4, align 2, !tbaa !12
  %25 = zext i16 %24 to i32
  %26 = icmp sgt i32 %25, 9
  br i1 %26, label %27, label %34

27:                                               ; preds = %14
  %28 = load ptr, ptr @stderr, align 8, !tbaa !5
  %29 = load i16, ptr %4, align 2, !tbaa !12
  %30 = zext i16 %29 to i32
  %31 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %28, ptr noundef @.str, i32 noundef %30) #5
  %32 = load i32, ptr @netmemfd, align 4, !tbaa !9
  %33 = call i32 @close(i32 noundef %32)
  store i32 -1, ptr @netmemfd, align 4, !tbaa !9
  store ptr null, ptr %2, align 8
  store i32 1, ptr %8, align 4
  br label %153

34:                                               ; preds = %14
  %35 = getelementptr inbounds [9 x i8], ptr %7, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 1 %35, i8 0, i64 9, i1 false)
  %36 = load i32, ptr @netmemfd, align 4, !tbaa !9
  %37 = getelementptr inbounds [9 x i8], ptr %7, i64 0, i64 0
  %38 = load i16, ptr %4, align 2, !tbaa !12
  %39 = zext i16 %38 to i32
  %40 = call i32 @readn(i32 noundef %36, ptr noundef %37, i32 noundef %39)
  %41 = getelementptr inbounds [9 x i8], ptr %7, i64 0, i64 1
  %42 = load i8, ptr %41, align 1, !tbaa !11
  %43 = zext i8 %42 to i32
  %44 = getelementptr inbounds [9 x i8], ptr %7, i64 0, i64 2
  %45 = load i8, ptr %44, align 1, !tbaa !11
  %46 = zext i8 %45 to i32
  %47 = shl i32 %46, 8
  %48 = or i32 %43, %47
  %49 = getelementptr inbounds [9 x i8], ptr %7, i64 0, i64 3
  %50 = load i8, ptr %49, align 1, !tbaa !11
  %51 = zext i8 %50 to i32
  %52 = shl i32 %51, 16
  %53 = or i32 %48, %52
  %54 = sext i32 %53 to i64
  store i64 %54, ptr %5, align 8, !tbaa !14
  %55 = getelementptr inbounds [9 x i8], ptr %7, i64 0, i64 4
  %56 = load i8, ptr %55, align 1, !tbaa !11
  %57 = zext i8 %56 to i32
  %58 = getelementptr inbounds [9 x i8], ptr %7, i64 0, i64 5
  %59 = load i8, ptr %58, align 1, !tbaa !11
  %60 = zext i8 %59 to i32
  %61 = shl i32 %60, 8
  %62 = or i32 %57, %61
  %63 = getelementptr inbounds [9 x i8], ptr %7, i64 0, i64 6
  %64 = load i8, ptr %63, align 1, !tbaa !11
  %65 = zext i8 %64 to i32
  %66 = shl i32 %65, 16
  %67 = or i32 %62, %66
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [9 x i8], ptr %7, i64 0, i64 7
  %70 = load i8, ptr %69, align 1, !tbaa !11
  %71 = zext i8 %70 to i64
  %72 = shl i64 %71, 24
  %73 = or i64 %68, %72
  %74 = getelementptr inbounds [9 x i8], ptr %7, i64 0, i64 8
  %75 = load i8, ptr %74, align 1, !tbaa !11
  %76 = zext i8 %75 to i64
  %77 = shl i64 %76, 32
  %78 = or i64 %73, %77
  store i64 %78, ptr %6, align 8, !tbaa !14
  %79 = load i64, ptr %5, align 8, !tbaa !14
  %80 = and i64 %79, 262143
  store i64 %80, ptr %5, align 8, !tbaa !14
  %81 = load i64, ptr %6, align 8, !tbaa !14
  %82 = and i64 %81, 68719476735
  store i64 %82, ptr %6, align 8, !tbaa !14
  %83 = getelementptr inbounds [9 x i8], ptr %7, i64 0, i64 0
  %84 = load i8, ptr %83, align 1, !tbaa !11
  %85 = zext i8 %84 to i32
  switch i32 %85, label %143 [
    i32 1, label %86
    i32 2, label %105
  ]

86:                                               ; preds = %34
  %87 = load i64, ptr %5, align 8, !tbaa !14
  %88 = trunc i64 %87 to i32
  %89 = load i64, ptr %6, align 8, !tbaa !14
  call void @deposit(i32 noundef %88, i64 noundef %89)
  %90 = load i64, ptr %5, align 8, !tbaa !14
  %91 = load i64, ptr %6, align 8, !tbaa !14
  %92 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %90, i64 noundef %91)
  %93 = load ptr, ptr @stdout, align 8, !tbaa !5
  %94 = call i32 @fflush(ptr noundef %93)
  %95 = getelementptr inbounds [9 x i8], ptr %7, i64 0, i64 0
  store i8 0, ptr %95, align 1, !tbaa !11
  %96 = getelementptr inbounds [9 x i8], ptr %7, i64 0, i64 1
  store i8 1, ptr %96, align 1, !tbaa !11
  %97 = getelementptr inbounds [9 x i8], ptr %7, i64 0, i64 2
  store i8 3, ptr %97, align 1, !tbaa !11
  %98 = load i32, ptr @netmemfd, align 4, !tbaa !9
  %99 = getelementptr inbounds [9 x i8], ptr %7, i64 0, i64 0
  %100 = getelementptr inbounds [9 x i8], ptr %7, i64 0, i64 1
  %101 = load i8, ptr %100, align 1, !tbaa !11
  %102 = zext i8 %101 to i32
  %103 = add nsw i32 %102, 2
  %104 = call i32 @writen(i32 noundef %98, ptr noundef %99, i32 noundef %103)
  br label %149

105:                                              ; preds = %34
  %106 = load i64, ptr %5, align 8, !tbaa !14
  %107 = trunc i64 %106 to i32
  %108 = call i64 @examine(i32 noundef %107)
  store i64 %108, ptr %6, align 8, !tbaa !14
  %109 = load i64, ptr %5, align 8, !tbaa !14
  %110 = load i64, ptr %6, align 8, !tbaa !14
  %111 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %109, i64 noundef %110)
  %112 = load ptr, ptr @stdout, align 8, !tbaa !5
  %113 = call i32 @fflush(ptr noundef %112)
  %114 = getelementptr inbounds [9 x i8], ptr %7, i64 0, i64 0
  store i8 0, ptr %114, align 1, !tbaa !11
  %115 = getelementptr inbounds [9 x i8], ptr %7, i64 0, i64 1
  store i8 6, ptr %115, align 1, !tbaa !11
  %116 = getelementptr inbounds [9 x i8], ptr %7, i64 0, i64 2
  store i8 3, ptr %116, align 1, !tbaa !11
  %117 = load i64, ptr %6, align 8, !tbaa !14
  %118 = trunc i64 %117 to i8
  %119 = getelementptr inbounds [9 x i8], ptr %7, i64 0, i64 3
  store i8 %118, ptr %119, align 1, !tbaa !11
  %120 = load i64, ptr %6, align 8, !tbaa !14
  %121 = lshr i64 %120, 8
  %122 = trunc i64 %121 to i8
  %123 = getelementptr inbounds [9 x i8], ptr %7, i64 0, i64 4
  store i8 %122, ptr %123, align 1, !tbaa !11
  %124 = load i64, ptr %6, align 8, !tbaa !14
  %125 = lshr i64 %124, 16
  %126 = trunc i64 %125 to i8
  %127 = getelementptr inbounds [9 x i8], ptr %7, i64 0, i64 5
  store i8 %126, ptr %127, align 1, !tbaa !11
  %128 = load i64, ptr %6, align 8, !tbaa !14
  %129 = lshr i64 %128, 24
  %130 = trunc i64 %129 to i8
  %131 = getelementptr inbounds [9 x i8], ptr %7, i64 0, i64 6
  store i8 %130, ptr %131, align 1, !tbaa !11
  %132 = load i64, ptr %6, align 8, !tbaa !14
  %133 = lshr i64 %132, 32
  %134 = trunc i64 %133 to i8
  %135 = getelementptr inbounds [9 x i8], ptr %7, i64 0, i64 7
  store i8 %134, ptr %135, align 1, !tbaa !11
  %136 = load i32, ptr @netmemfd, align 4, !tbaa !9
  %137 = getelementptr inbounds [9 x i8], ptr %7, i64 0, i64 0
  %138 = getelementptr inbounds [9 x i8], ptr %7, i64 0, i64 1
  %139 = load i8, ptr %138, align 1, !tbaa !11
  %140 = zext i8 %139 to i32
  %141 = add nsw i32 %140, 2
  %142 = call i32 @writen(i32 noundef %136, ptr noundef %137, i32 noundef %141)
  br label %149

143:                                              ; preds = %34
  %144 = load ptr, ptr @stderr, align 8, !tbaa !5
  %145 = getelementptr inbounds [9 x i8], ptr %7, i64 0, i64 0
  %146 = load i8, ptr %145, align 1, !tbaa !11
  %147 = zext i8 %146 to i32
  %148 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %144, ptr noundef @.str.3, i32 noundef %147) #5
  br label %149

149:                                              ; preds = %143, %105, %86
  br label %9, !llvm.loop !16

150:                                              ; preds = %9
  %151 = load ptr, ptr @stderr, align 8, !tbaa !5
  %152 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %151, ptr noundef @.str.4) #5
  store i32 -1, ptr @netmemfd, align 4, !tbaa !9
  store ptr null, ptr %2, align 8
  store i32 1, ptr %8, align 4
  br label %153

153:                                              ; preds = %150, %27
  call void @llvm.lifetime.end.p0(i64 9, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 2, ptr %4) #5
  %154 = load ptr, ptr %2, align 8
  ret ptr %154
}

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

declare i32 @readn(i32 noundef, ptr noundef, i32 noundef) #2

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

declare i32 @close(i32 noundef) #2

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

declare void @deposit(i32 noundef, i64 noundef) #2

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

declare i32 @fflush(ptr noundef) #2

declare i32 @writen(i32 noundef, ptr noundef, i32 noundef) #2

declare i64 @examine(i32 noundef) #2

; 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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"long", !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}


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

@netmemfd = external dso_local local_unnamed_addr global i32, align 4
@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [27 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 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 [27 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [18 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noalias noundef ptr @netmemthread(ptr nocapture noundef readnone %0) local_unnamed_addr #0 {
  %2 = alloca [9 x i8], align 1
  call void @llvm.lifetime.start.p0(i64 9, ptr nonnull %2) #5
  %3 = load i32, ptr @netmemfd, align 4, !tbaa !5
  %4 = call i32 @readn(i32 noundef %3, ptr noundef nonnull %2, i32 noundef 2) #5
  %5 = icmp eq i32 %4, 0
  br i1 %5, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %1
  %6 = getelementptr inbounds i8, ptr %2, i64 1
  %7 = getelementptr inbounds i8, ptr %2, i64 2
  %8 = getelementptr inbounds i8, ptr %2, i64 3
  %9 = getelementptr inbounds i8, ptr %2, i64 4
  %10 = getelementptr inbounds i8, ptr %2, i64 5
  %11 = getelementptr inbounds i8, ptr %2, i64 6
  %12 = getelementptr inbounds i8, ptr %2, i64 7
  %13 = getelementptr inbounds i8, ptr %2, i64 8
  br label %14

14:                                               ; preds = %.lr.ph, %71
  %15 = load i8, ptr %2, align 1, !tbaa !9
  %16 = zext i8 %15 to i32
  %17 = shl nuw nsw i32 %16, 8
  %18 = load i8, ptr %6, align 1, !tbaa !9
  %19 = zext i8 %18 to i32
  %20 = or disjoint i32 %17, %19
  %21 = icmp ugt i32 %20, 9
  br i1 %21, label %22, label %27

22:                                               ; preds = %14
  %23 = load ptr, ptr @stderr, align 8, !tbaa !10
  %24 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %23, ptr noundef nonnull @.str, i32 noundef %20) #6
  %25 = load i32, ptr @netmemfd, align 4, !tbaa !5
  %26 = call i32 @close(i32 noundef %25) #5
  br label %77

27:                                               ; preds = %14
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(9) %2, i8 0, i64 9, i1 false)
  %28 = load i32, ptr @netmemfd, align 4, !tbaa !5
  %29 = call i32 @readn(i32 noundef %28, ptr noundef nonnull %2, i32 noundef %20) #5
  %30 = load i16, ptr %6, align 1
  %31 = zext i16 %30 to i64
  %32 = load i8, ptr %8, align 1, !tbaa !9
  %33 = zext i8 %32 to i64
  %34 = shl nuw nsw i64 %33, 16
  %.masked = and i64 %34, 196608
  %35 = or disjoint i64 %.masked, %31
  %36 = load i8, ptr %2, align 1, !tbaa !9
  switch i8 %36, label %67 [
    i8 1, label %37
    i8 2, label %50
  ]

37:                                               ; preds = %27
  %38 = load i8, ptr %13, align 1, !tbaa !9
  %39 = zext i8 %38 to i64
  %40 = shl nuw nsw i64 %39, 32
  %41 = load i32, ptr %9, align 1
  %42 = zext i32 %41 to i64
  %.masked17 = and i64 %40, 64424509440
  %43 = or disjoint i64 %.masked17, %42
  %44 = trunc nuw nsw i64 %35 to i32
  call void @deposit(i32 noundef %44, i64 noundef %43) #5
  %45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %35, i64 noundef %43)
  %46 = load ptr, ptr @stdout, align 8, !tbaa !10
  %47 = call i32 @fflush(ptr noundef %46)
  store i8 0, ptr %2, align 1, !tbaa !9
  store i8 1, ptr %6, align 1, !tbaa !9
  store i8 3, ptr %7, align 1, !tbaa !9
  %48 = load i32, ptr @netmemfd, align 4, !tbaa !5
  %49 = call i32 @writen(i32 noundef %48, ptr noundef nonnull %2, i32 noundef 3) #5
  br label %71

50:                                               ; preds = %27
  %51 = trunc nuw nsw i64 %35 to i32
  %52 = call i64 @examine(i32 noundef %51) #5
  %53 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %35, i64 noundef %52)
  %54 = load ptr, ptr @stdout, align 8, !tbaa !10
  %55 = call i32 @fflush(ptr noundef %54)
  store i8 0, ptr %2, align 1, !tbaa !9
  store i8 6, ptr %6, align 1, !tbaa !9
  store i8 3, ptr %7, align 1, !tbaa !9
  %56 = trunc i64 %52 to i8
  store i8 %56, ptr %8, align 1, !tbaa !9
  %57 = lshr i64 %52, 8
  %58 = trunc i64 %57 to i8
  store i8 %58, ptr %9, align 1, !tbaa !9
  %59 = lshr i64 %52, 16
  %60 = trunc i64 %59 to i8
  store i8 %60, ptr %10, align 1, !tbaa !9
  %61 = lshr i64 %52, 24
  %62 = trunc i64 %61 to i8
  store i8 %62, ptr %11, align 1, !tbaa !9
  %63 = lshr i64 %52, 32
  %64 = trunc i64 %63 to i8
  store i8 %64, ptr %12, align 1, !tbaa !9
  %65 = load i32, ptr @netmemfd, align 4, !tbaa !5
  %66 = call i32 @writen(i32 noundef %65, ptr noundef nonnull %2, i32 noundef 8) #5
  br label %71

67:                                               ; preds = %27
  %68 = zext i8 %36 to i32
  %69 = load ptr, ptr @stderr, align 8, !tbaa !10
  %70 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %69, ptr noundef nonnull @.str.3, i32 noundef %68) #6
  br label %71

71:                                               ; preds = %67, %50, %37
  %72 = load i32, ptr @netmemfd, align 4, !tbaa !5
  %73 = call i32 @readn(i32 noundef %72, ptr noundef nonnull %2, i32 noundef 2) #5
  %74 = icmp eq i32 %73, 0
  br i1 %74, label %14, label %._crit_edge, !llvm.loop !12

._crit_edge:                                      ; preds = %71, %1
  %75 = load ptr, ptr @stderr, align 8, !tbaa !10
  %76 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %75, ptr noundef nonnull @.str.4) #6
  br label %77

77:                                               ; preds = %._crit_edge, %22
  store i32 -1, ptr @netmemfd, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 9, ptr nonnull %2) #5
  ret ptr null
}

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

declare i32 @readn(i32 noundef, ptr noundef, i32 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 i32 @close(i32 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) #4

declare void @deposit(i32 noundef, i64 noundef) local_unnamed_addr #2

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

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

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

declare i64 @examine(i32 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

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 = { "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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }
attributes #6 = { cold 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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}


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