#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 */
typedef int uint32_t;
typedef char int8_t;

/* Variables and functions */
int8_t flash_read_byte(uint32_t vaddr) {
  int8_t rv = 0x0;
  switch (vaddr) {
  case 0x9f000021:
    rv = 'Q';
    break;
  case 0x9f000023:
    rv = 'R';
    break;
  case 0x9f000025:
    rv = 'Y';
    break;
  case 0x9f000081:
    rv = 'P';
    break;
  case 0x9f000083:
    rv = 'R';
    break;
  case 0x9f000085:
    rv = 'I';
    break;
  default:
    rv = 0x0;
    break;
  }
  return rv;
}


x86 assembly (clang, -O0):
<flash_read_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x9f000021,%eax
je     1180 <flash_read_byte+0x80>
jmp    1121 <flash_read_byte+0x21>
mov    -0xc(%rbp),%eax
sub    $0x9f000023,%eax
je     1189 <flash_read_byte+0x89>
jmp    1134 <flash_read_byte+0x34>
mov    -0xc(%rbp),%eax
sub    $0x9f000025,%eax
je     1192 <flash_read_byte+0x92>
jmp    1147 <flash_read_byte+0x47>
mov    -0xc(%rbp),%eax
sub    $0x9f000081,%eax
je     119b <flash_read_byte+0x9b>
jmp    115a <flash_read_byte+0x5a>
mov    -0xc(%rbp),%eax
sub    $0x9f000083,%eax
je     11a4 <flash_read_byte+0xa4>
jmp    116d <flash_read_byte+0x6d>
mov    -0xc(%rbp),%eax
sub    $0x9f000085,%eax
je     11ad <flash_read_byte+0xad>
jmp    11b6 <flash_read_byte+0xb6>
movb   $0x51,-0x5(%rbp)
jmp    11ba <flash_read_byte+0xba>
movb   $0x52,-0x5(%rbp)
jmp    11ba <flash_read_byte+0xba>
movb   $0x59,-0x5(%rbp)
jmp    11ba <flash_read_byte+0xba>
movb   $0x50,-0x5(%rbp)
jmp    11ba <flash_read_byte+0xba>
movb   $0x52,-0x5(%rbp)
jmp    11ba <flash_read_byte+0xba>
movb   $0x49,-0x5(%rbp)
jmp    11ba <flash_read_byte+0xba>
movb   $0x0,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<flash_read_byte>:
cmp    $0x9f000080,%edi
jg     1123 <flash_read_byte+0x23>
cmp    $0x9f000021,%edi
je     1141 <flash_read_byte+0x41>
cmp    $0x9f000023,%edi
je     113e <flash_read_byte+0x3e>
cmp    $0x9f000025,%edi
jne    1147 <flash_read_byte+0x47>
mov    $0x59,%al
ret
cmp    $0x9f000081,%edi
je     1144 <flash_read_byte+0x44>
cmp    $0x9f000083,%edi
je     113e <flash_read_byte+0x3e>
cmp    $0x9f000085,%edi
jne    1147 <flash_read_byte+0x47>
mov    $0x49,%al
ret
mov    $0x52,%al
ret
mov    $0x51,%al
ret
mov    $0x50,%al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define signext i8 @flash_read_byte(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
store i8 0, i8* %3
%4 = load i32, i32* %2
switch i32 %4, label %11 [
i32 -1627389919, label %5
i32 -1627389917, label %6
i32 -1627389915, label %7
i32 -1627389823, label %8
i32 -1627389821, label %9
i32 -1627389819, label %10
]
5: ; preds = %1
store i8 81, i8* %3
br label %12
6: ; preds = %1
store i8 82, i8* %3
br label %12
7: ; preds = %1
store i8 89, i8* %3
br label %12
8: ; preds = %1
store i8 80, i8* %3
br label %12
9: ; preds = %1
store i8 82, i8* %3
br label %12
10: ; preds = %1
store i8 73, i8* %3
br label %12
11: ; preds = %1
store i8 0, i8* %3
br label %12
12: ; preds = %11, %10, %9, %8, %7, %6, %5
%13 = load i8, i8* %3
ret i8 %13
}

LLVM IR (-O2):
define signext i8 @flash_read_byte(i32 %0) {
switch i32 %0, label %7 [
i32 -1627389919, label %8
i32 -1627389917, label %2
i32 -1627389915, label %3
i32 -1627389823, label %4
i32 -1627389821, label %5
i32 -1627389819, label %6
]
2: ; preds = %1
br label %8
3: ; preds = %1
br label %8
4: ; preds = %1
br label %8
5: ; preds = %1
br label %8
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %1, %7, %6, %5, %4, %3, %2
%9 = phi i8 [ 0, %7 ], [ 73, %6 ], [ 82, %5 ], [ 80, %4 ], [ 89, %3 ], [ 82, %2 ], [ 81, %1 ]
ret i8 %9
}