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

; 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.SNP_DRIVER = type <{ i32, [4 x i8], %struct.EFI_LOCK, %struct._EFI_SIMPLE_NETWORK_PROTOCOL, %struct.EFI_SIMPLE_NETWORK_MODE, ptr, ptr, ptr, i8, i8, i16, i32, ptr, ptr, ptr, ptr, ptr, ptr, i8, i8, %struct.s_pxe_cdb, [6 x i8], ptr, ptr, ptr, %struct.s_pxe_db_get_init_info, i8, ptr, [100 x %struct.MAP_LIST], ptr, i8, [7 x i8] }>
%struct.EFI_LOCK = type { i64, i64, i32 }
%struct._EFI_SIMPLE_NETWORK_PROTOCOL = type { i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.EFI_SIMPLE_NETWORK_MODE = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [16 x %struct.EFI_MAC_ADDRESS], %struct.EFI_MAC_ADDRESS, %struct.EFI_MAC_ADDRESS, %struct.EFI_MAC_ADDRESS, i8, i8, i8, i8, i8 }
%struct.EFI_MAC_ADDRESS = type { [32 x i8] }
%struct.s_pxe_cdb = type { i16, i16, i16, i16, i64, i64, i16, i16, i16, i16 }
%struct.s_pxe_db_get_init_info = type <{ i32, i32, [4 x i32], i32, i16, i16, i16, i16, i16, i16, i16, i16, i8, i8, i8 }>
%struct.MAP_LIST = type { i64, ptr }
%struct.s_pxe_cpb_receive = type { i64, i32, i32 }
%struct.s_pxe_db_receive = type { [32 x i8], [32 x i8], i32, i16, i16, i8, [7 x i8] }

