; LLVM IR from thalium/icebox :: third_party/virtualbox/src/VBox/Devices/EFI/Firmware/MdePkg/Library (DevPathToTextVendor)

; 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.GUID = type { i32, i16, i16, [8 x i8] }
%struct.VENDOR_DEVICE_PATH = type { %struct.EFI_DEVICE_PATH_PROTOCOL, %struct.GUID }
%struct.EFI_DEVICE_PATH_PROTOCOL = type { i8, i8, [2 x i8] }
%struct.UART_FLOW_CONTROL_DEVICE_PATH = type { %struct.EFI_DEVICE_PATH_PROTOCOL, %struct.GUID, i32 }
%struct.SAS_DEVICE_PATH = type <{ %struct.EFI_DEVICE_PATH_PROTOCOL, %struct.GUID, i32, i64, i64, i16, i16 }>
%struct.VENDOR_DEVICE_PATH_WITH_DATA = type <{ %struct.EFI_DEVICE_PATH_PROTOCOL, %struct.GUID, [1 x i8] }>

@.str.5 = external hidden unnamed_addr constant [3 x i32], align 4
@.str.6 = external hidden unnamed_addr constant [4 x i32], align 4
@gEfiPcAnsiGuid = external global %struct.GUID, align 4
@.str.7 = external hidden unnamed_addr constant [12 x i32], align 4
@gEfiVT100Guid = external global %struct.GUID, align 4
@.str.8 = external hidden unnamed_addr constant [11 x i32], align 4
@gEfiVT100PlusGuid = external global %struct.GUID, align 4
@.str.9 = external hidden unnamed_addr constant [15 x i32], align 4
@gEfiVTUTF8Guid = external global %struct.GUID, align 4
@.str.10 = external hidden unnamed_addr constant [10 x i32], align 4
@gEfiUartDevicePathGuid = external global %struct.GUID, align 4
@.str.11 = external hidden unnamed_addr constant [17 x i32], align 4
@.str.12 = external hidden unnamed_addr constant [5 x i32], align 4
@.str.13 = external hidden unnamed_addr constant [9 x i32], align 4
@.str.14 = external hidden unnamed_addr constant [8 x i32], align 4
@gEfiSasDevicePathGuid = external global %struct.GUID, align 4
@.str.15 = external hidden unnamed_addr constant [22 x i32], align 4
@.str.16 = external hidden unnamed_addr constant [18 x i32], align 4
@.str.17 = external hidden unnamed_addr constant [10 x i32], align 4
@.str.18 = external hidden unnamed_addr constant [5 x i32], align 4
@.str.19 = external hidden unnamed_addr constant [4 x i32], align 4
@.str.20 = external hidden unnamed_addr constant [9 x i32], align 4
@.str.21 = external hidden unnamed_addr constant [9 x i32], align 4
@.str.22 = external hidden unnamed_addr constant [9 x i32], align 4
@.str.23 = external hidden unnamed_addr constant [7 x i32], align 4
@.str.24 = external hidden unnamed_addr constant [3 x i32], align 4
@.str.25 = external hidden unnamed_addr constant [6 x i32], align 4
@.str.26 = external hidden unnamed_addr constant [12 x i32], align 4
@.str.27 = external hidden unnamed_addr constant [6 x i32], align 4
@gEfiDebugPortProtocolGuid = external global %struct.GUID, align 4
@.str.28 = external hidden unnamed_addr constant [12 x i32], align 4
@.str.29 = external hidden unnamed_addr constant [6 x i32], align 4
@.str.30 = external hidden unnamed_addr constant [2 x i32], align 4
@.str.31 = external hidden unnamed_addr constant [9 x i32], align 4
@.str.32 = external hidden unnamed_addr constant [2 x i32], align 4
@.str.33 = external hidden unnamed_addr constant [5 x i32], align 4
@.str.34 = external hidden unnamed_addr constant [2 x i32], align 4

; Function Attrs: nounwind uwtable
declare dso_local ptr @UefiDevicePathLibCatPrint(ptr noundef, ptr noundef, ...) #0

; 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

; Function Attrs: nounwind uwtable
define dso_local void @DevPathToTextVendor(ptr noundef %0, ptr noundef %1, i8 noundef zeroext %2, i8 noundef zeroext %3) #0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i8, align 1
  %8 = alloca i8, align 1
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i32, align 4
  %14 = alloca i16, align 2
  %15 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i8 %2, ptr %7, align 1, !tbaa !9
  store i8 %3, ptr %8, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 2, ptr %14) #3
  %16 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %16, ptr %9, align 8, !tbaa !5
  %17 = load ptr, ptr %9, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.VENDOR_DEVICE_PATH, ptr %17, i32 0, i32 0
  %19 = call zeroext i8 @DevicePathType(ptr noundef %18)
  %20 = zext i8 %19 to i32
  switch i32 %20, label %188 [
    i32 1, label %21
    i32 3, label %22
    i32 4, label %187
  ]

