#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, unsigned int);
const char *x86_pci_device_id_to_string(unsigned vendor_id, unsigned device_id,
                                        const char **vendor_name) {
  static char temp_vendor_name[7], temp_device_name[7];
  const char *vendor_name_null;
  if (!vendor_name) {
    vendor_name = &vendor_name_null;
  }
  switch (vendor_id) {
  case 0x1013:
    *vendor_name = "Cirrus Logic";
    switch (device_id) {
    case 0x00b8:
      return "GD 5446";
    }
    break;
  case 0x8086:
    *vendor_name = "Intel Corporation";
    switch (device_id) {
    case 0x100e:
      return "82540EM Gigabit Ethernet Controller";
    case 0x1237:
      return "440FX - 82441FX PMC [Natoma]";
    case 0x2415:
      return "82801AA AC'97 Audio Controller";
    case 0x2668:
      return "82801FB/FBM/FR/FW/FRW (ICH6 Family) HDA Controller";
    case 0x7000:
      return "82371SB PIIX3 ISA [Natoma/Triton II]";
    case 0x7010:
      return "82371SB PIIX3 IDE [Natoma/Triton II]";
    case 0x7020:
      return "82371SB PIIX3 USB [Natoma/Triton II]";
    case 0x7113:
      return "82371AB/EB/MB PIIX4 ACPI";
    case 0x0958:
      return "Host Bridge";
    case 0x095E:
      return "Legacy Bridge";
    case 0x11C3:
      return "PCIe* Root Port 0";
    case 0x11C4:
      return "PCIe* Root Port 1";
    case 0x08A7:
      return "SDIO / eMMC Controller";
    case 0x0936:
      return "HS-UART";
    case 0x0939:
      return "USB 2.0 Device";
    case 0x093A:
      return "USB OHCI Host Controller";
    case 0x0937:
      return "10/100 Ethernet";
    case 0x0935:
      return "SPI Controller";
    case 0x0934:
      return "I2C* Controller and GPIO Controller";
    }
    break;
  default:
    snprintf(temp_vendor_name, sizeof temp_vendor_name, "0x%04x", vendor_id);
    *vendor_name = temp_vendor_name;
  }
  snprintf(temp_device_name, sizeof temp_device_name, "0x%04x", device_id);
  return temp_device_name;
}


