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

; 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.s_pxe_db_get_status = type { i32, i32, [32 x i64] }
%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]] }
%struct.s_RxFD = type { %struct.CB_Header, i32, i16, i16, [1536 x i8], i8, [3 x i8] }
%struct.CB_Header = type { i16, i16, i32 }
%struct.s_pxe_cdb = type { i16, i16, i16, i16, i64, i64, i16, i16, i16, i16 }

; Function Attrs: nounwind uwtable
define dso_local void @UNDI_Status(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %struct.s_pxe_db_get_status, align 1
  %7 = alloca i16, align 2
  %8 = alloca i16, align 2
  %9 = alloca i16, align 2
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 264, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 2, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 2, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 2, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.s_data_instance, ptr %12, i32 0, i32 35
  %14 = load ptr, ptr %13, align 8, !tbaa !9
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.s_data_instance, ptr %15, i32 0, i32 49
  %17 = load i16, ptr %16, align 4, !tbaa !15
  %18 = zext i16 %17 to i64
  %19 = getelementptr inbounds %struct.s_RxFD, ptr %14, i64 %18
  store ptr %19, ptr %10, align 8, !tbaa !5
  %20 = load ptr, ptr %10, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.s_RxFD, ptr %20, i32 0, i32 0
  %22 = getelementptr inbounds %struct.CB_Header, ptr %21, i32 0, i32 0
  %23 = load i16, ptr %22, align 1, !tbaa !16
  %24 = zext i16 %23 to i32
  %25 = and i32 %24, 32768
  %26 = icmp ne i32 %25, 0
  br i1 %26, label %27, label %34

27:                                               ; preds = %2
  %28 = load ptr, ptr %10, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.s_RxFD, ptr %28, i32 0, i32 2
  %30 = load i16, ptr %29, align 1, !tbaa !19
  %31 = zext i16 %30 to i32
  %32 = and i32 %31, 16383
  %33 = getelementptr inbounds %struct.s_pxe_db_get_status, ptr %6, i32 0, i32 0
  store i32 %32, ptr %33, align 1, !tbaa !20
  br label %36

34:                                               ; preds = %2
  %35 = getelementptr inbounds %struct.s_pxe_db_get_status, ptr %6, i32 0, i32 0
  store i32 0, ptr %35, align 1, !tbaa !20
  br label %36

36:                                               ; preds = %34, %27
  %37 = getelementptr inbounds %struct.s_pxe_db_get_status, ptr %6, i32 0, i32 1
  store i32 0, ptr %37, align 1, !tbaa !22
  %38 = load ptr, ptr %3, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.s_pxe_cdb, ptr %38, i32 0, i32 5
  %40 = load i64, ptr %39, align 1, !tbaa !23
  %41 = inttoptr i64 %40 to ptr
  store ptr %41, ptr %5, align 8, !tbaa !5
  %42 = load ptr, ptr %3, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.s_pxe_cdb, ptr %42, i32 0, i32 3
  %44 = load i16, ptr %43, align 1, !tbaa !25
  %45 = zext i16 %44 to i32
  %46 = icmp sgt i32 %45, 0
  br i1 %46, label %47, label %60

47:                                               ; preds = %36
  %48 = load ptr, ptr %3, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.s_pxe_cdb, ptr %48, i32 0, i32 3
  %50 = load i16, ptr %49, align 1, !tbaa !25
  %51 = zext i16 %50 to i64
  %52 = icmp ult i64 %51, 8
  br i1 %52, label %53, label %60

53:                                               ; preds = %47
  %54 = load ptr, ptr %5, align 8, !tbaa !5
  %55 = load ptr, ptr %3, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.s_pxe_cdb, ptr %55, i32 0, i32 3
  %57 = load i16, ptr %56, align 1, !tbaa !25
  %58 = zext i16 %57 to i64
  %59 = call ptr @CopyMem(ptr noundef %54, ptr noundef %6, i64 noundef %58)
  br label %63

60:                                               ; preds = %47, %36
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = call ptr @CopyMem(ptr noundef %61, ptr noundef %6, i64 noundef 8)
  br label %63

63:                                               ; preds = %60, %53
  %64 = load ptr, ptr %3, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.s_pxe_cdb, ptr %64, i32 0, i32 1
  %66 = load i16, ptr %65, align 1, !tbaa !26
  %67 = zext i16 %66 to i32
  %68 = and i32 %67, 2
  %69 = icmp ne i32 %68, 0
  br i1 %69, label %70, label %183

70:                                               ; preds = %63
  %71 = load ptr, ptr %3, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.s_pxe_cdb, ptr %71, i32 0, i32 3
  %73 = load i16, ptr %72, align 1, !tbaa !25
  %74 = zext i16 %73 to i32
  %75 = icmp eq i32 %74, 0
  br i1 %75, label %76, label %81

76:                                               ; preds = %70
  %77 = load ptr, ptr %3, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.s_pxe_cdb, ptr %77, i32 0, i32 7
  store i16 -32768, ptr %78, align 1, !tbaa !27
  %79 = load ptr, ptr %3, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.s_pxe_cdb, ptr %79, i32 0, i32 6
  store i16 1, ptr %80, align 1, !tbaa !28
  store i32 1, ptr %11, align 4
  br label %267

81:                                               ; preds = %70
  %82 = load ptr, ptr %3, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.s_pxe_cdb, ptr %82, i32 0, i32 3
  %84 = load i16, ptr %83, align 1, !tbaa !25
  %85 = zext i16 %84 to i64
  %86 = sub i64 %85, 8
  %87 = trunc i64 %86 to i16
  store i16 %87, ptr %9, align 2, !tbaa !29
  %88 = load ptr, ptr %3, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.s_pxe_cdb, ptr %88, i32 0, i32 3
  store i16 8, ptr %89, align 1, !tbaa !25
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  %91 = call zeroext i16 @CheckCBList(ptr noundef %90)
  %92 = load ptr, ptr %4, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.s_data_instance, ptr %92, i32 0, i32 47
  %94 = load i16, ptr %93, align 8, !tbaa !30
  %95 = zext i16 %94 to i32
  %96 = load ptr, ptr %4, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.s_data_instance, ptr %96, i32 0, i32 48
  %98 = load i16, ptr %97, align 2, !tbaa !31
  %99 = zext i16 %98 to i32
  %100 = icmp eq i32 %95, %99
  br i1 %100, label %101, label %108

101:                                              ; preds = %81
  %102 = load ptr, ptr %3, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.s_pxe_cdb, ptr %102, i32 0, i32 7
  %104 = load i16, ptr %103, align 1, !tbaa !27
  %105 = zext i16 %104 to i32
  %106 = or i32 %105, 16
  %107 = trunc i32 %106 to i16
  store i16 %107, ptr %103, align 1, !tbaa !27
  br label %165

108:                                              ; preds = %81
  store i16 0, ptr %7, align 2, !tbaa !29
  br label %109

109:                                              ; preds = %157, %108
  %110 = load i16, ptr %7, align 2, !tbaa !29
  %111 = zext i16 %110 to i32
  %112 = icmp slt i32 %111, 32
  br i1 %112, label %113, label %117

113:                                              ; preds = %109
  %114 = load i16, ptr %9, align 2, !tbaa !29
  %115 = zext i16 %114 to i64
  %116 = icmp uge i64 %115, 8
  br label %117

117:                                              ; preds = %113, %109
  %118 = phi i1 [ false, %109 ], [ %116, %113 ]
  br i1 %118, label %119, label %164

119:                                              ; preds = %117
  %120 = load ptr, ptr %4, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.s_data_instance, ptr %120, i32 0, i32 47
  %122 = load i16, ptr %121, align 8, !tbaa !30
  %123 = zext i16 %122 to i32
  %124 = load ptr, ptr %4, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.s_data_instance, ptr %124, i32 0, i32 48
  %126 = load i16, ptr %125, align 2, !tbaa !31
  %127 = zext i16 %126 to i32
  %128 = icmp ne i32 %123, %127
  br i1 %128, label %129, label %155

129:                                              ; preds = %119
  %130 = load ptr, ptr %4, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.s_data_instance, ptr %130, i32 0, i32 46
  %132 = load ptr, ptr %4, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.s_data_instance, ptr %132, i32 0, i32 47
  %134 = load i16, ptr %133, align 8, !tbaa !30
  %135 = zext i16 %134 to i64
  %136 = getelementptr inbounds [64 x i64], ptr %131, i64 0, i64 %135
  %137 = load i64, ptr %136, align 8, !tbaa !32
  %138 = load ptr, ptr %5, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.s_pxe_db_get_status, ptr %138, i32 0, i32 2
  %140 = load i16, ptr %7, align 2, !tbaa !29
  %141 = zext i16 %140 to i64
  %142 = getelementptr inbounds [32 x i64], ptr %139, i64 0, i64 %141
  store i64 %137, ptr %142, align 1, !tbaa !32
  %143 = load ptr, ptr %4, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.s_data_instance, ptr %143, i32 0, i32 47
  %145 = load i16, ptr %144, align 8, !tbaa !30
  %146 = call zeroext i16 @next(i16 noundef zeroext %145)
  %147 = load ptr, ptr %4, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.s_data_instance, ptr %147, i32 0, i32 47
  store i16 %146, ptr %148, align 8, !tbaa !30
  %149 = load ptr, ptr %3, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.s_pxe_cdb, ptr %149, i32 0, i32 3
  %151 = load i16, ptr %150, align 1, !tbaa !25
  %152 = zext i16 %151 to i64
  %153 = add i64 %152, 8
  %154 = trunc i64 %153 to i16
  store i16 %154, ptr %150, align 1, !tbaa !25
  br label %156

155:                                              ; preds = %119
  br label %164

156:                                              ; preds = %129
  br label %157

157:                                              ; preds = %156
  %158 = load i16, ptr %7, align 2, !tbaa !29
  %159 = add i16 %158, 1
  store i16 %159, ptr %7, align 2, !tbaa !29
  %160 = load i16, ptr %9, align 2, !tbaa !29
  %161 = zext i16 %160 to i64
  %162 = sub i64 %161, 8
  %163 = trunc i64 %162 to i16
  store i16 %163, ptr %9, align 2, !tbaa !29
  br label %109, !llvm.loop !33

164:                                              ; preds = %155, %117
  br label %165

165:                                              ; preds = %164, %101
  %166 = load ptr, ptr %4, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.s_data_instance, ptr %166, i32 0, i32 47
  %168 = load i16, ptr %167, align 8, !tbaa !30
  %169 = zext i16 %168 to i32
  %170 = load ptr, ptr %4, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.s_data_instance, ptr %170, i32 0, i32 48
  %172 = load i16, ptr %171, align 2, !tbaa !31
  %173 = zext i16 %172 to i32
  %174 = icmp ne i32 %169, %173
  br i1 %174, label %175, label %182

175:                                              ; preds = %165
  %176 = load ptr, ptr %3, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.s_pxe_cdb, ptr %176, i32 0, i32 7
  %178 = load i16, ptr %177, align 1, !tbaa !27
  %179 = zext i16 %178 to i32
  %180 = or i32 %179, 8192
  %181 = trunc i32 %180 to i16
  store i16 %181, ptr %177, align 1, !tbaa !27
  br label %182

182:                                              ; preds = %175, %165
  br label %183

183:                                              ; preds = %182, %63
  %184 = load ptr, ptr %3, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.s_pxe_cdb, ptr %184, i32 0, i32 1
  %186 = load i16, ptr %185, align 1, !tbaa !26
  %187 = zext i16 %186 to i32
  %188 = and i32 %187, 1
  %189 = icmp ne i32 %188, 0
  br i1 %189, label %190, label %243

190:                                              ; preds = %183
  %191 = load ptr, ptr %4, align 8, !tbaa !5
  %192 = load ptr, ptr %4, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.s_data_instance, ptr %192, i32 0, i32 14
  %194 = load i32, ptr %193, align 8, !tbaa !35
  %195 = add i32 %194, 0
  %196 = call zeroext i16 @InWord(ptr noundef %191, i32 noundef %195)
  store i16 %196, ptr %8, align 2, !tbaa !29
  %197 = load ptr, ptr %4, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.s_data_instance, ptr %197, i32 0, i32 29
  %199 = load i16, ptr %198, align 2, !tbaa !36
  %200 = zext i16 %199 to i32
  %201 = load i16, ptr %8, align 2, !tbaa !29
  %202 = zext i16 %201 to i32
  %203 = or i32 %200, %202
  %204 = trunc i32 %203 to i16
  %205 = load ptr, ptr %4, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.s_data_instance, ptr %205, i32 0, i32 29
  store i16 %204, ptr %206, align 2, !tbaa !36
  %207 = load ptr, ptr %4, align 8, !tbaa !5
  %208 = load i16, ptr %8, align 2, !tbaa !29
  %209 = zext i16 %208 to i32
  %210 = and i32 %209, 64512
  %211 = trunc i32 %210 to i16
  %212 = load ptr, ptr %4, align 8, !tbaa !5
  %213 = getelementptr inbounds %struct.s_data_instance, ptr %212, i32 0, i32 14
  %214 = load i32, ptr %213, align 8, !tbaa !35
  %215 = add i32 %214, 0
  call void @OutWord(ptr noundef %207, i16 noundef zeroext %211, i32 noundef %215)
  %216 = load ptr, ptr %4, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct.s_data_instance, ptr %216, i32 0, i32 29
  %218 = load i16, ptr %217, align 2, !tbaa !36
  store i16 %218, ptr %8, align 2, !tbaa !29
  %219 = load i16, ptr %8, align 2, !tbaa !29
  %220 = zext i16 %219 to i32
  %221 = and i32 %220, 16384
  %222 = icmp ne i32 %221, 0
  br i1 %222, label %223, label %230

223:                                              ; preds = %190
  %224 = load ptr, ptr %3, align 8, !tbaa !5
  %225 = getelementptr inbounds %struct.s_pxe_cdb, ptr %224, i32 0, i32 7
  %226 = load i16, ptr %225, align 1, !tbaa !27
  %227 = zext i16 %226 to i32
  %228 = or i32 %227, 1
  %229 = trunc i32 %228 to i16
  store i16 %229, ptr %225, align 1, !tbaa !27
  br label %230

230:                                              ; preds = %223, %190
  %231 = load i16, ptr %8, align 2, !tbaa !29
  %232 = zext i16 %231 to i32
  %233 = and i32 %232, 1024
  %234 = icmp ne i32 %233, 0
  br i1 %234, label %235, label %242

235:                                              ; preds = %230
  %236 = load ptr, ptr %3, align 8, !tbaa !5
  %237 = getelementptr inbounds %struct.s_pxe_cdb, ptr %236, i32 0, i32 7
  %238 = load i16, ptr %237, align 1, !tbaa !27
  %239 = zext i16 %238 to i32
  %240 = or i32 %239, 8
  %241 = trunc i32 %240 to i16
  store i16 %241, ptr %237, align 1, !tbaa !27
  br label %242

242:                                              ; preds = %235, %230
  br label %243

243:                                              ; preds = %242, %183
  %244 = load ptr, ptr %3, align 8, !tbaa !5
  %245 = getelementptr inbounds %struct.s_pxe_cdb, ptr %244, i32 0, i32 1
  %246 = load i16, ptr %245, align 1, !tbaa !26
  %247 = zext i16 %246 to i32
  %248 = and i32 %247, 4
  %249 = icmp ne i32 %248, 0
  br i1 %249, label %250, label %266

250:                                              ; preds = %243
  %251 = load ptr, ptr %4, align 8, !tbaa !5
  %252 = getelementptr inbounds %struct.s_data_instance, ptr %251, i32 0, i32 31
  store i8 -1, ptr %252, align 8, !tbaa !37
  %253 = load ptr, ptr %4, align 8, !tbaa !5
  %254 = getelementptr inbounds %struct.s_data_instance, ptr %253, i32 0, i32 20
  store i8 1, ptr %254, align 2, !tbaa !38
  %255 = load ptr, ptr %4, align 8, !tbaa !5
  %256 = call zeroext i8 @PhyDetect(ptr noundef %255)
  %257 = icmp ne i8 %256, 0
  br i1 %257, label %265, label %258

258:                                              ; preds = %250
  %259 = load ptr, ptr %3, align 8, !tbaa !5
  %260 = getelementptr inbounds %struct.s_pxe_cdb, ptr %259, i32 0, i32 7
  %261 = load i16, ptr %260, align 1, !tbaa !27
  %262 = zext i16 %261 to i32
  %263 = or i32 %262, 64
  %264 = trunc i32 %263 to i16
  store i16 %264, ptr %260, align 1, !tbaa !27
  br label %265

265:                                              ; preds = %258, %250
  br label %266

266:                                              ; preds = %265, %243
  store i32 1, ptr %11, align 4
  br label %267

267:                                              ; preds = %266, %76
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 264, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  ret void
}

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

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

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

