#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 /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ fputc_err(unsigned long, int /*<<< orphan*/ *);
void WriteDWORDLE(FILE *outf, unsigned long data) {
  (assert(outf != NULL));
  fputc_err(data & 0xFF, outf);
  data = data >> 8;
  fputc_err(data & 0xFF, outf);
  data = data >> 8;
  fputc_err(data & 0xFF, outf);
  data = data >> 8;
  fputc_err(data & 0xFF, outf);
}


x86 assembly (clang, -O0):
<WriteDWORDLE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rdi
and    $0xff,%rdi
mov    -0x8(%rbp),%rsi
call   1040 <fputc_err@plt>
mov    -0x10(%rbp),%rax
shr    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
and    $0xff,%rdi
mov    -0x8(%rbp),%rsi
call   1040 <fputc_err@plt>
mov    -0x10(%rbp),%rax
shr    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
and    $0xff,%rdi
mov    -0x8(%rbp),%rsi
call   1040 <fputc_err@plt>
mov    -0x10(%rbp),%rax
shr    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
and    $0xff,%rdi
mov    -0x8(%rbp),%rsi
call   1040 <fputc_err@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteDWORDLE>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1030 <assert@plt>
movzbl %bl,%edi
mov    %r14,%rsi
call   1040 <fputc_err@plt>
movzbl %bh,%edi
mov    %r14,%rsi
call   1040 <fputc_err@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%edi
mov    %r14,%rsi
call   1040 <fputc_err@plt>
shr    $0x18,%ebx
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fputc_err@plt>

LLVM IR (-O0):
define void @WriteDWORDLE(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%5 = load i32*, i32** %3
%6 = icmp ne i32* %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i64, i64* %4
%10 = and i64 %9, 255
%11 = load i32*, i32** %3
%12 = call i32 @fputc_err(i64 %10, i32* %11)
%13 = load i64, i64* %4
%14 = lshr i64 %13, 8
store i64 %14, i64* %4
%15 = load i64, i64* %4
%16 = and i64 %15, 255
%17 = load i32*, i32** %3
%18 = call i32 @fputc_err(i64 %16, i32* %17)
%19 = load i64, i64* %4
%20 = lshr i64 %19, 8
store i64 %20, i64* %4
%21 = load i64, i64* %4
%22 = and i64 %21, 255
%23 = load i32*, i32** %3
%24 = call i32 @fputc_err(i64 %22, i32* %23)
%25 = load i64, i64* %4
%26 = lshr i64 %25, 8
store i64 %26, i64* %4
%27 = load i64, i64* %4
%28 = and i64 %27, 255
%29 = load i32*, i32** %3
%30 = call i32 @fputc_err(i64 %28, i32* %29)
ret void
}

LLVM IR (-O2):
define void @WriteDWORDLE(i32* %0, i64 %1) {
%3 = icmp ne i32* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = and i64 %1, 255
%7 = tail call i32 @fputc_err(i64 %6, i32* %0)
%8 = lshr i64 %1, 8
%9 = and i64 %8, 255
%10 = tail call i32 @fputc_err(i64 %9, i32* %0)
%11 = lshr i64 %1, 16
%12 = and i64 %11, 255
%13 = tail call i32 @fputc_err(i64 %12, i32* %0)
%14 = lshr i64 %1, 24
%15 = and i64 %14, 255
%16 = tail call i32 @fputc_err(i64 %15, i32* %0)
ret void
}