x86 assembly (clang, -O0):
<x86_pci_device_id_to_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1135 <x86_pci_device_id_to_string+0x25>
lea    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
sub    $0x1013,%eax
je     115e <x86_pci_device_id_to_string+0x4e>
jmp    114b <x86_pci_device_id_to_string+0x3b>
mov    -0x24(%rbp),%eax
sub    $0x8086,%eax
je     1194 <x86_pci_device_id_to_string+0x84>
jmp    1443 <x86_pci_device_id_to_string+0x333>
mov    -0x18(%rbp),%rax
lea    0xe97(%rip),%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%eax
sub    $0xb8,%eax
jne    118f <x86_pci_device_id_to_string+0x7f>
jmp    117f <x86_pci_device_id_to_string+0x6f>
lea    0xe87(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1492 <x86_pci_device_id_to_string+0x382>
jmp    146c <x86_pci_device_id_to_string+0x35c>
mov    -0x18(%rbp),%rax
lea    0xe76(%rip),%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%eax
mov    %eax,-0x28(%rbp)
sub    $0x8a7,%eax
je     13ce <x86_pci_device_id_to_string+0x2be>
jmp    11b8 <x86_pci_device_id_to_string+0xa8>
mov    -0x28(%rbp),%eax
sub    $0x934,%eax
je     142e <x86_pci_device_id_to_string+0x31e>
jmp    11cb <x86_pci_device_id_to_string+0xbb>
mov    -0x28(%rbp),%eax
sub    $0x935,%eax
je     141e <x86_pci_device_id_to_string+0x30e>
jmp    11de <x86_pci_device_id_to_string+0xce>
mov    -0x28(%rbp),%eax
sub    $0x936,%eax
je     13de <x86_pci_device_id_to_string+0x2ce>
jmp    11f1 <x86_pci_device_id_to_string+0xe1>
mov    -0x28(%rbp),%eax
sub    $0x937,%eax
je     140e <x86_pci_device_id_to_string+0x2fe>
jmp    1204 <x86_pci_device_id_to_string+0xf4>
mov    -0x28(%rbp),%eax
sub    $0x939,%eax
je     13ee <x86_pci_device_id_to_string+0x2de>
jmp    1217 <x86_pci_device_id_to_string+0x107>
mov    -0x28(%rbp),%eax
sub    $0x93a,%eax
je     13fe <x86_pci_device_id_to_string+0x2ee>
jmp    122a <x86_pci_device_id_to_string+0x11a>
mov    -0x28(%rbp),%eax
sub    $0x958,%eax
je     138e <x86_pci_device_id_to_string+0x27e>
jmp    123d <x86_pci_device_id_to_string+0x12d>
mov    -0x28(%rbp),%eax
sub    $0x95e,%eax
je     139e <x86_pci_device_id_to_string+0x28e>
jmp    1250 <x86_pci_device_id_to_string+0x140>
mov    -0x28(%rbp),%eax
sub    $0x100e,%eax
je     130e <x86_pci_device_id_to_string+0x1fe>
jmp    1263 <x86_pci_device_id_to_string+0x153>
mov    -0x28(%rbp),%eax
sub    $0x11c3,%eax
je     13ae <x86_pci_device_id_to_string+0x29e>
jmp    1276 <x86_pci_device_id_to_string+0x166>
mov    -0x28(%rbp),%eax
sub    $0x11c4,%eax
je     13be <x86_pci_device_id_to_string+0x2ae>
jmp    1289 <x86_pci_device_id_to_string+0x179>
mov    -0x28(%rbp),%eax
sub    $0x1237,%eax
je     131e <x86_pci_device_id_to_string+0x20e>
jmp    129c <x86_pci_device_id_to_string+0x18c>
mov    -0x28(%rbp),%eax
sub    $0x2415,%eax
je     132e <x86_pci_device_id_to_string+0x21e>
jmp    12af <x86_pci_device_id_to_string+0x19f>
mov    -0x28(%rbp),%eax
sub    $0x2668,%eax
je     133e <x86_pci_device_id_to_string+0x22e>
jmp    12c2 <x86_pci_device_id_to_string+0x1b2>
mov    -0x28(%rbp),%eax
sub    $0x7000,%eax
je     134e <x86_pci_device_id_to_string+0x23e>
jmp    12d5 <x86_pci_device_id_to_string+0x1c5>
mov    -0x28(%rbp),%eax
sub    $0x7010,%eax
je     135e <x86_pci_device_id_to_string+0x24e>
jmp    12e8 <x86_pci_device_id_to_string+0x1d8>
mov    -0x28(%rbp),%eax
sub    $0x7020,%eax
je     136e <x86_pci_device_id_to_string+0x25e>
jmp    12fb <x86_pci_device_id_to_string+0x1eb>
mov    -0x28(%rbp),%eax
sub    $0x7113,%eax
je     137e <x86_pci_device_id_to_string+0x26e>
jmp    143e <x86_pci_device_id_to_string+0x32e>
lea    0xd12(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1492 <x86_pci_device_id_to_string+0x382>
lea    0xd26(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1492 <x86_pci_device_id_to_string+0x382>
lea    0xd33(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1492 <x86_pci_device_id_to_string+0x382>
lea    0xd42(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1492 <x86_pci_device_id_to_string+0x382>
lea    0xd65(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1492 <x86_pci_device_id_to_string+0x382>
lea    0xd7a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1492 <x86_pci_device_id_to_string+0x382>
lea    0xd8f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1492 <x86_pci_device_id_to_string+0x382>
lea    0xda4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1492 <x86_pci_device_id_to_string+0x382>
lea    0xdad(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1492 <x86_pci_device_id_to_string+0x382>
lea    0xda9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1492 <x86_pci_device_id_to_string+0x382>
lea    0xda7(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1492 <x86_pci_device_id_to_string+0x382>
lea    0xda9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1492 <x86_pci_device_id_to_string+0x382>
lea    0xdab(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1492 <x86_pci_device_id_to_string+0x382>
lea    0xdb2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1492 <x86_pci_device_id_to_string+0x382>
lea    0xdaa(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1492 <x86_pci_device_id_to_string+0x382>
lea    0xda9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1492 <x86_pci_device_id_to_string+0x382>
lea    0xdb2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1492 <x86_pci_device_id_to_string+0x382>
lea    0xdb2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1492 <x86_pci_device_id_to_string+0x382>
lea    0xdb1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1492 <x86_pci_device_id_to_string+0x382>
jmp    146c <x86_pci_device_id_to_string+0x35c>
mov    -0xc(%rbp),%ecx
lea    0x2bdc(%rip),%rdi
mov    $0x7,%esi
lea    0xdb1(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x18(%rbp),%rax
lea    0x2bc0(%rip),%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%ecx
lea    0x2bba(%rip),%rdi
mov    $0x7,%esi
lea    0xd88(%rip),%rdx
call   1030 <snprintf@plt>
lea    0x2ba2(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x86_pci_device_id_to_string>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%r14d
test   %rdx,%rdx
lea    0x8(%rsp),%rbx
cmovne %rdx,%rbx
cmp    $0x8086,%edi
je     1156 <x86_pci_device_id_to_string+0x46>
mov    %edi,%ecx
cmp    $0x1013,%edi
jne    1192 <x86_pci_device_id_to_string+0x82>
lea    0xf6b(%rip),%rax
mov    %rax,(%rbx)
cmp    $0xb8,%r14d
jne    11b0 <x86_pci_device_id_to_string+0xa0>
lea    0xf65(%rip),%rbx
jmp    11ce <x86_pci_device_id_to_string+0xbe>
lea    0xf64(%rip),%rax
mov    %rax,(%rbx)
cmp    $0x11c2,%r14d
jg     11db <x86_pci_device_id_to_string+0xcb>
lea    -0x934(%r14),%eax
cmp    $0x2a,%eax
ja     1245 <x86_pci_device_id_to_string+0x135>
lea    0xe80(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0x1102(%rip),%rbx
jmp    11ce <x86_pci_device_id_to_string+0xbe>
lea    0x2e90(%rip),%r15
lea    0x1116(%rip),%rdx
mov    %r15,%rdi
mov    $0x7,%esi
call   1030 <snprintf@plt>
mov    %r15,(%rbx)
lea    0x2e79(%rip),%rbx
lea    0x10f8(%rip),%rdx
mov    %rbx,%rdi
mov    $0x7,%esi
mov    %r14d,%ecx
call   1030 <snprintf@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
cmp    $0x2667,%r14d
jle    1219 <x86_pci_device_id_to_string+0x109>
cmp    $0x700f,%r14d
jle    126b <x86_pci_device_id_to_string+0x15b>
cmp    $0x7010,%r14d
je     130b <x86_pci_device_id_to_string+0x1fb>
cmp    $0x7020,%r14d
je     1317 <x86_pci_device_id_to_string+0x207>
cmp    $0x7113,%r14d
jne    11b0 <x86_pci_device_id_to_string+0xa0>
lea    0xfbe(%rip),%rbx
jmp    11ce <x86_pci_device_id_to_string+0xbe>
cmp    $0x1236,%r14d
jg     1291 <x86_pci_device_id_to_string+0x181>
cmp    $0x11c3,%r14d
je     1323 <x86_pci_device_id_to_string+0x213>
cmp    $0x11c4,%r14d
jne    11b0 <x86_pci_device_id_to_string+0xa0>
lea    0xfd7(%rip),%rbx
jmp    11ce <x86_pci_device_id_to_string+0xbe>
cmp    $0x8a7,%r14d
je     132f <x86_pci_device_id_to_string+0x21f>
cmp    $0x100e,%r14d
jne    11b0 <x86_pci_device_id_to_string+0xa0>
lea    0xe6d(%rip),%rbx
jmp    11ce <x86_pci_device_id_to_string+0xbe>
cmp    $0x2668,%r14d
je     133b <x86_pci_device_id_to_string+0x22b>
cmp    $0x7000,%r14d
jne    11b0 <x86_pci_device_id_to_string+0xa0>
lea    0xeda(%rip),%rbx
jmp    11ce <x86_pci_device_id_to_string+0xbe>
cmp    $0x1237,%r14d
je     1347 <x86_pci_device_id_to_string+0x237>
cmp    $0x2415,%r14d
jne    11b0 <x86_pci_device_id_to_string+0xa0>
lea    0xe62(%rip),%rbx
jmp    11ce <x86_pci_device_id_to_string+0xbe>
lea    0xfc5(%rip),%rbx
jmp    11ce <x86_pci_device_id_to_string+0xbe>
lea    0xf79(%rip),%rbx
jmp    11ce <x86_pci_device_id_to_string+0xbe>
lea    0xf9d(%rip),%rbx
jmp    11ce <x86_pci_device_id_to_string+0xbe>
lea    0xf69(%rip),%rbx
jmp    11ce <x86_pci_device_id_to_string+0xbe>
lea    0xf6c(%rip),%rbx
jmp    11ce <x86_pci_device_id_to_string+0xbe>
lea    0xef4(%rip),%rbx
jmp    11ce <x86_pci_device_id_to_string+0xbe>
lea    0xef4(%rip),%rbx
jmp    11ce <x86_pci_device_id_to_string+0xbe>
lea    0xe79(%rip),%rbx
jmp    11ce <x86_pci_device_id_to_string+0xbe>
lea    0xe92(%rip),%rbx
jmp    11ce <x86_pci_device_id_to_string+0xbe>
lea    0xede(%rip),%rbx
jmp    11ce <x86_pci_device_id_to_string+0xbe>
lea    0xef6(%rip),%rbx
jmp    11ce <x86_pci_device_id_to_string+0xbe>
lea    0xdf1(%rip),%rbx
jmp    11ce <x86_pci_device_id_to_string+0xbe>
lea    0xda9(%rip),%rbx
jmp    11ce <x86_pci_device_id_to_string+0xbe>

LLVM IR (-O0):
@x86_pci_device_id_to_string.temp_vendor_name = internal global [7 x i8] zeroinitializer
@x86_pci_device_id_to_string.temp_device_name = internal global [7 x i8] zeroinitializer
@.str = [13 x i8] c"Cirrus Logic\00"
@.str.1 = [8 x i8] c"GD 5446\00"
@.str.2 = [18 x i8] c"Intel Corporation\00"
@.str.3 = [36 x i8] c"82540EM Gigabit Ethernet Controller\00"
@.str.4 = [29 x i8] c"440FX - 82441FX PMC [Natoma]\00"
@.str.5 = [31 x i8] c"82801AA AC'97 Audio Controller\00"
@.str.6 = [51 x i8] c"82801FB/FBM/FR/FW/FRW (ICH6 Family) HDA Controller\00"
@.str.7 = [37 x i8] c"82371SB PIIX3 ISA [Natoma/Triton II]\00"
@.str.8 = [37 x i8] c"82371SB PIIX3 IDE [Natoma/Triton II]\00"
@.str.9 = [37 x i8] c"82371SB PIIX3 USB [Natoma/Triton II]\00"
@.str.10 = [25 x i8] c"82371AB/EB/MB PIIX4 ACPI\00"
@.str.11 = [12 x i8] c"Host Bridge\00"
@.str.12 = [14 x i8] c"Legacy Bridge\00"
@.str.13 = [18 x i8] c"PCIe* Root Port 0\00"
@.str.14 = [18 x i8] c"PCIe* Root Port 1\00"
@.str.15 = [23 x i8] c"SDIO / eMMC Controller\00"
@.str.16 = [8 x i8] c"HS-UART\00"
@.str.17 = [15 x i8] c"USB 2.0 Device\00"
@.str.18 = [25 x i8] c"USB OHCI Host Controller\00"
@.str.19 = [16 x i8] c"10/100 Ethernet\00"
@.str.20 = [15 x i8] c"SPI Controller\00"
@.str.21 = [36 x i8] c"I2C* Controller and GPIO Controller\00"
@.str.22 = [7 x i8] c"0x%04x\00"
define i8* @x86_pci_device_id_to_string(i32 %0, i32 %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
%9 = load i8**, i8*** %7
%10 = icmp ne i8** %9, null
br i1 %10, label %12, label %11
11: ; preds = %3
store i8** %8, i8*** %7
br label %12
12: ; preds = %11, %3
%13 = load i32, i32* %5
switch i32 %13, label %42 [
i32 4115, label %14
i32 32902, label %19
]
14: ; preds = %12
%15 = load i8**, i8*** %7
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %15
%16 = load i32, i32* %6
switch i32 %16, label %18 [
i32 184, label %17
]
17: ; preds = %14
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %4
br label %49
18: ; preds = %14
br label %46
19: ; preds = %12
%20 = load i8**, i8*** %7
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8** %20
%21 = load i32, i32* %6
switch i32 %21, label %41 [
i32 4110, label %22
i32 4663, label %23
i32 9237, label %24
i32 9832, label %25
i32 28672, label %26
i32 28688, label %27
i32 28704, label %28
i32 28947, label %29
i32 2392, label %30
i32 2398, label %31
i32 4547, label %32
i32 4548, label %33
i32 2215, label %34
i32 2358, label %35
i32 2361, label %36
i32 2362, label %37
i32 2359, label %38
i32 2357, label %39
i32 2356, label %40
]
22: ; preds = %19
store i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), i8** %4
br label %49
23: ; preds = %19
store i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i8** %4
br label %49
24: ; preds = %19
store i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i8** %4
br label %49
25: ; preds = %19
store i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.6, i64 0, i64 0), i8** %4
br label %49
26: ; preds = %19
store i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.7, i64 0, i64 0), i8** %4
br label %49
27: ; preds = %19
store i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.8, i64 0, i64 0), i8** %4
br label %49
28: ; preds = %19
store i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.9, i64 0, i64 0), i8** %4
br label %49
29: ; preds = %19
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.10, i64 0, i64 0), i8** %4
br label %49
30: ; preds = %19
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0), i8** %4
br label %49
31: ; preds = %19
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.12, i64 0, i64 0), i8** %4
br label %49
32: ; preds = %19
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.13, i64 0, i64 0), i8** %4
br label %49
33: ; preds = %19
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.14, i64 0, i64 0), i8** %4
br label %49
34: ; preds = %19
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.15, i64 0, i64 0), i8** %4
br label %49
35: ; preds = %19
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0), i8** %4
br label %49
36: ; preds = %19
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.17, i64 0, i64 0), i8** %4
br label %49
37: ; preds = %19
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.18, i64 0, i64 0), i8** %4
br label %49
38: ; preds = %19
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.19, i64 0, i64 0), i8** %4
br label %49
39: ; preds = %19
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.20, i64 0, i64 0), i8** %4
br label %49
40: ; preds = %19
store i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.21, i64 0, i64 0), i8** %4
br label %49
41: ; preds = %19
br label %46
42: ; preds = %12
%43 = load i32, i32* %5
%44 = call i32 @snprintf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @x86_pci_device_id_to_string.temp_vendor_name, i64 0, i64 0), i32 7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.22, i64 0, i64 0), i32 %43)
%45 = load i8**, i8*** %7
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @x86_pci_device_id_to_string.temp_vendor_name, i64 0, i64 0), i8** %45
br label %46
46: ; preds = %42, %41, %18
%47 = load i32, i32* %6
%48 = call i32 @snprintf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @x86_pci_device_id_to_string.temp_device_name, i64 0, i64 0), i32 7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.22, i64 0, i64 0), i32 %47)
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @x86_pci_device_id_to_string.temp_device_name, i64 0, i64 0), i8** %4
br label %49
49: ; preds = %46, %40, %39, %38, %37, %36, %35, %34, %33, %32, %31, %30, %29, %28, %27, %26, %25, %24, %23, %22, %17
%50 = load i8*, i8** %4
ret i8* %50
}