declare zeroext i16 @CheckCBList(ptr noundef) #2

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

declare zeroext i16 @InWord(ptr noundef, i32 noundef) #2

declare void @OutWord(ptr noundef, i16 noundef zeroext, i32 noundef) #2

declare zeroext i8 @PhyDetect(ptr 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 = !{!10, !6, i64 928}
!10 = !{!"s_data_instance", !11, i64 0, !11, i64 2, !7, i64 4, !7, i64 5, !11, i64 6, !11, i64 8, !11, i64 10, !11, i64 12, !11, i64 14, !7, i64 16, !7, i64 48, !7, i64 80, !7, i64 112, !7, i64 368, !12, i64 880, !12, i64 884, !11, i64 888, !11, i64 890, !7, i64 892, !7, i64 893, !7, i64 894, !7, i64 895, !11, i64 896, !11, i64 898, !11, i64 900, !11, i64 902, !12, i64 904, !12, i64 908, !11, i64 912, !11, i64 914, !7, i64 916, !7, i64 920, !7, i64 921, !11, i64 922, !12, i64 924, !6, i64 928, !6, i64 936, !6, i64 944, !6, i64 952, !6, i64 960, !6, i64 968, !13, i64 976, !13, i64 984, !13, i64 992, !13, i64 1000, !13, i64 1008, !7, i64 1016, !11, i64 1528, !11, i64 1530, !11, i64 1532, !11, i64 1534, !7, i64 1536, !7, i64 1537, !7, i64 1538, !7, i64 1539, !7, i64 1540, !7, i64 1541, !14, i64 1544, !13, i64 1808, !6, i64 1816, !13, i64 1824, !6, i64 1832, !6, i64 1840, !6, i64 1848, !6, i64 1856, !6, i64 1864, !6, i64 1872, !6, i64 1880, !6, i64 1888, !6, i64 1896, !6, i64 1904, !6, i64 1912}
!11 = !{!"short", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = !{!"mc", !7, i64 0, !11, i64 6, !7, i64 8}
!15 = !{!10, !11, i64 1532}
!16 = !{!17, !11, i64 0}
!17 = !{!"s_RxFD", !18, i64 0, !12, i64 8, !11, i64 12, !11, i64 14, !7, i64 16, !7, i64 1552, !7, i64 1553}
!18 = !{!"CB_Header", !11, i64 0, !11, i64 2, !12, i64 4}
!19 = !{!17, !11, i64 12}
!20 = !{!21, !12, i64 0}
!21 = !{!"s_pxe_db_get_status", !12, i64 0, !12, i64 4, !7, i64 8}
!22 = !{!21, !12, i64 4}
!23 = !{!24, !13, i64 16}
!24 = !{!"s_pxe_cdb", !11, i64 0, !11, i64 2, !11, i64 4, !11, i64 6, !13, i64 8, !13, i64 16, !11, i64 24, !11, i64 26, !11, i64 28, !11, i64 30}
!25 = !{!24, !11, i64 6}
!26 = !{!24, !11, i64 2}
!27 = !{!24, !11, i64 26}
!28 = !{!24, !11, i64 24}
!29 = !{!11, !11, i64 0}
!30 = !{!10, !11, i64 1528}
!31 = !{!10, !11, i64 1530}
!32 = !{!13, !13, i64 0}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}
!35 = !{!10, !12, i64 880}
!36 = !{!10, !11, i64 914}
!37 = !{!10, !7, i64 920}
!38 = !{!10, !7, i64 894}


; 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.s_pxe_db_get_status = type { i32, i32, [32 x i64] }
%struct.s_RxFD = type { %struct.CB_Header, i32, i16, i16, [1536 x i8], i8, [3 x i8] }
%struct.CB_Header = type { i16, i16, i32 }

; Function Attrs: nounwind uwtable
define dso_local void @UNDI_Status(ptr nocapture noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca %struct.s_pxe_db_get_status, align 4
  call void @llvm.lifetime.start.p0(i64 264, ptr nonnull %3) #4
  %4 = getelementptr inbounds i8, ptr %1, i64 928
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %1, i64 1532
  %7 = load i16, ptr %6, align 4, !tbaa !14
  %8 = zext i16 %7 to i64
  %9 = getelementptr inbounds %struct.s_RxFD, ptr %5, i64 %8
  %10 = load i16, ptr %9, align 1, !tbaa !15
  %.not = icmp sgt i16 %10, -1
  br i1 %.not, label %16, label %11

11:                                               ; preds = %2
  %12 = getelementptr inbounds i8, ptr %9, i64 12
  %13 = load i16, ptr %12, align 1, !tbaa !18
  %14 = and i16 %13, 16383
  %15 = zext nneg i16 %14 to i32
  br label %16

16:                                               ; preds = %2, %11
  %storemerge = phi i32 [ %15, %11 ], [ 0, %2 ]
  store i32 %storemerge, ptr %3, align 4, !tbaa !19
  %17 = getelementptr inbounds i8, ptr %3, i64 4
  store i32 0, ptr %17, align 4, !tbaa !21
  %18 = getelementptr inbounds i8, ptr %0, i64 16
  %19 = load i64, ptr %18, align 1, !tbaa !22
  %20 = inttoptr i64 %19 to ptr
  %21 = getelementptr inbounds i8, ptr %0, i64 6
  %22 = load i16, ptr %21, align 1, !tbaa !24
  %23 = add i16 %22, -1
  %or.cond = icmp ult i16 %23, 7
  %narrow = select i1 %or.cond, i16 %22, i16 8
  %.sink = zext i16 %narrow to i64
  %24 = call ptr @CopyMem(ptr noundef %20, ptr noundef nonnull %3, i64 noundef %.sink) #4
  %25 = getelementptr inbounds i8, ptr %0, i64 2
  %26 = load i16, ptr %25, align 1, !tbaa !25
  %27 = and i16 %26, 2
  %.not58 = icmp eq i16 %27, 0
  br i1 %.not58, label %.loopexit.thread, label %28

28:                                               ; preds = %16
  %29 = load i16, ptr %21, align 1, !tbaa !24
  %30 = icmp eq i16 %29, 0
  br i1 %30, label %31, label %34

31:                                               ; preds = %28
  %32 = getelementptr inbounds i8, ptr %0, i64 26
  store i16 -32768, ptr %32, align 1, !tbaa !26
  %33 = getelementptr inbounds i8, ptr %0, i64 24
  store i16 1, ptr %33, align 1, !tbaa !27
  br label %98

34:                                               ; preds = %28
  store i16 8, ptr %21, align 1, !tbaa !24
  %35 = call zeroext i16 @CheckCBList(ptr noundef nonnull %1) #4
  %36 = getelementptr inbounds i8, ptr %1, i64 1528
  %37 = load i16, ptr %36, align 8, !tbaa !28
  %38 = getelementptr inbounds i8, ptr %1, i64 1530
  %39 = load i16, ptr %38, align 2, !tbaa !29
  %40 = icmp eq i16 %37, %39
  br i1 %40, label %.loopexit.thread.sink.split, label %.preheader

.preheader:                                       ; preds = %34
  %41 = and i16 %29, -8
  %.not72 = icmp eq i16 %41, 8
  br i1 %.not72, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  %42 = getelementptr inbounds i8, ptr %1, i64 1016
  %43 = getelementptr inbounds i8, ptr %20, i64 8
  %44 = add i16 %29, -16
  %45 = lshr i16 %44, 3
  %umin = call i16 @llvm.umin.i16(i16 %45, i16 31)
  %46 = add nuw nsw i16 %umin, 1
  %wide.trip.count = zext nneg i16 %46 to i64
  br label %47

47:                                               ; preds = %.lr.ph, %50
  %48 = phi i16 [ %37, %.lr.ph ], [ %55, %50 ]
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %50 ]
  %49 = load i16, ptr %38, align 2, !tbaa !29
  %.not59 = icmp eq i16 %48, %49
  br i1 %.not59, label %.loopexit.thread, label %50

50:                                               ; preds = %47
  %51 = zext i16 %48 to i64
  %52 = getelementptr inbounds [64 x i64], ptr %42, i64 0, i64 %51
  %53 = load i64, ptr %52, align 8, !tbaa !30
  %54 = getelementptr inbounds [32 x i64], ptr %43, i64 0, i64 %indvars.iv
  store i64 %53, ptr %54, align 1, !tbaa !30
  %55 = call zeroext i16 @next(i16 noundef zeroext %48) #4
  store i16 %55, ptr %36, align 8, !tbaa !28
  %56 = load i16, ptr %21, align 1, !tbaa !24
  %57 = add i16 %56, 8
  store i16 %57, ptr %21, align 1, !tbaa !24
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %..loopexit.loopexit_crit_edge, label %47, !llvm.loop !31

..loopexit.loopexit_crit_edge:                    ; preds = %50
  %.pre.pre = load i16, ptr %38, align 2, !tbaa !29
  br label %.loopexit

.loopexit:                                        ; preds = %..loopexit.loopexit_crit_edge, %.preheader
  %58 = phi i16 [ %39, %.preheader ], [ %.pre.pre, %..loopexit.loopexit_crit_edge ]
  %59 = phi i16 [ %37, %.preheader ], [ %55, %..loopexit.loopexit_crit_edge ]
  %.not60 = icmp eq i16 %59, %58
  br i1 %.not60, label %.loopexit.thread, label %.loopexit.thread.sink.split

.loopexit.thread.sink.split:                      ; preds = %.loopexit, %34
  %.sink78 = phi i16 [ 16, %34 ], [ 8192, %.loopexit ]
  %60 = getelementptr inbounds i8, ptr %0, i64 26
  %61 = load i16, ptr %60, align 1, !tbaa !26
  %62 = or i16 %61, %.sink78
  store i16 %62, ptr %60, align 1, !tbaa !26
  br label %.loopexit.thread

.loopexit.thread:                                 ; preds = %47, %.loopexit.thread.sink.split, %.loopexit, %16
  %63 = load i16, ptr %25, align 1, !tbaa !25
  %64 = and i16 %63, 1
  %.not61 = icmp eq i16 %64, 0
  br i1 %.not61, label %87, label %65

65:                                               ; preds = %.loopexit.thread
  %66 = getelementptr inbounds i8, ptr %1, i64 880
  %67 = load i32, ptr %66, align 8, !tbaa !33
  %68 = call zeroext i16 @InWord(ptr noundef nonnull %1, i32 noundef %67) #4
  %69 = getelementptr inbounds i8, ptr %1, i64 914
  %70 = load i16, ptr %69, align 2, !tbaa !34
  %71 = or i16 %70, %68
  store i16 %71, ptr %69, align 2, !tbaa !34
  %72 = and i16 %68, -1024
  %73 = load i32, ptr %66, align 8, !tbaa !33
  call void @OutWord(ptr noundef nonnull %1, i16 noundef zeroext %72, i32 noundef %73) #4
  %74 = load i16, ptr %69, align 2, !tbaa !34
  %75 = zext i16 %74 to i32
  %76 = and i32 %75, 16384
  %.not62 = icmp eq i32 %76, 0
  br i1 %.not62, label %81, label %77

77:                                               ; preds = %65
  %78 = getelementptr inbounds i8, ptr %0, i64 26
  %79 = load i16, ptr %78, align 1, !tbaa !26
  %80 = or i16 %79, 1
  store i16 %80, ptr %78, align 1, !tbaa !26
  br label %81

81:                                               ; preds = %77, %65
  %82 = and i32 %75, 1024
  %.not63 = icmp eq i32 %82, 0
  br i1 %.not63, label %87, label %83

83:                                               ; preds = %81
  %84 = getelementptr inbounds i8, ptr %0, i64 26
  %85 = load i16, ptr %84, align 1, !tbaa !26
  %86 = or i16 %85, 8
  store i16 %86, ptr %84, align 1, !tbaa !26
  br label %87

87:                                               ; preds = %81, %83, %.loopexit.thread
  %88 = load i16, ptr %25, align 1, !tbaa !25
  %89 = and i16 %88, 4
  %.not64 = icmp eq i16 %89, 0
  br i1 %.not64, label %98, label %90

90:                                               ; preds = %87
  %91 = getelementptr inbounds i8, ptr %1, i64 920
  store i8 -1, ptr %91, align 8, !tbaa !35
  %92 = getelementptr inbounds i8, ptr %1, i64 894
  store i8 1, ptr %92, align 2, !tbaa !36
  %93 = call zeroext i8 @PhyDetect(ptr noundef nonnull %1) #4
  %.not65 = icmp eq i8 %93, 0
  br i1 %.not65, label %94, label %98

94:                                               ; preds = %90
  %95 = getelementptr inbounds i8, ptr %0, i64 26
  %96 = load i16, ptr %95, align 1, !tbaa !26
  %97 = or i16 %96, 64
  store i16 %97, ptr %95, align 1, !tbaa !26
  br label %98

98:                                               ; preds = %87, %94, %90, %31
  call void @llvm.lifetime.end.p0(i64 264, ptr nonnull %3) #4
  ret void
}

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

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

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

