; LLVM IR from wkoszek/kmnsim :: src (all)

; 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.network = type { i64, %struct.nids, %struct.connlist, %struct.arptable, i32, i32, i32, i32, ptr, ptr, [1024 x i8] }
%struct.nids = type { ptr, ptr }
%struct.connlist = type { ptr, ptr }
%struct.arptable = type { ptr, ptr }
%struct.nid = type { i64, [64 x i8], i32, i32, ptr, %struct.anon.0 }
%struct.anon.0 = type { ptr, ptr }
%struct.hub = type { i64, ptr, [8 x ptr], i32, i32, %struct.anon.1 }
%struct.anon.1 = type { ptr, ptr }
%struct.iface = type { i64, ptr, ptr, %struct.pktq, %struct.pktq, i32, ptr, [4 x i32], [4 x i32], [6 x i32], %struct.anon }
%struct.pktq = type { ptr, ptr }
%struct.anon = type { ptr, ptr }

@.str.2 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.115 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.116 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.132 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.133 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.146 = external hidden unnamed_addr constant [17 x i8], align 1
@__PRETTY_FUNCTION__.hub_remove = external hidden unnamed_addr constant [47 x i8], align 1
@.str.148 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.149 = external hidden unnamed_addr constant [33 x i8], align 1

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

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

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @nid_lookup(ptr noundef, ptr noundef, i32 noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @hub_remove(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %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
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  store ptr null, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  store ptr null, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  store ptr null, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  store i32 0, ptr %9, align 4, !tbaa !9
  %11 = load ptr, ptr %4, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.network, ptr %11, i32 0, i32 0
  %13 = load i64, ptr %12, align 8, !tbaa !11
  %14 = icmp eq i64 %13, 473585002
  br i1 %14, label %15, label %16

15:                                               ; preds = %2
  br label %17

16:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str.6, ptr noundef @.str.2, i32 noundef 1827, ptr noundef @__PRETTY_FUNCTION__.hub_remove) #4
  unreachable

17:                                               ; preds = %15
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = icmp ne ptr %18, null
  br i1 %19, label %20, label %21

20:                                               ; preds = %17
  br label %22

21:                                               ; preds = %17
  call void @__assert_fail(ptr noundef @.str.146, ptr noundef @.str.2, i32 noundef 1828, ptr noundef @__PRETTY_FUNCTION__.hub_remove) #4
  unreachable

22:                                               ; preds = %20
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.network, ptr %23, i32 0, i32 1
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = call ptr @nid_lookup(ptr noundef %24, ptr noundef %25, i32 noundef -1, i32 noundef 3)
  store ptr %26, ptr %6, align 8, !tbaa !5
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = icmp eq ptr %27, null
  br i1 %28, label %29, label %33

29:                                               ; preds = %22
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = call i32 (ptr, ptr, ...) @network_err(ptr noundef %30, ptr noundef @.str.148, ptr noundef %31)
  store i32 %32, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %118

33:                                               ; preds = %22
  br label %34

34:                                               ; preds = %33
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = icmp ne ptr %35, null
  br i1 %36, label %37, label %38

37:                                               ; preds = %34
  br label %39

38:                                               ; preds = %34
  call void @__assert_fail(ptr noundef @.str.132, ptr noundef @.str.2, i32 noundef 1834, ptr noundef @__PRETTY_FUNCTION__.hub_remove) #4
  unreachable

39:                                               ; preds = %37
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.nid, ptr %40, i32 0, i32 0
  %42 = load i64, ptr %41, align 8, !tbaa !17
  %43 = icmp eq i64 %42, 1805988336
  br i1 %43, label %44, label %45

44:                                               ; preds = %39
  br label %46

45:                                               ; preds = %39
  call void @__assert_fail(ptr noundef @.str.133, ptr noundef @.str.2, i32 noundef 1834, ptr noundef @__PRETTY_FUNCTION__.hub_remove) #4
  unreachable

46:                                               ; preds = %44
  br label %47

47:                                               ; preds = %46
  br label %48

48:                                               ; preds = %47
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.nid, ptr %49, i32 0, i32 4
  %51 = load ptr, ptr %50, align 8, !tbaa !20
  store ptr %51, ptr %7, align 8, !tbaa !5
  %52 = load ptr, ptr %7, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.hub, ptr %52, i32 0, i32 0
  %54 = load i64, ptr %53, align 8, !tbaa !21
  %55 = icmp eq i64 %54, 891901535
  br i1 %55, label %56, label %57

56:                                               ; preds = %48
  br label %58

57:                                               ; preds = %48
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.2, i32 noundef 1836, ptr noundef @__PRETTY_FUNCTION__.hub_remove) #4
  unreachable

