LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/ocornoc[P]crolol/src/num.cpp
// Function: crolol::num::operator/=(crolol::num)
num& num::operator/=(num rhs)
{
	const backend::saferet result = backend::divide(bi, rhs.bi);
	
	switch (result.flow) {
		case backend::badarg: throw std::invalid_argument("Bad div");
		case backend::underflow: *this = num::min(); return *this;
		case backend::overflow: *this = num::max(); return *this;
		default: *this = result.val; return *this;
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movabsq $0x7fffffffffffffff, %r14 # imm = 0x7FFFFFFFFFFFFFFF
movq (%rdi), %rdi
callq 0x7033
cmpl $0x1, %edx
je 0x6b63
cmpl $0x2, %edx
je 0x6b66
cmpl $0x3, %edx
je 0x6b74
movq %rax, %r14
jmp 0x6b66
incq %r14
movq %r14, (%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
pushq $0x10
popq %rdi
callq 0x4180
movq %rax, %rbx
leaq 0xe5e7(%rip), %rsi      # 0x1516d
movq %rax, %rdi
callq 0x4570
movq 0x1d43b(%rip), %rsi     # 0x23fd0
movq 0x1d424(%rip), %rdx     # 0x23fc0
movq %rbx, %rdi
callq 0x4510
movq %rax, %r14
movq %rbx, %rdi
callq 0x4280
movq %r14, %rdi
callq 0x4540
nop
// File: /workspace/github_cpp_makefile_star2_O2/ocornoc[P]crolol/src/num.cpp
// Function: crolol::num::operator%=(crolol::num)
num& num::operator%=(num rhs)
{
	const bool sign = rhs.bi < 0;
	
	bi = abs(*this).bi % abs(rhs).bi;
	
	if (sign) *this = -*this;
	
	return *this;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x6bfd
movq %rax, %r15
movq %r14, %rdi
callq 0x6bfd
movq %rax, %rcx
movq %r15, %rax
cqto
idivq %rcx
testq %r14, %r14
jns 0x6bf1
movq %rdx, %rdi
callq 0x6c0a
movq %rax, %rdx
movq %rdx, (%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/ocornoc[P]crolol/src/num.cpp
// Function: operator^(crolol::num, crolol::num)
num operator^(num lhs, num rhs)
{
	const backend::saferet result = backend::pow(lhs.bi, rhs.bi);
	int64_t newv;
	
	switch (result.flow) {
		case backend::badarg: throw std::invalid_argument("Bad pow");
		case backend::underflow: newv = num_min; return newv;
		case backend::overflow: newv = num_max; return newv;
		default: newv = result.val; return newv;
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movabsq $0x7fffffffffffffff, %rbx # imm = 0x7FFFFFFFFFFFFFFF
callq 0x70bd
cmpl $0x1, %edx
je 0x6cd1
cmpl $0x2, %edx
je 0x6cd4
cmpl $0x3, %edx
je 0x6cdf
movq %rax, %rbx
jmp 0x6cd4
incq %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
pushq $0x10
popq %rdi
callq 0x4180
movq %rax, %rbx
leaq 0xe484(%rip), %rsi      # 0x15175
movq %rax, %rdi
callq 0x4570
movq 0x1d2d0(%rip), %rsi     # 0x23fd0
movq 0x1d2b9(%rip), %rdx     # 0x23fc0
movq %rbx, %rdi
callq 0x4510
movq %rax, %r14
movq %rbx, %rdi
callq 0x4280
movq %r14, %rdi
callq 0x4540
// File: /workspace/github_cpp_makefile_star2_O2/ocornoc[P]crolol/src/losslessops.cpp
// Function: crolol::backend::factorial(long)
saferet backend::factorial(int64_t n)
{
	if (n < 0 or n % scale != 0) return make_badarg(n);
	
	saferet acc = clamp(scale);
	
	for (int64_t i = 0; i < n && acc.flow == noflow; i += scale)
		acc = multiply(acc.val, i);
	
	return acc;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movl $0x3e8, %ecx            # imm = 0x3E8
movq %rdi, %rax
xorl %edx, %edx
divq %rcx
movq %rdx, %rax
pushq $0x3
popq %rdx
testq %rdi, %rdi
js 0x7354
testq %rax, %rax
jne 0x7354
movq %rsp, %rdi
andq $0x0, 0x8(%rdi)
movq $0x3e8, (%rdi)          # imm = 0x3E8
movb $0x0, 0x10(%rdi)
callq 0x6fd9
xorl %r14d, %r14d
cmpq %rbx, %r14
jge 0x7351
testl %edx, %edx
jne 0x7351
movq %rax, %rdi
movq %r14, %rsi
callq 0x6f48
addq $0x3e8, %r14            # imm = 0x3E8
jmp 0x7334
movq %rax, %rbx
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/ocornoc[P]crolol/src/losslessops.cpp
// Function: crolol::backend::asin(long)
saferet backend::asin(int64_t n)
{
	if (n > scale or n < -scale) return make_badarg(n);
	else return clamp(static_cast<int128>(
		std::truncl(std::asin(
			static_cast<long double>(n) / scale
		)) * scale * radtodeg
	));
}

// Assembly:
movq %rdi, %rax
leaq -0x3e9(%rdi), %rcx
cmpq $-0x7d2, %rcx           # imm = 0xF82E
ja 0x74e7
pushq $0x3
popq %rdx
retq
subq $0x58, %rsp
movq %rax, 0x28(%rsp)
fildll 0x28(%rsp)
flds 0xdc66(%rip)            # 0x15160
fld %st(0)
fstpt 0x1c(%rsp)
fdivrp %st, %st(1)
fstpt (%rsp)
callq 0x44c0
fstpt (%rsp)
callq 0x4040
fldt 0x1c(%rsp)
fmulp %st, %st(1)
fldt 0xdca2(%rip)            # 0x151c0
fmulp %st, %st(1)
fld %st(0)
fstpt 0x1c(%rsp)
fabs
fstpt (%rsp)
callq 0x41d0
leaq 0x30(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rax, (%rdi)
fldz
fldt 0x1c(%rsp)
fxch %st(1)
fucompi %st(1), %st
fstp %st(0)
seta 0x10(%rdi)
callq 0x6fd9
addq $0x58, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ocornoc[P]crolol/src/losslessops.cpp
// Function: crolol::backend::acos(long)
saferet backend::acos(int64_t n)
{
	if (n > scale or n < -scale) return make_badarg(n);
	else return clamp(static_cast<int128>(
		std::truncl(std::acos(
			static_cast<long double>(n) / scale
		)) * scale * radtodeg
	));
}

// Assembly:
movq %rdi, %rax
leaq -0x3e9(%rdi), %rcx
cmpq $-0x7d2, %rcx           # imm = 0xF82E
ja 0x756d
pushq $0x3
popq %rdx
retq
subq $0x58, %rsp
movq %rax, 0x28(%rsp)
fildll 0x28(%rsp)
flds 0xdbe0(%rip)            # 0x15160
fld %st(0)
fstpt 0x1c(%rsp)
fdivrp %st, %st(1)
fstpt (%rsp)
callq 0x4220
fstpt (%rsp)
callq 0x4040
fldt 0x1c(%rsp)
fmulp %st, %st(1)
fldt 0xdc1c(%rip)            # 0x151c0
fmulp %st, %st(1)
fld %st(0)
fstpt 0x1c(%rsp)
fabs
fstpt (%rsp)
callq 0x41d0
leaq 0x30(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rax, (%rdi)
fldz
fldt 0x1c(%rsp)
fxch %st(1)
fucompi %st(1), %st
fstp %st(0)
seta 0x10(%rdi)
callq 0x6fd9
addq $0x58, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ocornoc[P]crolol/src/losslessops.cpp
// Function: crolol::backend::atan(long)
saferet backend::atan(int64_t n)
{
	return clamp(static_cast<int128>(
		std::truncl(std::atan(
			static_cast<long double>(n) / scale
		)) * scale * radtodeg
	));
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x28(%rsp)
fildll 0x28(%rsp)
flds 0xdb71(%rip)            # 0x15160
fld %st(0)
fstpt 0x1c(%rsp)
fdivrp %st, %st(1)
fstpt (%rsp)
callq 0x44f0
fstpt (%rsp)
callq 0x4040
fldt 0x1c(%rsp)
fmulp %st, %st(1)
fldt 0xdbad(%rip)            # 0x151c0
fmulp %st, %st(1)
fld %st(0)
fstpt 0x1c(%rsp)
fabs
fstpt (%rsp)
callq 0x41d0
leaq 0x30(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rax, (%rdi)
fldz
fldt 0x1c(%rsp)
fxch %st(1)
fucompi %st(1), %st
fstp %st(0)
seta 0x10(%rdi)
callq 0x6fd9
addq $0x58, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O2/disjukr[P]Tetris/main.cc
// Function: main
int main() {
#if defined _WIN32 && defined _DEBUG
    // check memory leak
    _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
#endif
    // handle signal
    signal(SIGINT, signalHandler);
    signal(SIGTERM, signalHandler);
    // game logic
    currentPage = new Intro();
    currentPage -> Start();
    delete currentPage;
    currentPage = new Tetris();
    currentPage -> Start();
    delete currentPage;
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq -0x2c(%rip), %rbx       # 0x33fc
pushq $0x2
popq %rdi
movq %rbx, %rsi
callq 0x3180
pushq $0xf
popq %rdi
movq %rbx, %rsi
callq 0x3180
movl $0x340, %edi            # imm = 0x340
callq 0x3140
movq %rax, %rbx
movq %rax, %rdi
callq 0x356a
movq %rbx, 0x7cee(%rip)      # 0xb148
movq %rbx, %rdi
callq 0x34c8
movq 0x7cdf(%rip), %rdi      # 0xb148
testq %rdi, %rdi
je 0x3474
movq (%rdi), %rax
callq *0x8(%rax)
movl $0x430, %edi            # imm = 0x430
callq 0x3140
movq %rax, %rbx
movq %rax, %rdi
callq 0x3afe
movq %rbx, 0x7cb8(%rip)      # 0xb148
movq %rbx, %rdi
callq 0x34c8
movq 0x7ca9(%rip), %rdi      # 0xb148
testq %rdi, %rdi
je 0x34aa
movq (%rdi), %rax
callq *0x8(%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
jmp 0x34b3
movq %rax, %r14
movq %rbx, %rdi
callq 0x3120
movq %r14, %rdi
callq 0x3230
nop
// File: /workspace/github_cpp_makefile_star2_O2/disjukr[P]Tetris/Tetris.cc
// Function: Page::Start()
void Page::Start() {
    long long int curr;
    long long int prev = Time::msec();
    long long int diff;
    Console::Clear();
    Console::SetEcho(false);
    Console::SetCursor(false);
    while (!exit) {
        curr = Time::msec();
        diff = curr - prev;
        Loop();
        if (diff >= interval) {
            Render();
            Console::Update();
            prev = curr - (diff - interval);
            ++frame;
        }
    }
    Console::Clear();
    Console::SetEcho(true);
    Console::SetCursor(true);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x6148
movq %rax, %r14
callq 0x6602
xorl %edi, %edi
callq 0x658e
xorl %edi, %edi
callq 0x65cc
cmpb $0x0, 0x8(%rbx)
jne 0x352d
callq 0x6148
movq %rax, %r15
subq %r14, %r15
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
movslq 0x10(%rbx), %rax
cmpq %rax, %r15
jl 0x34f0
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x20(%rax)
callq 0x67e4
movslq 0x10(%rbx), %rax
addq %rax, %r14
incl 0xc(%rbx)
jmp 0x34f0
callq 0x6602
pushq $0x1
popq %rbx
movl %ebx, %edi
callq 0x658e
movl %ebx, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x65cc
nop
// File: /workspace/github_cpp_makefile_star2_O2/disjukr[P]Tetris/Tetris.cc
// Function: Intro::ResetParticle(int)
void Intro::ResetParticle(int index) {
    rotations[index] = random.Get(0, 100);
    rotateSpeeds[index] = random.Get(1, 5);
    falls[index] = random.Get(0, 100);
    fallSpeeds[index] = random.Get(5, 20);
    directions[index] = random.Get() < 0.5;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %r15d
movq %rdi, %rbx
leaq 0x18(%rdi), %r14
pushq $0x64
popq %r12
movq %r14, %rdi
xorl %esi, %esi
movl %r12d, %edx
callq 0x57dc
movslq %r15d, %r13
movl %eax, 0xd0(%rbx,%r13,4)
pushq $0x1
popq %rsi
pushq $0x5
popq %r15
movq %r14, %rdi
movl %r15d, %edx
callq 0x57dc
movl %eax, 0xf8(%rbx,%r13,4)
movq %r14, %rdi
xorl %esi, %esi
movl %r12d, %edx
callq 0x57dc
movl %eax, 0x120(%rbx,%r13,4)
pushq $0x14
popq %rdx
movq %r14, %rdi
movl %r15d, %esi
callq 0x57dc
movl %eax, 0x148(%rbx,%r13,4)
movq %r14, %rdi
callq 0x4ebc
movsd 0x383b(%rip), %xmm1     # 0x7008
ucomisd %xmm0, %xmm1
seta 0x170(%rbx,%r13)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/disjukr[P]Tetris/Tetris.cc
// Function: Intro::RenderTitle(int, int)
void Intro::RenderTitle(int x, int y) {
    int xx;
    int yy;
    Screen* screen = Console::GetScreen();
    for (int i = 0; i < titleWidth; ++i) {
        for (int j = 0; j < titleHeight; ++j) {
            if (titleTable[j * titleWidth + i]) {
                xx = x + i;
                yy = y + j;
                screen -> FillCell(
                    ColorUtil::GetComplementary(
                        screen -> GetColor(xx, yy, true)),
                    xx, yy, true);
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, -0x2c(%rbp)
movq %rsi, -0x38(%rbp)
movq %rdi, %r15
callq 0x6580
movq %rax, -0x48(%rbp)
addq $0x17a, %r15            # imm = 0x17A
xorl %ecx, %ecx
pushq $0x1
popq %r12
cmpq $0x40, %rcx
je 0x3aee
movq -0x38(%rbp), %rax
movq %rcx, -0x40(%rbp)
addl %ecx, %eax
movl %eax, -0x30(%rbp)
xorl %r13d, %r13d
movl -0x2c(%rbp), %r14d
movq %r15, -0x50(%rbp)
cmpq $0x1c0, %r13            # imm = 0x1C0
je 0x3ae2
cmpb $0x1, (%r15,%r13)
jne 0x3ad9
movq -0x48(%rbp), %r15
movq %r15, %rdi
movl -0x30(%rbp), %ebx
movl %ebx, %esi
movl %r14d, %edx
movl %r12d, %ecx
callq 0x62fa
movl %eax, %edi
callq 0x4f3a
movq %r15, %rdi
movq -0x50(%rbp), %r15
movl %eax, %esi
movl %ebx, %edx
movl %r14d, %ecx
movl %r12d, %r8d
callq 0x638c
incl %r14d
addq $0x40, %r13
jmp 0x3a95
movq -0x40(%rbp), %rcx
incq %rcx
incq %r15
jmp 0x3a77
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/disjukr[P]Tetris/Tetris.cc
// Function: Tetris::Tetris()
Tetris::Tetris() {
    this -> dropFrameInterval = 20;
    this -> attachFrameInterval = 20;
    this -> lastDrop = this -> frame;
    this -> pieceGenerator = new TGM2Randomizer();
    this -> backgroundColor = BLUE;
    this -> queueScreen = new Screen(
        Tetromino::size * 2, (Tetromino::size + 1) * pieceQueueSize);
    for (int i = 0; i < pieceQueueSize; ++i)
        this -> pieceQueue.push_back(pieceGenerator -> Get());
    this -> holdPieceScreen = new Screen(
        Tetromino::size * 2, Tetromino::size + 1);
    this -> currentPiece = this -> EmitPiece();
    this -> holdPiece = NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r15
movb $0x0, 0x8(%rdi)
movabsq $0x1100000000, %rax     # imm = 0x1100000000
movq %rax, 0xc(%rdi)
leaq 0x6de8(%rip), %rax      # 0xa910
movq %rax, (%rdi)
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, 0x20(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rdi)
leaq 0x38(%rdi), %rbx
movq %rbx, %rdi
callq 0x4b22
leaq 0x3d0(%r15), %r14
movq %r14, %rdi
callq 0x5152
movabsq $0x1400000014, %rax     # imm = 0x1400000014
movq %rax, 0x14(%r15)
movl 0xc(%r15), %eax
movl %eax, 0x1c(%r15)
pushq $0x50
popq %rdi
callq 0x3140
movq %rax, %r12
movq %rax, %rdi
callq 0x5900
movq %r12, 0x3c8(%r15)
movl $0x4, 0x3b0(%r15)
pushq $0x20
popq %rdi
callq 0x3140
movq %rax, %r12
pushq $0x8
popq %rsi
pushq $0x14
popq %rdx
movq %rax, %rdi
callq 0x6234
movq %r12, 0x3b8(%r15)
pushq $0x4
popq %r13
leaq -0x30(%rbp), %r12
subl $0x1, %r13d
jb 0x3be2
movq 0x3c8(%r15), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movq %rax, -0x30(%rbp)
movq %r14, %rdi
movq %r12, %rsi
callq 0x545a
jmp 0x3bbe
pushq $0x20
popq %rdi
callq 0x3140
movq %rax, %r12
pushq $0x8
popq %rsi
pushq $0x5
popq %rdx
movq %rax, %rdi
callq 0x6234
movq %r12, 0x3c0(%r15)
movq %r15, %rdi
xorl %esi, %esi
callq 0x3c5e
movq %rax, 0x420(%r15)
andq $0x0, 0x428(%r15)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3c2e
jmp 0x3c2e
movq %rax, %r15
movq %r12, %rdi
callq 0x3120
jmp 0x3c45
movq %rax, %r15
jmp 0x3c4d
jmp 0x3c42
movq %rax, %r15
movq %r14, %rdi
callq 0x542a
movq %rbx, %rdi
callq 0x4bb4
movq %r15, %rdi
callq 0x3230
nop
// File: /workspace/github_cpp_makefile_star2_O2/disjukr[P]Tetris/Tetris.cc
// Function: Tetris::EmitPiece(Tetromino*)
Tetromino* Tetris::EmitPiece(Tetromino* piece) {
    if (piece == NULL)
        piece = this -> NextPiece();
    piece -> x = (TetrisStage::width - Tetromino::size) / 2;
    piece -> y = -(Tetromino::size / 2);
    return piece;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rsi, %rax
testq %rsi, %rsi
jne 0x3c6f
callq 0x48f4
movabsq $-0x1fffffffd, %rcx     # imm = 0xFFFFFFFE00000003
movq %rcx, 0xc(%rax)
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/disjukr[P]Tetris/Tetris.cc
// Function: Tetris::~Tetris()
Tetris::~Tetris() {
    delete this -> currentPiece;
    delete this -> pieceGenerator;
    for (int i = 0; i < pieceQueueSize; ++i)
        delete this -> pieceQueue[i];
    this -> pieceQueue.clear();
    delete this -> queueScreen;
    delete this -> holdPieceScreen;
    if (this -> holdPiece != NULL)
        delete this -> holdPiece;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x6c7c(%rip), %rax      # 0xa910
movq %rax, (%rdi)
movq 0x420(%rdi), %rdi
testq %rdi, %rdi
je 0x3ca9
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x3c8(%rbx), %rdi
testq %rdi, %rdi
je 0x3cbb
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x3e0(%rbx), %r14
xorl %r15d, %r15d
cmpq $0x4, %r15
je 0x3ce9
movq %r14, %rdi
movq %r15, %rsi
callq 0x56a6
movq (%rax), %rdi
testq %rdi, %rdi
je 0x3ce4
movq (%rdi), %rax
callq *0x8(%rax)
incq %r15
jmp 0x3cc5
leaq 0x3d0(%rbx), %r14
movq %r14, %rdi
callq 0x4f56
movq 0x3b8(%rbx), %r15
testq %r15, %r15
je 0x3d0c
movq %r15, %rdi
callq 0x6266
movq %r15, %rdi
callq 0x3120
movq 0x3c0(%rbx), %r15
testq %r15, %r15
je 0x3d28
movq %r15, %rdi
callq 0x6266
movq %r15, %rdi
callq 0x3120
movq 0x428(%rbx), %rdi
testq %rdi, %rdi
je 0x3d42
movq (%rdi), %rax
callq *0x8(%rax)
movq %r14, %rdi
callq 0x542a
addq $0x38, %rbx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4bb4
// File: /workspace/github_cpp_makefile_star2_O2/disjukr[P]Tetris/Tetris.cc
// Function: Tetris::ControlPiece(std::function<void ()>)
void Tetris::ControlPiece(std::function<void()> controlFunction) {
    Tetromino* trash;
    Tetromino* backup = currentPiece -> Clone();
    controlFunction();
    if (stage.CheckCollision(*currentPiece)) {
        trash = currentPiece;
        currentPiece = backup;
    }
    else {
        trash = backup;
    }
    delete trash;
    Infinity();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
movq 0x420(%rdi), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movq %rax, %r14
movq %r15, %rdi
callq 0x5032
leaq 0x38(%rbx), %rdi
movq 0x420(%rbx), %rsi
callq 0x4a00
testb %al, %al
je 0x4029
movq 0x420(%rbx), %rax
movq %r14, 0x420(%rbx)
movq %rax, %r14
testq %r14, %r14
je 0x4037
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4abe
nop
// File: /workspace/github_cpp_makefile_star2_O2/disjukr[P]Tetris/Tetris.cc
// Function: Tetris::SoftDrop(bool)
bool Tetris::SoftDrop(bool attach) {
    ++(this -> currentPiece -> y);
    if (stage.CheckCollision(*currentPiece)) {
        --(this -> currentPiece -> y);
        if (attach)
            this -> AttachPiece();
        return false;
    }
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r15d
movq %rdi, %rbx
movq 0x420(%rdi), %rsi
incl 0x10(%rsi)
addq $0x38, %rdi
callq 0x4a00
movl %eax, %r14d
testb %al, %al
je 0x408b
movq 0x420(%rbx), %rax
decl 0x10(%rax)
testb %r15b, %r15b
je 0x408b
movq %rbx, %rdi
callq 0x4944
xorb $0x1, %r14b
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/disjukr[P]Tetris/Tetris.cc
// Function: Tetris::HardDrop(bool)
void Tetris::HardDrop(bool attach) {
    int cast = stage.CastPiece(*currentPiece);
    statistics.score += 2 * cast;
    if (attach)
        AttachPiece();
    else
        Infinity();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
addq $0x38, %rdi
movq 0x420(%rbx), %rsi
callq 0x4a7a
addl %eax, %eax
addl %eax, 0x20(%rbx)
movq %rbx, %rdi
testl %r14d, %r14d
je 0x40d1
popq %rbx
popq %r14
popq %rbp
jmp 0x4944
popq %rbx
popq %r14
popq %rbp
jmp 0x4abe
// File: /workspace/github_cpp_makefile_star2_O2/disjukr[P]Tetris/Tetris.cc
// Function: Tetris::HoldPiece()
void Tetris::HoldPiece() {
    if (holdPiece == NULL) {
        holdPiece = currentPiece;
        currentPiece = this -> EmitPiece();
    }
    else {
        Tetromino* temp = currentPiece;
        currentPiece = this -> EmitPiece(holdPiece);
        holdPiece = temp;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x420(%rdi), %rax
movq 0x428(%rdi), %rcx
testq %rcx, %rcx
je 0x4114
movabsq $-0x1fffffffd, %rdx     # imm = 0xFFFFFFFE00000003
movq %rdx, 0xc(%rcx)
movq %rcx, 0x420(%rbx)
movq %rax, 0x428(%rbx)
jmp 0x412c
movq %rax, 0x428(%rbx)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3c5e
movq %rax, 0x420(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/disjukr[P]Tetris/Tetris.cc
// Function: Tetris::CheckGameOver()
bool Tetris::CheckGameOver() {
    for (int i = 0; i < TetrisStage::width; ++i)
        if (this -> stage.CheckBlock(i, 1))
            return true;
    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorl %ecx, %ecx
movq %rcx, %rax
cmpq $0xa, %rcx
je 0x414e
leaq 0x1(%rax), %rcx
cmpl $0x0, 0x60(%rdi,%rax,4)
je 0x413a
cmpq $0xa, %rax
setb %al
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/disjukr[P]Tetris/Tetris.cc
// Function: Tetris::CheckLine(int)
bool Tetris::CheckLine(int y) {
    for (int i = 0; i < TetrisStage::width; ++i)
        if (!(this -> stage.CheckBlock(i, y)))
            return false;
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %esi, %eax
imulq $0x28, %rax, %rax
leaq (%rax,%rdi), %rcx
addq $0x38, %rcx
xorl %edx, %edx
cmpq $0xa, %rdx
setae %al
cmpl $0x15, %esi
ja 0x418a
cmpq $0x9, %rdx
ja 0x418a
cmpl $0x0, (%rcx,%rdx,4)
leaq 0x1(%rdx), %rdx
jne 0x416c
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/disjukr[P]Tetris/Tetris.cc
// Function: Tetris::LevelUp()
void Tetris::LevelUp() {
    ++statistics.level;
    dropFrameInterval = max(dropFrameInterval - 1, 1);
    int color = (int) backgroundColor - 4;
    backgroundColor = (Color) ((++color % 6) + 4);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
incl 0x24(%rdi)
movl 0x14(%rdi), %eax
cmpl $0x3, %eax
movl $0x2, %ecx
cmovgel %eax, %ecx
decl %ecx
movl %ecx, 0x14(%rdi)
movl 0x3b0(%rdi), %eax
addl $-0x3, %eax
movl $0x6, %ecx
cltd
idivl %ecx
addl $0x4, %edx
movl %edx, 0x3b0(%rdi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/disjukr[P]Tetris/Tetris.cc
// Function: TetrisStage::Render(Tetromino&, bool)
void TetrisStage::Render(Tetromino& piece, bool renderGhost) {
    this -> RenderStage();
    if (renderGhost)
        this -> RenderGhostPiece(piece);
    this -> RenderPiece(piece);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r15d
movq %rsi, %rbx
movq %rdi, %r14
callq 0x4c2c
testl %r15d, %r15d
je 0x46b8
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4d3c
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4d7c
nop
// File: /workspace/github_cpp_makefile_star2_O2/disjukr[P]Tetris/Tetris.cc
// Function: Tetris::RenderPieceQueue()
void Tetris::RenderPieceQueue() {
    int width = queueScreen -> GetWidth();
    int offset = Tetromino::size + 1;
    queueScreen -> Clear(' ', BLACK, BLACK);
    queueScreen -> WriteLine("NEXT", 0, 0);
    for (int i = 0; i < pieceQueueSize; ++i) {
        queueScreen -> FillLine(backgroundColor, 0, i * offset, width, true);
        (*pieceQueue[i]).Render(*queueScreen, 0, i * offset + 1);
    }
    queueScreen -> FillLine(WHITE, 0, 0, 4, true);
    queueScreen -> FillLine(BLACK, 0, 0, 4, false);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq 0x3b8(%rdi), %rdi
callq 0x62aa
movl %eax, %r14d
movq 0x3b8(%rbx), %rdi
pushq $0x20
popq %rsi
pushq $0x3
popq %rcx
movl %ecx, %edx
callq 0x64ec
movq 0x3b8(%rbx), %r15
leaq 0x2c04(%rip), %rsi      # 0x7317
leaq -0x50(%rbp), %r12
leaq -0x29(%rbp), %rdx
movq %r12, %rdi
callq 0x3090
movq %r15, %rdi
movq %r12, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x632e
leaq -0x50(%rbp), %rdi
callq 0x30b0
leaq 0x3e0(%rbx), %r15
pushq $0x1
popq %rax
xorl %r13d, %r13d
movl %eax, %r12d
movq 0x3b8(%rbx), %rdi
cmpq $0x4, %r13
je 0x479a
movl 0x3b0(%rbx), %esi
leal -0x1(%r12), %ecx
xorl %edx, %edx
movl %r14d, %r8d
pushq $0x1
popq %r9
callq 0x63ae
movq %r15, %rdi
movq %r13, %rsi
callq 0x56a6
movq (%rax), %rdi
movq 0x3b8(%rbx), %rsi
movq (%rdi), %rax
xorl %edx, %edx
movl %r12d, %ecx
callq *0x30(%rax)
incq %r13
addl $0x5, %r12d
jmp 0x474b
pushq $0x4
popq %r14
pushq $0x1
popq %rsi
xorl %edx, %edx
xorl %ecx, %ecx
movl %r14d, %r8d
movl %esi, %r9d
callq 0x63ae
movq 0x3b8(%rbx), %rdi
pushq $0x3
popq %rsi
xorl %edx, %edx
xorl %ecx, %ecx
movl %r14d, %r8d
xorl %r9d, %r9d
callq 0x63ae
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x30b0
movq %rbx, %rdi
callq 0x3230
// File: /workspace/github_cpp_makefile_star2_O2/disjukr[P]Tetris/Tetris.cc
// Function: Tetris::RenderHoldPiece()
void Tetris::RenderHoldPiece() {
    holdPieceScreen -> Clear(' ', BLACK, BLACK);
    holdPieceScreen -> WriteLine("HOLD", 0, 0);
    holdPieceScreen -> FillLine(backgroundColor, 0, 0,
        holdPieceScreen -> GetWidth(), true);
    if (holdPiece != NULL)
        (*holdPiece).Render(*holdPieceScreen, 0, 1);
    holdPieceScreen -> FillLine(WHITE, 0, 0, 4, true);
    holdPieceScreen -> FillLine(BLACK, 0, 0, 4, false);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq 0x3c0(%rdi), %rdi
pushq $0x20
popq %rsi
pushq $0x3
popq %rcx
movl %ecx, %edx
callq 0x64ec
movq 0x3c0(%rbx), %r14
leaq 0x2afe(%rip), %rsi      # 0x731c
leaq -0x40(%rbp), %r15
leaq -0x19(%rbp), %rdx
movq %r15, %rdi
callq 0x3090
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x632e
leaq -0x40(%rbp), %rdi
callq 0x30b0
movq 0x3c0(%rbx), %r14
movl 0x3b0(%rbx), %r15d
movq %r14, %rdi
callq 0x62aa
pushq $0x1
popq %r9
movq %r14, %rdi
movl %r15d, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movl %eax, %r8d
callq 0x63ae
movq 0x428(%rbx), %rdi
testq %rdi, %rdi
je 0x4890
movq 0x3c0(%rbx), %rsi
movq (%rdi), %rax
pushq $0x1
popq %rcx
xorl %edx, %edx
callq *0x30(%rax)
movq 0x3c0(%rbx), %rdi
pushq $0x4
popq %r14
pushq $0x1
popq %rsi
xorl %edx, %edx
xorl %ecx, %ecx
movl %r14d, %r8d
movl %esi, %r9d
callq 0x63ae
movq 0x3c0(%rbx), %rdi
pushq $0x3
popq %rsi
xorl %edx, %edx
xorl %ecx, %ecx
movl %r14d, %r8d
xorl %r9d, %r9d
callq 0x63ae
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x30b0
movq %rbx, %rdi
callq 0x3230
nop
// File: /workspace/github_cpp_makefile_star2_O2/disjukr[P]Tetris/Tetris.cc
// Function: Tetris::NextPiece()
Tetromino* Tetris::NextPiece() {
    Tetromino* result;
    this -> pieceQueue.push_back(pieceGenerator -> Get());
    result = this -> pieceQueue.front();
    this -> pieceQueue.pop_front();
    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x3d0(%rdi), %r14
movq 0x3c8(%rdi), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
leaq -0x18(%rbp), %rsi
movq %rax, (%rsi)
movq %r14, %rdi
callq 0x545a
movq 0x3e0(%rbx), %rax
movq (%rax), %rbx
movq %r14, %rdi
callq 0x500c
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/disjukr[P]Tetris/Tetris.cc
// Function: TetrisStage::AttachPiece(Tetromino&)
void TetrisStage::AttachPiece(Tetromino& piece) {
    for (int i = 0; i < Tetromino::size; ++i) {
        for (int j = 0; j < Tetromino::size; ++j) {
            if (piece.CheckBlock(i, j)) {
                int x = i + piece.x;
                int y = j + piece.y;
                this -> WriteBlock(piece.color, x, y);
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
cmpl $0x4, %r15d
je 0x49f7
xorl %r12d, %r12d
cmpl $0x4, %r12d
je 0x49f2
movq (%rbx), %rax
movq %rbx, %rdi
movl %r15d, %esi
movl %r12d, %edx
callq *0x28(%rax)
testb %al, %al
je 0x49ed
movl 0xc(%rbx), %eax
addl %r15d, %eax
movl 0x10(%rbx), %ecx
addl %r12d, %ecx
cmpl $0xa, %eax
setae %dl
cmpl $0x16, %ecx
setae %sil
orb %dl, %sil
jne 0x49ed
movl 0x8(%rbx), %edx
movl %ecx, %ecx
movl %eax, %eax
imulq $0x28, %rcx, %rcx
addq %r14, %rcx
movl %edx, (%rcx,%rax,4)
incl %r12d
jmp 0x49a5
incl %r15d
jmp 0x499c
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/disjukr[P]Tetris/Tetris.cc
// Function: TetrisStage::CheckCollision(Tetromino&)
bool TetrisStage::CheckCollision(Tetromino& piece) {
    for (int i = 0; i < Tetromino::size; ++i) {
        for (int j = 0; j < Tetromino::size; ++j) {
            if (piece.CheckBlock(i, j)) {
                int x = i + piece.x;
                int y = j + piece.y;
                if (this -> CheckOutOfRange(x, y) ||
                    this -> CheckBlock(x, y))
                    return true;
            }
        }
    }
    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
xorl %r14d, %r14d
cmpl $0x4, %r14d
je 0x4a69
xorl %r12d, %r12d
cmpl $0x4, %r12d
je 0x4a64
movq (%rbx), %rax
movq %rbx, %rdi
movl %r14d, %esi
movl %r12d, %edx
callq *0x28(%rax)
testb %al, %al
je 0x4a5f
movl 0xc(%rbx), %eax
addl %r14d, %eax
cmpl $0x9, %eax
ja 0x4a69
movl 0x10(%rbx), %ecx
addl %r12d, %ecx
cmpl $0x15, %ecx
jg 0x4a69
ja 0x4a5f
movl %ecx, %ecx
movl %eax, %eax
imulq $0x28, %rcx, %rcx
addq %r15, %rcx
cmpl $0x0, (%rcx,%rax,4)
jne 0x4a69
incl %r12d
jmp 0x4a1d
incl %r14d
jmp 0x4a14
cmpl $0x4, %r14d
setb %al
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/disjukr[P]Tetris/Tetris.cc
// Function: TetrisStage::CastPiece(Tetromino&)
int TetrisStage::CastPiece(Tetromino& piece) {
    int lineCount = 0;
    while (!(this -> CheckCollision(piece))) {
        ++piece.y;
        ++lineCount;
    }
    --piece.y;
    return lineCount - 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r15
pushq $-0x1
popq %r14
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4a00
movl 0x10(%rbx), %ecx
testb %al, %al
jne 0x4aaa
incl %ecx
movl %ecx, 0x10(%rbx)
incl %r14d
jmp 0x4a8e
decl %ecx
movl %ecx, 0x10(%rbx)
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/disjukr[P]Tetris/Tetris.cc
// Function: Tetris::Infinity()
void Tetris::Infinity() {
    ++(currentPiece -> y);
    if (stage.CheckCollision(*currentPiece))
        lastDrop = frame;
    --(currentPiece -> y);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x420(%rdi), %rsi
incl 0x10(%rsi)
addq $0x38, %rdi
callq 0x4a00
testb %al, %al
je 0x4ae4
movl 0xc(%rbx), %eax
movl %eax, 0x1c(%rbx)
movq 0x420(%rbx), %rax
decl 0x10(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/disjukr[P]Tetris/Tetris.cc
// Function: TetrisStage::TetrisStage()
TetrisStage::TetrisStage() {
    for (int i = 0; i < width; ++i)
        for (int j = 0; j < height; ++j)
            WriteBlock(NONE, i, j);
    this -> screen = new Screen(width * 2, height);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %eax, %eax
movq %rdi, %rcx
cmpq $0xa, %rax
je 0x4b55
xorl %edx, %edx
cmpq $0x370, %rdx            # imm = 0x370
je 0x4b4c
andl $0x0, (%rcx,%rdx)
addq $0x28, %rdx
jmp 0x4b39
incq %rax
addq $0x4, %rcx
jmp 0x4b31
pushq $0x20
popq %rdi
callq 0x3140
movq %rax, %r14
pushq $0x14
popq %rsi
pushq $0x16
popq %rdx
movq %rax, %rdi
callq 0x6234
movq %r14, 0x370(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
movq %r14, %rdi
callq 0x3120
movq %rbx, %rdi
callq 0x3230
nop
// File: /workspace/github_cpp_makefile_star2_O2/disjukr[P]Tetris/Tetris.cc
// Function: TetrisStage::RenderStage()
void TetrisStage::RenderStage() {
    // render map
    for (int i = 0; i < width; ++i) {
        for (int j = 0; j < height; ++j) {
            Color color = this -> ReadBlock(i, j);
            int x = i * 2;
            int y = j;
            color = color == NONE ? BLACK : color;
            this -> screen -> FillCell(color, x, y, true);
            this -> screen -> FillCell(color, x + 1, y, true);
        }
    }
    // render dead line
    this -> screen -> WriteLine("____________________", 0, 1);
    this -> screen -> FillLine(RED, 0, 1, width * 2, false);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
xorl %eax, %eax
movq %rdi, %r15
pushq $0x1
popq %r12
cmpq $0xa, %rax
je 0x4cc7
leal (%rax,%rax), %ecx
movl %ecx, -0x34(%rbp)
movq %rax, -0x48(%rbp)
leal 0x1(,%rax,2), %eax
movl %eax, -0x30(%rbp)
movq %r15, -0x40(%rbp)
xorl %r13d, %r13d
cmpq $0x16, %r13
je 0x4cb6
movl (%r15), %r14d
testl %r14d, %r14d
pushq $0x3
popq %rax
cmovel %eax, %r14d
movq 0x370(%rbx), %rdi
movl %r14d, %esi
movl -0x34(%rbp), %edx
movl %r13d, %ecx
movl %r12d, %r8d
callq 0x638c
movq 0x370(%rbx), %rdi
movl %r14d, %esi
movl -0x30(%rbp), %edx
movl %r13d, %ecx
movl %r12d, %r8d
callq 0x638c
incq %r13
addq $0x28, %r15
jmp 0x4c6a
movq -0x48(%rbp), %rax
incq %rax
movq -0x40(%rbp), %r15
addq $0x4, %r15
jmp 0x4c49
movq 0x370(%rbx), %r14
leaq 0x264c(%rip), %rsi      # 0x7321
leaq -0x68(%rbp), %r15
leaq -0x29(%rbp), %rdx
movq %r15, %rdi
callq 0x3090
pushq $0x1
popq %rcx
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x632e
leaq -0x68(%rbp), %rdi
callq 0x30b0
movq 0x370(%rbx), %rdi
pushq $0x8
popq %rsi
pushq $0x1
popq %rcx
pushq $0x14
popq %r8
xorl %edx, %edx
xorl %r9d, %r9d
callq 0x63ae
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x30b0
movq %rbx, %rdi
callq 0x3230
// File: /workspace/github_cpp_makefile_star2_O2/disjukr[P]Tetris/Tetris.cc
// Function: TetrisStage::RenderGhostPiece(Tetromino&)
void TetrisStage::RenderGhostPiece(Tetromino& piece) {
    Tetromino* ghost = piece.Clone();
    ghost -> color = GREY;
    this -> CastPiece(*ghost);
    this -> RenderPiece(*ghost);
    delete ghost;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rsi), %rax
movq %rsi, %rdi
callq *0x10(%rax)
movq %rax, %r14
movl $0x2, 0x8(%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x4a7a
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4d7c
movq (%r14), %rax
movq %r14, %rdi
popq %rbx
popq %r14
popq %rbp
jmpq *0x8(%rax)
// File: /workspace/github_cpp_makefile_star2_O2/disjukr[P]Tetris/./Randomizer.hh
// Function: Lfsr113::Set(int)
void Set(int seed) {
        int e;
        if (seed <= 0) seed = 1;
        e = seed / IQ;
        seed = IA * (seed - e * IQ) - IR * e;
        if (seed < 0) seed += IM;
        if (seed < 2) a = seed + 2; else a = seed;
        e = seed / IQ;
        seed = IA * (seed - e * IQ) - IR * e;
        if (seed < 0) seed += IM;
        if (seed < 8) b = seed + 8; else b = seed;
        e = seed / IQ;
        seed = IA * (seed - e * IQ) - IR * e;
        if (seed < 0) seed += IM;
        if (seed < 16) c = seed + 16; else c = seed;
        e = seed / IQ;
        seed = IA * (seed - e * IQ) - IR * e;
        if (seed < 0) seed += IM;
        if (seed < 128) d = seed + 128; else d = seed;
        this -> Get(); // mix
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpl $0x2, %esi
movl $0x1, %ecx
cmovgel %esi, %ecx
movl $0x1f31d, %r8d          # imm = 0x1F31D
movl %ecx, %eax
xorl %edx, %edx
divl %r8d
imull $0xfffe0ce3, %eax, %edx # imm = 0xFFFE0CE3
addl %ecx, %edx
imull $0x41a7, %edx, %ecx     # imm = 0x41A7
imull $0xfffff4ec, %eax, %eax # imm = 0xFFFFF4EC
addl %ecx, %eax
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
leal (%rax,%rsi), %ecx
testl %eax, %eax
cmovnsl %eax, %ecx
leal 0x2(%rcx), %eax
cmpl $0x2, %ecx
cmovgel %ecx, %eax
movl %eax, 0x8(%rdi)
movl %ecx, %eax
cltd
idivl %r8d
imull $0xfffe0ce3, %eax, %edx # imm = 0xFFFE0CE3
addl %ecx, %edx
imull $0x41a7, %edx, %ecx     # imm = 0x41A7
imull $0xfffff4ec, %eax, %eax # imm = 0xFFFFF4EC
addl %ecx, %eax
leal (%rax,%rsi), %ecx
testl %eax, %eax
cmovnsl %eax, %ecx
leal 0x8(%rcx), %eax
cmpl $0x8, %ecx
cmovgel %ecx, %eax
movl %eax, 0xc(%rdi)
movl %ecx, %eax
cltd
idivl %r8d
imull $0xfffe0ce3, %eax, %edx # imm = 0xFFFE0CE3
addl %ecx, %edx
imull $0x41a7, %edx, %ecx     # imm = 0x41A7
imull $0xfffff4ec, %eax, %eax # imm = 0xFFFFF4EC
addl %ecx, %eax
leal (%rax,%rsi), %ecx
testl %eax, %eax
cmovnsl %eax, %ecx
leal 0x10(%rcx), %eax
cmpl $0x10, %ecx
cmovgel %ecx, %eax
movl %eax, 0x10(%rdi)
movl %ecx, %eax
cltd
idivl %r8d
imull $0xfffe0ce3, %eax, %edx # imm = 0xFFFE0CE3
addl %ecx, %edx
imull $0x41a7, %edx, %ecx     # imm = 0x41A7
imull $0xfffff4ec, %eax, %eax # imm = 0xFFFFF4EC
addl %ecx, %eax
addl %eax, %esi
testl %eax, %eax
cmovnsl %eax, %esi
movl $0x80, %eax
leal (%rsi,%rax), %ecx
cmpl %eax, %esi
cmovgel %esi, %ecx
movl %ecx, 0x14(%rdi)
movq (%rdi), %rax
popq %rbp
jmpq *0x18(%rax)
nop
// File: /workspace/github_cpp_makefile_star2_O2/disjukr[P]Tetris/Randomizer.cc
// Function: PieceGenerator::Get()
Tetromino* PieceGenerator::Get() {
    switch (this -> random.Get(0, 6)) {
    case 0: return new IMino();
    case 1: return new OMino();
    case 2: return new TMino();
    case 3: return new SMino();
    case 4: return new ZMino();
    case 5: return new JMino();
    default: return new LMino();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq 0x8(%rdi), %rax
addq $0x8, %rdi
callq *0x18(%rax)
mulsd 0x1bf3(%rip), %xmm0     # 0x7440
callq 0x3210
cvttsd2si %xmm0, %ebx
pushq $0x18
popq %rdi
callq 0x3140
andq $0x0, 0xc(%rax)
cmpl $0x5, %ebx
ja 0x58e2
leaq 0x1be1(%rip), %rcx      # 0x7450
movslq (%rcx,%rbx,4), %rdx
addq %rcx, %rdx
jmpq *%rdx
leaq 0x5291(%rip), %rcx      # 0xab10
movq %rcx, (%rax)
movb $0x1, 0x14(%rax)
pushq $0x5
jmp 0x58f4
leaq 0x540f(%rip), %rcx      # 0xaca0
movq %rcx, (%rax)
movb $0x1, 0x14(%rax)
pushq $0x8
jmp 0x58f4
leaq 0x533d(%rip), %rcx      # 0xabe0
movq %rcx, (%rax)
movw $0x101, 0x14(%rax)      # imm = 0x101
pushq $0x7
jmp 0x58f4
leaq 0x5389(%rip), %rcx      # 0xac40
movq %rcx, (%rax)
movb $0x1, 0x14(%rax)
pushq $0x6
jmp 0x58f4
leaq 0x52b7(%rip), %rcx      # 0xab80
movq %rcx, (%rax)
jmp 0x58f2
leaq 0x542b(%rip), %rcx      # 0xad00
movq %rcx, (%rax)
movw $0x101, 0x14(%rax)      # imm = 0x101
pushq $0x4
jmp 0x58f4
leaq 0x5477(%rip), %rcx      # 0xad60
movq %rcx, (%rax)
movw $0x101, 0x14(%rax)      # imm = 0x101
pushq $0x9
popq %rcx
movl %ecx, 0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/disjukr[P]Tetris/Randomizer.cc
// Function: TGM2Randomizer::TGM2Randomizer()
TGM2Randomizer::TGM2Randomizer() {
    history[0] = Z;
    history[1] = S;
    history[2] = Z;
    history[3] = S;
    first = true;
    pos = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x580c
leaq 0x5163(%rip), %rax      # 0xaa78
movq %rax, (%rbx)
leaq 0x20(%rbx), %rdi
callq 0x4e9c
movabsq $0x600000005, %rax      # imm = 0x600000005
movq %rax, 0x44(%rbx)
movl $0x5, 0x4c(%rbx)
movb $0x1, 0x38(%rbx)
movabsq $0x600000000, %rax      # imm = 0x600000000
movq %rax, 0x3c(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/disjukr[P]Tetris/Randomizer.cc
// Function: TGM2Randomizer::CheckHistory(int)
bool TGM2Randomizer::CheckHistory(int pieceType) {
    for (int i = 0; i < historySize; ++i)
        if (pieceType == history[i])
            return true;
    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorl %ecx, %ecx
movq %rcx, %rax
cmpq $0x4, %rcx
je 0x5979
leaq 0x1(%rax), %rcx
cmpl %esi, 0x40(%rdi,%rax,4)
jne 0x5966
cmpq $0x4, %rax
setb %al
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/disjukr[P]Tetris/Randomizer.cc
// Function: TGM2Randomizer::Get()
Tetromino* TGM2Randomizer::Get() {
    int type = random.Get(0, first ? 3 : 6); // exclude O, S, Z
    first = false;
    int i = 0;
    while (this -> CheckHistory(type) && i++ < tryCount)
        type = random.Get(0, 6);
    history[pos] = type;
    pos = (pos + 1) % 4;
    switch (type) {
    case I: return new IMino();
    case O: return new OMino();
    case T: return new TMino();
    case S: return new SMino();
    case Z: return new ZMino();
    case J: return new JMino();
    default: return new LMino();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x20(%rdi), %r14
movq 0x20(%rdi), %rax
cmpb $0x0, 0x38(%rdi)
movsd 0x1a98(%rip), %xmm0     # 0x7440
je 0x59b2
movsd 0x1a96(%rip), %xmm0     # 0x7448
movsd %xmm0, -0x28(%rbp)
movq %r14, %rdi
callq *0x18(%rax)
mulsd -0x28(%rbp), %xmm0
callq 0x3210
movb $0x0, 0x38(%rbx)
xorl %r12d, %r12d
cvttsd2si %xmm0, %r15d
movq %rbx, %rdi
movl %r15d, %esi
callq 0x5960
testb %al, %al
je 0x5a03
cmpl $0x5, %r12d
ja 0x5a03
incl %r12d
movq (%r14), %rax
movq %r14, %rdi
callq *0x18(%rax)
mulsd 0x1a44(%rip), %xmm0     # 0x7440
callq 0x3210
jmp 0x59ce
movslq 0x3c(%rbx), %rax
movl %r15d, 0x40(%rbx,%rax,4)
movl 0x3c(%rbx), %eax
incl %eax
pushq $0x4
popq %r14
cltd
idivl %r14d
movl %edx, 0x3c(%rbx)
pushq $0x18
popq %rdi
callq 0x3140
andq $0x0, 0xc(%rax)
cmpl $0x6, %r15d
ja 0x5a78
movl %r15d, %ecx
leaq 0x1a2f(%rip), %rdx      # 0x7468
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
leaq 0x50c7(%rip), %rcx      # 0xab10
movq %rcx, (%rax)
movb $0x1, 0x14(%rax)
pushq $0x5
jmp 0x5abc
leaq 0x52a5(%rip), %rcx      # 0xad00
movq %rcx, (%rax)
movw $0x101, 0x14(%rax)      # imm = 0x101
jmp 0x5abe
leaq 0x5233(%rip), %rcx      # 0xaca0
movq %rcx, (%rax)
movb $0x1, 0x14(%rax)
pushq $0x8
jmp 0x5abc
leaq 0x52e1(%rip), %rcx      # 0xad60
movq %rcx, (%rax)
movw $0x101, 0x14(%rax)      # imm = 0x101
jmp 0x5aa8
leaq 0x514f(%rip), %rcx      # 0xabe0
movq %rcx, (%rax)
movw $0x101, 0x14(%rax)      # imm = 0x101
pushq $0x7
jmp 0x5abc
leaq 0x50db(%rip), %rcx      # 0xab80
movq %rcx, (%rax)
pushq $0x9
jmp 0x5abc
leaq 0x518d(%rip), %rcx      # 0xac40
movq %rcx, (%rax)
movb $0x1, 0x14(%rax)
pushq $0x6
popq %r14
movl %r14d, 0x8(%rax)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/disjukr[P]Tetris/./Tetromino.hh
// Function: IMino::CheckBlock(int, int)
virtual bool CheckBlock(int x, int y) {
        if (!Tetromino::CheckBlock(x, y))
            return false;
        if (vertical)
            return x == 1;
        else
            return y == 2;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edx, %eax
orl %esi, %eax
cmpl $0x3, %eax
ja 0x5b48
cmpb $0x1, 0x14(%rdi)
jne 0x5b4c
cmpl $0x1, %esi
jmp 0x5b4f
xorl %eax, %eax
jmp 0x5b52
cmpl $0x2, %edx
sete %al
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/disjukr[P]Tetris/./Tetromino.hh
// Function: Tetromino::Render(Screen&, int, int)
virtual void Render(Screen& screen, int x, int y) {
        for (int i = 0; i < size; ++i) {
            for (int j = 0; j < size; ++j) {
                int tx = i * 2 + x;
                int ty = j + y;
                if (this -> CheckBlock(i, j)) {
                    screen.FillCell(this -> color, tx, ty, true);
                    screen.FillCell(this -> color, tx + 1, ty, true);
                }
            }
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, -0x48(%rbp)
movq %rdx, -0x38(%rbp)
movq %rsi, -0x40(%rbp)
movq %rdi, %r12
xorl %r14d, %r14d
movq -0x40(%rbp), %r13
pushq $0x1
popq %r15
cmpl $0x4, %r14d
je 0x5bf8
movq -0x38(%rbp), %rax
leal (%rax,%r14,2), %ecx
movl %ecx, -0x30(%rbp)
leal (%rax,%r14,2), %eax
incl %eax
movl %eax, -0x2c(%rbp)
xorl %ebx, %ebx
movq %r14, -0x50(%rbp)
cmpl $0x4, %ebx
je 0x5bf3
movq (%r12), %rax
movq %r12, %rdi
movl %r14d, %esi
movl %ebx, %edx
callq *0x28(%rax)
testb %al, %al
je 0x5bef
movq -0x48(%rbp), %rax
leal (%rax,%rbx), %r14d
movl 0x8(%r12), %esi
movq %r13, %rdi
movl -0x30(%rbp), %edx
movl %r14d, %ecx
movl %r15d, %r8d
callq 0x638c
movl 0x8(%r12), %esi
movq %r13, %rdi
movl -0x2c(%rbp), %edx
movl %r14d, %ecx
movq -0x50(%rbp), %r14
movl %r15d, %r8d
callq 0x638c
incl %ebx
jmp 0x5b9f
incl %r14d
jmp 0x5b7f
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/disjukr[P]Tetris/./Tetromino.hh
// Function: TMino::CheckBlock(int, int)
virtual bool CheckBlock(int x, int y) {
        if (!Tetromino::CheckBlock(x, y))
            return false;
        if (y == 0 || x == 3 ||
            ((y == 1 || y == 3) && (x == 0 || x == 2)))
            return false;
        if (vertical) {
            if (x == 1 &&
                ((tail && y == 1) || (!tail && y == 3)))
                return false;
        }
        else {
            if (y == 2 &&
                ((tail && x == 0) || (!tail && x == 2)))
                return false;
        }
        return true;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edx, %eax
orl %esi, %eax
cmpl $0x3, %eax
ja 0x5d2a
testl %edx, %edx
sete %al
cmpl $0x3, %esi
sete %cl
orb %al, %cl
jne 0x5d2a
movl %edx, %eax
orl $0x2, %eax
cmpl $0x3, %eax
jne 0x5d2e
testb $0x1, %sil
jne 0x5d2e
xorl %eax, %eax
popq %rbp
retq
cmpb $0x1, 0x14(%rdi)
jne 0x5d4d
cmpl $0x1, %esi
jne 0x5d5f
movzbl 0x15(%rdi), %eax
xorl $0x1, %eax
leal 0x1(,%rax,2), %eax
cmpl %edx, %eax
je 0x5d2a
jmp 0x5d5f
cmpl $0x2, %edx
jne 0x5d5f
movzbl 0x15(%rdi), %eax
xorl $0x1, %eax
addl %eax, %eax
cmpl %esi, %eax
je 0x5d2a
movb $0x1, %al
jmp 0x5d2c
nop
// File: /workspace/github_cpp_makefile_star2_O2/disjukr[P]Tetris/./Tetromino.hh
// Function: SMino::CheckBlock(int, int)
virtual bool CheckBlock(int x, int y) {
        if (!Tetromino::CheckBlock(x, y))
            return false;
        if (y == 2 && (x == 1 || x == 2))
            return true;
        if (vertical)
            return (x == 1 && y == 1) || (x == 2 && y == 3);
        else
            return y == 3 && x < 2;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edx, %eax
orl %esi, %eax
cmpl $0x3, %eax
ja 0x5e1d
cmpl $0x2, %edx
sete %cl
leal -0x1(%rsi), %eax
cmpl $0x2, %eax
setb %r8b
movb $0x1, %al
testb %r8b, %cl
jne 0x5e1f
cmpb $0x1, 0x14(%rdi)
jne 0x5e21
movl %esi, %ecx
xorl $0x1, %ecx
movl %edx, %edi
xorl $0x1, %edi
orl %ecx, %edi
je 0x5e1f
xorl $0x2, %esi
xorl $0x3, %edx
orl %esi, %edx
sete %al
jmp 0x5e1f
xorl %eax, %eax
popq %rbp
retq
cmpl $0x3, %edx
sete %cl
cmpl $0x2, %esi
setb %al
andb %cl, %al
jmp 0x5e1f
nop
// File: /workspace/github_cpp_makefile_star2_O2/disjukr[P]Tetris/./Tetromino.hh
// Function: JMino::CheckBlock(int, int)
virtual bool CheckBlock(int x, int y) {
        if (!Tetromino::CheckBlock(x, y))
            return false;
        if (vertical) {
            if (x == 1 && y > 0)
                return true;
            if (tail && x == 0 && y == 3)
                return true;
            if (!tail && x == 2 && y == 1)
                return true;
        }
        else {
            if (y == 2 && x < 3 )
                return true;
            if (!tail && x == 0 && y == 1)
                return true;
            if (tail && x == 2 && y == 3)
                return true;
        }
        return false;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edx, %eax
orl %esi, %eax
cmpl $0x3, %eax
ja 0x5ffc
cmpb $0x1, 0x14(%rdi)
jne 0x5fc9
cmpl $0x1, %esi
sete %cl
testl %edx, %edx
setne %r8b
movb $0x1, %al
testb %r8b, %cl
jne 0x5ffe
movb 0x15(%rdi), %cl
movl %edx, %edi
xorl $0x3, %edi
orl %esi, %edi
sete %dil
testb %cl, %dil
jne 0x5ffe
cmpl $0x1, %edx
jne 0x5ffc
cmpl $0x2, %esi
jne 0x5ffc
testb %cl, %cl
je 0x5ffe
jmp 0x5ffc
cmpl $0x2, %edx
sete %cl
cmpl $0x3, %esi
setb %r8b
movb $0x1, %al
testb %cl, %r8b
jne 0x5ffe
movb 0x15(%rdi), %cl
cmpl $0x1, %edx
jne 0x5fed
testl %esi, %esi
jne 0x5fed
testb %cl, %cl
je 0x5ffe
xorl $0x2, %esi
xorl $0x3, %edx
orl %esi, %edx
sete %dl
testb %cl, %dl
jne 0x5ffe
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/disjukr[P]Tetris/Screen.cc
// Function: Screen::init(int, int)
void Screen::init(int width, int height) {
    this -> width = width;
    this -> height = height;
    this -> buffer = new Cell*[height];
    for (int i = 0; i < height; ++i) {
        buffer[i] = new Cell[width];
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ecx
movq %rdi, %rbx
movl %edx, %edi
shlq $0x3, %rdi
movslq %esi, %r14
pushq $0xc
popq %rdx
movq %r14, %rax
mulq %rdx
movq %rax, %r13
seto %al
addq $0x8, %r13
pushq $-0x1
popq %rdx
cmovbq %rdx, %r13
xorl %r12d, %r12d
testl %ecx, %ecx
cmovsq %rdx, %rdi
movl $0x0, %esi
cmovgl %ecx, %esi
movq %rsi, -0x30(%rbp)
movl %r14d, (%rbx)
movl %ecx, 0x4(%rbx)
testb %al, %al
cmovneq %rdx, %r13
callq 0x3030
movq %rbx, %r15
movq %rax, 0x8(%rbx)
imulq $0xc, %r14, %rbx
cmpq -0x30(%rbp), %r12
je 0x6224
movq %r13, %rdi
callq 0x3030
movq %r14, (%rax)
testl %r14d, %r14d
je 0x6213
xorl %ecx, %ecx
movb $0x20, 0x8(%rax,%rcx)
andq $0x0, 0xc(%rax,%rcx)
addq $0xc, %rcx
cmpq %rcx, %rbx
jne 0x61ff
addq $0x8, %rax
movq 0x8(%r15), %rcx
movq %rax, (%rcx,%r12,8)
incq %r12
jmp 0x61e7
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop