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

; 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.PXEBC_DHCP6_PACKET_CACHE = type { %union.PXEBC_DHCP6_PACKET, i32, [4 x ptr] }
%union.PXEBC_DHCP6_PACKET = type { [1472 x i8] }
%struct.EFI_DHCP6_PACKET = type <{ i32, i32, %struct.anon.3 }>
%struct.anon.3 = type <{ %struct.EFI_DHCP6_HEADER, [1 x i8] }>
%struct.EFI_DHCP6_HEADER = type { i32 }
%struct.EFI_DHCP6_PACKET_OPTION = type <{ i16, i16, [1 x i8] }>

@.str = external hidden unnamed_addr constant [33 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @PxeBcParseDhcp6Options(ptr noundef, i32 noundef, i16 noundef zeroext) #0

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

declare zeroext i16 @SwapBytes16(i16 noundef zeroext) #2

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

declare i32 @SwapBytes32(i32 noundef) #2

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

; Function Attrs: nounwind uwtable
define dso_local i64 @PxeBcParseDhcp6Packet(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i8, align 1
  %8 = alloca i8, align 1
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  store i8 1, ptr %7, align 1, !tbaa !9
  store i8 0, ptr %8, align 1, !tbaa !9
  %12 = load ptr, ptr %2, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.PXEBC_DHCP6_PACKET_CACHE, ptr %12, i32 0, i32 0
  store ptr %13, ptr %3, align 8, !tbaa !5
  %14 = load ptr, ptr %2, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.PXEBC_DHCP6_PACKET_CACHE, ptr %14, i32 0, i32 2
  %16 = getelementptr inbounds [4 x ptr], ptr %15, i64 0, i64 0
  store ptr %16, ptr %4, align 8, !tbaa !5
  %17 = load ptr, ptr %2, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.PXEBC_DHCP6_PACKET_CACHE, ptr %17, i32 0, i32 2
  %19 = getelementptr inbounds [4 x ptr], ptr %18, i64 0, i64 0
  %20 = call ptr @ZeroMem(ptr noundef %19, i64 noundef 32)
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %21, i32 0, i32 2
  %23 = getelementptr inbounds %struct.anon.3, ptr %22, i32 0, i32 1
  %24 = getelementptr inbounds [1 x i8], ptr %23, i64 0, i64 0
  store ptr %24, ptr %5, align 8, !tbaa !5
  store i32 0, ptr %9, align 4, !tbaa !10
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %25, i32 0, i32 1
  %27 = load i32, ptr %26, align 1, !tbaa !12
  %28 = zext i32 %27 to i64
  %29 = sub i64 %28, 4
  %30 = trunc i64 %29 to i32
  store i32 %30, ptr %10, align 4, !tbaa !10
  br label %31

31:                                               ; preds = %82, %1
  %32 = load i32, ptr %9, align 4, !tbaa !10
  %33 = load i32, ptr %10, align 4, !tbaa !10
  %34 = icmp ult i32 %32, %33
  br i1 %34, label %35, label %98

35:                                               ; preds = %31
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %36, i32 0, i32 0
  %38 = load i16, ptr %37, align 1, !tbaa !16
  %39 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %38)
  %40 = zext i16 %39 to i32
  %41 = icmp eq i32 %40, 3
  br i1 %41, label %42, label %46

42:                                               ; preds = %35
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = load ptr, ptr %4, align 8, !tbaa !5
  %45 = getelementptr inbounds ptr, ptr %44, i64 0
  store ptr %43, ptr %45, align 8, !tbaa !5
  br label %82

46:                                               ; preds = %35
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %47, i32 0, i32 0
  %49 = load i16, ptr %48, align 1, !tbaa !16
  %50 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %49)
  %51 = zext i16 %50 to i32
  %52 = icmp eq i32 %51, 59
  br i1 %52, label %53, label %57

53:                                               ; preds = %46
  %54 = load ptr, ptr %5, align 8, !tbaa !5
  %55 = load ptr, ptr %4, align 8, !tbaa !5
  %56 = getelementptr inbounds ptr, ptr %55, i64 1
  store ptr %54, ptr %56, align 8, !tbaa !5
  br label %81