@.str = external hidden unnamed_addr constant [24 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [31 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i64 @PxeReceive(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6) #0 {
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i64, align 8
  %19 = alloca i32, align 4
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store ptr %2, ptr %11, align 8, !tbaa !5
  store ptr %3, ptr %12, align 8, !tbaa !5
  store ptr %4, ptr %13, align 8, !tbaa !5
  store ptr %5, ptr %14, align 8, !tbaa !5
  store ptr %6, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  %20 = load ptr, ptr %9, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.SNP_DRIVER, ptr %20, i32 0, i32 22
  %22 = load ptr, ptr %21, align 8, !tbaa !9
  store ptr %22, ptr %16, align 8, !tbaa !5
  %23 = load ptr, ptr %9, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.SNP_DRIVER, ptr %23, i32 0, i32 24
  %25 = load ptr, ptr %24, align 8, !tbaa !20
  store ptr %25, ptr %17, align 8, !tbaa !5
  %26 = load ptr, ptr %11, align 8, !tbaa !5
  %27 = load i64, ptr %26, align 8, !tbaa !21
  store i64 %27, ptr %18, align 8, !tbaa !21
  %28 = load ptr, ptr %10, align 8, !tbaa !5
  %29 = ptrtoint ptr %28 to i64
  %30 = load ptr, ptr %16, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.s_pxe_cpb_receive, ptr %30, i32 0, i32 0
  store i64 %29, ptr %31, align 1, !tbaa !22
  %32 = load ptr, ptr %11, align 8, !tbaa !5
  %33 = load i64, ptr %32, align 8, !tbaa !21
  %34 = trunc i64 %33 to i32
  %35 = load ptr, ptr %16, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.s_pxe_cpb_receive, ptr %35, i32 0, i32 1
  store i32 %34, ptr %36, align 1, !tbaa !24
  %37 = load ptr, ptr %16, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.s_pxe_cpb_receive, ptr %37, i32 0, i32 2
  store i32 0, ptr %38, align 1, !tbaa !25
  %39 = load ptr, ptr %9, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.SNP_DRIVER, ptr %39, i32 0, i32 20
  %41 = getelementptr inbounds %struct.s_pxe_cdb, ptr %40, i32 0, i32 0
  store i16 17, ptr %41, align 2, !tbaa !26
  %42 = load ptr, ptr %9, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.SNP_DRIVER, ptr %42, i32 0, i32 20
  %44 = getelementptr inbounds %struct.s_pxe_cdb, ptr %43, i32 0, i32 1
  store i16 0, ptr %44, align 2, !tbaa !27
  %45 = load ptr, ptr %9, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.SNP_DRIVER, ptr %45, i32 0, i32 20
  %47 = getelementptr inbounds %struct.s_pxe_cdb, ptr %46, i32 0, i32 2
  store i16 16, ptr %47, align 2, !tbaa !28
  %48 = load ptr, ptr %16, align 8, !tbaa !5
  %49 = ptrtoint ptr %48 to i64
  %50 = load ptr, ptr %9, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.SNP_DRIVER, ptr %50, i32 0, i32 20
  %52 = getelementptr inbounds %struct.s_pxe_cdb, ptr %51, i32 0, i32 4
  store i64 %49, ptr %52, align 2, !tbaa !29
  %53 = load ptr, ptr %9, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.SNP_DRIVER, ptr %53, i32 0, i32 20
  %55 = getelementptr inbounds %struct.s_pxe_cdb, ptr %54, i32 0, i32 3
  store i16 80, ptr %55, align 2, !tbaa !30
  %56 = load ptr, ptr %17, align 8, !tbaa !5
  %57 = ptrtoint ptr %56 to i64
  %58 = load ptr, ptr %9, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.SNP_DRIVER, ptr %58, i32 0, i32 20
  %60 = getelementptr inbounds %struct.s_pxe_cdb, ptr %59, i32 0, i32 5
  store i64 %57, ptr %60, align 2, !tbaa !31
  %61 = load ptr, ptr %9, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.SNP_DRIVER, ptr %61, i32 0, i32 20
  %63 = getelementptr inbounds %struct.s_pxe_cdb, ptr %62, i32 0, i32 6
  store i16 0, ptr %63, align 2, !tbaa !32
  %64 = load ptr, ptr %9, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.SNP_DRIVER, ptr %64, i32 0, i32 20
  %66 = getelementptr inbounds %struct.s_pxe_cdb, ptr %65, i32 0, i32 7
  store i16 0, ptr %66, align 2, !tbaa !33
  %67 = load ptr, ptr %9, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.SNP_DRIVER, ptr %67, i32 0, i32 10
  %69 = load i16, ptr %68, align 2, !tbaa !34
  %70 = load ptr, ptr %9, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.SNP_DRIVER, ptr %70, i32 0, i32 20
  %72 = getelementptr inbounds %struct.s_pxe_cdb, ptr %71, i32 0, i32 8
  store i16 %69, ptr %72, align 2, !tbaa !35
  %73 = load ptr, ptr %9, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.SNP_DRIVER, ptr %73, i32 0, i32 20
  %75 = getelementptr inbounds %struct.s_pxe_cdb, ptr %74, i32 0, i32 9
  store i16 0, ptr %75, align 2, !tbaa !36
  br label %76

76:                                               ; preds = %7
  %77 = call zeroext i8 @DebugPrintEnabled()
  %78 = icmp ne i8 %77, 0
  br i1 %78, label %79, label %87

79:                                               ; preds = %76
  br label %80

80:                                               ; preds = %79
  %81 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 16384)
  %82 = icmp ne i8 %81, 0
  br i1 %82, label %83, label %84

83:                                               ; preds = %80
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 16384, ptr noundef @.str)
  br label %84

84:                                               ; preds = %83, %80
  br label %85

85:                                               ; preds = %84
  br label %86

86:                                               ; preds = %85
  br label %87

87:                                               ; preds = %86, %76
  br label %88

88:                                               ; preds = %87
  br label %89

89:                                               ; preds = %88
  %90 = load ptr, ptr %9, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.SNP_DRIVER, ptr %90, i32 0, i32 7
  %92 = load ptr, ptr %91, align 8, !tbaa !37
  %93 = load ptr, ptr %9, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.SNP_DRIVER, ptr %93, i32 0, i32 20
  %95 = ptrtoint ptr %94 to i64
  %96 = call i64 %92(i64 noundef %95)
  %97 = load ptr, ptr %9, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.SNP_DRIVER, ptr %97, i32 0, i32 20
  %99 = getelementptr inbounds %struct.s_pxe_cdb, ptr %98, i32 0, i32 6
  %100 = load i16, ptr %99, align 2, !tbaa !32
  %101 = zext i16 %100 to i32
  switch i32 %101, label %127 [
    i32 0, label %152
    i32 19, label %102
  ]

