#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*/ bitbang_io(unsigned char *, int, int /*<<< orphan*/);
scalar_t__ bitbang_open(char *, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ max_command(int, int);
void max_init(int intensity) {
  if (bitbang_open("FT232R USB UART", 0x10 | 0x08 | 0x01) < 0) {
    exit(-1);
  }
  unsigned char c = 0x10;
  bitbang_io(&c, 1, 0);
  max_command(0x0b, 7);
  max_command(0x09, 0);
  max_command(0x0c, 1);
  max_command(0x0f, 0);
  max_command(0x0a, intensity);
}


x86 assembly (clang, -O0):
<max_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xeae(%rip),%rdi
mov    $0x19,%esi
call   1060 <bitbang_open@plt>
cmp    $0x0,%rax
jge    1170 <max_init+0x30>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
movb   $0x10,-0x5(%rbp)
lea    -0x5(%rbp),%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1050 <bitbang_io@plt>
mov    $0xb,%edi
mov    $0x7,%esi
call   1030 <max_command@plt>
mov    $0x9,%edi
xor    %esi,%esi
call   1030 <max_command@plt>
mov    $0xc,%edi
mov    $0x1,%esi
call   1030 <max_command@plt>
mov    $0xf,%edi
xor    %esi,%esi
call   1030 <max_command@plt>
mov    -0x4(%rbp),%esi
mov    $0xa,%edi
call   1030 <max_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_init>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0xeb2(%rip),%rdi
mov    $0x19,%esi
call   1060 <bitbang_open@plt>
test   %rax,%rax
js     11bb <max_init+0x7b>
movb   $0x10,0xf(%rsp)
lea    0xf(%rsp),%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1050 <bitbang_io@plt>
mov    $0xb,%edi
mov    $0x7,%esi
call   1030 <max_command@plt>
mov    $0x9,%edi
xor    %esi,%esi
call   1030 <max_command@plt>
mov    $0xc,%edi
mov    $0x1,%esi
call   1030 <max_command@plt>
mov    $0xf,%edi
xor    %esi,%esi
call   1030 <max_command@plt>
mov    $0xa,%edi
mov    %ebx,%esi
call   1030 <max_command@plt>
add    $0x10,%rsp
pop    %rbx
ret
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"FT232R USB UART\00"
define void @max_init(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = call i64 @bitbang_open(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 25)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @exit(i32 -1)
unreachable
8: ; preds = %1
store i8 16, i8* %3
%9 = call i32 @bitbang_io(i8* %3, i32 1, i32 0)
%10 = call i32 @max_command(i32 11, i32 7)
%11 = call i32 @max_command(i32 9, i32 0)
%12 = call i32 @max_command(i32 12, i32 1)
%13 = call i32 @max_command(i32 15, i32 0)
%14 = load i32, i32* %2
%15 = call i32 @max_command(i32 10, i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"FT232R USB UART\00"
define void @max_init(i32 %0) {
%2 = alloca i8
%3 = tail call i64 @bitbang_open(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 25)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %1
store i8 16, i8* %2
%8 = call i32 @bitbang_io(i8* %2, i32 1, i32 0)
%9 = call i32 @max_command(i32 11, i32 7)
%10 = call i32 @max_command(i32 9, i32 0)
%11 = call i32 @max_command(i32 12, i32 1)
%12 = call i32 @max_command(i32 15, i32 0)
%13 = call i32 @max_command(i32 10, i32 %0)
ret void
}