57:                                               ; preds = %46
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %58, i32 0, i32 0
  %60 = load i16, ptr %59, align 1, !tbaa !16
  %61 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %60)
  %62 = zext i16 %61 to i32
  %63 = icmp eq i32 %62, 60
  br i1 %63, label %64, label %68

64:                                               ; preds = %57
  %65 = load ptr, ptr %5, align 8, !tbaa !5
  %66 = load ptr, ptr %4, align 8, !tbaa !5
  %67 = getelementptr inbounds ptr, ptr %66, i64 2
  store ptr %65, ptr %67, align 8, !tbaa !5
  br label %80

68:                                               ; preds = %57
  %69 = load ptr, ptr %5, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %69, i32 0, i32 0
  %71 = load i16, ptr %70, align 1, !tbaa !16
  %72 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %71)
  %73 = zext i16 %72 to i32
  %74 = icmp eq i32 %73, 16
  br i1 %74, label %75, label %79

75:                                               ; preds = %68
  %76 = load ptr, ptr %5, align 8, !tbaa !5
  %77 = load ptr, ptr %4, align 8, !tbaa !5
  %78 = getelementptr inbounds ptr, ptr %77, i64 3
  store ptr %76, ptr %78, align 8, !tbaa !5
  br label %79

79:                                               ; preds = %75, %68
  br label %80

80:                                               ; preds = %79, %64
  br label %81

81:                                               ; preds = %80, %53
  br label %82

82:                                               ; preds = %81, %42
  %83 = load ptr, ptr %5, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %83, i32 0, i32 1
  %85 = load i16, ptr %84, align 1, !tbaa !19
  %86 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %85)
  %87 = zext i16 %86 to i32
  %88 = add nsw i32 %87, 4
  %89 = load i32, ptr %9, align 4, !tbaa !10
  %90 = add i32 %89, %88
  store i32 %90, ptr %9, align 4, !tbaa !10
  %91 = load ptr, ptr %3, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.EFI_DHCP6_PACKET, ptr %91, i32 0, i32 2
  %93 = getelementptr inbounds %struct.anon.3, ptr %92, i32 0, i32 1
  %94 = getelementptr inbounds [1 x i8], ptr %93, i64 0, i64 0
  %95 = load i32, ptr %9, align 4, !tbaa !10
  %96 = zext i32 %95 to i64
  %97 = getelementptr inbounds i8, ptr %94, i64 %96
  store ptr %97, ptr %5, align 8, !tbaa !5
  br label %31, !llvm.loop !20

98:                                               ; preds = %31
  %99 = load ptr, ptr %4, align 8, !tbaa !5
  %100 = getelementptr inbounds ptr, ptr %99, i64 0
  %101 = load ptr, ptr %100, align 8, !tbaa !5
  store ptr %101, ptr %5, align 8, !tbaa !5
  %102 = load ptr, ptr %5, align 8, !tbaa !5
  %103 = icmp ne ptr %102, null
  br i1 %103, label %104, label %129

104:                                              ; preds = %98
  %105 = load ptr, ptr %5, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %105, i32 0, i32 2
  %107 = getelementptr inbounds [1 x i8], ptr %106, i64 0, i64 0
  %108 = getelementptr inbounds i8, ptr %107, i64 12
  %109 = load ptr, ptr %5, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %109, i32 0, i32 1
  %111 = load i16, ptr %110, align 1, !tbaa !19
  %112 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %111)
  %113 = zext i16 %112 to i32
  %114 = call ptr @PxeBcParseDhcp6Options(ptr noundef %108, i32 noundef %113, i16 noundef zeroext 13)
  store ptr %114, ptr %5, align 8, !tbaa !5
  %115 = load ptr, ptr %5, align 8, !tbaa !5
  %116 = icmp ne ptr %115, null
  br i1 %116, label %117, label %124

