#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*/ GLCD_DisplayString(unsigned int, int /*<<< orphan*/,
                                      unsigned char, unsigned char *);
int /*<<< orphan*/ GLCD_WindowMax();
void GLCD_ClearLn(unsigned int ln, unsigned char fi) {
  unsigned char i;
  unsigned char buf[60];
  GLCD_WindowMax();
  switch (fi) {
  case 0:
    for (i = 0; i < (320 + 5) / 6; i++)
      buf[i] = ' ';
    buf[i + 1] = 0;
    break;
  case 1:
    for (i = 0; i < (320 + 15) / 16; i++)
      buf[i] = ' ';
    buf[i + 1] = 0;
    break;
  }
  GLCD_DisplayString(ln, 0, fi, buf);
}


x86 assembly (clang, -O0):
<GLCD_ClearLn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
xor    %eax,%eax
call   1030 <GLCD_WindowMax@plt>
movzbl -0x5(%rbp),%eax
mov    %eax,-0x54(%rbp)
test   %eax,%eax
je     115d <GLCD_ClearLn+0x3d>
jmp    114c <GLCD_ClearLn+0x2c>
mov    -0x54(%rbp),%eax
sub    $0x1,%eax
je     1197 <GLCD_ClearLn+0x77>
jmp    11cc <GLCD_ClearLn+0xac>
movb   $0x0,-0x6(%rbp)
movzbl -0x6(%rbp),%eax
cmp    $0x36,%eax
jge    1184 <GLCD_ClearLn+0x64>
movzbl -0x6(%rbp),%eax
movb   $0x20,-0x50(%rbp,%rax,1)
mov    -0x6(%rbp),%al
add    $0x1,%al
mov    %al,-0x6(%rbp)
jmp    1161 <GLCD_ClearLn+0x41>
movzbl -0x6(%rbp),%eax
add    $0x1,%eax
cltq
movb   $0x0,-0x50(%rbp,%rax,1)
jmp    11cc <GLCD_ClearLn+0xac>
movb   $0x0,-0x6(%rbp)
movzbl -0x6(%rbp),%eax
cmp    $0x14,%eax
jge    11be <GLCD_ClearLn+0x9e>
movzbl -0x6(%rbp),%eax
movb   $0x20,-0x50(%rbp,%rax,1)
mov    -0x6(%rbp),%al
add    $0x1,%al
mov    %al,-0x6(%rbp)
jmp    119b <GLCD_ClearLn+0x7b>
movzbl -0x6(%rbp),%eax
add    $0x1,%eax
cltq
movb   $0x0,-0x50(%rbp,%rax,1)
mov    -0x4(%rbp),%edi
mov    -0x5(%rbp),%al
lea    -0x50(%rbp),%rcx
xor    %esi,%esi
movzbl %al,%edx
call   1040 <GLCD_DisplayString@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GLCD_ClearLn>:
push   %rbp
push   %rbx
sub    $0x48,%rsp
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <GLCD_WindowMax@plt>
test   %ebp,%ebp
je     1155 <GLCD_ClearLn+0x35>
cmp    $0x1,%bpl
jne    1182 <GLCD_ClearLn+0x62>
movaps 0xebe(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x20202020,0x10(%rsp)
20
mov    $0x15,%eax
jmp    117e <GLCD_ClearLn+0x5e>
movabs $0x2020202020202020,%rax
20 20 20
mov    %rax,0x2e(%rsp)
movaps 0xe95(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
mov    $0x37,%eax
movb   $0x0,(%rsp,%rax,1)
movzbl %bpl,%edx
mov    %rsp,%rcx
mov    %ebx,%edi
xor    %esi,%esi
call   1040 <GLCD_DisplayString@plt>
add    $0x48,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @GLCD_ClearLn(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i8
%6 = alloca [60 x i8]
store i32 %0, i32* %3
store i8 %1, i8* %4
%7 = call i32 (...) @GLCD_WindowMax()
%8 = load i8, i8* %4
%9 = zext i8 %8 to i32
switch i32 %9, label %46 [
i32 0, label %10
i32 1, label %28
]
10: ; preds = %2
store i8 0, i8* %5
br label %11
11: ; preds = %19, %10
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = icmp slt i32 %13, 54
br i1 %14, label %15, label %22
15: ; preds = %11
%16 = load i8, i8* %5
%17 = zext i8 %16 to i64
%18 = getelementptr inbounds [60 x i8], [60 x i8]* %6, i64 0, i64 %17
store i8 32, i8* %18
br label %19
19: ; preds = %15
%20 = load i8, i8* %5
%21 = add i8 %20, 1
store i8 %21, i8* %5
br label %11
22: ; preds = %11
%23 = load i8, i8* %5
%24 = zext i8 %23 to i32
%25 = add nsw i32 %24, 1
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [60 x i8], [60 x i8]* %6, i64 0, i64 %26
store i8 0, i8* %27
br label %46
28: ; preds = %2
store i8 0, i8* %5
br label %29
29: ; preds = %37, %28
%30 = load i8, i8* %5
%31 = zext i8 %30 to i32
%32 = icmp slt i32 %31, 20
br i1 %32, label %33, label %40
33: ; preds = %29
%34 = load i8, i8* %5
%35 = zext i8 %34 to i64
%36 = getelementptr inbounds [60 x i8], [60 x i8]* %6, i64 0, i64 %35
store i8 32, i8* %36
br label %37
37: ; preds = %33
%38 = load i8, i8* %5
%39 = add i8 %38, 1
store i8 %39, i8* %5
br label %29
40: ; preds = %29
%41 = load i8, i8* %5
%42 = zext i8 %41 to i32
%43 = add nsw i32 %42, 1
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [60 x i8], [60 x i8]* %6, i64 0, i64 %44
store i8 0, i8* %45
br label %46
46: ; preds = %2, %40, %22
%47 = load i32, i32* %3
%48 = load i8, i8* %4
%49 = getelementptr inbounds [60 x i8], [60 x i8]* %6, i64 0, i64 0
%50 = call i32 @GLCD_DisplayString(i32 %47, i32 0, i8 zeroext %48, i8* %49)
ret void
}

LLVM IR (-O2):
define void @GLCD_ClearLn(i32 %0, i8 zeroext %1) {
%3 = alloca [60 x i8]
%4 = getelementptr inbounds [60 x i8], [60 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds [60 x i8], [60 x i8]* %3, i64 0, i64 0
%6 = tail call i32 (...) @GLCD_WindowMax()
switch i8 %1, label %12 [
i8 0, label %8
i8 1, label %7
]
7: ; preds = %2
br label %9
8: ; preds = %2
br label %9
9: ; preds = %8, %7
%10 = phi i64 [ 21, %7 ], [ 55, %8 ]
%11 = getelementptr inbounds [60 x i8], [60 x i8]* %3, i64 0, i64 %10
store i8 0, i8* %11
br label %12
12: ; preds = %9, %2
%13 = call i32 @GLCD_DisplayString(i32 %0, i32 0, i8 zeroext %1, i8* %5)
ret void
}