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

; 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.bpf_program = type { i32, ptr }

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [30 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [28 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 [256 x i8], align 16
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca %struct.bpf_program, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = 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) #4
  call void @llvm.lifetime.start.p0(i64 256, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  store ptr null, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  store ptr null, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  store ptr null, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %19 = load i32, ptr %4, align 4, !tbaa !5
  %20 = icmp eq i32 %19, 1
  br i1 %20, label %21, label %22

21:                                               ; preds = %2
  call void @usage()
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %18, align 4
  br label %127

22:                                               ; preds = %2
  store i32 1, ptr %11, align 4, !tbaa !5
  br label %23

23:                                               ; preds = %58, %22
  %24 = load i32, ptr %11, align 4, !tbaa !5
  %25 = load i32, ptr %4, align 4, !tbaa !5
  %26 = icmp slt i32 %24, %25
  br i1 %26, label %27, label %61

27:                                               ; preds = %23
  %28 = load ptr, ptr %5, align 8, !tbaa !9
  %29 = load i32, ptr %11, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds ptr, ptr %28, i64 %30
  %32 = load ptr, ptr %31, align 8, !tbaa !9
  %33 = getelementptr inbounds i8, ptr %32, i64 1
  %34 = load i8, ptr %33, align 1, !tbaa !11
  %35 = sext i8 %34 to i32
  switch i32 %35, label %57 [
    i32 115, label %36
    i32 111, label %43
    i32 102, label %50
  ]

36:                                               ; preds = %27
  %37 = load ptr, ptr %5, align 8, !tbaa !9
  %38 = load i32, ptr %11, align 4, !tbaa !5
  %39 = add nsw i32 %38, 1
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds ptr, ptr %37, i64 %40
  %42 = load ptr, ptr %41, align 8, !tbaa !9
  store ptr %42, ptr %8, align 8, !tbaa !9
  br label %57

43:                                               ; preds = %27
  %44 = load ptr, ptr %5, align 8, !tbaa !9
  %45 = load i32, ptr %11, align 4, !tbaa !5
  %46 = add nsw i32 %45, 1
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds ptr, ptr %44, i64 %47
  %49 = load ptr, ptr %48, align 8, !tbaa !9
  store ptr %49, ptr %9, align 8, !tbaa !9
  br label %57

50:                                               ; preds = %27
  %51 = load ptr, ptr %5, align 8, !tbaa !9
  %52 = load i32, ptr %11, align 4, !tbaa !5
  %53 = add nsw i32 %52, 1
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds ptr, ptr %51, i64 %54
  %56 = load ptr, ptr %55, align 8, !tbaa !9
  store ptr %56, ptr %10, align 8, !tbaa !9
  br label %57

57:                                               ; preds = %50, %43, %36, %27
  br label %58

58:                                               ; preds = %57
  %59 = load i32, ptr %11, align 4, !tbaa !5
  %60 = add nsw i32 %59, 2
  store i32 %60, ptr %11, align 4, !tbaa !5
  br label %23, !llvm.loop !12

61:                                               ; preds = %23
  %62 = load ptr, ptr %8, align 8, !tbaa !9
  %63 = icmp ne ptr %62, null
  br i1 %63, label %64, label %73

64:                                               ; preds = %61
  %65 = load ptr, ptr %8, align 8, !tbaa !9
  %66 = getelementptr inbounds [256 x i8], ptr %7, i64 0, i64 0
  %67 = call ptr @pcap_open_live(ptr noundef %65, i32 noundef 65536, i32 noundef 1, i32 noundef 1000, ptr noundef %66)
  store ptr %67, ptr %6, align 8, !tbaa !9
  %68 = icmp eq ptr %67, null
  br i1 %68, label %69, label %72

69:                                               ; preds = %64
  %70 = load ptr, ptr @stderr, align 8, !tbaa !9
  %71 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %70, ptr noundef @.str) #4
  store i32 -2, ptr %3, align 4
  store i32 1, ptr %18, align 4
  br label %127

72:                                               ; preds = %64
  br label %74

73:                                               ; preds = %61
  call void @usage()
  br label %74

74:                                               ; preds = %73, %72
  %75 = load ptr, ptr %10, align 8, !tbaa !9
  %76 = icmp ne ptr %75, null
  br i1 %76, label %77, label %96

77:                                               ; preds = %74
  store i32 16777215, ptr %14, align 4, !tbaa !5
  %78 = load ptr, ptr %6, align 8, !tbaa !9
  %79 = load ptr, ptr %10, align 8, !tbaa !9
  %80 = load i32, ptr %14, align 4, !tbaa !5
  %81 = call i32 @pcap_compile(ptr noundef %78, ptr noundef %13, ptr noundef %79, i32 noundef 1, i32 noundef %80)
  %82 = icmp slt i32 %81, 0
  br i1 %82, label %83, label %87

83:                                               ; preds = %77
  %84 = load ptr, ptr @stderr, align 8, !tbaa !9
  %85 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %84, ptr noundef @.str.1) #4
  %86 = load ptr, ptr %6, align 8, !tbaa !9
  call void @pcap_close(ptr noundef %86)
  store i32 -3, ptr %3, align 4
  store i32 1, ptr %18, align 4
  br label %127

