; LLVM IR from docsteer/sacnview :: libs/WinPcap-413-173-b4/Examples-pcap/pktdump_ex (pktdump_ex)

; 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.pcap_if = type { ptr, ptr, ptr, ptr, i32 }
%struct.pcap_pkthdr = type { %struct.timeval, i32, i32 }
%struct.timeval = type { i64, i64 }

@.str = external hidden unnamed_addr constant [62 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [149 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [49 x i8], align 1
@stderr = external global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [31 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 ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca [256 x i8], align 16
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = 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) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 256, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %16 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  %17 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  %18 = load i32, ptr %4, align 4, !tbaa !5
  %19 = icmp slt i32 %18, 3
  br i1 %19, label %20, label %100

20:                                               ; preds = %2
  %21 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  %22 = getelementptr inbounds [256 x i8], ptr %11, i64 0, i64 0
  %23 = call i32 @pcap_findalldevs(ptr noundef %6, ptr noundef %22)
  %24 = icmp eq i32 %23, -1
  br i1 %24, label %25, label %29

25:                                               ; preds = %20
  %26 = load ptr, ptr @stderr, align 8, !tbaa !9
  %27 = getelementptr inbounds [256 x i8], ptr %11, i64 0, i64 0
  %28 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %26, ptr noundef @.str.3, ptr noundef %27) #5
  call void @exit(i32 noundef 1) #6
  unreachable

29:                                               ; preds = %20
  %30 = load ptr, ptr %6, align 8, !tbaa !9
  store ptr %30, ptr %7, align 8, !tbaa !9
  br label %31

31:                                               ; preds = %53, %29
  %32 = load ptr, ptr %7, align 8, !tbaa !9
  %33 = icmp ne ptr %32, null
  br i1 %33, label %34, label %57

34:                                               ; preds = %31
  %35 = load i32, ptr %10, align 4, !tbaa !5
  %36 = add i32 %35, 1
  store i32 %36, ptr %10, align 4, !tbaa !5
  %37 = load ptr, ptr %7, align 8, !tbaa !9
  %38 = getelementptr inbounds %struct.pcap_if, ptr %37, i32 0, i32 1
  %39 = load ptr, ptr %38, align 8, !tbaa !11
  %40 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %36, ptr noundef %39)
  %41 = load ptr, ptr %7, align 8, !tbaa !9
  %42 = getelementptr inbounds %struct.pcap_if, ptr %41, i32 0, i32 2
  %43 = load ptr, ptr %42, align 8, !tbaa !13
  %44 = icmp ne ptr %43, null
  br i1 %44, label %45, label %50

45:                                               ; preds = %34
  %46 = load ptr, ptr %7, align 8, !tbaa !9
  %47 = getelementptr inbounds %struct.pcap_if, ptr %46, i32 0, i32 2
  %48 = load ptr, ptr %47, align 8, !tbaa !13
  %49 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, ptr noundef %48)
  br label %52

50:                                               ; preds = %34
  %51 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  br label %52

52:                                               ; preds = %50, %45
  br label %53

53:                                               ; preds = %52
  %54 = load ptr, ptr %7, align 8, !tbaa !9
  %55 = getelementptr inbounds %struct.pcap_if, ptr %54, i32 0, i32 0
  %56 = load ptr, ptr %55, align 8, !tbaa !14
  store ptr %56, ptr %7, align 8, !tbaa !9
  br label %31, !llvm.loop !15

57:                                               ; preds = %31
  %58 = load i32, ptr %10, align 4, !tbaa !5
  %59 = icmp eq i32 %58, 0
  br i1 %59, label %60, label %62

60:                                               ; preds = %57
  %61 = call i32 (ptr, ...) @printf(ptr noundef @.str.7)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %169

62:                                               ; preds = %57
  %63 = load i32, ptr %10, align 4, !tbaa !5
  %64 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, i32 noundef %63)
  %65 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.9, ptr noundef %9)
  %66 = load i32, ptr %9, align 4, !tbaa !5
  %67 = icmp ult i32 %66, 1
  br i1 %67, label %72, label %68

68:                                               ; preds = %62
  %69 = load i32, ptr %9, align 4, !tbaa !5
  %70 = load i32, ptr %10, align 4, !tbaa !5
  %71 = icmp ugt i32 %69, %70
  br i1 %71, label %72, label %75

