#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*/ enableInterrupt(int, int);
unsigned int usicChannelBase(int);
unsigned int usicFifoEnable(int channel) {
  const unsigned int cbase = usicChannelBase(channel);
  if (cbase == 0)
    return 1;
  (*((volatile unsigned int *const)(cbase + 0x108))) =
      ((4 << 24) | (1 << 16) | (3 << 14) | (1 << 8) | 0x10);
  (*((volatile unsigned int *const)(cbase + 0x10c))) =
      (1 << 30) | (1 << 28) | (4 << 24) | 0x00;
  (*((volatile unsigned int *const)(cbase + 0x118))) = 0x0000C707;
  (*((volatile unsigned int *const)(cbase + 0x04c))) = 0x0001FFFF;
  enableInterrupt(9, 129);
  enableInterrupt(10, 128);
  return 0;
}


x86 assembly (clang, -O0):
<usicFifoEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <usicChannelBase@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    114c <usicFifoEnable+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    11af <usicFifoEnable+0x8f>
mov    -0xc(%rbp),%eax
add    $0x108,%eax
mov    %eax,%eax
movl   $0x401c110,(%rax)
mov    -0xc(%rbp),%eax
add    $0x10c,%eax
mov    %eax,%eax
movl   $0x54000000,(%rax)
mov    -0xc(%rbp),%eax
add    $0x118,%eax
mov    %eax,%eax
movl   $0xc707,(%rax)
mov    -0xc(%rbp),%eax
add    $0x4c,%eax
mov    %eax,%eax
movl   $0x1ffff,(%rax)
mov    $0x9,%edi
mov    $0x81,%esi
call   1040 <enableInterrupt@plt>
mov    $0xa,%edi
mov    $0x80,%esi
call   1040 <enableInterrupt@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usicFifoEnable>:
push   %rax
call   1030 <usicChannelBase@plt>
test   %eax,%eax
je     1179 <usicFifoEnable+0x59>
lea    0x108(%rax),%ecx
movl   $0x401c110,(%rcx)
lea    0x10c(%rax),%ecx
movl   $0x54000000,(%rcx)
lea    0x118(%rax),%ecx
movl   $0xc707,(%rcx)
add    $0x4c,%eax
movl   $0x1ffff,(%rax)
mov    $0x9,%edi
mov    $0x81,%esi
call   1040 <enableInterrupt@plt>
mov    $0xa,%edi
mov    $0x80,%esi
call   1040 <enableInterrupt@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @usicFifoEnable(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @usicChannelBase(i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %29
10: ; preds = %1
%11 = load i32, i32* %4
%12 = add i32 %11, 264
%13 = zext i32 %12 to i64
%14 = inttoptr i64 %13 to i32*
store volatile i32 67223824, i32* %14
%15 = load i32, i32* %4
%16 = add i32 %15, 268
%17 = zext i32 %16 to i64
%18 = inttoptr i64 %17 to i32*
store volatile i32 1409286144, i32* %18
%19 = load i32, i32* %4
%20 = add i32 %19, 280
%21 = zext i32 %20 to i64
%22 = inttoptr i64 %21 to i32*
store volatile i32 50951, i32* %22
%23 = load i32, i32* %4
%24 = add i32 %23, 76
%25 = zext i32 %24 to i64
%26 = inttoptr i64 %25 to i32*
store volatile i32 131071, i32* %26
%27 = call i32 @enableInterrupt(i32 9, i32 129)
%28 = call i32 @enableInterrupt(i32 10, i32 128)
store i32 0, i32* %2
br label %29
29: ; preds = %10, %9
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
define i32 @usicFifoEnable(i32 %0) {
%2 = tail call i32 @usicChannelBase(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %19, label %4
4: ; preds = %1
%5 = add i32 %2, 264
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
store volatile i32 67223824, i32* %7
%8 = add i32 %2, 268
%9 = zext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
store volatile i32 1409286144, i32* %10
%11 = add i32 %2, 280
%12 = zext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
store volatile i32 50951, i32* %13
%14 = add i32 %2, 76
%15 = zext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
store volatile i32 131071, i32* %16
%17 = tail call i32 @enableInterrupt(i32 9, i32 129)
%18 = tail call i32 @enableInterrupt(i32 10, i32 128)
br label %19
19: ; preds = %1, %4
%20 = phi i32 [ 0, %4 ], [ 1, %1 ]
ret i32 %20
}