#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*/ OSD9616_send(int, int);
int /*<<< orphan*/ USBSTK5515_GPIO_setDirection(int, int);
int /*<<< orphan*/ USBSTK5515_GPIO_setOutput(int, int);
int /*<<< orphan*/ USBSTK5515_I2C_init();
int /*<<< orphan*/ USBSTK5515_I2C_write(int, unsigned char *, int);
void LCD_init() {
  unsigned char cmd[10];
  USBSTK5515_I2C_init();
  USBSTK5515_GPIO_setDirection(12, 1);
  USBSTK5515_GPIO_setOutput(12, 1);
  OSD9616_send(0x00, 0x00);
  OSD9616_send(0x00, 0x10);
  OSD9616_send(0x00, 0x40);
  cmd[0] = 0x00 & 0x00FF;
  cmd[1] = 0x81;
  cmd[2] = 0x7f;
  USBSTK5515_I2C_write(0x3C, cmd, 3);
  OSD9616_send(0x00, 0xa0);
  OSD9616_send(0x00, 0xa6);
  cmd[0] = 0x00 & 0x00FF;
  cmd[1] = 0xa8;
  cmd[2] = 0x0f;
  USBSTK5515_I2C_write(0x3C, cmd, 3);
  OSD9616_send(0x00, 0xd3);
  OSD9616_send(0x00, 0x00);
  OSD9616_send(0x00, 0xd5);
  OSD9616_send(0x00, 0xf0);
  cmd[0] = 0x00 & 0x00FF;
  cmd[1] = 0xd9;
  cmd[2] = 0x22;
  USBSTK5515_I2C_write(0x3C, cmd, 3);
  cmd[0] = 0x00 & 0x00FF;
  cmd[1] = 0xda;
  cmd[2] = 0x02;
  USBSTK5515_I2C_write(0x3C, cmd, 3);
  OSD9616_send(0x00, 0xdb);
  OSD9616_send(0x00, 0x49);
  cmd[0] = 0x00 & 0x00FF;
  cmd[1] = 0x8d;
  cmd[2] = 0x14;
  USBSTK5515_I2C_write(0x3C, cmd, 3);
  OSD9616_send(0x00, 0xaf);
  OSD9616_send(0x00, 0x2E);
}


