; LLVM IR from thalium/icebox :: third_party/virtualbox/src/VBox/Devices/EFI/Firmware/OptionRomPkg (Common)

; 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.UNDI_CALL_TABLE = type { i16, i16, i16, i16, ptr }
%struct.s_pxe_cdb = type { i16, i16, i16, i16, i64, i64, i16, i16, i16, i16 }
%struct.s_pxe_sw_undi = type { i32, i8, i8, i8, i8, i8, i8, i8, i8, i32, i64, [3 x i8], i8, [1 x i32] }
%struct.UNDI32_DEV = type { i64, %struct._EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL, ptr, ptr, ptr, %struct.s_data_instance }
%struct._EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL = type { i64, i64, i64, i32, [4 x i8], i8, i8, i8, i8, i16 }
%struct.s_data_instance = type { i16, i16, i8, i8, i16, i16, i16, i16, i16, [32 x i8], [32 x i8], [32 x i8], [64 x i32], [128 x i32], i32, i32, i16, i16, i8, i8, i8, i8, i16, i16, i16, i16, i32, i32, i16, i16, [2 x i16], i8, i8, i16, i32, ptr, ptr, ptr, ptr, ptr, ptr, i64, i64, i64, i64, i64, [64 x i64], i16, i16, i16, i16, i8, i8, i8, i8, i8, [3 x i8], %struct.mc, i64, ptr, i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.mc = type { [3 x i16], i16, [8 x [32 x i8]] }

@api_table = external dso_local global [18 x %struct.UNDI_CALL_TABLE], align 16
@pxe_31 = external global ptr, align 8
@UNDI32DeviceList = external global [16 x ptr], align 16

; 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

; Function Attrs: nounwind uwtable
define dso_local void @UNDI_APIEntry_Common(i64 noundef %0) #1 {
  %2 = alloca i64, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  store i64 %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #2
  %7 = load i64, ptr %2, align 8, !tbaa !5
  %8 = inttoptr i64 %7 to ptr
  store ptr %8, ptr %3, align 8, !tbaa !9
  %9 = load ptr, ptr %3, align 8, !tbaa !9
  %10 = getelementptr inbounds %struct.s_pxe_cdb, ptr %9, i32 0, i32 0
  %11 = load i16, ptr %10, align 1, !tbaa !11
  %12 = zext i16 %11 to i32
  %13 = icmp sgt i32 %12, 17
  br i1 %13, label %42, label %14

14:                                               ; preds = %1
  %15 = load ptr, ptr %3, align 8, !tbaa !9
  %16 = getelementptr inbounds %struct.s_pxe_cdb, ptr %15, i32 0, i32 6
  %17 = load i16, ptr %16, align 1, !tbaa !14
  %18 = zext i16 %17 to i32
  %19 = icmp ne i32 %18, 0
  br i1 %19, label %42, label %20

20:                                               ; preds = %14
  %21 = load ptr, ptr %3, align 8, !tbaa !9
  %22 = getelementptr inbounds %struct.s_pxe_cdb, ptr %21, i32 0, i32 7
  %23 = load i16, ptr %22, align 1, !tbaa !15
  %24 = zext i16 %23 to i32
  %25 = icmp ne i32 %24, 0
  br i1 %25, label %42, label %26

26:                                               ; preds = %20
  %27 = load ptr, ptr %3, align 8, !tbaa !9
  %28 = getelementptr inbounds %struct.s_pxe_cdb, ptr %27, i32 0, i32 8
  %29 = load i16, ptr %28, align 1, !tbaa !16
  %30 = zext i16 %29 to i32
  %31 = load ptr, ptr @pxe_31, align 8, !tbaa !9
  %32 = getelementptr inbounds %struct.s_pxe_sw_undi, ptr %31, i32 0, i32 4
  %33 = load i8, ptr %32, align 1, !tbaa !17
  %34 = zext i8 %33 to i32
  %35 = load ptr, ptr @pxe_31, align 8, !tbaa !9
  %36 = getelementptr inbounds %struct.s_pxe_sw_undi, ptr %35, i32 0, i32 7
  %37 = load i8, ptr %36, align 1, !tbaa !20
  %38 = zext i8 %37 to i32
  %39 = shl i32 %38, 8
  %40 = or i32 %34, %39
  %41 = icmp sge i32 %30, %40
  br i1 %41, label %42, label %43

42:                                               ; preds = %26, %20, %14, %1
  br label %192

43:                                               ; preds = %26
  %44 = load ptr, ptr %3, align 8, !tbaa !9
  %45 = getelementptr inbounds %struct.s_pxe_cdb, ptr %44, i32 0, i32 2
  %46 = load i16, ptr %45, align 1, !tbaa !21
  %47 = zext i16 %46 to i32
  %48 = icmp eq i32 %47, 0
  br i1 %48, label %49, label %56

49:                                               ; preds = %43
  %50 = load ptr, ptr %3, align 8, !tbaa !9
  %51 = getelementptr inbounds %struct.s_pxe_cdb, ptr %50, i32 0, i32 4
  %52 = load i64, ptr %51, align 1, !tbaa !22
  %53 = icmp ne i64 %52, 0
  br i1 %53, label %54, label %55

54:                                               ; preds = %49
  br label %192

55:                                               ; preds = %49
  br label %63

56:                                               ; preds = %43
  %57 = load ptr, ptr %3, align 8, !tbaa !9
  %58 = getelementptr inbounds %struct.s_pxe_cdb, ptr %57, i32 0, i32 4
  %59 = load i64, ptr %58, align 1, !tbaa !22
  %60 = icmp eq i64 %59, 0
  br i1 %60, label %61, label %62

61:                                               ; preds = %56
  br label %192

62:                                               ; preds = %56
  br label %63

63:                                               ; preds = %62, %55
  %64 = load ptr, ptr %3, align 8, !tbaa !9
  %65 = getelementptr inbounds %struct.s_pxe_cdb, ptr %64, i32 0, i32 3
  %66 = load i16, ptr %65, align 1, !tbaa !23
  %67 = zext i16 %66 to i32
  %68 = icmp eq i32 %67, 0
  br i1 %68, label %69, label %76

69:                                               ; preds = %63
  %70 = load ptr, ptr %3, align 8, !tbaa !9
  %71 = getelementptr inbounds %struct.s_pxe_cdb, ptr %70, i32 0, i32 5
  %72 = load i64, ptr %71, align 1, !tbaa !24
  %73 = icmp ne i64 %72, 0
  br i1 %73, label %74, label %75

74:                                               ; preds = %69
  br label %192

75:                                               ; preds = %69
  br label %83

76:                                               ; preds = %63
  %77 = load ptr, ptr %3, align 8, !tbaa !9
  %78 = getelementptr inbounds %struct.s_pxe_cdb, ptr %77, i32 0, i32 5
  %79 = load i64, ptr %78, align 1, !tbaa !24
  %80 = icmp eq i64 %79, 0
  br i1 %80, label %81, label %82

81:                                               ; preds = %76
  br label %192

82:                                               ; preds = %76
  br label %83

83:                                               ; preds = %82, %75
  %84 = load ptr, ptr %3, align 8, !tbaa !9
  %85 = getelementptr inbounds %struct.s_pxe_cdb, ptr %84, i32 0, i32 0
  %86 = load i16, ptr %85, align 1, !tbaa !11
  %87 = zext i16 %86 to i64
  %88 = getelementptr inbounds [18 x %struct.UNDI_CALL_TABLE], ptr @api_table, i64 0, i64 %87
  store ptr %88, ptr %5, align 8, !tbaa !9
  %89 = load ptr, ptr %5, align 8, !tbaa !9
  %90 = getelementptr inbounds %struct.UNDI_CALL_TABLE, ptr %89, i32 0, i32 0
  %91 = load i16, ptr %90, align 8, !tbaa !25
  %92 = zext i16 %91 to i32
  %93 = icmp ne i32 %92, 65535
  br i1 %93, label %94, label %105

94:                                               ; preds = %83
  %95 = load ptr, ptr %5, align 8, !tbaa !9
  %96 = getelementptr inbounds %struct.UNDI_CALL_TABLE, ptr %95, i32 0, i32 0
  %97 = load i16, ptr %96, align 8, !tbaa !25
  %98 = zext i16 %97 to i32
  %99 = load ptr, ptr %3, align 8, !tbaa !9
  %100 = getelementptr inbounds %struct.s_pxe_cdb, ptr %99, i32 0, i32 2
  %101 = load i16, ptr %100, align 1, !tbaa !21
  %102 = zext i16 %101 to i32
  %103 = icmp ne i32 %98, %102
  br i1 %103, label %104, label %105

104:                                              ; preds = %94
  br label %192

105:                                              ; preds = %94, %83
  %106 = load ptr, ptr %5, align 8, !tbaa !9
  %107 = getelementptr inbounds %struct.UNDI_CALL_TABLE, ptr %106, i32 0, i32 1
  %108 = load i16, ptr %107, align 2, !tbaa !27
  %109 = zext i16 %108 to i32
  %110 = icmp ne i32 %109, 65535
  br i1 %110, label %111, label %122

111:                                              ; preds = %105
  %112 = load ptr, ptr %5, align 8, !tbaa !9
  %113 = getelementptr inbounds %struct.UNDI_CALL_TABLE, ptr %112, i32 0, i32 1
  %114 = load i16, ptr %113, align 2, !tbaa !27
  %115 = zext i16 %114 to i32
  %116 = load ptr, ptr %3, align 8, !tbaa !9
  %117 = getelementptr inbounds %struct.s_pxe_cdb, ptr %116, i32 0, i32 3
  %118 = load i16, ptr %117, align 1, !tbaa !23
  %119 = zext i16 %118 to i32
  %120 = icmp ne i32 %115, %119
  br i1 %120, label %121, label %122

121:                                              ; preds = %111
  br label %192

122:                                              ; preds = %111, %105
  %123 = load ptr, ptr %5, align 8, !tbaa !9
  %124 = getelementptr inbounds %struct.UNDI_CALL_TABLE, ptr %123, i32 0, i32 2
  %125 = load i16, ptr %124, align 4, !tbaa !28
  %126 = zext i16 %125 to i32
  %127 = icmp ne i32 %126, 65535
  br i1 %127, label %128, label %139

128:                                              ; preds = %122
  %129 = load ptr, ptr %5, align 8, !tbaa !9
  %130 = getelementptr inbounds %struct.UNDI_CALL_TABLE, ptr %129, i32 0, i32 2
  %131 = load i16, ptr %130, align 4, !tbaa !28
  %132 = zext i16 %131 to i32
  %133 = load ptr, ptr %3, align 8, !tbaa !9
  %134 = getelementptr inbounds %struct.s_pxe_cdb, ptr %133, i32 0, i32 1
  %135 = load i16, ptr %134, align 1, !tbaa !29
  %136 = zext i16 %135 to i32
  %137 = icmp ne i32 %132, %136
  br i1 %137, label %138, label %139

138:                                              ; preds = %128
  br label %192

139:                                              ; preds = %128, %122
  %140 = load ptr, ptr %3, align 8, !tbaa !9
  %141 = getelementptr inbounds %struct.s_pxe_cdb, ptr %140, i32 0, i32 8
  %142 = load i16, ptr %141, align 1, !tbaa !16
  %143 = zext i16 %142 to i64
  %144 = getelementptr inbounds [16 x ptr], ptr @UNDI32DeviceList, i64 0, i64 %143
  %145 = load ptr, ptr %144, align 8, !tbaa !9
  %146 = getelementptr inbounds %struct.UNDI32_DEV, ptr %145, i32 0, i32 5
  store ptr %146, ptr %4, align 8, !tbaa !9
  %147 = load ptr, ptr %5, align 8, !tbaa !9
  %148 = getelementptr inbounds %struct.UNDI_CALL_TABLE, ptr %147, i32 0, i32 3
  %149 = load i16, ptr %148, align 2, !tbaa !30
  %150 = zext i16 %149 to i32
  %151 = icmp ne i32 %150, 65535
  br i1 %151, label %152, label %182

152:                                              ; preds = %139
  %153 = load ptr, ptr %4, align 8, !tbaa !9
  %154 = getelementptr inbounds %struct.s_data_instance, ptr %153, i32 0, i32 0
  %155 = load i16, ptr %154, align 8, !tbaa !31
  %156 = zext i16 %155 to i32
  %157 = icmp eq i32 %156, 0
  br i1 %157, label %158, label %163

158:                                              ; preds = %152
  %159 = load ptr, ptr %3, align 8, !tbaa !9
  %160 = getelementptr inbounds %struct.s_pxe_cdb, ptr %159, i32 0, i32 7
  store i16 -32768, ptr %160, align 1, !tbaa !15
  %161 = load ptr, ptr %3, align 8, !tbaa !9
  %162 = getelementptr inbounds %struct.s_pxe_cdb, ptr %161, i32 0, i32 6
  store i16 6, ptr %162, align 1, !tbaa !14
  store i32 1, ptr %6, align 4
  br label %197

163:                                              ; preds = %152
  %164 = load ptr, ptr %5, align 8, !tbaa !9
  %165 = getelementptr inbounds %struct.UNDI_CALL_TABLE, ptr %164, i32 0, i32 3
  %166 = load i16, ptr %165, align 2, !tbaa !30
  %167 = zext i16 %166 to i32
  %168 = icmp eq i32 %167, 2
  br i1 %168, label %169, label %181

169:                                              ; preds = %163
  %170 = load ptr, ptr %4, align 8, !tbaa !9
  %171 = getelementptr inbounds %struct.s_data_instance, ptr %170, i32 0, i32 0
  %172 = load i16, ptr %171, align 8, !tbaa !31
  %173 = zext i16 %172 to i32
  %174 = icmp ne i32 %173, 2
  br i1 %174, label %175, label %180

175:                                              ; preds = %169
  %176 = load ptr, ptr %3, align 8, !tbaa !9
  %177 = getelementptr inbounds %struct.s_pxe_cdb, ptr %176, i32 0, i32 6
  store i16 9, ptr %177, align 1, !tbaa !14
  %178 = load ptr, ptr %3, align 8, !tbaa !9
  %179 = getelementptr inbounds %struct.s_pxe_cdb, ptr %178, i32 0, i32 7
  store i16 -32768, ptr %179, align 1, !tbaa !15
  store i32 1, ptr %6, align 4
  br label %197

180:                                              ; preds = %169
  br label %181

181:                                              ; preds = %180, %163
  br label %182

182:                                              ; preds = %181, %139
  %183 = load ptr, ptr %3, align 8, !tbaa !9
  %184 = getelementptr inbounds %struct.s_pxe_cdb, ptr %183, i32 0, i32 7
  store i16 -16384, ptr %184, align 1, !tbaa !15
  %185 = load ptr, ptr %3, align 8, !tbaa !9
  %186 = getelementptr inbounds %struct.s_pxe_cdb, ptr %185, i32 0, i32 6
  store i16 0, ptr %186, align 1, !tbaa !14
  %187 = load ptr, ptr %5, align 8, !tbaa !9
  %188 = getelementptr inbounds %struct.UNDI_CALL_TABLE, ptr %187, i32 0, i32 4
  %189 = load ptr, ptr %188, align 8, !tbaa !34
  %190 = load ptr, ptr %3, align 8, !tbaa !9
  %191 = load ptr, ptr %4, align 8, !tbaa !9
  call void (ptr, ptr, ...) %189(ptr noundef %190, ptr noundef %191)
  store i32 1, ptr %6, align 4
  br label %197

192:                                              ; preds = %138, %121, %104, %81, %74, %61, %54, %42
  %193 = load ptr, ptr %3, align 8, !tbaa !9
  %194 = getelementptr inbounds %struct.s_pxe_cdb, ptr %193, i32 0, i32 7
  store i16 -32768, ptr %194, align 1, !tbaa !15
  %195 = load ptr, ptr %3, align 8, !tbaa !9
  %196 = getelementptr inbounds %struct.s_pxe_cdb, ptr %195, i32 0, i32 6
  store i16 1, ptr %196, align 1, !tbaa !14
  store i32 1, ptr %6, align 4
  br label %197

197:                                              ; preds = %192, %182, %175, %158
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #2
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"s_pxe_cdb", !13, i64 0, !13, i64 2, !13, i64 4, !13, i64 6, !6, i64 8, !6, i64 16, !13, i64 24, !13, i64 26, !13, i64 28, !13, i64 30}
!13 = !{!"short", !7, i64 0}
!14 = !{!12, !13, i64 24}
!15 = !{!12, !13, i64 26}
!16 = !{!12, !13, i64 28}
!17 = !{!18, !7, i64 7}
!18 = !{!"s_pxe_sw_undi", !19, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !7, i64 8, !7, i64 9, !7, i64 10, !7, i64 11, !19, i64 12, !6, i64 16, !7, i64 24, !7, i64 27, !7, i64 28}
!19 = !{!"int", !7, i64 0}
!20 = !{!18, !7, i64 10}
!21 = !{!12, !13, i64 4}
!22 = !{!12, !6, i64 8}
!23 = !{!12, !13, i64 6}
!24 = !{!12, !6, i64 16}
!25 = !{!26, !13, i64 0}
!26 = !{!"", !13, i64 0, !13, i64 2, !13, i64 4, !13, i64 6, !10, i64 8}
!27 = !{!26, !13, i64 2}
!28 = !{!26, !13, i64 4}
!29 = !{!12, !13, i64 2}
!30 = !{!26, !13, i64 6}
!31 = !{!32, !13, i64 0}
!32 = !{!"s_data_instance", !13, i64 0, !13, i64 2, !7, i64 4, !7, i64 5, !13, i64 6, !13, i64 8, !13, i64 10, !13, i64 12, !13, i64 14, !7, i64 16, !7, i64 48, !7, i64 80, !7, i64 112, !7, i64 368, !19, i64 880, !19, i64 884, !13, i64 888, !13, i64 890, !7, i64 892, !7, i64 893, !7, i64 894, !7, i64 895, !13, i64 896, !13, i64 898, !13, i64 900, !13, i64 902, !19, i64 904, !19, i64 908, !13, i64 912, !13, i64 914, !7, i64 916, !7, i64 920, !7, i64 921, !13, i64 922, !19, i64 924, !10, i64 928, !10, i64 936, !10, i64 944, !10, i64 952, !10, i64 960, !10, i64 968, !6, i64 976, !6, i64 984, !6, i64 992, !6, i64 1000, !6, i64 1008, !7, i64 1016, !13, i64 1528, !13, i64 1530, !13, i64 1532, !13, i64 1534, !7, i64 1536, !7, i64 1537, !7, i64 1538, !7, i64 1539, !7, i64 1540, !7, i64 1541, !33, i64 1544, !6, i64 1808, !10, i64 1816, !6, i64 1824, !10, i64 1832, !10, i64 1840, !10, i64 1848, !10, i64 1856, !10, i64 1864, !10, i64 1872, !10, i64 1880, !10, i64 1888, !10, i64 1896, !10, i64 1904, !10, i64 1912}
!33 = !{!"mc", !7, i64 0, !13, i64 6, !7, i64 8}
!34 = !{!26, !10, i64 8}


