; LLVM IR from whoiswelliton/Computer_Engineering_UTFPR-PB :: Embedded_Systems/TIVA Connected TM4C1294XL Projects/01 - lwIP_HTTPServer_on_TIVA (sendto)

; 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.netbuf = type { ptr, ptr, %struct.ip4_addr, i16 }
%struct.ip4_addr = type { i32 }
%struct.lwip_sock = type { ptr, %union.lwip_sock_lastdata, i16, i16, i16, i8 }
%union.lwip_sock_lastdata = type { ptr }
%struct.netconn = type { i32, i32, %union.anon, i8, ptr, ptr, ptr, i32, i32, i32, i8, ptr, ptr }
%union.anon = type { ptr }
%struct.sockaddr = type { i8, i8, [14 x i8] }
%struct.sockaddr_in = type { i8, i8, i16, %struct.in_addr, [8 x i8] }
%struct.in_addr = type { i32 }

@errno = external global i32, align 4
@.str = external hidden unnamed_addr constant [40 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [181 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [29 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: nounwind uwtable
declare hidden ptr @get_socket(i32 noundef) #1

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

declare i32 @err_to_errno(i8 noundef signext) #2

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

declare zeroext i16 @lwip_htons(i16 noundef zeroext) #2

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

; Function Attrs: nounwind uwtable
define dso_local i64 @lwip_sendto(i32 noundef %0, ptr noundef %1, i64 noundef %2, i32 noundef %3, ptr noundef %4, i32 noundef %5) #1 {
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i8, align 1
  %16 = alloca i16, align 2
  %17 = alloca i16, align 2
  %18 = alloca %struct.netbuf, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  store i32 %0, ptr %8, align 4, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !9
  store i64 %2, ptr %10, align 8, !tbaa !11
  store i32 %3, ptr %11, align 4, !tbaa !5
  store ptr %4, ptr %12, align 8, !tbaa !9
  store i32 %5, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 2, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 2, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #3
  %23 = load i32, ptr %8, align 4, !tbaa !5
  %24 = call ptr @get_socket(i32 noundef %23)
  store ptr %24, ptr %14, align 8, !tbaa !9
  %25 = load ptr, ptr %14, align 8, !tbaa !9
  %26 = icmp ne ptr %25, null
  br i1 %26, label %28, label %27

27:                                               ; preds = %6
  store i64 -1, ptr %7, align 8
  store i32 1, ptr %19, align 4
  br label %159

28:                                               ; preds = %6
  %29 = load ptr, ptr %14, align 8, !tbaa !9
  %30 = getelementptr inbounds %struct.lwip_sock, ptr %29, i32 0, i32 0
  %31 = load ptr, ptr %30, align 8, !tbaa !13
  %32 = getelementptr inbounds %struct.netconn, ptr %31, i32 0, i32 0
  %33 = load i32, ptr %32, align 8, !tbaa !16
  %34 = and i32 %33, 240
  %35 = icmp eq i32 %34, 16
  br i1 %35, label %36, label %42

36:                                               ; preds = %28
  %37 = load i32, ptr %8, align 4, !tbaa !5
  %38 = load ptr, ptr %9, align 8, !tbaa !9
  %39 = load i64, ptr %10, align 8, !tbaa !11
  %40 = load i32, ptr %11, align 4, !tbaa !5
  %41 = call i64 @lwip_send(i32 noundef %37, ptr noundef %38, i64 noundef %39, i32 noundef %40)
  store i64 %41, ptr %7, align 8
  store i32 1, ptr %19, align 4
  br label %159

42:                                               ; preds = %28
  %43 = load i64, ptr %10, align 8, !tbaa !11
  %44 = icmp ugt i64 %43, 65535
  br i1 %44, label %45, label %52

45:                                               ; preds = %42
  br label %46

46:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #3
  store i32 90, ptr %20, align 4, !tbaa !5
  br label %47

47:                                               ; preds = %46
  store i32 90, ptr @errno, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %47
  br label %49

49:                                               ; preds = %48
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #3
  br label %50

50:                                               ; preds = %49
  br label %51

51:                                               ; preds = %50
  store i64 -1, ptr %7, align 8
  store i32 1, ptr %19, align 4
  br label %159

52:                                               ; preds = %42
  %53 = load i64, ptr %10, align 8, !tbaa !11
  %54 = trunc i64 %53 to i16
  store i16 %54, ptr %16, align 2, !tbaa !18
  br label %55

55:                                               ; preds = %52
  %56 = load ptr, ptr %12, align 8, !tbaa !9
  %57 = icmp eq ptr %56, null
  br i1 %57, label %58, label %61

58:                                               ; preds = %55
  %59 = load i32, ptr %13, align 4, !tbaa !5
  %60 = icmp eq i32 %59, 0
  br i1 %60, label %96, label %61

61:                                               ; preds = %58, %55
  %62 = load i32, ptr %13, align 4, !tbaa !5
  %63 = zext i32 %62 to i64
  %64 = icmp eq i64 %63, 16
  br i1 %64, label %65, label %79

65:                                               ; preds = %61
  %66 = load ptr, ptr %12, align 8, !tbaa !9
  %67 = icmp ne ptr %66, null
  br i1 %67, label %68, label %79

68:                                               ; preds = %65
  %69 = load ptr, ptr %12, align 8, !tbaa !9
  %70 = getelementptr inbounds %struct.sockaddr, ptr %69, i32 0, i32 1
  %71 = load i8, ptr %70, align 1, !tbaa !19
  %72 = zext i8 %71 to i32
  %73 = icmp eq i32 %72, 2
  br i1 %73, label %74, label %79

74:                                               ; preds = %68
  %75 = load ptr, ptr %12, align 8, !tbaa !9
  %76 = ptrtoint ptr %75 to i64
  %77 = urem i64 %76, 4
  %78 = icmp eq i64 %77, 0
  br i1 %78, label %96, label %79

79:                                               ; preds = %74, %68, %65, %61
  br label %80

80:                                               ; preds = %79
  %81 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef @.str.15, i32 noundef 1621, ptr noundef @.str.2)
  br label %82

82:                                               ; preds = %80
  br label %83

83:                                               ; preds = %82
  br label %84

84:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #3
  %85 = call i32 @err_to_errno(i8 noundef signext -16)
  store i32 %85, ptr %21, align 4, !tbaa !5
  br label %86

86:                                               ; preds = %84
  %87 = load i32, ptr %21, align 4, !tbaa !5
  %88 = icmp ne i32 %87, 0
  br i1 %88, label %89, label %91

89:                                               ; preds = %86
  %90 = load i32, ptr %21, align 4, !tbaa !5
  store i32 %90, ptr @errno, align 4, !tbaa !5
  br label %91

91:                                               ; preds = %89, %86
  br label %92

92:                                               ; preds = %91
  br label %93

93:                                               ; preds = %92
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #3
  br label %94

94:                                               ; preds = %93
  br label %95

95:                                               ; preds = %94
  store i64 -1, ptr %7, align 8
  store i32 1, ptr %19, align 4
  br label %159

96:                                               ; preds = %74, %58
  br label %97

97:                                               ; preds = %96
  br label %98

98:                                               ; preds = %97
  %99 = load i32, ptr %13, align 4, !tbaa !5
  %100 = getelementptr inbounds %struct.netbuf, ptr %18, i32 0, i32 1
  store ptr null, ptr %100, align 8, !tbaa !21
  %101 = getelementptr inbounds %struct.netbuf, ptr %18, i32 0, i32 0
  store ptr null, ptr %101, align 8, !tbaa !24
  %102 = load ptr, ptr %12, align 8, !tbaa !9
  %103 = icmp ne ptr %102, null
  br i1 %103, label %104, label %118

104:                                              ; preds = %98
  br label %105

105:                                              ; preds = %104
  %106 = load ptr, ptr %12, align 8, !tbaa !9
  %107 = getelementptr inbounds %struct.sockaddr_in, ptr %106, i32 0, i32 3
  %108 = getelementptr inbounds %struct.in_addr, ptr %107, i32 0, i32 0
  %109 = load i32, ptr %108, align 4, !tbaa !25
  %110 = getelementptr inbounds %struct.netbuf, ptr %18, i32 0, i32 2
  %111 = getelementptr inbounds %struct.ip4_addr, ptr %110, i32 0, i32 0
  store i32 %109, ptr %111, align 8, !tbaa !28
  %112 = load ptr, ptr %12, align 8, !tbaa !9
  %113 = getelementptr inbounds %struct.sockaddr_in, ptr %112, i32 0, i32 2
  %114 = load i16, ptr %113, align 2, !tbaa !29
  %115 = call zeroext i16 @lwip_htons(i16 noundef zeroext %114)
  store i16 %115, ptr %17, align 2, !tbaa !18
  br label %116

116:                                              ; preds = %105
  br label %117

117:                                              ; preds = %116
  br label %121

118:                                              ; preds = %98
  store i16 0, ptr %17, align 2, !tbaa !18
  %119 = getelementptr inbounds %struct.netbuf, ptr %18, i32 0, i32 2
  %120 = getelementptr inbounds %struct.ip4_addr, ptr %119, i32 0, i32 0
  store i32 0, ptr %120, align 8, !tbaa !28
  br label %121

121:                                              ; preds = %118, %117
  %122 = load i16, ptr %17, align 2, !tbaa !18
  %123 = getelementptr inbounds %struct.netbuf, ptr %18, i32 0, i32 3
  store i16 %122, ptr %123, align 4, !tbaa !30
  %124 = load ptr, ptr %9, align 8, !tbaa !9
  %125 = load i16, ptr %16, align 2, !tbaa !18
  %126 = call signext i8 @netbuf_ref(ptr noundef %18, ptr noundef %124, i16 noundef zeroext %125)
  store i8 %126, ptr %15, align 1, !tbaa !31
  %127 = load i8, ptr %15, align 1, !tbaa !31
  %128 = sext i8 %127 to i32
  %129 = icmp eq i32 %128, 0
  br i1 %129, label %130, label %135

130:                                              ; preds = %121
  %131 = load ptr, ptr %14, align 8, !tbaa !9
  %132 = getelementptr inbounds %struct.lwip_sock, ptr %131, i32 0, i32 0
  %133 = load ptr, ptr %132, align 8, !tbaa !13
  %134 = call signext i8 @netconn_send(ptr noundef %133, ptr noundef %18)
  store i8 %134, ptr %15, align 1, !tbaa !31
  br label %135

135:                                              ; preds = %130, %121
  call void @netbuf_free(ptr noundef %18)
  br label %136

136:                                              ; preds = %135
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #3
  %137 = load i8, ptr %15, align 1, !tbaa !31
  %138 = call i32 @err_to_errno(i8 noundef signext %137)
  store i32 %138, ptr %22, align 4, !tbaa !5
  br label %139

139:                                              ; preds = %136
  %140 = load i32, ptr %22, align 4, !tbaa !5
  %141 = icmp ne i32 %140, 0
  br i1 %141, label %142, label %144

142:                                              ; preds = %139
  %143 = load i32, ptr %22, align 4, !tbaa !5
  store i32 %143, ptr @errno, align 4, !tbaa !5
  br label %144

144:                                              ; preds = %142, %139
  br label %145

145:                                              ; preds = %144
  br label %146

146:                                              ; preds = %145
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #3
  br label %147

147:                                              ; preds = %146
  br label %148

148:                                              ; preds = %147
  %149 = load i8, ptr %15, align 1, !tbaa !31
  %150 = sext i8 %149 to i32
  %151 = icmp eq i32 %150, 0
  br i1 %151, label %152, label %155

152:                                              ; preds = %148
  %153 = load i16, ptr %16, align 2, !tbaa !18
  %154 = zext i16 %153 to i32
  br label %156

155:                                              ; preds = %148
  br label %156

156:                                              ; preds = %155, %152
  %157 = phi i32 [ %154, %152 ], [ -1, %155 ]
  %158 = sext i32 %157 to i64
  store i64 %158, ptr %7, align 8
  store i32 1, ptr %19, align 4
  br label %159

159:                                              ; preds = %156, %95, %51, %36, %27
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  %160 = load i64, ptr %7, align 8
  ret i64 %160
}

declare signext i8 @netconn_send(ptr noundef, ptr noundef) #2

declare void @netbuf_free(ptr noundef) #2

declare signext i8 @netbuf_ref(ptr noundef, ptr noundef, i16 noundef zeroext) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !10, i64 0}
!14 = !{!"lwip_sock", !10, i64 0, !7, i64 8, !15, i64 16, !15, i64 18, !15, i64 20, !7, i64 22}
!15 = !{!"short", !7, i64 0}
!16 = !{!17, !6, i64 0}
!17 = !{!"netconn", !6, i64 0, !6, i64 4, !7, i64 8, !7, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !6, i64 48, !6, i64 52, !6, i64 56, !7, i64 60, !10, i64 64, !10, i64 72}
!18 = !{!15, !15, i64 0}
!19 = !{!20, !7, i64 1}
!20 = !{!"sockaddr", !7, i64 0, !7, i64 1, !7, i64 2}
!21 = !{!22, !10, i64 8}
!22 = !{!"netbuf", !10, i64 0, !10, i64 8, !23, i64 16, !15, i64 20}
!23 = !{!"ip4_addr", !6, i64 0}
!24 = !{!22, !10, i64 0}
!25 = !{!26, !6, i64 4}
!26 = !{!"sockaddr_in", !7, i64 0, !7, i64 1, !15, i64 2, !27, i64 4, !7, i64 8}
!27 = !{!"in_addr", !6, i64 0}
!28 = !{!22, !6, i64 16}
!29 = !{!26, !15, i64 2}
!30 = !{!22, !15, i64 20}
!31 = !{!7, !7, i64 0}


; 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.netbuf = type { ptr, ptr, %struct.ip4_addr, i16 }
%struct.ip4_addr = type { i32 }

@errno = external local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [40 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [181 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [29 x i8], align 1

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

; Function Attrs: nounwind uwtable
declare hidden ptr @get_socket(i32 noundef) local_unnamed_addr #1

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

declare i32 @err_to_errno(i8 noundef signext) local_unnamed_addr #2

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

declare zeroext i16 @lwip_htons(i16 noundef zeroext) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
define dso_local i64 @lwip_sendto(i32 noundef %0, ptr noundef %1, i64 noundef %2, i32 noundef %3, ptr noundef %4, i32 noundef %5) local_unnamed_addr #1 {
  %7 = alloca %struct.netbuf, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #5
  %8 = tail call ptr @get_socket(i32 noundef %0)
  %.not = icmp eq ptr %8, null
  br i1 %.not, label %58, label %9

9:                                                ; preds = %6
  %10 = load ptr, ptr %8, align 8, !tbaa !5
  %11 = load i32, ptr %10, align 8, !tbaa !11
  %12 = and i32 %11, 240
  %13 = icmp eq i32 %12, 16
  br i1 %13, label %14, label %16

14:                                               ; preds = %9
  %15 = tail call i64 @lwip_send(i32 noundef %0, ptr noundef %1, i64 noundef %2, i32 noundef %3)
  br label %58

16:                                               ; preds = %9
  %17 = icmp ugt i64 %2, 65535
  br i1 %17, label %18, label %19

18:                                               ; preds = %16
  store i32 90, ptr @errno, align 4, !tbaa !14
  br label %58

19:                                               ; preds = %16
  %20 = trunc nuw i64 %2 to i16
  %21 = icmp eq ptr %4, null
  %22 = icmp eq i32 %5, 0
  %or.cond = and i1 %21, %22
  br i1 %or.cond, label %44, label %23

23:                                               ; preds = %19
  %24 = icmp eq i32 %5, 16
  %25 = icmp ne ptr %4, null
  %or.cond3 = and i1 %25, %24
  br i1 %or.cond3, label %26, label %33

26:                                               ; preds = %23
  %27 = getelementptr inbounds i8, ptr %4, i64 1
  %28 = load i8, ptr %27, align 1, !tbaa !15
  %29 = icmp eq i8 %28, 2
  %30 = ptrtoint ptr %4 to i64
  %31 = and i64 %30, 3
  %32 = icmp eq i64 %31, 0
  %or.cond46 = and i1 %32, %29
  br i1 %or.cond46, label %37, label %33

33:                                               ; preds = %23, %26
  %34 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull @.str.15, i32 noundef 1621, ptr noundef nonnull @.str.2)
  %35 = tail call i32 @err_to_errno(i8 noundef signext -16) #5
  %.not41 = icmp eq i32 %35, 0
  br i1 %.not41, label %58, label %36

36:                                               ; preds = %33
  store i32 %35, ptr @errno, align 4, !tbaa !14
  br label %58

37:                                               ; preds = %26
  %38 = getelementptr inbounds i8, ptr %4, i64 4
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %7, i8 0, i64 16, i1 false)
  %39 = load i32, ptr %38, align 4, !tbaa !17
  %40 = getelementptr inbounds i8, ptr %7, i64 16
  store i32 %39, ptr %40, align 8, !tbaa !20
  %41 = getelementptr inbounds i8, ptr %4, i64 2
  %42 = load i16, ptr %41, align 2, !tbaa !23
  %43 = tail call zeroext i16 @lwip_htons(i16 noundef zeroext %42) #5
  br label %45

