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

; 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.EFI_DHCP4_MODE_DATA = type { i32, %struct.EFI_DHCP4_CONFIG_DATA, %struct.EFI_IPv4_ADDRESS, %struct.EFI_MAC_ADDRESS, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i32, ptr }
%struct.EFI_DHCP4_CONFIG_DATA = type { i32, ptr, i32, ptr, %struct.EFI_IPv4_ADDRESS, ptr, ptr, i32, ptr }
%struct.EFI_MAC_ADDRESS = type { [32 x i8] }
%struct.EFI_IPv4_ADDRESS = type { [4 x i8] }
%struct._EFI_DHCP4_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct._ISCSI_SESSION_CONFIG_DATA = type { %struct.ISCSI_SESSION_CONFIG_NVDATA, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS }
%struct.ISCSI_SESSION_CONFIG_NVDATA = type <{ i8, i8, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i8, [224 x i8], %struct.EFI_IPv4_ADDRESS, i16, [8 x i8], [6 x i8] }>
%struct.EFI_DHCP4_PACKET_OPTION = type { i8, i8, [1 x i8] }

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

declare ptr @AllocatePool(i64 noundef) #1

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

declare void @FreePool(ptr noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local i64 @IScsiParseDhcpAck(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 %struct.EFI_DHCP4_MODE_DATA, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %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 144, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct._EFI_DHCP4_PROTOCOL, ptr %12, i32 0, i32 0
  %14 = load ptr, ptr %13, align 8, !tbaa !9
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = call i64 %14(ptr noundef %15, ptr noundef %7)
  store i64 %16, ptr %6, align 8, !tbaa !11
  %17 = load i64, ptr %6, align 8, !tbaa !11
  %18 = icmp slt i64 %17, 0
  br i1 %18, label %19, label %21

19:                                               ; preds = %2
  %20 = load i64, ptr %6, align 8, !tbaa !11
  store i64 %20, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %183

21:                                               ; preds = %2
  %22 = getelementptr inbounds %struct.EFI_DHCP4_MODE_DATA, ptr %7, i32 0, i32 0
  %23 = load i32, ptr %22, align 8, !tbaa !13
  %24 = icmp ne i32 %23, 4
  br i1 %24, label %25, label %26

25:                                               ; preds = %21
  store i64 -9223372036854775791, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %183

26:                                               ; preds = %21
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct._ISCSI_SESSION_CONFIG_DATA, ptr %27, i32 0, i32 0
  %29 = getelementptr inbounds %struct.ISCSI_SESSION_CONFIG_NVDATA, ptr %28, i32 0, i32 2
  %30 = getelementptr inbounds %struct.EFI_DHCP4_MODE_DATA, ptr %7, i32 0, i32 2
  %31 = call ptr @CopyMem(ptr noundef %29, ptr noundef %30, i64 noundef 4)
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct._ISCSI_SESSION_CONFIG_DATA, ptr %32, i32 0, i32 0
  %34 = getelementptr inbounds %struct.ISCSI_SESSION_CONFIG_NVDATA, ptr %33, i32 0, i32 3
  %35 = getelementptr inbounds %struct.EFI_DHCP4_MODE_DATA, ptr %7, i32 0, i32 6
  %36 = call ptr @CopyMem(ptr noundef %34, ptr noundef %35, i64 noundef 4)
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct._ISCSI_SESSION_CONFIG_DATA, ptr %37, i32 0, i32 0
  %39 = getelementptr inbounds %struct.ISCSI_SESSION_CONFIG_NVDATA, ptr %38, i32 0, i32 4
  %40 = getelementptr inbounds %struct.EFI_DHCP4_MODE_DATA, ptr %7, i32 0, i32 5
  %41 = call ptr @CopyMem(ptr noundef %39, ptr noundef %40, i64 noundef 4)
  store i32 0, ptr %8, align 4, !tbaa !18
  store ptr null, ptr %9, align 8, !tbaa !5
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct._EFI_DHCP4_PROTOCOL, ptr %42, i32 0, i32 8
  %44 = load ptr, ptr %43, align 8, !tbaa !19
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.EFI_DHCP4_MODE_DATA, ptr %7, i32 0, i32 8
  %47 = load ptr, ptr %46, align 8, !tbaa !20
  %48 = load ptr, ptr %9, align 8, !tbaa !5
  %49 = call i64 %44(ptr noundef %45, ptr noundef %47, ptr noundef %8, ptr noundef %48)
  store i64 %49, ptr %6, align 8, !tbaa !11
  %50 = load i64, ptr %6, align 8, !tbaa !11
  %51 = icmp ne i64 %50, -9223372036854775803
  br i1 %51, label %52, label %53

52:                                               ; preds = %26
  store i64 -9223372036854775801, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %183

53:                                               ; preds = %26
  %54 = load i32, ptr %8, align 4, !tbaa !18
  %55 = zext i32 %54 to i64
  %56 = mul i64 %55, 8
  %57 = call ptr @AllocatePool(i64 noundef %56)
  store ptr %57, ptr %9, align 8, !tbaa !5
  %58 = load ptr, ptr %9, align 8, !tbaa !5
  %59 = icmp eq ptr %58, null
  br i1 %59, label %60, label %61

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

61:                                               ; preds = %53
  %62 = load ptr, ptr %4, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct._EFI_DHCP4_PROTOCOL, ptr %62, i32 0, i32 8
  %64 = load ptr, ptr %63, align 8, !tbaa !19
  %65 = load ptr, ptr %4, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.EFI_DHCP4_MODE_DATA, ptr %7, i32 0, i32 8
  %67 = load ptr, ptr %66, align 8, !tbaa !20
  %68 = load ptr, ptr %9, align 8, !tbaa !5
  %69 = call i64 %64(ptr noundef %65, ptr noundef %67, ptr noundef %8, ptr noundef %68)
  store i64 %69, ptr %6, align 8, !tbaa !11
  %70 = load i64, ptr %6, align 8, !tbaa !11
  %71 = icmp slt i64 %70, 0
  br i1 %71, label %72, label %74

72:                                               ; preds = %61
  %73 = load ptr, ptr %9, align 8, !tbaa !5
  call void @FreePool(ptr noundef %73)
  store i64 -9223372036854775801, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %183

74:                                               ; preds = %61
  store i32 0, ptr %10, align 4, !tbaa !18
  br label %75

75:                                               ; preds = %177, %74
  %76 = load i32, ptr %10, align 4, !tbaa !18
  %77 = load i32, ptr %8, align 4, !tbaa !18
  %78 = icmp ult i32 %76, %77
  br i1 %78, label %79, label %180

79:                                               ; preds = %75
  %80 = load ptr, ptr %9, align 8, !tbaa !5
  %81 = load i32, ptr %10, align 4, !tbaa !18
  %82 = zext i32 %81 to i64
  %83 = getelementptr inbounds ptr, ptr %80, i64 %82
  %84 = load ptr, ptr %83, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.EFI_DHCP4_PACKET_OPTION, ptr %84, i32 0, i32 0
  %86 = load i8, ptr %85, align 1, !tbaa !21
  %87 = zext i8 %86 to i32
  %88 = icmp eq i32 %87, 6
  br i1 %88, label %89, label %143

89:                                               ; preds = %79
  %90 = load ptr, ptr %9, align 8, !tbaa !5
  %91 = load i32, ptr %10, align 4, !tbaa !18
  %92 = zext i32 %91 to i64
  %93 = getelementptr inbounds ptr, ptr %90, i64 %92
  %94 = load ptr, ptr %93, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.EFI_DHCP4_PACKET_OPTION, ptr %94, i32 0, i32 1
  %96 = load i8, ptr %95, align 1, !tbaa !23
  %97 = zext i8 %96 to i32
  %98 = and i32 %97, 3
  %99 = icmp ne i32 %98, 0
  br i1 %99, label %110, label %100

100:                                              ; preds = %89
  %101 = load ptr, ptr %9, align 8, !tbaa !5
  %102 = load i32, ptr %10, align 4, !tbaa !18
  %103 = zext i32 %102 to i64
  %104 = getelementptr inbounds ptr, ptr %101, i64 %103
  %105 = load ptr, ptr %104, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.EFI_DHCP4_PACKET_OPTION, ptr %105, i32 0, i32 1
  %107 = load i8, ptr %106, align 1, !tbaa !23
  %108 = zext i8 %107 to i32
  %109 = icmp eq i32 %108, 0
  br i1 %109, label %110, label %111

110:                                              ; preds = %100, %89
  store i64 -9223372036854775806, ptr %6, align 8, !tbaa !11
  br label %180

111:                                              ; preds = %100
  %112 = load ptr, ptr %5, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct._ISCSI_SESSION_CONFIG_DATA, ptr %112, i32 0, i32 1
  %114 = load ptr, ptr %9, align 8, !tbaa !5
  %115 = load i32, ptr %10, align 4, !tbaa !18
  %116 = zext i32 %115 to i64
  %117 = getelementptr inbounds ptr, ptr %114, i64 %116
  %118 = load ptr, ptr %117, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.EFI_DHCP4_PACKET_OPTION, ptr %118, i32 0, i32 2
  %120 = getelementptr inbounds [1 x i8], ptr %119, i64 0, i64 0
  %121 = call ptr @CopyMem(ptr noundef %113, ptr noundef %120, i64 noundef 4)
  %122 = load ptr, ptr %9, align 8, !tbaa !5
  %123 = load i32, ptr %10, align 4, !tbaa !18
  %124 = zext i32 %123 to i64
  %125 = getelementptr inbounds ptr, ptr %122, i64 %124
  %126 = load ptr, ptr %125, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.EFI_DHCP4_PACKET_OPTION, ptr %126, i32 0, i32 1
  %128 = load i8, ptr %127, align 1, !tbaa !23
  %129 = zext i8 %128 to i32
  %130 = icmp sgt i32 %129, 4
  br i1 %130, label %131, label %142

131:                                              ; preds = %111
  %132 = load ptr, ptr %5, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct._ISCSI_SESSION_CONFIG_DATA, ptr %132, i32 0, i32 2
  %134 = load ptr, ptr %9, align 8, !tbaa !5
  %135 = load i32, ptr %10, align 4, !tbaa !18
  %136 = zext i32 %135 to i64
  %137 = getelementptr inbounds ptr, ptr %134, i64 %136
  %138 = load ptr, ptr %137, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.EFI_DHCP4_PACKET_OPTION, ptr %138, i32 0, i32 2
  %140 = getelementptr inbounds [1 x i8], ptr %139, i64 0, i64 4
  %141 = call ptr @CopyMem(ptr noundef %133, ptr noundef %140, i64 noundef 4)
  br label %142

142:                                              ; preds = %131, %111
  br label %176

143:                                              ; preds = %79
  %144 = load ptr, ptr %9, align 8, !tbaa !5
  %145 = load i32, ptr %10, align 4, !tbaa !18
  %146 = zext i32 %145 to i64
  %147 = getelementptr inbounds ptr, ptr %144, i64 %146
  %148 = load ptr, ptr %147, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.EFI_DHCP4_PACKET_OPTION, ptr %148, i32 0, i32 0
  %150 = load i8, ptr %149, align 1, !tbaa !21
  %151 = zext i8 %150 to i32
  %152 = icmp eq i32 %151, 54
  br i1 %152, label %153, label %175

153:                                              ; preds = %143
  %154 = load ptr, ptr %9, align 8, !tbaa !5
  %155 = load i32, ptr %10, align 4, !tbaa !18
  %156 = zext i32 %155 to i64
  %157 = getelementptr inbounds ptr, ptr %154, i64 %156
  %158 = load ptr, ptr %157, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.EFI_DHCP4_PACKET_OPTION, ptr %158, i32 0, i32 1
  %160 = load i8, ptr %159, align 1, !tbaa !23
  %161 = zext i8 %160 to i32
  %162 = icmp ne i32 %161, 4
  br i1 %162, label %163, label %164

163:                                              ; preds = %153
  store i64 -9223372036854775806, ptr %6, align 8, !tbaa !11
  br label %180

164:                                              ; preds = %153
  %165 = load ptr, ptr %5, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct._ISCSI_SESSION_CONFIG_DATA, ptr %165, i32 0, i32 3
  %167 = load ptr, ptr %9, align 8, !tbaa !5
  %168 = load i32, ptr %10, align 4, !tbaa !18
  %169 = zext i32 %168 to i64
  %170 = getelementptr inbounds ptr, ptr %167, i64 %169
  %171 = load ptr, ptr %170, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.EFI_DHCP4_PACKET_OPTION, ptr %171, i32 0, i32 2
  %173 = getelementptr inbounds [1 x i8], ptr %172, i64 0, i64 0
  %174 = call ptr @CopyMem(ptr noundef %166, ptr noundef %173, i64 noundef 4)
  br label %175

175:                                              ; preds = %164, %143
  br label %176

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

177:                                              ; preds = %176
  %178 = load i32, ptr %10, align 4, !tbaa !18
  %179 = add i32 %178, 1
  store i32 %179, ptr %10, align 4, !tbaa !18
  br label %75, !llvm.loop !24

180:                                              ; preds = %163, %110, %75
  %181 = load ptr, ptr %9, align 8, !tbaa !5
  call void @FreePool(ptr noundef %181)
  %182 = load i64, ptr %6, align 8, !tbaa !11
  store i64 %182, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %183

183:                                              ; preds = %180, %72, %60, %52, %25, %19
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 144, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  %184 = load i64, ptr %3, align 8
  ret i64 %184
}

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 = !{!10, !6, i64 0}
!10 = !{!"_EFI_DHCP4_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}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = !{!14, !15, i64 0}
!14 = !{!"", !15, i64 0, !16, i64 8, !17, i64 80, !17, i64 84, !17, i64 116, !17, i64 120, !17, i64 124, !15, i64 128, !6, i64 136}
!15 = !{!"int", !7, i64 0}
!16 = !{!"", !15, i64 0, !6, i64 8, !15, i64 16, !6, i64 24, !17, i64 32, !6, i64 40, !6, i64 48, !15, i64 56, !6, i64 64}
!17 = !{!"", !7, i64 0}
!18 = !{!15, !15, i64 0}
!19 = !{!10, !6, i64 64}
!20 = !{!14, !6, i64 136}
!21 = !{!22, !7, i64 0}
!22 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2}
!23 = !{!22, !7, i64 1}
!24 = distinct !{!24, !25}
!25 = !{!"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"

%struct.EFI_DHCP4_MODE_DATA = type { i32, %struct.EFI_DHCP4_CONFIG_DATA, %struct.EFI_IPv4_ADDRESS, %struct.EFI_MAC_ADDRESS, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i32, ptr }
%struct.EFI_DHCP4_CONFIG_DATA = type { i32, ptr, i32, ptr, %struct.EFI_IPv4_ADDRESS, ptr, ptr, i32, ptr }
%struct.EFI_MAC_ADDRESS = type { [32 x i8] }
%struct.EFI_IPv4_ADDRESS = type { [4 x i8] }

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

declare ptr @AllocatePool(i64 noundef) local_unnamed_addr #1

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

declare void @FreePool(ptr 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

; Function Attrs: nounwind uwtable
define dso_local i64 @IScsiParseDhcpAck(ptr noundef %0, ptr noundef %1) local_unnamed_addr #2 {
  %3 = alloca %struct.EFI_DHCP4_MODE_DATA, align 8
  %4 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 144, ptr nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #3
  %5 = load ptr, ptr %0, align 8, !tbaa !5
  %6 = call i64 %5(ptr noundef nonnull %0, ptr noundef nonnull %3) #3
  %7 = icmp slt i64 %6, 0
  br i1 %7, label %69, label %8

8:                                                ; preds = %2
  %9 = load i32, ptr %3, align 8, !tbaa !10
  %.not = icmp eq i32 %9, 4
  br i1 %.not, label %10, label %69

10:                                               ; preds = %8
  %11 = getelementptr inbounds i8, ptr %1, i64 2
  %12 = getelementptr inbounds i8, ptr %3, i64 80
  %13 = call ptr @CopyMem(ptr noundef nonnull %11, ptr noundef nonnull %12, i64 noundef 4) #3
  %14 = getelementptr inbounds i8, ptr %1, i64 6
  %15 = getelementptr inbounds i8, ptr %3, i64 124
  %16 = call ptr @CopyMem(ptr noundef nonnull %14, ptr noundef nonnull %15, i64 noundef 4) #3
  %17 = getelementptr inbounds i8, ptr %1, i64 10
  %18 = getelementptr inbounds i8, ptr %3, i64 120
  %19 = call ptr @CopyMem(ptr noundef nonnull %17, ptr noundef nonnull %18, i64 noundef 4) #3
  store i32 0, ptr %4, align 4, !tbaa !15
  %20 = getelementptr inbounds i8, ptr %0, i64 64
  %21 = load ptr, ptr %20, align 8, !tbaa !16
  %22 = getelementptr inbounds i8, ptr %3, i64 136
  %23 = load ptr, ptr %22, align 8, !tbaa !17
  %24 = call i64 %21(ptr noundef nonnull %0, ptr noundef %23, ptr noundef nonnull %4, ptr noundef null) #3
  %.not48 = icmp eq i64 %24, -9223372036854775803
  br i1 %.not48, label %25, label %69

25:                                               ; preds = %10
  %26 = load i32, ptr %4, align 4, !tbaa !15
  %27 = zext i32 %26 to i64
  %28 = shl nuw nsw i64 %27, 3
  %29 = call ptr @AllocatePool(i64 noundef %28) #3
  %30 = icmp eq ptr %29, null
  br i1 %30, label %69, label %31

31:                                               ; preds = %25
  %32 = load ptr, ptr %20, align 8, !tbaa !16
  %33 = load ptr, ptr %22, align 8, !tbaa !17
  %34 = call i64 %32(ptr noundef nonnull %0, ptr noundef %33, ptr noundef nonnull %4, ptr noundef nonnull %29) #3
  %35 = icmp slt i64 %34, 0
  br i1 %35, label %.sink.split, label %.preheader

.preheader:                                       ; preds = %31
  %36 = load i32, ptr %4, align 4, !tbaa !15
  %.not56 = icmp eq i32 %36, 0
  br i1 %.not56, label %.sink.split, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  %37 = getelementptr inbounds i8, ptr %1, i64 267
  %38 = getelementptr inbounds i8, ptr %1, i64 259
  %39 = getelementptr inbounds i8, ptr %1, i64 263
  br label %40

40:                                               ; preds = %.lr.ph, %65
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %65 ]
  %41 = getelementptr inbounds ptr, ptr %29, i64 %indvars.iv
  %42 = load ptr, ptr %41, align 8, !tbaa !18
  %43 = load i8, ptr %42, align 1, !tbaa !19
  switch i8 %43, label %65 [
    i8 6, label %44
    i8 54, label %59
  ]

44:                                               ; preds = %40
  %45 = getelementptr inbounds i8, ptr %42, i64 1
  %46 = load i8, ptr %45, align 1, !tbaa !21
  %47 = and i8 %46, 3
  %.not50 = icmp ne i8 %47, 0
  %48 = icmp eq i8 %46, 0
  %or.cond = or i1 %48, %.not50
  br i1 %or.cond, label %.sink.split, label %49

49:                                               ; preds = %44
  %50 = getelementptr inbounds i8, ptr %42, i64 2
  %51 = call ptr @CopyMem(ptr noundef nonnull %38, ptr noundef nonnull %50, i64 noundef 4) #3
  %52 = load ptr, ptr %41, align 8, !tbaa !18
  %53 = getelementptr inbounds i8, ptr %52, i64 1
  %54 = load i8, ptr %53, align 1, !tbaa !21
  %55 = icmp ugt i8 %54, 4
  br i1 %55, label %56, label %65

56:                                               ; preds = %49
  %57 = getelementptr inbounds i8, ptr %52, i64 6
  %58 = call ptr @CopyMem(ptr noundef nonnull %39, ptr noundef nonnull %57, i64 noundef 4) #3
  br label %65

59:                                               ; preds = %40
  %60 = getelementptr inbounds i8, ptr %42, i64 1
  %61 = load i8, ptr %60, align 1, !tbaa !21
  %.not49 = icmp eq i8 %61, 4
  br i1 %.not49, label %62, label %.sink.split

62:                                               ; preds = %59
  %63 = getelementptr inbounds i8, ptr %42, i64 2
  %64 = call ptr @CopyMem(ptr noundef nonnull %37, ptr noundef nonnull %63, i64 noundef 4) #3
  br label %65

65:                                               ; preds = %40, %56, %49, %62
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %66 = load i32, ptr %4, align 4, !tbaa !15
  %67 = zext i32 %66 to i64
  %68 = icmp ult i64 %indvars.iv.next, %67
  br i1 %68, label %40, label %.sink.split, !llvm.loop !22

.sink.split:                                      ; preds = %59, %44, %65, %.preheader, %31
  %.043.ph = phi i64 [ -9223372036854775801, %31 ], [ %34, %.preheader ], [ -9223372036854775806, %59 ], [ -9223372036854775806, %44 ], [ %34, %65 ]
  call void @FreePool(ptr noundef nonnull %29) #3
  br label %69

69:                                               ; preds = %.sink.split, %25, %10, %8, %2
  %.043 = phi i64 [ %6, %2 ], [ -9223372036854775791, %8 ], [ -9223372036854775801, %10 ], [ -9223372036854775799, %25 ], [ %.043.ph, %.sink.split ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 144, ptr nonnull %3) #3
  ret i64 %.043
}

attributes #0 = { mustprogress 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, !7, i64 0}
!6 = !{!"_EFI_DHCP4_PROTOCOL", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!11, !12, i64 0}
!11 = !{!"", !12, i64 0, !13, i64 8, !14, i64 80, !14, i64 84, !14, i64 116, !14, i64 120, !14, i64 124, !12, i64 128, !7, i64 136}
!12 = !{!"int", !8, i64 0}
!13 = !{!"", !12, i64 0, !7, i64 8, !12, i64 16, !7, i64 24, !14, i64 32, !7, i64 40, !7, i64 48, !12, i64 56, !7, i64 64}
!14 = !{!"", !8, i64 0}
!15 = !{!12, !12, i64 0}
!16 = !{!6, !7, i64 64}
!17 = !{!11, !7, i64 136}
!18 = !{!7, !7, i64 0}
!19 = !{!20, !8, i64 0}
!20 = !{!"", !8, i64 0, !8, i64 1, !8, i64 2}
!21 = !{!20, !8, i64 1}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}


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