#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*/ send_data(int /*<<< orphan*/);
int /*<<< orphan*/ set_column_address(int);
int /*<<< orphan*/ set_page_address(int);
void clear_display(void) {
  int i, j;
  for (i = 0; i < 9; i++) {
    set_page_address(i);
    set_column_address(4);
    for (j = 0; j < 128; j++)
      send_data(0);
  }
}


x86 assembly (clang, -O0):
<clear_display>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x9,-0x4(%rbp)
jge    1197 <clear_display+0x67>
mov    -0x4(%rbp),%edi
call   1040 <set_page_address@plt>
mov    $0x4,%edi
call   1030 <set_column_address@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x80,-0x8(%rbp)
jge    1184 <clear_display+0x54>
xor    %edi,%edi
call   1050 <send_data@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1162 <clear_display+0x32>
jmp    1189 <clear_display+0x59>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113f <clear_display+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_display>:
push   %rbx
xor    %edi,%edi
call   1040 <set_page_address@plt>
mov    $0x4,%edi
call   1030 <set_column_address@plt>
mov    $0x80,%ebx
nopw   0x0(%rax,%rax,1)
xor    %edi,%edi
call   1050 <send_data@plt>
add    $0xffffffff,%ebx
jne    1150 <clear_display+0x20>
mov    $0x1,%edi
call   1040 <set_page_address@plt>
mov    $0x4,%edi
call   1030 <set_column_address@plt>
mov    $0x80,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
xor    %edi,%edi
call   1050 <send_data@plt>
add    $0xffffffff,%ebx
jne    1180 <clear_display+0x50>
mov    $0x2,%edi
call   1040 <set_page_address@plt>
mov    $0x4,%edi
call   1030 <set_column_address@plt>
mov    $0x80,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
xor    %edi,%edi
call   1050 <send_data@plt>
add    $0xffffffff,%ebx
jne    11b0 <clear_display+0x80>
mov    $0x3,%edi
call   1040 <set_page_address@plt>
mov    $0x4,%edi
call   1030 <set_column_address@plt>
mov    $0x80,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
xor    %edi,%edi
call   1050 <send_data@plt>
add    $0xffffffff,%ebx
jne    11e0 <clear_display+0xb0>
mov    $0x4,%edi
call   1040 <set_page_address@plt>
mov    $0x4,%edi
call   1030 <set_column_address@plt>
mov    $0x80,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
xor    %edi,%edi
call   1050 <send_data@plt>
add    $0xffffffff,%ebx
jne    1210 <clear_display+0xe0>
mov    $0x5,%edi
call   1040 <set_page_address@plt>
mov    $0x4,%edi
call   1030 <set_column_address@plt>
mov    $0x80,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
xor    %edi,%edi
call   1050 <send_data@plt>
add    $0xffffffff,%ebx
jne    1240 <clear_display+0x110>
mov    $0x6,%edi
call   1040 <set_page_address@plt>
mov    $0x4,%edi
call   1030 <set_column_address@plt>
mov    $0x80,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
xor    %edi,%edi
call   1050 <send_data@plt>
add    $0xffffffff,%ebx
jne    1270 <clear_display+0x140>
mov    $0x7,%edi
call   1040 <set_page_address@plt>
mov    $0x4,%edi
call   1030 <set_column_address@plt>
mov    $0x80,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
xor    %edi,%edi
call   1050 <send_data@plt>
add    $0xffffffff,%ebx
jne    12a0 <clear_display+0x170>
mov    $0x8,%edi
call   1040 <set_page_address@plt>
mov    $0x4,%edi
call   1030 <set_column_address@plt>
mov    $0x80,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
xor    %edi,%edi
call   1050 <send_data@plt>
add    $0xffffffff,%ebx
jne    12d0 <clear_display+0x1a0>
pop    %rbx
ret