58:                                               ; preds = %56
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  %60 = load ptr, ptr %7, align 8, !tbaa !5
  call void @hub_destroy(ptr noundef %59, ptr noundef %60)
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %61

61:                                               ; preds = %114, %58
  %62 = load i32, ptr %9, align 4, !tbaa !9
  %63 = icmp slt i32 %62, 8
  br i1 %63, label %64, label %117

64:                                               ; preds = %61
  %65 = load ptr, ptr %4, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.network, ptr %65, i32 0, i32 1
  %67 = load ptr, ptr %5, align 8, !tbaa !5
  %68 = load i32, ptr %9, align 4, !tbaa !9
  %69 = call ptr @nid_lookup(ptr noundef %66, ptr noundef %67, i32 noundef %68, i32 noundef 2)
  store ptr %69, ptr %6, align 8, !tbaa !5
  %70 = load ptr, ptr %6, align 8, !tbaa !5
  %71 = icmp eq ptr %70, null
  br i1 %71, label %72, label %77

72:                                               ; preds = %64
  %73 = load ptr, ptr %4, align 8, !tbaa !5
  %74 = load ptr, ptr %5, align 8, !tbaa !5
  %75 = load i32, ptr %9, align 4, !tbaa !9
  %76 = call i32 (ptr, ptr, ...) @network_err(ptr noundef %73, ptr noundef @.str.149, ptr noundef %74, i32 noundef %75)
  store i32 %76, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %118

77:                                               ; preds = %64
  br label %78

78:                                               ; preds = %77
  %79 = load ptr, ptr %6, align 8, !tbaa !5
  %80 = icmp ne ptr %79, null
  br i1 %80, label %81, label %82

81:                                               ; preds = %78
  br label %83

82:                                               ; preds = %78
  call void @__assert_fail(ptr noundef @.str.132, ptr noundef @.str.2, i32 noundef 1843, ptr noundef @__PRETTY_FUNCTION__.hub_remove) #4
  unreachable

83:                                               ; preds = %81
  %84 = load ptr, ptr %6, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.nid, ptr %84, i32 0, i32 0
  %86 = load i64, ptr %85, align 8, !tbaa !17
  %87 = icmp eq i64 %86, 1805988336
  br i1 %87, label %88, label %89

88:                                               ; preds = %83
  br label %90

89:                                               ; preds = %83
  call void @__assert_fail(ptr noundef @.str.133, ptr noundef @.str.2, i32 noundef 1843, ptr noundef @__PRETTY_FUNCTION__.hub_remove) #4
  unreachable

90:                                               ; preds = %88
  br label %91

91:                                               ; preds = %90
  br label %92

92:                                               ; preds = %91
  %93 = load ptr, ptr %6, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.nid, ptr %93, i32 0, i32 4
  %95 = load ptr, ptr %94, align 8, !tbaa !20
  store ptr %95, ptr %8, align 8, !tbaa !5
  br label %96

96:                                               ; preds = %92
  %97 = load ptr, ptr %8, align 8, !tbaa !5
  %98 = icmp ne ptr %97, null
  br i1 %98, label %99, label %100

99:                                               ; preds = %96
  br label %101

100:                                              ; preds = %96
  call void @__assert_fail(ptr noundef @.str.115, ptr noundef @.str.2, i32 noundef 1845, ptr noundef @__PRETTY_FUNCTION__.hub_remove) #4
  unreachable

101:                                              ; preds = %99
  %102 = load ptr, ptr %8, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.iface, ptr %102, i32 0, i32 0
  %104 = load i64, ptr %103, align 8, !tbaa !23
  %105 = icmp eq i64 %104, 1991415775
  br i1 %105, label %106, label %107

106:                                              ; preds = %101
  br label %108

107:                                              ; preds = %101
  call void @__assert_fail(ptr noundef @.str.116, ptr noundef @.str.2, i32 noundef 1845, ptr noundef @__PRETTY_FUNCTION__.hub_remove) #4
  unreachable

