// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
xorl %r13d, %r13d
movq %rsp, %r14
leaq 0x1c(%rsp), %r15
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
movq 0x8(%rbx), %rax
movq (%rax), %rdx
movq 0x18(%rax), %rcx
movl (%rdx,%r13,4), %esi
movl (%rcx,%r13,4), %ecx
cmpl %ecx, %esi
jne 0x6a66
addl %esi, %esi
movl %esi, 0x1c(%rsp)
movq %r14, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x80fe
movq 0x8(%rbx), %rcx
movq (%rcx), %rdx
movq 0x30(%rcx), %rax
movq 0x48(%rcx), %rcx
movl (%rdx,%r13,4), %edx
addl %edx, %edx
addl %edx, (%rbx)
movl (%rax,%r13,4), %edi
cmpl (%rcx,%r13,4), %edi
jne 0x6afe
addl %edi, %edi
movl %edi, 0x1c(%rsp)
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x6b63
movl %edi, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x6c00
leaq (%rdx,%r13,4), %rdx
movq 0x30(%rax), %rsi
movl (%rsi,%r13,4), %esi
cmpl %esi, %ecx
jne 0x6ab5
movq %r14, %rdi
xorl %esi, %esi
callq 0x3560
movq 0x8(%rbx), %rax
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rcx
movq 0x18(%rax), %rdx
movl (%rdx,%r13,4), %edx
addl %edx, %edx
movl %edx, 0x1c(%rsp)
cmpq %rcx, %rsi
je 0x6b7b
movl %edx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x6b94
movq 0x48(%rax), %rax
cmpl (%rax,%r13,4), %esi
jne 0x6b21
movq %r14, %rdi
xorl %esi, %esi
callq 0x3560
movq 0x8(%rbx), %rcx
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rax
leaq (,%r13,4), %rdx
addq 0x18(%rcx), %rdx
cmpq %rax, %rsi
je 0x6c99
movl (%rdx), %edx
movl %edx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x6caf
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
cmpq %rdx, %rsi
je 0x6bb4
movl %edi, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x6bd2
movq %r14, %rdi
xorl %esi, %esi
callq 0x3560
movq 0x8(%rbx), %rax
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rcx
leaq (,%r13,4), %r12
movq 0x18(%rax), %rdx
addq %r12, %rdx
cmpq %rcx, %rsi
je 0x6ccf
movl (%rdx), %edx
movl %edx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x6ce5
movq %r14, %rdi
movq %r15, %rdx
callq 0x80fe
movq 0x8(%rbx), %rax
movq 0x30(%rax), %rax
jmp 0x6c00
movq %r14, %rdi
movq %r15, %rdx
callq 0x80fe
movq 0x8(%rbx), %rax
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rcx
leaq (,%r13,4), %rdx
addq 0x48(%rax), %rdx
cmpq %rcx, %rsi
je 0x6bf0
movl (%rdx), %ecx
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x6bfc
leaq (%rax,%r13,4), %rdx
movq %r14, %rdi
callq 0x3560
movq 0x8(%rbx), %rax
movq 0x48(%rax), %rcx
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq (%rcx,%r13,4), %r12
cmpq %rdx, %rsi
je 0x6d3f
movl (%r12), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x6c08
movq %r14, %rdi
callq 0x3560
movq 0x8(%rbx), %rax
movq 0x18(%rax), %rax
movl (%rax,%r13,4), %eax
addl %eax, %eax
addl %eax, (%rbx)
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movq %rsi, %rax
subq %rdi, %rax
cmpq $0xf, %rax
ja 0x6c5d
movl $0x0, 0x1c(%rsp)
cmpq 0x10(%rsp), %rsi
je 0x6c3d
movl $0x0, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x6c51
movq %r14, %rdi
movq %r15, %rdx
callq 0x80fe
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movq %rsi, %rax
subq %rdi, %rax
cmpq $0x10, %rax
jb 0x6c1d
movq 0x8(%rbx), %rax
xorl %ecx, %ecx
movl (%rdi,%rcx,4), %edx
movq (%rax), %rsi
movl %edx, (%rsi,%r13,4)
incq %rcx
addq $0x18, %rax
cmpq $0x4, %rcx
jne 0x6c63
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
incq %r13
cmpq $0x4, %r13
jne 0x69e1
jmp 0x6d4f
movq %r14, %rdi
callq 0x3560
movq 0x8(%rbx), %rcx
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rax
movq 0x30(%rcx), %rcx
movl (%rcx,%r13,4), %edx
addl %edx, %edx
movl %edx, 0x1c(%rsp)
cmpq %rax, %rsi
je 0x6d00
movl %edx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x6d13
movq %r14, %rdi
callq 0x3560
movq 0x8(%rbx), %rax
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rcx
movq 0x30(%rax), %rdx
addq %r12, %rdx
cmpq %rcx, %rsi
je 0x6d1c
movl (%rdx), %edx
movl %edx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x6d32
movq %r14, %rdi
movq %r15, %rdx
callq 0x80fe
movq 0x8(%rbx), %rax
movq 0x30(%rax), %rcx
movl (%rcx,%r13,4), %eax
jmp 0x6c04
movq %r14, %rdi
callq 0x3560
movq 0x8(%rbx), %rax
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rcx
addq 0x48(%rax), %r12
cmpq %rcx, %rsi
jne 0x6bdf
movq %r14, %rdi
movq %r12, %rdx
callq 0x3560
jmp 0x6c08
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x6d67
jmp 0x6d67
jmp 0x6d67
jmp 0x6d67
jmp 0x6d67
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x6d80
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq %rbx, %rdi
callq 0x22b0