#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*/ sendCommand(int);
int /*<<< orphan*/ sendData(int);
void draw_Square(void) {
  sendCommand(0b10110011);
  for (int j = 16; j < 24; j++) {
    sendCommand(0b00001111 & j);
    sendCommand((0b00001111 & (j >> 4)) | (1 << 4));
    sendData(0xFF);
  }
}


x86 assembly (clang, -O0):
<draw_Square>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xb3,%edi
call   1030 <sendCommand@plt>
movl   $0x10,-0x4(%rbp)
cmpl   $0x18,-0x4(%rbp)
jge    1177 <draw_Square+0x57>
mov    -0x4(%rbp),%edi
and    $0xf,%edi
call   1030 <sendCommand@plt>
mov    -0x4(%rbp),%edi
sar    $0x4,%edi
and    $0xf,%edi
or     $0x10,%edi
call   1030 <sendCommand@plt>
mov    $0xff,%edi
call   1040 <sendData@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1139 <draw_Square+0x19>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_Square>:
push   %rax
mov    $0xb3,%edi
call   1030 <sendCommand@plt>
xor    %edi,%edi
call   1030 <sendCommand@plt>
mov    $0x11,%edi
call   1030 <sendCommand@plt>
mov    $0xff,%edi
call   1040 <sendData@plt>
mov    $0x1,%edi
call   1030 <sendCommand@plt>
mov    $0x11,%edi
call   1030 <sendCommand@plt>
mov    $0xff,%edi
call   1040 <sendData@plt>
mov    $0x2,%edi
call   1030 <sendCommand@plt>
mov    $0x11,%edi
call   1030 <sendCommand@plt>
mov    $0xff,%edi
call   1040 <sendData@plt>
mov    $0x3,%edi
call   1030 <sendCommand@plt>
mov    $0x11,%edi
call   1030 <sendCommand@plt>
mov    $0xff,%edi
call   1040 <sendData@plt>
mov    $0x4,%edi
call   1030 <sendCommand@plt>
mov    $0x11,%edi
call   1030 <sendCommand@plt>
mov    $0xff,%edi
call   1040 <sendData@plt>
mov    $0x5,%edi
call   1030 <sendCommand@plt>
mov    $0x11,%edi
call   1030 <sendCommand@plt>
mov    $0xff,%edi
call   1040 <sendData@plt>
mov    $0x6,%edi
call   1030 <sendCommand@plt>
mov    $0x11,%edi
call   1030 <sendCommand@plt>
mov    $0xff,%edi
call   1040 <sendData@plt>
mov    $0x7,%edi
call   1030 <sendCommand@plt>
mov    $0x11,%edi
call   1030 <sendCommand@plt>
mov    $0xff,%edi
pop    %rax
jmp    1040 <sendData@plt>

LLVM IR (-O0):
define void @draw_Square() {
%1 = alloca i32
%2 = call i32 @sendCommand(i32 179)
store i32 16, i32* %1
br label %3
3: ; preds = %16, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 24
br i1 %5, label %6, label %19
6: ; preds = %3
%7 = load i32, i32* %1
%8 = and i32 15, %7
%9 = call i32 @sendCommand(i32 %8)
%10 = load i32, i32* %1
%11 = ashr i32 %10, 4
%12 = and i32 15, %11
%13 = or i32 %12, 16
%14 = call i32 @sendCommand(i32 %13)
%15 = call i32 @sendData(i32 255)
br label %16
16: ; preds = %6
%17 = load i32, i32* %1
%18 = add nsw i32 %17, 1
store i32 %18, i32* %1
br label %3
19: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @draw_Square() {
%1 = tail call i32 @sendCommand(i32 179)
%2 = tail call i32 @sendCommand(i32 0)
%3 = tail call i32 @sendCommand(i32 17)
%4 = tail call i32 @sendData(i32 255)
%5 = tail call i32 @sendCommand(i32 1)
%6 = tail call i32 @sendCommand(i32 17)
%7 = tail call i32 @sendData(i32 255)
%8 = tail call i32 @sendCommand(i32 2)
%9 = tail call i32 @sendCommand(i32 17)
%10 = tail call i32 @sendData(i32 255)
%11 = tail call i32 @sendCommand(i32 3)
%12 = tail call i32 @sendCommand(i32 17)
%13 = tail call i32 @sendData(i32 255)
%14 = tail call i32 @sendCommand(i32 4)
%15 = tail call i32 @sendCommand(i32 17)
%16 = tail call i32 @sendData(i32 255)
%17 = tail call i32 @sendCommand(i32 5)
%18 = tail call i32 @sendCommand(i32 17)
%19 = tail call i32 @sendData(i32 255)
%20 = tail call i32 @sendCommand(i32 6)
%21 = tail call i32 @sendCommand(i32 17)
%22 = tail call i32 @sendData(i32 255)
%23 = tail call i32 @sendCommand(i32 7)
%24 = tail call i32 @sendCommand(i32 17)
%25 = tail call i32 @sendData(i32 255)
ret void
}