#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 */
struct ieeeSection {
  int dummy;
};
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ ieee_write_byte(struct ieeeSection *, int);
void ieee_write_dword(struct ieeeSection *seg, int32_t data) {
  ieee_write_byte(seg, data & 0xFF);
  ieee_write_byte(seg, (data >> 8) & 0xFF);
  ieee_write_byte(seg, (data >> 16) & 0xFF);
  ieee_write_byte(seg, (data >> 24) & 0xFF);
}


x86 assembly (clang, -O0):
<ieee_write_dword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
and    $0xff,%esi
call   1030 <ieee_write_byte@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sar    $0x8,%esi
and    $0xff,%esi
call   1030 <ieee_write_byte@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sar    $0x10,%esi
and    $0xff,%esi
call   1030 <ieee_write_byte@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sar    $0x18,%esi
and    $0xff,%esi
call   1030 <ieee_write_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee_write_dword>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
movzbl %bl,%esi
call   1030 <ieee_write_byte@plt>
movzbl %bh,%esi
mov    %r14,%rdi
call   1030 <ieee_write_byte@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%esi
mov    %r14,%rdi
call   1030 <ieee_write_byte@plt>
shr    $0x18,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <ieee_write_byte@plt>

LLVM IR (-O0):
%struct.ieeeSection = type { i32 }
define void @ieee_write_dword(%struct.ieeeSection* %0, i32 %1) {
%3 = alloca %struct.ieeeSection*
%4 = alloca i32
store %struct.ieeeSection* %0, %struct.ieeeSection** %3
store i32 %1, i32* %4
%5 = load %struct.ieeeSection*, %struct.ieeeSection** %3
%6 = load i32, i32* %4
%7 = and i32 %6, 255
%8 = call i32 @ieee_write_byte(%struct.ieeeSection* %5, i32 %7)
%9 = load %struct.ieeeSection*, %struct.ieeeSection** %3
%10 = load i32, i32* %4
%11 = ashr i32 %10, 8
%12 = and i32 %11, 255
%13 = call i32 @ieee_write_byte(%struct.ieeeSection* %9, i32 %12)
%14 = load %struct.ieeeSection*, %struct.ieeeSection** %3
%15 = load i32, i32* %4
%16 = ashr i32 %15, 16
%17 = and i32 %16, 255
%18 = call i32 @ieee_write_byte(%struct.ieeeSection* %14, i32 %17)
%19 = load %struct.ieeeSection*, %struct.ieeeSection** %3
%20 = load i32, i32* %4
%21 = ashr i32 %20, 24
%22 = and i32 %21, 255
%23 = call i32 @ieee_write_byte(%struct.ieeeSection* %19, i32 %22)
ret void
}

LLVM IR (-O2):
%struct.ieeeSection = type { i32 }
define void @ieee_write_dword(%struct.ieeeSection* %0, i32 %1) {
%3 = and i32 %1, 255
%4 = tail call i32 @ieee_write_byte(%struct.ieeeSection* %0, i32 %3)
%5 = lshr i32 %1, 8
%6 = and i32 %5, 255
%7 = tail call i32 @ieee_write_byte(%struct.ieeeSection* %0, i32 %6)
%8 = lshr i32 %1, 16
%9 = and i32 %8, 255
%10 = tail call i32 @ieee_write_byte(%struct.ieeeSection* %0, i32 %9)
%11 = lshr i32 %1, 24
%12 = tail call i32 @ieee_write_byte(%struct.ieeeSection* %0, i32 %11)
ret void
}