117:                                              ; preds = %104
  %118 = load ptr, ptr %5, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %118, i32 0, i32 2
  %120 = getelementptr inbounds [1 x i8], ptr %119, i64 0, i64 0
  %121 = load i8, ptr %120, align 1, !tbaa !9
  %122 = zext i8 %121 to i32
  %123 = icmp eq i32 %122, 0
  br i1 %123, label %127, label %124

124:                                              ; preds = %117, %104
  %125 = load ptr, ptr %5, align 8, !tbaa !5
  %126 = icmp eq ptr %125, null
  br i1 %126, label %127, label %128

127:                                              ; preds = %124, %117
  store i8 0, ptr %7, align 1, !tbaa !9
  br label %128

128:                                              ; preds = %127, %124
  br label %129

129:                                              ; preds = %128, %98
  %130 = load ptr, ptr %4, align 8, !tbaa !5
  %131 = getelementptr inbounds ptr, ptr %130, i64 3
  %132 = load ptr, ptr %131, align 8, !tbaa !5
  store ptr %132, ptr %5, align 8, !tbaa !5
  %133 = call i32 @SwapBytes32(i32 noundef 343)
  store i32 %133, ptr %11, align 4, !tbaa !10
  %134 = load ptr, ptr %5, align 8, !tbaa !5
  %135 = icmp ne ptr %134, null
  br i1 %135, label %136, label %156

136:                                              ; preds = %129
  %137 = load ptr, ptr %5, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %137, i32 0, i32 1
  %139 = load i16, ptr %138, align 1, !tbaa !19
  %140 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %139)
  %141 = zext i16 %140 to i32
  %142 = icmp sge i32 %141, 13
  br i1 %142, label %143, label %156

143:                                              ; preds = %136
  %144 = load ptr, ptr %5, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %144, i32 0, i32 2
  %146 = getelementptr inbounds [1 x i8], ptr %145, i64 0, i64 0
  %147 = call i64 @CompareMem(ptr noundef %146, ptr noundef %11, i64 noundef 4)
  %148 = icmp eq i64 %147, 0
  br i1 %148, label %149, label %156

149:                                              ; preds = %143
  %150 = load ptr, ptr %5, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.EFI_DHCP6_PACKET_OPTION, ptr %150, i32 0, i32 2
  %152 = getelementptr inbounds [1 x i8], ptr %151, i64 0, i64 6
  %153 = call i64 @CompareMem(ptr noundef %152, ptr noundef @.str, i64 noundef 9)
  %154 = icmp eq i64 %153, 0
  br i1 %154, label %155, label %156

155:                                              ; preds = %149
  store i8 1, ptr %8, align 1, !tbaa !9
  br label %156

156:                                              ; preds = %155, %149, %143, %136, %129
  %157 = load i8, ptr %8, align 1, !tbaa !9
  %158 = icmp ne i8 %157, 0
  br i1 %158, label %159, label %165

159:                                              ; preds = %156
  %160 = load i8, ptr %7, align 1, !tbaa !9
  %161 = zext i8 %160 to i32
  %162 = icmp ne i32 %161, 0
  %163 = zext i1 %162 to i64
  %164 = select i1 %162, i32 6, i32 3
  store i32 %164, ptr %6, align 4, !tbaa !10
  br label %166

165:                                              ; preds = %156
  store i32 0, ptr %6, align 4, !tbaa !10
  br label %166

166:                                              ; preds = %165, %159
  %167 = load i32, ptr %6, align 4, !tbaa !10
  %168 = load ptr, ptr %2, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.PXEBC_DHCP6_PACKET_CACHE, ptr %168, i32 0, i32 1
  store i32 %167, ptr %169, align 8, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  ret i64 0
}

declare ptr @ZeroMem(ptr noundef, i64 noundef) #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 = { 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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !11, i64 4}
!13 = !{!"", !11, i64 0, !11, i64 4, !14, i64 8}
!14 = !{!"", !15, i64 0, !7, i64 4}
!15 = !{!"", !11, i64 0, !11, i64 1}
!16 = !{!17, !18, i64 0}
!17 = !{!"", !18, i64 0, !18, i64 2, !7, i64 4}
!18 = !{!"short", !7, i64 0}
!19 = !{!17, !18, i64 2}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!23, !11, i64 1472}
!23 = !{!"", !7, i64 0, !11, i64 1472, !7, i64 1480}


; 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 [33 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @PxeBcParseDhcp6Options(ptr noundef, i32 noundef, i16 noundef zeroext) local_unnamed_addr #0

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

declare zeroext i16 @SwapBytes16(i16 noundef zeroext) local_unnamed_addr #2

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

declare i32 @SwapBytes32(i32 noundef) local_unnamed_addr #2

declare i64 @CompareMem(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local noundef i64 @PxeBcParseDhcp6Packet(ptr noundef %0) local_unnamed_addr #0 {
  %2 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #3
  %3 = getelementptr inbounds i8, ptr %0, i64 1480
  %4 = tail call ptr @ZeroMem(ptr noundef nonnull %3, i64 noundef 32) #3
  %5 = getelementptr inbounds i8, ptr %0, i64 12
  %6 = getelementptr inbounds i8, ptr %0, i64 4
  %7 = load i32, ptr %6, align 1, !tbaa !5
  %8 = add i32 %7, -4
  %.not55 = icmp eq i32 %8, 0
  br i1 %.not55, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %1
  %9 = getelementptr inbounds i8, ptr %0, i64 1504
  %10 = getelementptr inbounds i8, ptr %0, i64 1496
  %11 = getelementptr inbounds i8, ptr %0, i64 1488
  br label %12

12:                                               ; preds = %.lr.ph, %28
  %.054 = phi ptr [ %5, %.lr.ph ], [ %36, %28 ]
  %.03953 = phi i32 [ 0, %.lr.ph ], [ %34, %28 ]
  %13 = load i16, ptr %.054, align 1, !tbaa !12
  %14 = tail call zeroext i16 @SwapBytes16(i16 noundef zeroext %13) #3
  %15 = icmp eq i16 %14, 3
  br i1 %15, label %.sink.split, label %16

16:                                               ; preds = %12
  %17 = load i16, ptr %.054, align 1, !tbaa !12
  %18 = tail call zeroext i16 @SwapBytes16(i16 noundef zeroext %17) #3
  %19 = icmp eq i16 %18, 59
  br i1 %19, label %.sink.split, label %20

20:                                               ; preds = %16
  %21 = load i16, ptr %.054, align 1, !tbaa !12
  %22 = tail call zeroext i16 @SwapBytes16(i16 noundef zeroext %21) #3
  %23 = icmp eq i16 %22, 60
  br i1 %23, label %.sink.split, label %24

24:                                               ; preds = %20
  %25 = load i16, ptr %.054, align 1, !tbaa !12
  %26 = tail call zeroext i16 @SwapBytes16(i16 noundef zeroext %25) #3
  %27 = icmp eq i16 %26, 16
  br i1 %27, label %.sink.split, label %28

.sink.split:                                      ; preds = %24, %20, %16, %12
  %.sink = phi ptr [ %3, %12 ], [ %11, %16 ], [ %10, %20 ], [ %9, %24 ]
  store ptr %.054, ptr %.sink, align 8, !tbaa !15
  br label %28

28:                                               ; preds = %.sink.split, %24
  %29 = getelementptr inbounds i8, ptr %.054, i64 2
  %30 = load i16, ptr %29, align 1, !tbaa !17
  %31 = tail call zeroext i16 @SwapBytes16(i16 noundef zeroext %30) #3
  %32 = zext i16 %31 to i32
  %33 = add i32 %.03953, 4
  %34 = add i32 %33, %32
  %35 = zext i32 %34 to i64
  %36 = getelementptr inbounds i8, ptr %5, i64 %35
  %37 = icmp ult i32 %34, %8
  br i1 %37, label %12, label %._crit_edge, !llvm.loop !18

._crit_edge:                                      ; preds = %28, %1
  %38 = load ptr, ptr %3, align 8, !tbaa !15
  %.not = icmp eq ptr %38, null
  br i1 %.not, label %51, label %39

39:                                               ; preds = %._crit_edge
  %40 = getelementptr inbounds i8, ptr %38, i64 16
  %41 = getelementptr inbounds i8, ptr %38, i64 2
  %42 = load i16, ptr %41, align 1, !tbaa !17
  %43 = tail call zeroext i16 @SwapBytes16(i16 noundef zeroext %42) #3
  %44 = zext i16 %43 to i32
  %45 = tail call ptr @PxeBcParseDhcp6Options(ptr noundef nonnull %40, i32 noundef %44, i16 noundef zeroext 13)
  %.not46 = icmp eq ptr %45, null
  br i1 %.not46, label %50, label %46

46:                                               ; preds = %39
  %47 = getelementptr inbounds i8, ptr %45, i64 4
  %48 = load i8, ptr %47, align 1, !tbaa !20
  %49 = icmp eq i8 %48, 0
  br i1 %49, label %50, label %51

50:                                               ; preds = %39, %46
  br label %51

51:                                               ; preds = %50, %46, %._crit_edge
  %.not49 = phi i32 [ 3, %50 ], [ 6, %46 ], [ 6, %._crit_edge ]
  %52 = getelementptr inbounds i8, ptr %0, i64 1504
  %53 = load ptr, ptr %52, align 8, !tbaa !15
  %54 = tail call i32 @SwapBytes32(i32 noundef 343) #3
  store i32 %54, ptr %2, align 4, !tbaa !21
  %.not47 = icmp eq ptr %53, null
  br i1 %.not47, label %.thread, label %55

55:                                               ; preds = %51
  %56 = getelementptr inbounds i8, ptr %53, i64 2
  %57 = load i16, ptr %56, align 1, !tbaa !17
  %58 = tail call zeroext i16 @SwapBytes16(i16 noundef zeroext %57) #3
  %59 = icmp ugt i16 %58, 12
  br i1 %59, label %60, label %.thread

60:                                               ; preds = %55
  %61 = getelementptr inbounds i8, ptr %53, i64 4
  %62 = call i64 @CompareMem(ptr noundef nonnull %61, ptr noundef nonnull %2, i64 noundef 4) #3
  %63 = icmp eq i64 %62, 0
  br i1 %63, label %64, label %.thread

64:                                               ; preds = %60
  %65 = getelementptr inbounds i8, ptr %53, i64 10
  %66 = call i64 @CompareMem(ptr noundef nonnull %65, ptr noundef nonnull @.str, i64 noundef 9) #3
  %.fr = freeze i64 %66
  %.not52 = icmp eq i64 %.fr, 0
  br i1 %.not52, label %67, label %.thread

.thread:                                          ; preds = %51, %55, %60, %64
  br label %67

67:                                               ; preds = %64, %.thread
  %68 = phi i32 [ 0, %.thread ], [ %.not49, %64 ]
  %69 = getelementptr inbounds i8, ptr %0, i64 1472
  store i32 %68, ptr %69, align 8, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #3
  ret i64 0
}

declare ptr @ZeroMem(ptr noundef, i64 noundef) local_unnamed_addr #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 = { mustprogress 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, !7, i64 4}
!6 = !{!"", !7, i64 0, !7, i64 4, !10, i64 8}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"", !11, i64 0, !8, i64 4}
!11 = !{!"", !7, i64 0, !7, i64 1}
!12 = !{!13, !14, i64 0}
!13 = !{!"", !14, i64 0, !14, i64 2, !8, i64 4}
!14 = !{!"short", !8, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"any pointer", !8, i64 0}
!17 = !{!13, !14, i64 2}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!8, !8, i64 0}
!21 = !{!7, !7, i64 0}
!22 = !{!23, !7, i64 1472}
!23 = !{!"", !8, i64 0, !7, i64 1472, !8, i64 1480}


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