#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 __byte(int *, int /*<<< orphan*/);
void UARTConfigGetExpClk(uint32_t ui32Base, uint32_t ui32UARTClk,
                         uint32_t *pui32Baud, uint32_t *pui32Config) {
  ;
  *pui32Baud = ui32UARTClk / ((1 + (__byte((int *)(ui32Base + 0x2), 0) << 8) |
                               __byte((int *)(ui32Base + 0x3), 0)) *
                              8);
  *pui32Config = __byte((int *)(ui32Base + 0x0), 0) &
                 (0x00000060 | 0x00000080 | 0x00000007);
}


x86 assembly (clang, -O0):
<UARTConfigGetExpClk>:
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    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
movslq %eax,%rdi
xor    %esi,%esi
call   1030 <__byte@plt>
shl    $0x8,%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x4(%rbp),%eax
add    $0x3,%eax
movslq %eax,%rdi
xor    %esi,%esi
call   1030 <__byte@plt>
mov    -0x20(%rbp),%ecx
mov    %eax,%edx
mov    -0x1c(%rbp),%eax
or     %edx,%ecx
shl    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x0,%eax
movslq %eax,%rdi
xor    %esi,%esi
call   1030 <__byte@plt>
mov    %eax,%ecx
and    $0xe7,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTConfigGetExpClk>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rcx,%r14
mov    %rdx,%r15
mov    %esi,%r12d
mov    %edi,%ebx
lea    0x2(%rbx),%eax
movslq %eax,%rdi
xor    %esi,%esi
call   1030 <__byte@plt>
mov    %eax,%ebp
lea    0x3(%rbx),%eax
movslq %eax,%rdi
xor    %esi,%esi
call   1030 <__byte@plt>
mov    %eax,%ecx
shl    $0xb,%ebp
shl    $0x3,%ecx
or     %ebp,%ecx
or     $0x8,%ecx
mov    %r12d,%eax
cltd
idiv   %ecx
mov    %eax,(%r15)
movslq %ebx,%rdi
xor    %esi,%esi
call   1030 <__byte@plt>
and    $0xe7,%eax
mov    %eax,(%r14)
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @UARTConfigGetExpClk(i32 %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32, i32* %6
%10 = load i32, i32* %5
%11 = add nsw i32 %10, 2
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
%14 = call i32 @__byte(i32* %13, i32 0)
%15 = shl i32 %14, 8
%16 = add nsw i32 1, %15
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 3
%19 = sext i32 %18 to i64
%20 = inttoptr i64 %19 to i32*
%21 = call i32 @__byte(i32* %20, i32 0)
%22 = or i32 %16, %21
%23 = mul nsw i32 %22, 8
%24 = sdiv i32 %9, %23
%25 = load i32*, i32** %7
store i32 %24, i32* %25
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 0
%28 = sext i32 %27 to i64
%29 = inttoptr i64 %28 to i32*
%30 = call i32 @__byte(i32* %29, i32 0)
%31 = and i32 %30, 231
%32 = load i32*, i32** %8
store i32 %31, i32* %32
ret void
}

LLVM IR (-O2):
define void @UARTConfigGetExpClk(i32 %0, i32 %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = add nsw i32 %0, 2
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = tail call i32 @__byte(i32* %7, i32 0)
%9 = add nsw i32 %0, 3
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
%12 = tail call i32 @__byte(i32* %11, i32 0)
%13 = shl i32 %8, 11
%14 = shl i32 %12, 3
%15 = or i32 %13, %14
%16 = or i32 %15, 8
%17 = sdiv i32 %1, %16
store i32 %17, i32* %2
%18 = sext i32 %0 to i64
%19 = inttoptr i64 %18 to i32*
%20 = tail call i32 @__byte(i32* %19, i32 0)
%21 = and i32 %20, 231
store i32 %21, i32* %3
ret void
}