; LLVM IR from thalium/icebox :: third_party/virtualbox/src/VBox/Devices/EFI/Firmware/NetworkPkg/Dhcp6Dxe (Dhcp6HandleAdvertiseMsg)

; 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._DHCP6_INSTANCE = type { i32, ptr, ptr, %struct._LIST_ENTRY, %struct._EFI_DHCP6_PROTOCOL, ptr, ptr, ptr, %struct._DHCP6_IA_CB, %struct._LIST_ENTRY, %struct._LIST_ENTRY, ptr, i8, ptr, i64, i8, i8, i64 }
%struct._EFI_DHCP6_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct._DHCP6_IA_CB = type { ptr, i32, i32, i32, i32 }
%struct._LIST_ENTRY = type { ptr, ptr }
%struct.EFI_DHCP6_PACKET = type <{ i32, i32, %struct.anon }>
%struct.anon = type <{ %struct.EFI_DHCP6_HEADER, [1 x i8] }>
%struct.EFI_DHCP6_HEADER = type { i32 }
%struct.EFI_DHCP6_CONFIG_DATA = type { ptr, ptr, i32, ptr, %struct.EFI_DHCP6_IA_DESCRIPTOR, ptr, i8, i8, ptr }
%struct.EFI_DHCP6_IA_DESCRIPTOR = type { i16, i32 }