44:                                               ; preds = %19
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(20) %7, i8 0, i64 20, i1 false)
  br label %45

45:                                               ; preds = %44, %37
  %.035 = phi i16 [ %43, %37 ], [ 0, %44 ]
  %46 = getelementptr inbounds i8, ptr %7, i64 20
  store i16 %.035, ptr %46, align 4, !tbaa !24
  %47 = call signext i8 @netbuf_ref(ptr noundef nonnull %7, ptr noundef %1, i16 noundef zeroext %20) #5
  %48 = icmp eq i8 %47, 0
  br i1 %48, label %49, label %52

49:                                               ; preds = %45
  %50 = load ptr, ptr %8, align 8, !tbaa !5
  %51 = call signext i8 @netconn_send(ptr noundef %50, ptr noundef nonnull %7) #5
  br label %52

52:                                               ; preds = %49, %45
  %.034 = phi i8 [ %51, %49 ], [ %47, %45 ]
  call void @netbuf_free(ptr noundef nonnull %7) #5
  %53 = call i32 @err_to_errno(i8 noundef signext %.034) #5
  %.not43 = icmp eq i32 %53, 0
  br i1 %.not43, label %55, label %54

54:                                               ; preds = %52
  store i32 %53, ptr @errno, align 4, !tbaa !14
  br label %55

