// File: /workspace/github_cpp_makefile_star2_O1/dcx86r[P]rubikon/main.cpp
// Function: main
int main() {
	random_device rd;
	uint_fast32_t seed = rd();
	typedef linear_congruential_engine<uint_fast32_t, 134775813, 1, 4294967296> lce;
	lce rng{seed};
	discrete_distribution<short> color {2,6,6,6,4,2};
	char ph[] = {'+', '@', '#', '$', '%', '&'};	//blue, yellow, green, orange, red, white
	vector<string> str;
	short i, j, k, l;

	for (i = 0; i < 9; ++i) {
		str.push_back(string(3, ph[color(rng)]));
	}

	cout << "/* XPM */\n"
	"static char * rubik_xpm[] = {\n"
	"\"15 15 8 1\",\n"
	"\" 	c None\",\n"
	"\".	c #000000\",\n"
	"\"+	c #0000FF\",\n"
	"\"@	c #FFFF00\",\n"
	"\"#	c #008000\",\n"
	"\"$	c #FFA500\",\n"
	"\"%	c #FF0000\",\n"
	"\"&	c #FFFFFF\",\n"
	"\"               \",\n";

	l = 0;

	for (j = 0; j < 3; ++j) {
		cout << "\" ............. \",\n";
		for (k = 0; k < 3; ++k) {
			cout << "\" ." << str[l] << "."
			<< str[l+1] << "."
			<< str[l+2] << ". \",\n";
		}
		l += 3;
	}
	cout << "\" ............. \",\n"
	"\"               \"};" << endl;

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1428, %rsp           # imm = 0x1428
leaq -0x1448(%rbp), %rbx
movq %rbx, %rdi
callq 0x1626
movq %rbx, %rdi
callq 0x1150
movl %eax, %eax
movq %rax, -0x60(%rbp)
movups 0x1cd4(%rip), %xmm0     # 0x3038
leaq -0x90(%rbp), %rsi
movaps %xmm0, 0x20(%rsi)
movups 0x1cb2(%rip), %xmm0     # 0x3028
movaps %xmm0, 0x10(%rsi)
movups 0x1c97(%rip), %xmm0     # 0x3018
movaps %xmm0, (%rsi)
leaq -0xc0(%rbp), %rdi
movl $0x6, %edx
callq 0x17f6
xorps %xmm0, %xmm0
leaq -0x50(%rbp), %rax
movaps %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movw $0x9, %r14w
leaq -0x80(%rbp), %r13
leaq -0xc0(%rbp), %r15
leaq 0x1c8a(%rip), %rbx      # 0x3048
leaq -0x90(%rbp), %r12
movq %r15, %rdi
leaq -0x60(%rbp), %rsi
movq %r15, %rdx
callq 0x1c40
movswq %ax, %rax
movsbl (%rax,%rbx), %edx
movq %r13, -0x90(%rbp)
movl $0x3, %esi
movq %r12, %rdi
callq 0x1140
leaq -0x50(%rbp), %rdi
movq %r12, %rsi
callq 0x1d92
movq -0x90(%rbp), %rdi
cmpq %r13, %rdi
je 0x1414
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x1120
decw %r14w
jne 0x13c5
movq 0x3bb7(%rip), %rdi      # 0x4fd8
leaq 0x1c26(%rip), %rsi      # 0x304e
movl $0xbd, %edx
callq 0x1130
xorl %r13d, %r13d
movq 0x3b9c(%rip), %rbx      # 0x4fd8
leaq 0x1cdf(%rip), %r12      # 0x3122
movl $0x0, -0x2c(%rbp)
movl $0x13, %edx
movq %rbx, %rdi
leaq 0x1cb3(%rip), %rsi      # 0x310c
callq 0x1130
movw $0x3, %r15w
movq %r13, -0x58(%rbp)
shlq $0x5, %r13
movl $0x3, %edx
movq %rbx, %rdi
leaq 0x1ca6(%rip), %rsi      # 0x3120
callq 0x1130
movq -0x50(%rbp), %rax
movq (%rax,%r13), %rsi
movq 0x8(%rax,%r13), %rdx
movq %rbx, %rdi
callq 0x1130
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x1130
movq -0x50(%rbp), %rax
movq 0x20(%rax,%r13), %rsi
movq 0x28(%rax,%r13), %rdx
movq %r14, %rdi
callq 0x1130
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x1130
movq -0x50(%rbp), %rax
movq 0x40(%rax,%r13), %rsi
movq 0x48(%rax,%r13), %rdx
movq %r14, %rdi
callq 0x1130
movl $0x5, %edx
movq %rax, %rdi
leaq 0x1c25(%rip), %rsi      # 0x311a
callq 0x1130
decw %r15w
jne 0x146b
movq -0x58(%rbp), %r13
addq $0x3, %r13
movl -0x2c(%rbp), %eax
incl %eax
movl %eax, -0x2c(%rbp)
cmpw $0x3, %ax
jne 0x144a
movq 0x3ab3(%rip), %rbx      # 0x4fd8
leaq 0x1bf8(%rip), %rsi      # 0x3124
movl $0x26, %edx
movq %rbx, %rdi
callq 0x1130
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x1100
movsbl %al, %esi
movq 0x3a81(%rip), %rdi      # 0x4fd8
callq 0x1030
movq %rax, %rdi
callq 0x1090
leaq -0x50(%rbp), %rdi
callq 0x16a4
movq -0xa8(%rbp), %rdi
testq %rdi, %rdi
je 0x1588
movq -0x98(%rbp), %rsi
subq %rdi, %rsi
callq 0x1120
movq -0xc0(%rbp), %rdi
testq %rdi, %rdi
je 0x15a3
movq -0xb0(%rbp), %rsi
subq %rdi, %rsi
callq 0x1120
leaq -0x1448(%rbp), %rdi
callq 0x10f0
xorl %eax, %eax
addq $0x1428, %rsp           # imm = 0x1428
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x161d
jmp 0x15c7
movq %rax, %rbx
jmp 0x1609
jmp 0x15f1
jmp 0x15f1
jmp 0x15f1
jmp 0x15f1
movq %rax, %rbx
movq -0x90(%rbp), %rdi
cmpq %r13, %rdi
je 0x15f4
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x1120
jmp 0x15f4
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x16a4
leaq -0xc0(%rbp), %rdi
callq 0x170e
leaq -0x1448(%rbp), %rdi
callq 0x10f0
movq %rbx, %rdi
callq 0x1190
movq %rax, %rdi
callq 0x17e7
nop