#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 */
typedef int /*<<< orphan*/ pucRow2;
typedef int /*<<< orphan*/ pucRow1;

/* Variables and functions */
int /*<<< orphan*/ OSRAMWriteArray(unsigned char const *, int);
int /*<<< orphan*/ OSRAMWriteByte(int);
int /*<<< orphan*/ OSRAMWriteFinal(int);
int /*<<< orphan*/ OSRAMWriteFirst(int);
void OSRAMClear(void) {
  static const unsigned char pucRow1[] = {0xb0, 0x80, 0x04, 0x80, 0x12, 0x40};
  static const unsigned char pucRow2[] = {0xb1, 0x80, 0x04, 0x80, 0x12, 0x40};
  unsigned long ulIdx;
  OSRAMWriteFirst(0x80);
  OSRAMWriteArray(pucRow1, sizeof(pucRow1));
  for (ulIdx = 0; ulIdx < 95; ulIdx++) {
    OSRAMWriteByte(0x00);
  }
  OSRAMWriteFinal(0x00);
  OSRAMWriteFirst(0x80);
  OSRAMWriteArray(pucRow2, sizeof(pucRow2));
  for (ulIdx = 0; ulIdx < 95; ulIdx++) {
    OSRAMWriteByte(0x00);
  }
  OSRAMWriteFinal(0x00);
}


x86 assembly (clang, -O0):
<OSRAMClear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x80,%edi
call   1060 <OSRAMWriteFirst@plt>
lea    0xea7(%rip),%rdi
mov    $0x6,%esi
call   1030 <OSRAMWriteArray@plt>
movq   $0x0,-0x8(%rbp)
cmpq   $0x5f,-0x8(%rbp)
jae    118e <OSRAMClear+0x4e>
xor    %edi,%edi
call   1050 <OSRAMWriteByte@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    116b <OSRAMClear+0x2b>
xor    %edi,%edi
call   1040 <OSRAMWriteFinal@plt>
mov    $0x80,%edi
call   1060 <OSRAMWriteFirst@plt>
lea    0xe60(%rip),%rdi
mov    $0x6,%esi
call   1030 <OSRAMWriteArray@plt>
movq   $0x0,-0x8(%rbp)
cmpq   $0x5f,-0x8(%rbp)
jae    11db <OSRAMClear+0x9b>
xor    %edi,%edi
call   1050 <OSRAMWriteByte@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    11b8 <OSRAMClear+0x78>
xor    %edi,%edi
call   1040 <OSRAMWriteFinal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OSRAMClear>:
push   %rbx
mov    $0x80,%edi
call   1060 <OSRAMWriteFirst@plt>
lea    0xeae(%rip),%rdi
mov    $0x6,%esi
call   1030 <OSRAMWriteArray@plt>
mov    $0x5f,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %edi,%edi
call   1050 <OSRAMWriteByte@plt>
add    $0xffffffffffffffff,%rbx
jne    1170 <OSRAMClear+0x30>
xor    %edi,%edi
call   1040 <OSRAMWriteFinal@plt>
mov    $0x80,%edi
call   1060 <OSRAMWriteFirst@plt>
lea    0xe71(%rip),%rdi
mov    $0x6,%esi
call   1030 <OSRAMWriteArray@plt>
mov    $0x5f,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %edi,%edi
call   1050 <OSRAMWriteByte@plt>
add    $0xffffffffffffffff,%rbx
jne    11b0 <OSRAMClear+0x70>
xor    %edi,%edi
pop    %rbx
jmp    1040 <OSRAMWriteFinal@plt>

LLVM IR (-O0):
@OSRAMClear.pucRow1 = internal constant [6 x i8] c"\B0\80\04\80\12@"
@OSRAMClear.pucRow2 = internal constant [6 x i8] c"\B1\80\04\80\12@"
define void @OSRAMClear() {
%1 = alloca i64
%2 = call i32 @OSRAMWriteFirst(i32 128)
%3 = call i32 @OSRAMWriteArray(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @OSRAMClear.pucRow1, i64 0, i64 0), i32 6)
store i64 0, i64* %1
br label %4
4: ; preds = %9, %0
%5 = load i64, i64* %1
%6 = icmp ult i64 %5, 95
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = call i32 @OSRAMWriteByte(i32 0)
br label %9
9: ; preds = %7
%10 = load i64, i64* %1
%11 = add i64 %10, 1
store i64 %11, i64* %1
br label %4
12: ; preds = %4
%13 = call i32 @OSRAMWriteFinal(i32 0)
%14 = call i32 @OSRAMWriteFirst(i32 128)
%15 = call i32 @OSRAMWriteArray(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @OSRAMClear.pucRow2, i64 0, i64 0), i32 6)
store i64 0, i64* %1
br label %16
16: ; preds = %21, %12
%17 = load i64, i64* %1
%18 = icmp ult i64 %17, 95
br i1 %18, label %19, label %24
19: ; preds = %16
%20 = call i32 @OSRAMWriteByte(i32 0)
br label %21
21: ; preds = %19
%22 = load i64, i64* %1
%23 = add i64 %22, 1
store i64 %23, i64* %1
br label %16
24: ; preds = %16
%25 = call i32 @OSRAMWriteFinal(i32 0)
ret void
}

LLVM IR (-O2):
@OSRAMClear.pucRow1 = internal constant [6 x i8] c"\B0\80\04\80\12@"
@OSRAMClear.pucRow2 = internal constant [6 x i8] c"\B1\80\04\80\12@"
define void @OSRAMClear() {
%1 = tail call i32 @OSRAMWriteFirst(i32 128)
%2 = tail call i32 @OSRAMWriteArray(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @OSRAMClear.pucRow1, i64 0, i64 0), i32 6)
br label %3
3: ; preds = %0, %3
%4 = phi i64 [ 0, %0 ], [ %6, %3 ]
%5 = tail call i32 @OSRAMWriteByte(i32 0)
%6 = add nuw nsw i64 %4, 1
%7 = icmp eq i64 %6, 95
br i1 %7, label %8, label %3
8: ; preds = %3
%9 = tail call i32 @OSRAMWriteFinal(i32 0)
%10 = tail call i32 @OSRAMWriteFirst(i32 128)
%11 = tail call i32 @OSRAMWriteArray(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @OSRAMClear.pucRow2, i64 0, i64 0), i32 6)
br label %12
12: ; preds = %8, %12
%13 = phi i64 [ 0, %8 ], [ %15, %12 ]
%14 = tail call i32 @OSRAMWriteByte(i32 0)
%15 = add nuw nsw i64 %13, 1
%16 = icmp eq i64 %15, 95
br i1 %16, label %17, label %12
17: ; preds = %12
%18 = tail call i32 @OSRAMWriteFinal(i32 0)
ret void
}