; 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.UNDI_CALL_TABLE = type { i16, i16, i16, i16, ptr }

@api_table = external dso_local local_unnamed_addr global [18 x %struct.UNDI_CALL_TABLE], align 16
@pxe_31 = external local_unnamed_addr global ptr, align 8
@UNDI32DeviceList = external local_unnamed_addr global [16 x ptr], align 16

; Function Attrs: nounwind uwtable
define dso_local void @UNDI_APIEntry_Common(i64 noundef %0) local_unnamed_addr #0 {
  %2 = inttoptr i64 %0 to ptr
  %3 = load i16, ptr %2, align 1, !tbaa !5
  %4 = icmp ugt i16 %3, 17
  br i1 %4, label %68, label %5

5:                                                ; preds = %1
  %6 = getelementptr inbounds i8, ptr %2, i64 24
  %7 = load i16, ptr %6, align 1, !tbaa !11
  %.not = icmp eq i16 %7, 0
  br i1 %.not, label %8, label %68

8:                                                ; preds = %5
  %9 = getelementptr inbounds i8, ptr %2, i64 26
  %10 = load i16, ptr %9, align 1, !tbaa !12
  %.not40 = icmp eq i16 %10, 0
  br i1 %.not40, label %11, label %68

11:                                               ; preds = %8
  %12 = getelementptr inbounds i8, ptr %2, i64 28
  %13 = load i16, ptr %12, align 1, !tbaa !13
  %14 = zext i16 %13 to i32
  %15 = load ptr, ptr @pxe_31, align 8, !tbaa !14
  %16 = getelementptr inbounds i8, ptr %15, i64 7
  %17 = load i8, ptr %16, align 1, !tbaa !16
  %18 = zext i8 %17 to i32
  %19 = getelementptr inbounds i8, ptr %15, i64 10
  %20 = load i8, ptr %19, align 1, !tbaa !19
  %21 = zext i8 %20 to i32
  %22 = shl nuw nsw i32 %21, 8
  %23 = or disjoint i32 %22, %18
  %.not41 = icmp ugt i32 %23, %14
  br i1 %.not41, label %24, label %68

