#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*/ LCD_AQM_wrcmd(int);
void LCD_AQM_contrast(unsigned char contrast) {
  unsigned char v;
  LCD_AQM_wrcmd(0x38);
  CMT1_delay_10us(3);
  LCD_AQM_wrcmd(0x39);
  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(0x38);
  CMT1_delay_10us(3);
}


x86 assembly (clang, -O0):
<LCD_AQM_contrast>:
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>
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    $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>:
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    %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    $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(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 = load i8, i8* %2
%9 = zext i8 %8 to i32
%10 = and i32 %9, 15
%11 = add nsw i32 112, %10
%12 = trunc i32 %11 to i8
store i8 %12, i8* %3
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = call i32 @LCD_AQM_wrcmd(i32 %14)
%16 = call i32 @CMT1_delay_10us(i32 3)
%17 = load i8, i8* %2
%18 = zext i8 %17 to i32
%19 = ashr i32 %18, 4
%20 = and i32 %19, 3
%21 = add nsw i32 84, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %3
%23 = load i8, i8* %3
%24 = zext i8 %23 to i32
%25 = call i32 @LCD_AQM_wrcmd(i32 %24)
%26 = call i32 @CMT1_delay_10us(i32 3)
%27 = call i32 @LCD_AQM_wrcmd(i32 56)
%28 = call i32 @CMT1_delay_10us(i32 3)
ret void
}

LLVM IR (-O2):
define void @LCD_AQM_contrast(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 = and i8 %0, 15
%7 = or i8 %6, 112
%8 = zext i8 %7 to i32
%9 = tail call i32 @LCD_AQM_wrcmd(i32 %8)
%10 = tail call i32 @CMT1_delay_10us(i32 3)
%11 = lshr i8 %0, 4
%12 = and i8 %11, 3
%13 = or i8 %12, 84
%14 = zext i8 %13 to i32
%15 = tail call i32 @LCD_AQM_wrcmd(i32 %14)
%16 = tail call i32 @CMT1_delay_10us(i32 3)
%17 = tail call i32 @LCD_AQM_wrcmd(i32 56)
%18 = tail call i32 @CMT1_delay_10us(i32 3)
ret void
}