#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 __ibm440eplike_fixup_clocks(unsigned int, unsigned int,
                                         int /*<<< orphan*/);
int /*<<< orphan*/ eplike_fixup_uart_clk(int, char *, unsigned int,
                                         unsigned int);
void ibm440ep_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk,
                           unsigned int tmr_clk) {
  unsigned int plb_clk = __ibm440eplike_fixup_clocks(sys_clk, tmr_clk, 0);
  eplike_fixup_uart_clk(0, "/plb/opb/serial@ef600300", ser_clk, plb_clk);
  eplike_fixup_uart_clk(1, "/plb/opb/serial@ef600400", ser_clk, plb_clk);
  eplike_fixup_uart_clk(2, "/plb/opb/serial@ef600500", ser_clk, plb_clk);
  eplike_fixup_uart_clk(3, "/plb/opb/serial@ef600600", ser_clk, plb_clk);
}


x86 assembly (clang, -O0):
<ibm440ep_fixup_clocks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
xor    %edx,%edx
call   1030 <__ibm440eplike_fixup_clocks@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%ecx
xor    %edi,%edi
lea    0xeb0(%rip),%rsi
call   1040 <eplike_fixup_uart_clk@plt>
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    $0x1,%edi
lea    0xeb2(%rip),%rsi
call   1040 <eplike_fixup_uart_clk@plt>
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    $0x2,%edi
lea    0xeb4(%rip),%rsi
call   1040 <eplike_fixup_uart_clk@plt>
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    $0x3,%edi
lea    0xeb6(%rip),%rsi
call   1040 <eplike_fixup_uart_clk@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ibm440ep_fixup_clocks>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edx,%esi
xor    %edx,%edx
call   1030 <__ibm440eplike_fixup_clocks@plt>
mov    %eax,%ebp
lea    0xec9(%rip),%rsi
xor    %edi,%edi
mov    %ebx,%edx
mov    %eax,%ecx
call   1040 <eplike_fixup_uart_clk@plt>
lea    0xed0(%rip),%rsi
mov    $0x1,%edi
mov    %ebx,%edx
mov    %ebp,%ecx
call   1040 <eplike_fixup_uart_clk@plt>
lea    0xed4(%rip),%rsi
mov    $0x2,%edi
mov    %ebx,%edx
mov    %ebp,%ecx
call   1040 <eplike_fixup_uart_clk@plt>
lea    0xed8(%rip),%rsi
mov    $0x3,%edi
mov    %ebx,%edx
mov    %ebp,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <eplike_fixup_uart_clk@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"/plb/opb/serial@ef600300\00"
@.str.1 = [25 x i8] c"/plb/opb/serial@ef600400\00"
@.str.2 = [25 x i8] c"/plb/opb/serial@ef600500\00"
@.str.3 = [25 x i8] c"/plb/opb/serial@ef600600\00"
define void @ibm440ep_fixup_clocks(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %6
%10 = call i32 @__ibm440eplike_fixup_clocks(i32 %8, i32 %9, i32 0)
store i32 %10, i32* %7
%11 = load i32, i32* %5
%12 = load i32, i32* %7
%13 = call i32 @eplike_fixup_uart_clk(i32 0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12)
%14 = load i32, i32* %5
%15 = load i32, i32* %7
%16 = call i32 @eplike_fixup_uart_clk(i32 1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %14, i32 %15)
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = call i32 @eplike_fixup_uart_clk(i32 2, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %17, i32 %18)
%20 = load i32, i32* %5
%21 = load i32, i32* %7
%22 = call i32 @eplike_fixup_uart_clk(i32 3, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i32 %20, i32 %21)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"/plb/opb/serial@ef600300\00"
@.str.1 = [25 x i8] c"/plb/opb/serial@ef600400\00"
@.str.2 = [25 x i8] c"/plb/opb/serial@ef600500\00"
@.str.3 = [25 x i8] c"/plb/opb/serial@ef600600\00"
define void @ibm440ep_fixup_clocks(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @__ibm440eplike_fixup_clocks(i32 %0, i32 %2, i32 0)
%5 = tail call i32 @eplike_fixup_uart_clk(i32 0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %4)
%6 = tail call i32 @eplike_fixup_uart_clk(i32 1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %1, i32 %4)
%7 = tail call i32 @eplike_fixup_uart_clk(i32 2, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %1, i32 %4)
%8 = tail call i32 @eplike_fixup_uart_clk(i32 3, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i32 %1, i32 %4)
ret void
}