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

; 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._MTFTP4_PROTOCOL = type { i32, %struct._LIST_ENTRY, %struct._EFI_MTFTP4_PROTOCOL, i64, i8, ptr, ptr, %struct.EFI_MTFTP4_CONFIG_DATA, ptr, %struct.MTFTP4_OPTION, i16, i16, i16, %struct._LIST_ENTRY, i32, i16, i16, i32, ptr, ptr, i32, i32, i32, i32, i32, i16, i8, ptr }
%struct._EFI_MTFTP4_PROTOCOL = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.EFI_MTFTP4_CONFIG_DATA = type { i8, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i16, %struct.EFI_IPv4_ADDRESS, %struct.EFI_IPv4_ADDRESS, i16, i16, i16 }
%struct.EFI_IPv4_ADDRESS = type { [4 x i8] }
%struct.MTFTP4_OPTION = type { i16, i8, i32, i32, i16, i8, i32 }
%struct._LIST_ENTRY = type { ptr, ptr }
%struct.EFI_MTFTP4_DATA_HEADER = type <{ i16, i16, [1 x i8] }>
%struct._EFI_MTFTP4_TOKEN = type { i64, ptr, ptr, ptr, ptr, i32, ptr, i64, ptr, ptr, ptr, ptr, ptr }

@.str.2 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [40 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

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

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

; Function Attrs: nounwind uwtable
define dso_local i64 @Mtftp4RrqSaveBlock(ptr noundef %0, ptr noundef %1, i32 noundef %2) #2 {
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca i16, align 2
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca i64, align 8
  %14 = alloca i8, align 1
  %15 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 2, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #3
  store i8 0, ptr %14, align 1, !tbaa !11
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %16, i32 0, i32 8
  %18 = load ptr, ptr %17, align 8, !tbaa !12
  store ptr %18, ptr %8, align 8, !tbaa !5
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.EFI_MTFTP4_DATA_HEADER, ptr %19, i32 0, i32 1
  %21 = load i16, ptr %20, align 1, !tbaa !11
  %22 = call zeroext i16 @SwapBytes16(i16 noundef zeroext %21)
  store i16 %22, ptr %10, align 2, !tbaa !21
  %23 = load i32, ptr %7, align 4, !tbaa !9
  %24 = sub i32 %23, 4
  store i32 %24, ptr %12, align 4, !tbaa !9
  %25 = load i32, ptr %12, align 4, !tbaa !9
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %26, i32 0, i32 11
  %28 = load i16, ptr %27, align 2, !tbaa !22
  %29 = zext i16 %28 to i32
  %30 = icmp ult i32 %25, %29
  br i1 %30, label %31, label %38

31:                                               ; preds = %3
  store i8 1, ptr %14, align 1, !tbaa !11
  %32 = load i16, ptr %10, align 2, !tbaa !21
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %33, i32 0, i32 12
  store i16 %32, ptr %34, align 8, !tbaa !23
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %35, i32 0, i32 13
  %37 = load i16, ptr %10, align 2, !tbaa !21
  call void @Mtftp4SetLastBlockNum(ptr noundef %36, i16 noundef zeroext %37)
  br label %38

38:                                               ; preds = %31, %3
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %39, i32 0, i32 13
  %41 = load i16, ptr %10, align 2, !tbaa !21
  %42 = load i8, ptr %14, align 1, !tbaa !11
  %43 = call i64 @Mtftp4RemoveBlockNum(ptr noundef %40, i16 noundef zeroext %41, i8 noundef zeroext %42, ptr noundef %13)
  store i64 %43, ptr %9, align 8, !tbaa !24
  %44 = load i64, ptr %9, align 8, !tbaa !24
  %45 = icmp eq i64 %44, -9223372036854775794
  br i1 %45, label %46, label %47

46:                                               ; preds = %38
  store i64 0, ptr %4, align 8
  store i32 1, ptr %15, align 4
  br label %145

47:                                               ; preds = %38
  %48 = load i64, ptr %9, align 8, !tbaa !24
  %49 = icmp slt i64 %48, 0
  br i1 %49, label %50, label %52

50:                                               ; preds = %47
  %51 = load i64, ptr %9, align 8, !tbaa !24
  store i64 %51, ptr %4, align 8
  store i32 1, ptr %15, align 4
  br label %145

52:                                               ; preds = %47
  br label %53

53:                                               ; preds = %52
  %54 = load ptr, ptr %8, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct._EFI_MTFTP4_TOKEN, ptr %54, i32 0, i32 10
  %56 = load ptr, ptr %55, align 8, !tbaa !25
  %57 = icmp ne ptr %56, null
  br i1 %57, label %58, label %75

58:                                               ; preds = %53
  %59 = load ptr, ptr %8, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct._EFI_MTFTP4_TOKEN, ptr %59, i32 0, i32 10
  %61 = load ptr, ptr %60, align 8, !tbaa !25
  %62 = load ptr, ptr %5, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %62, i32 0, i32 2
  %64 = load ptr, ptr %8, align 8, !tbaa !5
  %65 = load i32, ptr %7, align 4, !tbaa !9
  %66 = trunc i32 %65 to i16
  %67 = load ptr, ptr %6, align 8, !tbaa !5
  %68 = call i64 %61(ptr noundef %63, ptr noundef %64, i16 noundef zeroext %66, ptr noundef %67)
  store i64 %68, ptr %9, align 8, !tbaa !24
  %69 = load i64, ptr %9, align 8, !tbaa !24
  %70 = icmp slt i64 %69, 0
  br i1 %70, label %71, label %74

71:                                               ; preds = %58
  %72 = load ptr, ptr %5, align 8, !tbaa !5
  %73 = call i64 @Mtftp4SendError(ptr noundef %72, i16 noundef zeroext 4, ptr noundef @.str.2)
  store i64 -9223372036854775787, ptr %4, align 8
  store i32 1, ptr %15, align 4
  br label %145

74:                                               ; preds = %58
  br label %75

75:                                               ; preds = %74, %53
  %76 = load ptr, ptr %8, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct._EFI_MTFTP4_TOKEN, ptr %76, i32 0, i32 8
  %78 = load ptr, ptr %77, align 8, !tbaa !27
  %79 = icmp ne ptr %78, null
  br i1 %79, label %80, label %144

80:                                               ; preds = %75
  %81 = load i64, ptr %13, align 8, !tbaa !24
  %82 = sub i64 %81, 1
  %83 = load ptr, ptr %5, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %83, i32 0, i32 11
  %85 = load i16, ptr %84, align 2, !tbaa !22
  %86 = zext i16 %85 to i32
  %87 = call i64 @MultU64x32(i64 noundef %82, i32 noundef %86)
  store i64 %87, ptr %11, align 8, !tbaa !24
  %88 = load i64, ptr %11, align 8, !tbaa !24
  %89 = load i32, ptr %12, align 4, !tbaa !9
  %90 = zext i32 %89 to i64
  %91 = add i64 %88, %90
  %92 = load ptr, ptr %8, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct._EFI_MTFTP4_TOKEN, ptr %92, i32 0, i32 7
  %94 = load i64, ptr %93, align 8, !tbaa !28
  %95 = icmp ule i64 %91, %94
  br i1 %95, label %96, label %127

96:                                               ; preds = %80
  %97 = load ptr, ptr %8, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct._EFI_MTFTP4_TOKEN, ptr %97, i32 0, i32 8
  %99 = load ptr, ptr %98, align 8, !tbaa !27
  %100 = load i64, ptr %11, align 8, !tbaa !24
  %101 = getelementptr inbounds i8, ptr %99, i64 %100
  %102 = load ptr, ptr %6, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.EFI_MTFTP4_DATA_HEADER, ptr %102, i32 0, i32 2
  %104 = getelementptr inbounds [1 x i8], ptr %103, i64 0, i64 0
  %105 = load i32, ptr %12, align 4, !tbaa !9
  %106 = zext i32 %105 to i64
  %107 = call ptr @CopyMem(ptr noundef %101, ptr noundef %104, i64 noundef %106)
  %108 = load ptr, ptr %5, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %108, i32 0, i32 12
  %110 = load i16, ptr %109, align 8, !tbaa !23
  %111 = zext i16 %110 to i32
  %112 = load i16, ptr %10, align 2, !tbaa !21
  %113 = zext i16 %112 to i32
  %114 = icmp eq i32 %111, %113
  br i1 %114, label %115, label %126

115:                                              ; preds = %96
  %116 = load i8, ptr %14, align 1, !tbaa !11
  %117 = zext i8 %116 to i32
  %118 = icmp ne i32 %117, 0
  br i1 %118, label %119, label %126

119:                                              ; preds = %115
  %120 = load i64, ptr %11, align 8, !tbaa !24
  %121 = load i32, ptr %12, align 4, !tbaa !9
  %122 = zext i32 %121 to i64
  %123 = add i64 %120, %122
  %124 = load ptr, ptr %8, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct._EFI_MTFTP4_TOKEN, ptr %124, i32 0, i32 7
  store i64 %123, ptr %125, align 8, !tbaa !28
  br label %126

126:                                              ; preds = %119, %115, %96
  br label %143

127:                                              ; preds = %80
  %128 = load ptr, ptr %5, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct._MTFTP4_PROTOCOL, ptr %128, i32 0, i32 12
  %130 = load i16, ptr %129, align 8, !tbaa !23
  %131 = zext i16 %130 to i32
  %132 = icmp ne i32 %131, 0
  br i1 %132, label %133, label %142

133:                                              ; preds = %127
  %134 = load i64, ptr %11, align 8, !tbaa !24
  %135 = load i32, ptr %12, align 4, !tbaa !9
  %136 = zext i32 %135 to i64
  %137 = add i64 %134, %136
  %138 = load ptr, ptr %8, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct._EFI_MTFTP4_TOKEN, ptr %138, i32 0, i32 7
  store i64 %137, ptr %139, align 8, !tbaa !28
  %140 = load ptr, ptr %5, align 8, !tbaa !5
  %141 = call i64 @Mtftp4SendError(ptr noundef %140, i16 noundef zeroext 3, ptr noundef @.str.3)
  store i64 -9223372036854775803, ptr %4, align 8
  store i32 1, ptr %15, align 4
  br label %145

142:                                              ; preds = %127
  br label %143

143:                                              ; preds = %142, %126
  br label %144

144:                                              ; preds = %143, %75
  store i64 0, ptr %4, align 8
  store i32 1, ptr %15, align 4
  br label %145

145:                                              ; preds = %144, %133, %71, %50, %46
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  %146 = load i64, ptr %4, align 8
  ret i64 %146
}

