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

; 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_TIME = type { i16, i8, i8, i8, i8, i8, i8, i32, i16, i8, i8 }
%struct.EFI_RUNTIME_SERVICES = type { %struct.EFI_TABLE_HEADER, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.EFI_TABLE_HEADER = type { i64, i32, i32, i32, i32 }
%struct._PXEBC_PRIVATE_DATA = type { i32, ptr, ptr, %struct._PXEBC_PRIVATE_PROTOCOL, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %struct._EFI_PXE_BASE_CODE_PROTOCOL, %struct._EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL, ptr, ptr, %struct.EFI_PXE_BASE_CODE_MODE, i32, i32, i32, i64, %struct.EFI_UDP4_CONFIG_DATA, %struct.EFI_UDP6_CONFIG_DATA, %struct.EFI_IP4_CONFIG_DATA, %struct.EFI_IP6_CONFIG_DATA, ptr, ptr, %struct.EFI_IP4_COMPLETION_TOKEN, %struct.EFI_IP6_COMPLETION_TOKEN, i8, i8, i8, i8, %union.EFI_IP_ADDRESS, %union.EFI_IP_ADDRESS, %union.EFI_IP_ADDRESS, %union.EFI_IP_ADDRESS, i16, i32, i32, i32, ptr, i64, i64, %union.PXEBC_DHCP_PACKET_CACHE, %union.PXEBC_DHCP_PACKET_CACHE, %union.PXEBC_DHCP_PACKET_CACHE, ptr, %struct.EFI_DHCP4_PACKET, i32, i32, [16 x %union.PXEBC_DHCP_PACKET_CACHE], i32, [8 x i32], [8 x [16 x i32]] }
%struct._PXEBC_PRIVATE_PROTOCOL = type { i64 }
%struct._EFI_PXE_BASE_CODE_PROTOCOL = type { i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct._EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL = type { i64, ptr }
%struct.EFI_PXE_BASE_CODE_MODE = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, %union.EFI_IP_ADDRESS, %union.EFI_IP_ADDRESS, %union.EFI_PXE_BASE_CODE_PACKET, %union.EFI_PXE_BASE_CODE_PACKET, %union.EFI_PXE_BASE_CODE_PACKET, %union.EFI_PXE_BASE_CODE_PACKET, %union.EFI_PXE_BASE_CODE_PACKET, %union.EFI_PXE_BASE_CODE_PACKET, %struct.EFI_PXE_BASE_CODE_IP_FILTER, i32, [8 x %struct.EFI_PXE_BASE_CODE_ARP_ENTRY], i32, [8 x %struct.EFI_PXE_BASE_CODE_ROUTE_ENTRY], %struct.EFI_PXE_BASE_CODE_ICMP_ERROR, %struct.EFI_PXE_BASE_CODE_TFTP_ERROR }
%union.EFI_PXE_BASE_CODE_PACKET = type { %struct.EFI_PXE_BASE_CODE_DHCPV6_PACKET, [444 x i8] }
%struct.EFI_PXE_BASE_CODE_DHCPV6_PACKET = type { i32, [1024 x i8] }
%struct.EFI_PXE_BASE_CODE_IP_FILTER = type { i8, i8, i16, [8 x %union.EFI_IP_ADDRESS] }
%struct.EFI_PXE_BASE_CODE_ARP_ENTRY = type { %union.EFI_IP_ADDRESS, %struct.EFI_MAC_ADDRESS }
%struct.EFI_MAC_ADDRESS = type { [32 x i8] }
%struct.EFI_PXE_BASE_CODE_ROUTE_ENTRY = type { %union.EFI_IP_ADDRESS, %union.EFI_IP_ADDRESS, %union.EFI_IP_ADDRESS }
%struct.EFI_PXE_BASE_CODE_ICMP_ERROR = type { i8, i8, i16, %union.anon, [494 x i8] }
%union.anon = type { i32 }
%struct.EFI_PXE_BASE_CODE_TFTP_ERROR = type { i8, [127 x i8] }
%struct.EFI_UDP4_CONFIG_DATA = type { i8, i8, i8, i8, i8, i8, i8, i32, i32, i8, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i16, %struct.EFI_IPv4_ADDRESS, i16 }
%struct.EFI_IPv4_ADDRESS = type { [4 x i8] }
%struct.EFI_UDP6_CONFIG_DATA = type { i8, i8, i8, i8, i8, i32, i32, %struct.EFI_IPv6_ADDRESS, i16, %struct.EFI_IPv6_ADDRESS, i16 }
%struct.EFI_IPv6_ADDRESS = type { [16 x i8] }
%struct.EFI_IP4_CONFIG_DATA = type { i8, i8, i8, i8, i8, i8, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i8, i8, i8, i8, i32, i32 }
%struct.EFI_IP6_CONFIG_DATA = type { i8, i8, i8, i8, %struct.EFI_IPv6_ADDRESS, %struct.EFI_IPv6_ADDRESS, i8, i8, i32, i32, i32 }
%struct.EFI_IP4_COMPLETION_TOKEN = type { ptr, i64, %union.anon.0 }
%union.anon.0 = type { ptr }
%struct.EFI_IP6_COMPLETION_TOKEN = type { ptr, i64, %union.anon.1 }
%union.anon.1 = type { ptr }
%union.EFI_IP_ADDRESS = type { [4 x i32] }
%union.PXEBC_DHCP_PACKET_CACHE = type { %struct.PXEBC_DHCP4_PACKET_CACHE }
%struct.PXEBC_DHCP4_PACKET_CACHE = type { %union.PXEBC_DHCP4_PACKET, i32, [7 x ptr], %struct.PXEBC_VENDOR_OPTION }
%union.PXEBC_DHCP4_PACKET = type { [1472 x i8] }
%struct.PXEBC_VENDOR_OPTION = type { [8 x i32], %struct.EFI_IPv4_ADDRESS, i16, i16, i8, i8, i8, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i16, i16, i16, i16, ptr, i8, ptr, i8, ptr, i8, ptr, i8 }
%struct.EFI_DHCP4_PACKET = type <{ i32, i32, %struct.anon.2 }>
%struct.anon.2 = type <{ %struct.EFI_DHCP4_HEADER, i32, [1 x i8] }>
%struct.EFI_DHCP4_HEADER = type { i8, i8, i8, i8, i32, i16, i16, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, [16 x i8], [64 x i8], [128 x i8] }

@gRT = external global ptr, align 8

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @CalcElapsedTime(ptr noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca %struct.EFI_TIME, align 4
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, 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
  %6 = call ptr @ZeroMem(ptr noundef %3, i64 noundef 16)
  %7 = load ptr, ptr @gRT, align 8, !tbaa !5
  %8 = getelementptr inbounds %struct.EFI_RUNTIME_SERVICES, ptr %7, i32 0, i32 1
  %9 = load ptr, ptr %8, align 8, !tbaa !9
  %10 = call i64 %9(ptr noundef %3, ptr noundef null)
  %11 = getelementptr inbounds %struct.EFI_TIME, ptr %3, i32 0, i32 0
  %12 = load i16, ptr %11, align 4, !tbaa !14
  %13 = zext i16 %12 to i32
  %14 = sub nsw i32 %13, 1900
  %15 = mul nsw i32 %14, 360
  %16 = getelementptr inbounds %struct.EFI_TIME, ptr %3, i32 0, i32 1
  %17 = load i8, ptr %16, align 2, !tbaa !17
  %18 = zext i8 %17 to i32
  %19 = sub nsw i32 %18, 1
  %20 = add nsw i32 %15, %19
  %21 = mul nsw i32 %20, 30
  %22 = getelementptr inbounds %struct.EFI_TIME, ptr %3, i32 0, i32 2
  %23 = load i8, ptr %22, align 1, !tbaa !18
  %24 = zext i8 %23 to i32
  %25 = sub nsw i32 %24, 1
  %26 = add nsw i32 %21, %25
  %27 = mul nsw i32 %26, 24
  %28 = getelementptr inbounds %struct.EFI_TIME, ptr %3, i32 0, i32 3
  %29 = load i8, ptr %28, align 4, !tbaa !19
  %30 = zext i8 %29 to i32
  %31 = add nsw i32 %27, %30
  %32 = mul nsw i32 %31, 60
  %33 = getelementptr inbounds %struct.EFI_TIME, ptr %3, i32 0, i32 4
  %34 = load i8, ptr %33, align 1, !tbaa !20
  %35 = zext i8 %34 to i32
  %36 = add nsw i32 %32, %35
  %37 = mul nsw i32 %36, 60
  %38 = getelementptr inbounds %struct.EFI_TIME, ptr %3, i32 0, i32 5
  %39 = load i8, ptr %38, align 2, !tbaa !21
  %40 = zext i8 %39 to i32
  %41 = add nsw i32 %37, %40
  %42 = mul nsw i32 %41, 100
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds %struct.EFI_TIME, ptr %3, i32 0, i32 7
  %45 = load i32, ptr %44, align 4, !tbaa !22
  %46 = zext i32 %45 to i64
  %47 = call i64 @DivU64x32(i64 noundef %46, i32 noundef 10000000)
  %48 = add i64 %43, %47
  store i64 %48, ptr %4, align 8, !tbaa !23
  %49 = load ptr, ptr %2, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %49, i32 0, i32 39
  %51 = load i64, ptr %50, align 8, !tbaa !24
  %52 = icmp eq i64 %51, 0
  br i1 %52, label %53, label %57

53:                                               ; preds = %1
  %54 = load i64, ptr %4, align 8, !tbaa !23
  %55 = load ptr, ptr %2, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %55, i32 0, i32 39
  store i64 %54, ptr %56, align 8, !tbaa !24
  br label %70

57:                                               ; preds = %1
  %58 = load i64, ptr %4, align 8, !tbaa !23
  %59 = load ptr, ptr %2, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %59, i32 0, i32 39
  %61 = load i64, ptr %60, align 8, !tbaa !24
  %62 = sub i64 %58, %61
  store i64 %62, ptr %5, align 8, !tbaa !23
  %63 = load i64, ptr %5, align 8, !tbaa !23
  %64 = icmp ugt i64 %63, 65535
  br i1 %64, label %65, label %66

65:                                               ; preds = %57
  store i64 65535, ptr %5, align 8, !tbaa !23
  br label %66

66:                                               ; preds = %65, %57
  %67 = load i64, ptr %5, align 8, !tbaa !23
  %68 = load ptr, ptr %2, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct._PXEBC_PRIVATE_DATA, ptr %68, i32 0, i32 39
  store i64 %67, ptr %69, align 8, !tbaa !24
  br label %70

70:                                               ; preds = %66, %53
  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 16, ptr %3) #3
  ret void
}