21:                                               ; preds = %4
  store ptr @.str.5, ptr %10, align 8, !tbaa !5
  br label %189

22:                                               ; preds = %4
  store ptr @.str.6, ptr %10, align 8, !tbaa !5
  %23 = load i8, ptr %8, align 1, !tbaa !9
  %24 = icmp ne i8 %23, 0
  br i1 %24, label %25, label %186

25:                                               ; preds = %22
  %26 = load ptr, ptr %9, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.VENDOR_DEVICE_PATH, ptr %26, i32 0, i32 1
  %28 = call zeroext i8 @CompareGuid(ptr noundef %27, ptr noundef @gEfiPcAnsiGuid)
  %29 = icmp ne i8 %28, 0
  br i1 %29, label %30, label %33

30:                                               ; preds = %25
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = call ptr (ptr, ptr, ...) @UefiDevicePathLibCatPrint(ptr noundef %31, ptr noundef @.str.7)
  store i32 1, ptr %15, align 4
  br label %224

33:                                               ; preds = %25
  %34 = load ptr, ptr %9, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.VENDOR_DEVICE_PATH, ptr %34, i32 0, i32 1
  %36 = call zeroext i8 @CompareGuid(ptr noundef %35, ptr noundef @gEfiVT100Guid)
  %37 = icmp ne i8 %36, 0
  br i1 %37, label %38, label %41

38:                                               ; preds = %33
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = call ptr (ptr, ptr, ...) @UefiDevicePathLibCatPrint(ptr noundef %39, ptr noundef @.str.8)
  store i32 1, ptr %15, align 4
  br label %224

41:                                               ; preds = %33
  %42 = load ptr, ptr %9, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.VENDOR_DEVICE_PATH, ptr %42, i32 0, i32 1
  %44 = call zeroext i8 @CompareGuid(ptr noundef %43, ptr noundef @gEfiVT100PlusGuid)
  %45 = icmp ne i8 %44, 0
  br i1 %45, label %46, label %49

46:                                               ; preds = %41
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = call ptr (ptr, ptr, ...) @UefiDevicePathLibCatPrint(ptr noundef %47, ptr noundef @.str.9)
  store i32 1, ptr %15, align 4
  br label %224

49:                                               ; preds = %41
  %50 = load ptr, ptr %9, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.VENDOR_DEVICE_PATH, ptr %50, i32 0, i32 1
  %52 = call zeroext i8 @CompareGuid(ptr noundef %51, ptr noundef @gEfiVTUTF8Guid)
  %53 = icmp ne i8 %52, 0
  br i1 %53, label %54, label %57

54:                                               ; preds = %49
  %55 = load ptr, ptr %5, align 8, !tbaa !5
  %56 = call ptr (ptr, ptr, ...) @UefiDevicePathLibCatPrint(ptr noundef %55, ptr noundef @.str.10)
  store i32 1, ptr %15, align 4
  br label %224

57:                                               ; preds = %49
  %58 = load ptr, ptr %9, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.VENDOR_DEVICE_PATH, ptr %58, i32 0, i32 1
  %60 = call zeroext i8 @CompareGuid(ptr noundef %59, ptr noundef @gEfiUartDevicePathGuid)
  %61 = icmp ne i8 %60, 0
  br i1 %61, label %62, label %79

62:                                               ; preds = %57
  %63 = load ptr, ptr %9, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.UART_FLOW_CONTROL_DEVICE_PATH, ptr %63, i32 0, i32 2
  %65 = load i32, ptr %64, align 1, !tbaa !10
  store i32 %65, ptr %13, align 4, !tbaa !16
  %66 = load i32, ptr %13, align 4, !tbaa !16
  %67 = and i32 %66, 3
  switch i32 %67, label %77 [
    i32 0, label %68
    i32 1, label %71
    i32 2, label %74
  ]

68:                                               ; preds = %62
  %69 = load ptr, ptr %5, align 8, !tbaa !5
  %70 = call ptr (ptr, ptr, ...) @UefiDevicePathLibCatPrint(ptr noundef %69, ptr noundef @.str.11, ptr noundef @.str.12)
  br label %78