72:                                               ; preds = %68, %62
  %73 = call i32 (ptr, ...) @printf(ptr noundef @.str.10)
  %74 = load ptr, ptr %6, align 8, !tbaa !9
  call void @pcap_freealldevs(ptr noundef %74)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %169

75:                                               ; preds = %68
  %76 = load ptr, ptr %6, align 8, !tbaa !9
  store ptr %76, ptr %7, align 8, !tbaa !9
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %77

77:                                               ; preds = %83, %75
  %78 = load i32, ptr %10, align 4, !tbaa !5
  %79 = load i32, ptr %9, align 4, !tbaa !5
  %80 = sub i32 %79, 1
  %81 = icmp ult i32 %78, %80
  br i1 %81, label %82, label %89

82:                                               ; preds = %77
  br label %83

83:                                               ; preds = %82
  %84 = load ptr, ptr %7, align 8, !tbaa !9
  %85 = getelementptr inbounds %struct.pcap_if, ptr %84, i32 0, i32 0
  %86 = load ptr, ptr %85, align 8, !tbaa !14
  store ptr %86, ptr %7, align 8, !tbaa !9
  %87 = load i32, ptr %10, align 4, !tbaa !5
  %88 = add i32 %87, 1
  store i32 %88, ptr %10, align 4, !tbaa !5
  br label %77, !llvm.loop !17

89:                                               ; preds = %77
  %90 = load ptr, ptr %7, align 8, !tbaa !9
  %91 = getelementptr inbounds %struct.pcap_if, ptr %90, i32 0, i32 1
  %92 = load ptr, ptr %91, align 8, !tbaa !11
  %93 = getelementptr inbounds [256 x i8], ptr %11, i64 0, i64 0
  %94 = call ptr @pcap_open_live(ptr noundef %92, i32 noundef 65536, i32 noundef 1, i32 noundef 1000, ptr noundef %93)
  store ptr %94, ptr %8, align 8, !tbaa !9
  %95 = icmp eq ptr %94, null
  br i1 %95, label %96, label %99

96:                                               ; preds = %89
  %97 = load ptr, ptr @stderr, align 8, !tbaa !9
  %98 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %97, ptr noundef @.str.11) #5
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %169

99:                                               ; preds = %89
  br label %111

100:                                              ; preds = %2
  %101 = load ptr, ptr %5, align 8, !tbaa !9
  %102 = getelementptr inbounds ptr, ptr %101, i64 2
  %103 = load ptr, ptr %102, align 8, !tbaa !9
  %104 = getelementptr inbounds [256 x i8], ptr %11, i64 0, i64 0
  %105 = call ptr @pcap_open_live(ptr noundef %103, i32 noundef 65536, i32 noundef 1, i32 noundef 1000, ptr noundef %104)
  store ptr %105, ptr %8, align 8, !tbaa !9
  %106 = icmp eq ptr %105, null
  br i1 %106, label %107, label %110

107:                                              ; preds = %100
  %108 = load ptr, ptr @stderr, align 8, !tbaa !9
  %109 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %108, ptr noundef @.str.11) #5
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %169

110:                                              ; preds = %100
  br label %111

111:                                              ; preds = %110, %99
  br label %112

112:                                              ; preds = %158, %119, %111
  %113 = load ptr, ptr %8, align 8, !tbaa !9
  %114 = call i32 @pcap_next_ex(ptr noundef %113, ptr noundef %13, ptr noundef %14)
  store i32 %114, ptr %12, align 4, !tbaa !5
  %115 = icmp sge i32 %114, 0
  br i1 %115, label %116, label %160

116:                                              ; preds = %112
  %117 = load i32, ptr %12, align 4, !tbaa !5
  %118 = icmp eq i32 %117, 0
  br i1 %118, label %119, label %120

119:                                              ; preds = %116
  br label %112, !llvm.loop !18