x86 assembly (clang, -O0):
<LCD_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <USBSTK5515_I2C_init@plt>
mov    $0xc,%edi
mov    $0x1,%esi
call   1030 <USBSTK5515_GPIO_setDirection@plt>
mov    $0xc,%edi
mov    $0x1,%esi
call   1070 <USBSTK5515_GPIO_setOutput@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1060 <OSD9616_send@plt>
xor    %edi,%edi
mov    $0x10,%esi
call   1060 <OSD9616_send@plt>
xor    %edi,%edi
mov    $0x40,%esi
call   1060 <OSD9616_send@plt>
movb   $0x0,-0xa(%rbp)
movb   $0x81,-0x9(%rbp)
movb   $0x7f,-0x8(%rbp)
lea    -0xa(%rbp),%rsi
mov    $0x3c,%edi
mov    $0x3,%edx
call   1040 <USBSTK5515_I2C_write@plt>
xor    %edi,%edi
mov    $0xa0,%esi
call   1060 <OSD9616_send@plt>
xor    %edi,%edi
mov    $0xa6,%esi
call   1060 <OSD9616_send@plt>
movb   $0x0,-0xa(%rbp)
movb   $0xa8,-0x9(%rbp)
movb   $0xf,-0x8(%rbp)
lea    -0xa(%rbp),%rsi
mov    $0x3c,%edi
mov    $0x3,%edx
call   1040 <USBSTK5515_I2C_write@plt>
xor    %edi,%edi
mov    $0xd3,%esi
call   1060 <OSD9616_send@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1060 <OSD9616_send@plt>
xor    %edi,%edi
mov    $0xd5,%esi
call   1060 <OSD9616_send@plt>
xor    %edi,%edi
mov    $0xf0,%esi
call   1060 <OSD9616_send@plt>
movb   $0x0,-0xa(%rbp)
movb   $0xd9,-0x9(%rbp)
movb   $0x22,-0x8(%rbp)
lea    -0xa(%rbp),%rsi
mov    $0x3c,%edi
mov    $0x3,%edx
call   1040 <USBSTK5515_I2C_write@plt>
movb   $0x0,-0xa(%rbp)
movb   $0xda,-0x9(%rbp)
movb   $0x2,-0x8(%rbp)
lea    -0xa(%rbp),%rsi
mov    $0x3c,%edi
mov    $0x3,%edx
call   1040 <USBSTK5515_I2C_write@plt>
xor    %edi,%edi
mov    $0xdb,%esi
call   1060 <OSD9616_send@plt>
xor    %edi,%edi
mov    $0x49,%esi
call   1060 <OSD9616_send@plt>
movb   $0x0,-0xa(%rbp)
movb   $0x8d,-0x9(%rbp)
movb   $0x14,-0x8(%rbp)
lea    -0xa(%rbp),%rsi
mov    $0x3c,%edi
mov    $0x3,%edx
call   1040 <USBSTK5515_I2C_write@plt>
xor    %edi,%edi
mov    $0xaf,%esi
call   1060 <OSD9616_send@plt>
xor    %edi,%edi
mov    $0x2e,%esi
call   1060 <OSD9616_send@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD_init>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1050 <USBSTK5515_I2C_init@plt>
mov    $0xc,%edi
mov    $0x1,%esi
call   1030 <USBSTK5515_GPIO_setDirection@plt>
mov    $0xc,%edi
mov    $0x1,%esi
call   1070 <USBSTK5515_GPIO_setOutput@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1060 <OSD9616_send@plt>
xor    %edi,%edi
mov    $0x10,%esi
call   1060 <OSD9616_send@plt>
xor    %edi,%edi
mov    $0x40,%esi
call   1060 <OSD9616_send@plt>
movw   $0x8100,0x6(%rsp)
movb   $0x7f,0x8(%rsp)
lea    0x6(%rsp),%rbx
mov    $0x3c,%edi
mov    %rbx,%rsi
mov    $0x3,%edx
call   1040 <USBSTK5515_I2C_write@plt>
xor    %edi,%edi
mov    $0xa0,%esi
call   1060 <OSD9616_send@plt>
xor    %edi,%edi
mov    $0xa6,%esi
call   1060 <OSD9616_send@plt>
movw   $0xa800,0x6(%rsp)
movb   $0xf,0x8(%rsp)
mov    $0x3c,%edi
mov    %rbx,%rsi
mov    $0x3,%edx
call   1040 <USBSTK5515_I2C_write@plt>
xor    %edi,%edi
mov    $0xd3,%esi
call   1060 <OSD9616_send@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1060 <OSD9616_send@plt>
xor    %edi,%edi
mov    $0xd5,%esi
call   1060 <OSD9616_send@plt>
xor    %edi,%edi
mov    $0xf0,%esi
call   1060 <OSD9616_send@plt>
movw   $0xd900,0x6(%rsp)
movb   $0x22,0x8(%rsp)
mov    $0x3c,%edi
mov    %rbx,%rsi
mov    $0x3,%edx
call   1040 <USBSTK5515_I2C_write@plt>
movw   $0xda00,0x6(%rsp)
movb   $0x2,0x8(%rsp)
mov    $0x3c,%edi
mov    %rbx,%rsi
mov    $0x3,%edx
call   1040 <USBSTK5515_I2C_write@plt>
xor    %edi,%edi
mov    $0xdb,%esi
call   1060 <OSD9616_send@plt>
xor    %edi,%edi
mov    $0x49,%esi
call   1060 <OSD9616_send@plt>
movw   $0x8d00,0x6(%rsp)
movb   $0x14,0x8(%rsp)
mov    $0x3c,%edi
mov    %rbx,%rsi
mov    $0x3,%edx
call   1040 <USBSTK5515_I2C_write@plt>
xor    %edi,%edi
mov    $0xaf,%esi
call   1060 <OSD9616_send@plt>
xor    %edi,%edi
mov    $0x2e,%esi
call   1060 <OSD9616_send@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @LCD_init() {
%1 = alloca [10 x i8]
%2 = call i32 (...) @USBSTK5515_I2C_init()
%3 = call i32 @USBSTK5515_GPIO_setDirection(i32 12, i32 1)
%4 = call i32 @USBSTK5515_GPIO_setOutput(i32 12, i32 1)
%5 = call i32 @OSD9616_send(i32 0, i32 0)
%6 = call i32 @OSD9616_send(i32 0, i32 16)
%7 = call i32 @OSD9616_send(i32 0, i32 64)
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
store i8 0, i8* %8
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 1
store i8 -127, i8* %9
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 2
store i8 127, i8* %10
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%12 = call i32 @USBSTK5515_I2C_write(i32 60, i8* %11, i32 3)
%13 = call i32 @OSD9616_send(i32 0, i32 160)
%14 = call i32 @OSD9616_send(i32 0, i32 166)
%15 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
store i8 0, i8* %15
%16 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 1
store i8 -88, i8* %16
%17 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 2
store i8 15, i8* %17
%18 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%19 = call i32 @USBSTK5515_I2C_write(i32 60, i8* %18, i32 3)
%20 = call i32 @OSD9616_send(i32 0, i32 211)
%21 = call i32 @OSD9616_send(i32 0, i32 0)
%22 = call i32 @OSD9616_send(i32 0, i32 213)
%23 = call i32 @OSD9616_send(i32 0, i32 240)
%24 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
store i8 0, i8* %24
%25 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 1
store i8 -39, i8* %25
%26 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 2
store i8 34, i8* %26
%27 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%28 = call i32 @USBSTK5515_I2C_write(i32 60, i8* %27, i32 3)
%29 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
store i8 0, i8* %29
%30 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 1
store i8 -38, i8* %30
%31 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 2
store i8 2, i8* %31
%32 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%33 = call i32 @USBSTK5515_I2C_write(i32 60, i8* %32, i32 3)
%34 = call i32 @OSD9616_send(i32 0, i32 219)
%35 = call i32 @OSD9616_send(i32 0, i32 73)
%36 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
store i8 0, i8* %36
%37 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 1
store i8 -115, i8* %37
%38 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 2
store i8 20, i8* %38
%39 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%40 = call i32 @USBSTK5515_I2C_write(i32 60, i8* %39, i32 3)
%41 = call i32 @OSD9616_send(i32 0, i32 175)
%42 = call i32 @OSD9616_send(i32 0, i32 46)
ret void
}

LLVM IR (-O2):
define void @LCD_init() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (...) @USBSTK5515_I2C_init()
%4 = tail call i32 @USBSTK5515_GPIO_setDirection(i32 12, i32 1)
%5 = tail call i32 @USBSTK5515_GPIO_setOutput(i32 12, i32 1)
%6 = tail call i32 @OSD9616_send(i32 0, i32 0)
%7 = tail call i32 @OSD9616_send(i32 0, i32 16)
%8 = tail call i32 @OSD9616_send(i32 0, i32 64)
store i8 0, i8* %2
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 1
store i8 -127, i8* %9
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 2
store i8 127, i8* %10
%11 = call i32 @USBSTK5515_I2C_write(i32 60, i8* %2, i32 3)
%12 = call i32 @OSD9616_send(i32 0, i32 160)
%13 = call i32 @OSD9616_send(i32 0, i32 166)
store i8 0, i8* %2
store i8 -88, i8* %9
store i8 15, i8* %10
%14 = call i32 @USBSTK5515_I2C_write(i32 60, i8* %2, i32 3)
%15 = call i32 @OSD9616_send(i32 0, i32 211)
%16 = call i32 @OSD9616_send(i32 0, i32 0)
%17 = call i32 @OSD9616_send(i32 0, i32 213)
%18 = call i32 @OSD9616_send(i32 0, i32 240)
store i8 0, i8* %2
store i8 -39, i8* %9
store i8 34, i8* %10
%19 = call i32 @USBSTK5515_I2C_write(i32 60, i8* %2, i32 3)
store i8 0, i8* %2
store i8 -38, i8* %9
store i8 2, i8* %10
%20 = call i32 @USBSTK5515_I2C_write(i32 60, i8* %2, i32 3)
%21 = call i32 @OSD9616_send(i32 0, i32 219)
%22 = call i32 @OSD9616_send(i32 0, i32 73)
store i8 0, i8* %2
store i8 -115, i8* %9
store i8 20, i8* %10
%23 = call i32 @USBSTK5515_I2C_write(i32 60, i8* %2, i32 3)
%24 = call i32 @OSD9616_send(i32 0, i32 175)
%25 = call i32 @OSD9616_send(i32 0, i32 46)
ret void
}