#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*/ ADXL345_readFrom(int, int, int, char *);
void ADXL345_readAccel(int file, int *x, int *y, int *z) {
  char buff[6];
  ADXL345_readFrom(file, 0x32, (6), buff);
  *x = (((int)buff[1]) << 8) | buff[0];
  *y = (((int)buff[3]) << 8) | buff[2];
  *z = (((int)buff[5]) << 8) | buff[4];
}


x86 assembly (clang, -O0):
<ADXL345_readAccel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x26(%rbp),%rcx
mov    $0x32,%esi
mov    $0x6,%edx
call   1030 <ADXL345_readFrom@plt>
movsbl -0x25(%rbp),%ecx
shl    $0x8,%ecx
movsbl -0x26(%rbp),%eax
or     %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movsbl -0x23(%rbp),%ecx
shl    $0x8,%ecx
movsbl -0x24(%rbp),%eax
or     %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movsbl -0x21(%rbp),%ecx
shl    $0x8,%ecx
movsbl -0x22(%rbp),%eax
or     %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADXL345_readAccel>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
lea    0xa(%rsp),%rcx
mov    $0x32,%esi
mov    $0x6,%edx
call   1030 <ADXL345_readFrom@plt>
movsbl 0xb(%rsp),%eax
shl    $0x8,%eax
movsbl 0xa(%rsp),%ecx
or     %eax,%ecx
mov    %ecx,(%rbx)
movsbl 0xd(%rsp),%eax
shl    $0x8,%eax
movsbl 0xc(%rsp),%ecx
or     %eax,%ecx
mov    %ecx,(%r15)
movsbl 0xf(%rsp),%eax
shl    $0x8,%eax
movsbl 0xe(%rsp),%ecx
or     %eax,%ecx
mov    %ecx,(%r14)
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @ADXL345_readAccel(i32 %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca [6 x i8]
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%10 = load i32, i32* %5
%11 = getelementptr inbounds [6 x i8], [6 x i8]* %9, i64 0, i64 0
%12 = call i32 @ADXL345_readFrom(i32 %10, i32 50, i32 6, i8* %11)
%13 = getelementptr inbounds [6 x i8], [6 x i8]* %9, i64 0, i64 1
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = shl i32 %15, 8
%17 = getelementptr inbounds [6 x i8], [6 x i8]* %9, i64 0, i64 0
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = or i32 %16, %19
%21 = load i32*, i32** %6
store i32 %20, i32* %21
%22 = getelementptr inbounds [6 x i8], [6 x i8]* %9, i64 0, i64 3
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = shl i32 %24, 8
%26 = getelementptr inbounds [6 x i8], [6 x i8]* %9, i64 0, i64 2
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = or i32 %25, %28
%30 = load i32*, i32** %7
store i32 %29, i32* %30
%31 = getelementptr inbounds [6 x i8], [6 x i8]* %9, i64 0, i64 5
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = shl i32 %33, 8
%35 = getelementptr inbounds [6 x i8], [6 x i8]* %9, i64 0, i64 4
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
%38 = or i32 %34, %37
%39 = load i32*, i32** %8
store i32 %38, i32* %39
ret void
}

LLVM IR (-O2):
define void @ADXL345_readAccel(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = alloca [6 x i8]
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %5, i64 0, i64 0
%7 = call i32 @ADXL345_readFrom(i32 %0, i32 50, i32 6, i8* %6)
%8 = getelementptr inbounds [6 x i8], [6 x i8]* %5, i64 0, i64 1
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = shl nsw i32 %10, 8
%12 = load i8, i8* %6
%13 = sext i8 %12 to i32
%14 = or i32 %11, %13
store i32 %14, i32* %1
%15 = getelementptr inbounds [6 x i8], [6 x i8]* %5, i64 0, i64 3
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = shl nsw i32 %17, 8
%19 = getelementptr inbounds [6 x i8], [6 x i8]* %5, i64 0, i64 2
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = or i32 %18, %21
store i32 %22, i32* %2
%23 = getelementptr inbounds [6 x i8], [6 x i8]* %5, i64 0, i64 5
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = shl nsw i32 %25, 8
%27 = getelementptr inbounds [6 x i8], [6 x i8]* %5, i64 0, i64 4
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = or i32 %26, %29
store i32 %30, i32* %3
ret void
}