71:                                               ; preds = %62
  %72 = load ptr, ptr %5, align 8, !tbaa !5
  %73 = call ptr (ptr, ptr, ...) @UefiDevicePathLibCatPrint(ptr noundef %72, ptr noundef @.str.11, ptr noundef @.str.13)
  br label %78

74:                                               ; preds = %62
  %75 = load ptr, ptr %5, align 8, !tbaa !5
  %76 = call ptr (ptr, ptr, ...) @UefiDevicePathLibCatPrint(ptr noundef %75, ptr noundef @.str.11, ptr noundef @.str.14)
  br label %78

77:                                               ; preds = %62
  br label %78

78:                                               ; preds = %77, %74, %71, %68
  store i32 1, ptr %15, align 4
  br label %224

79:                                               ; preds = %57
  %80 = load ptr, ptr %9, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.VENDOR_DEVICE_PATH, ptr %80, i32 0, i32 1
  %82 = call zeroext i8 @CompareGuid(ptr noundef %81, ptr noundef @gEfiSasDevicePathGuid)
  %83 = icmp ne i8 %82, 0
  br i1 %83, label %84, label %171

84:                                               ; preds = %79
  %85 = load ptr, ptr %5, align 8, !tbaa !5
  %86 = load ptr, ptr %9, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.SAS_DEVICE_PATH, ptr %86, i32 0, i32 3
  %88 = load i64, ptr %87, align 1, !tbaa !17
  %89 = load ptr, ptr %9, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.SAS_DEVICE_PATH, ptr %89, i32 0, i32 4
  %91 = load i64, ptr %90, align 1, !tbaa !20
  %92 = load ptr, ptr %9, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.SAS_DEVICE_PATH, ptr %92, i32 0, i32 6
  %94 = load i16, ptr %93, align 1, !tbaa !21
  %95 = zext i16 %94 to i32
  %96 = call ptr (ptr, ptr, ...) @UefiDevicePathLibCatPrint(ptr noundef %85, ptr noundef @.str.15, i64 noundef %88, i64 noundef %91, i32 noundef %95)
  %97 = load ptr, ptr %9, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.SAS_DEVICE_PATH, ptr %97, i32 0, i32 5
  %99 = load i16, ptr %98, align 1, !tbaa !22
  store i16 %99, ptr %14, align 2, !tbaa !23
  %100 = load i16, ptr %14, align 2, !tbaa !23
  %101 = zext i16 %100 to i32
  %102 = and i32 %101, 15
  %103 = icmp eq i32 %102, 0
  br i1 %103, label %104, label %112

104:                                              ; preds = %84
  %105 = load i16, ptr %14, align 2, !tbaa !23
  %106 = zext i16 %105 to i32
  %107 = and i32 %106, 128
  %108 = icmp eq i32 %107, 0
  br i1 %108, label %109, label %112

109:                                              ; preds = %104
  %110 = load ptr, ptr %5, align 8, !tbaa !5
  %111 = call ptr (ptr, ptr, ...) @UefiDevicePathLibCatPrint(ptr noundef %110, ptr noundef @.str.16)
  br label %165

112:                                              ; preds = %104, %84
  %113 = load i16, ptr %14, align 2, !tbaa !23
  %114 = zext i16 %113 to i32
  %115 = and i32 %114, 15
  %116 = icmp sle i32 %115, 2
  br i1 %116, label %117, label %159

117:                                              ; preds = %112
  %118 = load i16, ptr %14, align 2, !tbaa !23
  %119 = zext i16 %118 to i32
  %120 = and i32 %119, 128
  %121 = icmp eq i32 %120, 0
  br i1 %121, label %122, label %159

122:                                              ; preds = %117
  %123 = load ptr, ptr %5, align 8, !tbaa !5
  %124 = load i16, ptr %14, align 2, !tbaa !23
  %125 = zext i16 %124 to i32
  %126 = and i32 %125, 16
  %127 = icmp ne i32 %126, 0
  %128 = zext i1 %127 to i64
  %129 = select i1 %127, ptr @.str.18, ptr @.str.19
  %130 = load i16, ptr %14, align 2, !tbaa !23
  %131 = zext i16 %130 to i32
  %132 = and i32 %131, 32
  %133 = icmp ne i32 %132, 0
  %134 = zext i1 %133 to i64
  %135 = select i1 %133, ptr @.str.20, ptr @.str.21
  %136 = load i16, ptr %14, align 2, !tbaa !23
  %137 = zext i16 %136 to i32
  %138 = and i32 %137, 64
  %139 = icmp ne i32 %138, 0
  %140 = zext i1 %139 to i64
  %141 = select i1 %139, ptr @.str.22, ptr @.str.23
  %142 = call ptr (ptr, ptr, ...) @UefiDevicePathLibCatPrint(ptr noundef %123, ptr noundef @.str.17, ptr noundef %129, ptr noundef %135, ptr noundef %141)
  %143 = load i16, ptr %14, align 2, !tbaa !23
  %144 = zext i16 %143 to i32
  %145 = and i32 %144, 15
  %146 = icmp eq i32 %145, 1
  br i1 %146, label %147, label %150