declare zeroext i16 @CheckCBList(ptr noundef) local_unnamed_addr #2

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

declare zeroext i16 @InWord(ptr noundef, i32 noundef) local_unnamed_addr #2

declare void @OutWord(ptr noundef, i16 noundef zeroext, i32 noundef) local_unnamed_addr #2

declare zeroext i8 @PhyDetect(ptr noundef) local_unnamed_addr #2

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

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 = { 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, !11, i64 928}
!6 = !{!"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, !10, i64 880, !10, 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, !10, i64 904, !10, i64 908, !7, i64 912, !7, i64 914, !8, i64 916, !8, i64 920, !8, i64 921, !7, i64 922, !10, i64 924, !11, i64 928, !11, i64 936, !11, i64 944, !11, i64 952, !11, i64 960, !11, i64 968, !12, i64 976, !12, i64 984, !12, i64 992, !12, i64 1000, !12, 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, !13, i64 1544, !12, i64 1808, !11, i64 1816, !12, i64 1824, !11, i64 1832, !11, i64 1840, !11, i64 1848, !11, i64 1856, !11, i64 1864, !11, i64 1872, !11, i64 1880, !11, i64 1888, !11, i64 1896, !11, i64 1904, !11, i64 1912}
!7 = !{!"short", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"long long", !8, i64 0}
!13 = !{!"mc", !8, i64 0, !7, i64 6, !8, i64 8}
!14 = !{!6, !7, i64 1532}
!15 = !{!16, !7, i64 0}
!16 = !{!"s_RxFD", !17, i64 0, !10, i64 8, !7, i64 12, !7, i64 14, !8, i64 16, !8, i64 1552, !8, i64 1553}
!17 = !{!"CB_Header", !7, i64 0, !7, i64 2, !10, i64 4}
!18 = !{!16, !7, i64 12}
!19 = !{!20, !10, i64 0}
!20 = !{!"s_pxe_db_get_status", !10, i64 0, !10, i64 4, !8, i64 8}
!21 = !{!20, !10, i64 4}
!22 = !{!23, !12, i64 16}
!23 = !{!"s_pxe_cdb", !7, i64 0, !7, i64 2, !7, i64 4, !7, i64 6, !12, i64 8, !12, i64 16, !7, i64 24, !7, i64 26, !7, i64 28, !7, i64 30}
!24 = !{!23, !7, i64 6}
!25 = !{!23, !7, i64 2}
!26 = !{!23, !7, i64 26}
!27 = !{!23, !7, i64 24}
!28 = !{!6, !7, i64 1528}
!29 = !{!6, !7, i64 1530}
!30 = !{!12, !12, i64 0}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = !{!6, !10, i64 880}
!34 = !{!6, !7, i64 914}
!35 = !{!6, !8, i64 920}
!36 = !{!6, !8, i64 894}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SCCPPass,SROAPass,SimplifyCFGPass