// File: 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
subq $0x14d0, %rsp           # imm = 0x14D0
movl $0x0, -0x4(%rbp)
leaq -0x1390(%rbp), %rdi
movq %rdi, -0x1478(%rbp)
callq 0x2820
movq -0x1478(%rbp), %rdi
callq 0x28c0
movl %eax, -0x1470(%rbp)
jmp 0x2409
movl -0x1470(%rbp), %eax
movl %eax, %eax
movq %rax, -0x1398(%rbp)
movq -0x1398(%rbp), %rsi
leaq -0x13b0(%rbp), %rdi
callq 0x28e0
jmp 0x242d
movups 0x3c2c(%rip), %xmm0     # 0x6060
movaps %xmm0, -0x1400(%rbp)
movups 0x3c0e(%rip), %xmm0     # 0x6050
movaps %xmm0, -0x1410(%rbp)
movups 0x3bf0(%rip), %xmm0     # 0x6040
movaps %xmm0, -0x1420(%rbp)
leaq -0x1420(%rbp), %rax
movq %rax, -0x13f0(%rbp)
movq $0x6, -0x13e8(%rbp)
movq -0x13f0(%rbp), %rsi
movq -0x13e8(%rbp), %rdx
leaq -0x13e0(%rbp), %rdi
callq 0x2910
jmp 0x248c
movl 0x3bde(%rip), %eax      # 0x6070
movl %eax, -0x1426(%rbp)
movw 0x3bd5(%rip), %ax       # 0x6074
movw %ax, -0x1422(%rbp)
leaq -0x1440(%rbp), %rdi
callq 0x2950
movw $0x0, -0x1442(%rbp)
movswl -0x1442(%rbp), %eax
cmpl $0x9, %eax
jge 0x25e8
leaq -0x13e0(%rbp), %rdi
leaq -0x13b0(%rbp), %rsi
callq 0x29a0
movw %ax, -0x147a(%rbp)
jmp 0x24e7
movw -0x147a(%rbp), %ax
movswq %ax, %rax
movsbl -0x1426(%rbp,%rax), %eax
movl %eax, -0x148c(%rbp)
leaq -0x1469(%rbp), %rdi
movq %rdi, -0x1488(%rbp)
callq 0x2260
movl -0x148c(%rbp), %edx
movq -0x1488(%rbp), %rcx
leaq -0x1468(%rbp), %rdi
movl $0x3, %esi
callq 0x29d0
jmp 0x2533
leaq -0x1440(%rbp), %rdi
leaq -0x1468(%rbp), %rsi
callq 0x2970
jmp 0x2548
leaq -0x1468(%rbp), %rdi
callq 0x20b0
leaq -0x1469(%rbp), %rdi
callq 0x21a0
movw -0x1442(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x1442(%rbp)
jmp 0x24bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x13a0(%rbp)
movl %eax, -0x13a4(%rbp)
jmp 0x2804
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x13a0(%rbp)
movl %eax, -0x13a4(%rbp)
jmp 0x27ec
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x13a0(%rbp)
movl %eax, -0x13a4(%rbp)
jmp 0x25d7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x13a0(%rbp)
movl %eax, -0x13a4(%rbp)
leaq -0x1468(%rbp), %rdi
callq 0x20b0
leaq -0x1469(%rbp), %rdi
callq 0x21a0
jmp 0x27ec
movq 0x79e9(%rip), %rdi      # 0x9fd8
leaq 0x3a80(%rip), %rsi      # 0x6076
callq 0x2150
jmp 0x25fd
movw $0x0, -0x1448(%rbp)
movw $0x0, -0x1444(%rbp)
movswl -0x1444(%rbp), %eax
cmpl $0x3, %eax
jge 0x2784
movq 0x79b2(%rip), %rdi      # 0x9fd8
leaq 0x3b07(%rip), %rsi      # 0x6134
callq 0x2150
jmp 0x2634
movw $0x0, -0x1446(%rbp)
movswl -0x1446(%rbp), %eax
cmpl $0x3, %eax
jge 0x275c
movq 0x7984(%rip), %rdi      # 0x9fd8
leaq 0x3aed(%rip), %rsi      # 0x6148
callq 0x2150
movq %rax, -0x1498(%rbp)
jmp 0x2669
movswq -0x1448(%rbp), %rsi
leaq -0x1440(%rbp), %rdi
callq 0x2a40
movq -0x1498(%rbp), %rdi
movq %rax, %rsi
callq 0x2130
movq %rax, -0x14a0(%rbp)
jmp 0x2695
movq -0x14a0(%rbp), %rdi
leaq 0x3aa7(%rip), %rsi      # 0x614a
callq 0x2150
movq %rax, -0x14a8(%rbp)
jmp 0x26b1
movswl -0x1448(%rbp), %eax
incl %eax
movslq %eax, %rsi
leaq -0x1440(%rbp), %rdi
callq 0x2a40
movq -0x14a8(%rbp), %rdi
movq %rax, %rsi
callq 0x2130
movq %rax, -0x14b0(%rbp)
jmp 0x26e1
movq -0x14b0(%rbp), %rdi
leaq 0x3a5b(%rip), %rsi      # 0x614a
callq 0x2150
movq %rax, -0x14b8(%rbp)
jmp 0x26fd
movswl -0x1448(%rbp), %eax
addl $0x2, %eax
movslq %eax, %rsi
leaq -0x1440(%rbp), %rdi
callq 0x2a40
movq -0x14b8(%rbp), %rdi
movq %rax, %rsi
callq 0x2130
movq %rax, -0x14c0(%rbp)
jmp 0x272e
movq -0x14c0(%rbp), %rdi
leaq 0x3a06(%rip), %rsi      # 0x6142
callq 0x2150
jmp 0x2743
jmp 0x2745
movw -0x1446(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x1446(%rbp)
jmp 0x263d
movswl -0x1448(%rbp), %eax
addl $0x3, %eax
movw %ax, -0x1448(%rbp)
movw -0x1444(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x1444(%rbp)
jmp 0x260f
movq 0x784d(%rip), %rdi      # 0x9fd8
leaq 0x39ba(%rip), %rsi      # 0x614c
callq 0x2150
movq %rax, -0x14c8(%rbp)
jmp 0x27a0
movq -0x14c8(%rbp), %rdi
movq 0x781a(%rip), %rsi      # 0x9fc8
callq 0x2180
jmp 0x27b5
movl $0x0, -0x4(%rbp)
leaq -0x1440(%rbp), %rdi
callq 0x2a60
leaq -0x13e0(%rbp), %rdi
callq 0x2ac0
leaq -0x1390(%rbp), %rdi
callq 0x2ae0
movl -0x4(%rbp), %eax
addq $0x14d0, %rsp           # imm = 0x14D0
popq %rbp
retq
leaq -0x1440(%rbp), %rdi
callq 0x2a60
leaq -0x13e0(%rbp), %rdi
callq 0x2ac0
leaq -0x1390(%rbp), %rdi
callq 0x2ae0
movq -0x13a0(%rbp), %rdi
callq 0x2250
nopl (%rax)