#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 */
struct sCC1101PhyInfo {
  int dummy;
};

/* Variables and functions */
unsigned char CC1101GetRegisterWithSpiSyncProblem(struct sCC1101PhyInfo *,
                                                  unsigned char);
int /*<<< orphan*/ CC1101Read(struct sCC1101PhyInfo *, unsigned char,
                              unsigned char *, int);
unsigned char CC1101GetRegister(struct sCC1101PhyInfo *phyInfo,
                                unsigned char address) {
  switch (address) {
  case 0x32u:
  case 0x35u:
  case 0x3Bu:
  case 0x3Au:
  case 0x36u:
  case 0x37u:
    return CC1101GetRegisterWithSpiSyncProblem(phyInfo, address);
  default: {
    unsigned char value;
    CC1101Read(phyInfo, address, &value, 1);
    return value;
  }
  }
}


x86 assembly (clang, -O0):
<CC1101GetRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movzbl -0x11(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0x32,%eax
je     116f <CC1101GetRegister+0x4f>
jmp    1147 <CC1101GetRegister+0x27>
mov    -0x18(%rbp),%eax
add    $0xffffffcb,%eax
sub    $0x3,%eax
jb     116f <CC1101GetRegister+0x4f>
jmp    115b <CC1101GetRegister+0x3b>
mov    -0x18(%rbp),%eax
add    $0xffffffc6,%eax
sub    $0x1,%eax
ja     1184 <CC1101GetRegister+0x64>
jmp    116f <CC1101GetRegister+0x4f>
mov    -0x10(%rbp),%rdi
movzbl -0x11(%rbp),%esi
call   1030 <CC1101GetRegisterWithSpiSyncProblem@plt>
mov    %al,-0x1(%rbp)
jmp    11a0 <CC1101GetRegister+0x80>
mov    -0x10(%rbp),%rdi
lea    -0x12(%rbp),%rdx
mov    $0x1,%ecx
movzbl -0x11(%rbp),%esi
call   1040 <CC1101Read@plt>
mov    -0x12(%rbp),%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CC1101GetRegister>:
cmp    $0x3b,%sil
ja     1141 <CC1101GetRegister+0x21>
mov    %esi,%eax
movabs $0xce4000000000000,%rcx
bt     %rax,%rcx
jae    1141 <CC1101GetRegister+0x21>
movzbl %sil,%esi
jmp    1030 <CC1101GetRegisterWithSpiSyncProblem@plt>
push   %rax
movzbl %sil,%esi
lea    0x7(%rsp),%rdx
mov    $0x1,%ecx
call   1040 <CC1101Read@plt>
mov    0x7(%rsp),%al
pop    %rcx
ret

LLVM IR (-O0):
%struct.sCC1101PhyInfo = type { i32 }
define zeroext i8 @CC1101GetRegister(%struct.sCC1101PhyInfo* %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca %struct.sCC1101PhyInfo*
%5 = alloca i8
%6 = alloca i8
store %struct.sCC1101PhyInfo* %0, %struct.sCC1101PhyInfo** %4
store i8 %1, i8* %5
%7 = load i8, i8* %5
%8 = zext i8 %7 to i32
switch i32 %8, label %13 [
i32 50, label %9
i32 53, label %9
i32 59, label %9
i32 58, label %9
i32 54, label %9
i32 55, label %9
]
9: ; preds = %2, %2, %2, %2, %2, %2
%10 = load %struct.sCC1101PhyInfo*, %struct.sCC1101PhyInfo** %4
%11 = load i8, i8* %5
%12 = call zeroext i8 @CC1101GetRegisterWithSpiSyncProblem(%struct.sCC1101PhyInfo* %10, i8 zeroext %11)
store i8 %12, i8* %3
br label %18
13: ; preds = %2
%14 = load %struct.sCC1101PhyInfo*, %struct.sCC1101PhyInfo** %4
%15 = load i8, i8* %5
%16 = call i32 @CC1101Read(%struct.sCC1101PhyInfo* %14, i8 zeroext %15, i8* %6, i32 1)
%17 = load i8, i8* %6
store i8 %17, i8* %3
br label %18
18: ; preds = %13, %9
%19 = load i8, i8* %3
ret i8 %19
}

LLVM IR (-O2):
%struct.sCC1101PhyInfo = type { i32 }
define zeroext i8 @CC1101GetRegister(%struct.sCC1101PhyInfo* %0, i8 zeroext %1) {
%3 = alloca i8
switch i8 %1, label %6 [
i8 50, label %4
i8 53, label %4
i8 59, label %4
i8 58, label %4
i8 54, label %4
i8 55, label %4
]
4: ; preds = %2, %2, %2, %2, %2, %2
%5 = tail call zeroext i8 @CC1101GetRegisterWithSpiSyncProblem(%struct.sCC1101PhyInfo* %0, i8 zeroext %1)
br label %9
6: ; preds = %2
%7 = call i32 @CC1101Read(%struct.sCC1101PhyInfo* %0, i8 zeroext %1, i8* %3, i32 1)
%8 = load i8, i8* %3
br label %9
9: ; preds = %6, %4
%10 = phi i8 [ %8, %6 ], [ %5, %4 ]
ret i8 %10
}