147:                                              ; preds = %122
  %148 = load ptr, ptr %5, align 8, !tbaa !5
  %149 = call ptr (ptr, ptr, ...) @UefiDevicePathLibCatPrint(ptr noundef %148, ptr noundef @.str.24)
  br label %158

150:                                              ; preds = %122
  %151 = load ptr, ptr %5, align 8, !tbaa !5
  %152 = load i16, ptr %14, align 2, !tbaa !23
  %153 = zext i16 %152 to i32
  %154 = ashr i32 %153, 8
  %155 = and i32 %154, 255
  %156 = add nsw i32 %155, 1
  %157 = call ptr (ptr, ptr, ...) @UefiDevicePathLibCatPrint(ptr noundef %151, ptr noundef @.str.25, i32 noundef %156)
  br label %158

158:                                              ; preds = %150, %147
  br label %164

159:                                              ; preds = %117, %112
  %160 = load ptr, ptr %5, align 8, !tbaa !5
  %161 = load i16, ptr %14, align 2, !tbaa !23
  %162 = zext i16 %161 to i32
  %163 = call ptr (ptr, ptr, ...) @UefiDevicePathLibCatPrint(ptr noundef %160, ptr noundef @.str.26, i32 noundef %162)
  br label %164

164:                                              ; preds = %159, %158
  br label %165

165:                                              ; preds = %164, %109
  %166 = load ptr, ptr %5, align 8, !tbaa !5
  %167 = load ptr, ptr %9, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.SAS_DEVICE_PATH, ptr %167, i32 0, i32 2
  %169 = load i32, ptr %168, align 1, !tbaa !24
  %170 = call ptr (ptr, ptr, ...) @UefiDevicePathLibCatPrint(ptr noundef %166, ptr noundef @.str.27, i32 noundef %169)
  store i32 1, ptr %15, align 4
  br label %224

171:                                              ; preds = %79
  %172 = load ptr, ptr %9, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.VENDOR_DEVICE_PATH, ptr %172, i32 0, i32 1
  %174 = call zeroext i8 @CompareGuid(ptr noundef %173, ptr noundef @gEfiDebugPortProtocolGuid)
  %175 = icmp ne i8 %174, 0
  br i1 %175, label %176, label %179

176:                                              ; preds = %171
  %177 = load ptr, ptr %5, align 8, !tbaa !5
  %178 = call ptr (ptr, ptr, ...) @UefiDevicePathLibCatPrint(ptr noundef %177, ptr noundef @.str.28)
  store i32 1, ptr %15, align 4
  br label %224

179:                                              ; preds = %171
  br label %180

180:                                              ; preds = %179
  br label %181

181:                                              ; preds = %180
  br label %182

182:                                              ; preds = %181
  br label %183

183:                                              ; preds = %182
  br label %184

184:                                              ; preds = %183
  br label %185

185:                                              ; preds = %184
  br label %186

186:                                              ; preds = %185, %22
  br label %189

187:                                              ; preds = %4
  store ptr @.str.29, ptr %10, align 8, !tbaa !5
  br label %189

188:                                              ; preds = %4
  store ptr @.str.30, ptr %10, align 8, !tbaa !5
  br label %189

189:                                              ; preds = %188, %187, %186, %21
  %190 = load ptr, ptr %9, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.VENDOR_DEVICE_PATH, ptr %190, i32 0, i32 0
  %192 = call i64 @DevicePathNodeLength(ptr noundef %191)
  %193 = sub i64 %192, 20
  store i64 %193, ptr %12, align 8, !tbaa !25
  %194 = load ptr, ptr %5, align 8, !tbaa !5
  %195 = load ptr, ptr %10, align 8, !tbaa !5
  %196 = load ptr, ptr %9, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.VENDOR_DEVICE_PATH, ptr %196, i32 0, i32 1
  %198 = call ptr (ptr, ptr, ...) @UefiDevicePathLibCatPrint(ptr noundef %194, ptr noundef @.str.31, ptr noundef %195, ptr noundef %197)
  %199 = load i64, ptr %12, align 8, !tbaa !25
  %200 = icmp ne i64 %199, 0
  br i1 %200, label %201, label %221

201:                                              ; preds = %189
  %202 = load ptr, ptr %5, align 8, !tbaa !5
  %203 = call ptr (ptr, ptr, ...) @UefiDevicePathLibCatPrint(ptr noundef %202, ptr noundef @.str.32)
  store i64 0, ptr %11, align 8, !tbaa !25
  br label %204

204:                                              ; preds = %217, %201
  %205 = load i64, ptr %11, align 8, !tbaa !25
  %206 = load i64, ptr %12, align 8, !tbaa !25
  %207 = icmp ult i64 %205, %206
  br i1 %207, label %208, label %220

208:                                              ; preds = %204
  %209 = load ptr, ptr %5, align 8, !tbaa !5
  %210 = load ptr, ptr %9, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.VENDOR_DEVICE_PATH_WITH_DATA, ptr %210, i32 0, i32 2
  %212 = load i64, ptr %11, align 8, !tbaa !25
  %213 = getelementptr inbounds [1 x i8], ptr %211, i64 0, i64 %212
  %214 = load i8, ptr %213, align 1, !tbaa !9
  %215 = zext i8 %214 to i32
  %216 = call ptr (ptr, ptr, ...) @UefiDevicePathLibCatPrint(ptr noundef %209, ptr noundef @.str.33, i32 noundef %215)
  br label %217

217:                                              ; preds = %208
  %218 = load i64, ptr %11, align 8, !tbaa !25
  %219 = add i64 %218, 1
  store i64 %219, ptr %11, align 8, !tbaa !25
  br label %204, !llvm.loop !26

220:                                              ; preds = %204
  br label %221

221:                                              ; preds = %220, %189
  %222 = load ptr, ptr %5, align 8, !tbaa !5
  %223 = call ptr (ptr, ptr, ...) @UefiDevicePathLibCatPrint(ptr noundef %222, ptr noundef @.str.34)
  store i32 0, ptr %15, align 4
  br label %224

224:                                              ; preds = %221, %176, %165, %78, %54, %46, %38, %30
  call void @llvm.lifetime.end.p0(i64 2, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  %225 = load i32, ptr %15, align 4
  switch i32 %225, label %227 [
    i32 0, label %226
    i32 1, label %226
  ]

226:                                              ; preds = %224, %224
  ret void

227:                                              ; preds = %224
  unreachable
}

declare zeroext i8 @DevicePathType(ptr noundef) #2

declare zeroext i8 @CompareGuid(ptr noundef, ptr noundef) #2

declare i64 @DevicePathNodeLength(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 = !{!7, !7, i64 0}
!10 = !{!11, !14, i64 20}
!11 = !{!"", !12, i64 0, !13, i64 4, !14, i64 20}
!12 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2}
!13 = !{!"", !14, i64 0, !15, i64 4, !15, i64 6, !7, i64 8}
!14 = !{!"int", !7, i64 0}
!15 = !{!"short", !7, i64 0}
!16 = !{!14, !14, i64 0}
!17 = !{!18, !19, i64 24}
!18 = !{!"", !12, i64 0, !13, i64 4, !14, i64 20, !19, i64 24, !19, i64 32, !15, i64 40, !15, i64 42}
!19 = !{!"long long", !7, i64 0}
!20 = !{!18, !19, i64 32}
!21 = !{!18, !15, i64 42}
!22 = !{!18, !15, i64 40}
!23 = !{!15, !15, i64 0}
!24 = !{!18, !14, i64 20}
!25 = !{!19, !19, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}


; 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.GUID = type { i32, i16, i16, [8 x i8] }

@.str.5 = external hidden unnamed_addr constant [3 x i32], align 4
@.str.6 = external hidden unnamed_addr constant [4 x i32], align 4
@gEfiPcAnsiGuid = external global %struct.GUID, align 4
@.str.7 = external hidden unnamed_addr constant [12 x i32], align 4
@gEfiVT100Guid = external global %struct.GUID, align 4
@.str.8 = external hidden unnamed_addr constant [11 x i32], align 4
@gEfiVT100PlusGuid = external global %struct.GUID, align 4
@.str.9 = external hidden unnamed_addr constant [15 x i32], align 4
@gEfiVTUTF8Guid = external global %struct.GUID, align 4
@.str.10 = external hidden unnamed_addr constant [10 x i32], align 4
@gEfiUartDevicePathGuid = external global %struct.GUID, align 4
@.str.11 = external hidden unnamed_addr constant [17 x i32], align 4
@.str.12 = external hidden unnamed_addr constant [5 x i32], align 4
@.str.13 = external hidden unnamed_addr constant [9 x i32], align 4
@.str.14 = external hidden unnamed_addr constant [8 x i32], align 4
@gEfiSasDevicePathGuid = external global %struct.GUID, align 4
@.str.15 = external hidden unnamed_addr constant [22 x i32], align 4
@.str.16 = external hidden unnamed_addr constant [18 x i32], align 4
@.str.17 = external hidden unnamed_addr constant [10 x i32], align 4
@.str.18 = external hidden unnamed_addr constant [5 x i32], align 4
@.str.19 = external hidden unnamed_addr constant [4 x i32], align 4
@.str.20 = external hidden unnamed_addr constant [9 x i32], align 4
@.str.21 = external hidden unnamed_addr constant [9 x i32], align 4
@.str.22 = external hidden unnamed_addr constant [9 x i32], align 4
@.str.23 = external hidden unnamed_addr constant [7 x i32], align 4
@.str.24 = external hidden unnamed_addr constant [3 x i32], align 4
@.str.25 = external hidden unnamed_addr constant [6 x i32], align 4
@.str.26 = external hidden unnamed_addr constant [12 x i32], align 4
@.str.27 = external hidden unnamed_addr constant [6 x i32], align 4
@gEfiDebugPortProtocolGuid = external global %struct.GUID, align 4
@.str.28 = external hidden unnamed_addr constant [12 x i32], align 4
@.str.29 = external hidden unnamed_addr constant [6 x i32], align 4
@.str.30 = external hidden unnamed_addr constant [2 x i32], align 4
@.str.31 = external hidden unnamed_addr constant [9 x i32], align 4
@.str.32 = external hidden unnamed_addr constant [2 x i32], align 4
@.str.33 = external hidden unnamed_addr constant [5 x i32], align 4
@.str.34 = external hidden unnamed_addr constant [2 x i32], align 4

; Function Attrs: nounwind uwtable
declare dso_local ptr @UefiDevicePathLibCatPrint(ptr noundef, ptr noundef, ...) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @DevPathToTextVendor(ptr noundef %0, ptr noundef %1, i8 noundef zeroext %2, i8 noundef zeroext %3) local_unnamed_addr #0 {
  %5 = tail call zeroext i8 @DevicePathType(ptr noundef %1) #2
  switch i8 %5, label %84 [
    i8 1, label %85
    i8 3, label %6
    i8 4, label %83
  ]

6:                                                ; preds = %4
  %.not = icmp eq i8 %3, 0
  br i1 %.not, label %85, label %7

7:                                                ; preds = %6
  %8 = getelementptr inbounds i8, ptr %1, i64 4
  %9 = tail call zeroext i8 @CompareGuid(ptr noundef nonnull %8, ptr noundef nonnull @gEfiPcAnsiGuid) #2
  %.not57 = icmp eq i8 %9, 0
  br i1 %.not57, label %12, label %10

10:                                               ; preds = %7
  %11 = tail call ptr (ptr, ptr, ...) @UefiDevicePathLibCatPrint(ptr noundef %0, ptr noundef nonnull @.str.7)
  br label %100

12:                                               ; preds = %7
  %13 = tail call zeroext i8 @CompareGuid(ptr noundef nonnull %8, ptr noundef nonnull @gEfiVT100Guid) #2
  %.not58 = icmp eq i8 %13, 0
  br i1 %.not58, label %16, label %14

14:                                               ; preds = %12
  %15 = tail call ptr (ptr, ptr, ...) @UefiDevicePathLibCatPrint(ptr noundef %0, ptr noundef nonnull @.str.8)
  br label %100

16:                                               ; preds = %12
  %17 = tail call zeroext i8 @CompareGuid(ptr noundef nonnull %8, ptr noundef nonnull @gEfiVT100PlusGuid) #2
  %.not59 = icmp eq i8 %17, 0
  br i1 %.not59, label %20, label %18

18:                                               ; preds = %16
  %19 = tail call ptr (ptr, ptr, ...) @UefiDevicePathLibCatPrint(ptr noundef %0, ptr noundef nonnull @.str.9)
  br label %100

20:                                               ; preds = %16
  %21 = tail call zeroext i8 @CompareGuid(ptr noundef nonnull %8, ptr noundef nonnull @gEfiVTUTF8Guid) #2
  %.not60 = icmp eq i8 %21, 0
  br i1 %.not60, label %24, label %22

22:                                               ; preds = %20
  %23 = tail call ptr (ptr, ptr, ...) @UefiDevicePathLibCatPrint(ptr noundef %0, ptr noundef nonnull @.str.10)
  br label %100

