// File: ShootMe[P]Klondike-Solver/Solitaire.cpp
// Function: Solitaire::Shuffle2(int)
void Solitaire::Shuffle2(int dealNumber) {
	for (int i = 0; i < 26; i++) { cards[i].Set(i); }
	for (int i = 39; i < 52; i++) { cards[i].Set(i - 13); }
	for (int i = 26; i < 39; i++) { cards[i].Set(i + 13); }

	random.SetSeed(dealNumber);
	for (int i = 0; i < 7; i++) {
		for (int j = 0; j < 52; j++) {
			int r = random.Next2() % 52;
			Card temp = cards[j];
			cards[j] = cards[r];
			cards[r] = temp;
		}
	}

	for (int i = 0, j = 51; i < 26; i++, j--) {
		Card temp = cards[j];
		cards[j] = cards[i];
		cards[i] = temp;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movl $0x0, -0x10(%rbp)
cmpl $0x1a, -0x10(%rbp)
jge 0xbca0
movq -0x48(%rbp), %rdi
addq $0x173c, %rdi           # imm = 0x173C
movslq -0x10(%rbp), %rax
imulq $0x6, %rax, %rax
addq %rax, %rdi
movl -0x10(%rbp), %eax
movzbl %al, %esi
callq 0x13220
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0xbc6e
movl $0x27, -0x14(%rbp)
cmpl $0x34, -0x14(%rbp)
jge 0xbcdc
movq -0x48(%rbp), %rdi
addq $0x173c, %rdi           # imm = 0x173C
movslq -0x14(%rbp), %rax
imulq $0x6, %rax, %rax
addq %rax, %rdi
movl -0x14(%rbp), %eax
subl $0xd, %eax
movzbl %al, %esi
callq 0x13220
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xbca7
movl $0x1a, -0x18(%rbp)
cmpl $0x27, -0x18(%rbp)
jge 0xbd18
movq -0x48(%rbp), %rdi
addq $0x173c, %rdi           # imm = 0x173C
movslq -0x18(%rbp), %rax
imulq $0x6, %rax, %rax
addq %rax, %rdi
movl -0x18(%rbp), %eax
addl $0xd, %eax
movzbl %al, %esi
callq 0x13220
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0xbce3
movq -0x48(%rbp), %rdi
addq $0x18f4, %rdi           # imm = 0x18F4
movl -0xc(%rbp), %esi
callq 0x13080
movl $0x0, -0x1c(%rbp)
cmpl $0x7, -0x1c(%rbp)
jge 0xbe00
movl $0x0, -0x20(%rbp)
cmpl $0x34, -0x20(%rbp)
jge 0xbdf0
movq -0x48(%rbp), %rdi
addq $0x18f4, %rdi           # imm = 0x18F4
callq 0x13180
movl $0x34, %ecx
cltd
idivl %ecx
movq -0x48(%rbp), %rax
movl %edx, -0x24(%rbp)
movq %rax, %rcx
addq $0x173c, %rcx           # imm = 0x173C
movslq -0x20(%rbp), %rdx
imulq $0x6, %rdx, %rdx
addq %rdx, %rcx
movl (%rcx), %edx
movl %edx, -0x2a(%rbp)
movw 0x4(%rcx), %cx
movw %cx, -0x26(%rbp)
movq %rax, %rdx
addq $0x173c, %rdx           # imm = 0x173C
movslq -0x24(%rbp), %rcx
imulq $0x6, %rcx, %rcx
addq %rcx, %rdx
movq %rax, %rcx
addq $0x173c, %rcx           # imm = 0x173C
movslq -0x20(%rbp), %rsi
imulq $0x6, %rsi, %rsi
addq %rsi, %rcx
movl (%rdx), %esi
movl %esi, (%rcx)
movw 0x4(%rdx), %dx
movw %dx, 0x4(%rcx)
addq $0x173c, %rax           # imm = 0x173C
movslq -0x24(%rbp), %rcx
imulq $0x6, %rcx, %rcx
addq %rcx, %rax
movl -0x2a(%rbp), %ecx
movl %ecx, (%rax)
movw -0x26(%rbp), %cx
movw %cx, 0x4(%rax)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xbd43
jmp 0xbdf2
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xbd32
movl $0x0, -0x30(%rbp)
movl $0x33, -0x34(%rbp)
cmpl $0x1a, -0x30(%rbp)
jge 0xbea9
movq -0x48(%rbp), %rax
movq %rax, %rcx
addq $0x173c, %rcx           # imm = 0x173C
movslq -0x34(%rbp), %rdx
imulq $0x6, %rdx, %rdx
addq %rdx, %rcx
movl (%rcx), %edx
movl %edx, -0x3a(%rbp)
movw 0x4(%rcx), %cx
movw %cx, -0x36(%rbp)
movq %rax, %rdx
addq $0x173c, %rdx           # imm = 0x173C
movslq -0x30(%rbp), %rcx
imulq $0x6, %rcx, %rcx
addq %rcx, %rdx
movq %rax, %rcx
addq $0x173c, %rcx           # imm = 0x173C
movslq -0x34(%rbp), %rsi
imulq $0x6, %rsi, %rsi
addq %rsi, %rcx
movl (%rdx), %esi
movl %esi, (%rcx)
movw 0x4(%rdx), %dx
movw %dx, 0x4(%rcx)
addq $0x173c, %rax           # imm = 0x173C
movslq -0x30(%rbp), %rcx
imulq $0x6, %rcx, %rcx
addq %rcx, %rax
movl -0x3a(%rbp), %ecx
movl %ecx, (%rax)
movw -0x36(%rbp), %cx
movw %cx, 0x4(%rax)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
movl -0x34(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0xbe0e
addq $0x50, %rsp
popq %rbp
retq
nop