declare i64 @DivU64x32(i64 noundef, i32 noundef) #1

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 24}
!10 = !{!"", !11, i64 0, !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, !6, i64 128}
!11 = !{!"", !12, i64 0, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20}
!12 = !{!"long long", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !16, i64 0}
!15 = !{!"", !16, i64 0, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !13, i64 8, !16, i64 12, !7, i64 14, !7, i64 15}
!16 = !{!"short", !7, i64 0}
!17 = !{!15, !7, i64 2}
!18 = !{!15, !7, i64 3}
!19 = !{!15, !7, i64 4}
!20 = !{!15, !7, i64 5}
!21 = !{!15, !7, i64 6}
!22 = !{!15, !13, i64 8}
!23 = !{!12, !12, i64 0}
!24 = !{!25, !12, i64 10832}
!25 = !{!"_PXEBC_PRIVATE_DATA", !13, i64 0, !6, i64 8, !6, i64 16, !26, 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, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !27, i64 248, !28, i64 360, !6, i64 376, !6, i64 384, !29, i64 392, !13, i64 10816, !13, i64 10820, !13, i64 10824, !12, i64 10832, !33, i64 10840, !35, i64 10876, !36, i64 10928, !37, i64 10956, !6, i64 11008, !6, i64 11016, !38, i64 11024, !38, i64 11048, !7, i64 11072, !7, i64 11073, !7, i64 11074, !7, i64 11075, !7, i64 11076, !7, i64 11092, !7, i64 11108, !7, i64 11124, !16, i64 11140, !13, i64 11144, !13, i64 11148, !13, i64 11152, !6, i64 11160, !12, i64 11168, !12, i64 11176, !7, i64 11184, !7, i64 12848, !7, i64 14512, !6, i64 16176, !39, i64 16184, !13, i64 16436, !13, i64 16440, !7, i64 16448, !13, i64 43072, !7, i64 43076, !7, i64 43108}
!26 = !{!"_PXEBC_PRIVATE_PROTOCOL", !12, i64 0}
!27 = !{!"_EFI_PXE_BASE_CODE_PROTOCOL", !12, 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}
!28 = !{!"_EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL", !12, i64 0, !6, i64 8}
!29 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !7, i64 8, !7, i64 9, !7, i64 10, !7, i64 11, !7, i64 12, !7, i64 13, !7, i64 14, !7, i64 15, !7, i64 16, !7, i64 17, !7, i64 18, !7, i64 20, !7, i64 36, !7, i64 52, !7, i64 1524, !7, i64 2996, !7, i64 4468, !7, i64 5940, !7, i64 7412, !30, i64 8884, !13, i64 9016, !7, i64 9020, !13, i64 9404, !7, i64 9408, !31, i64 9792, !32, i64 10296}
!30 = !{!"", !7, i64 0, !7, i64 1, !16, i64 2, !7, i64 4}
!31 = !{!"", !7, i64 0, !7, i64 1, !16, i64 2, !7, i64 4, !7, i64 8}
!32 = !{!"", !7, i64 0, !7, i64 1}
!33 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6, !13, i64 8, !13, i64 12, !7, i64 16, !34, i64 17, !34, i64 21, !16, i64 26, !34, i64 28, !16, i64 32}
!34 = !{!"", !7, i64 0}
!35 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !13, i64 8, !13, i64 12, !34, i64 16, !16, i64 32, !34, i64 34, !16, i64 50}
!36 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !34, i64 6, !34, i64 10, !7, i64 14, !7, i64 15, !7, i64 16, !7, i64 17, !13, i64 20, !13, i64 24}
!37 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !34, i64 4, !34, i64 20, !7, i64 36, !7, i64 37, !13, i64 40, !13, i64 44, !13, i64 48}
!38 = !{!"", !6, i64 0, !12, i64 8, !7, i64 16}
!39 = !{!"", !13, i64 0, !13, i64 4, !40, i64 8}
!40 = !{!"", !41, i64 0, !13, i64 236, !7, i64 240}
!41 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !13, i64 4, !16, i64 8, !16, i64 10, !34, i64 12, !34, i64 16, !34, i64 20, !34, i64 24, !7, i64 28, !7, i64 44, !7, i64 108}


