#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
int check_args(const int bus_num, const unsigned char i2c_addr) {
  if (bus_num > 1 || bus_num < 0) {
    fprintf(stderr, "Invalid bus number %i, please select 0 or 1\n", bus_num);
    return -1;
  }
  if (i2c_addr == 0) {
    fprintf(
        stderr,
        "Invalid i2c device address, please set proper address of the MLX\n");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<check_args>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     1135 <check_args+0x25>
cmpl   $0x0,-0x8(%rbp)
jge    115b <check_args+0x4b>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
lea    0xeb8(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1192 <check_args+0x82>
movzbl -0x9(%rbp),%eax
cmp    $0x0,%eax
jne    118b <check_args+0x7b>
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
lea    0xeb5(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1192 <check_args+0x82>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_args>:
push   %rax
cmp    $0x2,%edi
jb     1131 <check_args+0x21>
mov    %edi,%edx
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    0xed8(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
jmp    1151 <check_args+0x41>
xor    %eax,%eax
test   %sil,%sil
je     113a <check_args+0x2a>
pop    %rcx
ret
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
lea    0xee3(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [45 x i8] c"Invalid bus number %i, please select 0 or 1\0A\00"
@.str.1 = [66 x i8] c"Invalid i2c device address, please set proper address of the MLX\0A\00"
define i32 @check_args(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
store i32 %0, i32* %4
store i8 %1, i8* %5
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 1
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %8, %2
%12 = load i32, i32* @stderr
%13 = load i32, i32* %4
%14 = call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %13)
store i32 -1, i32* %3
br label %23
15: ; preds = %8
%16 = load i8, i8* %5
%17 = zext i8 %16 to i32
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %15
%20 = load i32, i32* @stderr
%21 = call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %3
br label %23
22: ; preds = %15
store i32 0, i32* %3
br label %23
23: ; preds = %22, %19, %11
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [45 x i8] c"Invalid bus number %i, please select 0 or 1\0A\00"
@.str.1 = [66 x i8] c"Invalid i2c device address, please set proper address of the MLX\0A\00"
define i32 @check_args(i32 %0, i8 zeroext %1) {
%3 = icmp ugt i32 %0, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %12
7: ; preds = %2
%8 = icmp eq i8 %1, 0
br i1 %8, label %9, label %12
9: ; preds = %7
%10 = load i32, i32* @stderr
%11 = tail call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %7, %9, %4
%13 = phi i32 [ -1, %4 ], [ -1, %9 ], [ 0, %7 ]
ret i32 %13
}