#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 */
unsigned int UARTDivisorLatchWrite(unsigned int, unsigned int);
unsigned int UARTRegConfigModeEnable(unsigned int, int);
void UARTFIFORegisterWrite(unsigned int baseAdd, unsigned int fcrValue) {
  unsigned int divLatchRegVal = 0;
  unsigned int lcrRegValue = 0;
  lcrRegValue = UARTRegConfigModeEnable(baseAdd, (0x0080));
  divLatchRegVal = UARTDivisorLatchWrite(baseAdd, 0x0000);
  (*((volatile unsigned int *)(baseAdd + (0x8)))) = fcrValue;
  UARTDivisorLatchWrite(baseAdd, divLatchRegVal);
  (*((volatile unsigned int *)(baseAdd + (0xC)))) = lcrRegValue;
}


x86 assembly (clang, -O0):
<UARTFIFORegisterWrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x80,%esi
call   1040 <UARTRegConfigModeEnable@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <UARTDivisorLatchWrite@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x8,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <UARTDivisorLatchWrite@plt>
mov    -0x10(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0xc,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTFIFORegisterWrite>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %edi,%ebx
mov    $0x80,%esi
call   1040 <UARTRegConfigModeEnable@plt>
mov    %eax,%r14d
mov    %ebx,%edi
xor    %esi,%esi
call   1030 <UARTDivisorLatchWrite@plt>
lea    0x8(%rbx),%ecx
mov    %ebp,(%rcx)
mov    %ebx,%edi
mov    %eax,%esi
call   1030 <UARTDivisorLatchWrite@plt>
add    $0xc,%ebx
mov    %r14d,(%rbx)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @UARTFIFORegisterWrite(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
%7 = load i32, i32* %3
%8 = call i32 @UARTRegConfigModeEnable(i32 %7, i32 128)
store i32 %8, i32* %6
%9 = load i32, i32* %3
%10 = call i32 @UARTDivisorLatchWrite(i32 %9, i32 0)
store i32 %10, i32* %5
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = add i32 %12, 8
%14 = zext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
store volatile i32 %11, i32* %15
%16 = load i32, i32* %3
%17 = load i32, i32* %5
%18 = call i32 @UARTDivisorLatchWrite(i32 %16, i32 %17)
%19 = load i32, i32* %6
%20 = load i32, i32* %3
%21 = add i32 %20, 12
%22 = zext i32 %21 to i64
%23 = inttoptr i64 %22 to i32*
store volatile i32 %19, i32* %23
ret void
}

LLVM IR (-O2):
define void @UARTFIFORegisterWrite(i32 %0, i32 %1) {
%3 = tail call i32 @UARTRegConfigModeEnable(i32 %0, i32 128)
%4 = tail call i32 @UARTDivisorLatchWrite(i32 %0, i32 0)
%5 = add i32 %0, 8
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
store volatile i32 %1, i32* %7
%8 = tail call i32 @UARTDivisorLatchWrite(i32 %0, i32 %4)
%9 = add i32 %0, 12
%10 = zext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
store volatile i32 %3, i32* %11
ret void
}