#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*/ RamWrite32A_LC898122AF(int, int);
int /*<<< orphan*/ RegWriteA_LC898122AF(int, int);
void GyrCon(unsigned char UcGyrCon) {
  RegWriteA_LC898122AF(0x0107, 0x00);
  if (UcGyrCon == 0x01) {
    ClrGyr(0x000E, 0x02);
    RamWrite32A_LC898122AF(0x10B5, 0x3F800000);
    RamWrite32A_LC898122AF(0x11B5, 0x3F800000);
  } else if (UcGyrCon == 0x02) {
    RamWrite32A_LC898122AF(0x10B5, 0x3F800000);
    RamWrite32A_LC898122AF(0x11B5, 0x3F800000);
  } else {
    RamWrite32A_LC898122AF(0x10B5, 0x00000000);
    RamWrite32A_LC898122AF(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   1040 <RegWriteA_LC898122AF@plt>
movzbl -0x1(%rbp),%eax
cmp    $0x1,%eax
jne    1189 <GyrCon+0x59>
mov    $0xe,%edi
mov    $0x2,%esi
call   1030 <ClrGyr@plt>
mov    $0x10b5,%edi
mov    $0x3f800000,%esi
call   1050 <RamWrite32A_LC898122AF@plt>
mov    $0x11b5,%edi
mov    $0x3f800000,%esi
call   1050 <RamWrite32A_LC898122AF@plt>
jmp    11d6 <GyrCon+0xa6>
movzbl -0x1(%rbp),%eax
cmp    $0x2,%eax
jne    11b9 <GyrCon+0x89>
mov    $0x10b5,%edi
mov    $0x3f800000,%esi
call   1050 <RamWrite32A_LC898122AF@plt>
mov    $0x11b5,%edi
mov    $0x3f800000,%esi
call   1050 <RamWrite32A_LC898122AF@plt>
jmp    11d1 <GyrCon+0xa1>
mov    $0x10b5,%edi
xor    %esi,%esi
call   1050 <RamWrite32A_LC898122AF@plt>
mov    $0x11b5,%edi
xor    %esi,%esi
call   1050 <RamWrite32A_LC898122AF@plt>
jmp    11d6 <GyrCon+0xa6>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GyrCon>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x107,%edi
xor    %esi,%esi
call   1040 <RegWriteA_LC898122AF@plt>
mov    $0x3f800000,%ebx
cmp    $0x2,%bpl
je     1165 <GyrCon+0x35>
cmp    $0x1,%bpl
jne    1163 <GyrCon+0x33>
mov    $0xe,%edi
mov    $0x2,%esi
call   1030 <ClrGyr@plt>
jmp    1165 <GyrCon+0x35>
xor    %ebx,%ebx
mov    $0x10b5,%edi
mov    %ebx,%esi
call   1050 <RamWrite32A_LC898122AF@plt>
mov    $0x11b5,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <RamWrite32A_LC898122AF@plt>

LLVM IR (-O0):
define void @GyrCon(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @RegWriteA_LC898122AF(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 %11
7: ; preds = %1
%8 = call i32 @ClrGyr(i32 14, i32 2)
%9 = call i32 @RamWrite32A_LC898122AF(i32 4277, i32 1065353216)
%10 = call i32 @RamWrite32A_LC898122AF(i32 4533, i32 1065353216)
br label %22
11: ; preds = %1
%12 = load i8, i8* %2
%13 = zext i8 %12 to i32
%14 = icmp eq i32 %13, 2
br i1 %14, label %15, label %18
15: ; preds = %11
%16 = call i32 @RamWrite32A_LC898122AF(i32 4277, i32 1065353216)
%17 = call i32 @RamWrite32A_LC898122AF(i32 4533, i32 1065353216)
br label %21
18: ; preds = %11
%19 = call i32 @RamWrite32A_LC898122AF(i32 4277, i32 0)
%20 = call i32 @RamWrite32A_LC898122AF(i32 4533, i32 0)
br label %21
21: ; preds = %18, %15
br label %22
22: ; preds = %21, %7
ret void
}

LLVM IR (-O2):
define void @GyrCon(i8 zeroext %0) {
%2 = tail call i32 @RegWriteA_LC898122AF(i32 263, i32 0)
switch i8 %0, label %5 [
i8 1, label %3
i8 2, label %6
]
3: ; preds = %1
%4 = tail call i32 @ClrGyr(i32 14, i32 2)
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %5, %3
%7 = phi i32 [ 0, %5 ], [ 1065353216, %3 ], [ 1065353216, %1 ]
%8 = tail call i32 @RamWrite32A_LC898122AF(i32 4277, i32 %7)
%9 = tail call i32 @RamWrite32A_LC898122AF(i32 4533, i32 %7)
ret void
}