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

; 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.api_msg = type { ptr, i8, %union.anon }
%union.anon = type { %struct.anon.2 }
%struct.anon.2 = type { ptr, i16, i64, i64, i64, i8, i32 }
%struct.netconn = type { i32, i32, %union.anon.5, i8, ptr, ptr, ptr, i32, i32, i32, i8, ptr, ptr }
%union.anon.5 = type { ptr }
%struct.anon.0 = type { ptr, i16, i8 }

@.str = external hidden unnamed_addr constant [40 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [181 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [7 x i8], align 1
@lock_tcpip_core = external global ptr, align 8
@.str.11 = external hidden unnamed_addr constant [21 x i8], align 1

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

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

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

declare void @sys_mutex_unlock(ptr noundef) #0

declare i32 @sys_arch_sem_wait(ptr noundef, i32 noundef) #0

declare void @sys_mutex_lock(ptr noundef) #0

; Function Attrs: nounwind uwtable
define dso_local void @lwip_netconn_do_connect(ptr noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i8, align 1
  %5 = alloca i8, align 1
  %6 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  %7 = load ptr, ptr %2, align 8, !tbaa !5
  store ptr %7, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #3
  %8 = load ptr, ptr %3, align 8, !tbaa !5
  %9 = getelementptr inbounds %struct.api_msg, ptr %8, i32 0, i32 0
  %10 = load ptr, ptr %9, align 8, !tbaa !9
  %11 = getelementptr inbounds %struct.netconn, ptr %10, i32 0, i32 2
  %12 = load ptr, ptr %11, align 8, !tbaa !11
  %13 = icmp eq ptr %12, null
  br i1 %13, label %14, label %15

14:                                               ; preds = %1
  store i8 -15, ptr %4, align 1, !tbaa !11
  br label %190

15:                                               ; preds = %1
  %16 = load ptr, ptr %3, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.api_msg, ptr %16, i32 0, i32 0
  %18 = load ptr, ptr %17, align 8, !tbaa !9
  %19 = getelementptr inbounds %struct.netconn, ptr %18, i32 0, i32 0
  %20 = load i32, ptr %19, align 8, !tbaa !12
  %21 = and i32 %20, 240
  switch i32 %21, label %178 [
    i32 32, label %22
    i32 16, label %37
  ]

22:                                               ; preds = %15
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.api_msg, ptr %23, i32 0, i32 0
  %25 = load ptr, ptr %24, align 8, !tbaa !9
  %26 = getelementptr inbounds %struct.netconn, ptr %25, i32 0, i32 2
  %27 = load ptr, ptr %26, align 8, !tbaa !11
  %28 = load ptr, ptr %3, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.api_msg, ptr %28, i32 0, i32 2
  %30 = getelementptr inbounds %struct.anon.0, ptr %29, i32 0, i32 0
  %31 = load ptr, ptr %30, align 8, !tbaa !11
  %32 = load ptr, ptr %3, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.api_msg, ptr %32, i32 0, i32 2
  %34 = getelementptr inbounds %struct.anon.0, ptr %33, i32 0, i32 1
  %35 = load i16, ptr %34, align 8, !tbaa !11
  %36 = call signext i8 @udp_connect(ptr noundef %27, ptr noundef %31, i16 noundef zeroext %35)
  store i8 %36, ptr %4, align 1, !tbaa !11
  br label %189

37:                                               ; preds = %15
  %38 = load ptr, ptr %3, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.api_msg, ptr %38, i32 0, i32 0
  %40 = load ptr, ptr %39, align 8, !tbaa !9
  %41 = getelementptr inbounds %struct.netconn, ptr %40, i32 0, i32 1
  %42 = load i32, ptr %41, align 4, !tbaa !15
  %43 = icmp eq i32 %42, 3
  br i1 %43, label %44, label %45

44:                                               ; preds = %37
  store i8 -9, ptr %4, align 1, !tbaa !11
  br label %177

45:                                               ; preds = %37
  %46 = load ptr, ptr %3, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.api_msg, ptr %46, i32 0, i32 0
  %48 = load ptr, ptr %47, align 8, !tbaa !9
  %49 = getelementptr inbounds %struct.netconn, ptr %48, i32 0, i32 1
  %50 = load i32, ptr %49, align 4, !tbaa !15
  %51 = icmp ne i32 %50, 0
  br i1 %51, label %52, label %53

52:                                               ; preds = %45
  store i8 -10, ptr %4, align 1, !tbaa !11
  br label %176

53:                                               ; preds = %45
  %54 = load ptr, ptr %3, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.api_msg, ptr %54, i32 0, i32 0
  %56 = load ptr, ptr %55, align 8, !tbaa !9
  call void @setup_tcp(ptr noundef %56)
  %57 = load ptr, ptr %3, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.api_msg, ptr %57, i32 0, i32 0
  %59 = load ptr, ptr %58, align 8, !tbaa !9
  %60 = getelementptr inbounds %struct.netconn, ptr %59, i32 0, i32 2
  %61 = load ptr, ptr %60, align 8, !tbaa !11
  %62 = load ptr, ptr %3, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.api_msg, ptr %62, i32 0, i32 2
  %64 = getelementptr inbounds %struct.anon.0, ptr %63, i32 0, i32 0
  %65 = load ptr, ptr %64, align 8, !tbaa !11
  %66 = load ptr, ptr %3, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.api_msg, ptr %66, i32 0, i32 2
  %68 = getelementptr inbounds %struct.anon.0, ptr %67, i32 0, i32 1
  %69 = load i16, ptr %68, align 8, !tbaa !11
  %70 = call signext i8 @tcp_connect(ptr noundef %61, ptr noundef %65, i16 noundef zeroext %69, ptr noundef @lwip_netconn_do_connected)
  store i8 %70, ptr %4, align 1, !tbaa !11
  %71 = load i8, ptr %4, align 1, !tbaa !11
  %72 = sext i8 %71 to i32
  %73 = icmp eq i32 %72, 0
  br i1 %73, label %74, label %175

74:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #3
  %75 = load ptr, ptr %3, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.api_msg, ptr %75, i32 0, i32 0
  %77 = load ptr, ptr %76, align 8, !tbaa !9
  %78 = getelementptr inbounds %struct.netconn, ptr %77, i32 0, i32 10
  %79 = load i8, ptr %78, align 4, !tbaa !16
  %80 = zext i8 %79 to i32
  %81 = and i32 %80, 2
  %82 = icmp ne i32 %81, 0
  %83 = zext i1 %82 to i32
  %84 = trunc i32 %83 to i8
  store i8 %84, ptr %5, align 1, !tbaa !11
  %85 = load ptr, ptr %3, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.api_msg, ptr %85, i32 0, i32 0
  %87 = load ptr, ptr %86, align 8, !tbaa !9
  %88 = getelementptr inbounds %struct.netconn, ptr %87, i32 0, i32 1
  store i32 3, ptr %88, align 4, !tbaa !15
  br label %89

89:                                               ; preds = %74
  %90 = load i8, ptr %5, align 1, !tbaa !11
  %91 = icmp ne i8 %90, 0
  br i1 %91, label %92, label %108

92:                                               ; preds = %89
  br label %93

93:                                               ; preds = %92
  %94 = load ptr, ptr %3, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.api_msg, ptr %94, i32 0, i32 0
  %96 = load ptr, ptr %95, align 8, !tbaa !9
  %97 = getelementptr inbounds %struct.netconn, ptr %96, i32 0, i32 10
  %98 = load i8, ptr %97, align 4, !tbaa !16
  %99 = zext i8 %98 to i32
  %100 = or i32 %99, 4
  %101 = trunc i32 %100 to i8
  %102 = load ptr, ptr %3, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.api_msg, ptr %102, i32 0, i32 0
  %104 = load ptr, ptr %103, align 8, !tbaa !9
  %105 = getelementptr inbounds %struct.netconn, ptr %104, i32 0, i32 10
  store i8 %101, ptr %105, align 4, !tbaa !16
  br label %106

106:                                              ; preds = %93
  br label %107

107:                                              ; preds = %106
  br label %124

108:                                              ; preds = %89
  br label %109

109:                                              ; preds = %108
  %110 = load ptr, ptr %3, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.api_msg, ptr %110, i32 0, i32 0
  %112 = load ptr, ptr %111, align 8, !tbaa !9
  %113 = getelementptr inbounds %struct.netconn, ptr %112, i32 0, i32 10
  %114 = load i8, ptr %113, align 4, !tbaa !16
  %115 = zext i8 %114 to i32
  %116 = and i32 %115, 251
  %117 = trunc i32 %116 to i8
  %118 = load ptr, ptr %3, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.api_msg, ptr %118, i32 0, i32 0
  %120 = load ptr, ptr %119, align 8, !tbaa !9
  %121 = getelementptr inbounds %struct.netconn, ptr %120, i32 0, i32 10
  store i8 %117, ptr %121, align 4, !tbaa !16
  br label %122

122:                                              ; preds = %109
  br label %123

123:                                              ; preds = %122
  br label %124

124:                                              ; preds = %123, %107
  br label %125

125:                                              ; preds = %124
  br label %126

126:                                              ; preds = %125
  %127 = load i8, ptr %5, align 1, !tbaa !11
  %128 = icmp ne i8 %127, 0
  br i1 %128, label %129, label %130

129:                                              ; preds = %126
  store i8 -5, ptr %4, align 1, !tbaa !11
  br label %171

130:                                              ; preds = %126
  %131 = load ptr, ptr %3, align 8, !tbaa !5
  %132 = load ptr, ptr %3, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.api_msg, ptr %132, i32 0, i32 0
  %134 = load ptr, ptr %133, align 8, !tbaa !9
  %135 = getelementptr inbounds %struct.netconn, ptr %134, i32 0, i32 11
  store ptr %131, ptr %135, align 8, !tbaa !17
  br label %136

136:                                              ; preds = %130
  %137 = load ptr, ptr %3, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.api_msg, ptr %137, i32 0, i32 0
  %139 = load ptr, ptr %138, align 8, !tbaa !9
  %140 = getelementptr inbounds %struct.netconn, ptr %139, i32 0, i32 1
  %141 = load i32, ptr %140, align 4, !tbaa !15
  %142 = icmp eq i32 %141, 3
  br i1 %142, label %148, label %143

143:                                              ; preds = %136
  br label %144

144:                                              ; preds = %143
  %145 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef @.str.10, i32 noundef 1392, ptr noundef @.str.2)
  br label %146

146:                                              ; preds = %144
  br label %147

147:                                              ; preds = %146
  br label %148

148:                                              ; preds = %147, %136
  br label %149

149:                                              ; preds = %148
  br label %150

150:                                              ; preds = %149
  call void @sys_mutex_unlock(ptr noundef @lock_tcpip_core)
  %151 = load ptr, ptr %3, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.api_msg, ptr %151, i32 0, i32 0
  %153 = load ptr, ptr %152, align 8, !tbaa !9
  %154 = getelementptr inbounds %struct.netconn, ptr %153, i32 0, i32 4
  %155 = call i32 @sys_arch_sem_wait(ptr noundef %154, i32 noundef 0)
  call void @sys_mutex_lock(ptr noundef @lock_tcpip_core)
  br label %156

156:                                              ; preds = %150
  %157 = load ptr, ptr %3, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.api_msg, ptr %157, i32 0, i32 0
  %159 = load ptr, ptr %158, align 8, !tbaa !9
  %160 = getelementptr inbounds %struct.netconn, ptr %159, i32 0, i32 1
  %161 = load i32, ptr %160, align 4, !tbaa !15
  %162 = icmp ne i32 %161, 3
  br i1 %162, label %168, label %163

163:                                              ; preds = %156
  br label %164

164:                                              ; preds = %163
  %165 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef @.str.10, i32 noundef 1396, ptr noundef @.str.2)
  br label %166

166:                                              ; preds = %164
  br label %167

167:                                              ; preds = %166
  br label %168

168:                                              ; preds = %167, %156
  br label %169

169:                                              ; preds = %168
  br label %170

170:                                              ; preds = %169
  store i32 1, ptr %6, align 4
  br label %172

171:                                              ; preds = %129
  store i32 0, ptr %6, align 4
  br label %172

172:                                              ; preds = %171, %170
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #3
  %173 = load i32, ptr %6, align 4
  switch i32 %173, label %194 [
    i32 0, label %174
  ]

174:                                              ; preds = %172
  br label %175

175:                                              ; preds = %174, %53
  br label %176

176:                                              ; preds = %175, %52
  br label %177

177:                                              ; preds = %176, %44
  br label %189

178:                                              ; preds = %15
  br label %179

179:                                              ; preds = %178
  br label %180

180:                                              ; preds = %179
  %181 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef @.str.11, i32 noundef 1407, ptr noundef @.str.2)
  br label %182

