#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_OFILM(int, int);
int /*<<< orphan*/ RamWrite32A_Ofilm(int, int);
int /*<<< orphan*/ RegWriteA_Ofilm(int, int);
void GyrCon_OFILM(unsigned char UcGyrCon_OFILM) {
  RegWriteA_Ofilm(0x0107, 0x00);
  if (UcGyrCon_OFILM == 0x01) {
    ClrGyr_OFILM(0x000E, 0x02);
    RamWrite32A_Ofilm(0x10B5, 0x3F800000);
    RamWrite32A_Ofilm(0x11B5, 0x3F800000);
  } else if (UcGyrCon_OFILM == 0x02) {
    RamWrite32A_Ofilm(0x10B5, 0x3F800000);
    RamWrite32A_Ofilm(0x11B5, 0x3F800000);
  } else {
    RamWrite32A_Ofilm(0x10B5, 0x00000000);
    RamWrite32A_Ofilm(0x11B5, 0x00000000);
  }
}


x86 assembly (clang, -O0):
<GyrCon_OFILM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x107,%edi
xor    %esi,%esi
call   1040 <RegWriteA_Ofilm@plt>
movzbl -0x1(%rbp),%eax
cmp    $0x1,%eax
jne    1189 <GyrCon_OFILM+0x59>
mov    $0xe,%edi
mov    $0x2,%esi
call   1030 <ClrGyr_OFILM@plt>
mov    $0x10b5,%edi
mov    $0x3f800000,%esi
call   1050 <RamWrite32A_Ofilm@plt>
mov    $0x11b5,%edi
mov    $0x3f800000,%esi
call   1050 <RamWrite32A_Ofilm@plt>
jmp    11d6 <GyrCon_OFILM+0xa6>
movzbl -0x1(%rbp),%eax
cmp    $0x2,%eax
jne    11b9 <GyrCon_OFILM+0x89>
mov    $0x10b5,%edi
mov    $0x3f800000,%esi
call   1050 <RamWrite32A_Ofilm@plt>
mov    $0x11b5,%edi
mov    $0x3f800000,%esi
call   1050 <RamWrite32A_Ofilm@plt>
jmp    11d1 <GyrCon_OFILM+0xa1>
mov    $0x10b5,%edi
xor    %esi,%esi
call   1050 <RamWrite32A_Ofilm@plt>
mov    $0x11b5,%edi
xor    %esi,%esi
call   1050 <RamWrite32A_Ofilm@plt>
jmp    11d6 <GyrCon_OFILM+0xa6>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @GyrCon_OFILM(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @RegWriteA_Ofilm(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_OFILM(i32 14, i32 2)
%9 = call i32 @RamWrite32A_Ofilm(i32 4277, i32 1065353216)
%10 = call i32 @RamWrite32A_Ofilm(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_Ofilm(i32 4277, i32 1065353216)
%17 = call i32 @RamWrite32A_Ofilm(i32 4533, i32 1065353216)
br label %21
18: ; preds = %11
%19 = call i32 @RamWrite32A_Ofilm(i32 4277, i32 0)
%20 = call i32 @RamWrite32A_Ofilm(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_OFILM(i8 zeroext %0) {
%2 = tail call i32 @RegWriteA_Ofilm(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_OFILM(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_Ofilm(i32 4277, i32 %7)
%9 = tail call i32 @RamWrite32A_Ofilm(i32 4533, i32 %7)
ret void
}