#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*/ AfDrvSw(int);
int /*<<< orphan*/ DrvSw(int);
int /*<<< orphan*/ GyOutSignalCont();
int /*<<< orphan*/ RegReadA(int, unsigned char *);
int /*<<< orphan*/ RegWriteA(int, unsigned char);
int /*<<< orphan*/ SelectGySleep(int);
void SetStandby(unsigned char UcContMode) {
  unsigned char UcStbb0, UcClkon;
  switch (UcContMode) {
  case 0x00:
    RegWriteA(0x0081, 0x00);
    RegWriteA(0x0250, 0x00);
    RegWriteA(0x0264, 0x00);
    RegWriteA(0x0010, 0x00);
    RegWriteA(0x0090, 0x00);
    RegWriteA(0x0020, 0x00);
    DrvSw(0x00);
    AfDrvSw(0x00);
    SelectGySleep(0x01);
    break;
  case 0x01:
    SelectGySleep(0x00);
    DrvSw(0x01);
    AfDrvSw(0x01);
    RegWriteA(0x0020, 0xC0);
    RegWriteA(0x0090, 0x00);
    RegWriteA(0x0010, 0xC0);
    RegWriteA(0x0264, 0x05);
    RegWriteA(0x0250, 0xFF);
    break;
  case 0x02:
    RegWriteA(0x0081, 0x00);
    RegWriteA(0x0250, 0x00);
    RegWriteA(0x0264, 0x00);
    RegWriteA(0x0010, 0x00);
    RegWriteA(0x0090, 0x00);
    RegWriteA(0x0020, 0x00);
    DrvSw(0x00);
    AfDrvSw(0x00);
    SelectGySleep(0x01);
    RegWriteA(0x020B, 0x00);
    break;
  case 0x03:
    RegWriteA(0x020B, 0x1F);
    SelectGySleep(0x00);
    DrvSw(0x01);
    AfDrvSw(0x01);
    RegWriteA(0x0020, 0xC0);
    RegWriteA(0x0090, 0x00);
    RegWriteA(0x0010, 0xC0);
    RegWriteA(0x0264, 0x05);
    RegWriteA(0x0250, 0xFF);
    break;
  case 0x04:
    RegWriteA(0x0081, 0x00);
    RegWriteA(0x0250, 0x00);
    RegWriteA(0x0264, 0x00);
    RegWriteA(0x0010, 0x00);
    RegWriteA(0x0090, 0x00);
    RegWriteA(0x0020, 0x00);
    DrvSw(0x00);
    AfDrvSw(0x00);
    SelectGySleep(0x01);
    RegWriteA(0x020B, 0x00);
    RegWriteA(0x0248, 0x01);
    RegWriteA(0x0256, 0x02);
    break;
  case 0x05:
    RegWriteA(0x0256, 0x00);
    RegWriteA(0x0248, 0x00);
    RegWriteA(0x020B, 0x1F);
    SelectGySleep(0x00);
    DrvSw(0x01);
    AfDrvSw(0x01);
    RegWriteA(0x0020, 0xC0);
    RegWriteA(0x0090, 0x00);
    RegWriteA(0x0010, 0xC0);
    RegWriteA(0x0264, 0x05);
    RegWriteA(0x0250, 0xFF);
    break;
  case 0x06:
    RegWriteA(0x0081, 0x00);
    RegWriteA(0x0250, 0x00);
    RegWriteA(0x0264, 0x00);
    RegWriteA(0x0010, 0x00);
    RegWriteA(0x0090, 0x00);
    RegWriteA(0x0020, 0x00);
    DrvSw(0x00);
    AfDrvSw(0x00);
    GyOutSignalCont();
    RegWriteA(0x020B, 0x04);
    break;
  case 0x07:
    RegWriteA(0x020B, 0x1F);
    SelectGySleep(0x00);
    DrvSw(0x01);
    AfDrvSw(0x01);
    RegWriteA(0x0020, 0xC0);
    RegWriteA(0x0090, 0x00);
    RegWriteA(0x0010, 0xC0);
    RegWriteA(0x0264, 0x05);
    RegWriteA(0x0250, 0xFF);
    break;
  case 0x08:
    RegReadA(0x0250, &UcStbb0);
    UcStbb0 &= 0xA0;
    RegWriteA(0x0250, UcStbb0);
    RegWriteA(0x0010, 0x00);
    RegWriteA(0x0020, 0x00);
    DrvSw(0x00);
    SelectGySleep(0x01);
    RegReadA(0x020B, &UcClkon);
    UcClkon &= 0x1A;
    RegWriteA(0x020B, UcClkon);
    break;
  case 0x09:
    RegReadA(0x020B, &UcClkon);
    UcClkon |= 0x05;
    RegWriteA(0x020B, UcClkon);
    SelectGySleep(0x00);
    DrvSw(0x01);
    RegWriteA(0x0020, 0xC0);
    RegWriteA(0x0010, 0xC0);
    RegReadA(0x0250, &UcStbb0);
    UcStbb0 |= 0x5F;
    RegWriteA(0x0250, UcStbb0);
    break;
  case 0x0A:
    RegWriteA(0x0081, 0x00);
    RegReadA(0x0250, &UcStbb0);
    UcStbb0 &= 0x5F;
    RegWriteA(0x0250, UcStbb0);
    RegWriteA(0x0264, 0x00);
    RegWriteA(0x0090, 0x00);
    AfDrvSw(0x00);
    RegReadA(0x020B, &UcClkon);
    UcClkon &= 0x07;
    RegWriteA(0x020B, UcClkon);
    break;
  case 0x0B:
    RegReadA(0x020B, &UcClkon);
    UcClkon |= 0x18;
    RegWriteA(0x020B, UcClkon);
    AfDrvSw(0x01);
    RegWriteA(0x0090, 0x00);
    RegWriteA(0x0264, 0x05);
    RegReadA(0x0250, &UcStbb0);
    UcStbb0 |= 0xA0;
    RegWriteA(0x0250, UcStbb0);
    break;
  }
}