24:                                               ; preds = %11
  %25 = getelementptr inbounds i8, ptr %2, i64 4
  %26 = load i16, ptr %25, align 1, !tbaa !20
  %27 = icmp eq i16 %26, 0
  %28 = getelementptr inbounds i8, ptr %2, i64 8
  %29 = load i64, ptr %28, align 1, !tbaa !21
  %.not42 = icmp eq i64 %29, 0
  %30 = xor i1 %27, %.not42
  br i1 %30, label %68, label %31

31:                                               ; preds = %24
  %32 = getelementptr inbounds i8, ptr %2, i64 6
  %33 = load i16, ptr %32, align 1, !tbaa !22
  %34 = icmp eq i16 %33, 0
  %35 = getelementptr inbounds i8, ptr %2, i64 16
  %36 = load i64, ptr %35, align 1, !tbaa !23
  %.not43 = icmp eq i64 %36, 0
  %37 = xor i1 %34, %.not43
  br i1 %37, label %68, label %38

38:                                               ; preds = %31
  %39 = zext nneg i16 %3 to i64
  %40 = getelementptr inbounds [18 x %struct.UNDI_CALL_TABLE], ptr @api_table, i64 0, i64 %39
  %41 = load i16, ptr %40, align 16, !tbaa !24
  %.not44 = icmp eq i16 %41, -1
  %.not45 = icmp eq i16 %41, %26
  %or.cond52 = or i1 %.not44, %.not45
  br i1 %or.cond52, label %42, label %68

