#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_row(int, int, int, int /*<<< orphan*/,
                            int /*<<< orphan*/, int /*<<< orphan*/);
void cube_layer(int layer, int buffer, uint8_t red, uint8_t green,
                uint8_t blue) {
  int panel;
  for (panel = 0; panel < 8; panel++)
    cube_row(panel, layer, buffer, red, green, blue);
}


x86 assembly (clang, -O0):
<cube_layer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x8,-0x18(%rbp)
jge    1160 <cube_layer+0x50>
mov    -0x18(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0x14(%rbp),%r9d
call   1030 <cube_row@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112f <cube_layer+0x1f>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cube_layer>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%r14d
mov    %ecx,%r15d
mov    %edx,%r12d
mov    %esi,%ebp
mov    %edi,%ebx
xor    %edi,%edi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
call   1030 <cube_row@plt>
mov    $0x1,%edi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
call   1030 <cube_row@plt>
mov    $0x2,%edi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
call   1030 <cube_row@plt>
mov    $0x3,%edi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
call   1030 <cube_row@plt>
mov    $0x4,%edi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
call   1030 <cube_row@plt>
mov    $0x5,%edi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
call   1030 <cube_row@plt>
mov    $0x6,%edi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
call   1030 <cube_row@plt>
mov    $0x7,%edi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <cube_row@plt>

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

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