// File: NathanWine[P]2048-AI-Solvers/src/Game.cpp
// Function: Game::compressUp(bool)
void Game::compressUp(bool peak) {
    for (int col = 0; col < DIM; ++col) {
        std::vector<int> compressed_column;
        if (state[0][col] == state[1][col]) {
            compressed_column.push_back(state[0][col] * 2);
            score += state[0][col] * 2;
            if (state[2][col] == state[3][col]) {
                compressed_column.push_back(state[2][col] * 2);
                score += state[2][col] * 2;
            }
            else {
                compressed_column.push_back(state[2][col]);
                compressed_column.push_back(state[3][col]);
            }
        }
        else if (state[1][col] == state[2][col]) {
            compressed_column.push_back(state[0][col]);
            compressed_column.push_back(state[1][col] * 2);
            compressed_column.push_back(state[3][col]);
            score += state[1][col] * 2;
        }
        else if (state[2][col] == state[3][col]) {
            compressed_column.push_back(state[0][col]);
            compressed_column.push_back(state[1][col]);
            compressed_column.push_back(state[2][col] * 2);
            score += state[2][col] * 2;
        }
        else {
            compressed_column.push_back(state[0][col]);
            compressed_column.push_back(state[1][col]);
            compressed_column.push_back(state[2][col]);
            compressed_column.push_back(state[3][col]);
        }
        while(compressed_column.size() < DIM) {
            compressed_column.push_back(0);
        }
        for (int i = 0; i < DIM; ++i) {
            state[i][col] = compressed_column[i];
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
andb $0x1, %al
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
movl $0x0, -0x10(%rbp)
cmpl $0x4, -0x10(%rbp)
jge 0x1065c
leaq -0x28(%rbp), %rdi
callq 0xbf90
movq -0x58(%rbp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x7fb0
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x4230
movq -0x58(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x5c(%rbp)
addq $0x8, %rdi
movl $0x1, %esi
callq 0x7fb0
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x4230
movq %rax, %rcx
movl -0x5c(%rbp), %eax
cmpl (%rcx), %eax
jne 0x10303
movq -0x58(%rbp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x7fb0
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x4230
movl (%rax), %eax
addl %eax, %eax
movl %eax, -0x2c(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x2c(%rbp), %rsi
callq 0x11670
jmp 0x101b7
movq -0x58(%rbp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x7fb0
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x4230
movq -0x58(%rbp), %rdi
movl (%rax), %eax
shll %eax
addl (%rdi), %eax
movl %eax, (%rdi)
addq $0x8, %rdi
movl $0x2, %esi
callq 0x7fb0
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x4230
movq -0x58(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x60(%rbp)
addq $0x8, %rdi
movl $0x3, %esi
callq 0x7fb0
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x4230
movq %rax, %rcx
movl -0x60(%rbp), %eax
cmpl (%rcx), %eax
jne 0x102a4
movq -0x58(%rbp), %rdi
addq $0x8, %rdi
movl $0x2, %esi
callq 0x7fb0
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x4230
movl (%rax), %eax
addl %eax, %eax
movl %eax, -0x40(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x11670
jmp 0x1025b
movq -0x58(%rbp), %rdi
addq $0x8, %rdi
movl $0x2, %esi
callq 0x7fb0
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x4230
movq %rax, %rcx
movq -0x58(%rbp), %rax
movl (%rcx), %ecx
shll %ecx
addl (%rax), %ecx
movl %ecx, (%rax)
jmp 0x102fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x4370
jmp 0x10662
movq -0x58(%rbp), %rdi
addq $0x8, %rdi
movl $0x2, %esi
callq 0x7fb0
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x4230
movq %rax, %rsi
leaq -0x28(%rbp), %rdi
callq 0x4960
jmp 0x102d0
movq -0x58(%rbp), %rdi
addq $0x8, %rdi
movl $0x3, %esi
callq 0x7fb0
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x4230
movq %rax, %rsi
leaq -0x28(%rbp), %rdi
callq 0x4960
jmp 0x102fc
jmp 0x102fe
jmp 0x105d0
movq -0x58(%rbp), %rdi
addq $0x8, %rdi
movl $0x1, %esi
callq 0x7fb0
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x4230
movq -0x58(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x64(%rbp)
addq $0x8, %rdi
movl $0x2, %esi
callq 0x7fb0
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x4230
movq %rax, %rcx
movl -0x64(%rbp), %eax
cmpl (%rcx), %eax
jne 0x1040f
movq -0x58(%rbp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x7fb0
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x4230
movq %rax, %rsi
leaq -0x28(%rbp), %rdi
callq 0x4960
jmp 0x1037d
movq -0x58(%rbp), %rdi
addq $0x8, %rdi
movl $0x1, %esi
callq 0x7fb0
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x4230
movl (%rax), %eax
addl %eax, %eax
movl %eax, -0x44(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x44(%rbp), %rsi
callq 0x11670
jmp 0x103b1
movq -0x58(%rbp), %rdi
addq $0x8, %rdi
movl $0x3, %esi
callq 0x7fb0
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x4230
movq %rax, %rsi
leaq -0x28(%rbp), %rdi
callq 0x4960
jmp 0x103dd
movq -0x58(%rbp), %rdi
addq $0x8, %rdi
movl $0x1, %esi
callq 0x7fb0
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x4230
movq %rax, %rcx
movq -0x58(%rbp), %rax
movl (%rcx), %ecx
shll %ecx
addl (%rax), %ecx
movl %ecx, (%rax)
jmp 0x105ce
movq -0x58(%rbp), %rdi
addq $0x8, %rdi
movl $0x2, %esi
callq 0x7fb0
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x4230
movq -0x58(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x68(%rbp)
addq $0x8, %rdi
movl $0x3, %esi
callq 0x7fb0
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x4230
movq %rax, %rcx
movl -0x68(%rbp), %eax
cmpl (%rcx), %eax
jne 0x1051b
movq -0x58(%rbp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x7fb0
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x4230
movq %rax, %rsi
leaq -0x28(%rbp), %rdi
callq 0x4960
jmp 0x10489
movq -0x58(%rbp), %rdi
addq $0x8, %rdi
movl $0x1, %esi
callq 0x7fb0
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x4230
movq %rax, %rsi
leaq -0x28(%rbp), %rdi
callq 0x4960
jmp 0x104b5
movq -0x58(%rbp), %rdi
addq $0x8, %rdi
movl $0x2, %esi
callq 0x7fb0
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x4230
movl (%rax), %eax
addl %eax, %eax
movl %eax, -0x48(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x11670
jmp 0x104e9
movq -0x58(%rbp), %rdi
addq $0x8, %rdi
movl $0x2, %esi
callq 0x7fb0
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x4230
movq %rax, %rcx
movq -0x58(%rbp), %rax
movl (%rcx), %ecx
shll %ecx
addl (%rax), %ecx
movl %ecx, (%rax)
jmp 0x105cc
movq -0x58(%rbp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x7fb0
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x4230
movq %rax, %rsi
leaq -0x28(%rbp), %rdi
callq 0x4960
jmp 0x10546
movq -0x58(%rbp), %rdi
addq $0x8, %rdi
movl $0x1, %esi
callq 0x7fb0
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x4230
movq %rax, %rsi
leaq -0x28(%rbp), %rdi
callq 0x4960
jmp 0x10572
movq -0x58(%rbp), %rdi
addq $0x8, %rdi
movl $0x2, %esi
callq 0x7fb0
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x4230
movq %rax, %rsi
leaq -0x28(%rbp), %rdi
callq 0x4960
jmp 0x1059e
movq -0x58(%rbp), %rdi
addq $0x8, %rdi
movl $0x3, %esi
callq 0x7fb0
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x4230
movq %rax, %rsi
leaq -0x28(%rbp), %rdi
callq 0x4960
jmp 0x105ca
jmp 0x105cc
jmp 0x105ce
jmp 0x105d0
jmp 0x105d2
leaq -0x28(%rbp), %rdi
callq 0x41e0
cmpq $0x4, %rax
jae 0x105f9
movl $0x0, -0x4c(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x4c(%rbp), %rsi
callq 0x11670
jmp 0x105f7
jmp 0x105d2
movl $0x0, -0x50(%rbp)
cmpl $0x4, -0x50(%rbp)
jge 0x10645
movslq -0x50(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x4230
movq -0x58(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x6c(%rbp)
addq $0x8, %rdi
movslq -0x50(%rbp), %rsi
callq 0x7fb0
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x4230
movl -0x6c(%rbp), %ecx
movl %ecx, (%rax)
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x10600
leaq -0x28(%rbp), %rdi
callq 0x4370
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x10123
addq $0x70, %rsp
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x33d0
nopl (%rax,%rax)