#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 */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _USBIndexWrite(int, int, int, int, int);
void USBFIFOConfigSet(uint32_t ui32Base, uint32_t ui32Endpoint,
                      uint32_t ui32FIFOAddress, uint32_t ui32FIFOSize,
                      uint32_t ui32Flags) {
  ;

  ;
  if (ui32Flags & (0x00002000 | 0x00002000)) {
    _USBIndexWrite(ui32Base, ui32Endpoint >> 4, 0x00000062, ui32FIFOSize, 1);
    _USBIndexWrite(ui32Base, ui32Endpoint >> 4, 0x00000064,
                   ui32FIFOAddress >> 3, 2);
  } else {
    _USBIndexWrite(ui32Base, ui32Endpoint >> 4, 0x00000063, ui32FIFOSize, 1);
    _USBIndexWrite(ui32Base, ui32Endpoint >> 4, 0x00000066,
                   ui32FIFOAddress >> 3, 2);
  }
}


x86 assembly (clang, -O0):
<USBFIFOConfigSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    $0x2000,%eax
cmp    $0x0,%eax
je     1179 <USBFIFOConfigSet+0x69>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
sar    $0x4,%esi
mov    -0x10(%rbp),%ecx
mov    $0x62,%edx
mov    $0x1,%r8d
call   1030 <_USBIndexWrite@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
sar    $0x4,%esi
mov    -0xc(%rbp),%ecx
sar    $0x3,%ecx
mov    $0x64,%edx
mov    $0x2,%r8d
call   1030 <_USBIndexWrite@plt>
jmp    11b4 <USBFIFOConfigSet+0xa4>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
sar    $0x4,%esi
mov    -0x10(%rbp),%ecx
mov    $0x63,%edx
mov    $0x1,%r8d
call   1030 <_USBIndexWrite@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
sar    $0x4,%esi
mov    -0xc(%rbp),%ecx
sar    $0x3,%ecx
mov    $0x66,%edx
mov    $0x2,%r8d
call   1030 <_USBIndexWrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBFIFOConfigSet>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edi,%r14d
xor    %eax,%eax
test   $0x2000,%r8d
sete   %al
sar    $0x4,%ebp
lea    (%rax,%rax,1),%r15d
add    $0x64,%r15d
mov    %eax,%edx
or     $0x62,%edx
mov    %ebp,%esi
mov    $0x1,%r8d
call   1030 <_USBIndexWrite@plt>
sar    $0x3,%ebx
mov    %r14d,%edi
mov    %ebp,%esi
mov    %r15d,%edx
mov    %ebx,%ecx
mov    $0x2,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <_USBIndexWrite@plt>

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

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