// File: /workspace/github_cpp_makefile_star2_O1/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), %rcx
movq (%rcx), %rax
movq 0x18(%rcx), %rsi
leaq (%rax,%r13,4), %rdx
movl (%rdx), %eax
movl (%rsi,%r13,4), %esi
cmpl %esi, %eax
jne 0x6c29
movl (%rdx), %eax
addl %eax, %eax
movl %eax, 0x1c(%rsp)
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x6c83
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x6c8e
movq 0x30(%rcx), %rdi
movl (%rdi,%r13,4), %edi
cmpl %edi, %esi
jne 0x6c55
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x6d12
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x6d1a
movq 0x48(%rcx), %rcx
cmpl (%rcx,%r13,4), %edi
jne 0x6cf2
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x6da9
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x6db1
movq %r14, %rdi
movq %r15, %rdx
callq 0x826a
movq 0x8(%rbx), %rax
movq (%rax), %rcx
movl (%rcx,%r13,4), %ecx
addl %ecx, %ecx
addl %ecx, (%rbx)
movq 0x30(%rax), %rcx
movq 0x48(%rax), %rsi
leaq (%rcx,%r13,4), %rdx
movl (%rdx), %eax
cmpl (%rsi,%r13,4), %eax
jne 0x6cd9
movl (%rdx), %eax
addl %eax, %eax
movl %eax, 0x1c(%rsp)
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
jne 0x6e38
movq %r14, %rdi
movq %r15, %rdx
callq 0x826a
jmp 0x6e43
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x6d45
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x6d4d
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x6ddc
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x6de4
movq %r14, %rdi
callq 0x35e2
movq 0x8(%rbx), %rax
movq 0x18(%rax), %rax
movl (%rax,%r13,4), %eax
addl %eax, %eax
movl %eax, 0x1c(%rsp)
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x6d5e
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x6d69
movq %r14, %rdi
callq 0x35e2
movq 0x8(%rbx), %rax
leaq (,%r13,4), %r12
jmp 0x6e9c
movq %r14, %rdi
movq %r15, %rdx
callq 0x826a
movq 0x8(%rbx), %rax
leaq (,%r13,4), %rdx
addq 0x48(%rax), %rdx
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x6d94
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x6d9c
movq %r14, %rdi
callq 0x35e2
movq 0x8(%rbx), %rax
movq 0x18(%rax), %rax
jmp 0x6e4b
movq %r14, %rdi
callq 0x35e2
movq 0x8(%rbx), %rax
leaq (,%r13,4), %rdx
addq 0x18(%rax), %rdx
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x6e12
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x6e1a
movq %r14, %rdi
callq 0x35e2
movq 0x8(%rbx), %rax
leaq (,%r13,4), %r12
movq 0x18(%rax), %rdx
addq %r12, %rdx
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x6e55
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x6e5d
movq %r14, %rdi
callq 0x35e2
movq 0x8(%rbx), %rax
movq 0x30(%rax), %rax
movl (%rax,%r13,4), %eax
addl %eax, %eax
movl %eax, 0x1c(%rsp)
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x6e83
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
movq 0x8(%rbx), %rax
movq 0x30(%rax), %rax
movl (%rax,%r13,4), %eax
addl %eax, %eax
addl %eax, (%rbx)
jmp 0x6ec8
movq %r14, %rdi
callq 0x35e2
movq 0x8(%rbx), %rax
movq 0x30(%rax), %rdx
addq %r12, %rdx
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x6e90
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x6e98
movq %r14, %rdi
movq %r15, %rdx
callq 0x826a
jmp 0x6e43
movq %r14, %rdi
callq 0x35e2
movq 0x8(%rbx), %rax
addq 0x48(%rax), %r12
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x6ebd
movl (%r12), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x6ec8
movq %r14, %rdi
movq %r12, %rdx
callq 0x35e2
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movq %rsi, %rax
subq %rdi, %rax
cmpq $0xf, %rax
ja 0x6f1d
movl $0x0, 0x1c(%rsp)
cmpq 0x10(%rsp), %rsi
je 0x6efd
movl $0x0, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x6f08
movq %r14, %rdi
movq %r15, %rdx
callq 0x826a
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movq %rsi, %rax
subq %rdi, %rax
cmpq $0x10, %rax
jb 0x6edd
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 0x6f23
testq %rdi, %rdi
je 0x6f4c
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
incq %r13
cmpq $0x4, %r13
jne 0x6bdf
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x6f71
jmp 0x6f71
jmp 0x6f71
jmp 0x6f71
jmp 0x6f71
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x6f8a
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq %rbx, %rdi
callq 0x22b0