#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*/ I2CEnable(unsigned long);
void I2CSlaveInit(unsigned long ulBase, unsigned long ulAddrConfig,
                  unsigned char ucSlaveAddr, unsigned long ulGeneralCall) {
  ;
  ;
  I2CEnable(ulBase);
  (*((volatile unsigned long *)(ulBase + 0x00000008))) =
      ulAddrConfig | (ucSlaveAddr << 1);
  (*((volatile unsigned long *)(ulBase + 0x00000000))) &= ~0x00000040;
  (*((volatile unsigned long *)(ulBase + 0x00000000))) |= 0x00000400;
  (*((volatile unsigned long *)(ulBase + 0x00000000))) |= ulGeneralCall;
}


x86 assembly (clang, -O0):
<I2CSlaveInit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <I2CEnable@plt>
mov    -0x10(%rbp),%rcx
movzbl -0x11(%rbp),%eax
shl    $0x1,%eax
cltq
or     %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
and    $0xffffffffffffffbf,%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
or     $0x400,%rcx
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
or     %rdx,%rcx
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CSlaveInit>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %edx,%ebp
mov    %rsi,%r15
mov    %rdi,%rbx
call   1030 <I2CEnable@plt>
mov    %ebp,%eax
add    %rax,%rax
or     %r15,%rax
mov    %rax,0x8(%rbx)
andq   $0xffffffffffffffbf,(%rbx)
orq    $0x400,(%rbx)
or     %r14,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @I2CSlaveInit(i64 %0, i64 %1, i8 zeroext %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i8
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i8 %2, i8* %7
store i64 %3, i64* %8
%9 = load i64, i64* %5
%10 = call i32 @I2CEnable(i64 %9)
%11 = load i64, i64* %6
%12 = load i8, i8* %7
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 1
%15 = sext i32 %14 to i64
%16 = or i64 %11, %15
%17 = load i64, i64* %5
%18 = add i64 %17, 8
%19 = inttoptr i64 %18 to i64*
store volatile i64 %16, i64* %19
%20 = load i64, i64* %5
%21 = add i64 %20, 0
%22 = inttoptr i64 %21 to i64*
%23 = load volatile i64, i64* %22
%24 = and i64 %23, -65
store volatile i64 %24, i64* %22
%25 = load i64, i64* %5
%26 = add i64 %25, 0
%27 = inttoptr i64 %26 to i64*
%28 = load volatile i64, i64* %27
%29 = or i64 %28, 1024
store volatile i64 %29, i64* %27
%30 = load i64, i64* %8
%31 = load i64, i64* %5
%32 = add i64 %31, 0
%33 = inttoptr i64 %32 to i64*
%34 = load volatile i64, i64* %33
%35 = or i64 %34, %30
store volatile i64 %35, i64* %33
ret void
}

LLVM IR (-O2):
define void @I2CSlaveInit(i64 %0, i64 %1, i8 zeroext %2, i64 %3) {
%5 = tail call i32 @I2CEnable(i64 %0)
%6 = zext i8 %2 to i64
%7 = shl nuw nsw i64 %6, 1
%8 = or i64 %7, %1
%9 = add i64 %0, 8
%10 = inttoptr i64 %9 to i64*
store volatile i64 %8, i64* %10
%11 = inttoptr i64 %0 to i64*
%12 = load volatile i64, i64* %11
%13 = and i64 %12, -65
store volatile i64 %13, i64* %11
%14 = load volatile i64, i64* %11
%15 = or i64 %14, 1024
store volatile i64 %15, i64* %11
%16 = load volatile i64, i64* %11
%17 = or i64 %16, %3
store volatile i64 %17, i64* %11
ret void
}