42:                                               ; preds = %38
  %43 = getelementptr inbounds i8, ptr %40, i64 2
  %44 = load i16, ptr %43, align 2, !tbaa !26
  %.not46 = icmp eq i16 %44, -1
  %.not47 = icmp eq i16 %44, %33
  %or.cond53 = or i1 %.not46, %.not47
  br i1 %or.cond53, label %45, label %68

45:                                               ; preds = %42
  %46 = getelementptr inbounds i8, ptr %40, i64 4
  %47 = load i16, ptr %46, align 4, !tbaa !27
  %.not48 = icmp eq i16 %47, -1
  br i1 %.not48, label %51, label %48

48:                                               ; preds = %45
  %49 = getelementptr inbounds i8, ptr %2, i64 2
  %50 = load i16, ptr %49, align 1, !tbaa !28
  %.not49 = icmp eq i16 %47, %50
  br i1 %.not49, label %51, label %68

51:                                               ; preds = %48, %45
  %52 = zext i16 %13 to i64
  %53 = getelementptr inbounds [16 x ptr], ptr @UNDI32DeviceList, i64 0, i64 %52
  %54 = load ptr, ptr %53, align 8, !tbaa !14
  %55 = getelementptr inbounds i8, ptr %54, i64 72
  %56 = getelementptr inbounds i8, ptr %40, i64 6
  %57 = load i16, ptr %56, align 2, !tbaa !29
  %.not50 = icmp eq i16 %57, -1
  br i1 %.not50, label %65, label %58