LLVM IR (-O0):
define void @clear_display() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %19, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 9
br i1 %5, label %6, label %22
6: ; preds = %3
%7 = load i32, i32* %1
%8 = call i32 @set_page_address(i32 %7)
%9 = call i32 @set_column_address(i32 4)
store i32 0, i32* %2
br label %10
10: ; preds = %15, %6
%11 = load i32, i32* %2
%12 = icmp slt i32 %11, 128
br i1 %12, label %13, label %18
13: ; preds = %10
%14 = call i32 @send_data(i32 0)
br label %15
15: ; preds = %13
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
store i32 %17, i32* %2
br label %10
18: ; preds = %10
br label %19
19: ; preds = %18
%20 = load i32, i32* %1
%21 = add nsw i32 %20, 1
store i32 %21, i32* %1
br label %3
22: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @clear_display() {
%1 = tail call i32 @set_page_address(i32 0)
%2 = tail call i32 @set_column_address(i32 4)
br label %3
3: ; preds = %0, %3
%4 = phi i32 [ 0, %0 ], [ %6, %3 ]
%5 = tail call i32 @send_data(i32 0)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 128
br i1 %7, label %8, label %3
8: ; preds = %3
%9 = tail call i32 @set_page_address(i32 1)
%10 = tail call i32 @set_column_address(i32 4)
br label %11
11: ; preds = %11, %8
%12 = phi i32 [ 0, %8 ], [ %14, %11 ]
%13 = tail call i32 @send_data(i32 0)
%14 = add nuw nsw i32 %12, 1
%15 = icmp eq i32 %14, 128
br i1 %15, label %16, label %11
16: ; preds = %11
%17 = tail call i32 @set_page_address(i32 2)
%18 = tail call i32 @set_column_address(i32 4)
br label %19
19: ; preds = %19, %16
%20 = phi i32 [ 0, %16 ], [ %22, %19 ]
%21 = tail call i32 @send_data(i32 0)
%22 = add nuw nsw i32 %20, 1
%23 = icmp eq i32 %22, 128
br i1 %23, label %24, label %19
24: ; preds = %19
%25 = tail call i32 @set_page_address(i32 3)
%26 = tail call i32 @set_column_address(i32 4)
br label %27
27: ; preds = %27, %24
%28 = phi i32 [ 0, %24 ], [ %30, %27 ]
%29 = tail call i32 @send_data(i32 0)
%30 = add nuw nsw i32 %28, 1
%31 = icmp eq i32 %30, 128
br i1 %31, label %32, label %27
32: ; preds = %27
%33 = tail call i32 @set_page_address(i32 4)
%34 = tail call i32 @set_column_address(i32 4)
br label %35
35: ; preds = %35, %32
%36 = phi i32 [ 0, %32 ], [ %38, %35 ]
%37 = tail call i32 @send_data(i32 0)
%38 = add nuw nsw i32 %36, 1
%39 = icmp eq i32 %38, 128
br i1 %39, label %40, label %35
40: ; preds = %35
%41 = tail call i32 @set_page_address(i32 5)
%42 = tail call i32 @set_column_address(i32 4)
br label %43
43: ; preds = %43, %40
%44 = phi i32 [ 0, %40 ], [ %46, %43 ]
%45 = tail call i32 @send_data(i32 0)
%46 = add nuw nsw i32 %44, 1
%47 = icmp eq i32 %46, 128
br i1 %47, label %48, label %43
48: ; preds = %43
%49 = tail call i32 @set_page_address(i32 6)
%50 = tail call i32 @set_column_address(i32 4)
br label %51
51: ; preds = %51, %48
%52 = phi i32 [ 0, %48 ], [ %54, %51 ]
%53 = tail call i32 @send_data(i32 0)
%54 = add nuw nsw i32 %52, 1
%55 = icmp eq i32 %54, 128
br i1 %55, label %56, label %51
56: ; preds = %51
%57 = tail call i32 @set_page_address(i32 7)
%58 = tail call i32 @set_column_address(i32 4)
br label %59
59: ; preds = %59, %56
%60 = phi i32 [ 0, %56 ], [ %62, %59 ]
%61 = tail call i32 @send_data(i32 0)
%62 = add nuw nsw i32 %60, 1
%63 = icmp eq i32 %62, 128
br i1 %63, label %64, label %59
64: ; preds = %59
%65 = tail call i32 @set_page_address(i32 8)
%66 = tail call i32 @set_column_address(i32 4)
br label %67
67: ; preds = %67, %64
%68 = phi i32 [ 0, %64 ], [ %70, %67 ]
%69 = tail call i32 @send_data(i32 0)
%70 = add nuw nsw i32 %68, 1
%71 = icmp eq i32 %70, 128
br i1 %71, label %72, label %67
72: ; preds = %67
ret void
}