#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 */
scalar_t__ i2c_write_byte(int, int, int, int);
int mpu6050_init(int device) {
  if (i2c_write_byte(device, 0x68, 0x19, 7) != 0)
    return -3;
  if (i2c_write_byte(device, 0x68, 0x1A, 0x00) != 0)
    return -3;
  if (i2c_write_byte(device, 0x68, 0x1B, 0x00) != 0)
    return -3;
  if (i2c_write_byte(device, 0x68, 0x1C, 0x00) != 0)
    return -3;
  if (i2c_write_byte(device, 0x68, 0x6B, 0x01) != 0)
    return -3;
  return 0;
}


x86 assembly (clang, -O0):
<mpu6050_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x68,%esi
mov    $0x19,%edx
mov    $0x7,%ecx
call   1030 <i2c_write_byte@plt>
cmp    $0x0,%rax
je     1148 <mpu6050_init+0x38>
movl   $0xfffffffd,-0x4(%rbp)
jmp    11fa <mpu6050_init+0xea>
mov    -0x8(%rbp),%edi
mov    $0x68,%esi
mov    $0x1a,%edx
xor    %ecx,%ecx
call   1030 <i2c_write_byte@plt>
cmp    $0x0,%rax
je     1172 <mpu6050_init+0x62>
movl   $0xfffffffd,-0x4(%rbp)
jmp    11fa <mpu6050_init+0xea>
mov    -0x8(%rbp),%edi
mov    $0x68,%esi
mov    $0x1b,%edx
xor    %ecx,%ecx
call   1030 <i2c_write_byte@plt>
cmp    $0x0,%rax
je     119c <mpu6050_init+0x8c>
movl   $0xfffffffd,-0x4(%rbp)
jmp    11fa <mpu6050_init+0xea>
mov    -0x8(%rbp),%edi
mov    $0x68,%esi
mov    $0x1c,%edx
xor    %ecx,%ecx
call   1030 <i2c_write_byte@plt>
cmp    $0x0,%rax
je     11c6 <mpu6050_init+0xb6>
movl   $0xfffffffd,-0x4(%rbp)
jmp    11fa <mpu6050_init+0xea>
mov    -0x8(%rbp),%edi
mov    $0x68,%esi
mov    $0x6b,%edx
mov    $0x1,%ecx
call   1030 <i2c_write_byte@plt>
cmp    $0x0,%rax
je     11f3 <mpu6050_init+0xe3>
movl   $0xfffffffd,-0x4(%rbp)
jmp    11fa <mpu6050_init+0xea>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpu6050_init>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x68,%esi
mov    $0x19,%edx
mov    $0x7,%ecx
call   1030 <i2c_write_byte@plt>
mov    $0xfffffffd,%ebp
test   %rax,%rax
jne    119f <mpu6050_init+0x8f>
mov    %ebx,%edi
mov    $0x68,%esi
mov    $0x1a,%edx
xor    %ecx,%ecx
call   1030 <i2c_write_byte@plt>
test   %rax,%rax
jne    119f <mpu6050_init+0x8f>
mov    %ebx,%edi
mov    $0x68,%esi
mov    $0x1b,%edx
xor    %ecx,%ecx
call   1030 <i2c_write_byte@plt>
test   %rax,%rax
jne    119f <mpu6050_init+0x8f>
mov    %ebx,%edi
mov    $0x68,%esi
mov    $0x1c,%edx
xor    %ecx,%ecx
call   1030 <i2c_write_byte@plt>
test   %rax,%rax
jne    119f <mpu6050_init+0x8f>
mov    %ebx,%edi
mov    $0x68,%esi
mov    $0x6b,%edx
mov    $0x1,%ecx
call   1030 <i2c_write_byte@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
lea    (%rcx,%rcx,2),%ebp
add    $0xfffffffd,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mpu6050_init(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @i2c_write_byte(i32 %4, i32 104, i32 25, i32 7)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -3, i32* %2
br label %29
8: ; preds = %1
%9 = load i32, i32* %3
%10 = call i64 @i2c_write_byte(i32 %9, i32 104, i32 26, i32 0)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 -3, i32* %2
br label %29
13: ; preds = %8
%14 = load i32, i32* %3
%15 = call i64 @i2c_write_byte(i32 %14, i32 104, i32 27, i32 0)
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 -3, i32* %2
br label %29
18: ; preds = %13
%19 = load i32, i32* %3
%20 = call i64 @i2c_write_byte(i32 %19, i32 104, i32 28, i32 0)
%21 = icmp ne i64 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 -3, i32* %2
br label %29
23: ; preds = %18
%24 = load i32, i32* %3
%25 = call i64 @i2c_write_byte(i32 %24, i32 104, i32 107, i32 1)
%26 = icmp ne i64 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %23
store i32 -3, i32* %2
br label %29
28: ; preds = %23
store i32 0, i32* %2
br label %29
29: ; preds = %28, %27, %22, %17, %12, %7
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
define i32 @mpu6050_init(i32 %0) {
%2 = tail call i64 @i2c_write_byte(i32 %0, i32 104, i32 25, i32 7)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %17
4: ; preds = %1
%5 = tail call i64 @i2c_write_byte(i32 %0, i32 104, i32 26, i32 0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = tail call i64 @i2c_write_byte(i32 %0, i32 104, i32 27, i32 0)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %7
%11 = tail call i64 @i2c_write_byte(i32 %0, i32 104, i32 28, i32 0)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %10
%14 = tail call i64 @i2c_write_byte(i32 %0, i32 104, i32 107, i32 1)
%15 = icmp eq i64 %14, 0
%16 = select i1 %15, i32 0, i32 -3
br label %17
17: ; preds = %13, %10, %7, %4, %1
%18 = phi i32 [ -3, %1 ], [ -3, %4 ], [ -3, %7 ], [ -3, %10 ], [ %16, %13 ]
ret i32 %18
}