24:                                               ; preds = %20
  %25 = tail call zeroext i8 @CompareGuid(ptr noundef nonnull %8, ptr noundef nonnull @gEfiUartDevicePathGuid) #2
  %.not61 = icmp eq i8 %25, 0
  br i1 %.not61, label %36, label %26

26:                                               ; preds = %24
  %27 = getelementptr inbounds i8, ptr %1, i64 20
  %28 = load i32, ptr %27, align 1, !tbaa !5
  %29 = and i32 %28, 3
  switch i32 %29, label %default.unreachable72 [
    i32 0, label %30
    i32 1, label %32
    i32 2, label %34
    i32 3, label %100
  ]

30:                                               ; preds = %26
  %31 = tail call ptr (ptr, ptr, ...) @UefiDevicePathLibCatPrint(ptr noundef %0, ptr noundef nonnull @.str.11, ptr noundef nonnull @.str.12)
  br label %100

32:                                               ; preds = %26
  %33 = tail call ptr (ptr, ptr, ...) @UefiDevicePathLibCatPrint(ptr noundef %0, ptr noundef nonnull @.str.11, ptr noundef nonnull @.str.13)
  br label %100

34:                                               ; preds = %26
  %35 = tail call ptr (ptr, ptr, ...) @UefiDevicePathLibCatPrint(ptr noundef %0, ptr noundef nonnull @.str.11, ptr noundef nonnull @.str.14)
  br label %100

default.unreachable72:                            ; preds = %26
  unreachable

36:                                               ; preds = %24
  %37 = tail call zeroext i8 @CompareGuid(ptr noundef nonnull %8, ptr noundef nonnull @gEfiSasDevicePathGuid) #2
  %.not62 = icmp eq i8 %37, 0
  br i1 %.not62, label %79, label %38

38:                                               ; preds = %36
  %39 = getelementptr inbounds i8, ptr %1, i64 24
  %40 = load i64, ptr %39, align 1, !tbaa !13
  %41 = getelementptr inbounds i8, ptr %1, i64 32
  %42 = load i64, ptr %41, align 1, !tbaa !16
  %43 = getelementptr inbounds i8, ptr %1, i64 42
  %44 = load i16, ptr %43, align 1, !tbaa !17
  %45 = zext i16 %44 to i32
  %46 = tail call ptr (ptr, ptr, ...) @UefiDevicePathLibCatPrint(ptr noundef %0, ptr noundef nonnull @.str.15, i64 noundef %40, i64 noundef %42, i32 noundef %45)
  %47 = getelementptr inbounds i8, ptr %1, i64 40
  %48 = load i16, ptr %47, align 1, !tbaa !18
  %49 = zext i16 %48 to i32
  %50 = and i32 %49, 15
  %51 = and i32 %49, 143
  %or.cond = icmp eq i32 %51, 0
  br i1 %or.cond, label %52, label %54

52:                                               ; preds = %38
  %53 = tail call ptr (ptr, ptr, ...) @UefiDevicePathLibCatPrint(ptr noundef %0, ptr noundef nonnull @.str.16)
  br label %75

54:                                               ; preds = %38
  %55 = and i32 %49, 128
  %56 = icmp eq i32 %55, 0
  %57 = icmp ult i32 %50, 3
  %or.cond70 = and i1 %57, %56
  br i1 %or.cond70, label %58, label %73

58:                                               ; preds = %54
  %59 = and i32 %49, 16
  %.not64 = icmp eq i32 %59, 0
  %60 = select i1 %.not64, ptr @.str.19, ptr @.str.18
  %61 = and i32 %49, 32
  %.not65 = icmp eq i32 %61, 0
  %62 = select i1 %.not65, ptr @.str.21, ptr @.str.20
  %63 = and i32 %49, 64
  %.not66 = icmp eq i32 %63, 0
  %64 = select i1 %.not66, ptr @.str.23, ptr @.str.22
  %65 = tail call ptr (ptr, ptr, ...) @UefiDevicePathLibCatPrint(ptr noundef %0, ptr noundef nonnull @.str.17, ptr noundef nonnull %60, ptr noundef nonnull %62, ptr noundef nonnull %64)
  %66 = icmp eq i32 %50, 1
  br i1 %66, label %67, label %69

67:                                               ; preds = %58
  %68 = tail call ptr (ptr, ptr, ...) @UefiDevicePathLibCatPrint(ptr noundef %0, ptr noundef nonnull @.str.24)
  br label %75

69:                                               ; preds = %58
  %70 = lshr i32 %49, 8
  %71 = add nuw nsw i32 %70, 1
  %72 = tail call ptr (ptr, ptr, ...) @UefiDevicePathLibCatPrint(ptr noundef %0, ptr noundef nonnull @.str.25, i32 noundef %71)
  br label %75

73:                                               ; preds = %54
  %74 = tail call ptr (ptr, ptr, ...) @UefiDevicePathLibCatPrint(ptr noundef %0, ptr noundef nonnull @.str.26, i32 noundef %49)
  br label %75

75:                                               ; preds = %73, %69, %67, %52
  %76 = getelementptr inbounds i8, ptr %1, i64 20
  %77 = load i32, ptr %76, align 1, !tbaa !19
  %78 = tail call ptr (ptr, ptr, ...) @UefiDevicePathLibCatPrint(ptr noundef %0, ptr noundef nonnull @.str.27, i32 noundef %77)
  br label %100

79:                                               ; preds = %36
  %80 = tail call zeroext i8 @CompareGuid(ptr noundef nonnull %8, ptr noundef nonnull @gEfiDebugPortProtocolGuid) #2
  %.not63 = icmp eq i8 %80, 0
  br i1 %.not63, label %85, label %81

81:                                               ; preds = %79
  %82 = tail call ptr (ptr, ptr, ...) @UefiDevicePathLibCatPrint(ptr noundef %0, ptr noundef nonnull @.str.28)
  br label %100

83:                                               ; preds = %4
  br label %85

84:                                               ; preds = %4
  br label %85

85:                                               ; preds = %4, %6, %79, %84, %83
  %.0 = phi ptr [ @.str.30, %84 ], [ @.str.29, %83 ], [ @.str.6, %79 ], [ @.str.6, %6 ], [ @.str.5, %4 ]
  %86 = tail call i64 @DevicePathNodeLength(ptr noundef %1) #2
  %87 = add i64 %86, -20
  %88 = getelementptr inbounds i8, ptr %1, i64 4
  %89 = tail call ptr (ptr, ptr, ...) @UefiDevicePathLibCatPrint(ptr noundef %0, ptr noundef nonnull @.str.31, ptr noundef nonnull %.0, ptr noundef nonnull %88)
  %.not67 = icmp eq i64 %87, 0
  br i1 %.not67, label %.loopexit, label %90

90:                                               ; preds = %85
  %91 = tail call ptr (ptr, ptr, ...) @UefiDevicePathLibCatPrint(ptr noundef %0, ptr noundef nonnull @.str.32)
  %92 = getelementptr inbounds i8, ptr %1, i64 20
  br label %93

93:                                               ; preds = %90, %93
  %.05471 = phi i64 [ 0, %90 ], [ %98, %93 ]
  %94 = getelementptr inbounds [1 x i8], ptr %92, i64 0, i64 %.05471
  %95 = load i8, ptr %94, align 1, !tbaa !20
  %96 = zext i8 %95 to i32
  %97 = tail call ptr (ptr, ptr, ...) @UefiDevicePathLibCatPrint(ptr noundef %0, ptr noundef nonnull @.str.33, i32 noundef %96)
  %98 = add nuw i64 %.05471, 1
  %exitcond.not = icmp eq i64 %98, %87
  br i1 %exitcond.not, label %.loopexit, label %93, !llvm.loop !21

.loopexit:                                        ; preds = %93, %85
  %99 = tail call ptr (ptr, ptr, ...) @UefiDevicePathLibCatPrint(ptr noundef %0, ptr noundef nonnull @.str.34)
  br label %100

100:                                              ; preds = %30, %32, %34, %26, %.loopexit, %81, %75, %22, %18, %14, %10
  ret void
}

declare zeroext i8 @DevicePathType(ptr noundef) local_unnamed_addr #1

declare zeroext i8 @CompareGuid(ptr noundef, ptr noundef) local_unnamed_addr #1

declare i64 @DevicePathNodeLength(ptr noundef) local_unnamed_addr #1

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 = { "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, !11, i64 20}
!6 = !{!"", !7, i64 0, !10, i64 4, !11, i64 20}
!7 = !{!"", !8, i64 0, !8, i64 1, !8, i64 2}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"", !11, i64 0, !12, i64 4, !12, i64 6, !8, i64 8}
!11 = !{!"int", !8, i64 0}
!12 = !{!"short", !8, i64 0}
!13 = !{!14, !15, i64 24}
!14 = !{!"", !7, i64 0, !10, i64 4, !11, i64 20, !15, i64 24, !15, i64 32, !12, i64 40, !12, i64 42}
!15 = !{!"long long", !8, i64 0}
!16 = !{!14, !15, i64 32}
!17 = !{!14, !12, i64 42}
!18 = !{!14, !12, i64 40}
!19 = !{!14, !11, i64 20}
!20 = !{!8, !8, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}


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