#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*/ LCD_Cursor(unsigned char);
int /*<<< orphan*/ LCD_WriteData(int);
void animate_bar_gen(unsigned char pos) {
  pos -= 3;
  LCD_Cursor(pos);
  if (pos >= 22 && pos < 16 * 2 + 1)
    LCD_WriteData(0xFF);
  ++pos;
  LCD_Cursor(pos);
  if (pos >= 22 && pos < 16 * 2 + 1)
    LCD_WriteData(0x7C);
  ++pos;
  LCD_Cursor(pos);
  if (pos >= 22 && pos < 16 * 2 + 1)
    LCD_WriteData(0x2F);
  ++pos;
  LCD_Cursor(pos);
  if (pos >= 22 && pos < 16 * 2 + 1)
    LCD_WriteData(0xB0);
}


x86 assembly (clang, -O0):
<animate_bar_gen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
sub    $0x3,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <LCD_Cursor@plt>
movzbl -0x1(%rbp),%eax
cmp    $0x16,%eax
jl     1165 <animate_bar_gen+0x45>
movzbl -0x1(%rbp),%eax
cmp    $0x21,%eax
jge    1165 <animate_bar_gen+0x45>
mov    $0xff,%edi
call   1040 <LCD_WriteData@plt>
mov    -0x1(%rbp),%al
add    $0x1,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <LCD_Cursor@plt>
movzbl -0x1(%rbp),%eax
cmp    $0x16,%eax
jl     119a <animate_bar_gen+0x7a>
movzbl -0x1(%rbp),%eax
cmp    $0x21,%eax
jge    119a <animate_bar_gen+0x7a>
mov    $0x7c,%edi
call   1040 <LCD_WriteData@plt>
mov    -0x1(%rbp),%al
add    $0x1,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <LCD_Cursor@plt>
movzbl -0x1(%rbp),%eax
cmp    $0x16,%eax
jl     11cf <animate_bar_gen+0xaf>
movzbl -0x1(%rbp),%eax
cmp    $0x21,%eax
jge    11cf <animate_bar_gen+0xaf>
mov    $0x2f,%edi
call   1040 <LCD_WriteData@plt>
mov    -0x1(%rbp),%al
add    $0x1,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <LCD_Cursor@plt>
movzbl -0x1(%rbp),%eax
cmp    $0x16,%eax
jl     1204 <animate_bar_gen+0xe4>
movzbl -0x1(%rbp),%eax
cmp    $0x21,%eax
jge    1204 <animate_bar_gen+0xe4>
mov    $0xb0,%edi
call   1040 <LCD_WriteData@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<animate_bar_gen>:
push   %rbx
mov    %edi,%ebx
lea    -0x3(%rbx),%eax
movzbl %al,%edi
call   1030 <LCD_Cursor@plt>
lea    -0x19(%rbx),%eax
cmp    $0xa,%al
ja     113f <animate_bar_gen+0x1f>
mov    $0xff,%edi
call   1040 <LCD_WriteData@plt>
lea    -0x2(%rbx),%eax
movzbl %al,%edi
call   1030 <LCD_Cursor@plt>
lea    -0x18(%rbx),%eax
cmp    $0xa,%al
ja     115b <animate_bar_gen+0x3b>
mov    $0x7c,%edi
call   1040 <LCD_WriteData@plt>
lea    -0x1(%rbx),%eax
movzbl %al,%edi
call   1030 <LCD_Cursor@plt>
lea    -0x17(%rbx),%eax
cmp    $0xa,%al
ja     1177 <animate_bar_gen+0x57>
mov    $0x2f,%edi
call   1040 <LCD_WriteData@plt>
movzbl %bl,%edi
call   1030 <LCD_Cursor@plt>
add    $0xea,%bl
cmp    $0xa,%bl
ja     1192 <animate_bar_gen+0x72>
mov    $0xb0,%edi
pop    %rbx
jmp    1040 <LCD_WriteData@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @animate_bar_gen(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = sub nsw i32 %4, 3
%6 = trunc i32 %5 to i8
store i8 %6, i8* %2
%7 = load i8, i8* %2
%8 = call i32 @LCD_Cursor(i8 zeroext %7)
%9 = load i8, i8* %2
%10 = zext i8 %9 to i32
%11 = icmp sge i32 %10, 22
br i1 %11, label %12, label %18
12: ; preds = %1
%13 = load i8, i8* %2
%14 = zext i8 %13 to i32
%15 = icmp slt i32 %14, 33
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = call i32 @LCD_WriteData(i32 255)
br label %18
18: ; preds = %16, %12, %1
%19 = load i8, i8* %2
%20 = add i8 %19, 1
store i8 %20, i8* %2
%21 = load i8, i8* %2
%22 = call i32 @LCD_Cursor(i8 zeroext %21)
%23 = load i8, i8* %2
%24 = zext i8 %23 to i32
%25 = icmp sge i32 %24, 22
br i1 %25, label %26, label %32
26: ; preds = %18
%27 = load i8, i8* %2
%28 = zext i8 %27 to i32
%29 = icmp slt i32 %28, 33
br i1 %29, label %30, label %32
30: ; preds = %26
%31 = call i32 @LCD_WriteData(i32 124)
br label %32
32: ; preds = %30, %26, %18
%33 = load i8, i8* %2
%34 = add i8 %33, 1
store i8 %34, i8* %2
%35 = load i8, i8* %2
%36 = call i32 @LCD_Cursor(i8 zeroext %35)
%37 = load i8, i8* %2
%38 = zext i8 %37 to i32
%39 = icmp sge i32 %38, 22
br i1 %39, label %40, label %46
40: ; preds = %32
%41 = load i8, i8* %2
%42 = zext i8 %41 to i32
%43 = icmp slt i32 %42, 33
br i1 %43, label %44, label %46
44: ; preds = %40
%45 = call i32 @LCD_WriteData(i32 47)
br label %46
46: ; preds = %44, %40, %32
%47 = load i8, i8* %2
%48 = add i8 %47, 1
store i8 %48, i8* %2
%49 = load i8, i8* %2
%50 = call i32 @LCD_Cursor(i8 zeroext %49)
%51 = load i8, i8* %2
%52 = zext i8 %51 to i32
%53 = icmp sge i32 %52, 22
br i1 %53, label %54, label %60
54: ; preds = %46
%55 = load i8, i8* %2
%56 = zext i8 %55 to i32
%57 = icmp slt i32 %56, 33
br i1 %57, label %58, label %60
58: ; preds = %54
%59 = call i32 @LCD_WriteData(i32 176)
br label %60
60: ; preds = %58, %54, %46
ret void
}