@.str = external hidden unnamed_addr constant [131 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [18 x i8], align 1

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

declare zeroext i8 @DebugAssertEnabled() #1

declare void @DebugAssert(ptr noundef, i64 noundef, ptr noundef) #1

declare ptr @AllocateZeroPool(i64 noundef) #1

; 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
declare dso_local i64 @Dhcp6CallbackUser(ptr noundef, i32 noundef, ptr noundef) #2

declare ptr @Dhcp6SeekOption(ptr noundef, i32 noundef, i16 noundef zeroext) #1

; Function Attrs: nounwind uwtable
declare dso_local i64 @Dhcp6SeekStsOption(ptr noundef, ptr noundef, ptr noundef) #2

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

; Function Attrs: nounwind uwtable
declare dso_local i64 @Dhcp6HandleReplyMsg(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i64 @Dhcp6SelectAdvertiseMsg(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i64 @Dhcp6HandleAdvertiseMsg(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 i16, align 2
  %9 = alloca i8, align 1
  %10 = 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 2, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #3
  br label %11

11:                                               ; preds = %2
  %12 = call zeroext i8 @DebugAssertEnabled()
  %13 = icmp ne i8 %12, 0
  br i1 %13, label %14, label %21

14:                                               ; preds = %11
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %15, i32 0, i32 6
  %17 = load ptr, ptr %16, align 8, !tbaa !9
  %18 = icmp ne ptr %17, null
  br i1 %18, label %20, label %19

19:                                               ; preds = %14
  call void @DebugAssert(ptr noundef @.str, i64 noundef 2434, ptr noundef @.str.3)
  br label %20

20:                                               ; preds = %19, %14
  br label %21

21:                                               ; preds = %20, %11
  br label %22

22:                                               ; preds = %21
  br label %23

23:                                               ; preds = %22
  br label %24

24:                                               ; preds = %23
  %25 = call zeroext i8 @DebugAssertEnabled()
  %26 = icmp ne i8 %25, 0
  br i1 %26, label %27, label %35

27:                                               ; preds = %24
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %28, i32 0, i32 8
  %30 = getelementptr inbounds %struct._DHCP6_IA_CB, ptr %29, i32 0, i32 0
  %31 = load ptr, ptr %30, align 8, !tbaa !16
  %32 = icmp ne ptr %31, null
  br i1 %32, label %34, label %33

33:                                               ; preds = %27
  call void @DebugAssert(ptr noundef @.str, i64 noundef 2435, ptr noundef @.str.4)
  br label %34

34:                                               ; preds = %33, %27
  br label %35

35:                                               ; preds = %34, %24
  br label %36

36:                                               ; preds = %35
  br label %37

37:                                               ; preds = %36
  store i8 0, ptr %9, align 1, !tbaa !17
  store i16 0, ptr %8, align 2, !tbaa !18
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %38, i32 0, i32 2
  %40 = getelementptr inbounds %struct.anon, ptr %39, i32 0, i32 1
  %41 = getelementptr inbounds [1 x i8], ptr %40, i64 0, i64 0
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %42, i32 0, i32 1
  %44 = load i32, ptr %43, align 1, !tbaa !20
  %45 = sub i32 %44, 4
  %46 = call ptr @Dhcp6SeekOption(ptr noundef %41, i32 noundef %45, i16 noundef zeroext 14)
  store ptr %46, ptr %7, align 8, !tbaa !5
  %47 = load ptr, ptr %7, align 8, !tbaa !5
  %48 = icmp ne ptr %47, null
  br i1 %48, label %49, label %68

49:                                               ; preds = %37
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %50, i32 0, i32 6
  %52 = load ptr, ptr %51, align 8, !tbaa !9
  %53 = getelementptr inbounds %struct.EFI_DHCP6_CONFIG_DATA, ptr %52, i32 0, i32 7
  %54 = load i8, ptr %53, align 1, !tbaa !24
  %55 = zext i8 %54 to i32
  %56 = icmp ne i32 %55, 0
  br i1 %56, label %57, label %68

57:                                               ; preds = %49
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %58, i32 0, i32 2
  %60 = getelementptr inbounds %struct.anon, ptr %59, i32 0, i32 0
  %61 = load i32, ptr %60, align 1
  %62 = and i32 %61, 255
  %63 = icmp eq i32 %62, 7
  br i1 %63, label %64, label %68

64:                                               ; preds = %57
  %65 = load ptr, ptr %4, align 8, !tbaa !5
  %66 = load ptr, ptr %5, align 8, !tbaa !5
  %67 = call i64 @Dhcp6HandleReplyMsg(ptr noundef %65, ptr noundef %66)
  store i64 %67, ptr %3, align 8
  store i32 1, ptr %10, align 4
  br label %228

68:                                               ; preds = %57, %49, %37
  %69 = load ptr, ptr %5, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %69, i32 0, i32 2
  %71 = getelementptr inbounds %struct.anon, ptr %70, i32 0, i32 0
  %72 = load i32, ptr %71, align 1
  %73 = and i32 %72, 255
  %74 = icmp ne i32 %73, 2
  br i1 %74, label %75, label %76

75:                                               ; preds = %68
  store i64 -9223372036854775801, ptr %3, align 8
  store i32 1, ptr %10, align 4
  br label %228

76:                                               ; preds = %68
  %77 = load ptr, ptr %4, align 8, !tbaa !5
  %78 = load ptr, ptr %5, align 8, !tbaa !5
  %79 = call i64 @Dhcp6SeekStsOption(ptr noundef %77, ptr noundef %78, ptr noundef %7)
  store i64 %79, ptr %6, align 8, !tbaa !27
  %80 = load i64, ptr %6, align 8, !tbaa !27
  %81 = icmp slt i64 %80, 0
  br i1 %81, label %82, label %83

82:                                               ; preds = %76
  store i64 -9223372036854775801, ptr %3, align 8
  store i32 1, ptr %10, align 4
  br label %228

83:                                               ; preds = %76
  %84 = load ptr, ptr %4, align 8, !tbaa !5
  %85 = call i64 @Dhcp6CallbackUser(ptr noundef %84, i32 noundef 1, ptr noundef %5)
  store i64 %85, ptr %6, align 8, !tbaa !27
  %86 = load i64, ptr %6, align 8, !tbaa !27
  %87 = icmp slt i64 %86, 0
  br i1 %87, label %122, label %88

88:                                               ; preds = %83
  %89 = load ptr, ptr %4, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %89, i32 0, i32 11
  %91 = load ptr, ptr %90, align 8, !tbaa !28
  %92 = icmp ne ptr %91, null
  br i1 %92, label %93, label %97

93:                                               ; preds = %88
  %94 = load ptr, ptr %4, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %94, i32 0, i32 11
  %96 = load ptr, ptr %95, align 8, !tbaa !28
  call void @FreePool(ptr noundef %96)
  br label %97

97:                                               ; preds = %93, %88
  %98 = load ptr, ptr %5, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %98, i32 0, i32 0
  %100 = load i32, ptr %99, align 1, !tbaa !29
  %101 = zext i32 %100 to i64
  %102 = call ptr @AllocateZeroPool(i64 noundef %101)
  %103 = load ptr, ptr %4, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %103, i32 0, i32 11
  store ptr %102, ptr %104, align 8, !tbaa !28
  %105 = load ptr, ptr %4, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %105, i32 0, i32 11
  %107 = load ptr, ptr %106, align 8, !tbaa !28
  %108 = icmp eq ptr %107, null
  br i1 %108, label %109, label %110

109:                                              ; preds = %97
  store i64 -9223372036854775799, ptr %3, align 8
  store i32 1, ptr %10, align 4
  br label %228

110:                                              ; preds = %97
  %111 = load ptr, ptr %4, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %111, i32 0, i32 11
  %113 = load ptr, ptr %112, align 8, !tbaa !28
  %114 = load ptr, ptr %5, align 8, !tbaa !5
  %115 = load ptr, ptr %5, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %115, i32 0, i32 0
  %117 = load i32, ptr %116, align 1, !tbaa !29
  %118 = zext i32 %117 to i64
  %119 = call ptr @CopyMem(ptr noundef %113, ptr noundef %114, i64 noundef %118)
  %120 = load ptr, ptr %4, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %120, i32 0, i32 12
  store i8 -1, ptr %121, align 8, !tbaa !30
  br label %210

122:                                              ; preds = %83
  %123 = load i64, ptr %6, align 8, !tbaa !27
  %124 = icmp eq i64 %123, -9223372036854775802
  br i1 %124, label %125, label %207

125:                                              ; preds = %122
  %126 = load ptr, ptr %4, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %126, i32 0, i32 12
  %128 = load i8, ptr %127, align 8, !tbaa !30
  %129 = zext i8 %128 to i32
  %130 = icmp eq i32 %129, 255
  br i1 %130, label %131, label %137

131:                                              ; preds = %125
  %132 = load ptr, ptr %4, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %132, i32 0, i32 11
  %134 = load ptr, ptr %133, align 8, !tbaa !28
  %135 = icmp eq ptr %134, null
  br i1 %135, label %136, label %137

136:                                              ; preds = %131
  store i8 1, ptr %9, align 1, !tbaa !17
  br label %137

137:                                              ; preds = %136, %131, %125
  %138 = load ptr, ptr %5, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %138, i32 0, i32 2
  %140 = getelementptr inbounds %struct.anon, ptr %139, i32 0, i32 1
  %141 = getelementptr inbounds [1 x i8], ptr %140, i64 0, i64 0
  %142 = load ptr, ptr %5, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %142, i32 0, i32 1
  %144 = load i32, ptr %143, align 1, !tbaa !20
  %145 = sub i32 %144, 4
  %146 = call ptr @Dhcp6SeekOption(ptr noundef %141, i32 noundef %145, i16 noundef zeroext 7)
  store ptr %146, ptr %7, align 8, !tbaa !5
  %147 = load ptr, ptr %4, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %147, i32 0, i32 11
  %149 = load ptr, ptr %148, align 8, !tbaa !28
  %150 = icmp eq ptr %149, null
  br i1 %150, label %164, label %151

151:                                              ; preds = %137
  %152 = load ptr, ptr %7, align 8, !tbaa !5
  %153 = icmp ne ptr %152, null
  br i1 %153, label %154, label %205

154:                                              ; preds = %151
  %155 = load ptr, ptr %7, align 8, !tbaa !5
  %156 = getelementptr inbounds i8, ptr %155, i64 4
  %157 = load i8, ptr %156, align 1, !tbaa !17
  %158 = zext i8 %157 to i32
  %159 = load ptr, ptr %4, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %159, i32 0, i32 12
  %161 = load i8, ptr %160, align 8, !tbaa !30
  %162 = zext i8 %161 to i32
  %163 = icmp sgt i32 %158, %162
  br i1 %163, label %164, label %205

164:                                              ; preds = %154, %137
  %165 = load ptr, ptr %4, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %165, i32 0, i32 11
  %167 = load ptr, ptr %166, align 8, !tbaa !28
  %168 = icmp ne ptr %167, null
  br i1 %168, label %169, label %173

169:                                              ; preds = %164
  %170 = load ptr, ptr %4, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %170, i32 0, i32 11
  %172 = load ptr, ptr %171, align 8, !tbaa !28
  call void @FreePool(ptr noundef %172)
  br label %173

173:                                              ; preds = %169, %164
  %174 = load ptr, ptr %5, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %174, i32 0, i32 0
  %176 = load i32, ptr %175, align 1, !tbaa !29
  %177 = zext i32 %176 to i64
  %178 = call ptr @AllocateZeroPool(i64 noundef %177)
  %179 = load ptr, ptr %4, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %179, i32 0, i32 11
  store ptr %178, ptr %180, align 8, !tbaa !28
  %181 = load ptr, ptr %4, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %181, i32 0, i32 11
  %183 = load ptr, ptr %182, align 8, !tbaa !28
  %184 = icmp eq ptr %183, null
  br i1 %184, label %185, label %186

185:                                              ; preds = %173
  store i64 -9223372036854775799, ptr %3, align 8
  store i32 1, ptr %10, align 4
  br label %228

186:                                              ; preds = %173
  %187 = load ptr, ptr %4, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %187, i32 0, i32 11
  %189 = load ptr, ptr %188, align 8, !tbaa !28
  %190 = load ptr, ptr %5, align 8, !tbaa !5
  %191 = load ptr, ptr %5, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %191, i32 0, i32 0
  %193 = load i32, ptr %192, align 1, !tbaa !29
  %194 = zext i32 %193 to i64
  %195 = call ptr @CopyMem(ptr noundef %189, ptr noundef %190, i64 noundef %194)
  %196 = load ptr, ptr %7, align 8, !tbaa !5
  %197 = icmp ne ptr %196, null
  br i1 %197, label %198, label %204

198:                                              ; preds = %186
  %199 = load ptr, ptr %7, align 8, !tbaa !5
  %200 = getelementptr inbounds i8, ptr %199, i64 4
  %201 = load i8, ptr %200, align 1, !tbaa !17
  %202 = load ptr, ptr %4, align 8, !tbaa !5
  %203 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %202, i32 0, i32 12
  store i8 %201, ptr %203, align 8, !tbaa !30
  br label %204

204:                                              ; preds = %198, %186
  br label %206

205:                                              ; preds = %154, %151
  br label %206

206:                                              ; preds = %205, %204
  br label %209

207:                                              ; preds = %122
  %208 = load i64, ptr %6, align 8, !tbaa !27
  store i64 %208, ptr %3, align 8
  store i32 1, ptr %10, align 4
  br label %228

209:                                              ; preds = %206
  br label %210

210:                                              ; preds = %209, %110
  %211 = load ptr, ptr %4, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %211, i32 0, i32 12
  %213 = load i8, ptr %212, align 8, !tbaa !30
  %214 = zext i8 %213 to i32
  %215 = icmp eq i32 %214, 255
  br i1 %215, label %220, label %216

216:                                              ; preds = %210
  %217 = load i8, ptr %9, align 1, !tbaa !17
  %218 = zext i8 %217 to i32
  %219 = icmp ne i32 %218, 0
  br i1 %219, label %220, label %226

220:                                              ; preds = %216, %210
  %221 = load ptr, ptr %4, align 8, !tbaa !5
  %222 = load ptr, ptr %4, align 8, !tbaa !5
  %223 = getelementptr inbounds %struct._DHCP6_INSTANCE, ptr %222, i32 0, i32 11
  %224 = load ptr, ptr %223, align 8, !tbaa !28
  %225 = call i64 @Dhcp6SelectAdvertiseMsg(ptr noundef %221, ptr noundef %224)
  store i64 %225, ptr %6, align 8, !tbaa !27
  br label %226

226:                                              ; preds = %220, %216
  %227 = load i64, ptr %6, align 8, !tbaa !27
  store i64 %227, ptr %3, align 8
  store i32 1, ptr %10, align 4
  br label %228

228:                                              ; preds = %226, %207, %185, %109, %82, %75, %64
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 2, 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
  %229 = load i64, ptr %3, align 8
  ret i64 %229
}

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 120}
!10 = !{!"_DHCP6_INSTANCE", !11, i64 0, !6, i64 8, !6, i64 16, !12, i64 24, !13, i64 40, !6, i64 112, !6, i64 120, !6, i64 128, !14, i64 136, !12, i64 160, !12, i64 176, !6, i64 192, !7, i64 200, !6, i64 208, !15, i64 216, !7, i64 224, !7, i64 225, !15, i64 232}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!13 = !{!"_EFI_DHCP6_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}
!14 = !{!"_DHCP6_IA_CB", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!15 = !{!"long long", !7, i64 0}
!16 = !{!10, !6, i64 136}
!17 = !{!7, !7, i64 0}
!18 = !{!19, !19, i64 0}
!19 = !{!"short", !7, i64 0}
!20 = !{!21, !11, i64 4}
!21 = !{!"", !11, i64 0, !11, i64 4, !22, i64 8}
!22 = !{!"", !23, i64 0, !7, i64 4}
!23 = !{!"", !11, i64 0, !11, i64 1}
!24 = !{!25, !7, i64 49}
!25 = !{!"", !6, i64 0, !6, i64 8, !11, i64 16, !6, i64 24, !26, i64 32, !6, i64 40, !7, i64 48, !7, i64 49, !6, i64 56}
!26 = !{!"", !19, i64 0, !11, i64 4}
!27 = !{!15, !15, i64 0}
!28 = !{!10, !6, i64 192}
!29 = !{!21, !11, i64 0}
!30 = !{!10, !7, i64 200}


; 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 [131 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [18 x i8], align 1

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

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #1

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

declare ptr @AllocateZeroPool(i64 noundef) local_unnamed_addr #1

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

declare void @FreePool(ptr noundef) local_unnamed_addr #1

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

declare ptr @Dhcp6SeekOption(ptr noundef, i32 noundef, i16 noundef zeroext) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local i64 @Dhcp6SeekStsOption(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
declare dso_local i64 @Dhcp6HandleReplyMsg(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local i64 @Dhcp6SelectAdvertiseMsg(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local i64 @Dhcp6HandleAdvertiseMsg(ptr noundef %0, ptr noundef %1) local_unnamed_addr #2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  store ptr %1, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %5 = tail call zeroext i8 @DebugAssertEnabled() #3
  %.not = icmp eq i8 %5, 0
  br i1 %.not, label %10, label %6

6:                                                ; preds = %2
  %7 = getelementptr inbounds i8, ptr %0, i64 120
  %8 = load ptr, ptr %7, align 8, !tbaa !9
  %.not42 = icmp eq ptr %8, null
  br i1 %.not42, label %9, label %10

9:                                                ; preds = %6
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 2434, ptr noundef nonnull @.str.3) #3
  br label %10

10:                                               ; preds = %2, %9, %6
  %11 = tail call zeroext i8 @DebugAssertEnabled() #3
  %.not43 = icmp eq i8 %11, 0
  br i1 %.not43, label %16, label %12

12:                                               ; preds = %10
  %13 = getelementptr inbounds i8, ptr %0, i64 136
  %14 = load ptr, ptr %13, align 8, !tbaa !16
  %.not44 = icmp eq ptr %14, null
  br i1 %.not44, label %15, label %16

15:                                               ; preds = %12
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 2435, ptr noundef nonnull @.str.4) #3
  br label %16

16:                                               ; preds = %12, %15, %10
  %17 = getelementptr inbounds i8, ptr %1, i64 12
  %18 = getelementptr inbounds i8, ptr %1, i64 4
  %19 = load i32, ptr %18, align 1, !tbaa !17
  %20 = add i32 %19, -4
  %21 = tail call ptr @Dhcp6SeekOption(ptr noundef nonnull %17, i32 noundef %20, i16 noundef zeroext 14) #3
  store ptr %21, ptr %4, align 8, !tbaa !5
  %.not45 = icmp eq ptr %21, null
  br i1 %.not45, label %34, label %22

22:                                               ; preds = %16
  %23 = getelementptr inbounds i8, ptr %0, i64 120
  %24 = load ptr, ptr %23, align 8, !tbaa !9
  %25 = getelementptr inbounds i8, ptr %24, i64 49
  %26 = load i8, ptr %25, align 1, !tbaa !21
  %.not46 = icmp eq i8 %26, 0
  br i1 %.not46, label %34, label %27

27:                                               ; preds = %22
  %28 = getelementptr inbounds i8, ptr %1, i64 8
  %29 = load i32, ptr %28, align 1
  %30 = and i32 %29, 255
  %31 = icmp eq i32 %30, 7
  br i1 %31, label %32, label %34

32:                                               ; preds = %27
  %33 = tail call i64 @Dhcp6HandleReplyMsg(ptr noundef nonnull %0, ptr noundef nonnull %1)
  br label %110

34:                                               ; preds = %27, %22, %16
  %35 = getelementptr inbounds i8, ptr %1, i64 8
  %36 = load i32, ptr %35, align 1
  %37 = and i32 %36, 255
  %.not47 = icmp eq i32 %37, 2
  br i1 %.not47, label %38, label %110

38:                                               ; preds = %34
  %39 = call i64 @Dhcp6SeekStsOption(ptr noundef %0, ptr noundef nonnull %1, ptr noundef nonnull %4)
  %40 = icmp slt i64 %39, 0
  br i1 %40, label %110, label %41

41:                                               ; preds = %38
  %42 = call i64 @Dhcp6CallbackUser(ptr noundef %0, i32 noundef 1, ptr noundef nonnull %3)
  %43 = icmp slt i64 %42, 0
  br i1 %43, label %60, label %44

44:                                               ; preds = %41
  %45 = getelementptr inbounds i8, ptr %0, i64 192
  %46 = load ptr, ptr %45, align 8, !tbaa !25
  %.not48 = icmp eq ptr %46, null
  br i1 %.not48, label %48, label %47

47:                                               ; preds = %44
  call void @FreePool(ptr noundef nonnull %46) #3
  br label %48

48:                                               ; preds = %47, %44
  %49 = load ptr, ptr %3, align 8, !tbaa !5
  %50 = load i32, ptr %49, align 1, !tbaa !26
  %51 = zext i32 %50 to i64
  %52 = call ptr @AllocateZeroPool(i64 noundef %51) #3
  store ptr %52, ptr %45, align 8, !tbaa !25
  %53 = icmp eq ptr %52, null
  br i1 %53, label %110, label %54

54:                                               ; preds = %48
  %55 = load ptr, ptr %3, align 8, !tbaa !5
  %56 = load i32, ptr %55, align 1, !tbaa !26
  %57 = zext i32 %56 to i64
  %58 = call ptr @CopyMem(ptr noundef nonnull %52, ptr noundef nonnull %55, i64 noundef %57) #3
  %59 = getelementptr inbounds i8, ptr %0, i64 200
  store i8 -1, ptr %59, align 8, !tbaa !27
  br label %101

60:                                               ; preds = %41
  %61 = icmp eq i64 %42, -9223372036854775802
  br i1 %61, label %62, label %110

62:                                               ; preds = %60
  %63 = getelementptr inbounds i8, ptr %0, i64 200
  %64 = load i8, ptr %63, align 8, !tbaa !27
  %65 = icmp eq i8 %64, -1
  br i1 %65, label %66, label %70

66:                                               ; preds = %62
  %67 = getelementptr inbounds i8, ptr %0, i64 192
  %68 = load ptr, ptr %67, align 8, !tbaa !25
  %69 = icmp eq ptr %68, null
  %spec.select = zext i1 %69 to i8
  br label %70

70:                                               ; preds = %66, %62
  %.0 = phi i8 [ 0, %62 ], [ %spec.select, %66 ]
  %71 = load ptr, ptr %3, align 8, !tbaa !5
  %72 = getelementptr inbounds i8, ptr %71, i64 12
  %73 = getelementptr inbounds i8, ptr %71, i64 4
  %74 = load i32, ptr %73, align 1, !tbaa !17
  %75 = add i32 %74, -4
  %76 = call ptr @Dhcp6SeekOption(ptr noundef nonnull %72, i32 noundef %75, i16 noundef zeroext 7) #3
  store ptr %76, ptr %4, align 8, !tbaa !5
  %77 = getelementptr inbounds i8, ptr %0, i64 192
  %78 = load ptr, ptr %77, align 8, !tbaa !25
  %79 = icmp eq ptr %78, null
  br i1 %79, label %.thread, label %80

80:                                               ; preds = %70
  %.not49 = icmp eq ptr %76, null
  br i1 %.not49, label %101, label %81

81:                                               ; preds = %80
  %82 = getelementptr inbounds i8, ptr %76, i64 4
  %83 = load i8, ptr %82, align 1, !tbaa !28
  %84 = load i8, ptr %63, align 8, !tbaa !27
  %85 = icmp ugt i8 %83, %84
  br i1 %85, label %86, label %101

86:                                               ; preds = %81
  call void @FreePool(ptr noundef nonnull %78) #3
  br label %.thread

.thread:                                          ; preds = %70, %86
  %87 = load ptr, ptr %3, align 8, !tbaa !5
  %88 = load i32, ptr %87, align 1, !tbaa !26
  %89 = zext i32 %88 to i64
  %90 = call ptr @AllocateZeroPool(i64 noundef %89) #3
  store ptr %90, ptr %77, align 8, !tbaa !25
  %91 = icmp eq ptr %90, null
  br i1 %91, label %110, label %92

92:                                               ; preds = %.thread
  %93 = load ptr, ptr %3, align 8, !tbaa !5
  %94 = load i32, ptr %93, align 1, !tbaa !26
  %95 = zext i32 %94 to i64
  %96 = call ptr @CopyMem(ptr noundef nonnull %90, ptr noundef nonnull %93, i64 noundef %95) #3
  %97 = load ptr, ptr %4, align 8, !tbaa !5
  %.not51 = icmp eq ptr %97, null
  br i1 %.not51, label %101, label %98

98:                                               ; preds = %92
  %99 = getelementptr inbounds i8, ptr %97, i64 4
  %100 = load i8, ptr %99, align 1, !tbaa !28
  store i8 %100, ptr %63, align 8, !tbaa !27
  br label %101

101:                                              ; preds = %80, %81, %92, %98, %54
  %.1 = phi i8 [ %.0, %98 ], [ %.0, %92 ], [ %.0, %81 ], [ %.0, %80 ], [ 0, %54 ]
  %102 = getelementptr inbounds i8, ptr %0, i64 200
  %103 = load i8, ptr %102, align 8, !tbaa !27
  %104 = icmp eq i8 %103, -1
  %105 = icmp ne i8 %.1, 0
  %or.cond = or i1 %105, %104
  br i1 %or.cond, label %106, label %110

106:                                              ; preds = %101
  %107 = getelementptr inbounds i8, ptr %0, i64 192
  %108 = load ptr, ptr %107, align 8, !tbaa !25
  %109 = call i64 @Dhcp6SelectAdvertiseMsg(ptr noundef nonnull %0, ptr noundef %108)
  br label %110

110:                                              ; preds = %106, %101, %60, %.thread, %48, %38, %34, %32
  %.033 = phi i64 [ %33, %32 ], [ -9223372036854775801, %34 ], [ -9223372036854775801, %38 ], [ -9223372036854775799, %48 ], [ -9223372036854775799, %.thread ], [ %42, %60 ], [ %109, %106 ], [ %42, %101 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  ret i64 %.033
}

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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 120}
!10 = !{!"_DHCP6_INSTANCE", !11, i64 0, !6, i64 8, !6, i64 16, !12, i64 24, !13, i64 40, !6, i64 112, !6, i64 120, !6, i64 128, !14, i64 136, !12, i64 160, !12, i64 176, !6, i64 192, !7, i64 200, !6, i64 208, !15, i64 216, !7, i64 224, !7, i64 225, !15, i64 232}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!13 = !{!"_EFI_DHCP6_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}
!14 = !{!"_DHCP6_IA_CB", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!15 = !{!"long long", !7, i64 0}
!16 = !{!10, !6, i64 136}
!17 = !{!18, !11, i64 4}
!18 = !{!"", !11, i64 0, !11, i64 4, !19, i64 8}
!19 = !{!"", !20, i64 0, !7, i64 4}
!20 = !{!"", !11, i64 0, !11, i64 1}
!21 = !{!22, !7, i64 49}
!22 = !{!"", !6, i64 0, !6, i64 8, !11, i64 16, !6, i64 24, !23, i64 32, !6, i64 40, !7, i64 48, !7, i64 49, !6, i64 56}
!23 = !{!"", !24, i64 0, !11, i64 4}
!24 = !{!"short", !7, i64 0}
!25 = !{!10, !6, i64 192}
!26 = !{!18, !11, i64 0}
!27 = !{!10, !7, i64 200}
!28 = !{!7, !7, i64 0}


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