#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 receiveByte(int);
unsigned int receiveWord(int);
int /*<<< orphan*/ sendByte(int, unsigned int);
int /*<<< orphan*/ sendWord(int, unsigned int);
void tube_Args(unsigned int *reg) {
  sendByte(2, 0x0C);
  sendByte(2, reg[1]);
  sendWord(2, reg[2]);
  sendByte(2, reg[0]);
  reg[0] = receiveByte(2);
  reg[2] = receiveWord(2);
}


x86 assembly (clang, -O0):
<tube_Args>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x2,%edi
mov    $0xc,%esi
call   1060 <sendByte@plt>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%esi
mov    $0x2,%edi
call   1060 <sendByte@plt>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%esi
mov    $0x2,%edi
call   1040 <sendWord@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
mov    $0x2,%edi
call   1060 <sendByte@plt>
mov    $0x2,%edi
call   1050 <receiveByte@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x2,%edi
call   1030 <receiveWord@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tube_Args>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2,%edi
mov    $0xc,%esi
call   1060 <sendByte@plt>
mov    0x4(%rbx),%esi
mov    $0x2,%edi
call   1060 <sendByte@plt>
mov    0x8(%rbx),%esi
mov    $0x2,%edi
call   1040 <sendWord@plt>
mov    (%rbx),%esi
mov    $0x2,%edi
call   1060 <sendByte@plt>
mov    $0x2,%edi
call   1050 <receiveByte@plt>
mov    %eax,(%rbx)
mov    $0x2,%edi
call   1030 <receiveWord@plt>
mov    %eax,0x8(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @tube_Args(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @sendByte(i32 2, i32 12)
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 1
%6 = load i32, i32* %5
%7 = call i32 @sendByte(i32 2, i32 %6)
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 2
%10 = load i32, i32* %9
%11 = call i32 @sendWord(i32 2, i32 %10)
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 0
%14 = load i32, i32* %13
%15 = call i32 @sendByte(i32 2, i32 %14)
%16 = call i32 @receiveByte(i32 2)
%17 = load i32*, i32** %2
%18 = getelementptr inbounds i32, i32* %17, i64 0
store i32 %16, i32* %18
%19 = call i32 @receiveWord(i32 2)
%20 = load i32*, i32** %2
%21 = getelementptr inbounds i32, i32* %20, i64 2
store i32 %19, i32* %21
ret void
}

LLVM IR (-O2):
define void @tube_Args(i32* nocapture %0) {
%2 = tail call i32 @sendByte(i32 2, i32 12)
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = tail call i32 @sendByte(i32 2, i32 %4)
%6 = getelementptr inbounds i32, i32* %0, i64 2
%7 = load i32, i32* %6
%8 = tail call i32 @sendWord(i32 2, i32 %7)
%9 = load i32, i32* %0
%10 = tail call i32 @sendByte(i32 2, i32 %9)
%11 = tail call i32 @receiveByte(i32 2)
store i32 %11, i32* %0
%12 = tail call i32 @receiveWord(i32 2)
store i32 %12, i32* %6
ret void
}