#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 */
int /*<<< orphan*/ sendByte(unsigned char, unsigned char);
void sendWord(unsigned char reg, unsigned int word) {
  sendByte(reg, (unsigned char)(word >> 24));
  word <<= 8;
  sendByte(reg, (unsigned char)(word >> 24));
  word <<= 8;
  sendByte(reg, (unsigned char)(word >> 24));
  word <<= 8;
  sendByte(reg, (unsigned char)(word >> 24));
}


x86 assembly (clang, -O0):
<sendWord>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x8(%rbp),%eax
shr    $0x18,%eax
movzbl %cl,%edi
movzbl %al,%esi
call   1030 <sendByte@plt>
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x8(%rbp),%eax
shr    $0x18,%eax
movzbl %cl,%edi
movzbl %al,%esi
call   1030 <sendByte@plt>
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x8(%rbp),%eax
shr    $0x18,%eax
movzbl %cl,%edi
movzbl %al,%esi
call   1030 <sendByte@plt>
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x8(%rbp),%eax
shr    $0x18,%eax
movzbl %cl,%edi
movzbl %al,%esi
call   1030 <sendByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @sendWord(i8 zeroext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i8, i8* %3
%6 = load i32, i32* %4
%7 = lshr i32 %6, 24
%8 = trunc i32 %7 to i8
%9 = call i32 @sendByte(i8 zeroext %5, i8 zeroext %8)
%10 = load i32, i32* %4
%11 = shl i32 %10, 8
store i32 %11, i32* %4
%12 = load i8, i8* %3
%13 = load i32, i32* %4
%14 = lshr i32 %13, 24
%15 = trunc i32 %14 to i8
%16 = call i32 @sendByte(i8 zeroext %12, i8 zeroext %15)
%17 = load i32, i32* %4
%18 = shl i32 %17, 8
store i32 %18, i32* %4
%19 = load i8, i8* %3
%20 = load i32, i32* %4
%21 = lshr i32 %20, 24
%22 = trunc i32 %21 to i8
%23 = call i32 @sendByte(i8 zeroext %19, i8 zeroext %22)
%24 = load i32, i32* %4
%25 = shl i32 %24, 8
store i32 %25, i32* %4
%26 = load i8, i8* %3
%27 = load i32, i32* %4
%28 = lshr i32 %27, 24
%29 = trunc i32 %28 to i8
%30 = call i32 @sendByte(i8 zeroext %26, i8 zeroext %29)
ret void
}

LLVM IR (-O2):
define void @sendWord(i8 zeroext %0, i32 %1) {
%3 = lshr i32 %1, 24
%4 = trunc i32 %3 to i8
%5 = tail call i32 @sendByte(i8 zeroext %0, i8 zeroext %4)
%6 = lshr i32 %1, 16
%7 = trunc i32 %6 to i8
%8 = tail call i32 @sendByte(i8 zeroext %0, i8 zeroext %7)
%9 = lshr i32 %1, 8
%10 = trunc i32 %9 to i8
%11 = tail call i32 @sendByte(i8 zeroext %0, i8 zeroext %10)
%12 = trunc i32 %1 to i8
%13 = tail call i32 @sendByte(i8 zeroext %0, i8 zeroext %12)
ret void
}