55:                                               ; preds = %54, %52
  %56 = icmp eq i8 %.034, 0
  %57 = select i1 %56, i64 %2, i64 -1
  br label %58

58:                                               ; preds = %33, %36, %6, %55, %18, %14
  %.0 = phi i64 [ %15, %14 ], [ -1, %18 ], [ %57, %55 ], [ -1, %6 ], [ -1, %36 ], [ -1, %33 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  ret i64 %.0
}

declare signext i8 @netconn_send(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @netbuf_free(ptr noundef) local_unnamed_addr #2

declare signext i8 @netbuf_ref(ptr noundef, ptr noundef, i16 noundef zeroext) local_unnamed_addr #2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 = { 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, !7, i64 0}
!6 = !{!"lwip_sock", !7, i64 0, !8, i64 8, !10, i64 16, !10, i64 18, !10, i64 20, !8, i64 22}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"short", !8, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"netconn", !13, i64 0, !13, i64 4, !8, i64 8, !8, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !13, i64 48, !13, i64 52, !13, i64 56, !8, i64 60, !7, i64 64, !7, i64 72}
!13 = !{!"int", !8, i64 0}
!14 = !{!13, !13, i64 0}
!15 = !{!16, !8, i64 1}
!16 = !{!"sockaddr", !8, i64 0, !8, i64 1, !8, i64 2}
!17 = !{!18, !13, i64 4}
!18 = !{!"sockaddr_in", !8, i64 0, !8, i64 1, !10, i64 2, !19, i64 4, !8, i64 8}
!19 = !{!"in_addr", !13, i64 0}
!20 = !{!21, !13, i64 16}
!21 = !{!"netbuf", !7, i64 0, !7, i64 8, !22, i64 16, !10, i64 20}
!22 = !{!"ip4_addr", !13, i64 0}
!23 = !{!18, !10, i64 2}
!24 = !{!21, !10, i64 20}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,MemCpyOptPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass