#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 /*<<< orphan*/ ncr53c8xx_ram_writeb(int, int, void *);
void ncr53c8xx_ram_writel(uint32_t addr, uint32_t val, void *p) {
  ncr53c8xx_ram_writeb(addr, val & 0xff, p);
  ncr53c8xx_ram_writeb(addr + 1, (val >> 8) & 0xff, p);
  ncr53c8xx_ram_writeb(addr + 2, (val >> 16) & 0xff, p);
  ncr53c8xx_ram_writeb(addr + 3, (val >> 24) & 0xff, p);
}


x86 assembly (clang, -O0):
<ncr53c8xx_ram_writel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
and    $0xff,%esi
mov    -0x10(%rbp),%rdx
call   1030 <ncr53c8xx_ram_writeb@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
sar    $0x8,%esi
and    $0xff,%esi
mov    -0x10(%rbp),%rdx
call   1030 <ncr53c8xx_ram_writeb@plt>
mov    -0x4(%rbp),%edi
add    $0x2,%edi
mov    -0x8(%rbp),%esi
sar    $0x10,%esi
and    $0xff,%esi
mov    -0x10(%rbp),%rdx
call   1030 <ncr53c8xx_ram_writeb@plt>
mov    -0x4(%rbp),%edi
add    $0x3,%edi
mov    -0x8(%rbp),%esi
sar    $0x18,%esi
and    $0xff,%esi
mov    -0x10(%rbp),%rdx
call   1030 <ncr53c8xx_ram_writeb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ncr53c8xx_ram_writel>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%eax
mov    %edi,%ebx
movzbl %al,%esi
mov    %eax,%ebp
call   1030 <ncr53c8xx_ram_writeb@plt>
lea    0x1(%rbx),%edi
mov    %ebp,%eax
movzbl %ah,%esi
mov    %r14,%rdx
call   1030 <ncr53c8xx_ram_writeb@plt>
lea    0x2(%rbx),%edi
mov    %ebp,%eax
shr    $0x10,%eax
movzbl %al,%esi
mov    %r14,%rdx
call   1030 <ncr53c8xx_ram_writeb@plt>
add    $0x3,%ebx
mov    %ebp,%esi
shr    $0x18,%esi
mov    %ebx,%edi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <ncr53c8xx_ram_writeb@plt>

LLVM IR (-O0):
define void @ncr53c8xx_ram_writel(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = and i32 %8, 255
%10 = load i8*, i8** %6
%11 = call i32 @ncr53c8xx_ram_writeb(i32 %7, i32 %9, i8* %10)
%12 = load i32, i32* %4
%13 = add nsw i32 %12, 1
%14 = load i32, i32* %5
%15 = ashr i32 %14, 8
%16 = and i32 %15, 255
%17 = load i8*, i8** %6
%18 = call i32 @ncr53c8xx_ram_writeb(i32 %13, i32 %16, i8* %17)
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 2
%21 = load i32, i32* %5
%22 = ashr i32 %21, 16
%23 = and i32 %22, 255
%24 = load i8*, i8** %6
%25 = call i32 @ncr53c8xx_ram_writeb(i32 %20, i32 %23, i8* %24)
%26 = load i32, i32* %4
%27 = add nsw i32 %26, 3
%28 = load i32, i32* %5
%29 = ashr i32 %28, 24
%30 = and i32 %29, 255
%31 = load i8*, i8** %6
%32 = call i32 @ncr53c8xx_ram_writeb(i32 %27, i32 %30, i8* %31)
ret void
}

LLVM IR (-O2):
define void @ncr53c8xx_ram_writel(i32 %0, i32 %1, i8* %2) {
%4 = and i32 %1, 255
%5 = tail call i32 @ncr53c8xx_ram_writeb(i32 %0, i32 %4, i8* %2)
%6 = add nsw i32 %0, 1
%7 = lshr i32 %1, 8
%8 = and i32 %7, 255
%9 = tail call i32 @ncr53c8xx_ram_writeb(i32 %6, i32 %8, i8* %2)
%10 = add nsw i32 %0, 2
%11 = lshr i32 %1, 16
%12 = and i32 %11, 255
%13 = tail call i32 @ncr53c8xx_ram_writeb(i32 %10, i32 %12, i8* %2)
%14 = add nsw i32 %0, 3
%15 = lshr i32 %1, 24
%16 = tail call i32 @ncr53c8xx_ram_writeb(i32 %14, i32 %15, i8* %2)
ret void
}