#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*/ gpio_write(int, int);
int /*<<< orphan*/ lcd_reset();
int /*<<< orphan*/ lcd_send_command(int);
int /*<<< orphan*/ lcd_send_data(int);
void lcd_start(int horiz_flag) {
  gpio_write(((('H' == 'A'   ? 0x000
                : 'H' == 'B' ? 0x100
                : 'H' == 'C' ? 0x200
                : 'H' == 'D' ? 0x300
                : 'H' == 'E' ? 0x400
                : 'H' == 'F' ? 0x500
                : 'H' == 'G' ? 0x600
                : 'H' == 'H' ? 0x700
                : 'H' == 'J' ? 0x800
                             : 0x900)
               << 16) |
              (1 << 4)),
             1);
  lcd_reset();
  lcd_send_command(0x36);
  if (horiz_flag) {
    lcd_send_data(0x70);
  } else {
    lcd_send_data(0x00);
  }
  lcd_send_command(0x3A);
  lcd_send_data(0x05);
  lcd_send_command(0xB2);
  lcd_send_data(0x0C);
  lcd_send_data(0x0C);
  lcd_send_data(0x00);
  lcd_send_data(0x33);
  lcd_send_data(0x33);
  lcd_send_command(0xB7);
  lcd_send_data(0x35);
  lcd_send_command(0xBB);
  lcd_send_data(0x19);
  lcd_send_command(0xC0);
  lcd_send_data(0x2C);
  lcd_send_command(0xC2);
  lcd_send_data(0x01);
  lcd_send_command(0xC3);
  lcd_send_data(0x12);
  lcd_send_command(0xC4);
  lcd_send_data(0x20);
  lcd_send_command(0xC6);
  lcd_send_data(0x0F);
  lcd_send_command(0xD0);
  lcd_send_data(0xA4);
  lcd_send_data(0xA1);
  lcd_send_command(0xE0);
  lcd_send_data(0xD0);
  lcd_send_data(0x04);
  lcd_send_data(0x0D);
  lcd_send_data(0x11);
  lcd_send_data(0x13);
  lcd_send_data(0x2B);
  lcd_send_data(0x3F);
  lcd_send_data(0x54);
  lcd_send_data(0x4C);
  lcd_send_data(0x18);
  lcd_send_data(0x0D);
  lcd_send_data(0x0B);
  lcd_send_data(0x1F);
  lcd_send_data(0x23);
  lcd_send_command(0xE1);
  lcd_send_data(0xD0);
  lcd_send_data(0x04);
  lcd_send_data(0x0C);
  lcd_send_data(0x11);
  lcd_send_data(0x13);
  lcd_send_data(0x2C);
  lcd_send_data(0x3F);
  lcd_send_data(0x44);
  lcd_send_data(0x51);
  lcd_send_data(0x2F);
  lcd_send_data(0x1F);
  lcd_send_data(0x1F);
  lcd_send_data(0x20);
  lcd_send_data(0x23);
  lcd_send_command(0x21);
  lcd_send_command(0x11);
  lcd_send_command(0x29);
}


x86 assembly (clang, -O0):
<lcd_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x7000010,%edi
mov    $0x1,%esi
call   1060 <gpio_write@plt>
mov    $0x0,%al
call   1050 <lcd_reset@plt>
mov    $0x36,%edi
call   1040 <lcd_send_command@plt>
cmpl   $0x0,-0x4(%rbp)
je     1184 <lcd_start+0x44>
mov    $0x70,%edi
call   1030 <lcd_send_data@plt>
jmp    118b <lcd_start+0x4b>
xor    %edi,%edi
call   1030 <lcd_send_data@plt>
mov    $0x3a,%edi
call   1040 <lcd_send_command@plt>
mov    $0x5,%edi
call   1030 <lcd_send_data@plt>
mov    $0xb2,%edi
call   1040 <lcd_send_command@plt>
mov    $0xc,%edi
call   1030 <lcd_send_data@plt>
mov    $0xc,%edi
call   1030 <lcd_send_data@plt>
xor    %edi,%edi
call   1030 <lcd_send_data@plt>
mov    $0x33,%edi
call   1030 <lcd_send_data@plt>
mov    $0x33,%edi
call   1030 <lcd_send_data@plt>
mov    $0xb7,%edi
call   1040 <lcd_send_command@plt>
mov    $0x35,%edi
call   1030 <lcd_send_data@plt>
mov    $0xbb,%edi
call   1040 <lcd_send_command@plt>
mov    $0x19,%edi
call   1030 <lcd_send_data@plt>
mov    $0xc0,%edi
call   1040 <lcd_send_command@plt>
mov    $0x2c,%edi
call   1030 <lcd_send_data@plt>
mov    $0xc2,%edi
call   1040 <lcd_send_command@plt>
mov    $0x1,%edi
call   1030 <lcd_send_data@plt>
mov    $0xc3,%edi
call   1040 <lcd_send_command@plt>
mov    $0x12,%edi
call   1030 <lcd_send_data@plt>
mov    $0xc4,%edi
call   1040 <lcd_send_command@plt>
mov    $0x20,%edi
call   1030 <lcd_send_data@plt>
mov    $0xc6,%edi
call   1040 <lcd_send_command@plt>
mov    $0xf,%edi
call   1030 <lcd_send_data@plt>
mov    $0xd0,%edi
call   1040 <lcd_send_command@plt>
mov    $0xa4,%edi
call   1030 <lcd_send_data@plt>
mov    $0xa1,%edi
call   1030 <lcd_send_data@plt>
mov    $0xe0,%edi
call   1040 <lcd_send_command@plt>
mov    $0xd0,%edi
call   1030 <lcd_send_data@plt>
mov    $0x4,%edi
call   1030 <lcd_send_data@plt>
mov    $0xd,%edi
call   1030 <lcd_send_data@plt>
mov    $0x11,%edi
call   1030 <lcd_send_data@plt>
mov    $0x13,%edi
call   1030 <lcd_send_data@plt>
mov    $0x2b,%edi
call   1030 <lcd_send_data@plt>
mov    $0x3f,%edi
call   1030 <lcd_send_data@plt>
mov    $0x54,%edi
call   1030 <lcd_send_data@plt>
mov    $0x4c,%edi
call   1030 <lcd_send_data@plt>
mov    $0x18,%edi
call   1030 <lcd_send_data@plt>
mov    $0xd,%edi
call   1030 <lcd_send_data@plt>
mov    $0xb,%edi
call   1030 <lcd_send_data@plt>
mov    $0x1f,%edi
call   1030 <lcd_send_data@plt>
mov    $0x23,%edi
call   1030 <lcd_send_data@plt>
mov    $0xe1,%edi
call   1040 <lcd_send_command@plt>
mov    $0xd0,%edi
call   1030 <lcd_send_data@plt>
mov    $0x4,%edi
call   1030 <lcd_send_data@plt>
mov    $0xc,%edi
call   1030 <lcd_send_data@plt>
mov    $0x11,%edi
call   1030 <lcd_send_data@plt>
mov    $0x13,%edi
call   1030 <lcd_send_data@plt>
mov    $0x2c,%edi
call   1030 <lcd_send_data@plt>
mov    $0x3f,%edi
call   1030 <lcd_send_data@plt>
mov    $0x44,%edi
call   1030 <lcd_send_data@plt>
mov    $0x51,%edi
call   1030 <lcd_send_data@plt>
mov    $0x2f,%edi
call   1030 <lcd_send_data@plt>
mov    $0x1f,%edi
call   1030 <lcd_send_data@plt>
mov    $0x1f,%edi
call   1030 <lcd_send_data@plt>
mov    $0x20,%edi
call   1030 <lcd_send_data@plt>
mov    $0x23,%edi
call   1030 <lcd_send_data@plt>
mov    $0x21,%edi
call   1040 <lcd_send_command@plt>
mov    $0x11,%edi
call   1040 <lcd_send_command@plt>
mov    $0x29,%edi
call   1040 <lcd_send_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_start>:
push   %rbx
mov    %edi,%ebx
mov    $0x7000010,%edi
mov    $0x1,%esi
call   1060 <gpio_write@plt>
xor    %eax,%eax
call   1050 <lcd_reset@plt>
mov    $0x36,%edi
call   1040 <lcd_send_command@plt>
test   %ebx,%ebx
mov    $0x70,%edi
cmove  %ebx,%edi
call   1030 <lcd_send_data@plt>
mov    $0x3a,%edi
call   1040 <lcd_send_command@plt>
mov    $0x5,%edi
call   1030 <lcd_send_data@plt>
mov    $0xb2,%edi
call   1040 <lcd_send_command@plt>
mov    $0xc,%edi
call   1030 <lcd_send_data@plt>
mov    $0xc,%edi
call   1030 <lcd_send_data@plt>
xor    %edi,%edi
call   1030 <lcd_send_data@plt>
mov    $0x33,%edi
call   1030 <lcd_send_data@plt>
mov    $0x33,%edi
call   1030 <lcd_send_data@plt>
mov    $0xb7,%edi
call   1040 <lcd_send_command@plt>
mov    $0x35,%edi
call   1030 <lcd_send_data@plt>
mov    $0xbb,%edi
call   1040 <lcd_send_command@plt>
mov    $0x19,%edi
call   1030 <lcd_send_data@plt>
mov    $0xc0,%edi
call   1040 <lcd_send_command@plt>
mov    $0x2c,%edi
call   1030 <lcd_send_data@plt>
mov    $0xc2,%edi
call   1040 <lcd_send_command@plt>
mov    $0x1,%edi
call   1030 <lcd_send_data@plt>
mov    $0xc3,%edi
call   1040 <lcd_send_command@plt>
mov    $0x12,%edi
call   1030 <lcd_send_data@plt>
mov    $0xc4,%edi
call   1040 <lcd_send_command@plt>
mov    $0x20,%edi
call   1030 <lcd_send_data@plt>
mov    $0xc6,%edi
call   1040 <lcd_send_command@plt>
mov    $0xf,%edi
call   1030 <lcd_send_data@plt>
mov    $0xd0,%edi
call   1040 <lcd_send_command@plt>
mov    $0xa4,%edi
call   1030 <lcd_send_data@plt>
mov    $0xa1,%edi
call   1030 <lcd_send_data@plt>
mov    $0xe0,%edi
call   1040 <lcd_send_command@plt>
mov    $0xd0,%edi
call   1030 <lcd_send_data@plt>
mov    $0x4,%edi
call   1030 <lcd_send_data@plt>
mov    $0xd,%edi
call   1030 <lcd_send_data@plt>
mov    $0x11,%edi
call   1030 <lcd_send_data@plt>
mov    $0x13,%edi
call   1030 <lcd_send_data@plt>
mov    $0x2b,%edi
call   1030 <lcd_send_data@plt>
mov    $0x3f,%edi
call   1030 <lcd_send_data@plt>
mov    $0x54,%edi
call   1030 <lcd_send_data@plt>
mov    $0x4c,%edi
call   1030 <lcd_send_data@plt>
mov    $0x18,%edi
call   1030 <lcd_send_data@plt>
mov    $0xd,%edi
call   1030 <lcd_send_data@plt>
mov    $0xb,%edi
call   1030 <lcd_send_data@plt>
mov    $0x1f,%edi
call   1030 <lcd_send_data@plt>
mov    $0x23,%edi
call   1030 <lcd_send_data@plt>
mov    $0xe1,%edi
call   1040 <lcd_send_command@plt>
mov    $0xd0,%edi
call   1030 <lcd_send_data@plt>
mov    $0x4,%edi
call   1030 <lcd_send_data@plt>
mov    $0xc,%edi
call   1030 <lcd_send_data@plt>
mov    $0x11,%edi
call   1030 <lcd_send_data@plt>
mov    $0x13,%edi
call   1030 <lcd_send_data@plt>
mov    $0x2c,%edi
call   1030 <lcd_send_data@plt>
mov    $0x3f,%edi
call   1030 <lcd_send_data@plt>
mov    $0x44,%edi
call   1030 <lcd_send_data@plt>
mov    $0x51,%edi
call   1030 <lcd_send_data@plt>
mov    $0x2f,%edi
call   1030 <lcd_send_data@plt>
mov    $0x1f,%edi
call   1030 <lcd_send_data@plt>
mov    $0x1f,%edi
call   1030 <lcd_send_data@plt>
mov    $0x20,%edi
call   1030 <lcd_send_data@plt>
mov    $0x23,%edi
call   1030 <lcd_send_data@plt>
mov    $0x21,%edi
call   1040 <lcd_send_command@plt>
mov    $0x11,%edi
call   1040 <lcd_send_command@plt>
mov    $0x29,%edi
pop    %rbx
jmp    1040 <lcd_send_command@plt>

LLVM IR (-O0):
define void @lcd_start(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @gpio_write(i32 117440528, i32 1)
%4 = call i32 (...) @lcd_reset()
%5 = call i32 @lcd_send_command(i32 54)
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @lcd_send_data(i32 112)
br label %12
10: ; preds = %1
%11 = call i32 @lcd_send_data(i32 0)
br label %12
12: ; preds = %10, %8
%13 = call i32 @lcd_send_command(i32 58)
%14 = call i32 @lcd_send_data(i32 5)
%15 = call i32 @lcd_send_command(i32 178)
%16 = call i32 @lcd_send_data(i32 12)
%17 = call i32 @lcd_send_data(i32 12)
%18 = call i32 @lcd_send_data(i32 0)
%19 = call i32 @lcd_send_data(i32 51)
%20 = call i32 @lcd_send_data(i32 51)
%21 = call i32 @lcd_send_command(i32 183)
%22 = call i32 @lcd_send_data(i32 53)
%23 = call i32 @lcd_send_command(i32 187)
%24 = call i32 @lcd_send_data(i32 25)
%25 = call i32 @lcd_send_command(i32 192)
%26 = call i32 @lcd_send_data(i32 44)
%27 = call i32 @lcd_send_command(i32 194)
%28 = call i32 @lcd_send_data(i32 1)
%29 = call i32 @lcd_send_command(i32 195)
%30 = call i32 @lcd_send_data(i32 18)
%31 = call i32 @lcd_send_command(i32 196)
%32 = call i32 @lcd_send_data(i32 32)
%33 = call i32 @lcd_send_command(i32 198)
%34 = call i32 @lcd_send_data(i32 15)
%35 = call i32 @lcd_send_command(i32 208)
%36 = call i32 @lcd_send_data(i32 164)
%37 = call i32 @lcd_send_data(i32 161)
%38 = call i32 @lcd_send_command(i32 224)
%39 = call i32 @lcd_send_data(i32 208)
%40 = call i32 @lcd_send_data(i32 4)
%41 = call i32 @lcd_send_data(i32 13)
%42 = call i32 @lcd_send_data(i32 17)
%43 = call i32 @lcd_send_data(i32 19)
%44 = call i32 @lcd_send_data(i32 43)
%45 = call i32 @lcd_send_data(i32 63)
%46 = call i32 @lcd_send_data(i32 84)
%47 = call i32 @lcd_send_data(i32 76)
%48 = call i32 @lcd_send_data(i32 24)
%49 = call i32 @lcd_send_data(i32 13)
%50 = call i32 @lcd_send_data(i32 11)
%51 = call i32 @lcd_send_data(i32 31)
%52 = call i32 @lcd_send_data(i32 35)
%53 = call i32 @lcd_send_command(i32 225)
%54 = call i32 @lcd_send_data(i32 208)
%55 = call i32 @lcd_send_data(i32 4)
%56 = call i32 @lcd_send_data(i32 12)
%57 = call i32 @lcd_send_data(i32 17)
%58 = call i32 @lcd_send_data(i32 19)
%59 = call i32 @lcd_send_data(i32 44)
%60 = call i32 @lcd_send_data(i32 63)
%61 = call i32 @lcd_send_data(i32 68)
%62 = call i32 @lcd_send_data(i32 81)
%63 = call i32 @lcd_send_data(i32 47)
%64 = call i32 @lcd_send_data(i32 31)
%65 = call i32 @lcd_send_data(i32 31)
%66 = call i32 @lcd_send_data(i32 32)
%67 = call i32 @lcd_send_data(i32 35)
%68 = call i32 @lcd_send_command(i32 33)
%69 = call i32 @lcd_send_command(i32 17)
%70 = call i32 @lcd_send_command(i32 41)
ret void
}

LLVM IR (-O2):
define void @lcd_start(i32 %0) {
%2 = tail call i32 @gpio_write(i32 117440528, i32 1)
%3 = tail call i32 (...) @lcd_reset()
%4 = tail call i32 @lcd_send_command(i32 54)
%5 = icmp eq i32 %0, 0
%6 = select i1 %5, i32 0, i32 112
%7 = tail call i32 @lcd_send_data(i32 %6)
%8 = tail call i32 @lcd_send_command(i32 58)
%9 = tail call i32 @lcd_send_data(i32 5)
%10 = tail call i32 @lcd_send_command(i32 178)
%11 = tail call i32 @lcd_send_data(i32 12)
%12 = tail call i32 @lcd_send_data(i32 12)
%13 = tail call i32 @lcd_send_data(i32 0)
%14 = tail call i32 @lcd_send_data(i32 51)
%15 = tail call i32 @lcd_send_data(i32 51)
%16 = tail call i32 @lcd_send_command(i32 183)
%17 = tail call i32 @lcd_send_data(i32 53)
%18 = tail call i32 @lcd_send_command(i32 187)
%19 = tail call i32 @lcd_send_data(i32 25)
%20 = tail call i32 @lcd_send_command(i32 192)
%21 = tail call i32 @lcd_send_data(i32 44)
%22 = tail call i32 @lcd_send_command(i32 194)
%23 = tail call i32 @lcd_send_data(i32 1)
%24 = tail call i32 @lcd_send_command(i32 195)
%25 = tail call i32 @lcd_send_data(i32 18)
%26 = tail call i32 @lcd_send_command(i32 196)
%27 = tail call i32 @lcd_send_data(i32 32)
%28 = tail call i32 @lcd_send_command(i32 198)
%29 = tail call i32 @lcd_send_data(i32 15)
%30 = tail call i32 @lcd_send_command(i32 208)
%31 = tail call i32 @lcd_send_data(i32 164)
%32 = tail call i32 @lcd_send_data(i32 161)
%33 = tail call i32 @lcd_send_command(i32 224)
%34 = tail call i32 @lcd_send_data(i32 208)
%35 = tail call i32 @lcd_send_data(i32 4)
%36 = tail call i32 @lcd_send_data(i32 13)
%37 = tail call i32 @lcd_send_data(i32 17)
%38 = tail call i32 @lcd_send_data(i32 19)
%39 = tail call i32 @lcd_send_data(i32 43)
%40 = tail call i32 @lcd_send_data(i32 63)
%41 = tail call i32 @lcd_send_data(i32 84)
%42 = tail call i32 @lcd_send_data(i32 76)
%43 = tail call i32 @lcd_send_data(i32 24)
%44 = tail call i32 @lcd_send_data(i32 13)
%45 = tail call i32 @lcd_send_data(i32 11)
%46 = tail call i32 @lcd_send_data(i32 31)
%47 = tail call i32 @lcd_send_data(i32 35)
%48 = tail call i32 @lcd_send_command(i32 225)
%49 = tail call i32 @lcd_send_data(i32 208)
%50 = tail call i32 @lcd_send_data(i32 4)
%51 = tail call i32 @lcd_send_data(i32 12)
%52 = tail call i32 @lcd_send_data(i32 17)
%53 = tail call i32 @lcd_send_data(i32 19)
%54 = tail call i32 @lcd_send_data(i32 44)
%55 = tail call i32 @lcd_send_data(i32 63)
%56 = tail call i32 @lcd_send_data(i32 68)
%57 = tail call i32 @lcd_send_data(i32 81)
%58 = tail call i32 @lcd_send_data(i32 47)
%59 = tail call i32 @lcd_send_data(i32 31)
%60 = tail call i32 @lcd_send_data(i32 31)
%61 = tail call i32 @lcd_send_data(i32 32)
%62 = tail call i32 @lcd_send_data(i32 35)
%63 = tail call i32 @lcd_send_command(i32 33)
%64 = tail call i32 @lcd_send_command(i32 17)
%65 = tail call i32 @lcd_send_command(i32 41)
ret void
}