; LLVM IR from thalium/icebox :: third_party/virtualbox/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library (TcpIoTransmit)

; 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.TCP_IO = type { i8, ptr, ptr, ptr, %union.TCP_IO_PROTOCOL, %union.TCP_IO_PROTOCOL, %union.TCP_IO_CONNECTION_TOKEN, %union.TCP_IO_IO_TOKEN, %union.TCP_IO_IO_TOKEN, %union.TCP_IO_CLOSE_TOKEN, %union.TCP_IO_LISTEN_TOKEN, i8, i8, i8, i8, i8 }
%union.TCP_IO_PROTOCOL = type { ptr }
%union.TCP_IO_CONNECTION_TOKEN = type { %struct.EFI_TCP4_CONNECTION_TOKEN }
%struct.EFI_TCP4_CONNECTION_TOKEN = type { %struct.EFI_TCP4_COMPLETION_TOKEN }
%struct.EFI_TCP4_COMPLETION_TOKEN = type { ptr, i64 }
%union.TCP_IO_IO_TOKEN = type { %struct.EFI_TCP4_IO_TOKEN }
%struct.EFI_TCP4_IO_TOKEN = type { %struct.EFI_TCP4_COMPLETION_TOKEN, %union.anon }
%union.anon = type { ptr }
%union.TCP_IO_CLOSE_TOKEN = type { %struct.EFI_TCP4_CLOSE_TOKEN }
%struct.EFI_TCP4_CLOSE_TOKEN = type { %struct.EFI_TCP4_COMPLETION_TOKEN, i8 }
%union.TCP_IO_LISTEN_TOKEN = type { %struct.EFI_TCP4_LISTEN_TOKEN }
%struct.EFI_TCP4_LISTEN_TOKEN = type { %struct.EFI_TCP4_COMPLETION_TOKEN, ptr }
%struct.NET_BUF = type { i32, i64, %struct._LIST_ENTRY, %union.NET_IP_HEAD, ptr, ptr, [64 x i8], ptr, i32, i32, [1 x %struct.NET_BLOCK_OP] }
%struct._LIST_ENTRY = type { ptr, ptr }
%union.NET_IP_HEAD = type { ptr }
%struct.NET_BLOCK_OP = type { ptr, ptr, ptr, ptr, i32 }
%struct.EFI_TCP4_TRANSMIT_DATA = type { i8, i8, i32, i32, [1 x %struct.EFI_TCP4_FRAGMENT_DATA] }
%struct.EFI_TCP4_FRAGMENT_DATA = type { i32, ptr }
%struct._EFI_TCP4_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.EFI_TCP6_IO_TOKEN = type { %struct.EFI_TCP6_COMPLETION_TOKEN, %union.anon.0 }
%struct.EFI_TCP6_COMPLETION_TOKEN = type { ptr, i64 }
%union.anon.0 = type { ptr }
%struct._EFI_TCP6_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

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

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

declare void @FreePool(ptr noundef) #1

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

14:                                               ; preds = %2
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.TCP_IO, ptr %15, i32 0, i32 4
  %17 = load ptr, ptr %16, align 8, !tbaa !9
  %18 = icmp eq ptr %17, null
  br i1 %18, label %22, label %19

19:                                               ; preds = %14
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = icmp eq ptr %20, null
  br i1 %21, label %22, label %23

22:                                               ; preds = %19, %14, %2
  store i64 -9223372036854775806, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %183

23:                                               ; preds = %19
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.TCP_IO, ptr %24, i32 0, i32 0
  %26 = load i8, ptr %25, align 8, !tbaa !10
  %27 = zext i8 %26 to i32
  %28 = icmp eq i32 %27, 4
  br i1 %28, label %29, label %37

29:                                               ; preds = %23
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.NET_BUF, ptr %30, i32 0, i32 8
  %32 = load i32, ptr %31, align 8, !tbaa !12
  %33 = sub i32 %32, 1
  %34 = zext i32 %33 to i64
  %35 = mul i64 %34, 16
  %36 = add i64 32, %35
  store i64 %36, ptr %10, align 8, !tbaa !17
  br label %53

37:                                               ; preds = %23
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.TCP_IO, ptr %38, i32 0, i32 0
  %40 = load i8, ptr %39, align 8, !tbaa !10
  %41 = zext i8 %40 to i32
  %42 = icmp eq i32 %41, 6
  br i1 %42, label %43, label %51

43:                                               ; preds = %37
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.NET_BUF, ptr %44, i32 0, i32 8
  %46 = load i32, ptr %45, align 8, !tbaa !12
  %47 = sub i32 %46, 1
  %48 = zext i32 %47 to i64
  %49 = mul i64 %48, 16
  %50 = add i64 32, %49
  store i64 %50, ptr %10, align 8, !tbaa !17
  br label %52

51:                                               ; preds = %37
  store i64 -9223372036854775805, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %183

52:                                               ; preds = %43
  br label %53

53:                                               ; preds = %52, %29
  %54 = load i64, ptr %10, align 8, !tbaa !17
  %55 = call ptr @AllocatePool(i64 noundef %54)
  store ptr %55, ptr %7, align 8, !tbaa !5
  %56 = load ptr, ptr %7, align 8, !tbaa !5
  %57 = icmp eq ptr %56, null
  br i1 %57, label %58, label %59

58:                                               ; preds = %53
  store i64 -9223372036854775799, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %183

59:                                               ; preds = %53
  %60 = load ptr, ptr %7, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.EFI_TCP4_TRANSMIT_DATA, ptr %60, i32 0, i32 0
  store i8 1, ptr %61, align 8, !tbaa !18
  %62 = load ptr, ptr %7, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.EFI_TCP4_TRANSMIT_DATA, ptr %62, i32 0, i32 1
  store i8 0, ptr %63, align 1, !tbaa !20
  %64 = load ptr, ptr %5, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.NET_BUF, ptr %64, i32 0, i32 9
  %66 = load i32, ptr %65, align 4, !tbaa !21
  %67 = load ptr, ptr %7, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.EFI_TCP4_TRANSMIT_DATA, ptr %67, i32 0, i32 2
  store i32 %66, ptr %68, align 4, !tbaa !22
  %69 = load ptr, ptr %5, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.NET_BUF, ptr %69, i32 0, i32 8
  %71 = load i32, ptr %70, align 8, !tbaa !12
  %72 = load ptr, ptr %7, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.EFI_TCP4_TRANSMIT_DATA, ptr %72, i32 0, i32 3
  store i32 %71, ptr %73, align 8, !tbaa !23
  %74 = load ptr, ptr %5, align 8, !tbaa !5
  %75 = load ptr, ptr %7, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.EFI_TCP4_TRANSMIT_DATA, ptr %75, i32 0, i32 4
  %77 = getelementptr inbounds [1 x %struct.EFI_TCP4_FRAGMENT_DATA], ptr %76, i64 0, i64 0
  %78 = load ptr, ptr %7, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.EFI_TCP4_TRANSMIT_DATA, ptr %78, i32 0, i32 3
  %80 = call i64 @NetbufBuildExt(ptr noundef %74, ptr noundef %77, ptr noundef %79)
  store ptr null, ptr %8, align 8, !tbaa !5
  store ptr null, ptr %9, align 8, !tbaa !5
  store i64 -9223372036854775801, ptr %6, align 8, !tbaa !17
  %81 = load ptr, ptr %4, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.TCP_IO, ptr %81, i32 0, i32 0
  %83 = load i8, ptr %82, align 8, !tbaa !10
  %84 = zext i8 %83 to i32
  %85 = icmp eq i32 %84, 4
  br i1 %85, label %86, label %114

86:                                               ; preds = %59
  %87 = load ptr, ptr %7, align 8, !tbaa !5
  %88 = load ptr, ptr %4, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.TCP_IO, ptr %88, i32 0, i32 7
  %90 = getelementptr inbounds %struct.EFI_TCP4_IO_TOKEN, ptr %89, i32 0, i32 1
  store ptr %87, ptr %90, align 8, !tbaa !9
  %91 = load ptr, ptr %4, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.TCP_IO, ptr %91, i32 0, i32 4
  %93 = load ptr, ptr %92, align 8, !tbaa !9
  store ptr %93, ptr %8, align 8, !tbaa !5
  %94 = load ptr, ptr %4, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.TCP_IO, ptr %94, i32 0, i32 15
  %96 = load i8, ptr %95, align 4, !tbaa !24
  %97 = icmp ne i8 %96, 0
  br i1 %97, label %98, label %102

98:                                               ; preds = %86
  %99 = load ptr, ptr %4, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.TCP_IO, ptr %99, i32 0, i32 5
  %101 = load ptr, ptr %100, align 8, !tbaa !9
  store ptr %101, ptr %8, align 8, !tbaa !5
  br label %102

102:                                              ; preds = %98, %86
  %103 = load ptr, ptr %8, align 8, !tbaa !5
  %104 = icmp eq ptr %103, null
  br i1 %104, label %105, label %106

105:                                              ; preds = %102
  br label %180

106:                                              ; preds = %102
  %107 = load ptr, ptr %8, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct._EFI_TCP4_PROTOCOL, ptr %107, i32 0, i32 5
  %109 = load ptr, ptr %108, align 8, !tbaa !25
  %110 = load ptr, ptr %8, align 8, !tbaa !5
  %111 = load ptr, ptr %4, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.TCP_IO, ptr %111, i32 0, i32 7
  %113 = call i64 %109(ptr noundef %110, ptr noundef %112)
  store i64 %113, ptr %6, align 8, !tbaa !17
  br label %142

114:                                              ; preds = %59
  %115 = load ptr, ptr %7, align 8, !tbaa !5
  %116 = load ptr, ptr %4, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.TCP_IO, ptr %116, i32 0, i32 7
  %118 = getelementptr inbounds %struct.EFI_TCP6_IO_TOKEN, ptr %117, i32 0, i32 1
  store ptr %115, ptr %118, align 8, !tbaa !9
  %119 = load ptr, ptr %4, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.TCP_IO, ptr %119, i32 0, i32 4
  %121 = load ptr, ptr %120, align 8, !tbaa !9
  store ptr %121, ptr %9, align 8, !tbaa !5
  %122 = load ptr, ptr %4, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.TCP_IO, ptr %122, i32 0, i32 15
  %124 = load i8, ptr %123, align 4, !tbaa !24
  %125 = icmp ne i8 %124, 0
  br i1 %125, label %126, label %130

126:                                              ; preds = %114
  %127 = load ptr, ptr %4, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.TCP_IO, ptr %127, i32 0, i32 5
  %129 = load ptr, ptr %128, align 8, !tbaa !9
  store ptr %129, ptr %9, align 8, !tbaa !5
  br label %130

130:                                              ; preds = %126, %114
  %131 = load ptr, ptr %9, align 8, !tbaa !5
  %132 = icmp eq ptr %131, null
  br i1 %132, label %133, label %134

133:                                              ; preds = %130
  br label %180

134:                                              ; preds = %130
  %135 = load ptr, ptr %9, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct._EFI_TCP6_PROTOCOL, ptr %135, i32 0, i32 4
  %137 = load ptr, ptr %136, align 8, !tbaa !27
  %138 = load ptr, ptr %9, align 8, !tbaa !5
  %139 = load ptr, ptr %4, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.TCP_IO, ptr %139, i32 0, i32 7
  %141 = call i64 %137(ptr noundef %138, ptr noundef %140)
  store i64 %141, ptr %6, align 8, !tbaa !17
  br label %142

142:                                              ; preds = %134, %106
  %143 = load i64, ptr %6, align 8, !tbaa !17
  %144 = icmp slt i64 %143, 0
  br i1 %144, label %145, label %146

145:                                              ; preds = %142
  br label %180

146:                                              ; preds = %142
  br label %147

147:                                              ; preds = %171, %146
  %148 = load ptr, ptr %4, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.TCP_IO, ptr %148, i32 0, i32 12
  %150 = load i8, ptr %149, align 1, !tbaa !29
  %151 = icmp ne i8 %150, 0
  %152 = xor i1 %151, true
  br i1 %152, label %153, label %172

153:                                              ; preds = %147
  %154 = load ptr, ptr %4, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.TCP_IO, ptr %154, i32 0, i32 0
  %156 = load i8, ptr %155, align 8, !tbaa !10
  %157 = zext i8 %156 to i32
  %158 = icmp eq i32 %157, 4
  br i1 %158, label %159, label %165

159:                                              ; preds = %153
  %160 = load ptr, ptr %8, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct._EFI_TCP4_PROTOCOL, ptr %160, i32 0, i32 9
  %162 = load ptr, ptr %161, align 8, !tbaa !30
  %163 = load ptr, ptr %8, align 8, !tbaa !5
  %164 = call i64 %162(ptr noundef %163)
  br label %171

165:                                              ; preds = %153
  %166 = load ptr, ptr %9, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct._EFI_TCP6_PROTOCOL, ptr %166, i32 0, i32 8
  %168 = load ptr, ptr %167, align 8, !tbaa !31
  %169 = load ptr, ptr %9, align 8, !tbaa !5
  %170 = call i64 %168(ptr noundef %169)
  br label %171

171:                                              ; preds = %165, %159
  br label %147, !llvm.loop !32

172:                                              ; preds = %147
  %173 = load ptr, ptr %4, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.TCP_IO, ptr %173, i32 0, i32 12
  store i8 0, ptr %174, align 1, !tbaa !29
  %175 = load ptr, ptr %4, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.TCP_IO, ptr %175, i32 0, i32 7
  %177 = getelementptr inbounds %struct.EFI_TCP4_IO_TOKEN, ptr %176, i32 0, i32 0
  %178 = getelementptr inbounds %struct.EFI_TCP4_COMPLETION_TOKEN, ptr %177, i32 0, i32 1
  %179 = load i64, ptr %178, align 8, !tbaa !9
  store i64 %179, ptr %6, align 8, !tbaa !17
  br label %180

180:                                              ; preds = %172, %145, %133, %105
  %181 = load ptr, ptr %7, align 8, !tbaa !5
  call void @FreePool(ptr noundef %181)
  %182 = load i64, ptr %6, align 8, !tbaa !17
  store i64 %182, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %183

183:                                              ; preds = %180, %58, %51, %22
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, 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
  %184 = load i64, ptr %3, align 8
  ret i64 %184
}

declare ptr @AllocatePool(i64 noundef) #1

declare i64 @NetbufBuildExt(ptr noundef, ptr noundef, ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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, !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 = !{!11, !7, i64 0}
!11 = !{!"", !7, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 64, !7, i64 88, !7, i64 112, !7, i64 136, !7, i64 160, !7, i64 161, !7, i64 162, !7, i64 163, !7, i64 164}
!12 = !{!13, !14, i64 128}
!13 = !{!"", !14, i64 0, !15, i64 8, !16, i64 16, !7, i64 32, !6, i64 40, !6, i64 48, !7, i64 56, !6, i64 120, !14, i64 128, !14, i64 132, !7, i64 136}
!14 = !{!"int", !7, i64 0}
!15 = !{!"long long", !7, i64 0}
!16 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!17 = !{!15, !15, i64 0}
!18 = !{!19, !7, i64 0}
!19 = !{!"", !7, i64 0, !7, i64 1, !14, i64 4, !14, i64 8, !7, i64 16}
!20 = !{!19, !7, i64 1}
!21 = !{!13, !14, i64 132}
!22 = !{!19, !14, i64 4}
!23 = !{!19, !14, i64 8}
!24 = !{!11, !7, i64 164}
!25 = !{!26, !6, i64 40}
!26 = !{!"_EFI_TCP4_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72}
!27 = !{!28, !6, i64 32}
!28 = !{!"_EFI_TCP6_PROTOCOL", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64}
!29 = !{!11, !7, i64 161}
!30 = !{!26, !6, i64 72}
!31 = !{!28, !6, i64 64}
!32 = distinct !{!32, !33}
!33 = !{!"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"

declare void @FreePool(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local i64 @TcpIoTransmit(ptr noundef %0, ptr noundef %1) local_unnamed_addr #1 {
  %3 = icmp eq ptr %0, null
  br i1 %3, label %48, label %4

4:                                                ; preds = %2
  %5 = getelementptr inbounds i8, ptr %0, i64 32
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = icmp eq ptr %6, null
  %8 = icmp eq ptr %1, null
  %or.cond = or i1 %8, %7
  br i1 %or.cond, label %48, label %9

9:                                                ; preds = %4
  %10 = load i8, ptr %0, align 8, !tbaa !8
  switch i8 %10, label %48 [
    i8 4, label %11
    i8 6, label %11
  ]

11:                                               ; preds = %9, %9
  %.0.in.in.in.in.in = getelementptr inbounds i8, ptr %1, i64 128
  %.0.in.in.in.in = load i32, ptr %.0.in.in.in.in.in, align 8, !tbaa !11
  %.0.in.in.in = add i32 %.0.in.in.in.in, -1
  %.0.in.in = zext i32 %.0.in.in.in to i64
  %.0.in = shl nuw nsw i64 %.0.in.in, 4
  %.0 = add nuw nsw i64 %.0.in, 32
  %12 = tail call ptr @AllocatePool(i64 noundef %.0) #2
  %13 = icmp eq ptr %12, null
  br i1 %13, label %48, label %14

14:                                               ; preds = %11
  store i8 1, ptr %12, align 8, !tbaa !16
  %15 = getelementptr inbounds i8, ptr %12, i64 1
  store i8 0, ptr %15, align 1, !tbaa !18
  %16 = getelementptr inbounds i8, ptr %12, i64 4
  %17 = getelementptr inbounds i8, ptr %12, i64 8
  %18 = load <2 x i32>, ptr %.0.in.in.in.in.in, align 8, !tbaa !19
  %19 = shufflevector <2 x i32> %18, <2 x i32> poison, <2 x i32> <i32 1, i32 0>
  store <2 x i32> %19, ptr %16, align 4, !tbaa !19
  %20 = getelementptr inbounds i8, ptr %12, i64 16
  %21 = tail call i64 @NetbufBuildExt(ptr noundef nonnull %1, ptr noundef nonnull %20, ptr noundef nonnull %17) #2
  %22 = load i8, ptr %0, align 8, !tbaa !8
  %23 = icmp eq i8 %22, 4
  %24 = getelementptr inbounds i8, ptr %0, i64 80
  store ptr %12, ptr %24, align 8, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %0, i64 164
  %26 = load i8, ptr %25, align 4, !tbaa !20
  %.not59 = icmp eq i8 %26, 0
  %27 = getelementptr inbounds i8, ptr %0, i64 40
  %spec.select = select i1 %.not59, ptr %5, ptr %27
  %.050 = load ptr, ptr %spec.select, align 8, !tbaa !5
  %28 = icmp eq ptr %.050, null
  %.050. = select i1 %23, ptr %.050, ptr null
  %..050 = select i1 %23, ptr null, ptr %.050
  br i1 %28, label %47, label %29

29:                                               ; preds = %14
  %.67 = select i1 %23, i64 40, i64 32
  %30 = getelementptr inbounds i8, ptr %0, i64 64
  %31 = getelementptr inbounds i8, ptr %.050, i64 %.67
  %32 = load ptr, ptr %31, align 8, !tbaa !21
  %33 = tail call i64 %32(ptr noundef nonnull %.050, ptr noundef nonnull %30) #2
  %34 = icmp slt i64 %33, 0
  br i1 %34, label %47, label %.preheader

.preheader:                                       ; preds = %29
  %35 = getelementptr inbounds i8, ptr %0, i64 161
  %36 = load i8, ptr %35, align 1, !tbaa !22
  %.not6062 = icmp eq i8 %36, 0
  br i1 %.not6062, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  %37 = getelementptr inbounds i8, ptr %..050, i64 64
  %38 = getelementptr inbounds i8, ptr %.050., i64 72
  br label %39

39:                                               ; preds = %.lr.ph, %39
  %40 = load i8, ptr %0, align 8, !tbaa !8
  %41 = icmp eq i8 %40, 4
  %. = select i1 %41, ptr %38, ptr %37
  %.151..1 = select i1 %41, ptr %.050., ptr %..050
  %42 = load ptr, ptr %., align 8, !tbaa !21
  %43 = tail call i64 %42(ptr noundef %.151..1) #2
  %44 = load i8, ptr %35, align 1, !tbaa !22
  %.not60 = icmp eq i8 %44, 0
  br i1 %.not60, label %39, label %._crit_edge, !llvm.loop !23

._crit_edge:                                      ; preds = %39, %.preheader
  store i8 0, ptr %35, align 1, !tbaa !22
  %45 = getelementptr inbounds i8, ptr %0, i64 72
  %46 = load i64, ptr %45, align 8, !tbaa !5
  br label %47

47:                                               ; preds = %14, %29, %._crit_edge
  %.154 = phi i64 [ %33, %29 ], [ %46, %._crit_edge ], [ -9223372036854775801, %14 ]
  tail call void @FreePool(ptr noundef nonnull %12) #2
  br label %48

48:                                               ; preds = %11, %9, %2, %4, %47
  %.052 = phi i64 [ %.154, %47 ], [ -9223372036854775806, %4 ], [ -9223372036854775806, %2 ], [ -9223372036854775805, %9 ], [ -9223372036854775799, %11 ]
  ret i64 %.052
}

declare ptr @AllocatePool(i64 noundef) local_unnamed_addr #0

declare i64 @NetbufBuildExt(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

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 = { 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 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !6, i64 0}
!9 = !{!"", !6, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 64, !6, i64 88, !6, i64 112, !6, i64 136, !6, i64 160, !6, i64 161, !6, i64 162, !6, i64 163, !6, i64 164}
!10 = !{!"any pointer", !6, i64 0}
!11 = !{!12, !13, i64 128}
!12 = !{!"", !13, i64 0, !14, i64 8, !15, i64 16, !6, i64 32, !10, i64 40, !10, i64 48, !6, i64 56, !10, i64 120, !13, i64 128, !13, i64 132, !6, i64 136}
!13 = !{!"int", !6, i64 0}
!14 = !{!"long long", !6, i64 0}
!15 = !{!"_LIST_ENTRY", !10, i64 0, !10, i64 8}
!16 = !{!17, !6, i64 0}
!17 = !{!"", !6, i64 0, !6, i64 1, !13, i64 4, !13, i64 8, !6, i64 16}
!18 = !{!17, !6, i64 1}
!19 = !{!13, !13, i64 0}
!20 = !{!9, !6, i64 164}
!21 = !{!10, !10, i64 0}
!22 = !{!9, !6, i64 161}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}


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