#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_Goto(int, unsigned char);
int /*<<< orphan*/ LCD_Write_String(char *);
void LCD_Clear_Line(unsigned char line) {
  LCD_Goto(1, line);
  for (int i = 0; i < 20; i++) {
    LCD_Write_String(" ");
  }
  LCD_Goto(1, line);
}


x86 assembly (clang, -O0):
<LCD_Clear_Line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%edi
movzbl -0x1(%rbp),%esi
call   1030 <LCD_Goto@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x14,-0x8(%rbp)
jge    1167 <LCD_Clear_Line+0x47>
lea    0xeac(%rip),%rdi
call   1040 <LCD_Write_String@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1143 <LCD_Clear_Line+0x23>
mov    $0x1,%edi
movzbl -0x1(%rbp),%esi
call   1030 <LCD_Goto@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD_Clear_Line>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x1,%edi
mov    %ebp,%esi
call   1030 <LCD_Goto@plt>
lea    0xec8(%rip),%rbx
mov    %rbx,%rdi
call   1040 <LCD_Write_String@plt>
mov    %rbx,%rdi
call   1040 <LCD_Write_String@plt>
mov    %rbx,%rdi
call   1040 <LCD_Write_String@plt>
mov    %rbx,%rdi
call   1040 <LCD_Write_String@plt>
mov    %rbx,%rdi
call   1040 <LCD_Write_String@plt>
mov    %rbx,%rdi
call   1040 <LCD_Write_String@plt>
mov    %rbx,%rdi
call   1040 <LCD_Write_String@plt>
mov    %rbx,%rdi
call   1040 <LCD_Write_String@plt>
mov    %rbx,%rdi
call   1040 <LCD_Write_String@plt>
mov    %rbx,%rdi
call   1040 <LCD_Write_String@plt>
mov    %rbx,%rdi
call   1040 <LCD_Write_String@plt>
mov    %rbx,%rdi
call   1040 <LCD_Write_String@plt>
mov    %rbx,%rdi
call   1040 <LCD_Write_String@plt>
mov    %rbx,%rdi
call   1040 <LCD_Write_String@plt>
mov    %rbx,%rdi
call   1040 <LCD_Write_String@plt>
mov    %rbx,%rdi
call   1040 <LCD_Write_String@plt>
mov    %rbx,%rdi
call   1040 <LCD_Write_String@plt>
mov    %rbx,%rdi
call   1040 <LCD_Write_String@plt>
mov    %rbx,%rdi
call   1040 <LCD_Write_String@plt>
mov    %rbx,%rdi
call   1040 <LCD_Write_String@plt>
mov    $0x1,%edi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <LCD_Goto@plt>

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define void @LCD_Clear_Line(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = call i32 @LCD_Goto(i32 1, i8 zeroext %4)
store i32 0, i32* %3
br label %6
6: ; preds = %11, %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 20
br i1 %8, label %9, label %14
9: ; preds = %6
%10 = call i32 @LCD_Write_String(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %6
14: ; preds = %6
%15 = load i8, i8* %2
%16 = call i32 @LCD_Goto(i32 1, i8 zeroext %15)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define void @LCD_Clear_Line(i8 zeroext %0) {
%2 = tail call i32 @LCD_Goto(i32 1, i8 zeroext %0)
%3 = tail call i32 @LCD_Write_String(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @LCD_Write_String(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @LCD_Write_String(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @LCD_Write_String(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @LCD_Write_String(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @LCD_Write_String(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @LCD_Write_String(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @LCD_Write_String(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%11 = tail call i32 @LCD_Write_String(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%12 = tail call i32 @LCD_Write_String(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%13 = tail call i32 @LCD_Write_String(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%14 = tail call i32 @LCD_Write_String(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%15 = tail call i32 @LCD_Write_String(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%16 = tail call i32 @LCD_Write_String(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%17 = tail call i32 @LCD_Write_String(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%18 = tail call i32 @LCD_Write_String(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%19 = tail call i32 @LCD_Write_String(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%20 = tail call i32 @LCD_Write_String(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%21 = tail call i32 @LCD_Write_String(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%22 = tail call i32 @LCD_Write_String(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%23 = tail call i32 @LCD_Goto(i32 1, i8 zeroext %0)
ret void
}