; 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_TIME = type { i16, i8, i8, i8, i8, i8, i8, i32, i16, i8, i8 }

@gRT = external local_unnamed_addr global ptr, align 8

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @CalcElapsedTime(ptr nocapture noundef %0) local_unnamed_addr #2 {
  %2 = alloca %struct.EFI_TIME, align 4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #4
  %3 = call ptr @ZeroMem(ptr noundef nonnull %2, i64 noundef 16) #4
  %4 = load ptr, ptr @gRT, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %4, i64 24
  %6 = load ptr, ptr %5, align 8, !tbaa !9
  %7 = call i64 %6(ptr noundef nonnull %2, ptr noundef null) #4
  %8 = load i16, ptr %2, align 4, !tbaa !14
  %9 = zext i16 %8 to i64
  %10 = mul nuw nsw i64 %9, 360
  %11 = getelementptr inbounds i8, ptr %2, i64 2
  %12 = load i8, ptr %11, align 2, !tbaa !17
  %13 = zext i8 %12 to i64
  %14 = add nuw nsw i64 %10, %13
  %15 = mul nuw nsw i64 %14, 30
  %16 = getelementptr inbounds i8, ptr %2, i64 3
  %17 = load i8, ptr %16, align 1, !tbaa !18
  %18 = zext i8 %17 to i64
  %19 = add nuw nsw i64 %15, %18
  %20 = mul nuw nsw i64 %19, 24
  %21 = getelementptr inbounds i8, ptr %2, i64 4
  %22 = load i8, ptr %21, align 4, !tbaa !19
  %23 = zext i8 %22 to i64
  %24 = add nuw nsw i64 %23, -492480744
  %25 = add nsw i64 %24, %20
  %26 = mul nsw i64 %25, 60
  %27 = getelementptr inbounds i8, ptr %2, i64 5
  %28 = load i8, ptr %27, align 1, !tbaa !20
  %29 = zext i8 %28 to i64
  %30 = add nsw i64 %26, %29
  %31 = mul nsw i64 %30, 60
  %32 = getelementptr inbounds i8, ptr %2, i64 6
  %33 = load i8, ptr %32, align 2, !tbaa !21
  %34 = zext i8 %33 to i64
  %35 = add nsw i64 %31, %34
  %sext = mul i64 %35, 429496729600
  %36 = ashr exact i64 %sext, 32
  %37 = getelementptr inbounds i8, ptr %2, i64 8
  %38 = load i32, ptr %37, align 4, !tbaa !22
  %39 = zext i32 %38 to i64
  %40 = call i64 @DivU64x32(i64 noundef %39, i32 noundef 10000000) #4
  %41 = add i64 %36, %40
  %42 = getelementptr inbounds i8, ptr %0, i64 10832
  %43 = load i64, ptr %42, align 8, !tbaa !23
  %44 = icmp eq i64 %43, 0
  %45 = sub i64 %41, %43
  %spec.store.select = call i64 @llvm.umin.i64(i64 %45, i64 65535)
  %storemerge = select i1 %44, i64 %41, i64 %spec.store.select
  store i64 %storemerge, ptr %42, align 8, !tbaa !23
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #4
  ret void
}

