#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 */
struct rubikCube {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ setSquare(struct rubikCube *, unsigned char, unsigned char,
                             unsigned char, unsigned char);
void setRowColors(struct rubikCube *cube, unsigned char face, unsigned char row,
                  unsigned char *rowColors) {
  unsigned char col;
  for (col = 0; col < 3; col++) {
    setSquare(cube, face, row, col, rowColors[col]);
  }
}


x86 assembly (clang, -O0):
<setRowColors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %sil,%dl
mov    %rdi,-0x8(%rbp)
mov    %dl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    %rcx,-0x18(%rbp)
movb   $0x0,-0x19(%rbp)
movzbl -0x19(%rbp),%eax
cmp    $0x3,%eax
jge    1174 <setRowColors+0x64>
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%sil
mov    -0xa(%rbp),%dl
mov    -0x19(%rbp),%cl
mov    -0x18(%rbp),%rax
movzbl -0x19(%rbp),%r8d
movzbl %sil,%esi
movzbl %dl,%edx
movzbl %cl,%ecx
movzbl (%rax,%r8,1),%r8d
call   1030 <setSquare@plt>
mov    -0x19(%rbp),%al
add    $0x1,%al
mov    %al,-0x19(%rbp)
jmp    112f <setRowColors+0x1f>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setRowColors>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %edx,%r14d
mov    %esi,%r15d
mov    %rdi,%rbp
movzbl (%rcx),%r8d
xor    %ecx,%ecx
call   1030 <setSquare@plt>
movzbl 0x1(%rbx),%r8d
mov    %rbp,%rdi
mov    %r15d,%esi
mov    %r14d,%edx
mov    $0x1,%ecx
call   1030 <setSquare@plt>
movzbl 0x2(%rbx),%r8d
mov    %rbp,%rdi
mov    %r15d,%esi
mov    %r14d,%edx
mov    $0x2,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <setSquare@plt>

LLVM IR (-O0):
%struct.rubikCube = type { i32 }
define void @setRowColors(%struct.rubikCube* %0, i8 zeroext %1, i8 zeroext %2, i8* %3) {
%5 = alloca %struct.rubikCube*
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8*
%9 = alloca i8
store %struct.rubikCube* %0, %struct.rubikCube** %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8* %3, i8** %8
store i8 0, i8* %9
br label %10
10: ; preds = %25, %4
%11 = load i8, i8* %9
%12 = zext i8 %11 to i32
%13 = icmp slt i32 %12, 3
br i1 %13, label %14, label %28
14: ; preds = %10
%15 = load %struct.rubikCube*, %struct.rubikCube** %5
%16 = load i8, i8* %6
%17 = load i8, i8* %7
%18 = load i8, i8* %9
%19 = load i8*, i8** %8
%20 = load i8, i8* %9
%21 = zext i8 %20 to i64
%22 = getelementptr inbounds i8, i8* %19, i64 %21
%23 = load i8, i8* %22
%24 = call i32 @setSquare(%struct.rubikCube* %15, i8 zeroext %16, i8 zeroext %17, i8 zeroext %18, i8 zeroext %23)
br label %25
25: ; preds = %14
%26 = load i8, i8* %9
%27 = add i8 %26, 1
store i8 %27, i8* %9
br label %10
28: ; preds = %10
ret void
}

LLVM IR (-O2):
%struct.rubikCube = type { i32 }
define void @setRowColors(%struct.rubikCube* %0, i8 zeroext %1, i8 zeroext %2, i8* nocapture %3) {
%5 = load i8, i8* %3
%6 = tail call i32 @setSquare(%struct.rubikCube* %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext 0, i8 zeroext %5)
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = load i8, i8* %7
%9 = tail call i32 @setSquare(%struct.rubikCube* %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext 1, i8 zeroext %8)
%10 = getelementptr inbounds i8, i8* %3, i64 2
%11 = load i8, i8* %10
%12 = tail call i32 @setSquare(%struct.rubikCube* %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext 2, i8 zeroext %11)
ret void
}