declare void @Mtftp4SetLastBlockNum(ptr noundef, i16 noundef zeroext) #1

declare i64 @Mtftp4RemoveBlockNum(ptr noundef, i16 noundef zeroext, i8 noundef zeroext, ptr noundef) #1

declare i64 @Mtftp4SendError(ptr noundef, i16 noundef zeroext, ptr noundef) #1

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

declare ptr @CopyMem(ptr noundef, ptr noundef, i64 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !6, i64 152}
!13 = !{!"_MTFTP4_PROTOCOL", !10, i64 0, !14, i64 8, !15, i64 24, !16, i64 88, !7, i64 96, !6, i64 104, !6, i64 112, !17, i64 120, !6, i64 152, !20, i64 160, !19, i64 180, !19, i64 182, !19, i64 184, !14, i64 192, !10, i64 208, !19, i64 212, !19, i64 214, !10, i64 216, !6, i64 224, !6, i64 232, !10, i64 240, !10, i64 244, !10, i64 248, !10, i64 252, !10, i64 256, !19, i64 260, !7, i64 262, !6, i64 264}
!14 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!15 = !{!"_EFI_MTFTP4_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}
!16 = !{!"long long", !7, i64 0}
!17 = !{!"", !7, i64 0, !18, i64 1, !18, i64 5, !19, i64 10, !18, i64 12, !18, i64 16, !19, i64 20, !19, i64 22, !19, i64 24}
!18 = !{!"", !7, i64 0}
!19 = !{!"short", !7, i64 0}
!20 = !{!"", !19, i64 0, !7, i64 2, !10, i64 4, !10, i64 8, !19, i64 12, !7, i64 14, !10, i64 16}
!21 = !{!19, !19, i64 0}
!22 = !{!13, !19, i64 182}
!23 = !{!13, !19, i64 184}
!24 = !{!16, !16, i64 0}
!25 = !{!26, !6, i64 80}
!26 = !{!"_EFI_MTFTP4_TOKEN", !16, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !10, i64 40, !6, i64 48, !16, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96}
!27 = !{!26, !6, i64 64}
!28 = !{!26, !16, i64 56}


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

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

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

; Function Attrs: nounwind uwtable
define dso_local i64 @Mtftp4RrqSaveBlock(ptr noundef %0, ptr noundef %1, i32 noundef %2) local_unnamed_addr #2 {
  %4 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %5 = getelementptr inbounds i8, ptr %0, i64 152
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %1, i64 2
  %8 = load i16, ptr %7, align 1, !tbaa !18
  %9 = tail call zeroext i16 @SwapBytes16(i16 noundef zeroext %8) #3
  %10 = add i32 %2, -4
  %11 = getelementptr inbounds i8, ptr %0, i64 182
  %12 = load i16, ptr %11, align 2, !tbaa !19
  %13 = zext i16 %12 to i32
  %14 = icmp ult i32 %10, %13
  br i1 %14, label %15, label %18

15:                                               ; preds = %3
  %16 = getelementptr inbounds i8, ptr %0, i64 184
  store i16 %9, ptr %16, align 8, !tbaa !20
  %17 = getelementptr inbounds i8, ptr %0, i64 192
  tail call void @Mtftp4SetLastBlockNum(ptr noundef nonnull %17, i16 noundef zeroext %9) #3
  br label %18

18:                                               ; preds = %15, %3
  %.0 = phi i8 [ 1, %15 ], [ 0, %3 ]
  %19 = getelementptr inbounds i8, ptr %0, i64 192
  %20 = call i64 @Mtftp4RemoveBlockNum(ptr noundef nonnull %19, i16 noundef zeroext %9, i8 noundef zeroext %.0, ptr noundef nonnull %4) #3
  %21 = icmp eq i64 %20, -9223372036854775794
  br i1 %21, label %61, label %22

22:                                               ; preds = %18
  %23 = icmp slt i64 %20, 0
  br i1 %23, label %61, label %24

24:                                               ; preds = %22
  %25 = getelementptr inbounds i8, ptr %6, i64 80
  %26 = load ptr, ptr %25, align 8, !tbaa !21
  %.not = icmp eq ptr %26, null
  br i1 %.not, label %34, label %27

27:                                               ; preds = %24
  %28 = getelementptr inbounds i8, ptr %0, i64 24
  %29 = trunc i32 %2 to i16
  %30 = call i64 %26(ptr noundef nonnull %28, ptr noundef nonnull %6, i16 noundef zeroext %29, ptr noundef nonnull %1) #3
  %31 = icmp slt i64 %30, 0
  br i1 %31, label %32, label %34

32:                                               ; preds = %27
  %33 = call i64 @Mtftp4SendError(ptr noundef nonnull %0, i16 noundef zeroext 4, ptr noundef nonnull @.str.2) #3
  br label %61

34:                                               ; preds = %27, %24
  %35 = getelementptr inbounds i8, ptr %6, i64 64
  %36 = load ptr, ptr %35, align 8, !tbaa !23
  %.not49 = icmp eq ptr %36, null
  br i1 %.not49, label %61, label %37

37:                                               ; preds = %34
  %38 = load i64, ptr %4, align 8, !tbaa !24
  %39 = add i64 %38, -1
  %40 = load i16, ptr %11, align 2, !tbaa !19
  %41 = zext i16 %40 to i32
  %42 = call i64 @MultU64x32(i64 noundef %39, i32 noundef %41) #3
  %43 = zext i32 %10 to i64
  %44 = add i64 %42, %43
  %45 = getelementptr inbounds i8, ptr %6, i64 56
  %46 = load i64, ptr %45, align 8, !tbaa !25
  %.not50 = icmp ugt i64 %44, %46
  br i1 %.not50, label %56, label %47

47:                                               ; preds = %37
  %48 = load ptr, ptr %35, align 8, !tbaa !23
  %49 = getelementptr inbounds i8, ptr %48, i64 %42
  %50 = getelementptr inbounds i8, ptr %1, i64 4
  %51 = call ptr @CopyMem(ptr noundef %49, ptr noundef nonnull %50, i64 noundef %43) #3
  %52 = getelementptr inbounds i8, ptr %0, i64 184
  %53 = load i16, ptr %52, align 8, !tbaa !20
  %54 = icmp eq i16 %53, %9
  %or.cond = and i1 %14, %54
  br i1 %or.cond, label %55, label %61

55:                                               ; preds = %47
  store i64 %44, ptr %45, align 8, !tbaa !25
  br label %61

56:                                               ; preds = %37
  %57 = getelementptr inbounds i8, ptr %0, i64 184
  %58 = load i16, ptr %57, align 8, !tbaa !20
  %.not51 = icmp eq i16 %58, 0
  br i1 %.not51, label %61, label %59

59:                                               ; preds = %56
  store i64 %44, ptr %45, align 8, !tbaa !25
  %60 = call i64 @Mtftp4SendError(ptr noundef nonnull %0, i16 noundef zeroext 3, ptr noundef nonnull @.str.3) #3
  br label %61

61:                                               ; preds = %34, %56, %47, %55, %22, %18, %59, %32
  %.045 = phi i64 [ -9223372036854775787, %32 ], [ -9223372036854775803, %59 ], [ 0, %18 ], [ %20, %22 ], [ 0, %55 ], [ 0, %47 ], [ 0, %56 ], [ 0, %34 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  ret i64 %.045
}

declare void @Mtftp4SetLastBlockNum(ptr noundef, i16 noundef zeroext) local_unnamed_addr #1

declare i64 @Mtftp4RemoveBlockNum(ptr noundef, i16 noundef zeroext, i8 noundef zeroext, ptr noundef) local_unnamed_addr #1

declare i64 @Mtftp4SendError(ptr noundef, i16 noundef zeroext, ptr noundef) local_unnamed_addr #1

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

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

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, !11, i64 152}
!6 = !{!"_MTFTP4_PROTOCOL", !7, i64 0, !10, i64 8, !12, i64 24, !13, i64 88, !8, i64 96, !11, i64 104, !11, i64 112, !14, i64 120, !11, i64 152, !17, i64 160, !16, i64 180, !16, i64 182, !16, i64 184, !10, i64 192, !7, i64 208, !16, i64 212, !16, i64 214, !7, i64 216, !11, i64 224, !11, i64 232, !7, i64 240, !7, i64 244, !7, i64 248, !7, i64 252, !7, i64 256, !16, i64 260, !8, i64 262, !11, i64 264}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"_LIST_ENTRY", !11, i64 0, !11, i64 8}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"_EFI_MTFTP4_PROTOCOL", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56}
!13 = !{!"long long", !8, i64 0}
!14 = !{!"", !8, i64 0, !15, i64 1, !15, i64 5, !16, i64 10, !15, i64 12, !15, i64 16, !16, i64 20, !16, i64 22, !16, i64 24}
!15 = !{!"", !8, i64 0}
!16 = !{!"short", !8, i64 0}
!17 = !{!"", !16, i64 0, !8, i64 2, !7, i64 4, !7, i64 8, !16, i64 12, !8, i64 14, !7, i64 16}
!18 = !{!8, !8, i64 0}
!19 = !{!6, !16, i64 182}
!20 = !{!6, !16, i64 184}
!21 = !{!22, !11, i64 80}
!22 = !{!"_EFI_MTFTP4_TOKEN", !13, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !7, i64 40, !11, i64 48, !13, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !11, i64 88, !11, i64 96}
!23 = !{!22, !11, i64 64}
!24 = !{!13, !13, i64 0}
!25 = !{!22, !13, i64 56}


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