declare i64 @DivU64x32(i64 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umin.i64(i64, i64) #3

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 24}
!10 = !{!"", !11, i64 0, !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, !6, i64 128}
!11 = !{!"", !12, i64 0, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20}
!12 = !{!"long long", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !16, i64 0}
!15 = !{!"", !16, i64 0, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !13, i64 8, !16, i64 12, !7, i64 14, !7, i64 15}
!16 = !{!"short", !7, i64 0}
!17 = !{!15, !7, i64 2}
!18 = !{!15, !7, i64 3}
!19 = !{!15, !7, i64 4}
!20 = !{!15, !7, i64 5}
!21 = !{!15, !7, i64 6}
!22 = !{!15, !13, i64 8}
!23 = !{!24, !12, i64 10832}
!24 = !{!"_PXEBC_PRIVATE_DATA", !13, i64 0, !6, i64 8, !6, i64 16, !25, 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, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !26, i64 248, !27, i64 360, !6, i64 376, !6, i64 384, !28, i64 392, !13, i64 10816, !13, i64 10820, !13, i64 10824, !12, i64 10832, !32, i64 10840, !34, i64 10876, !35, i64 10928, !36, i64 10956, !6, i64 11008, !6, i64 11016, !37, i64 11024, !37, i64 11048, !7, i64 11072, !7, i64 11073, !7, i64 11074, !7, i64 11075, !7, i64 11076, !7, i64 11092, !7, i64 11108, !7, i64 11124, !16, i64 11140, !13, i64 11144, !13, i64 11148, !13, i64 11152, !6, i64 11160, !12, i64 11168, !12, i64 11176, !7, i64 11184, !7, i64 12848, !7, i64 14512, !6, i64 16176, !38, i64 16184, !13, i64 16436, !13, i64 16440, !7, i64 16448, !13, i64 43072, !7, i64 43076, !7, i64 43108}
!25 = !{!"_PXEBC_PRIVATE_PROTOCOL", !12, i64 0}
!26 = !{!"_EFI_PXE_BASE_CODE_PROTOCOL", !12, 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}
!27 = !{!"_EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL", !12, i64 0, !6, i64 8}
!28 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !7, i64 8, !7, i64 9, !7, i64 10, !7, i64 11, !7, i64 12, !7, i64 13, !7, i64 14, !7, i64 15, !7, i64 16, !7, i64 17, !7, i64 18, !7, i64 20, !7, i64 36, !7, i64 52, !7, i64 1524, !7, i64 2996, !7, i64 4468, !7, i64 5940, !7, i64 7412, !29, i64 8884, !13, i64 9016, !7, i64 9020, !13, i64 9404, !7, i64 9408, !30, i64 9792, !31, i64 10296}
!29 = !{!"", !7, i64 0, !7, i64 1, !16, i64 2, !7, i64 4}
!30 = !{!"", !7, i64 0, !7, i64 1, !16, i64 2, !7, i64 4, !7, i64 8}
!31 = !{!"", !7, i64 0, !7, i64 1}
!32 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6, !13, i64 8, !13, i64 12, !7, i64 16, !33, i64 17, !33, i64 21, !16, i64 26, !33, i64 28, !16, i64 32}
!33 = !{!"", !7, i64 0}
!34 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !13, i64 8, !13, i64 12, !33, i64 16, !16, i64 32, !33, i64 34, !16, i64 50}
!35 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !33, i64 6, !33, i64 10, !7, i64 14, !7, i64 15, !7, i64 16, !7, i64 17, !13, i64 20, !13, i64 24}
!36 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !33, i64 4, !33, i64 20, !7, i64 36, !7, i64 37, !13, i64 40, !13, i64 44, !13, i64 48}
!37 = !{!"", !6, i64 0, !12, i64 8, !7, i64 16}
!38 = !{!"", !13, i64 0, !13, i64 4, !39, i64 8}
!39 = !{!"", !40, i64 0, !13, i64 236, !7, i64 240}
!40 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !13, i64 4, !16, i64 8, !16, i64 10, !33, i64 12, !33, i64 16, !33, i64 20, !33, i64 24, !7, i64 28, !7, i64 44, !7, i64 108}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass