#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*/ RamRead32A_Ofilm(int, unsigned long *);
int /*<<< orphan*/ RamWrite32A_Ofilm(int, unsigned long);
void GyrGan_OFILM(unsigned char UcGygmode_OFILM, unsigned long UlGygXval_OFILM,
                  unsigned long UlGygYval_OFILM) {
  switch (UcGygmode_OFILM) {
  case 0x00:
    RamWrite32A_Ofilm(0x1020, UlGygXval_OFILM);
    RamWrite32A_Ofilm(0x1120, UlGygYval_OFILM);
    ;
    break;
  case 0x01:
    RamWrite32A_Ofilm(0x1020, UlGygXval_OFILM);
    RamWrite32A_Ofilm(0x1120, UlGygYval_OFILM);
    ;
    break;
  case 0x02:
    RamRead32A_Ofilm(0x1020, &UlGygXval_OFILM);
    RamRead32A_Ofilm(0x1120, &UlGygYval_OFILM);
    ;
    break;
  };
  ;
}


x86 assembly (clang, -O0):
<GyrGan_OFILM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movzbl -0x1(%rbp),%eax
mov    %eax,-0x1c(%rbp)
test   %eax,%eax
je     116c <GyrGan_OFILM+0x4c>
jmp    114a <GyrGan_OFILM+0x2a>
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
je     118d <GyrGan_OFILM+0x6d>
jmp    115b <GyrGan_OFILM+0x3b>
mov    -0x1c(%rbp),%eax
sub    $0x2,%eax
je     11ae <GyrGan_OFILM+0x8e>
jmp    11ca <GyrGan_OFILM+0xaa>
mov    -0x10(%rbp),%rsi
mov    $0x1020,%edi
call   1030 <RamWrite32A_Ofilm@plt>
mov    -0x18(%rbp),%rsi
mov    $0x1120,%edi
call   1030 <RamWrite32A_Ofilm@plt>
jmp    11ca <GyrGan_OFILM+0xaa>
mov    -0x10(%rbp),%rsi
mov    $0x1020,%edi
call   1030 <RamWrite32A_Ofilm@plt>
mov    -0x18(%rbp),%rsi
mov    $0x1120,%edi
call   1030 <RamWrite32A_Ofilm@plt>
jmp    11ca <GyrGan_OFILM+0xaa>
mov    $0x1020,%edi
lea    -0x10(%rbp),%rsi
call   1040 <RamRead32A_Ofilm@plt>
mov    $0x1120,%edi
lea    -0x18(%rbp),%rsi
call   1040 <RamRead32A_Ofilm@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GyrGan_OFILM>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,0x8(%rsp)
mov    %rdx,(%rsp)
cmp    $0x2,%dil
je     115e <GyrGan_OFILM+0x3e>
mov    %rdx,%rbx
cmp    $0x1,%dil
je     1142 <GyrGan_OFILM+0x22>
test   %dil,%dil
jne    117a <GyrGan_OFILM+0x5a>
mov    $0x1020,%edi
call   1030 <RamWrite32A_Ofilm@plt>
mov    $0x1120,%edi
mov    %rbx,%rsi
add    $0x10,%rsp
pop    %rbx
jmp    1030 <RamWrite32A_Ofilm@plt>
lea    0x8(%rsp),%rsi
mov    $0x1020,%edi
call   1040 <RamRead32A_Ofilm@plt>
mov    %rsp,%rsi
mov    $0x1120,%edi
call   1040 <RamRead32A_Ofilm@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @GyrGan_OFILM(i8 zeroext %0, i64 %1, i64 %2) {
%4 = alloca i8
%5 = alloca i64
%6 = alloca i64
store i8 %0, i8* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
switch i32 %8, label %22 [
i32 0, label %9
i32 1, label %14
i32 2, label %19
]
9: ; preds = %3
%10 = load i64, i64* %5
%11 = call i32 @RamWrite32A_Ofilm(i32 4128, i64 %10)
%12 = load i64, i64* %6
%13 = call i32 @RamWrite32A_Ofilm(i32 4384, i64 %12)
br label %22
14: ; preds = %3
%15 = load i64, i64* %5
%16 = call i32 @RamWrite32A_Ofilm(i32 4128, i64 %15)
%17 = load i64, i64* %6
%18 = call i32 @RamWrite32A_Ofilm(i32 4384, i64 %17)
br label %22
19: ; preds = %3
%20 = call i32 @RamRead32A_Ofilm(i32 4128, i64* %5)
%21 = call i32 @RamRead32A_Ofilm(i32 4384, i64* %6)
br label %22
22: ; preds = %3, %19, %14, %9
ret void
}

LLVM IR (-O2):
define void @GyrGan_OFILM(i8 zeroext %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
store i64 %1, i64* %4
store i64 %2, i64* %5
switch i8 %0, label %15 [
i8 0, label %6
i8 1, label %9
i8 2, label %12
]
6: ; preds = %3
%7 = tail call i32 @RamWrite32A_Ofilm(i32 4128, i64 %1)
%8 = tail call i32 @RamWrite32A_Ofilm(i32 4384, i64 %2)
br label %15
9: ; preds = %3
%10 = tail call i32 @RamWrite32A_Ofilm(i32 4128, i64 %1)
%11 = tail call i32 @RamWrite32A_Ofilm(i32 4384, i64 %2)
br label %15
12: ; preds = %3
%13 = call i32 @RamRead32A_Ofilm(i32 4128, i64* %4)
%14 = call i32 @RamRead32A_Ofilm(i32 4384, i64* %5)
br label %15
15: ; preds = %3, %12, %9, %6
ret void
}