#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*/ paintPixel(int, int, char, char, char);
void paintCharSpace(int current_x, int current_y, char B, char G, char R) {
  for (int i = 0; i < 8; i++) {
    for (int j = 0; j < 16; j++) {
      paintPixel(current_x + i, current_y + j, B, G, R);
    }
  }
}


x86 assembly (clang, -O0):
<paintCharSpace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %r8b,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %dl,-0x9(%rbp)
mov    %cl,-0xa(%rbp)
mov    %al,-0xb(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x8,-0x10(%rbp)
jge    118f <paintCharSpace+0x7f>
movl   $0x0,-0x14(%rbp)
cmpl   $0x10,-0x14(%rbp)
jge    117c <paintCharSpace+0x6c>
mov    -0x4(%rbp),%edi
add    -0x10(%rbp),%edi
mov    -0x8(%rbp),%esi
add    -0x14(%rbp),%esi
mov    -0x9(%rbp),%cl
mov    -0xa(%rbp),%al
movsbl %cl,%edx
movsbl %al,%ecx
movsbl -0xb(%rbp),%r8d
call   1030 <paintPixel@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1142 <paintCharSpace+0x32>
jmp    1181 <paintCharSpace+0x71>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1131 <paintCharSpace+0x21>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<paintCharSpace>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %r8d,0x4c(%rsp)
mov    %ecx,0x48(%rsp)
mov    %edx,0x44(%rsp)
mov    %esi,%ebp
mov    %rdi,0x50(%rsp)
lea    0x1(%rbp),%eax
mov    %eax,0x40(%rsp)
lea    0x2(%rbp),%eax
mov    %eax,0x3c(%rsp)
lea    0x3(%rbp),%eax
mov    %eax,0x38(%rsp)
lea    0x4(%rbp),%eax
mov    %eax,0x34(%rsp)
lea    0x5(%rbp),%eax
mov    %eax,0x30(%rsp)
lea    0x6(%rbp),%eax
mov    %eax,0x2c(%rsp)
lea    0x7(%rbp),%eax
mov    %eax,0x28(%rsp)
lea    0x8(%rbp),%eax
mov    %eax,0x24(%rsp)
lea    0x9(%rbp),%eax
mov    %eax,0x20(%rsp)
lea    0xa(%rbp),%eax
mov    %eax,0x1c(%rsp)
lea    0xb(%rbp),%eax
mov    %eax,0x18(%rsp)
lea    0xc(%rbp),%eax
mov    %eax,0x14(%rsp)
lea    0xd(%rbp),%eax
mov    %eax,0x10(%rsp)
lea    0xe(%rbp),%eax
mov    %eax,0xc(%rsp)
lea    0xf(%rbp),%eax
mov    %eax,0x8(%rsp)
xor    %r13d,%r13d
xchg   %ax,%ax
mov    0x50(%rsp),%rax
lea    (%rax,%r13,1),%ebx
movsbl 0x44(%rsp),%r14d
movsbl 0x48(%rsp),%r15d
movsbl 0x4c(%rsp),%r12d
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14d,%edx
mov    %r15d,%ecx
mov    %r12d,%r8d
call   1030 <paintPixel@plt>
mov    %ebx,%edi
mov    0x40(%rsp),%esi
mov    %r14d,%edx
mov    %r15d,%ecx
mov    %r12d,%r8d
call   1030 <paintPixel@plt>
mov    %ebx,%edi
mov    0x3c(%rsp),%esi
mov    %r14d,%edx
mov    %r15d,%ecx
mov    %r12d,%r8d
call   1030 <paintPixel@plt>
mov    %ebx,%edi
mov    0x38(%rsp),%esi
mov    %r14d,%edx
mov    %r15d,%ecx
mov    %r12d,%r8d
call   1030 <paintPixel@plt>
mov    %ebx,%edi
mov    0x34(%rsp),%esi
mov    %r14d,%edx
mov    %r15d,%ecx
mov    %r12d,%r8d
call   1030 <paintPixel@plt>
mov    %ebx,%edi
mov    0x30(%rsp),%esi
mov    %r14d,%edx
mov    %r15d,%ecx
mov    %r12d,%r8d
call   1030 <paintPixel@plt>
mov    %ebx,%edi
mov    0x2c(%rsp),%esi
mov    %r14d,%edx
mov    %r15d,%ecx
mov    %r12d,%r8d
call   1030 <paintPixel@plt>
mov    %ebx,%edi
mov    0x28(%rsp),%esi
mov    %r14d,%edx
mov    %r15d,%ecx
mov    %r12d,%r8d
call   1030 <paintPixel@plt>
mov    %ebx,%edi
mov    0x24(%rsp),%esi
mov    %r14d,%edx
mov    %r15d,%ecx
mov    %r12d,%r8d
call   1030 <paintPixel@plt>
mov    %ebx,%edi
mov    0x20(%rsp),%esi
mov    %r14d,%edx
mov    %r15d,%ecx
mov    %r12d,%r8d
call   1030 <paintPixel@plt>
mov    %ebx,%edi
mov    0x1c(%rsp),%esi
mov    %r14d,%edx
mov    %r15d,%ecx
mov    %r12d,%r8d
call   1030 <paintPixel@plt>
mov    %ebx,%edi
mov    0x18(%rsp),%esi
mov    %r14d,%edx
mov    %r15d,%ecx
mov    %r12d,%r8d
call   1030 <paintPixel@plt>
mov    %ebx,%edi
mov    0x14(%rsp),%esi
mov    %r14d,%edx
mov    %r15d,%ecx
mov    %r12d,%r8d
call   1030 <paintPixel@plt>
mov    %ebx,%edi
mov    0x10(%rsp),%esi
mov    %r14d,%edx
mov    %r15d,%ecx
mov    %r12d,%r8d
call   1030 <paintPixel@plt>
mov    %ebx,%edi
mov    0xc(%rsp),%esi
mov    %r14d,%edx
mov    %r15d,%ecx
mov    %r12d,%r8d
call   1030 <paintPixel@plt>
mov    %ebx,%edi
mov    0x8(%rsp),%esi
mov    %r14d,%edx
mov    %r15d,%ecx
mov    %r12d,%r8d
call   1030 <paintPixel@plt>
add    $0x1,%r13d
cmp    $0x8,%r13d
jne    11a0 <paintCharSpace+0x90>
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @paintCharSpace(i32 %0, i32 %1, i8 signext %2, i8 signext %3, i8 signext %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8
%9 = alloca i8
%10 = alloca i8
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i8 %2, i8* %8
store i8 %3, i8* %9
store i8 %4, i8* %10
store i32 0, i32* %11
br label %13
13: ; preds = %35, %5
%14 = load i32, i32* %11
%15 = icmp slt i32 %14, 8
br i1 %15, label %16, label %38
16: ; preds = %13
store i32 0, i32* %12
br label %17
17: ; preds = %31, %16
%18 = load i32, i32* %12
%19 = icmp slt i32 %18, 16
br i1 %19, label %20, label %34
20: ; preds = %17
%21 = load i32, i32* %6
%22 = load i32, i32* %11
%23 = add nsw i32 %21, %22
%24 = load i32, i32* %7
%25 = load i32, i32* %12
%26 = add nsw i32 %24, %25
%27 = load i8, i8* %8
%28 = load i8, i8* %9
%29 = load i8, i8* %10
%30 = call i32 @paintPixel(i32 %23, i32 %26, i8 signext %27, i8 signext %28, i8 signext %29)
br label %31
31: ; preds = %20
%32 = load i32, i32* %12
%33 = add nsw i32 %32, 1
store i32 %33, i32* %12
br label %17
34: ; preds = %17
br label %35
35: ; preds = %34
%36 = load i32, i32* %11
%37 = add nsw i32 %36, 1
store i32 %37, i32* %11
br label %13
38: ; preds = %13
ret void
}

LLVM IR (-O2):
define void @paintCharSpace(i32 %0, i32 %1, i8 signext %2, i8 signext %3, i8 signext %4) {
%6 = add nsw i32 %1, 1
%7 = add nsw i32 %1, 2
%8 = add nsw i32 %1, 3
%9 = add nsw i32 %1, 4
%10 = add nsw i32 %1, 5
%11 = add nsw i32 %1, 6
%12 = add nsw i32 %1, 7
%13 = add nsw i32 %1, 8
%14 = add nsw i32 %1, 9
%15 = add nsw i32 %1, 10
%16 = add nsw i32 %1, 11
%17 = add nsw i32 %1, 12
%18 = add nsw i32 %1, 13
%19 = add nsw i32 %1, 14
%20 = add nsw i32 %1, 15
br label %21
21: ; preds = %5, %21
%22 = phi i32 [ 0, %5 ], [ %40, %21 ]
%23 = add nsw i32 %22, %0
%24 = tail call i32 @paintPixel(i32 %23, i32 %1, i8 signext %2, i8 signext %3, i8 signext %4)
%25 = tail call i32 @paintPixel(i32 %23, i32 %6, i8 signext %2, i8 signext %3, i8 signext %4)
%26 = tail call i32 @paintPixel(i32 %23, i32 %7, i8 signext %2, i8 signext %3, i8 signext %4)
%27 = tail call i32 @paintPixel(i32 %23, i32 %8, i8 signext %2, i8 signext %3, i8 signext %4)
%28 = tail call i32 @paintPixel(i32 %23, i32 %9, i8 signext %2, i8 signext %3, i8 signext %4)
%29 = tail call i32 @paintPixel(i32 %23, i32 %10, i8 signext %2, i8 signext %3, i8 signext %4)
%30 = tail call i32 @paintPixel(i32 %23, i32 %11, i8 signext %2, i8 signext %3, i8 signext %4)
%31 = tail call i32 @paintPixel(i32 %23, i32 %12, i8 signext %2, i8 signext %3, i8 signext %4)
%32 = tail call i32 @paintPixel(i32 %23, i32 %13, i8 signext %2, i8 signext %3, i8 signext %4)
%33 = tail call i32 @paintPixel(i32 %23, i32 %14, i8 signext %2, i8 signext %3, i8 signext %4)
%34 = tail call i32 @paintPixel(i32 %23, i32 %15, i8 signext %2, i8 signext %3, i8 signext %4)
%35 = tail call i32 @paintPixel(i32 %23, i32 %16, i8 signext %2, i8 signext %3, i8 signext %4)
%36 = tail call i32 @paintPixel(i32 %23, i32 %17, i8 signext %2, i8 signext %3, i8 signext %4)
%37 = tail call i32 @paintPixel(i32 %23, i32 %18, i8 signext %2, i8 signext %3, i8 signext %4)
%38 = tail call i32 @paintPixel(i32 %23, i32 %19, i8 signext %2, i8 signext %3, i8 signext %4)
%39 = tail call i32 @paintPixel(i32 %23, i32 %20, i8 signext %2, i8 signext %3, i8 signext %4)
%40 = add nuw nsw i32 %22, 1
%41 = icmp eq i32 %40, 8
br i1 %41, label %42, label %21
42: ; preds = %21
ret void
}