87:                                               ; preds = %77
  %88 = load ptr, ptr %6, align 8, !tbaa !9
  %89 = call i32 @pcap_setfilter(ptr noundef %88, ptr noundef %13)
  %90 = icmp slt i32 %89, 0
  br i1 %90, label %91, label %95

91:                                               ; preds = %87
  %92 = load ptr, ptr @stderr, align 8, !tbaa !9
  %93 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %92, ptr noundef @.str.2) #4
  %94 = load ptr, ptr %6, align 8, !tbaa !9
  call void @pcap_close(ptr noundef %94)
  store i32 -4, ptr %3, align 4
  store i32 1, ptr %18, align 4
  br label %127

95:                                               ; preds = %87
  br label %96

96:                                               ; preds = %95, %74
  %97 = load ptr, ptr %9, align 8, !tbaa !9
  %98 = icmp ne ptr %97, null
  br i1 %98, label %99, label %110

99:                                               ; preds = %96
  %100 = load ptr, ptr %6, align 8, !tbaa !9
  %101 = load ptr, ptr %9, align 8, !tbaa !9
  %102 = call ptr @pcap_dump_open(ptr noundef %100, ptr noundef %101)
  store ptr %102, ptr %12, align 8, !tbaa !9
  %103 = load ptr, ptr %12, align 8, !tbaa !9
  %104 = icmp eq ptr %103, null
  br i1 %104, label %105, label %109

105:                                              ; preds = %99
  %106 = load ptr, ptr @stderr, align 8, !tbaa !9
  %107 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %106, ptr noundef @.str.3) #4
  %108 = load ptr, ptr %6, align 8, !tbaa !9
  call void @pcap_close(ptr noundef %108)
  store i32 -5, ptr %3, align 4
  store i32 1, ptr %18, align 4
  br label %127

109:                                              ; preds = %99
  br label %111

110:                                              ; preds = %96
  call void @usage()
  br label %111

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

112:                                              ; preds = %120, %119, %111
  %113 = load ptr, ptr %6, align 8, !tbaa !9
  %114 = call i32 @pcap_next_ex(ptr noundef %113, ptr noundef %16, ptr noundef %17)
  store i32 %114, ptr %15, align 4, !tbaa !5
  %115 = icmp sge i32 %114, 0
  br i1 %115, label %116, label %124

116:                                              ; preds = %112
  %117 = load i32, ptr %15, 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 !14

120:                                              ; preds = %116
  %121 = load ptr, ptr %12, align 8, !tbaa !9
  %122 = load ptr, ptr %16, align 8, !tbaa !9
  %123 = load ptr, ptr %17, align 8, !tbaa !9
  call void @pcap_dump(ptr noundef %121, ptr noundef %122, ptr noundef %123)
  br label %112, !llvm.loop !14

124:                                              ; preds = %112
  %125 = load ptr, ptr %6, align 8, !tbaa !9
  call void @pcap_close(ptr noundef %125)
  %126 = load ptr, ptr %12, align 8, !tbaa !9
  call void @pcap_dump_close(ptr noundef %126)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %18, align 4
  br label %127

127:                                              ; preds = %124, %105, %91, %83, %69, %21
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 256, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  %128 = load i32, ptr %3, align 4
  ret i32 %128
}

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

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

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

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

declare void @pcap_close(ptr noundef) #2

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

declare ptr @pcap_dump_open(ptr noundef, ptr noundef) #2

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

declare void @pcap_dump(ptr noundef, ptr noundef, ptr noundef) #2

declare void @pcap_dump_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

; Function Attrs: nounwind uwtable
declare dso_local void @usage() #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 = { "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 = { 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 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}


; 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.bpf_program = type { i32, ptr }

@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [30 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [28 x i8], align 1

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

.preheader:                                       ; preds = %2
  %8 = icmp sgt i32 %0, 1
  br i1 %8, label %.lr.ph.preheader, label %._crit_edge.thread

.lr.ph.preheader:                                 ; preds = %.preheader
  %9 = zext nneg i32 %0 to i64
  %10 = add nsw i64 %9, -2
  %11 = icmp ult i64 %10, 2
  br i1 %11, label %._crit_edge.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %12 = lshr i64 %10, 1
  %13 = add nuw i64 %12, 1
  %unroll_iter = and i64 %13, -2
  br label %.lr.ph

14:                                               ; preds = %2
  tail call void @usage()
  br label %94

.lr.ph:                                           ; preds = %42, %.lr.ph.preheader.new
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader.new ], [ %indvars.iv.next.1, %42 ]
  %.03447 = phi ptr [ null, %.lr.ph.preheader.new ], [ %.1.1, %42 ]
  %.03546 = phi ptr [ null, %.lr.ph.preheader.new ], [ %.136.1, %42 ]
  %.03745 = phi ptr [ null, %.lr.ph.preheader.new ], [ %.138.1, %42 ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.1, %42 ]
  %15 = getelementptr inbounds ptr, ptr %1, i64 %indvars.iv
  %16 = load ptr, ptr %15, align 8, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %16, i64 1
  %18 = load i8, ptr %17, align 1, !tbaa !9
  switch i8 %18, label %.lr.ph.1 [
    i8 115, label %19
    i8 111, label %22
    i8 102, label %25
  ]

19:                                               ; preds = %.lr.ph
  %20 = getelementptr inbounds i8, ptr %15, i64 8
  %21 = load ptr, ptr %20, align 8, !tbaa !5
  br label %.lr.ph.1

22:                                               ; preds = %.lr.ph
  %23 = getelementptr inbounds i8, ptr %15, i64 8
  %24 = load ptr, ptr %23, align 8, !tbaa !5
  br label %.lr.ph.1

25:                                               ; preds = %.lr.ph
  %26 = getelementptr inbounds i8, ptr %15, i64 8
  %27 = load ptr, ptr %26, align 8, !tbaa !5
  br label %.lr.ph.1

.lr.ph.1:                                         ; preds = %.lr.ph, %19, %22, %25
  %.138 = phi ptr [ %.03745, %.lr.ph ], [ %.03745, %25 ], [ %.03745, %22 ], [ %21, %19 ]
  %.136 = phi ptr [ %.03546, %.lr.ph ], [ %.03546, %25 ], [ %24, %22 ], [ %.03546, %19 ]
  %.1 = phi ptr [ %.03447, %.lr.ph ], [ %27, %25 ], [ %.03447, %22 ], [ %.03447, %19 ]
  %28 = getelementptr inbounds ptr, ptr %1, i64 %indvars.iv
  %29 = getelementptr inbounds i8, ptr %28, i64 16
  %30 = load ptr, ptr %29, align 8, !tbaa !5
  %31 = getelementptr inbounds i8, ptr %30, i64 1
  %32 = load i8, ptr %31, align 1, !tbaa !9
  switch i8 %32, label %42 [
    i8 115, label %39
    i8 111, label %36
    i8 102, label %33
  ]

33:                                               ; preds = %.lr.ph.1
  %34 = getelementptr inbounds i8, ptr %28, i64 24
  %35 = load ptr, ptr %34, align 8, !tbaa !5
  br label %42

36:                                               ; preds = %.lr.ph.1
  %37 = getelementptr inbounds i8, ptr %28, i64 24
  %38 = load ptr, ptr %37, align 8, !tbaa !5
  br label %42

39:                                               ; preds = %.lr.ph.1
  %40 = getelementptr inbounds i8, ptr %28, i64 24
  %41 = load ptr, ptr %40, align 8, !tbaa !5
  br label %42

42:                                               ; preds = %39, %36, %33, %.lr.ph.1
  %.138.1 = phi ptr [ %.138, %.lr.ph.1 ], [ %.138, %33 ], [ %.138, %36 ], [ %41, %39 ]
  %.136.1 = phi ptr [ %.136, %.lr.ph.1 ], [ %.136, %33 ], [ %38, %36 ], [ %.136, %39 ]
  %.1.1 = phi ptr [ %.1, %.lr.ph.1 ], [ %35, %33 ], [ %.1, %36 ], [ %.1, %39 ]
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 4
  %niter.next.1 = add nuw i64 %niter, 2
  %niter.ncmp.1.not = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1.not, label %._crit_edge.unr-lcssa, label %.lr.ph, !llvm.loop !10