120:                                              ; preds = %116
  %121 = load ptr, ptr %13, align 8, !tbaa !9
  %122 = getelementptr inbounds %struct.pcap_pkthdr, ptr %121, i32 0, i32 0
  %123 = getelementptr inbounds %struct.timeval, ptr %122, i32 0, i32 0
  %124 = load i64, ptr %123, align 8, !tbaa !19
  %125 = load ptr, ptr %13, align 8, !tbaa !9
  %126 = getelementptr inbounds %struct.pcap_pkthdr, ptr %125, i32 0, i32 0
  %127 = getelementptr inbounds %struct.timeval, ptr %126, i32 0, i32 1
  %128 = load i64, ptr %127, align 8, !tbaa !23
  %129 = load ptr, ptr %13, align 8, !tbaa !9
  %130 = getelementptr inbounds %struct.pcap_pkthdr, ptr %129, i32 0, i32 2
  %131 = load i32, ptr %130, align 4, !tbaa !24
  %132 = call i32 (ptr, ...) @printf(ptr noundef @.str.12, i64 noundef %124, i64 noundef %128, i32 noundef %131)
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %133

133:                                              ; preds = %155, %120
  %134 = load i32, ptr %10, align 4, !tbaa !5
  %135 = load ptr, ptr %13, align 8, !tbaa !9
  %136 = getelementptr inbounds %struct.pcap_pkthdr, ptr %135, i32 0, i32 1
  %137 = load i32, ptr %136, align 8, !tbaa !25
  %138 = add i32 %137, 1
  %139 = icmp ult i32 %134, %138
  br i1 %139, label %140, label %158

140:                                              ; preds = %133
  %141 = load ptr, ptr %14, align 8, !tbaa !9
  %142 = load i32, ptr %10, align 4, !tbaa !5
  %143 = sub i32 %142, 1
  %144 = zext i32 %143 to i64
  %145 = getelementptr inbounds i8, ptr %141, i64 %144
  %146 = load i8, ptr %145, align 1, !tbaa !26
  %147 = zext i8 %146 to i32
  %148 = call i32 (ptr, ...) @printf(ptr noundef @.str.13, i32 noundef %147)
  %149 = load i32, ptr %10, align 4, !tbaa !5
  %150 = urem i32 %149, 16
  %151 = icmp eq i32 %150, 0
  br i1 %151, label %152, label %154

152:                                              ; preds = %140
  %153 = call i32 (ptr, ...) @printf(ptr noundef @.str.14)
  br label %154

154:                                              ; preds = %152, %140
  br label %155

155:                                              ; preds = %154
  %156 = load i32, ptr %10, align 4, !tbaa !5
  %157 = add i32 %156, 1
  store i32 %157, ptr %10, align 4, !tbaa !5
  br label %133, !llvm.loop !27

158:                                              ; preds = %133
  %159 = call i32 (ptr, ...) @printf(ptr noundef @.str.15)
  br label %112, !llvm.loop !18

160:                                              ; preds = %112
  %161 = load i32, ptr %12, align 4, !tbaa !5
  %162 = icmp eq i32 %161, -1
  br i1 %162, label %163, label %167

163:                                              ; preds = %160
  %164 = load ptr, ptr %8, align 8, !tbaa !9
  %165 = call ptr @pcap_geterr(ptr noundef %164)
  %166 = call i32 (ptr, ...) @printf(ptr noundef @.str.16, ptr noundef %165)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %169

167:                                              ; preds = %160
  %168 = load ptr, ptr %8, align 8, !tbaa !9
  call void @pcap_close(ptr noundef %168)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %169

169:                                              ; preds = %167, %163, %107, %96, %72, %60
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 256, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  %170 = load i32, ptr %3, align 4
  ret i32 %170
}

; 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

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

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

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

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

declare void @pcap_freealldevs(ptr noundef) #2

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

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

declare ptr @pcap_geterr(ptr noundef) #2