LLVM IR (-O2):
define void @animate_bar_gen(i8 zeroext %0) {
%2 = add i8 %0, -3
%3 = tail call i32 @LCD_Cursor(i8 zeroext %2)
%4 = add i8 %0, -25
%5 = icmp ult i8 %4, 11
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @LCD_WriteData(i32 255)
br label %8
8: ; preds = %6, %1
%9 = add i8 %0, -2
%10 = tail call i32 @LCD_Cursor(i8 zeroext %9)
%11 = add i8 %0, -24
%12 = icmp ult i8 %11, 11
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = tail call i32 @LCD_WriteData(i32 124)
br label %15
15: ; preds = %13, %8
%16 = add i8 %0, -1
%17 = tail call i32 @LCD_Cursor(i8 zeroext %16)
%18 = add i8 %0, -23
%19 = icmp ult i8 %18, 11
br i1 %19, label %20, label %22
20: ; preds = %15
%21 = tail call i32 @LCD_WriteData(i32 47)
br label %22
22: ; preds = %20, %15
%23 = tail call i32 @LCD_Cursor(i8 zeroext %0)
%24 = add i8 %0, -22
%25 = icmp ult i8 %24, 11
br i1 %25, label %26, label %28
26: ; preds = %22
%27 = tail call i32 @LCD_WriteData(i32 176)
br label %28
28: ; preds = %26, %22
ret void
}