._crit_edge.unr-lcssa:                            ; preds = %42, %.lr.ph.preheader
  %.138.lcssa.ph = phi ptr [ poison, %.lr.ph.preheader ], [ %.138.1, %42 ]
  %.136.lcssa.ph = phi ptr [ poison, %.lr.ph.preheader ], [ %.136.1, %42 ]
  %.1.lcssa.ph = phi ptr [ poison, %.lr.ph.preheader ], [ %.1.1, %42 ]
  %indvars.iv.unr = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next.1, %42 ]
  %.03447.unr = phi ptr [ null, %.lr.ph.preheader ], [ %.1.1, %42 ]
  %.03546.unr = phi ptr [ null, %.lr.ph.preheader ], [ %.136.1, %42 ]
  %.03745.unr = phi ptr [ null, %.lr.ph.preheader ], [ %.138.1, %42 ]
  %43 = and i64 %10, 2
  %lcmp.mod.not.not = icmp eq i64 %43, 0
  br i1 %lcmp.mod.not.not, label %.lr.ph.epil, label %._crit_edge

.lr.ph.epil:                                      ; preds = %._crit_edge.unr-lcssa
  %44 = getelementptr inbounds ptr, ptr %1, i64 %indvars.iv.unr
  %45 = load ptr, ptr %44, align 8, !tbaa !5
  %46 = getelementptr inbounds i8, ptr %45, i64 1
  %47 = load i8, ptr %46, align 1, !tbaa !9
  switch i8 %47, label %._crit_edge [
    i8 115, label %54
    i8 111, label %51
    i8 102, label %48
  ]

48:                                               ; preds = %.lr.ph.epil
  %49 = getelementptr inbounds i8, ptr %44, i64 8
  %50 = load ptr, ptr %49, align 8, !tbaa !5
  br label %._crit_edge

51:                                               ; preds = %.lr.ph.epil
  %52 = getelementptr inbounds i8, ptr %44, i64 8
  %53 = load ptr, ptr %52, align 8, !tbaa !5
  br label %._crit_edge

54:                                               ; preds = %.lr.ph.epil
  %55 = getelementptr inbounds i8, ptr %44, i64 8
  %56 = load ptr, ptr %55, align 8, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph.epil, %48, %51, %54, %._crit_edge.unr-lcssa
  %.138.lcssa = phi ptr [ %.138.lcssa.ph, %._crit_edge.unr-lcssa ], [ %.03745.unr, %.lr.ph.epil ], [ %.03745.unr, %48 ], [ %.03745.unr, %51 ], [ %56, %54 ]
  %.136.lcssa = phi ptr [ %.136.lcssa.ph, %._crit_edge.unr-lcssa ], [ %.03546.unr, %.lr.ph.epil ], [ %.03546.unr, %48 ], [ %53, %51 ], [ %.03546.unr, %54 ]
  %.1.lcssa = phi ptr [ %.1.lcssa.ph, %._crit_edge.unr-lcssa ], [ %.03447.unr, %.lr.ph.epil ], [ %50, %48 ], [ %.03447.unr, %51 ], [ %.03447.unr, %54 ]
  %.not = icmp eq ptr %.138.lcssa, null
  br i1 %.not, label %._crit_edge.thread, label %57

57:                                               ; preds = %._crit_edge
  %58 = call ptr @pcap_open_live(ptr noundef nonnull %.138.lcssa, i32 noundef 65536, i32 noundef 1, i32 noundef 1000, ptr noundef nonnull %3) #4
  %59 = icmp eq ptr %58, null
  br i1 %59, label %60, label %63

60:                                               ; preds = %57
  %61 = load ptr, ptr @stderr, align 8, !tbaa !5
  %62 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %61, ptr noundef nonnull @.str) #5
  br label %94

._crit_edge.thread:                               ; preds = %.preheader, %._crit_edge
  %.034.lcssa62 = phi ptr [ %.1.lcssa, %._crit_edge ], [ null, %.preheader ]
  %.035.lcssa60 = phi ptr [ %.136.lcssa, %._crit_edge ], [ null, %.preheader ]
  tail call void @usage()
  br label %63