102:                                              ; preds = %89
  br label %103

103:                                              ; preds = %102
  %104 = call zeroext i8 @DebugPrintEnabled()
  %105 = icmp ne i8 %104, 0
  br i1 %105, label %106, label %124

106:                                              ; preds = %103
  br label %107

107:                                              ; preds = %106
  %108 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 16384)
  %109 = icmp ne i8 %108, 0
  br i1 %109, label %110, label %121

110:                                              ; preds = %107
  %111 = load ptr, ptr %9, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.SNP_DRIVER, ptr %111, i32 0, i32 20
  %113 = getelementptr inbounds %struct.s_pxe_cdb, ptr %112, i32 0, i32 7
  %114 = load i16, ptr %113, align 2, !tbaa !33
  %115 = zext i16 %114 to i32
  %116 = load ptr, ptr %9, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.SNP_DRIVER, ptr %116, i32 0, i32 20
  %118 = getelementptr inbounds %struct.s_pxe_cdb, ptr %117, i32 0, i32 6
  %119 = load i16, ptr %118, align 2, !tbaa !32
  %120 = zext i16 %119 to i32
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 16384, ptr noundef @.str.1, i32 noundef %115, i32 noundef %120)
  br label %121

121:                                              ; preds = %110, %107
  br label %122

122:                                              ; preds = %121
  br label %123

123:                                              ; preds = %122
  br label %124

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

125:                                              ; preds = %124
  br label %126

126:                                              ; preds = %125
  store i64 -9223372036854775802, ptr %8, align 8
  store i32 1, ptr %19, align 4
  br label %235

127:                                              ; preds = %89
  br label %128

128:                                              ; preds = %127
  %129 = call zeroext i8 @DebugPrintEnabled()
  %130 = icmp ne i8 %129, 0
  br i1 %130, label %131, label %149

131:                                              ; preds = %128
  br label %132

132:                                              ; preds = %131
  %133 = call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648)
  %134 = icmp ne i8 %133, 0
  br i1 %134, label %135, label %146

135:                                              ; preds = %132
  %136 = load ptr, ptr %9, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.SNP_DRIVER, ptr %136, i32 0, i32 20
  %138 = getelementptr inbounds %struct.s_pxe_cdb, ptr %137, i32 0, i32 7
  %139 = load i16, ptr %138, align 2, !tbaa !33
  %140 = zext i16 %139 to i32
  %141 = load ptr, ptr %9, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.SNP_DRIVER, ptr %141, i32 0, i32 20
  %143 = getelementptr inbounds %struct.s_pxe_cdb, ptr %142, i32 0, i32 6
  %144 = load i16, ptr %143, align 2, !tbaa !32
  %145 = zext i16 %144 to i32
  call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef @.str.2, i32 noundef %140, i32 noundef %145)
  br label %146

146:                                              ; preds = %135, %132
  br label %147

147:                                              ; preds = %146
  br label %148

148:                                              ; preds = %147
  br label %149

149:                                              ; preds = %148, %128
  br label %150

150:                                              ; preds = %149
  br label %151

151:                                              ; preds = %150
  store i64 -9223372036854775801, ptr %8, align 8
  store i32 1, ptr %19, align 4
  br label %235

152:                                              ; preds = %89
  %153 = load ptr, ptr %17, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.s_pxe_db_receive, ptr %153, i32 0, i32 2
  %155 = load i32, ptr %154, align 1, !tbaa !38
  %156 = zext i32 %155 to i64
  %157 = load ptr, ptr %11, align 8, !tbaa !5
  store i64 %156, ptr %157, align 8, !tbaa !21
  %158 = load ptr, ptr %12, align 8, !tbaa !5
  %159 = icmp ne ptr %158, null
  br i1 %159, label %160, label %166

