#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*/ bcm2835_i2c_setSlaveAddress(unsigned char);
int /*<<< orphan*/ bcm2835_i2c_write(char const *, int);
void I2C_WriteWordRegister(unsigned char address, unsigned char reg,
                           unsigned char *data) {
  bcm2835_i2c_setSlaveAddress(address);
  unsigned char wr_buf[3];
  wr_buf[0] = reg;
  wr_buf[1] = data[0];
  wr_buf[2] = data[1];
  bcm2835_i2c_write((const char *)wr_buf, 3);
}


x86 assembly (clang, -O0):
<I2C_WriteWordRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %rdx,-0x10(%rbp)
movzbl -0x1(%rbp),%edi
call   1040 <bcm2835_i2c_setSlaveAddress@plt>
mov    -0x2(%rbp),%al
mov    %al,-0x13(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x12(%rbp)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0x11(%rbp)
lea    -0x13(%rbp),%rdi
mov    $0x3,%esi
call   1030 <bcm2835_i2c_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2C_WriteWordRegister>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%ebp
call   1040 <bcm2835_i2c_setSlaveAddress@plt>
mov    %bpl,0x5(%rsp)
mov    (%rbx),%al
mov    %al,0x6(%rsp)
mov    0x1(%rbx),%al
mov    %al,0x7(%rsp)
lea    0x5(%rsp),%rdi
mov    $0x3,%esi
call   1030 <bcm2835_i2c_write@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @I2C_WriteWordRegister(i8 zeroext %0, i8 zeroext %1, i8* %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8*
%7 = alloca [3 x i8]
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8* %2, i8** %6
%8 = load i8, i8* %4
%9 = call i32 @bcm2835_i2c_setSlaveAddress(i8 zeroext %8)
%10 = load i8, i8* %5
%11 = getelementptr inbounds [3 x i8], [3 x i8]* %7, i64 0, i64 0
store i8 %10, i8* %11
%12 = load i8*, i8** %6
%13 = getelementptr inbounds i8, i8* %12, i64 0
%14 = load i8, i8* %13
%15 = getelementptr inbounds [3 x i8], [3 x i8]* %7, i64 0, i64 1
store i8 %14, i8* %15
%16 = load i8*, i8** %6
%17 = getelementptr inbounds i8, i8* %16, i64 1
%18 = load i8, i8* %17
%19 = getelementptr inbounds [3 x i8], [3 x i8]* %7, i64 0, i64 2
store i8 %18, i8* %19
%20 = getelementptr inbounds [3 x i8], [3 x i8]* %7, i64 0, i64 0
%21 = call i32 @bcm2835_i2c_write(i8* %20, i32 3)
ret void
}

LLVM IR (-O2):
define void @I2C_WriteWordRegister(i8 zeroext %0, i8 zeroext %1, i8* nocapture %2) {
%4 = alloca [3 x i8]
%5 = tail call i32 @bcm2835_i2c_setSlaveAddress(i8 zeroext %0)
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 0
store i8 %1, i8* %6
%7 = load i8, i8* %2
%8 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 1
store i8 %7, i8* %8
%9 = getelementptr inbounds i8, i8* %2, i64 1
%10 = load i8, i8* %9
%11 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 2
store i8 %10, i8* %11
%12 = call i32 @bcm2835_i2c_write(i8* %6, i32 3)
ret void
}