182:                                              ; preds = %180
  br label %183

183:                                              ; preds = %182
  br label %184

184:                                              ; preds = %183
  store i8 -6, ptr %4, align 1, !tbaa !11
  br label %185

185:                                              ; preds = %184
  br label %186

186:                                              ; preds = %185
  br label %187

187:                                              ; preds = %186
  br label %188

188:                                              ; preds = %187
  br label %189

189:                                              ; preds = %188, %177, %22
  br label %190

190:                                              ; preds = %189, %14
  %191 = load i8, ptr %4, align 1, !tbaa !11
  %192 = load ptr, ptr %3, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.api_msg, ptr %192, i32 0, i32 1
  store i8 %191, ptr %193, align 8, !tbaa !18
  store i32 0, ptr %6, align 4
  br label %194

194:                                              ; preds = %190, %172
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  %195 = load i32, ptr %6, align 4
  switch i32 %195, label %197 [
    i32 0, label %196
    i32 1, label %196
  ]

196:                                              ; preds = %194, %194
  ret void

197:                                              ; preds = %194
  unreachable
}

declare signext i8 @udp_connect(ptr noundef, ptr noundef, i16 noundef zeroext) #0

; Function Attrs: nounwind uwtable
declare hidden void @setup_tcp(ptr noundef) #2