160:                                              ; preds = %152
  %161 = load ptr, ptr %17, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.s_pxe_db_receive, ptr %161, i32 0, i32 4
  %163 = load i16, ptr %162, align 1, !tbaa !40
  %164 = zext i16 %163 to i64
  %165 = load ptr, ptr %12, align 8, !tbaa !5
  store i64 %164, ptr %165, align 8, !tbaa !21
  br label %166

166:                                              ; preds = %160, %152
  %167 = load ptr, ptr %13, align 8, !tbaa !5
  %168 = icmp ne ptr %167, null
  br i1 %168, label %169, label %179

169:                                              ; preds = %166
  %170 = load ptr, ptr %13, align 8, !tbaa !5
  %171 = load ptr, ptr %17, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.s_pxe_db_receive, ptr %171, i32 0, i32 0
  %173 = load ptr, ptr %9, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.SNP_DRIVER, ptr %173, i32 0, i32 4
  %175 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %174, i32 0, i32 1
  %176 = load i32, ptr %175, align 4, !tbaa !41
  %177 = zext i32 %176 to i64
  %178 = call ptr @CopyMem(ptr noundef %170, ptr noundef %172, i64 noundef %177)
  br label %179

179:                                              ; preds = %169, %166
  %180 = load ptr, ptr %14, align 8, !tbaa !5
  %181 = icmp ne ptr %180, null
  br i1 %181, label %182, label %192

182:                                              ; preds = %179
  %183 = load ptr, ptr %14, align 8, !tbaa !5
  %184 = load ptr, ptr %17, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.s_pxe_db_receive, ptr %184, i32 0, i32 1
  %186 = load ptr, ptr %9, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.SNP_DRIVER, ptr %186, i32 0, i32 4
  %188 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %187, i32 0, i32 1
  %189 = load i32, ptr %188, align 4, !tbaa !41
  %190 = zext i32 %189 to i64
  %191 = call ptr @CopyMem(ptr noundef %183, ptr noundef %185, i64 noundef %190)
  br label %192

192:                                              ; preds = %182, %179
  %193 = load ptr, ptr %15, align 8, !tbaa !5
  %194 = icmp ne ptr %193, null
  br i1 %194, label %195, label %211

195:                                              ; preds = %192
  %196 = load ptr, ptr %17, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.s_pxe_db_receive, ptr %196, i32 0, i32 3
  %198 = load i16, ptr %197, align 1, !tbaa !42
  %199 = zext i16 %198 to i32
  %200 = and i32 %199, 255
  %201 = shl i32 %200, 8
  %202 = load ptr, ptr %17, align 8, !tbaa !5
  %203 = getelementptr inbounds %struct.s_pxe_db_receive, ptr %202, i32 0, i32 3
  %204 = load i16, ptr %203, align 1, !tbaa !42
  %205 = zext i16 %204 to i32
  %206 = and i32 %205, 65280
  %207 = ashr i32 %206, 8
  %208 = or i32 %201, %207
  %209 = trunc i32 %208 to i16
  %210 = load ptr, ptr %15, align 8, !tbaa !5
  store i16 %209, ptr %210, align 2, !tbaa !43
  br label %211

211:                                              ; preds = %195, %192
  %212 = load ptr, ptr %9, align 8, !tbaa !5
  %213 = getelementptr inbounds %struct.SNP_DRIVER, ptr %212, i32 0, i32 4
  %214 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %213, i32 0, i32 17
  %215 = load i8, ptr %214, align 1, !tbaa !44
  %216 = zext i8 %215 to i32
  %217 = icmp ne i32 %216, 0
  br i1 %217, label %218, label %228

218:                                              ; preds = %211
  %219 = load ptr, ptr %9, align 8, !tbaa !5
  %220 = getelementptr inbounds %struct.SNP_DRIVER, ptr %219, i32 0, i32 4
  %221 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %220, i32 0, i32 18
  %222 = load i8, ptr %221, align 4, !tbaa !45
  %223 = icmp ne i8 %222, 0
  br i1 %223, label %228, label %224