LLVM IR (-O2):
@x86_pci_device_id_to_string.temp_vendor_name = internal global [7 x i8] zeroinitializer
@x86_pci_device_id_to_string.temp_device_name = internal global [7 x i8] zeroinitializer
@.str = [13 x i8] c"Cirrus Logic\00"
@.str.1 = [8 x i8] c"GD 5446\00"
@.str.2 = [18 x i8] c"Intel Corporation\00"
@.str.3 = [36 x i8] c"82540EM Gigabit Ethernet Controller\00"
@.str.4 = [29 x i8] c"440FX - 82441FX PMC [Natoma]\00"
@.str.5 = [31 x i8] c"82801AA AC'97 Audio Controller\00"
@.str.6 = [51 x i8] c"82801FB/FBM/FR/FW/FRW (ICH6 Family) HDA Controller\00"
@.str.7 = [37 x i8] c"82371SB PIIX3 ISA [Natoma/Triton II]\00"
@.str.8 = [37 x i8] c"82371SB PIIX3 IDE [Natoma/Triton II]\00"
@.str.9 = [37 x i8] c"82371SB PIIX3 USB [Natoma/Triton II]\00"
@.str.10 = [25 x i8] c"82371AB/EB/MB PIIX4 ACPI\00"
@.str.11 = [12 x i8] c"Host Bridge\00"
@.str.12 = [14 x i8] c"Legacy Bridge\00"
@.str.13 = [18 x i8] c"PCIe* Root Port 0\00"
@.str.14 = [18 x i8] c"PCIe* Root Port 1\00"
@.str.15 = [23 x i8] c"SDIO / eMMC Controller\00"
@.str.16 = [8 x i8] c"HS-UART\00"
@.str.17 = [15 x i8] c"USB 2.0 Device\00"
@.str.18 = [25 x i8] c"USB OHCI Host Controller\00"
@.str.19 = [16 x i8] c"10/100 Ethernet\00"
@.str.20 = [15 x i8] c"SPI Controller\00"
@.str.21 = [36 x i8] c"I2C* Controller and GPIO Controller\00"
@.str.22 = [7 x i8] c"0x%04x\00"
define i8* @x86_pci_device_id_to_string(i32 %0, i32 %1, i8** writeonly %2) {
%4 = alloca i8*
%5 = bitcast i8** %4 to i8*
%6 = icmp eq i8** %2, null
%7 = select i1 %6, i8** %4, i8** %2
switch i32 %0, label %29 [
i32 4115, label %8
i32 32902, label %10
]
8: ; preds = %3
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %7
%9 = icmp eq i32 %1, 184
br i1 %9, label %33, label %31
10: ; preds = %3
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8** %7
switch i32 %1, label %31 [
i32 4110, label %33
i32 4663, label %11
i32 9237, label %12
i32 9832, label %13
i32 28672, label %14
i32 28688, label %15
i32 28704, label %16
i32 28947, label %17
i32 2392, label %18
i32 2398, label %19
i32 4547, label %20
i32 4548, label %21
i32 2215, label %22
i32 2358, label %23
i32 2361, label %24
i32 2362, label %25
i32 2359, label %26
i32 2357, label %27
i32 2356, label %28
]
11: ; preds = %10
br label %33
12: ; preds = %10
br label %33
13: ; preds = %10
br label %33
14: ; preds = %10
br label %33
15: ; preds = %10
br label %33
16: ; preds = %10
br label %33
17: ; preds = %10
br label %33
18: ; preds = %10
br label %33
19: ; preds = %10
br label %33
20: ; preds = %10
br label %33
21: ; preds = %10
br label %33
22: ; preds = %10
br label %33
23: ; preds = %10
br label %33
24: ; preds = %10
br label %33
25: ; preds = %10
br label %33
26: ; preds = %10
br label %33
27: ; preds = %10
br label %33
28: ; preds = %10
br label %33
29: ; preds = %3
%30 = tail call i32 @snprintf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @x86_pci_device_id_to_string.temp_vendor_name, i64 0, i64 0), i32 7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.22, i64 0, i64 0), i32 %0)
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @x86_pci_device_id_to_string.temp_vendor_name, i64 0, i64 0), i8** %7
br label %31
31: ; preds = %10, %8, %29
%32 = tail call i32 @snprintf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @x86_pci_device_id_to_string.temp_device_name, i64 0, i64 0), i32 7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.22, i64 0, i64 0), i32 %1)
br label %33
33: ; preds = %10, %8, %31, %28, %27, %26, %25, %24, %23, %22, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11
%34 = phi i8* [ getelementptr inbounds ([7 x i8], [7 x i8]* @x86_pci_device_id_to_string.temp_device_name, i64 0, i64 0), %31 ], [ getelementptr inbounds ([36 x i8], [36 x i8]* @.str.21, i64 0, i64 0), %28 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.20, i64 0, i64 0), %27 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.19, i64 0, i64 0), %26 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.18, i64 0, i64 0), %25 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.17, i64 0, i64 0), %24 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0), %23 ], [ getelementptr inbounds ([23 x i8], [23 x i8]* @.str.15, i64 0, i64 0), %22 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str.14, i64 0, i64 0), %21 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str.13, i64 0, i64 0), %20 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.12, i64 0, i64 0), %19 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0), %18 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.10, i64 0, i64 0), %17 ], [ getelementptr inbounds ([37 x i8], [37 x i8]* @.str.9, i64 0, i64 0), %16 ], [ getelementptr inbounds ([37 x i8], [37 x i8]* @.str.8, i64 0, i64 0), %15 ], [ getelementptr inbounds ([37 x i8], [37 x i8]* @.str.7, i64 0, i64 0), %14 ], [ getelementptr inbounds ([51 x i8], [51 x i8]* @.str.6, i64 0, i64 0), %13 ], [ getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), %12 ], [ getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), %11 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), %8 ], [ getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), %10 ]
ret i8* %34
}