declare void @pcap_close(ptr 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 = { 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 = { nounwind }
attributes #6 = { 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, !10, i64 8}
!12 = !{!"pcap_if", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !6, i64 32}
!13 = !{!12, !10, i64 16}
!14 = !{!12, !10, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}
!19 = !{!20, !22, i64 0}
!20 = !{!"pcap_pkthdr", !21, i64 0, !6, i64 16, !6, i64 20}
!21 = !{!"timeval", !22, i64 0, !22, i64 8}
!22 = !{!"long", !7, i64 0}
!23 = !{!20, !22, i64 8}
!24 = !{!20, !6, i64 20}
!25 = !{!20, !6, i64 16}
!26 = !{!7, !7, i64 0}
!27 = distinct !{!27, !16}


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

@.str = external hidden unnamed_addr constant [62 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [149 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [49 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [31 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca [256 x i8], align 16
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  %9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %10 = icmp slt i32 %0, 3
  br i1 %10, label %11, label %47

11:                                               ; preds = %2
  %12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  %13 = call i32 @pcap_findalldevs(ptr noundef nonnull %3, ptr noundef nonnull %5) #5
  %14 = icmp eq i32 %13, -1
  br i1 %14, label %15, label %.preheader35

.preheader35:                                     ; preds = %11
  %.02636 = load ptr, ptr %3, align 8, !tbaa !5
  %.not37 = icmp eq ptr %.02636, null
  br i1 %.not37, label %._crit_edge.thread, label %.lr.ph

15:                                               ; preds = %11
  %16 = load ptr, ptr @stderr, align 8, !tbaa !5
  %17 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %16, ptr noundef nonnull @.str.3, ptr noundef nonnull %5) #6
  call void @exit(i32 noundef 1) #7
  unreachable

.lr.ph:                                           ; preds = %.preheader35, %28
  %.02639 = phi ptr [ %.026, %28 ], [ %.02636, %.preheader35 ]
  %.02438 = phi i32 [ %18, %28 ], [ 0, %.preheader35 ]
  %18 = add i32 %.02438, 1
  %19 = getelementptr inbounds i8, ptr %.02639, i64 8
  %20 = load ptr, ptr %19, align 8, !tbaa !9
  %21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %18, ptr noundef %20)
  %22 = getelementptr inbounds i8, ptr %.02639, i64 16
  %23 = load ptr, ptr %22, align 8, !tbaa !12
  %.not34 = icmp eq ptr %23, null
  br i1 %.not34, label %26, label %24

24:                                               ; preds = %.lr.ph
  %25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, ptr noundef nonnull %23)
  br label %28

26:                                               ; preds = %.lr.ph
  %27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  br label %28

28:                                               ; preds = %24, %26
  %.026 = load ptr, ptr %.02639, align 8, !tbaa !5
  %.not = icmp eq ptr %.026, null
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !13

._crit_edge:                                      ; preds = %28
  %29 = icmp eq i32 %18, 0
  br i1 %29, label %._crit_edge.thread, label %31

._crit_edge.thread:                               ; preds = %.preheader35, %._crit_edge
  %30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  br label %98

31:                                               ; preds = %._crit_edge
  %32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %18)
  %33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.9, ptr noundef nonnull %4)
  %34 = load i32, ptr %4, align 4, !tbaa !15
  %35 = add i32 %34, -1
  %or.cond.not = icmp ult i32 %35, %18
  br i1 %or.cond.not, label %.preheader.preheader, label %37

.preheader.preheader:                             ; preds = %31
  %xtraiter = and i32 %34, 7
  %36 = icmp ult i32 %35, 7
  br i1 %36, label %.unr-lcssa, label %.preheader.preheader.new

.preheader.preheader.new:                         ; preds = %.preheader.preheader
  %unroll_iter = and i32 %34, -8
  br label %.preheader

37:                                               ; preds = %31
  %38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10)
  %39 = load ptr, ptr %3, align 8, !tbaa !5
  call void @pcap_freealldevs(ptr noundef %39) #5
  br label %98

.preheader:                                       ; preds = %.preheader, %.preheader.preheader.new
  %.127.in = phi ptr [ %3, %.preheader.preheader.new ], [ %.127.7, %.preheader ]
  %niter = phi i32 [ 0, %.preheader.preheader.new ], [ %niter.next.7, %.preheader ]
  %.127 = load ptr, ptr %.127.in, align 8, !tbaa !5
  %.127.1 = load ptr, ptr %.127, align 8, !tbaa !5
  %.127.2 = load ptr, ptr %.127.1, align 8, !tbaa !5
  %.127.3 = load ptr, ptr %.127.2, align 8, !tbaa !5
  %.127.4 = load ptr, ptr %.127.3, align 8, !tbaa !5
  %.127.5 = load ptr, ptr %.127.4, align 8, !tbaa !5
  %.127.6 = load ptr, ptr %.127.5, align 8, !tbaa !5
  %.127.7 = load ptr, ptr %.127.6, align 8, !tbaa !5
  %niter.next.7 = add i32 %niter, 8
  %niter.ncmp.7 = icmp eq i32 %niter.next.7, %unroll_iter
  br i1 %niter.ncmp.7, label %.unr-lcssa, label %.preheader, !llvm.loop !16