63:                                               ; preds = %57, %._crit_edge.thread
  %.034.lcssa61 = phi ptr [ %.1.lcssa, %57 ], [ %.034.lcssa62, %._crit_edge.thread ]
  %.035.lcssa59 = phi ptr [ %.136.lcssa, %57 ], [ %.035.lcssa60, %._crit_edge.thread ]
  %.031 = phi ptr [ %58, %57 ], [ undef, %._crit_edge.thread ]
  %.not43 = icmp eq ptr %.034.lcssa61, null
  br i1 %.not43, label %76, label %64

64:                                               ; preds = %63
  %65 = call i32 @pcap_compile(ptr noundef %.031, ptr noundef nonnull %4, ptr noundef nonnull %.034.lcssa61, i32 noundef 1, i32 noundef 16777215) #4
  %66 = icmp slt i32 %65, 0
  br i1 %66, label %67, label %70

67:                                               ; preds = %64
  %68 = load ptr, ptr @stderr, align 8, !tbaa !5
  %69 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %68, ptr noundef nonnull @.str.1) #5
  call void @pcap_close(ptr noundef %.031) #4
  br label %94

70:                                               ; preds = %64
  %71 = call i32 @pcap_setfilter(ptr noundef %.031, ptr noundef nonnull %4) #4
  %72 = icmp slt i32 %71, 0
  br i1 %72, label %73, label %76

73:                                               ; preds = %70
  %74 = load ptr, ptr @stderr, align 8, !tbaa !5
  %75 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %74, ptr noundef nonnull @.str.2) #5
  call void @pcap_close(ptr noundef %.031) #4
  br label %94

76:                                               ; preds = %70, %63
  %.not44 = icmp eq ptr %.035.lcssa59, null
  br i1 %.not44, label %83, label %77

77:                                               ; preds = %76
  %78 = call ptr @pcap_dump_open(ptr noundef %.031, ptr noundef nonnull %.035.lcssa59) #4
  %79 = icmp eq ptr %78, null
  br i1 %79, label %80, label %84

80:                                               ; preds = %77
  %81 = load ptr, ptr @stderr, align 8, !tbaa !5
  %82 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %81, ptr noundef nonnull @.str.3) #5
  call void @pcap_close(ptr noundef %.031) #4
  br label %94

83:                                               ; preds = %76
  call void @usage()
  br label %84

84:                                               ; preds = %77, %83
  %.032 = phi ptr [ %78, %77 ], [ undef, %83 ]
  %85 = call i32 @pcap_next_ex(ptr noundef %.031, ptr noundef nonnull %5, ptr noundef nonnull %6) #4
  %86 = icmp sgt i32 %85, -1
  br i1 %86, label %.lr.ph52, label %._crit_edge53

.lr.ph52:                                         ; preds = %84, %.backedge
  %87 = phi i32 [ %92, %.backedge ], [ %85, %84 ]
  %88 = icmp eq i32 %87, 0
  br i1 %88, label %.backedge, label %89

89:                                               ; preds = %.lr.ph52
  %90 = load ptr, ptr %5, align 8, !tbaa !5
  %91 = load ptr, ptr %6, align 8, !tbaa !5
  call void @pcap_dump(ptr noundef %.032, ptr noundef %90, ptr noundef %91) #4
  br label %.backedge

.backedge:                                        ; preds = %89, %.lr.ph52
  %92 = call i32 @pcap_next_ex(ptr noundef %.031, ptr noundef nonnull %5, ptr noundef nonnull %6) #4
  %93 = icmp sgt i32 %92, -1
  br i1 %93, label %.lr.ph52, label %._crit_edge53, !llvm.loop !12

._crit_edge53:                                    ; preds = %.backedge, %84
  call void @pcap_close(ptr noundef %.031) #4
  call void @pcap_dump_close(ptr noundef %.032) #4
  br label %94

94:                                               ; preds = %._crit_edge53, %80, %73, %67, %60, %14
  %.0 = phi i32 [ -1, %14 ], [ -2, %60 ], [ -3, %67 ], [ -4, %73 ], [ -5, %80 ], [ 0, %._crit_edge53 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %3) #4
  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

declare ptr @pcap_open_live(ptr noundef, i32 noundef, i32 noundef, i32 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 i32 @pcap_compile(ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

declare void @pcap_close(ptr noundef) local_unnamed_addr #2

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

declare ptr @pcap_dump_open(ptr noundef, ptr noundef) local_unnamed_addr #2

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

declare void @pcap_dump(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @pcap_dump_close(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

; Function Attrs: nounwind uwtable
declare dso_local void @usage() 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 = { "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 = { nounwind }
attributes #5 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}


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