#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*/ printf(char *);
int i2c_error(int i2cError) {
  if (i2cError & -1) {
    printf("Failed to open I2C-Port\r\n");
  }
  if (i2cError & -2) {
    printf("Failed to setup I2C-Port\r\n");
  }
  if (i2cError & -4) {
    printf("I2C read error\r\n");
  }
  if (i2cError & -8) {
    printf("I2C write error\r\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<i2c_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffffffff,%eax
cmp    $0x0,%eax
je     1136 <i2c_error+0x26>
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
and    $0xfffffffe,%eax
cmp    $0x0,%eax
je     1151 <i2c_error+0x41>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
and    $0xfffffffc,%eax
cmp    $0x0,%eax
je     116c <i2c_error+0x5c>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
and    $0xfffffff8,%eax
cmp    $0x0,%eax
je     1187 <i2c_error+0x77>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_error>:
push   %rbx
test   %edi,%edi
je     1156 <i2c_error+0x46>
mov    %edi,%ebx
lea    0xf1d(%rip),%rdi
call   1030 <puts@plt>
cmp    $0x1,%ebx
je     1156 <i2c_error+0x46>
lea    0xef2(%rip),%rdi
call   1030 <puts@plt>
cmp    $0x4,%ebx
jb     1156 <i2c_error+0x46>
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
cmp    $0x8,%ebx
jb     1156 <i2c_error+0x46>
lea    0xeaf(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Failed to open I2C-Port\0D\0A\00"
@.str.1 = [27 x i8] c"Failed to setup I2C-Port\0D\0A\00"
@.str.2 = [17 x i8] c"I2C read error\0D\0A\00"
@.str.3 = [18 x i8] c"I2C write error\0D\0A\00"
define i32 @i2c_error(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -1
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = load i32, i32* %2
%10 = and i32 %9, -2
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %8
%15 = load i32, i32* %2
%16 = and i32 %15, -4
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
br label %20
20: ; preds = %18, %14
%21 = load i32, i32* %2
%22 = and i32 %21, -8
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %20
%25 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
br label %26
26: ; preds = %24, %20
ret i32 0
}

LLVM IR (-O2):
@str = [17 x i8] c"I2C write error\0D\00"
@str.4 = [16 x i8] c"I2C read error\0D\00"
@str.5 = [26 x i8] c"Failed to setup I2C-Port\0D\00"
@str.6 = [25 x i8] c"Failed to open I2C-Port\0D\00"
define i32 @i2c_error(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.6, i64 0, i64 0))
%5 = icmp eq i32 %0, 1
br i1 %5, label %14, label %6
6: ; preds = %3
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.5, i64 0, i64 0))
%8 = icmp ult i32 %0, 4
br i1 %8, label %14, label %9
9: ; preds = %6
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.4, i64 0, i64 0))
%11 = icmp ult i32 %0, 8
br i1 %11, label %14, label %12
12: ; preds = %9
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
br label %14
14: ; preds = %1, %3, %6, %12, %9
ret i32 0
}