.unr-lcssa:                                       ; preds = %.preheader, %.preheader.preheader
  %.127.lcssa.ph = phi ptr [ poison, %.preheader.preheader ], [ %.127.7, %.preheader ]
  %.127.in.unr = phi ptr [ %3, %.preheader.preheader ], [ %.127.7, %.preheader ]
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.epilog-lcssa, label %.preheader.epil

.preheader.epil:                                  ; preds = %.unr-lcssa, %.preheader.epil
  %.127.in.epil = phi ptr [ %.127.epil, %.preheader.epil ], [ %.127.in.unr, %.unr-lcssa ]
  %epil.iter = phi i32 [ %epil.iter.next, %.preheader.epil ], [ 0, %.unr-lcssa ]
  %.127.epil = load ptr, ptr %.127.in.epil, align 8, !tbaa !5
  %epil.iter.next = add i32 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i32 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.epilog-lcssa, label %.preheader.epil, !llvm.loop !17

.epilog-lcssa:                                    ; preds = %.preheader.epil, %.unr-lcssa
  %.127.lcssa = phi ptr [ %.127.lcssa.ph, %.unr-lcssa ], [ %.127.epil, %.preheader.epil ]
  %40 = getelementptr inbounds i8, ptr %.127.lcssa, i64 8
  %41 = load ptr, ptr %40, align 8, !tbaa !9
  %42 = call ptr @pcap_open_live(ptr noundef %41, i32 noundef 65536, i32 noundef 1, i32 noundef 1000, ptr noundef nonnull %5) #5
  %43 = icmp eq ptr %42, null
  br i1 %43, label %44, label %55

44:                                               ; preds = %.epilog-lcssa
  %45 = load ptr, ptr @stderr, align 8, !tbaa !5
  %46 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %45, ptr noundef nonnull @.str.11) #6
  br label %98

47:                                               ; preds = %2
  %48 = getelementptr inbounds i8, ptr %1, i64 16
  %49 = load ptr, ptr %48, align 8, !tbaa !5
  %50 = call ptr @pcap_open_live(ptr noundef %49, i32 noundef 65536, i32 noundef 1, i32 noundef 1000, ptr noundef nonnull %5) #5
  %51 = icmp eq ptr %50, null
  br i1 %51, label %52, label %55

52:                                               ; preds = %47
  %53 = load ptr, ptr @stderr, align 8, !tbaa !5
  %54 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %53, ptr noundef nonnull @.str.11) #6
  br label %98

55:                                               ; preds = %47, %.epilog-lcssa
  %.025 = phi ptr [ %42, %.epilog-lcssa ], [ %50, %47 ]
  %56 = call i32 @pcap_next_ex(ptr noundef nonnull %.025, ptr noundef nonnull %6, ptr noundef nonnull %7) #5
  %57 = icmp sgt i32 %56, -1
  br i1 %57, label %.lr.ph45, label %._crit_edge46

.lr.ph45:                                         ; preds = %55, %.backedge
  %58 = phi i32 [ %91, %.backedge ], [ %56, %55 ]
  %59 = icmp eq i32 %58, 0
  br i1 %59, label %.backedge, label %60

60:                                               ; preds = %.lr.ph45
  %61 = load ptr, ptr %6, align 8, !tbaa !5
  %62 = load i64, ptr %61, align 8, !tbaa !19
  %63 = getelementptr inbounds i8, ptr %61, i64 8
  %64 = load i64, ptr %63, align 8, !tbaa !23
  %65 = getelementptr inbounds i8, ptr %61, i64 20
  %66 = load i32, ptr %65, align 4, !tbaa !24
  %67 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12, i64 noundef %62, i64 noundef %64, i32 noundef %66)
  %68 = load ptr, ptr %6, align 8, !tbaa !5
  %69 = getelementptr inbounds i8, ptr %68, i64 16
  %70 = load i32, ptr %69, align 8, !tbaa !25
  %71 = add i32 %70, -1
  %72 = icmp ult i32 %71, -2
  br i1 %72, label %.lr.ph42, label %._crit_edge43

