#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 _USBIndexRead(int, int, int, int);
void USBFIFOConfigGet(uint32_t ui32Base, uint32_t ui32Endpoint,
                      uint32_t *pui32FIFOAddress, uint32_t *pui32FIFOSize,
                      uint32_t ui32Flags) {
  ;

  ;
  if (ui32Flags & (0x00002000 | 0x00002000)) {
    *pui32FIFOAddress =
        (_USBIndexRead(ui32Base, ui32Endpoint >> 4, (uint32_t)0x00000064, 2))
        << 3;
    *pui32FIFOSize =
        _USBIndexRead(ui32Base, ui32Endpoint >> 4, (uint32_t)0x00000062, 1);
  } else {
    *pui32FIFOAddress =
        (_USBIndexRead(ui32Base, ui32Endpoint >> 4, (uint32_t)0x00000066, 2))
        << 3;
    *pui32FIFOSize =
        _USBIndexRead(ui32Base, ui32Endpoint >> 4, (uint32_t)0x00000063, 1);
  }
}


x86 assembly (clang, -O0):
<USBFIFOConfigGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
and    $0x2000,%eax
cmp    $0x0,%eax
je     1183 <USBFIFOConfigGet+0x73>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
sar    $0x4,%esi
mov    $0x64,%edx
mov    $0x2,%ecx
call   1030 <_USBIndexRead@plt>
mov    %eax,%ecx
shl    $0x3,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
sar    $0x4,%esi
mov    $0x62,%edx
mov    $0x1,%ecx
call   1030 <_USBIndexRead@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
jmp    11c6 <USBFIFOConfigGet+0xb6>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
sar    $0x4,%esi
mov    $0x66,%edx
mov    $0x2,%ecx
call   1030 <_USBIndexRead@plt>
mov    %eax,%ecx
shl    $0x3,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
sar    $0x4,%esi
mov    $0x63,%edx
mov    $0x1,%ecx
call   1030 <_USBIndexRead@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBFIFOConfigGet>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rcx,%r14
mov    %rdx,%r15
mov    %esi,%ebp
mov    %edi,%r12d
xor    %ebx,%ebx
test   $0x2000,%r8d
sete   %bl
sar    $0x4,%ebp
lea    (%rbx,%rbx,1),%edx
add    $0x64,%edx
or     $0x62,%ebx
mov    %ebp,%esi
mov    $0x2,%ecx
call   1030 <_USBIndexRead@plt>
shl    $0x3,%eax
mov    %eax,(%r15)
mov    %r12d,%edi
mov    %ebp,%esi
mov    %ebx,%edx
mov    $0x1,%ecx
call   1030 <_USBIndexRead@plt>
mov    %eax,(%r14)
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @USBFIFOConfigGet(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 = call i32 @_USBIndexRead(i32 %15, i32 %17, i32 100, i32 2)
%19 = shl i32 %18, 3
%20 = load i32*, i32** %8
store i32 %19, i32* %20
%21 = load i32, i32* %6
%22 = load i32, i32* %7
%23 = ashr i32 %22, 4
%24 = call i32 @_USBIndexRead(i32 %21, i32 %23, i32 98, i32 1)
%25 = load i32*, i32** %9
store i32 %24, i32* %25
br label %38
26: ; preds = %5
%27 = load i32, i32* %6
%28 = load i32, i32* %7
%29 = ashr i32 %28, 4
%30 = call i32 @_USBIndexRead(i32 %27, i32 %29, i32 102, i32 2)
%31 = shl i32 %30, 3
%32 = load i32*, i32** %8
store i32 %31, i32* %32
%33 = load i32, i32* %6
%34 = load i32, i32* %7
%35 = ashr i32 %34, 4
%36 = call i32 @_USBIndexRead(i32 %33, i32 %35, i32 99, i32 1)
%37 = load i32*, i32** %9
store i32 %36, i32* %37
br label %38
38: ; preds = %26, %14
ret void
}

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