#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*/ LED(int, int, int, int /*<<< orphan*/, int /*<<< orphan*/,
                       int /*<<< orphan*/);
int /*<<< orphan*/ buffer_LED(int, int, int, int /*<<< orphan*/,
                              int /*<<< orphan*/, int /*<<< orphan*/);
void cube_column(int col, int panel, int buffer, uint8_t red, uint8_t green,
                 uint8_t blue) {
  int layer;
  for (layer = 0; layer < 8; layer++)
    if (buffer)
      buffer_LED(col, panel, layer, red, green, blue);
    else
      LED(col, panel, layer, red, green, blue);
}


x86 assembly (clang, -O0):
<cube_column>:
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)
mov    %r9d,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x8,-0x1c(%rbp)
jge    11a1 <cube_column+0x81>
cmpl   $0x0,-0xc(%rbp)
je     1175 <cube_column+0x55>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
call   1030 <buffer_LED@plt>
jmp    118e <cube_column+0x6e>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
call   1040 <LED@plt>
jmp    1193 <cube_column+0x73>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1143 <cube_column+0x23>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cube_column>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r9d,%r14d
mov    %r8d,%r15d
mov    %ecx,%r12d
mov    %esi,%ebp
mov    %edi,%ebx
test   %edx,%edx
je     11f6 <cube_column+0xd6>
xor    %edx,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
call   1030 <buffer_LED@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0x1,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
call   1030 <buffer_LED@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0x2,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
call   1030 <buffer_LED@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0x3,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
call   1030 <buffer_LED@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0x4,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
call   1030 <buffer_LED@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0x5,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
call   1030 <buffer_LED@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0x6,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
call   1030 <buffer_LED@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0x7,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <buffer_LED@plt>
xor    %edx,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
call   1040 <LED@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0x1,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
call   1040 <LED@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0x2,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
call   1040 <LED@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0x3,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
call   1040 <LED@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0x4,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
call   1040 <LED@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0x5,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
call   1040 <LED@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0x6,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
call   1040 <LED@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0x7,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <LED@plt>

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

LLVM IR (-O2):
define void @cube_column(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = icmp eq i32 %2, 0
br i1 %7, label %17, label %8
8: ; preds = %6
%9 = tail call i32 @buffer_LED(i32 %0, i32 %1, i32 0, i32 %3, i32 %4, i32 %5)
%10 = tail call i32 @buffer_LED(i32 %0, i32 %1, i32 1, i32 %3, i32 %4, i32 %5)
%11 = tail call i32 @buffer_LED(i32 %0, i32 %1, i32 2, i32 %3, i32 %4, i32 %5)
%12 = tail call i32 @buffer_LED(i32 %0, i32 %1, i32 3, i32 %3, i32 %4, i32 %5)
%13 = tail call i32 @buffer_LED(i32 %0, i32 %1, i32 4, i32 %3, i32 %4, i32 %5)
%14 = tail call i32 @buffer_LED(i32 %0, i32 %1, i32 5, i32 %3, i32 %4, i32 %5)
%15 = tail call i32 @buffer_LED(i32 %0, i32 %1, i32 6, i32 %3, i32 %4, i32 %5)
%16 = tail call i32 @buffer_LED(i32 %0, i32 %1, i32 7, i32 %3, i32 %4, i32 %5)
br label %26
17: ; preds = %6
%18 = tail call i32 @LED(i32 %0, i32 %1, i32 0, i32 %3, i32 %4, i32 %5)
%19 = tail call i32 @LED(i32 %0, i32 %1, i32 1, i32 %3, i32 %4, i32 %5)
%20 = tail call i32 @LED(i32 %0, i32 %1, i32 2, i32 %3, i32 %4, i32 %5)
%21 = tail call i32 @LED(i32 %0, i32 %1, i32 3, i32 %3, i32 %4, i32 %5)
%22 = tail call i32 @LED(i32 %0, i32 %1, i32 4, i32 %3, i32 %4, i32 %5)
%23 = tail call i32 @LED(i32 %0, i32 %1, i32 5, i32 %3, i32 %4, i32 %5)
%24 = tail call i32 @LED(i32 %0, i32 %1, i32 6, i32 %3, i32 %4, i32 %5)
%25 = tail call i32 @LED(i32 %0, i32 %1, i32 7, i32 %3, i32 %4, i32 %5)
br label %26
26: ; preds = %17, %8
ret void
}