.lr.ph42:                                         ; preds = %60, %83
  %indvars.iv = phi i64 [ %indvars.iv.next, %83 ], [ 1, %60 ]
  %73 = load ptr, ptr %7, align 8, !tbaa !5
  %74 = getelementptr i8, ptr %73, i64 %indvars.iv
  %75 = getelementptr i8, ptr %74, i64 -1
  %76 = load i8, ptr %75, align 1, !tbaa !26
  %77 = zext i8 %76 to i32
  %78 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13, i32 noundef %77)
  %79 = and i64 %indvars.iv, 15
  %80 = icmp eq i64 %79, 0
  br i1 %80, label %81, label %83

81:                                               ; preds = %.lr.ph42
  %82 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.14)
  br label %83

83:                                               ; preds = %.lr.ph42, %81
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %84 = load ptr, ptr %6, align 8, !tbaa !5
  %85 = getelementptr inbounds i8, ptr %84, i64 16
  %86 = load i32, ptr %85, align 8, !tbaa !25
  %87 = add i32 %86, 1
  %88 = zext i32 %87 to i64
  %89 = icmp ult i64 %indvars.iv.next, %88
  br i1 %89, label %.lr.ph42, label %._crit_edge43, !llvm.loop !27

._crit_edge43:                                    ; preds = %83, %60
  %90 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15)
  br label %.backedge

.backedge:                                        ; preds = %._crit_edge43, %.lr.ph45
  %91 = call i32 @pcap_next_ex(ptr noundef nonnull %.025, ptr noundef nonnull %6, ptr noundef nonnull %7) #5
  %92 = icmp sgt i32 %91, -1
  br i1 %92, label %.lr.ph45, label %._crit_edge46, !llvm.loop !28

._crit_edge46:                                    ; preds = %.backedge, %55
  %.lcssa = phi i32 [ %56, %55 ], [ %91, %.backedge ]
  %93 = icmp eq i32 %.lcssa, -1
  br i1 %93, label %94, label %97

94:                                               ; preds = %._crit_edge46
  %95 = call ptr @pcap_geterr(ptr noundef nonnull %.025) #5
  %96 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, ptr noundef %95)
  br label %98

97:                                               ; preds = %._crit_edge46
  call void @pcap_close(ptr noundef nonnull %.025) #5
  br label %98

98:                                               ; preds = %97, %94, %52, %44, %37, %._crit_edge.thread
  %.0 = phi i32 [ -1, %._crit_edge.thread ], [ -1, %37 ], [ -1, %44 ], [ -1, %94 ], [ 0, %97 ], [ -1, %52 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  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

declare i32 @pcap_findalldevs(ptr noundef, ptr noundef) local_unnamed_addr #3

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

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

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

declare void @pcap_freealldevs(ptr noundef) local_unnamed_addr #3

declare ptr @pcap_open_live(ptr noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

declare i32 @pcap_next_ex(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare ptr @pcap_geterr(ptr noundef) local_unnamed_addr #3

declare void @pcap_close(ptr noundef) local_unnamed_addr #3

; 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 = { "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 = { nounwind }
attributes #6 = { cold nounwind }
attributes #7 = { noreturn nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 8}
!10 = !{!"pcap_if", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !11, i64 32}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !6, i64 16}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!11, !11, i64 0}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.unroll.disable"}
!19 = !{!20, !22, i64 0}
!20 = !{!"pcap_pkthdr", !21, i64 0, !11, i64 16, !11, i64 20}
!21 = !{!"timeval", !22, i64 0, !22, i64 8}
!22 = !{!"long", !7, i64 0}
!23 = !{!20, !22, i64 8}
!24 = !{!20, !11, i64 20}
!25 = !{!20, !11, i64 16}
!26 = !{!7, !7, i64 0}
!27 = distinct !{!27, !14}
!28 = distinct !{!28, !14}


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