#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 */
void USBEndpointDataToggleClear(uint32_t ui32Base, uint32_t ui32Endpoint,
                                uint32_t ui32Flags) {
  ;

  ;
  if (ui32Flags & (0x00002000 | 0x00002000)) {
    (*((volatile unsigned char *)(ui32Base + 0x00000112 +
                                  (ui32Endpoint - 0x10)))) |= 0x00000040;
  } else {
    (*((volatile unsigned char *)(ui32Base + 0x00000116 +
                                  (ui32Endpoint - 0x10)))) |= 0x00000080;
  }
}


x86 assembly (clang, -O0):
<USBEndpointDataToggleClear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x2000,%eax
cmp    $0x0,%eax
je     113f <USBEndpointDataToggleClear+0x3f>
mov    -0x4(%rbp),%eax
add    $0x112,%eax
mov    -0x8(%rbp),%ecx
sub    $0x10,%ecx
add    %ecx,%eax
cltq
mov    (%rax),%cl
movzbl %cl,%ecx
or     $0x40,%ecx
mov    %cl,(%rax)
jmp    115e <USBEndpointDataToggleClear+0x5e>
mov    -0x4(%rbp),%eax
add    $0x116,%eax
mov    -0x8(%rbp),%ecx
sub    $0x10,%ecx
add    %ecx,%eax
cltq
mov    (%rax),%cl
movzbl %cl,%ecx
or     $0x80,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBEndpointDataToggleClear>:
add    %esi,%edi
xor    %eax,%eax
test   $0x2000,%edx
sete   %al
mov    $0x80,%ecx
mov    $0x40,%edx
cmove  %ecx,%edx
lea    (%rdi,%rax,4),%eax
add    $0x102,%eax
cltq
or     %dl,(%rax)
ret

LLVM IR (-O0):
define void @USBEndpointDataToggleClear(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = and i32 %7, 8192
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %22
10: ; preds = %3
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 274
%13 = load i32, i32* %5
%14 = sub nsw i32 %13, 16
%15 = add nsw i32 %12, %14
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i8*
%18 = load volatile i8, i8* %17
%19 = zext i8 %18 to i32
%20 = or i32 %19, 64
%21 = trunc i32 %20 to i8
store volatile i8 %21, i8* %17
br label %34
22: ; preds = %3
%23 = load i32, i32* %4
%24 = add nsw i32 %23, 278
%25 = load i32, i32* %5
%26 = sub nsw i32 %25, 16
%27 = add nsw i32 %24, %26
%28 = sext i32 %27 to i64
%29 = inttoptr i64 %28 to i8*
%30 = load volatile i8, i8* %29
%31 = zext i8 %30 to i32
%32 = or i32 %31, 128
%33 = trunc i32 %32 to i8
store volatile i8 %33, i8* %29
br label %34
34: ; preds = %22, %10
ret void
}

LLVM IR (-O2):
define void @USBEndpointDataToggleClear(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %2, 8192
%5 = icmp eq i32 %4, 0
%6 = add i32 %1, %0
%7 = select i1 %5, i32 262, i32 258
%8 = select i1 %5, i8 -128, i8 64
%9 = add i32 %6, %7
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i8*
%12 = load volatile i8, i8* %11
%13 = or i8 %12, %8
store volatile i8 %13, i8* %11
ret void
}