#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*/ ClrGyr(int, int);
int /*<<< orphan*/ IniPtMovMod(int);
int /*<<< orphan*/ RamWrite32A(int, int);
int /*<<< orphan*/ RegWriteA(int, int);
void GyrCon(unsigned char UcGyrCon) {
  RegWriteA(0x0107, 0x00);
  if (UcGyrCon == 0x01) {
    ClrGyr(0x0002, 0x02);
    RamWrite32A(0x1021, 0x3F800000);
    RamWrite32A(0x1121, 0x3F800000);
    RamWrite32A(0x10B5, 0x3F800000);
    RamWrite32A(0x11B5, 0x3F800000);
    RamWrite32A(0x1044, 0xBF800000);
    RamWrite32A(0x1144, 0xBF800000);
    IniPtMovMod(0x00);
    RegWriteA(0x010A, 0x00);
  } else if (UcGyrCon == 0x02) {
    RamWrite32A(0x1021, 0x3F800000);
    RamWrite32A(0x1121, 0x3F800000);
    RamWrite32A(0x10B5, 0x3F800000);
    RamWrite32A(0x11B5, 0x3F800000);
  } else {
    RamWrite32A(0x1021, 0x00000000);
    RamWrite32A(0x1121, 0x00000000);
    RamWrite32A(0x10B5, 0x00000000);
    RamWrite32A(0x11B5, 0x00000000);
  }
}


x86 assembly (clang, -O0):
<GyrCon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x107,%edi
xor    %esi,%esi
call   1050 <RegWriteA@plt>
movzbl -0x1(%rbp),%eax
cmp    $0x1,%eax
jne    11e5 <GyrCon+0xa5>
mov    $0x2,%esi
mov    %esi,%edi
call   1030 <ClrGyr@plt>
mov    $0x1021,%edi
mov    $0x3f800000,%esi
call   1040 <RamWrite32A@plt>
mov    $0x1121,%edi
mov    $0x3f800000,%esi
call   1040 <RamWrite32A@plt>
mov    $0x10b5,%edi
mov    $0x3f800000,%esi
call   1040 <RamWrite32A@plt>
mov    $0x11b5,%edi
mov    $0x3f800000,%esi
call   1040 <RamWrite32A@plt>
mov    $0x1044,%edi
mov    $0xbf800000,%esi
call   1040 <RamWrite32A@plt>
mov    $0x1144,%edi
mov    $0xbf800000,%esi
call   1040 <RamWrite32A@plt>
xor    %edi,%edi
call   1060 <IniPtMovMod@plt>
mov    $0x10a,%edi
xor    %esi,%esi
call   1050 <RegWriteA@plt>
jmp    1268 <GyrCon+0x128>
movzbl -0x1(%rbp),%eax
cmp    $0x2,%eax
jne    1233 <GyrCon+0xf3>
mov    $0x1021,%edi
mov    $0x3f800000,%esi
call   1040 <RamWrite32A@plt>
mov    $0x1121,%edi
mov    $0x3f800000,%esi
call   1040 <RamWrite32A@plt>
mov    $0x10b5,%edi
mov    $0x3f800000,%esi
call   1040 <RamWrite32A@plt>
mov    $0x11b5,%edi
mov    $0x3f800000,%esi
call   1040 <RamWrite32A@plt>
jmp    1263 <GyrCon+0x123>
mov    $0x1021,%edi
xor    %esi,%esi
call   1040 <RamWrite32A@plt>
mov    $0x1121,%edi
xor    %esi,%esi
call   1040 <RamWrite32A@plt>
mov    $0x10b5,%edi
xor    %esi,%esi
call   1040 <RamWrite32A@plt>
mov    $0x11b5,%edi
xor    %esi,%esi
call   1040 <RamWrite32A@plt>
jmp    1268 <GyrCon+0x128>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GyrCon>:
push   %rbx
mov    %edi,%ebx
mov    $0x107,%edi
xor    %esi,%esi
call   1050 <RegWriteA@plt>
cmp    $0x2,%bl
je     11de <GyrCon+0x9e>
cmp    $0x1,%bl
jne    121b <GyrCon+0xdb>
mov    $0x2,%edi
mov    $0x2,%esi
call   1030 <ClrGyr@plt>
mov    $0x1021,%edi
mov    $0x3f800000,%esi
call   1040 <RamWrite32A@plt>
mov    $0x1121,%edi
mov    $0x3f800000,%esi
call   1040 <RamWrite32A@plt>
mov    $0x10b5,%edi
mov    $0x3f800000,%esi
call   1040 <RamWrite32A@plt>
mov    $0x11b5,%edi
mov    $0x3f800000,%esi
call   1040 <RamWrite32A@plt>
mov    $0x1044,%edi
mov    $0xbf800000,%esi
call   1040 <RamWrite32A@plt>
mov    $0x1144,%edi
mov    $0xbf800000,%esi
call   1040 <RamWrite32A@plt>
xor    %edi,%edi
call   1060 <IniPtMovMod@plt>
mov    $0x10a,%edi
xor    %esi,%esi
pop    %rbx
jmp    1050 <RegWriteA@plt>
mov    $0x1021,%edi
mov    $0x3f800000,%esi
call   1040 <RamWrite32A@plt>
mov    $0x1121,%edi
mov    $0x3f800000,%esi
call   1040 <RamWrite32A@plt>
mov    $0x10b5,%edi
mov    $0x3f800000,%esi
call   1040 <RamWrite32A@plt>
mov    $0x11b5,%edi
mov    $0x3f800000,%esi
pop    %rbx
jmp    1040 <RamWrite32A@plt>
mov    $0x1021,%edi
xor    %esi,%esi
call   1040 <RamWrite32A@plt>
mov    $0x1121,%edi
xor    %esi,%esi
call   1040 <RamWrite32A@plt>
mov    $0x10b5,%edi
xor    %esi,%esi
call   1040 <RamWrite32A@plt>
mov    $0x11b5,%edi
xor    %esi,%esi
pop    %rbx
jmp    1040 <RamWrite32A@plt>

