#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*/ USBIndexWrite(unsigned long, unsigned long, int,
                                 unsigned long, int);
void USBFIFOConfigSet(unsigned long ulBase, unsigned long ulEndpoint,
                      unsigned long ulFIFOAddress, unsigned long ulFIFOSize,
                      unsigned long ulFlags) {
  ;

  ;
  if (ulFlags & (0x00002000 | 0x00002000)) {
    USBIndexWrite(ulBase, ulEndpoint >> 4, 0x00000062, ulFIFOSize, 1);
    USBIndexWrite(ulBase, ulEndpoint >> 4, 0x00000064, ulFIFOAddress >> 3, 2);
  } else {
    USBIndexWrite(ulBase, ulEndpoint >> 4, 0x00000063, ulFIFOSize, 1);
    USBIndexWrite(ulBase, ulEndpoint >> 4, 0x00000066, ulFIFOAddress >> 3, 2);
  }
}


x86 assembly (clang, -O0):
<USBFIFOConfigSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x28(%rbp),%rax
and    $0x2000,%rax
cmp    $0x0,%rax
je     1189 <USBFIFOConfigSet+0x79>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
shr    $0x4,%rsi
mov    -0x20(%rbp),%rcx
mov    $0x62,%edx
mov    $0x1,%r8d
call   1030 <USBIndexWrite@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
shr    $0x4,%rsi
mov    -0x18(%rbp),%rcx
shr    $0x3,%rcx
mov    $0x64,%edx
mov    $0x2,%r8d
call   1030 <USBIndexWrite@plt>
jmp    11cd <USBFIFOConfigSet+0xbd>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
shr    $0x4,%rsi
mov    -0x20(%rbp),%rcx
mov    $0x63,%edx
mov    $0x1,%r8d
call   1030 <USBIndexWrite@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
shr    $0x4,%rsi
mov    -0x18(%rbp),%rcx
shr    $0x3,%rcx
mov    $0x66,%edx
mov    $0x2,%r8d
call   1030 <USBIndexWrite@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBFIFOConfigSet>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
xor    %eax,%eax
test   $0x2000,%r8d
sete   %al
shr    $0x4,%rbx
lea    (%rax,%rax,1),%ebp
add    $0x64,%ebp
mov    %eax,%edx
or     $0x62,%edx
mov    %rbx,%rsi
mov    $0x1,%r8d
call   1030 <USBIndexWrite@plt>
shr    $0x3,%r14
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
mov    %r14,%rcx
mov    $0x2,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <USBIndexWrite@plt>

LLVM IR (-O0):
define void @USBFIFOConfigSet(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store i64 %0, i64* %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%11 = load i64, i64* %10
%12 = and i64 %11, 8192
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %26
14: ; preds = %5
%15 = load i64, i64* %6
%16 = load i64, i64* %7
%17 = lshr i64 %16, 4
%18 = load i64, i64* %9
%19 = call i32 @USBIndexWrite(i64 %15, i64 %17, i32 98, i64 %18, i32 1)
%20 = load i64, i64* %6
%21 = load i64, i64* %7
%22 = lshr i64 %21, 4
%23 = load i64, i64* %8
%24 = lshr i64 %23, 3
%25 = call i32 @USBIndexWrite(i64 %20, i64 %22, i32 100, i64 %24, i32 2)
br label %38
26: ; preds = %5
%27 = load i64, i64* %6
%28 = load i64, i64* %7
%29 = lshr i64 %28, 4
%30 = load i64, i64* %9
%31 = call i32 @USBIndexWrite(i64 %27, i64 %29, i32 99, i64 %30, i32 1)
%32 = load i64, i64* %6
%33 = load i64, i64* %7
%34 = lshr i64 %33, 4
%35 = load i64, i64* %8
%36 = lshr i64 %35, 3
%37 = call i32 @USBIndexWrite(i64 %32, i64 %34, i32 102, i64 %36, i32 2)
br label %38
38: ; preds = %26, %14
ret void
}

LLVM IR (-O2):
define void @USBFIFOConfigSet(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = and i64 %4, 8192
%7 = icmp eq i64 %6, 0
%8 = lshr i64 %1, 4
%9 = select i1 %7, i32 99, i32 98
%10 = select i1 %7, i32 102, i32 100
%11 = tail call i32 @USBIndexWrite(i64 %0, i64 %8, i32 %9, i64 %3, i32 1)
%12 = lshr i64 %2, 3
%13 = tail call i32 @USBIndexWrite(i64 %0, i64 %8, i32 %10, i64 %12, i32 2)
ret void
}