#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*/ CMT1_delay_10us(int);
int /*<<< orphan*/ CMT1_delay_ms(int);
int /*<<< orphan*/ LCD_AQM_wrcmd(int);
void LCD_AQM_contrast_and_power(unsigned char contrast) {
  unsigned char v;
  LCD_AQM_wrcmd(0x38);
  CMT1_delay_10us(3);
  LCD_AQM_wrcmd(0x39);
  CMT1_delay_10us(3);
  LCD_AQM_wrcmd(0x14);
  CMT1_delay_10us(3);
  v = 0x70 + (contrast & 0x0F);
  LCD_AQM_wrcmd(v);
  CMT1_delay_10us(3);
  v = 0x54 + ((contrast >> 4) & 0x03);
  LCD_AQM_wrcmd(v);
  CMT1_delay_10us(3);
  LCD_AQM_wrcmd(0x6C);
  CMT1_delay_ms(200);
  LCD_AQM_wrcmd(0x38);
  CMT1_delay_10us(3);
}


x86 assembly (clang, -O0):
<LCD_AQM_contrast_and_power>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x38,%edi
call   1030 <LCD_AQM_wrcmd@plt>
mov    $0x3,%edi
call   1040 <CMT1_delay_10us@plt>
mov    $0x39,%edi
call   1030 <LCD_AQM_wrcmd@plt>
mov    $0x3,%edi
call   1040 <CMT1_delay_10us@plt>
mov    $0x14,%edi
call   1030 <LCD_AQM_wrcmd@plt>
mov    $0x3,%edi
call   1040 <CMT1_delay_10us@plt>
movzbl -0x1(%rbp),%eax
and    $0xf,%eax
add    $0x70,%eax
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%edi
call   1030 <LCD_AQM_wrcmd@plt>
mov    $0x3,%edi
call   1040 <CMT1_delay_10us@plt>
movzbl -0x1(%rbp),%eax
sar    $0x4,%eax
and    $0x3,%eax
add    $0x54,%eax
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%edi
call   1030 <LCD_AQM_wrcmd@plt>
mov    $0x3,%edi
call   1040 <CMT1_delay_10us@plt>
mov    $0x6c,%edi
call   1030 <LCD_AQM_wrcmd@plt>
mov    $0xc8,%edi
call   1050 <CMT1_delay_ms@plt>
mov    $0x38,%edi
call   1030 <LCD_AQM_wrcmd@plt>
mov    $0x3,%edi
call   1040 <CMT1_delay_10us@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD_AQM_contrast_and_power>:
push   %rbx
mov    %edi,%ebx
mov    $0x38,%edi
call   1030 <LCD_AQM_wrcmd@plt>
mov    $0x3,%edi
call   1040 <CMT1_delay_10us@plt>
mov    $0x39,%edi
call   1030 <LCD_AQM_wrcmd@plt>
mov    $0x3,%edi
call   1040 <CMT1_delay_10us@plt>
mov    $0x14,%edi
call   1030 <LCD_AQM_wrcmd@plt>
mov    $0x3,%edi
call   1040 <CMT1_delay_10us@plt>
mov    %ebx,%eax
and    $0xf,%al
or     $0x70,%al
movzbl %al,%edi
call   1030 <LCD_AQM_wrcmd@plt>
mov    $0x3,%edi
call   1040 <CMT1_delay_10us@plt>
shr    $0x4,%bl
and    $0x3,%bl
or     $0x54,%bl
movzbl %bl,%edi
call   1030 <LCD_AQM_wrcmd@plt>
mov    $0x3,%edi
call   1040 <CMT1_delay_10us@plt>
mov    $0x6c,%edi
call   1030 <LCD_AQM_wrcmd@plt>
mov    $0xc8,%edi
call   1050 <CMT1_delay_ms@plt>
mov    $0x38,%edi
call   1030 <LCD_AQM_wrcmd@plt>
mov    $0x3,%edi
pop    %rbx
jmp    1040 <CMT1_delay_10us@plt>

LLVM IR (-O0):
define void @LCD_AQM_contrast_and_power(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = call i32 @LCD_AQM_wrcmd(i32 56)
%5 = call i32 @CMT1_delay_10us(i32 3)
%6 = call i32 @LCD_AQM_wrcmd(i32 57)
%7 = call i32 @CMT1_delay_10us(i32 3)
%8 = call i32 @LCD_AQM_wrcmd(i32 20)
%9 = call i32 @CMT1_delay_10us(i32 3)
%10 = load i8, i8* %2
%11 = zext i8 %10 to i32
%12 = and i32 %11, 15
%13 = add nsw i32 112, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %3
%15 = load i8, i8* %3
%16 = zext i8 %15 to i32
%17 = call i32 @LCD_AQM_wrcmd(i32 %16)
%18 = call i32 @CMT1_delay_10us(i32 3)
%19 = load i8, i8* %2
%20 = zext i8 %19 to i32
%21 = ashr i32 %20, 4
%22 = and i32 %21, 3
%23 = add nsw i32 84, %22
%24 = trunc i32 %23 to i8
store i8 %24, i8* %3
%25 = load i8, i8* %3
%26 = zext i8 %25 to i32
%27 = call i32 @LCD_AQM_wrcmd(i32 %26)
%28 = call i32 @CMT1_delay_10us(i32 3)
%29 = call i32 @LCD_AQM_wrcmd(i32 108)
%30 = call i32 @CMT1_delay_ms(i32 200)
%31 = call i32 @LCD_AQM_wrcmd(i32 56)
%32 = call i32 @CMT1_delay_10us(i32 3)
ret void
}

LLVM IR (-O2):
define void @LCD_AQM_contrast_and_power(i8 zeroext %0) {
%2 = tail call i32 @LCD_AQM_wrcmd(i32 56)
%3 = tail call i32 @CMT1_delay_10us(i32 3)
%4 = tail call i32 @LCD_AQM_wrcmd(i32 57)
%5 = tail call i32 @CMT1_delay_10us(i32 3)
%6 = tail call i32 @LCD_AQM_wrcmd(i32 20)
%7 = tail call i32 @CMT1_delay_10us(i32 3)
%8 = and i8 %0, 15
%9 = or i8 %8, 112
%10 = zext i8 %9 to i32
%11 = tail call i32 @LCD_AQM_wrcmd(i32 %10)
%12 = tail call i32 @CMT1_delay_10us(i32 3)
%13 = lshr i8 %0, 4
%14 = and i8 %13, 3
%15 = or i8 %14, 84
%16 = zext i8 %15 to i32
%17 = tail call i32 @LCD_AQM_wrcmd(i32 %16)
%18 = tail call i32 @CMT1_delay_10us(i32 3)
%19 = tail call i32 @LCD_AQM_wrcmd(i32 108)
%20 = tail call i32 @CMT1_delay_ms(i32 200)
%21 = tail call i32 @LCD_AQM_wrcmd(i32 56)
%22 = tail call i32 @CMT1_delay_10us(i32 3)
ret void
}