58:                                               ; preds = %51
  %59 = load i16, ptr %55, align 8, !tbaa !30
  %60 = icmp eq i16 %59, 0
  br i1 %60, label %61, label %62

61:                                               ; preds = %58
  store i16 -32768, ptr %9, align 1, !tbaa !12
  store i16 6, ptr %6, align 1, !tbaa !11
  br label %71

62:                                               ; preds = %58
  %63 = icmp ne i16 %57, 2
  %.not51 = icmp eq i16 %59, 2
  %or.cond = or i1 %63, %.not51
  br i1 %or.cond, label %65, label %64

64:                                               ; preds = %62
  store i16 9, ptr %6, align 1, !tbaa !11
  store i16 -32768, ptr %9, align 1, !tbaa !12
  br label %71

65:                                               ; preds = %62, %51
  store i16 -16384, ptr %9, align 1, !tbaa !12
  store i16 0, ptr %6, align 1, !tbaa !11
  %66 = getelementptr inbounds i8, ptr %40, i64 8
  %67 = load ptr, ptr %66, align 8, !tbaa !33
  tail call void (ptr, ptr, ...) %67(ptr noundef nonnull %2, ptr noundef nonnull %55) #1
  br label %71

68:                                               ; preds = %31, %24, %42, %38, %48, %1, %5, %8, %11
  %69 = getelementptr inbounds i8, ptr %2, i64 26
  store i16 -32768, ptr %69, align 1, !tbaa !12
  %70 = getelementptr inbounds i8, ptr %2, i64 24
  store i16 1, ptr %70, align 1, !tbaa !11
  br label %71

71:                                               ; preds = %68, %65, %64, %61
  ret void
}

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 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"s_pxe_cdb", !7, i64 0, !7, i64 2, !7, i64 4, !7, i64 6, !10, i64 8, !10, i64 16, !7, i64 24, !7, i64 26, !7, i64 28, !7, i64 30}
!7 = !{!"short", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long long", !8, i64 0}
!11 = !{!6, !7, i64 24}
!12 = !{!6, !7, i64 26}
!13 = !{!6, !7, i64 28}
!14 = !{!15, !15, i64 0}
!15 = !{!"any pointer", !8, i64 0}
!16 = !{!17, !8, i64 7}
!17 = !{!"s_pxe_sw_undi", !18, i64 0, !8, i64 4, !8, i64 5, !8, i64 6, !8, i64 7, !8, i64 8, !8, i64 9, !8, i64 10, !8, i64 11, !18, i64 12, !10, i64 16, !8, i64 24, !8, i64 27, !8, i64 28}
!18 = !{!"int", !8, i64 0}
!19 = !{!17, !8, i64 10}
!20 = !{!6, !7, i64 4}
!21 = !{!6, !10, i64 8}
!22 = !{!6, !7, i64 6}
!23 = !{!6, !10, i64 16}
!24 = !{!25, !7, i64 0}
!25 = !{!"", !7, i64 0, !7, i64 2, !7, i64 4, !7, i64 6, !15, i64 8}
!26 = !{!25, !7, i64 2}
!27 = !{!25, !7, i64 4}
!28 = !{!6, !7, i64 2}
!29 = !{!25, !7, i64 6}
!30 = !{!31, !7, i64 0}
!31 = !{!"s_data_instance", !7, i64 0, !7, i64 2, !8, i64 4, !8, i64 5, !7, i64 6, !7, i64 8, !7, i64 10, !7, i64 12, !7, i64 14, !8, i64 16, !8, i64 48, !8, i64 80, !8, i64 112, !8, i64 368, !18, i64 880, !18, i64 884, !7, i64 888, !7, i64 890, !8, i64 892, !8, i64 893, !8, i64 894, !8, i64 895, !7, i64 896, !7, i64 898, !7, i64 900, !7, i64 902, !18, i64 904, !18, i64 908, !7, i64 912, !7, i64 914, !8, i64 916, !8, i64 920, !8, i64 921, !7, i64 922, !18, i64 924, !15, i64 928, !15, i64 936, !15, i64 944, !15, i64 952, !15, i64 960, !15, i64 968, !10, i64 976, !10, i64 984, !10, i64 992, !10, i64 1000, !10, i64 1008, !8, i64 1016, !7, i64 1528, !7, i64 1530, !7, i64 1532, !7, i64 1534, !8, i64 1536, !8, i64 1537, !8, i64 1538, !8, i64 1539, !8, i64 1540, !8, i64 1541, !32, i64 1544, !10, i64 1808, !15, i64 1816, !10, i64 1824, !15, i64 1832, !15, i64 1840, !15, i64 1848, !15, i64 1856, !15, i64 1864, !15, i64 1872, !15, i64 1880, !15, i64 1888, !15, i64 1896, !15, i64 1904, !15, i64 1912}
!32 = !{!"mc", !8, i64 0, !7, i64 6, !8, i64 8}
!33 = !{!25, !15, i64 8}


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