#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*/ RegWriteA(int, int);
void PwmCareerSet(unsigned char ucMode) {
  switch (ucMode) {
  case 0x00:
  case 0x02:
  case 0x04:
  case 0x05:
  case 0x06:
    RegWriteA(0x0002, 0x90);
    RegWriteA(0x0011, 0x4C);
    RegWriteA(0x0018, 0xE3);
    RegWriteA(0x0019, 0x00);
    RegWriteA(0x001A, 0xE3);
    RegWriteA(0x001B, 0x00);
    RegWriteA(0x001C, 0xC0);
    RegWriteA(0x001D, 0x00);
    RegWriteA(0x001E, 0x00);
    RegWriteA(0x020C, 0x01);
    break;
  case 0x01:
    RegWriteA(0x0002, 0x90);
    RegWriteA(0x0011, 0x3C);
    RegWriteA(0x0018, 0xE3);
    RegWriteA(0x0019, 0x00);
    RegWriteA(0x001A, 0xE3);
    RegWriteA(0x001B, 0x00);
    RegWriteA(0x001C, 0xC0);
    RegWriteA(0x001D, 0x00);
    RegWriteA(0x001E, 0x00);
    RegWriteA(0x020C, 0x01);
    break;
  case 0x03:
    RegWriteA(0x0002, 0x90);
    RegWriteA(0x0011, 0x4C);
    RegWriteA(0x0018, 0xE4);
    RegWriteA(0x0019, 0x00);
    RegWriteA(0x001A, 0xE4);
    RegWriteA(0x001B, 0x00);
    RegWriteA(0x001C, 0xC0);
    RegWriteA(0x001D, 0x00);
    RegWriteA(0x001E, 0x00);
    RegWriteA(0x020C, 0x01);
    break;
  }
}


x86 assembly (clang, -O0):
<PwmCareerSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
test   %eax,%eax
je     1179 <PwmCareerSet+0x69>
jmp    1132 <PwmCareerSet+0x22>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
je     1208 <PwmCareerSet+0xf8>
jmp    1143 <PwmCareerSet+0x33>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
je     1179 <PwmCareerSet+0x69>
jmp    1154 <PwmCareerSet+0x44>
mov    -0x8(%rbp),%eax
sub    $0x3,%eax
je     1297 <PwmCareerSet+0x187>
jmp    1165 <PwmCareerSet+0x55>
mov    -0x8(%rbp),%eax
add    $0xfffffffc,%eax
sub    $0x2,%eax
ja     1321 <PwmCareerSet+0x211>
jmp    1179 <PwmCareerSet+0x69>
mov    $0x2,%edi
mov    $0x90,%esi
call   1030 <RegWriteA@plt>
mov    $0x11,%edi
mov    $0x4c,%esi
call   1030 <RegWriteA@plt>
mov    $0x18,%edi
mov    $0xe3,%esi
call   1030 <RegWriteA@plt>
mov    $0x19,%edi
xor    %esi,%esi
call   1030 <RegWriteA@plt>
mov    $0x1a,%edi
mov    $0xe3,%esi
call   1030 <RegWriteA@plt>
mov    $0x1b,%edi
xor    %esi,%esi
call   1030 <RegWriteA@plt>
mov    $0x1c,%edi
mov    $0xc0,%esi
call   1030 <RegWriteA@plt>
mov    $0x1d,%edi
xor    %esi,%esi
call   1030 <RegWriteA@plt>
mov    $0x1e,%edi
xor    %esi,%esi
call   1030 <RegWriteA@plt>
mov    $0x20c,%edi
mov    $0x1,%esi
call   1030 <RegWriteA@plt>
jmp    1321 <PwmCareerSet+0x211>
mov    $0x2,%edi
mov    $0x90,%esi
call   1030 <RegWriteA@plt>
mov    $0x11,%edi
mov    $0x3c,%esi
call   1030 <RegWriteA@plt>
mov    $0x18,%edi
mov    $0xe3,%esi
call   1030 <RegWriteA@plt>
mov    $0x19,%edi
xor    %esi,%esi
call   1030 <RegWriteA@plt>
mov    $0x1a,%edi
mov    $0xe3,%esi
call   1030 <RegWriteA@plt>
mov    $0x1b,%edi
xor    %esi,%esi
call   1030 <RegWriteA@plt>
mov    $0x1c,%edi
mov    $0xc0,%esi
call   1030 <RegWriteA@plt>
mov    $0x1d,%edi
xor    %esi,%esi
call   1030 <RegWriteA@plt>
mov    $0x1e,%edi
xor    %esi,%esi
call   1030 <RegWriteA@plt>
mov    $0x20c,%edi
mov    $0x1,%esi
call   1030 <RegWriteA@plt>
jmp    1321 <PwmCareerSet+0x211>
mov    $0x2,%edi
mov    $0x90,%esi
call   1030 <RegWriteA@plt>
mov    $0x11,%edi
mov    $0x4c,%esi
call   1030 <RegWriteA@plt>
mov    $0x18,%edi
mov    $0xe4,%esi
call   1030 <RegWriteA@plt>
mov    $0x19,%edi
xor    %esi,%esi
call   1030 <RegWriteA@plt>
mov    $0x1a,%edi
mov    $0xe4,%esi
call   1030 <RegWriteA@plt>
mov    $0x1b,%edi
xor    %esi,%esi
call   1030 <RegWriteA@plt>
mov    $0x1c,%edi
mov    $0xc0,%esi
call   1030 <RegWriteA@plt>
mov    $0x1d,%edi
xor    %esi,%esi
call   1030 <RegWriteA@plt>
mov    $0x1e,%edi
xor    %esi,%esi
call   1030 <RegWriteA@plt>
mov    $0x20c,%edi
mov    $0x1,%esi
call   1030 <RegWriteA@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PwmCareerSet>:
cmp    $0x6,%dil
ja     11bc <PwmCareerSet+0xac>
push   %rbp
push   %rbx
push   %rax
movsbq %dil,%rax
lea    0xed8(%rip),%rcx
mov    (%rcx,%rax,4),%ebx
lea    0xeea(%rip),%rcx
mov    (%rcx,%rax,4),%ebp
mov    $0x2,%edi
mov    $0x90,%esi
call   1030 <RegWriteA@plt>
mov    $0x11,%edi
mov    %ebx,%esi
call   1030 <RegWriteA@plt>
mov    $0x18,%edi
mov    %ebp,%esi
call   1030 <RegWriteA@plt>
mov    $0x19,%edi
xor    %esi,%esi
call   1030 <RegWriteA@plt>
mov    $0x1a,%edi
mov    %ebp,%esi
call   1030 <RegWriteA@plt>
mov    $0x1b,%edi
xor    %esi,%esi
call   1030 <RegWriteA@plt>
mov    $0x1c,%edi
mov    $0xc0,%esi
call   1030 <RegWriteA@plt>
mov    $0x1d,%edi
xor    %esi,%esi
call   1030 <RegWriteA@plt>
mov    $0x1e,%edi
xor    %esi,%esi
call   1030 <RegWriteA@plt>
mov    $0x20c,%edi
mov    $0x1,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <RegWriteA@plt>
ret

LLVM IR (-O0):
define void @PwmCareerSet(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
switch i32 %4, label %38 [
i32 0, label %5
i32 2, label %5
i32 4, label %5
i32 5, label %5
i32 6, label %5
i32 1, label %16
i32 3, label %27
]
5: ; preds = %1, %1, %1, %1, %1
%6 = call i32 @RegWriteA(i32 2, i32 144)
%7 = call i32 @RegWriteA(i32 17, i32 76)
%8 = call i32 @RegWriteA(i32 24, i32 227)
%9 = call i32 @RegWriteA(i32 25, i32 0)
%10 = call i32 @RegWriteA(i32 26, i32 227)
%11 = call i32 @RegWriteA(i32 27, i32 0)
%12 = call i32 @RegWriteA(i32 28, i32 192)
%13 = call i32 @RegWriteA(i32 29, i32 0)
%14 = call i32 @RegWriteA(i32 30, i32 0)
%15 = call i32 @RegWriteA(i32 524, i32 1)
br label %38
16: ; preds = %1
%17 = call i32 @RegWriteA(i32 2, i32 144)
%18 = call i32 @RegWriteA(i32 17, i32 60)
%19 = call i32 @RegWriteA(i32 24, i32 227)
%20 = call i32 @RegWriteA(i32 25, i32 0)
%21 = call i32 @RegWriteA(i32 26, i32 227)
%22 = call i32 @RegWriteA(i32 27, i32 0)
%23 = call i32 @RegWriteA(i32 28, i32 192)
%24 = call i32 @RegWriteA(i32 29, i32 0)
%25 = call i32 @RegWriteA(i32 30, i32 0)
%26 = call i32 @RegWriteA(i32 524, i32 1)
br label %38
27: ; preds = %1
%28 = call i32 @RegWriteA(i32 2, i32 144)
%29 = call i32 @RegWriteA(i32 17, i32 76)
%30 = call i32 @RegWriteA(i32 24, i32 228)
%31 = call i32 @RegWriteA(i32 25, i32 0)
%32 = call i32 @RegWriteA(i32 26, i32 228)
%33 = call i32 @RegWriteA(i32 27, i32 0)
%34 = call i32 @RegWriteA(i32 28, i32 192)
%35 = call i32 @RegWriteA(i32 29, i32 0)
%36 = call i32 @RegWriteA(i32 30, i32 0)
%37 = call i32 @RegWriteA(i32 524, i32 1)
br label %38
38: ; preds = %1, %27, %16, %5
ret void
}

LLVM IR (-O2):
@switch.table.PwmCareerSet = [7 x i32] [i32 76, i32 60, i32 76, i32 76, i32 76, i32 76, i32 76]
@switch.table.PwmCareerSet.1 = [7 x i32] [i32 227, i32 227, i32 227, i32 228, i32 227, i32 227, i32 227]
define void @PwmCareerSet(i8 zeroext %0) {
%2 = icmp ult i8 %0, 7
br i1 %2, label %3, label %20
3: ; preds = %1
%4 = sext i8 %0 to i64
%5 = getelementptr inbounds [7 x i32], [7 x i32]* @switch.table.PwmCareerSet, i64 0, i64 %4
%6 = load i32, i32* %5
%7 = sext i8 %0 to i64
%8 = getelementptr inbounds [7 x i32], [7 x i32]* @switch.table.PwmCareerSet.1, i64 0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @RegWriteA(i32 2, i32 144)
%11 = tail call i32 @RegWriteA(i32 17, i32 %6)
%12 = tail call i32 @RegWriteA(i32 24, i32 %9)
%13 = tail call i32 @RegWriteA(i32 25, i32 0)
%14 = tail call i32 @RegWriteA(i32 26, i32 %9)
%15 = tail call i32 @RegWriteA(i32 27, i32 0)
%16 = tail call i32 @RegWriteA(i32 28, i32 192)
%17 = tail call i32 @RegWriteA(i32 29, i32 0)
%18 = tail call i32 @RegWriteA(i32 30, i32 0)
%19 = tail call i32 @RegWriteA(i32 524, i32 1)
br label %20
20: ; preds = %1, %3
ret void
}