declare signext i8 @tcp_connect(ptr noundef, ptr noundef, i16 noundef zeroext, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden signext i8 @lwip_netconn_do_connected(ptr noundef, ptr noundef, i8 noundef signext) #2

attributes #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 = { 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 }

!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 0}
!10 = !{!"api_msg", !6, i64 0, !7, i64 8, !7, i64 16}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !14, i64 0}
!13 = !{!"netconn", !14, i64 0, !14, i64 4, !7, i64 8, !7, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !14, i64 48, !14, i64 52, !14, i64 56, !7, i64 60, !6, i64 64, !6, i64 72}
!14 = !{!"int", !7, i64 0}
!15 = !{!13, !14, i64 4}
!16 = !{!13, !7, i64 60}
!17 = !{!13, !6, i64 64}
!18 = !{!10, !7, i64 8}


; 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 [40 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [181 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [7 x i8], align 1
@lock_tcpip_core = external global ptr, align 8
@.str.11 = external hidden unnamed_addr constant [21 x i8], align 1

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

declare void @sys_mutex_unlock(ptr noundef) local_unnamed_addr #1

declare i32 @sys_arch_sem_wait(ptr noundef, i32 noundef) local_unnamed_addr #1

declare void @sys_mutex_lock(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @lwip_netconn_do_connect(ptr noundef %0) local_unnamed_addr #2 {
  %2 = load ptr, ptr %0, align 8, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %2, i64 8
  %4 = load ptr, ptr %3, align 8, !tbaa !10
  %5 = icmp eq ptr %4, null
  br i1 %5, label %50, label %6

6:                                                ; preds = %1
  %7 = load i32, ptr %2, align 8, !tbaa !11
  %8 = trunc i32 %7 to i8
  %trunc = and i8 %8, -16
  switch i8 %trunc, label %48 [
    i8 32, label %9
    i8 16, label %15
  ]

9:                                                ; preds = %6
  %10 = getelementptr inbounds i8, ptr %0, i64 16
  %11 = load ptr, ptr %10, align 8, !tbaa !10
  %12 = getelementptr inbounds i8, ptr %0, i64 24
  %13 = load i16, ptr %12, align 8, !tbaa !10
  %14 = tail call signext i8 @udp_connect(ptr noundef nonnull %4, ptr noundef %11, i16 noundef zeroext %13) #3
  br label %50

15:                                               ; preds = %6
  %16 = getelementptr inbounds i8, ptr %2, i64 4
  %17 = load i32, ptr %16, align 4, !tbaa !14
  switch i32 %17, label %18 [
    i32 3, label %50
    i32 0, label %19
  ]

18:                                               ; preds = %15
  br label %50

19:                                               ; preds = %15
  tail call void @setup_tcp(ptr noundef nonnull %2)
  %20 = load ptr, ptr %0, align 8, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %20, i64 8
  %22 = load ptr, ptr %21, align 8, !tbaa !10
  %23 = getelementptr inbounds i8, ptr %0, i64 16
  %24 = load ptr, ptr %23, align 8, !tbaa !10
  %25 = getelementptr inbounds i8, ptr %0, i64 24
  %26 = load i16, ptr %25, align 8, !tbaa !10
  %27 = tail call signext i8 @tcp_connect(ptr noundef %22, ptr noundef %24, i16 noundef zeroext %26, ptr noundef nonnull @lwip_netconn_do_connected) #3
  %28 = icmp eq i8 %27, 0
  br i1 %28, label %29, label %50

29:                                               ; preds = %19
  %30 = load ptr, ptr %0, align 8, !tbaa !5
  %31 = getelementptr inbounds i8, ptr %30, i64 60
  %32 = load i8, ptr %31, align 4, !tbaa !15
  %33 = getelementptr inbounds i8, ptr %30, i64 4
  store i32 3, ptr %33, align 4, !tbaa !14
  %34 = and i8 %32, 2
  %.not31.not = icmp eq i8 %34, 0
  br i1 %.not31.not, label %35, label %46

35:                                               ; preds = %29
  %36 = and i8 %32, -7
  store i8 %36, ptr %31, align 4, !tbaa !15
  %37 = getelementptr inbounds i8, ptr %30, i64 64
  store ptr %0, ptr %37, align 8, !tbaa !16
  tail call void @sys_mutex_unlock(ptr noundef nonnull @lock_tcpip_core) #3
  %38 = load ptr, ptr %0, align 8, !tbaa !5
  %39 = getelementptr inbounds i8, ptr %38, i64 24
  %40 = tail call i32 @sys_arch_sem_wait(ptr noundef nonnull %39, i32 noundef 0) #3
  tail call void @sys_mutex_lock(ptr noundef nonnull @lock_tcpip_core) #3
  %41 = load ptr, ptr %0, align 8, !tbaa !5
  %42 = getelementptr inbounds i8, ptr %41, i64 4
  %43 = load i32, ptr %42, align 4, !tbaa !14
  %.not32 = icmp eq i32 %43, 3
  br i1 %.not32, label %44, label %.thread33

44:                                               ; preds = %35
  %45 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull @.str.10, i32 noundef 1396, ptr noundef nonnull @.str.2)
  br label %.thread33

46:                                               ; preds = %29
  %47 = or i8 %32, 4
  store i8 %47, ptr %31, align 4, !tbaa !15
  br label %50

48:                                               ; preds = %6
  %49 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull @.str.11, i32 noundef 1407, ptr noundef nonnull @.str.2)
  br label %50

50:                                               ; preds = %46, %15, %1, %9, %48, %18, %19
  %.1 = phi i8 [ -6, %48 ], [ -10, %18 ], [ -5, %46 ], [ %27, %19 ], [ %14, %9 ], [ -15, %1 ], [ -9, %15 ]
  %51 = getelementptr inbounds i8, ptr %0, i64 8
  store i8 %.1, ptr %51, align 8, !tbaa !17
  br label %.thread33

.thread33:                                        ; preds = %44, %35, %50
  ret void
}

declare signext i8 @udp_connect(ptr noundef, ptr noundef, i16 noundef zeroext) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @setup_tcp(ptr noundef) local_unnamed_addr #2

declare signext i8 @tcp_connect(ptr noundef, ptr noundef, i16 noundef zeroext, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden signext i8 @lwip_netconn_do_connected(ptr noundef, ptr noundef, i8 noundef signext) #2

attributes #0 = { 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 #1 = { "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 }

!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 = !{!"api_msg", !7, i64 0, !8, i64 8, !8, i64 16}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!8, !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 = !{!12, !13, i64 4}
!15 = !{!12, !8, i64 60}
!16 = !{!12, !7, i64 64}
!17 = !{!6, !8, i64 8}


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