224:                                              ; preds = %218
  %225 = load ptr, ptr %9, align 8, !tbaa !5
  %226 = getelementptr inbounds %struct.SNP_DRIVER, ptr %225, i32 0, i32 4
  %227 = getelementptr inbounds %struct.EFI_SIMPLE_NETWORK_MODE, ptr %226, i32 0, i32 18
  store i8 1, ptr %227, align 4, !tbaa !45
  br label %228

228:                                              ; preds = %224, %218, %211
  %229 = load ptr, ptr %11, align 8, !tbaa !5
  %230 = load i64, ptr %229, align 8, !tbaa !21
  %231 = load i64, ptr %18, align 8, !tbaa !21
  %232 = icmp ule i64 %230, %231
  %233 = zext i1 %232 to i64
  %234 = select i1 %232, i64 0, i64 -9223372036854775803
  store i64 %234, ptr %8, align 8
  store i32 1, ptr %19, align 4
  br label %235

235:                                              ; preds = %228, %151, %126
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  %236 = load i64, ptr %8, align 8
  ret i64 %236
}

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

declare zeroext i8 @DebugPrintEnabled() #2

declare zeroext i8 @DebugPrintLevelEnabled(i64 noundef) #2

declare void @DebugPrint(i64 noundef, ptr noundef, ...) #2

declare ptr @CopyMem(ptr noundef, ptr noundef, i64 noundef) #2

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!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 936}
!10 = !{!"", !11, i64 0, !12, i64 8, !14, i64 32, !15, i64 160, !6, i64 816, !6, i64 824, !6, i64 832, !7, i64 840, !17, i64 842, !11, i64 844, !6, i64 848, !6, i64 856, !6, i64 864, !6, i64 872, !6, i64 880, !6, i64 888, !7, i64 896, !7, i64 897, !18, i64 898, !6, i64 936, !6, i64 944, !6, i64 952, !19, i64 960, !6, i64 1008, !7, i64 1016, !6, i64 2616, !7, i64 2624}
!11 = !{!"int", !7, i64 0}
!12 = !{!"", !13, i64 0, !13, i64 8, !11, i64 16}
!13 = !{!"long long", !7, i64 0}
!14 = !{!"_EFI_SIMPLE_NETWORK_PROTOCOL", !13, 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, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120}
!15 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !7, i64 40, !16, i64 552, !16, i64 584, !16, i64 616, !7, i64 648, !7, i64 649, !7, i64 650, !7, i64 651, !7, i64 652}
!16 = !{!"", !7, i64 0}
!17 = !{!"short", !7, i64 0}
!18 = !{!"s_pxe_cdb", !17, i64 0, !17, i64 2, !17, i64 4, !17, i64 6, !13, i64 8, !13, i64 16, !17, i64 24, !17, i64 26, !17, i64 28, !17, i64 30}
!19 = !{!"s_pxe_db_get_init_info", !11, i64 0, !11, i64 4, !7, i64 8, !11, i64 24, !17, i64 28, !17, i64 30, !17, i64 32, !17, i64 34, !17, i64 36, !17, i64 38, !17, i64 40, !17, i64 42, !7, i64 44, !7, i64 45, !7, i64 46}
!20 = !{!10, !6, i64 952}
!21 = !{!13, !13, i64 0}
!22 = !{!23, !13, i64 0}
!23 = !{!"s_pxe_cpb_receive", !13, i64 0, !11, i64 8, !11, i64 12}
!24 = !{!23, !11, i64 8}
!25 = !{!23, !11, i64 12}
!26 = !{!10, !17, i64 898}
!27 = !{!10, !17, i64 900}
!28 = !{!10, !17, i64 902}
!29 = !{!10, !13, i64 906}
!30 = !{!10, !17, i64 904}
!31 = !{!10, !13, i64 914}
!32 = !{!10, !17, i64 922}
!33 = !{!10, !17, i64 924}
!34 = !{!10, !17, i64 842}
!35 = !{!10, !17, i64 926}
!36 = !{!10, !17, i64 928}
!37 = !{!10, !6, i64 832}
!38 = !{!39, !11, i64 64}
!39 = !{!"s_pxe_db_receive", !7, i64 0, !7, i64 32, !11, i64 64, !17, i64 68, !17, i64 70, !7, i64 72, !7, i64 73}
!40 = !{!39, !17, i64 70}
!41 = !{!10, !11, i64 164}
!42 = !{!39, !17, i64 68}
!43 = !{!17, !17, i64 0}
!44 = !{!10, !7, i64 811}
!45 = !{!10, !7, i64 812}


; 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 [24 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [31 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775803, 1) i64 @PxeReceive(ptr noundef %0, ptr noundef %1, ptr nocapture noundef %2, ptr noundef writeonly %3, ptr noundef %4, ptr noundef %5, ptr noundef writeonly %6) local_unnamed_addr #0 {
  %8 = getelementptr inbounds i8, ptr %0, i64 936
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %0, i64 952
  %11 = load ptr, ptr %10, align 8, !tbaa !19
  %12 = load i64, ptr %2, align 8, !tbaa !20
  %13 = ptrtoint ptr %1 to i64
  store i64 %13, ptr %9, align 1, !tbaa !21
  %14 = load i64, ptr %2, align 8, !tbaa !20
  %15 = trunc i64 %14 to i32
  %16 = getelementptr inbounds i8, ptr %9, i64 8
  store i32 %15, ptr %16, align 1, !tbaa !23
  %17 = getelementptr inbounds i8, ptr %9, i64 12
  store i32 0, ptr %17, align 1, !tbaa !24
  %18 = getelementptr inbounds i8, ptr %0, i64 898
  %19 = ptrtoint ptr %9 to i64
  %20 = getelementptr inbounds i8, ptr %0, i64 906
  store i64 %19, ptr %20, align 2, !tbaa !25
  store <4 x i16> <i16 17, i16 0, i16 16, i16 80>, ptr %18, align 2, !tbaa !26
  %21 = ptrtoint ptr %11 to i64
  %22 = getelementptr inbounds i8, ptr %0, i64 914
  store i64 %21, ptr %22, align 2, !tbaa !27
  %23 = getelementptr inbounds i8, ptr %0, i64 922
  store i16 0, ptr %23, align 2, !tbaa !28
  %24 = getelementptr inbounds i8, ptr %0, i64 924
  store i16 0, ptr %24, align 2, !tbaa !29
  %25 = getelementptr inbounds i8, ptr %0, i64 842
  %26 = load i16, ptr %25, align 2, !tbaa !30
  %27 = getelementptr inbounds i8, ptr %0, i64 926
  store i16 %26, ptr %27, align 2, !tbaa !31
  %28 = getelementptr inbounds i8, ptr %0, i64 928
  store i16 0, ptr %28, align 2, !tbaa !32
  %29 = tail call zeroext i8 @DebugPrintEnabled() #3
  %.not = icmp eq i8 %29, 0
  br i1 %.not, label %33, label %30

30:                                               ; preds = %7
  %31 = tail call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 16384) #3
  %.not54 = icmp eq i8 %31, 0
  br i1 %.not54, label %33, label %32

32:                                               ; preds = %30
  tail call void (i64, ptr, ...) @DebugPrint(i64 noundef 16384, ptr noundef nonnull @.str) #3
  br label %33

33:                                               ; preds = %30, %32, %7
  %34 = getelementptr inbounds i8, ptr %0, i64 832
  %35 = load ptr, ptr %34, align 8, !tbaa !33
  %36 = ptrtoint ptr %18 to i64
  %37 = tail call i64 %35(i64 noundef %36) #3
  %38 = load i16, ptr %23, align 2, !tbaa !28
  switch i16 %38, label %48 [
    i16 0, label %57
    i16 19, label %39
  ]

39:                                               ; preds = %33
  %40 = tail call zeroext i8 @DebugPrintEnabled() #3
  %.not55 = icmp eq i8 %40, 0
  br i1 %.not55, label %92, label %41

41:                                               ; preds = %39
  %42 = tail call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 16384) #3
  %.not56 = icmp eq i8 %42, 0
  br i1 %.not56, label %92, label %43

43:                                               ; preds = %41
  %44 = load i16, ptr %24, align 2, !tbaa !29
  %45 = zext i16 %44 to i32
  %46 = load i16, ptr %23, align 2, !tbaa !28
  %47 = zext i16 %46 to i32
  tail call void (i64, ptr, ...) @DebugPrint(i64 noundef 16384, ptr noundef nonnull @.str.1, i32 noundef %45, i32 noundef %47) #3
  br label %92

48:                                               ; preds = %33
  %49 = tail call zeroext i8 @DebugPrintEnabled() #3
  %.not64 = icmp eq i8 %49, 0
  br i1 %.not64, label %92, label %50

50:                                               ; preds = %48
  %51 = tail call zeroext i8 @DebugPrintLevelEnabled(i64 noundef 2147483648) #3
  %.not65 = icmp eq i8 %51, 0
  br i1 %.not65, label %92, label %52

52:                                               ; preds = %50
  %53 = load i16, ptr %24, align 2, !tbaa !29
  %54 = zext i16 %53 to i32
  %55 = load i16, ptr %23, align 2, !tbaa !28
  %56 = zext i16 %55 to i32
  tail call void (i64, ptr, ...) @DebugPrint(i64 noundef 2147483648, ptr noundef nonnull @.str.2, i32 noundef %54, i32 noundef %56) #3
  br label %92

57:                                               ; preds = %33
  %58 = getelementptr inbounds i8, ptr %11, i64 64
  %59 = load i32, ptr %58, align 1, !tbaa !34
  %60 = zext i32 %59 to i64
  store i64 %60, ptr %2, align 8, !tbaa !20
  %.not57 = icmp eq ptr %3, null
  br i1 %.not57, label %65, label %61

61:                                               ; preds = %57
  %62 = getelementptr inbounds i8, ptr %11, i64 70
  %63 = load i16, ptr %62, align 1, !tbaa !36
  %64 = zext i16 %63 to i64
  store i64 %64, ptr %3, align 8, !tbaa !20
  br label %65

65:                                               ; preds = %61, %57
  %.not58 = icmp eq ptr %4, null
  br i1 %.not58, label %71, label %66

66:                                               ; preds = %65
  %67 = getelementptr inbounds i8, ptr %0, i64 164
  %68 = load i32, ptr %67, align 4, !tbaa !37
  %69 = zext i32 %68 to i64
  %70 = tail call ptr @CopyMem(ptr noundef nonnull %4, ptr noundef nonnull %11, i64 noundef %69) #3
  br label %71

71:                                               ; preds = %66, %65
  %.not59 = icmp eq ptr %5, null
  br i1 %.not59, label %78, label %72

72:                                               ; preds = %71
  %73 = getelementptr inbounds i8, ptr %11, i64 32
  %74 = getelementptr inbounds i8, ptr %0, i64 164
  %75 = load i32, ptr %74, align 4, !tbaa !37
  %76 = zext i32 %75 to i64
  %77 = tail call ptr @CopyMem(ptr noundef nonnull %5, ptr noundef nonnull %73, i64 noundef %76) #3
  br label %78

78:                                               ; preds = %72, %71
  %.not60 = icmp eq ptr %6, null
  br i1 %.not60, label %82, label %79

79:                                               ; preds = %78
  %80 = getelementptr inbounds i8, ptr %11, i64 68
  %81 = load i16, ptr %80, align 1, !tbaa !38
  %rev = tail call i16 @llvm.bswap.i16(i16 %81)
  store i16 %rev, ptr %6, align 2, !tbaa !26
  br label %82

82:                                               ; preds = %79, %78
  %83 = getelementptr inbounds i8, ptr %0, i64 811
  %84 = load i8, ptr %83, align 1, !tbaa !39
  %.not61 = icmp eq i8 %84, 0
  br i1 %.not61, label %89, label %85

85:                                               ; preds = %82
  %86 = getelementptr inbounds i8, ptr %0, i64 812
  %87 = load i8, ptr %86, align 4, !tbaa !40
  %.not62 = icmp eq i8 %87, 0
  br i1 %.not62, label %88, label %89

88:                                               ; preds = %85
  store i8 1, ptr %86, align 4, !tbaa !40
  br label %89