108:                                              ; preds = %106
  br label %109

109:                                              ; preds = %108
  br label %110

110:                                              ; preds = %109
  %111 = load ptr, ptr %4, align 8, !tbaa !5
  %112 = load ptr, ptr %8, align 8, !tbaa !5
  %113 = call i32 @iface_destroy(ptr noundef %111, ptr noundef %112)
  br label %114

114:                                              ; preds = %110
  %115 = load i32, ptr %9, align 4, !tbaa !9
  %116 = add nsw i32 %115, 1
  store i32 %116, ptr %9, align 4, !tbaa !9
  br label %61, !llvm.loop !26

117:                                              ; preds = %61
  store i32 0, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %118

118:                                              ; preds = %117, %72, %29
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  %119 = load i32, ptr %3, align 4
  ret i32 %119
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @iface_destroy(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @hub_destroy(ptr noundef, ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { nounwind }
attributes #4 = { 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"network", !13, i64 0, !14, i64 8, !15, i64 24, !16, i64 40, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !6, i64 72, !6, i64 80, !7, i64 88}
!13 = !{!"long", !7, i64 0}
!14 = !{!"nids", !6, i64 0, !6, i64 8}
!15 = !{!"connlist", !6, i64 0, !6, i64 8}
!16 = !{!"arptable", !6, i64 0, !6, i64 8}
!17 = !{!18, !13, i64 0}
!18 = !{!"nid", !13, i64 0, !7, i64 8, !10, i64 72, !10, i64 76, !6, i64 80, !19, i64 88}
!19 = !{!"", !6, i64 0, !6, i64 8}
!20 = !{!18, !6, i64 80}
!21 = !{!22, !13, i64 0}
!22 = !{!"hub", !13, i64 0, !6, i64 8, !7, i64 16, !10, i64 80, !10, i64 84, !19, i64 88}
!23 = !{!24, !13, i64 0}
!24 = !{!"iface", !13, i64 0, !6, i64 8, !6, i64 16, !25, i64 24, !25, i64 40, !10, i64 56, !6, i64 64, !7, i64 72, !7, i64 88, !7, i64 104, !19, i64 128}
!25 = !{!"pktq", !6, i64 0, !6, i64 8}
!26 = distinct !{!26, !27}
!27 = !{!"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"

@.str.2 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.115 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.116 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.133 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.146 = external hidden unnamed_addr constant [17 x i8], align 1
@__PRETTY_FUNCTION__.hub_remove = external hidden unnamed_addr constant [47 x i8], align 1
@.str.148 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.149 = external hidden unnamed_addr constant [33 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @network_err(ptr noundef, ptr noundef, ...) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @nid_lookup(ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local i32 @hub_remove(ptr noundef %0, ptr noundef %1) local_unnamed_addr #1 {
  %3 = load i64, ptr %0, align 8, !tbaa !5
  %4 = icmp eq i64 %3, 473585002
  br i1 %4, label %6, label %5

5:                                                ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.2, i32 noundef 1827, ptr noundef nonnull @__PRETTY_FUNCTION__.hub_remove) #2
  unreachable

6:                                                ; preds = %2
  %.not = icmp eq ptr %1, null
  br i1 %.not, label %7, label %8

7:                                                ; preds = %6
  tail call void @__assert_fail(ptr noundef nonnull @.str.146, ptr noundef nonnull @.str.2, i32 noundef 1828, ptr noundef nonnull @__PRETTY_FUNCTION__.hub_remove) #2
  unreachable

8:                                                ; preds = %6
  %9 = getelementptr inbounds i8, ptr %0, i64 8
  %10 = tail call ptr @nid_lookup(ptr noundef nonnull %9, ptr noundef nonnull %1, i32 noundef -1, i32 noundef 3)
  %11 = icmp eq ptr %10, null
  br i1 %11, label %12, label %14

12:                                               ; preds = %8
  %13 = tail call i32 (ptr, ptr, ...) @network_err(ptr noundef nonnull %0, ptr noundef nonnull @.str.148, ptr noundef nonnull %1)
  br label %.loopexit

14:                                               ; preds = %8
  %15 = load i64, ptr %10, align 8, !tbaa !15
  %16 = icmp eq i64 %15, 1805988336
  br i1 %16, label %18, label %17

17:                                               ; preds = %14
  tail call void @__assert_fail(ptr noundef nonnull @.str.133, ptr noundef nonnull @.str.2, i32 noundef 1834, ptr noundef nonnull @__PRETTY_FUNCTION__.hub_remove) #2
  unreachable

18:                                               ; preds = %14
  %19 = getelementptr inbounds i8, ptr %10, i64 80
  %20 = load ptr, ptr %19, align 8, !tbaa !18
  %21 = load i64, ptr %20, align 8, !tbaa !19
  %22 = icmp eq i64 %21, 891901535
  br i1 %22, label %24, label %23

23:                                               ; preds = %18
  tail call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.2, i32 noundef 1836, ptr noundef nonnull @__PRETTY_FUNCTION__.hub_remove) #2
  unreachable

24:                                               ; preds = %18
  tail call void @hub_destroy(ptr noundef nonnull %0, ptr noundef nonnull %20)
  %25 = tail call ptr @nid_lookup(ptr noundef nonnull %9, ptr noundef nonnull %1, i32 noundef 0, i32 noundef 2)
  %26 = icmp eq ptr %25, null
  br i1 %26, label %27, label %29

27:                                               ; preds = %119, %106, %93, %80, %67, %54, %41, %24
  %.039.lcssa = phi i32 [ 0, %24 ], [ 1, %41 ], [ 2, %54 ], [ 3, %67 ], [ 4, %80 ], [ 5, %93 ], [ 6, %106 ], [ 7, %119 ]
  %28 = tail call i32 (ptr, ptr, ...) @network_err(ptr noundef nonnull %0, ptr noundef nonnull @.str.149, ptr noundef nonnull %1, i32 noundef %.039.lcssa)
  br label %.loopexit

29:                                               ; preds = %24
  %30 = load i64, ptr %25, align 8, !tbaa !15
  %31 = icmp eq i64 %30, 1805988336
  br i1 %31, label %33, label %32

32:                                               ; preds = %123, %110, %97, %84, %71, %58, %45, %29
  tail call void @__assert_fail(ptr noundef nonnull @.str.133, ptr noundef nonnull @.str.2, i32 noundef 1843, ptr noundef nonnull @__PRETTY_FUNCTION__.hub_remove) #2
  unreachable

33:                                               ; preds = %29
  %34 = getelementptr inbounds i8, ptr %25, i64 80
  %35 = load ptr, ptr %34, align 8, !tbaa !18
  %.not34 = icmp eq ptr %35, null
  br i1 %.not34, label %36, label %37

36:                                               ; preds = %126, %113, %100, %87, %74, %61, %48, %33
  tail call void @__assert_fail(ptr noundef nonnull @.str.115, ptr noundef nonnull @.str.2, i32 noundef 1845, ptr noundef nonnull @__PRETTY_FUNCTION__.hub_remove) #2
  unreachable

37:                                               ; preds = %33
  %38 = load i64, ptr %35, align 8, !tbaa !21
  %39 = icmp eq i64 %38, 1991415775
  br i1 %39, label %41, label %40

40:                                               ; preds = %129, %116, %103, %90, %77, %64, %51, %37
  tail call void @__assert_fail(ptr noundef nonnull @.str.116, ptr noundef nonnull @.str.2, i32 noundef 1845, ptr noundef nonnull @__PRETTY_FUNCTION__.hub_remove) #2
  unreachable

41:                                               ; preds = %37
  %42 = tail call i32 @iface_destroy(ptr noundef nonnull %0, ptr noundef nonnull %35)
  %43 = tail call ptr @nid_lookup(ptr noundef nonnull %9, ptr noundef nonnull %1, i32 noundef 1, i32 noundef 2)
  %44 = icmp eq ptr %43, null
  br i1 %44, label %27, label %45

45:                                               ; preds = %41
  %46 = load i64, ptr %43, align 8, !tbaa !15
  %47 = icmp eq i64 %46, 1805988336
  br i1 %47, label %48, label %32

48:                                               ; preds = %45
  %49 = getelementptr inbounds i8, ptr %43, i64 80
  %50 = load ptr, ptr %49, align 8, !tbaa !18
  %.not34.1 = icmp eq ptr %50, null
  br i1 %.not34.1, label %36, label %51

51:                                               ; preds = %48
  %52 = load i64, ptr %50, align 8, !tbaa !21
  %53 = icmp eq i64 %52, 1991415775
  br i1 %53, label %54, label %40

54:                                               ; preds = %51
  %55 = tail call i32 @iface_destroy(ptr noundef nonnull %0, ptr noundef nonnull %50)
  %56 = tail call ptr @nid_lookup(ptr noundef nonnull %9, ptr noundef nonnull %1, i32 noundef 2, i32 noundef 2)
  %57 = icmp eq ptr %56, null
  br i1 %57, label %27, label %58

58:                                               ; preds = %54
  %59 = load i64, ptr %56, align 8, !tbaa !15
  %60 = icmp eq i64 %59, 1805988336
  br i1 %60, label %61, label %32

61:                                               ; preds = %58
  %62 = getelementptr inbounds i8, ptr %56, i64 80
  %63 = load ptr, ptr %62, align 8, !tbaa !18
  %.not34.2 = icmp eq ptr %63, null
  br i1 %.not34.2, label %36, label %64

64:                                               ; preds = %61
  %65 = load i64, ptr %63, align 8, !tbaa !21
  %66 = icmp eq i64 %65, 1991415775
  br i1 %66, label %67, label %40

67:                                               ; preds = %64
  %68 = tail call i32 @iface_destroy(ptr noundef nonnull %0, ptr noundef nonnull %63)
  %69 = tail call ptr @nid_lookup(ptr noundef nonnull %9, ptr noundef nonnull %1, i32 noundef 3, i32 noundef 2)
  %70 = icmp eq ptr %69, null
  br i1 %70, label %27, label %71

71:                                               ; preds = %67
  %72 = load i64, ptr %69, align 8, !tbaa !15
  %73 = icmp eq i64 %72, 1805988336
  br i1 %73, label %74, label %32

74:                                               ; preds = %71
  %75 = getelementptr inbounds i8, ptr %69, i64 80
  %76 = load ptr, ptr %75, align 8, !tbaa !18
  %.not34.3 = icmp eq ptr %76, null
  br i1 %.not34.3, label %36, label %77

77:                                               ; preds = %74
  %78 = load i64, ptr %76, align 8, !tbaa !21
  %79 = icmp eq i64 %78, 1991415775
  br i1 %79, label %80, label %40

80:                                               ; preds = %77
  %81 = tail call i32 @iface_destroy(ptr noundef nonnull %0, ptr noundef nonnull %76)
  %82 = tail call ptr @nid_lookup(ptr noundef nonnull %9, ptr noundef nonnull %1, i32 noundef 4, i32 noundef 2)
  %83 = icmp eq ptr %82, null
  br i1 %83, label %27, label %84

84:                                               ; preds = %80
  %85 = load i64, ptr %82, align 8, !tbaa !15
  %86 = icmp eq i64 %85, 1805988336
  br i1 %86, label %87, label %32

87:                                               ; preds = %84
  %88 = getelementptr inbounds i8, ptr %82, i64 80
  %89 = load ptr, ptr %88, align 8, !tbaa !18
  %.not34.4 = icmp eq ptr %89, null
  br i1 %.not34.4, label %36, label %90

90:                                               ; preds = %87
  %91 = load i64, ptr %89, align 8, !tbaa !21
  %92 = icmp eq i64 %91, 1991415775
  br i1 %92, label %93, label %40

93:                                               ; preds = %90
  %94 = tail call i32 @iface_destroy(ptr noundef nonnull %0, ptr noundef nonnull %89)
  %95 = tail call ptr @nid_lookup(ptr noundef nonnull %9, ptr noundef nonnull %1, i32 noundef 5, i32 noundef 2)
  %96 = icmp eq ptr %95, null
  br i1 %96, label %27, label %97

97:                                               ; preds = %93
  %98 = load i64, ptr %95, align 8, !tbaa !15
  %99 = icmp eq i64 %98, 1805988336
  br i1 %99, label %100, label %32

100:                                              ; preds = %97
  %101 = getelementptr inbounds i8, ptr %95, i64 80
  %102 = load ptr, ptr %101, align 8, !tbaa !18
  %.not34.5 = icmp eq ptr %102, null
  br i1 %.not34.5, label %36, label %103

103:                                              ; preds = %100
  %104 = load i64, ptr %102, align 8, !tbaa !21
  %105 = icmp eq i64 %104, 1991415775
  br i1 %105, label %106, label %40

106:                                              ; preds = %103
  %107 = tail call i32 @iface_destroy(ptr noundef nonnull %0, ptr noundef nonnull %102)
  %108 = tail call ptr @nid_lookup(ptr noundef nonnull %9, ptr noundef nonnull %1, i32 noundef 6, i32 noundef 2)
  %109 = icmp eq ptr %108, null
  br i1 %109, label %27, label %110

110:                                              ; preds = %106
  %111 = load i64, ptr %108, align 8, !tbaa !15
  %112 = icmp eq i64 %111, 1805988336
  br i1 %112, label %113, label %32

113:                                              ; preds = %110
  %114 = getelementptr inbounds i8, ptr %108, i64 80
  %115 = load ptr, ptr %114, align 8, !tbaa !18
  %.not34.6 = icmp eq ptr %115, null
  br i1 %.not34.6, label %36, label %116

116:                                              ; preds = %113
  %117 = load i64, ptr %115, align 8, !tbaa !21
  %118 = icmp eq i64 %117, 1991415775
  br i1 %118, label %119, label %40

119:                                              ; preds = %116
  %120 = tail call i32 @iface_destroy(ptr noundef nonnull %0, ptr noundef nonnull %115)
  %121 = tail call ptr @nid_lookup(ptr noundef nonnull %9, ptr noundef nonnull %1, i32 noundef 7, i32 noundef 2)
  %122 = icmp eq ptr %121, null
  br i1 %122, label %27, label %123

123:                                              ; preds = %119
  %124 = load i64, ptr %121, align 8, !tbaa !15
  %125 = icmp eq i64 %124, 1805988336
  br i1 %125, label %126, label %32

126:                                              ; preds = %123
  %127 = getelementptr inbounds i8, ptr %121, i64 80
  %128 = load ptr, ptr %127, align 8, !tbaa !18
  %.not34.7 = icmp eq ptr %128, null
  br i1 %.not34.7, label %36, label %129

129:                                              ; preds = %126
  %130 = load i64, ptr %128, align 8, !tbaa !21
  %131 = icmp eq i64 %130, 1991415775
  br i1 %131, label %.loopexit.loopexit, label %40

.loopexit.loopexit:                               ; preds = %129
  %132 = tail call i32 @iface_destroy(ptr noundef nonnull %0, ptr noundef nonnull %128)
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %27, %12
  %.029 = phi i32 [ %13, %12 ], [ %28, %27 ], [ 0, %.loopexit.loopexit ]
  ret i32 %.029
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @iface_destroy(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @hub_destroy(ptr noundef, ptr noundef) local_unnamed_addr #1

attributes #0 = { 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 #1 = { 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 #2 = { 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, !7, i64 0}
!6 = !{!"network", !7, i64 0, !10, i64 8, !12, i64 24, !13, i64 40, !14, i64 56, !14, i64 60, !14, i64 64, !14, i64 68, !11, i64 72, !11, i64 80, !8, i64 88}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"nids", !11, i64 0, !11, i64 8}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"connlist", !11, i64 0, !11, i64 8}
!13 = !{!"arptable", !11, i64 0, !11, i64 8}
!14 = !{!"int", !8, i64 0}
!15 = !{!16, !7, i64 0}
!16 = !{!"nid", !7, i64 0, !8, i64 8, !14, i64 72, !14, i64 76, !11, i64 80, !17, i64 88}
!17 = !{!"", !11, i64 0, !11, i64 8}
!18 = !{!16, !11, i64 80}
!19 = !{!20, !7, i64 0}
!20 = !{!"hub", !7, i64 0, !11, i64 8, !8, i64 16, !14, i64 80, !14, i64 84, !17, i64 88}
!21 = !{!22, !7, i64 0}
!22 = !{!"iface", !7, i64 0, !11, i64 8, !11, i64 16, !23, i64 24, !23, i64 40, !14, i64 56, !11, i64 64, !8, i64 72, !8, i64 88, !8, i64 104, !17, i64 128}
!23 = !{!"pktq", !11, i64 0, !11, i64 8}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,SROAPass,SimplifyCFGPass,TailCallElimPass