#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 adxl346_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ adxl346_i2c_write(int, unsigned char *,
                                     struct adxl346_data *);
int adxl346_Initial(struct adxl346_data *adxl346_data) {
  unsigned char buf[1];
  buf[0] = 0x08;
  adxl346_i2c_write(0x2D, buf, adxl346_data);
  buf[0] = 0x01;
  adxl346_i2c_write(0x31, buf, adxl346_data);
  buf[0] = 0x09;
  adxl346_i2c_write(0x2c, buf, adxl346_data);
  return 1;
}


x86 assembly (clang, -O0):
<adxl346_Initial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x8,-0x9(%rbp)
lea    -0x9(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    $0x2d,%edi
call   1030 <adxl346_i2c_write@plt>
movb   $0x1,-0x9(%rbp)
lea    -0x9(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    $0x31,%edi
call   1030 <adxl346_i2c_write@plt>
movb   $0x9,-0x9(%rbp)
lea    -0x9(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    $0x2c,%edi
call   1030 <adxl346_i2c_write@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adxl346_Initial>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movb   $0x8,0x7(%rsp)
lea    0x7(%rsp),%r14
mov    $0x2d,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <adxl346_i2c_write@plt>
movb   $0x1,0x7(%rsp)
mov    $0x31,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <adxl346_i2c_write@plt>
movb   $0x9,0x7(%rsp)
mov    $0x2c,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <adxl346_i2c_write@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.adxl346_data = type { i32 }
define i32 @adxl346_Initial(%struct.adxl346_data* %0) {
%2 = alloca %struct.adxl346_data*
%3 = alloca [1 x i8]
store %struct.adxl346_data* %0, %struct.adxl346_data** %2
%4 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0, i64 0
store i8 8, i8* %4
%5 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0, i64 0
%6 = load %struct.adxl346_data*, %struct.adxl346_data** %2
%7 = call i32 @adxl346_i2c_write(i32 45, i8* %5, %struct.adxl346_data* %6)
%8 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0, i64 0
store i8 1, i8* %8
%9 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0, i64 0
%10 = load %struct.adxl346_data*, %struct.adxl346_data** %2
%11 = call i32 @adxl346_i2c_write(i32 49, i8* %9, %struct.adxl346_data* %10)
%12 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0, i64 0
store i8 9, i8* %12
%13 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0, i64 0
%14 = load %struct.adxl346_data*, %struct.adxl346_data** %2
%15 = call i32 @adxl346_i2c_write(i32 44, i8* %13, %struct.adxl346_data* %14)
ret i32 1
}

LLVM IR (-O2):
%struct.adxl346_data = type { i32 }
define i32 @adxl346_Initial(%struct.adxl346_data* %0) {
%2 = alloca [1 x i8]
%3 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
store i8 8, i8* %3
%4 = call i32 @adxl346_i2c_write(i32 45, i8* %3, %struct.adxl346_data* %0)
store i8 1, i8* %3
%5 = call i32 @adxl346_i2c_write(i32 49, i8* %3, %struct.adxl346_data* %0)
store i8 9, i8* %3
%6 = call i32 @adxl346_i2c_write(i32 44, i8* %3, %struct.adxl346_data* %0)
ret i32 1
}