x86 assembly (clang, -O0):
<SetStandby>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0xb,%rax
ja     173a <SetStandby+0x5da>
mov    -0x10(%rbp),%rax
lea    0xe75(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x81,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x250,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x264,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x10,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x90,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x20,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
xor    %edi,%edi
call   1050 <DrvSw@plt>
xor    %edi,%edi
call   1030 <AfDrvSw@plt>
mov    $0x1,%edi
call   1040 <SelectGySleep@plt>
jmp    173a <SetStandby+0x5da>
xor    %edi,%edi
call   1040 <SelectGySleep@plt>
mov    $0x1,%edi
call   1050 <DrvSw@plt>
mov    $0x1,%edi
call   1030 <AfDrvSw@plt>
mov    $0x20,%edi
mov    $0xc0,%esi
call   1070 <RegWriteA@plt>
mov    $0x90,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x10,%edi
mov    $0xc0,%esi
call   1070 <RegWriteA@plt>
mov    $0x264,%edi
mov    $0x5,%esi
call   1070 <RegWriteA@plt>
mov    $0x250,%edi
mov    $0xff,%esi
call   1070 <RegWriteA@plt>
jmp    173a <SetStandby+0x5da>
mov    $0x81,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x250,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x264,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x10,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x90,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x20,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
xor    %edi,%edi
call   1050 <DrvSw@plt>
xor    %edi,%edi
call   1030 <AfDrvSw@plt>
mov    $0x1,%edi
call   1040 <SelectGySleep@plt>
mov    $0x20b,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
jmp    173a <SetStandby+0x5da>
mov    $0x20b,%edi
mov    $0x1f,%esi
call   1070 <RegWriteA@plt>
xor    %edi,%edi
call   1040 <SelectGySleep@plt>
mov    $0x1,%edi
call   1050 <DrvSw@plt>
mov    $0x1,%edi
call   1030 <AfDrvSw@plt>
mov    $0x20,%edi
mov    $0xc0,%esi
call   1070 <RegWriteA@plt>
mov    $0x90,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x10,%edi
mov    $0xc0,%esi
call   1070 <RegWriteA@plt>
mov    $0x264,%edi
mov    $0x5,%esi
call   1070 <RegWriteA@plt>
mov    $0x250,%edi
mov    $0xff,%esi
call   1070 <RegWriteA@plt>
jmp    173a <SetStandby+0x5da>
mov    $0x81,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x250,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x264,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x10,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x90,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x20,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
xor    %edi,%edi
call   1050 <DrvSw@plt>
xor    %edi,%edi
call   1030 <AfDrvSw@plt>
mov    $0x1,%edi
call   1040 <SelectGySleep@plt>
mov    $0x20b,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x248,%edi
mov    $0x1,%esi
call   1070 <RegWriteA@plt>
mov    $0x256,%edi
mov    $0x2,%esi
call   1070 <RegWriteA@plt>
jmp    173a <SetStandby+0x5da>
mov    $0x256,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x248,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x20b,%edi
mov    $0x1f,%esi
call   1070 <RegWriteA@plt>
xor    %edi,%edi
call   1040 <SelectGySleep@plt>
mov    $0x1,%edi
call   1050 <DrvSw@plt>
mov    $0x1,%edi
call   1030 <AfDrvSw@plt>
mov    $0x20,%edi
mov    $0xc0,%esi
call   1070 <RegWriteA@plt>
mov    $0x90,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x10,%edi
mov    $0xc0,%esi
call   1070 <RegWriteA@plt>
mov    $0x264,%edi
mov    $0x5,%esi
call   1070 <RegWriteA@plt>
mov    $0x250,%edi
mov    $0xff,%esi
call   1070 <RegWriteA@plt>
jmp    173a <SetStandby+0x5da>
mov    $0x81,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x250,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x264,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x10,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x90,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x20,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
xor    %edi,%edi
call   1050 <DrvSw@plt>
xor    %edi,%edi
call   1030 <AfDrvSw@plt>
mov    $0x0,%al
call   1080 <GyOutSignalCont@plt>
mov    $0x20b,%edi
mov    $0x4,%esi
call   1070 <RegWriteA@plt>
jmp    173a <SetStandby+0x5da>
mov    $0x20b,%edi
mov    $0x1f,%esi
call   1070 <RegWriteA@plt>
xor    %edi,%edi
call   1040 <SelectGySleep@plt>
mov    $0x1,%edi
call   1050 <DrvSw@plt>
mov    $0x1,%edi
call   1030 <AfDrvSw@plt>
mov    $0x20,%edi
mov    $0xc0,%esi
call   1070 <RegWriteA@plt>
mov    $0x90,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x10,%edi
mov    $0xc0,%esi
call   1070 <RegWriteA@plt>
mov    $0x264,%edi
mov    $0x5,%esi
call   1070 <RegWriteA@plt>
mov    $0x250,%edi
mov    $0xff,%esi
call   1070 <RegWriteA@plt>
jmp    173a <SetStandby+0x5da>
mov    $0x250,%edi
lea    -0x2(%rbp),%rsi
call   1060 <RegReadA@plt>
movzbl -0x2(%rbp),%eax
and    $0xa0,%eax
mov    %al,-0x2(%rbp)
mov    $0x250,%edi
movzbl -0x2(%rbp),%esi
call   1070 <RegWriteA@plt>
mov    $0x10,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x20,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
xor    %edi,%edi
call   1050 <DrvSw@plt>
mov    $0x1,%edi
call   1040 <SelectGySleep@plt>
mov    $0x20b,%edi
lea    -0x3(%rbp),%rsi
call   1060 <RegReadA@plt>
movzbl -0x3(%rbp),%eax
and    $0x1a,%eax
mov    %al,-0x3(%rbp)
mov    $0x20b,%edi
movzbl -0x3(%rbp),%esi
call   1070 <RegWriteA@plt>
jmp    173a <SetStandby+0x5da>
mov    $0x20b,%edi
lea    -0x3(%rbp),%rsi
call   1060 <RegReadA@plt>
movzbl -0x3(%rbp),%eax
or     $0x5,%eax
mov    %al,-0x3(%rbp)
mov    $0x20b,%edi
movzbl -0x3(%rbp),%esi
call   1070 <RegWriteA@plt>
xor    %edi,%edi
call   1040 <SelectGySleep@plt>
mov    $0x1,%edi
call   1050 <DrvSw@plt>
mov    $0x20,%edi
mov    $0xc0,%esi
call   1070 <RegWriteA@plt>
mov    $0x10,%edi
mov    $0xc0,%esi
call   1070 <RegWriteA@plt>
mov    $0x250,%edi
lea    -0x2(%rbp),%rsi
call   1060 <RegReadA@plt>
movzbl -0x2(%rbp),%eax
or     $0x5f,%eax
mov    %al,-0x2(%rbp)
mov    $0x250,%edi
movzbl -0x2(%rbp),%esi
call   1070 <RegWriteA@plt>
jmp    173a <SetStandby+0x5da>
mov    $0x81,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x250,%edi
lea    -0x2(%rbp),%rsi
call   1060 <RegReadA@plt>
movzbl -0x2(%rbp),%eax
and    $0x5f,%eax
mov    %al,-0x2(%rbp)
mov    $0x250,%edi
movzbl -0x2(%rbp),%esi
call   1070 <RegWriteA@plt>
mov    $0x264,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x90,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
xor    %edi,%edi
call   1030 <AfDrvSw@plt>
mov    $0x20b,%edi
lea    -0x3(%rbp),%rsi
call   1060 <RegReadA@plt>
movzbl -0x3(%rbp),%eax
and    $0x7,%eax
mov    %al,-0x3(%rbp)
mov    $0x20b,%edi
movzbl -0x3(%rbp),%esi
call   1070 <RegWriteA@plt>
jmp    173a <SetStandby+0x5da>
mov    $0x20b,%edi
lea    -0x3(%rbp),%rsi
call   1060 <RegReadA@plt>
movzbl -0x3(%rbp),%eax
or     $0x18,%eax
mov    %al,-0x3(%rbp)
mov    $0x20b,%edi
movzbl -0x3(%rbp),%esi
call   1070 <RegWriteA@plt>
mov    $0x1,%edi
call   1030 <AfDrvSw@plt>
mov    $0x90,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x264,%edi
mov    $0x5,%esi
call   1070 <RegWriteA@plt>
mov    $0x250,%edi
lea    -0x2(%rbp),%rsi
call   1060 <RegReadA@plt>
movzbl -0x2(%rbp),%eax
or     $0xa0,%eax
mov    %al,-0x2(%rbp)
mov    $0x250,%edi
movzbl -0x2(%rbp),%esi
call   1070 <RegWriteA@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetStandby>:
push   %rax
cmp    $0xb,%dil
ja     1592 <SetStandby+0x432>
mov    %edi,%eax
lea    0xe8c(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x81,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x250,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x264,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x10,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x90,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x20,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
xor    %edi,%edi
call   1050 <DrvSw@plt>
xor    %edi,%edi
call   1030 <AfDrvSw@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <SelectGySleep@plt>
mov    $0x81,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x250,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x264,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x10,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x90,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x20,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
xor    %edi,%edi
call   1050 <DrvSw@plt>
xor    %edi,%edi
call   1030 <AfDrvSw@plt>
mov    $0x1,%edi
call   1040 <SelectGySleep@plt>
mov    $0x20b,%edi
xor    %esi,%esi
pop    %rax
jmp    1070 <RegWriteA@plt>
mov    $0x81,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x250,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x264,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x10,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x90,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x20,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
xor    %edi,%edi
call   1050 <DrvSw@plt>
xor    %edi,%edi
call   1030 <AfDrvSw@plt>
mov    $0x1,%edi
call   1040 <SelectGySleep@plt>
mov    $0x20b,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x248,%edi
mov    $0x1,%esi
call   1070 <RegWriteA@plt>
mov    $0x256,%edi
mov    $0x2,%esi
pop    %rax
jmp    1070 <RegWriteA@plt>
mov    $0x256,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x248,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x20b,%edi
mov    $0x1f,%esi
call   1070 <RegWriteA@plt>
xor    %edi,%edi
call   1040 <SelectGySleep@plt>
mov    $0x1,%edi
call   1050 <DrvSw@plt>
mov    $0x1,%edi
call   1030 <AfDrvSw@plt>
mov    $0x20,%edi
mov    $0xc0,%esi
call   1070 <RegWriteA@plt>
mov    $0x90,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x10,%edi
mov    $0xc0,%esi
call   1070 <RegWriteA@plt>
mov    $0x264,%edi
mov    $0x5,%esi
call   1070 <RegWriteA@plt>
mov    $0x250,%edi
mov    $0xff,%esi
pop    %rax
jmp    1070 <RegWriteA@plt>
mov    $0x81,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x250,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x264,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x10,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x90,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x20,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
xor    %edi,%edi
call   1050 <DrvSw@plt>
xor    %edi,%edi
call   1030 <AfDrvSw@plt>
xor    %eax,%eax
call   1080 <GyOutSignalCont@plt>
mov    $0x20b,%edi
mov    $0x4,%esi
pop    %rax
jmp    1070 <RegWriteA@plt>
lea    0x7(%rsp),%rsi
mov    $0x250,%edi
call   1060 <RegReadA@plt>
movzbl 0x7(%rsp),%esi
and    $0xffffffa0,%esi
mov    %sil,0x7(%rsp)
mov    $0x250,%edi
call   1070 <RegWriteA@plt>
mov    $0x10,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x20,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
xor    %edi,%edi
call   1050 <DrvSw@plt>
mov    $0x1,%edi
call   1040 <SelectGySleep@plt>
lea    0x6(%rsp),%rsi
mov    $0x20b,%edi
call   1060 <RegReadA@plt>
movzbl 0x6(%rsp),%esi
and    $0x1a,%esi
jmp    1512 <SetStandby+0x3b2>
lea    0x6(%rsp),%rsi
mov    $0x20b,%edi
call   1060 <RegReadA@plt>
movzbl 0x6(%rsp),%esi
or     $0x5,%esi
mov    %sil,0x6(%rsp)
mov    $0x20b,%edi
call   1070 <RegWriteA@plt>
xor    %edi,%edi
call   1040 <SelectGySleep@plt>
mov    $0x1,%edi
call   1050 <DrvSw@plt>
mov    $0x20,%edi
mov    $0xc0,%esi
call   1070 <RegWriteA@plt>
mov    $0x10,%edi
mov    $0xc0,%esi
call   1070 <RegWriteA@plt>
lea    0x7(%rsp),%rsi
mov    $0x250,%edi
call   1060 <RegReadA@plt>
movzbl 0x7(%rsp),%esi
or     $0x5f,%esi
jmp    1583 <SetStandby+0x423>
mov    $0x81,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
lea    0x7(%rsp),%rsi
mov    $0x250,%edi
call   1060 <RegReadA@plt>
movzbl 0x7(%rsp),%esi
and    $0x5f,%esi
mov    %sil,0x7(%rsp)
mov    $0x250,%edi
call   1070 <RegWriteA@plt>
mov    $0x264,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x90,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
xor    %edi,%edi
call   1030 <AfDrvSw@plt>
lea    0x6(%rsp),%rsi
mov    $0x20b,%edi
call   1060 <RegReadA@plt>
movzbl 0x6(%rsp),%esi
and    $0x7,%esi
mov    %sil,0x6(%rsp)
mov    $0x20b,%edi
jmp    158d <SetStandby+0x42d>
lea    0x6(%rsp),%rsi
mov    $0x20b,%edi
call   1060 <RegReadA@plt>
movzbl 0x6(%rsp),%esi
or     $0x18,%esi
mov    %sil,0x6(%rsp)
mov    $0x20b,%edi
call   1070 <RegWriteA@plt>
mov    $0x1,%edi
call   1030 <AfDrvSw@plt>
mov    $0x90,%edi
xor    %esi,%esi
call   1070 <RegWriteA@plt>
mov    $0x264,%edi
mov    $0x5,%esi
call   1070 <RegWriteA@plt>
lea    0x7(%rsp),%rsi
mov    $0x250,%edi
call   1060 <RegReadA@plt>
movzbl 0x7(%rsp),%esi
or     $0xa0,%esi
mov    %sil,0x7(%rsp)
mov    $0x250,%edi
call   1070 <RegWriteA@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @SetStandby(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %2
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
switch i32 %6, label %168 [
i32 0, label %7
i32 1, label %17
i32 2, label %26
i32 3, label %37
i32 4, label %47
i32 5, label %60
i32 6, label %72
i32 7, label %83
i32 8, label %93
i32 9, label %112
i32 10, label %131
i32 11, label %150
]
7: ; preds = %1
%8 = call i32 @RegWriteA(i32 129, i8 zeroext 0)
%9 = call i32 @RegWriteA(i32 592, i8 zeroext 0)
%10 = call i32 @RegWriteA(i32 612, i8 zeroext 0)
%11 = call i32 @RegWriteA(i32 16, i8 zeroext 0)
%12 = call i32 @RegWriteA(i32 144, i8 zeroext 0)
%13 = call i32 @RegWriteA(i32 32, i8 zeroext 0)
%14 = call i32 @DrvSw(i32 0)
%15 = call i32 @AfDrvSw(i32 0)
%16 = call i32 @SelectGySleep(i32 1)
br label %168
17: ; preds = %1
%18 = call i32 @SelectGySleep(i32 0)
%19 = call i32 @DrvSw(i32 1)
%20 = call i32 @AfDrvSw(i32 1)
%21 = call i32 @RegWriteA(i32 32, i8 zeroext -64)
%22 = call i32 @RegWriteA(i32 144, i8 zeroext 0)
%23 = call i32 @RegWriteA(i32 16, i8 zeroext -64)
%24 = call i32 @RegWriteA(i32 612, i8 zeroext 5)
%25 = call i32 @RegWriteA(i32 592, i8 zeroext -1)
br label %168
26: ; preds = %1
%27 = call i32 @RegWriteA(i32 129, i8 zeroext 0)
%28 = call i32 @RegWriteA(i32 592, i8 zeroext 0)
%29 = call i32 @RegWriteA(i32 612, i8 zeroext 0)
%30 = call i32 @RegWriteA(i32 16, i8 zeroext 0)
%31 = call i32 @RegWriteA(i32 144, i8 zeroext 0)
%32 = call i32 @RegWriteA(i32 32, i8 zeroext 0)
%33 = call i32 @DrvSw(i32 0)
%34 = call i32 @AfDrvSw(i32 0)
%35 = call i32 @SelectGySleep(i32 1)
%36 = call i32 @RegWriteA(i32 523, i8 zeroext 0)
br label %168
37: ; preds = %1
%38 = call i32 @RegWriteA(i32 523, i8 zeroext 31)
%39 = call i32 @SelectGySleep(i32 0)
%40 = call i32 @DrvSw(i32 1)
%41 = call i32 @AfDrvSw(i32 1)
%42 = call i32 @RegWriteA(i32 32, i8 zeroext -64)
%43 = call i32 @RegWriteA(i32 144, i8 zeroext 0)
%44 = call i32 @RegWriteA(i32 16, i8 zeroext -64)
%45 = call i32 @RegWriteA(i32 612, i8 zeroext 5)
%46 = call i32 @RegWriteA(i32 592, i8 zeroext -1)
br label %168
47: ; preds = %1
%48 = call i32 @RegWriteA(i32 129, i8 zeroext 0)
%49 = call i32 @RegWriteA(i32 592, i8 zeroext 0)
%50 = call i32 @RegWriteA(i32 612, i8 zeroext 0)
%51 = call i32 @RegWriteA(i32 16, i8 zeroext 0)
%52 = call i32 @RegWriteA(i32 144, i8 zeroext 0)
%53 = call i32 @RegWriteA(i32 32, i8 zeroext 0)
%54 = call i32 @DrvSw(i32 0)
%55 = call i32 @AfDrvSw(i32 0)
%56 = call i32 @SelectGySleep(i32 1)
%57 = call i32 @RegWriteA(i32 523, i8 zeroext 0)
%58 = call i32 @RegWriteA(i32 584, i8 zeroext 1)
%59 = call i32 @RegWriteA(i32 598, i8 zeroext 2)
br label %168
60: ; preds = %1
%61 = call i32 @RegWriteA(i32 598, i8 zeroext 0)
%62 = call i32 @RegWriteA(i32 584, i8 zeroext 0)
%63 = call i32 @RegWriteA(i32 523, i8 zeroext 31)
%64 = call i32 @SelectGySleep(i32 0)
%65 = call i32 @DrvSw(i32 1)
%66 = call i32 @AfDrvSw(i32 1)
%67 = call i32 @RegWriteA(i32 32, i8 zeroext -64)
%68 = call i32 @RegWriteA(i32 144, i8 zeroext 0)
%69 = call i32 @RegWriteA(i32 16, i8 zeroext -64)
%70 = call i32 @RegWriteA(i32 612, i8 zeroext 5)
%71 = call i32 @RegWriteA(i32 592, i8 zeroext -1)
br label %168
72: ; preds = %1
%73 = call i32 @RegWriteA(i32 129, i8 zeroext 0)
%74 = call i32 @RegWriteA(i32 592, i8 zeroext 0)
%75 = call i32 @RegWriteA(i32 612, i8 zeroext 0)
%76 = call i32 @RegWriteA(i32 16, i8 zeroext 0)
%77 = call i32 @RegWriteA(i32 144, i8 zeroext 0)
%78 = call i32 @RegWriteA(i32 32, i8 zeroext 0)
%79 = call i32 @DrvSw(i32 0)
%80 = call i32 @AfDrvSw(i32 0)
%81 = call i32 (...) @GyOutSignalCont()
%82 = call i32 @RegWriteA(i32 523, i8 zeroext 4)
br label %168
83: ; preds = %1
%84 = call i32 @RegWriteA(i32 523, i8 zeroext 31)
%85 = call i32 @SelectGySleep(i32 0)
%86 = call i32 @DrvSw(i32 1)
%87 = call i32 @AfDrvSw(i32 1)
%88 = call i32 @RegWriteA(i32 32, i8 zeroext -64)
%89 = call i32 @RegWriteA(i32 144, i8 zeroext 0)
%90 = call i32 @RegWriteA(i32 16, i8 zeroext -64)
%91 = call i32 @RegWriteA(i32 612, i8 zeroext 5)
%92 = call i32 @RegWriteA(i32 592, i8 zeroext -1)
br label %168
93: ; preds = %1
%94 = call i32 @RegReadA(i32 592, i8* %3)
%95 = load i8, i8* %3
%96 = zext i8 %95 to i32
%97 = and i32 %96, 160
%98 = trunc i32 %97 to i8
store i8 %98, i8* %3
%99 = load i8, i8* %3
%100 = call i32 @RegWriteA(i32 592, i8 zeroext %99)
%101 = call i32 @RegWriteA(i32 16, i8 zeroext 0)
%102 = call i32 @RegWriteA(i32 32, i8 zeroext 0)
%103 = call i32 @DrvSw(i32 0)
%104 = call i32 @SelectGySleep(i32 1)
%105 = call i32 @RegReadA(i32 523, i8* %4)
%106 = load i8, i8* %4
%107 = zext i8 %106 to i32
%108 = and i32 %107, 26
%109 = trunc i32 %108 to i8
store i8 %109, i8* %4
%110 = load i8, i8* %4
%111 = call i32 @RegWriteA(i32 523, i8 zeroext %110)
br label %168
112: ; preds = %1
%113 = call i32 @RegReadA(i32 523, i8* %4)
%114 = load i8, i8* %4
%115 = zext i8 %114 to i32
%116 = or i32 %115, 5
%117 = trunc i32 %116 to i8
store i8 %117, i8* %4
%118 = load i8, i8* %4
%119 = call i32 @RegWriteA(i32 523, i8 zeroext %118)
%120 = call i32 @SelectGySleep(i32 0)
%121 = call i32 @DrvSw(i32 1)
%122 = call i32 @RegWriteA(i32 32, i8 zeroext -64)
%123 = call i32 @RegWriteA(i32 16, i8 zeroext -64)
%124 = call i32 @RegReadA(i32 592, i8* %3)
%125 = load i8, i8* %3
%126 = zext i8 %125 to i32
%127 = or i32 %126, 95
%128 = trunc i32 %127 to i8
store i8 %128, i8* %3
%129 = load i8, i8* %3
%130 = call i32 @RegWriteA(i32 592, i8 zeroext %129)
br label %168
131: ; preds = %1
%132 = call i32 @RegWriteA(i32 129, i8 zeroext 0)
%133 = call i32 @RegReadA(i32 592, i8* %3)
%134 = load i8, i8* %3
%135 = zext i8 %134 to i32
%136 = and i32 %135, 95
%137 = trunc i32 %136 to i8
store i8 %137, i8* %3
%138 = load i8, i8* %3
%139 = call i32 @RegWriteA(i32 592, i8 zeroext %138)
%140 = call i32 @RegWriteA(i32 612, i8 zeroext 0)
%141 = call i32 @RegWriteA(i32 144, i8 zeroext 0)
%142 = call i32 @AfDrvSw(i32 0)
%143 = call i32 @RegReadA(i32 523, i8* %4)
%144 = load i8, i8* %4
%145 = zext i8 %144 to i32
%146 = and i32 %145, 7
%147 = trunc i32 %146 to i8
store i8 %147, i8* %4
%148 = load i8, i8* %4
%149 = call i32 @RegWriteA(i32 523, i8 zeroext %148)
br label %168
150: ; preds = %1
%151 = call i32 @RegReadA(i32 523, i8* %4)
%152 = load i8, i8* %4
%153 = zext i8 %152 to i32
%154 = or i32 %153, 24
%155 = trunc i32 %154 to i8
store i8 %155, i8* %4
%156 = load i8, i8* %4
%157 = call i32 @RegWriteA(i32 523, i8 zeroext %156)
%158 = call i32 @AfDrvSw(i32 1)
%159 = call i32 @RegWriteA(i32 144, i8 zeroext 0)
%160 = call i32 @RegWriteA(i32 612, i8 zeroext 5)
%161 = call i32 @RegReadA(i32 592, i8* %3)
%162 = load i8, i8* %3
%163 = zext i8 %162 to i32
%164 = or i32 %163, 160
%165 = trunc i32 %164 to i8
store i8 %165, i8* %3
%166 = load i8, i8* %3
%167 = call i32 @RegWriteA(i32 592, i8 zeroext %166)
br label %168
168: ; preds = %1, %150, %131, %112, %93, %83, %72, %60, %47, %37, %26, %17, %7
ret void
}

LLVM IR (-O2):
define void @SetStandby(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
switch i8 %0, label %141 [
i8 0, label %4
i8 1, label %14
i8 2, label %23
i8 3, label %34
i8 4, label %44
i8 5, label %57
i8 6, label %69
i8 7, label %80
i8 8, label %90
i8 9, label %103
i8 10, label %116
i8 11, label %129
]
4: ; preds = %1
%5 = tail call i32 @RegWriteA(i32 129, i8 zeroext 0)
%6 = tail call i32 @RegWriteA(i32 592, i8 zeroext 0)
%7 = tail call i32 @RegWriteA(i32 612, i8 zeroext 0)
%8 = tail call i32 @RegWriteA(i32 16, i8 zeroext 0)
%9 = tail call i32 @RegWriteA(i32 144, i8 zeroext 0)
%10 = tail call i32 @RegWriteA(i32 32, i8 zeroext 0)
%11 = tail call i32 @DrvSw(i32 0)
%12 = tail call i32 @AfDrvSw(i32 0)
%13 = tail call i32 @SelectGySleep(i32 1)
br label %141
14: ; preds = %1
%15 = tail call i32 @SelectGySleep(i32 0)
%16 = tail call i32 @DrvSw(i32 1)
%17 = tail call i32 @AfDrvSw(i32 1)
%18 = tail call i32 @RegWriteA(i32 32, i8 zeroext -64)
%19 = tail call i32 @RegWriteA(i32 144, i8 zeroext 0)
%20 = tail call i32 @RegWriteA(i32 16, i8 zeroext -64)
%21 = tail call i32 @RegWriteA(i32 612, i8 zeroext 5)
%22 = tail call i32 @RegWriteA(i32 592, i8 zeroext -1)
br label %141
23: ; preds = %1
%24 = tail call i32 @RegWriteA(i32 129, i8 zeroext 0)
%25 = tail call i32 @RegWriteA(i32 592, i8 zeroext 0)
%26 = tail call i32 @RegWriteA(i32 612, i8 zeroext 0)
%27 = tail call i32 @RegWriteA(i32 16, i8 zeroext 0)
%28 = tail call i32 @RegWriteA(i32 144, i8 zeroext 0)
%29 = tail call i32 @RegWriteA(i32 32, i8 zeroext 0)
%30 = tail call i32 @DrvSw(i32 0)
%31 = tail call i32 @AfDrvSw(i32 0)
%32 = tail call i32 @SelectGySleep(i32 1)
%33 = tail call i32 @RegWriteA(i32 523, i8 zeroext 0)
br label %141
34: ; preds = %1
%35 = tail call i32 @RegWriteA(i32 523, i8 zeroext 31)
%36 = tail call i32 @SelectGySleep(i32 0)
%37 = tail call i32 @DrvSw(i32 1)
%38 = tail call i32 @AfDrvSw(i32 1)
%39 = tail call i32 @RegWriteA(i32 32, i8 zeroext -64)
%40 = tail call i32 @RegWriteA(i32 144, i8 zeroext 0)
%41 = tail call i32 @RegWriteA(i32 16, i8 zeroext -64)
%42 = tail call i32 @RegWriteA(i32 612, i8 zeroext 5)
%43 = tail call i32 @RegWriteA(i32 592, i8 zeroext -1)
br label %141
44: ; preds = %1
%45 = tail call i32 @RegWriteA(i32 129, i8 zeroext 0)
%46 = tail call i32 @RegWriteA(i32 592, i8 zeroext 0)
%47 = tail call i32 @RegWriteA(i32 612, i8 zeroext 0)
%48 = tail call i32 @RegWriteA(i32 16, i8 zeroext 0)
%49 = tail call i32 @RegWriteA(i32 144, i8 zeroext 0)
%50 = tail call i32 @RegWriteA(i32 32, i8 zeroext 0)
%51 = tail call i32 @DrvSw(i32 0)
%52 = tail call i32 @AfDrvSw(i32 0)
%53 = tail call i32 @SelectGySleep(i32 1)
%54 = tail call i32 @RegWriteA(i32 523, i8 zeroext 0)
%55 = tail call i32 @RegWriteA(i32 584, i8 zeroext 1)
%56 = tail call i32 @RegWriteA(i32 598, i8 zeroext 2)
br label %141
57: ; preds = %1
%58 = tail call i32 @RegWriteA(i32 598, i8 zeroext 0)
%59 = tail call i32 @RegWriteA(i32 584, i8 zeroext 0)
%60 = tail call i32 @RegWriteA(i32 523, i8 zeroext 31)
%61 = tail call i32 @SelectGySleep(i32 0)
%62 = tail call i32 @DrvSw(i32 1)
%63 = tail call i32 @AfDrvSw(i32 1)
%64 = tail call i32 @RegWriteA(i32 32, i8 zeroext -64)
%65 = tail call i32 @RegWriteA(i32 144, i8 zeroext 0)
%66 = tail call i32 @RegWriteA(i32 16, i8 zeroext -64)
%67 = tail call i32 @RegWriteA(i32 612, i8 zeroext 5)
%68 = tail call i32 @RegWriteA(i32 592, i8 zeroext -1)
br label %141
69: ; preds = %1
%70 = tail call i32 @RegWriteA(i32 129, i8 zeroext 0)
%71 = tail call i32 @RegWriteA(i32 592, i8 zeroext 0)
%72 = tail call i32 @RegWriteA(i32 612, i8 zeroext 0)
%73 = tail call i32 @RegWriteA(i32 16, i8 zeroext 0)
%74 = tail call i32 @RegWriteA(i32 144, i8 zeroext 0)
%75 = tail call i32 @RegWriteA(i32 32, i8 zeroext 0)
%76 = tail call i32 @DrvSw(i32 0)
%77 = tail call i32 @AfDrvSw(i32 0)
%78 = tail call i32 (...) @GyOutSignalCont()
%79 = tail call i32 @RegWriteA(i32 523, i8 zeroext 4)
br label %141
80: ; preds = %1
%81 = tail call i32 @RegWriteA(i32 523, i8 zeroext 31)
%82 = tail call i32 @SelectGySleep(i32 0)
%83 = tail call i32 @DrvSw(i32 1)
%84 = tail call i32 @AfDrvSw(i32 1)
%85 = tail call i32 @RegWriteA(i32 32, i8 zeroext -64)
%86 = tail call i32 @RegWriteA(i32 144, i8 zeroext 0)
%87 = tail call i32 @RegWriteA(i32 16, i8 zeroext -64)
%88 = tail call i32 @RegWriteA(i32 612, i8 zeroext 5)
%89 = tail call i32 @RegWriteA(i32 592, i8 zeroext -1)
br label %141
90: ; preds = %1
%91 = call i32 @RegReadA(i32 592, i8* %2)
%92 = load i8, i8* %2
%93 = and i8 %92, -96
store i8 %93, i8* %2
%94 = call i32 @RegWriteA(i32 592, i8 zeroext %93)
%95 = call i32 @RegWriteA(i32 16, i8 zeroext 0)
%96 = call i32 @RegWriteA(i32 32, i8 zeroext 0)
%97 = call i32 @DrvSw(i32 0)
%98 = call i32 @SelectGySleep(i32 1)
%99 = call i32 @RegReadA(i32 523, i8* %3)
%100 = load i8, i8* %3
%101 = and i8 %100, 26
store i8 %101, i8* %3
%102 = call i32 @RegWriteA(i32 523, i8 zeroext %101)
br label %141
103: ; preds = %1
%104 = call i32 @RegReadA(i32 523, i8* %3)
%105 = load i8, i8* %3
%106 = or i8 %105, 5
store i8 %106, i8* %3
%107 = call i32 @RegWriteA(i32 523, i8 zeroext %106)
%108 = call i32 @SelectGySleep(i32 0)
%109 = call i32 @DrvSw(i32 1)
%110 = call i32 @RegWriteA(i32 32, i8 zeroext -64)
%111 = call i32 @RegWriteA(i32 16, i8 zeroext -64)
%112 = call i32 @RegReadA(i32 592, i8* %2)
%113 = load i8, i8* %2
%114 = or i8 %113, 95
store i8 %114, i8* %2
%115 = call i32 @RegWriteA(i32 592, i8 zeroext %114)
br label %141
116: ; preds = %1
%117 = tail call i32 @RegWriteA(i32 129, i8 zeroext 0)
%118 = call i32 @RegReadA(i32 592, i8* %2)
%119 = load i8, i8* %2
%120 = and i8 %119, 95
store i8 %120, i8* %2
%121 = call i32 @RegWriteA(i32 592, i8 zeroext %120)
%122 = call i32 @RegWriteA(i32 612, i8 zeroext 0)
%123 = call i32 @RegWriteA(i32 144, i8 zeroext 0)
%124 = call i32 @AfDrvSw(i32 0)
%125 = call i32 @RegReadA(i32 523, i8* %3)
%126 = load i8, i8* %3
%127 = and i8 %126, 7
store i8 %127, i8* %3
%128 = call i32 @RegWriteA(i32 523, i8 zeroext %127)
br label %141
129: ; preds = %1
%130 = call i32 @RegReadA(i32 523, i8* %3)
%131 = load i8, i8* %3
%132 = or i8 %131, 24
store i8 %132, i8* %3
%133 = call i32 @RegWriteA(i32 523, i8 zeroext %132)
%134 = call i32 @AfDrvSw(i32 1)
%135 = call i32 @RegWriteA(i32 144, i8 zeroext 0)
%136 = call i32 @RegWriteA(i32 612, i8 zeroext 5)
%137 = call i32 @RegReadA(i32 592, i8* %2)
%138 = load i8, i8* %2
%139 = or i8 %138, -96
store i8 %139, i8* %2
%140 = call i32 @RegWriteA(i32 592, i8 zeroext %139)
br label %141
141: ; preds = %1, %129, %116, %103, %90, %80, %69, %57, %44, %34, %23, %14, %4
ret void
}