#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*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ cube_panel(int, int, int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/);
void cube_fill(int buffer, uint8_t r, uint8_t g, uint8_t b) {
  int panel;
  for (panel = 0; panel < 8; panel++)
    cube_panel(panel, buffer, r, g, b);
}


x86 assembly (clang, -O0):
<cube_fill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    1158 <cube_fill+0x48>
mov    -0x14(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
call   1030 <cube_panel@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112b <cube_fill+0x1b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cube_fill>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
call   1030 <cube_panel@plt>
mov    $0x1,%edi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
call   1030 <cube_panel@plt>
mov    $0x2,%edi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
call   1030 <cube_panel@plt>
mov    $0x3,%edi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
call   1030 <cube_panel@plt>
mov    $0x4,%edi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
call   1030 <cube_panel@plt>
mov    $0x5,%edi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
call   1030 <cube_panel@plt>
mov    $0x6,%edi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
call   1030 <cube_panel@plt>
mov    $0x7,%edi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <cube_panel@plt>

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

LLVM IR (-O2):
define void @cube_fill(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @cube_panel(i32 0, i32 %0, i32 %1, i32 %2, i32 %3)
%6 = tail call i32 @cube_panel(i32 1, i32 %0, i32 %1, i32 %2, i32 %3)
%7 = tail call i32 @cube_panel(i32 2, i32 %0, i32 %1, i32 %2, i32 %3)
%8 = tail call i32 @cube_panel(i32 3, i32 %0, i32 %1, i32 %2, i32 %3)
%9 = tail call i32 @cube_panel(i32 4, i32 %0, i32 %1, i32 %2, i32 %3)
%10 = tail call i32 @cube_panel(i32 5, i32 %0, i32 %1, i32 %2, i32 %3)
%11 = tail call i32 @cube_panel(i32 6, i32 %0, i32 %1, i32 %2, i32 %3)
%12 = tail call i32 @cube_panel(i32 7, i32 %0, i32 %1, i32 %2, i32 %3)
ret void
}