LLVM IR (-O0):
define void @GyrCon(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @RegWriteA(i32 263, i32 0)
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %17
7: ; preds = %1
%8 = call i32 @ClrGyr(i32 2, i32 2)
%9 = call i32 @RamWrite32A(i32 4129, i32 1065353216)
%10 = call i32 @RamWrite32A(i32 4385, i32 1065353216)
%11 = call i32 @RamWrite32A(i32 4277, i32 1065353216)
%12 = call i32 @RamWrite32A(i32 4533, i32 1065353216)
%13 = call i32 @RamWrite32A(i32 4164, i32 -1082130432)
%14 = call i32 @RamWrite32A(i32 4420, i32 -1082130432)
%15 = call i32 @IniPtMovMod(i32 0)
%16 = call i32 @RegWriteA(i32 266, i32 0)
br label %32
17: ; preds = %1
%18 = load i8, i8* %2
%19 = zext i8 %18 to i32
%20 = icmp eq i32 %19, 2
br i1 %20, label %21, label %26
21: ; preds = %17
%22 = call i32 @RamWrite32A(i32 4129, i32 1065353216)
%23 = call i32 @RamWrite32A(i32 4385, i32 1065353216)
%24 = call i32 @RamWrite32A(i32 4277, i32 1065353216)
%25 = call i32 @RamWrite32A(i32 4533, i32 1065353216)
br label %31
26: ; preds = %17
%27 = call i32 @RamWrite32A(i32 4129, i32 0)
%28 = call i32 @RamWrite32A(i32 4385, i32 0)
%29 = call i32 @RamWrite32A(i32 4277, i32 0)
%30 = call i32 @RamWrite32A(i32 4533, i32 0)
br label %31
31: ; preds = %26, %21
br label %32
32: ; preds = %31, %7
ret void
}

LLVM IR (-O2):
define void @GyrCon(i8 zeroext %0) {
%2 = tail call i32 @RegWriteA(i32 263, i32 0)
switch i8 %0, label %18 [
i8 1, label %3
i8 2, label %13
]
3: ; preds = %1
%4 = tail call i32 @ClrGyr(i32 2, i32 2)
%5 = tail call i32 @RamWrite32A(i32 4129, i32 1065353216)
%6 = tail call i32 @RamWrite32A(i32 4385, i32 1065353216)
%7 = tail call i32 @RamWrite32A(i32 4277, i32 1065353216)
%8 = tail call i32 @RamWrite32A(i32 4533, i32 1065353216)
%9 = tail call i32 @RamWrite32A(i32 4164, i32 -1082130432)
%10 = tail call i32 @RamWrite32A(i32 4420, i32 -1082130432)
%11 = tail call i32 @IniPtMovMod(i32 0)
%12 = tail call i32 @RegWriteA(i32 266, i32 0)
br label %23
13: ; preds = %1
%14 = tail call i32 @RamWrite32A(i32 4129, i32 1065353216)
%15 = tail call i32 @RamWrite32A(i32 4385, i32 1065353216)
%16 = tail call i32 @RamWrite32A(i32 4277, i32 1065353216)
%17 = tail call i32 @RamWrite32A(i32 4533, i32 1065353216)
br label %23
18: ; preds = %1
%19 = tail call i32 @RamWrite32A(i32 4129, i32 0)
%20 = tail call i32 @RamWrite32A(i32 4385, i32 0)
%21 = tail call i32 @RamWrite32A(i32 4277, i32 0)
%22 = tail call i32 @RamWrite32A(i32 4533, i32 0)
br label %23
23: ; preds = %13, %18, %3
ret void
}