89:                                               ; preds = %88, %85, %82
  %90 = load i64, ptr %2, align 8, !tbaa !20
  %.not63 = icmp ugt i64 %90, %12
  %91 = select i1 %.not63, i64 -9223372036854775803, i64 0
  br label %92

92:                                               ; preds = %48, %52, %50, %39, %43, %41, %89
  %.0 = phi i64 [ %91, %89 ], [ -9223372036854775802, %41 ], [ -9223372036854775802, %43 ], [ -9223372036854775802, %39 ], [ -9223372036854775801, %50 ], [ -9223372036854775801, %52 ], [ -9223372036854775801, %48 ]
  ret i64 %.0
}

declare zeroext i8 @DebugPrintEnabled() local_unnamed_addr #1

declare zeroext i8 @DebugPrintLevelEnabled(i64 noundef) local_unnamed_addr #1

declare void @DebugPrint(i64 noundef, ptr noundef, ...) local_unnamed_addr #1

declare ptr @CopyMem(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i16 @llvm.bswap.i16(i16) #2

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !13, i64 936}
!6 = !{!"", !7, i64 0, !10, i64 8, !12, i64 32, !14, i64 160, !13, i64 816, !13, i64 824, !13, i64 832, !8, i64 840, !16, i64 842, !7, i64 844, !13, i64 848, !13, i64 856, !13, i64 864, !13, i64 872, !13, i64 880, !13, i64 888, !8, i64 896, !8, i64 897, !17, i64 898, !13, i64 936, !13, i64 944, !13, i64 952, !18, i64 960, !13, i64 1008, !8, i64 1016, !13, i64 2616, !8, i64 2624}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"", !11, i64 0, !11, i64 8, !7, i64 16}
!11 = !{!"long long", !8, i64 0}
!12 = !{!"_EFI_SIMPLE_NETWORK_PROTOCOL", !11, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !13, i64 64, !13, i64 72, !13, i64 80, !13, i64 88, !13, i64 96, !13, i64 104, !13, i64 112, !13, i64 120}
!13 = !{!"any pointer", !8, i64 0}
!14 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !8, i64 40, !15, i64 552, !15, i64 584, !15, i64 616, !8, i64 648, !8, i64 649, !8, i64 650, !8, i64 651, !8, i64 652}
!15 = !{!"", !8, i64 0}
!16 = !{!"short", !8, i64 0}
!17 = !{!"s_pxe_cdb", !16, i64 0, !16, i64 2, !16, i64 4, !16, i64 6, !11, i64 8, !11, i64 16, !16, i64 24, !16, i64 26, !16, i64 28, !16, i64 30}
!18 = !{!"s_pxe_db_get_init_info", !7, i64 0, !7, i64 4, !8, i64 8, !7, i64 24, !16, i64 28, !16, i64 30, !16, i64 32, !16, i64 34, !16, i64 36, !16, i64 38, !16, i64 40, !16, i64 42, !8, i64 44, !8, i64 45, !8, i64 46}
!19 = !{!6, !13, i64 952}
!20 = !{!11, !11, i64 0}
!21 = !{!22, !11, i64 0}
!22 = !{!"s_pxe_cpb_receive", !11, i64 0, !7, i64 8, !7, i64 12}
!23 = !{!22, !7, i64 8}
!24 = !{!22, !7, i64 12}
!25 = !{!6, !11, i64 906}
!26 = !{!16, !16, i64 0}
!27 = !{!6, !11, i64 914}
!28 = !{!6, !16, i64 922}
!29 = !{!6, !16, i64 924}
!30 = !{!6, !16, i64 842}
!31 = !{!6, !16, i64 926}
!32 = !{!6, !16, i64 928}
!33 = !{!6, !13, i64 832}
!34 = !{!35, !7, i64 64}
!35 = !{!"s_pxe_db_receive", !8, i64 0, !8, i64 32, !7, i64 64, !16, i64 68, !16, i64 70, !8, i64 72, !8, i64 73}
!36 = !{!35, !16, i64 70}
!37 = !{!6, !7, i64 164}
!38 = !{!35, !16, i64 68}
!39 = !{!6, !8, i64 811}
!40 = !{!6, !8, i64 812}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass