#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*/ delay(int);
int /*<<< orphan*/ display_update(char, int /*<<< orphan*/);
void lcd_init() {
  int lcd_count;
  static char lcd_data_init[6] = {0x38, 0x06, 0x0c, 0x01, 0x80};
  delay(150000);
  for (lcd_count = 0; lcd_count < 6; lcd_count++) {
    display_update(lcd_data_init[lcd_count], 0);
    delay(500000);
  }
  delay(500000);
  return;
}


x86 assembly (clang, -O0):
<lcd_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x249f0,%edi
call   1030 <delay@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x6,-0x4(%rbp)
jge    1171 <lcd_init+0x51>
movslq -0x4(%rbp),%rcx
xor    %esi,%esi
lea    0x2ee0(%rip),%rax
movsbl (%rax,%rcx,1),%edi
call   1040 <display_update@plt>
mov    $0x7a120,%edi
call   1030 <delay@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1139 <lcd_init+0x19>
mov    $0x7a120,%edi
call   1030 <delay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_init>:
push   %rax
mov    $0x249f0,%edi
call   1030 <delay@plt>
mov    $0x38,%edi
xor    %esi,%esi
call   1040 <display_update@plt>
mov    $0x7a120,%edi
call   1030 <delay@plt>
mov    $0x6,%edi
xor    %esi,%esi
call   1040 <display_update@plt>
mov    $0x7a120,%edi
call   1030 <delay@plt>
mov    $0xc,%edi
xor    %esi,%esi
call   1040 <display_update@plt>
mov    $0x7a120,%edi
call   1030 <delay@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1040 <display_update@plt>
mov    $0x7a120,%edi
call   1030 <delay@plt>
mov    $0xffffff80,%edi
xor    %esi,%esi
call   1040 <display_update@plt>
mov    $0x7a120,%edi
call   1030 <delay@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1040 <display_update@plt>
mov    $0x7a120,%edi
call   1030 <delay@plt>
mov    $0x7a120,%edi
pop    %rax
jmp    1030 <delay@plt>

LLVM IR (-O0):
@lcd_init.lcd_data_init = internal global [6 x i8] c"8\06\0C\01\80\00"
define void @lcd_init() {
%1 = alloca i32
%2 = call i32 @delay(i32 150000)
store i32 0, i32* %1
br label %3
3: ; preds = %13, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 6
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = load i32, i32* %1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [6 x i8], [6 x i8]* @lcd_init.lcd_data_init, i64 0, i64 %8
%10 = load i8, i8* %9
%11 = call i32 @display_update(i8 signext %10, i32 0)
%12 = call i32 @delay(i32 500000)
br label %13
13: ; preds = %6
%14 = load i32, i32* %1
%15 = add nsw i32 %14, 1
store i32 %15, i32* %1
br label %3
16: ; preds = %3
%17 = call i32 @delay(i32 500000)
ret void
}

LLVM IR (-O2):
define void @lcd_init() {
%1 = tail call i32 @delay(i32 150000)
%2 = tail call i32 @display_update(i8 signext 56, i32 0)
%3 = tail call i32 @delay(i32 500000)
%4 = tail call i32 @display_update(i8 signext 6, i32 0)
%5 = tail call i32 @delay(i32 500000)
%6 = tail call i32 @display_update(i8 signext 12, i32 0)
%7 = tail call i32 @delay(i32 500000)
%8 = tail call i32 @display_update(i8 signext 1, i32 0)
%9 = tail call i32 @delay(i32 500000)
%10 = tail call i32 @display_update(i8 signext -128, i32 0)
%11 = tail call i32 @delay(i32 500000)
%12 = tail call i32 @display_update(i8 signext 0, i32 0)
%13 = tail call i32 @delay(i32 500000)
%14 = tail call i32 @delay(i32 500000)
ret void
}