LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/ksraj123[P]RAW12-to-bitmap-AVI/src/OutputWriter.cpp
// Function: OutputWriter::ConvertToPPM(unsigned char*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
uint8_t* OutputWriter::ConvertToPPM(uint8_t* channel, std::string chanelName)
{
    uint8_t* ppmBin = new uint8_t[3 * TOTAL_PIX]{0};
    for (int itrPpmBin = 0, itrChnl = 0; itrPpmBin < 3 * TOTAL_PIX, 
                            itrChnl < TOTAL_PIX; itrPpmBin += 3, ++itrChnl)
    {
        switch (chanelName[0])
        {
            case 'r':
                ppmBin[itrPpmBin] = channel[itrChnl];
                break;
            case 'g':
                ppmBin[itrPpmBin + 1] = channel[itrChnl];
                break;
            case 'b':
                ppmBin[itrPpmBin + 2] = channel[itrChnl];
                break;
        }      
    }
    return ppmBin;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r15
movq %rsi, %rbx
movl $0x2400000, %edi        # imm = 0x2400000
callq 0x2030
movq %rax, %r14
xorl %r12d, %r12d
movl $0x2400000, %edx        # imm = 0x2400000
movq %rax, %rdi
xorl %esi, %esi
callq 0x20f0
movq (%r15), %rax
movzbl (%rax), %eax
leaq 0x2(%r14), %rcx
movq %r14, %rdx
incq %rdx
cmpl $0x62, %eax
je 0x340f
movq %r14, %rsi
cmpl $0x72, %eax
je 0x3412
movq %rdx, %rsi
cmpl $0x67, %eax
je 0x3412
jmp 0x3419
movq %rcx, %rsi
movb (%rbx), %dil
movb %dil, (%rsi,%r12)
addq $0x3, %r12
incq %rbx
cmpq $0x2400000, %r12        # imm = 0x2400000
jne 0x33f8
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/ksraj123[P]RAW12-to-bitmap-AVI/src/OutputWriter.cpp
// Function: OutputWriter::ConvertToBMP(unsigned char*, unsigned char*, unsigned char*)
uint8_t* OutputWriter::ConvertToBMP(uint8_t* channelRed, uint8_t* channelBlue, 
                                  uint8_t* channelGreen)
{
    uint8_t* bmpBin = new uint8_t [TOTAL_PIX * 3];
    for (int row = IMAGE_HEIGHT - 1, itr = 0; row >= 0; --row)
    {
        for (int col = row * IMAGE_WIDTH; col < (row + 1) * IMAGE_WIDTH; ++col)
        {
            bmpBin[itr]     = channelBlue[col];
            bmpBin[itr + 1] = channelGreen[col];
            bmpBin[itr + 2] = channelRed[col];
            itr += 3;
        }
    }
    return bmpBin;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movl $0x2400000, %edi        # imm = 0x2400000
callq 0x2030
leaq 0x2(%rax), %rcx
movl $0xbff000, %edx         # imm = 0xBFF000
addq %rdx, %r15
addq %rdx, %rbx
addq %rdx, %r14
movl $0xbff, %edx            # imm = 0xBFF
xorl %esi, %esi
movq $-0x1000, %rdi          # imm = 0xF000
movslq %esi, %rsi
xorl %r8d, %r8d
movb (%r14,%r8), %r9b
movb %r9b, -0x2(%rcx,%rsi)
movb (%rbx,%r8), %r9b
movb %r9b, -0x1(%rcx,%rsi)
movb (%r15,%r8), %r9b
movb %r9b, (%rcx,%rsi)
addq $0x3, %rsi
incq %r8
cmpq $0x1000, %r8            # imm = 0x1000
jne 0x3631
addq %rdi, %r15
addq %rdi, %rbx
addq %rdi, %r14
subl $0x1, %edx
jae 0x362b
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/ksraj123[P]RAW12-to-bitmap-AVI/src/OutputWriter.cpp
// Function: Chunk::WriteToFile(std::basic_ofstream<char, std::char_traits<char>>*)
void Chunk::WriteToFile(std::ofstream* outputAVI)
{
    outputAVI->write(reinterpret_cast<const char*>(_fourCC), 4);
    outputAVI->write(reinterpret_cast<const char*>(&_size), 4);
    if (_avi == nullptr)
    {
        _size = 0;
    }
    outputAVI->write(reinterpret_cast<const char*>(_avi), _size);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r15
movl $0x4, %edx
movq %rsi, %rdi
movq %r15, %rsi
callq 0x21d0
leaq 0x4(%r15), %r14
movl $0x4, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x21d0
movq 0x8(%r15), %rsi
testq %rsi, %rsi
jne 0x36ec
movl $0x0, (%r14)
movl (%r14), %edx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x21d0
nop
// File: /workspace/github_cpp_makefile_star2_O1/ksraj123[P]RAW12-to-bitmap-AVI/src/ImageProcessor.cpp
// Function: ImageProcessor::Red()
void ImageProcessor::Red()
{
    int row;
    for (int itrChnl = 1; itrChnl < TOTAL_PIX; itrChnl += 2)
    {
        row = itrChnl / IMAGE_WIDTH;
        if (row % 2 == 1)
        {
            redChannel[itrChnl - 1] = (redChannel[itrChnl - 1 - IMAGE_WIDTH] 
                                 +  redChannel[itrChnl - 1 + IMAGE_WIDTH]) / 2;
            redChannel[itrChnl + 1] = (redChannel[itrChnl+1-IMAGE_WIDTH] 
                                 +  redChannel[itrChnl+1+IMAGE_WIDTH]) / 2;
        }
        redChannel[itrChnl] = (redChannel[itrChnl - 1] + redChannel[itrChnl + 1]) / 2;
    }
    std::fill(redChannel, redChannel+IMAGE_WIDTH, 0); // first row
    std::fill(redChannel + TOTAL_PIX - IMAGE_WIDTH, redChannel + TOTAL_PIX, 0); //last row
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x1, %eax
btl $0xc, %eax
jae 0x40d2
movq (%rbx), %rcx
movzbl -0x1001(%rcx,%rax), %edx
movzbl 0xfff(%rcx,%rax), %esi
addl %edx, %esi
shrl %esi
movb %sil, -0x1(%rcx,%rax)
movq (%rbx), %rcx
movzbl -0xfff(%rcx,%rax), %edx
movzbl 0x1001(%rcx,%rax), %esi
addl %edx, %esi
shrl %esi
movb %sil, 0x1(%rcx,%rax)
movq (%rbx), %rcx
movzbl -0x1(%rcx,%rax), %edx
movzbl 0x1(%rcx,%rax), %esi
addl %edx, %esi
shrl %esi
movb %sil, (%rcx,%rax)
leaq 0x2(%rax), %rcx
cmpq $0xbffffe, %rax         # imm = 0xBFFFFE
movq %rcx, %rax
jb 0x4094
movq (%rbx), %rdi
movl $0x1000, %edx           # imm = 0x1000
xorl %esi, %esi
callq 0x20f0
movl $0xbff000, %edi         # imm = 0xBFF000
addq (%rbx), %rdi
movl $0x1000, %edx           # imm = 0x1000
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x20f0
nop
// File: /workspace/github_cpp_makefile_star2_O1/ksraj123[P]RAW12-to-bitmap-AVI/src/ImageProcessor.cpp
// Function: ImageProcessor::Blue()
void ImageProcessor::Blue()
{
    int row;
    for (int itrChnl = 0; itrChnl < TOTAL_PIX; itrChnl += 2)
    {
        row = itrChnl / IMAGE_WIDTH;
        if (row % 2 == 0)
        {
            blueChannel[itrChnl - 1] = (blueChannel[itrChnl - 1 - IMAGE_WIDTH] 
                                 +  blueChannel[itrChnl - 1 + IMAGE_WIDTH]) / 2;
            blueChannel[itrChnl + 1] = (blueChannel[itrChnl+1-IMAGE_WIDTH] 
                                 +  blueChannel[itrChnl+1+IMAGE_WIDTH]) / 2;
        }
        blueChannel[itrChnl] = (blueChannel[itrChnl - 1] + blueChannel[itrChnl + 1]) / 2;
    }
    std::fill(blueChannel, blueChannel+IMAGE_WIDTH, 0); // first row
    std::fill(blueChannel + TOTAL_PIX - IMAGE_WIDTH, blueChannel + TOTAL_PIX, 0); //last row
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %eax, %eax
btl $0xc, %eax
jb 0x416b
movq 0x8(%rbx), %rcx
movzbl -0x1001(%rcx,%rax), %edx
movzbl 0xfff(%rcx,%rax), %esi
addl %edx, %esi
shrl %esi
movb %sil, -0x1(%rcx,%rax)
movq 0x8(%rbx), %rcx
movzbl -0xfff(%rcx,%rax), %edx
movzbl 0x1001(%rcx,%rax), %esi
addl %edx, %esi
shrl %esi
movb %sil, 0x1(%rcx,%rax)
movq 0x8(%rbx), %rcx
movzbl -0x1(%rcx,%rax), %edx
movzbl 0x1(%rcx,%rax), %esi
addl %edx, %esi
shrl %esi
movb %sil, (%rcx,%rax)
leaq 0x2(%rax), %rcx
cmpq $0xbffffe, %rax         # imm = 0xBFFFFE
movq %rcx, %rax
jb 0x412b
movq 0x8(%rbx), %rdi
movl $0x1000, %edx           # imm = 0x1000
xorl %esi, %esi
callq 0x20f0
movl $0xbff000, %edi         # imm = 0xBFF000
addq 0x8(%rbx), %rdi
movl $0x1000, %edx           # imm = 0x1000
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x20f0
nop
// File: /workspace/github_cpp_makefile_star2_O1/ksraj123[P]RAW12-to-bitmap-AVI/src/ImageProcessor.cpp
// Function: ImageProcessor::Green()
void ImageProcessor::Green()
{
    for (int itrChnl = IMAGE_WIDTH+1; itrChnl < TOTAL_PIX;)
    {
        greenChannel[itrChnl] = (greenChannel[itrChnl - 1] + greenChannel[itrChnl + 1] 
                         +  greenChannel[itrChnl - IMAGE_WIDTH]
                         +  greenChannel[itrChnl + IMAGE_WIDTH])/4;
        if (itrChnl / IMAGE_WIDTH != (itrChnl + 2) / IMAGE_WIDTH)
        {
            itrChnl += 3;
            continue;
        }
        itrChnl += 2;
    }
    std::fill(greenChannel, greenChannel+IMAGE_WIDTH, 0); //first row
    std::fill(greenChannel + TOTAL_PIX - IMAGE_WIDTH, greenChannel + TOTAL_PIX, 0); //last row
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x1001, %eax           # imm = 0x1001
movq 0x10(%rbx), %rdx
movslq %eax, %rcx
movzbl -0x1(%rdx,%rcx), %esi
movzbl 0x1(%rdx,%rcx), %edi
addl %esi, %edi
movzbl -0x1000(%rdx,%rcx), %esi
movzbl 0x1000(%rdx,%rcx), %r8d
addl %esi, %r8d
addl %edi, %r8d
shrl $0x2, %r8d
movb %r8b, (%rdx,%rcx)
leal 0xfff(%rcx), %esi
testl %ecx, %ecx
cmovnsl %eax, %esi
sarl $0xc, %esi
leal 0x2(%rcx), %edx
addl $0x1001, %ecx           # imm = 0x1001
testl %edx, %edx
cmovnsl %edx, %ecx
sarl $0xc, %ecx
cmpl %ecx, %esi
je 0x4224
addl $0x3, %eax
movl %eax, %edx
movl %edx, %eax
cmpl $0xc00000, %edx         # imm = 0xC00000
jl 0x41ca
movq 0x10(%rbx), %rdi
movl $0x1000, %edx           # imm = 0x1000
xorl %esi, %esi
callq 0x20f0
movl $0xbff000, %edi         # imm = 0xBFF000
addq 0x10(%rbx), %rdi
movl $0x1000, %edx           # imm = 0x1000
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x20f0
// File: /workspace/github_cpp_makefile_star2_O1/razimantv[P]DancingLinks/spangram/Trie.cpp
// Function: TrieNode::insert(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void TrieNode::insert(const std::string& word) {
  TrieNode* node = this;

  // Iterate through trie nodes for each character in the word
  for (char c : word) {
    // If the child node doesn't exist, create it
    if (!node->children[c - 'a']) node->children[c - 'a'] = new TrieNode();
    node = node->children[c - 'a'];
  }
  node->end = true; // Mark the end of the word
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rsi), %r15
testq %r15, %r15
je 0x4bd1
movq (%rsi), %r12
xorl %r13d, %r13d
movsbq (%r12,%r13), %rbp
cmpq $0x0, -0x308(%rbx,%rbp,8)
jne 0x4bc1
movl $0xd8, %edi
callq 0x2150
movq %rax, %r14
movl $0xd1, %edx
movq %rax, %rdi
xorl %esi, %esi
callq 0x20d0
movq %r14, -0x308(%rbx,%rbp,8)
movq -0x308(%rbx,%rbp,8), %rbx
incq %r13
cmpq %r13, %r15
jne 0x4b8d
movb $0x1, 0xd0(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/mh0fm4[P]SCDC/test/demos/convert/proc_U.c
// Function: main
int main(int argc, char **argv)
{
  TRACE_F("init");

  scdc_init(SCDC_INIT_DEFAULT);

#if USE_COMPS
  compS_init();
#endif

#if USE_COMPC
  compC_init();
#endif

#if USE_COMPU
  compU_run();
#elif defined(USE_COMPS) || defined(USE_COMPC)
  TRACE_F("press ENTER to exit");
  getchar();
#endif

#if USE_COMPS
  compS_release();
#endif

#if USE_COMPC
  compC_release();
#endif

  TRACE_F("release");

  scdc_release();

  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0x4ebf1(%rip), %rbx     # 0x5b048
leaq 0x4eba6(%rip), %r14     # 0x5b004
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0xb080
leaq 0x4eb99(%rip), %rdi     # 0x5b00b
xorl %eax, %eax
callq 0xb080
movl $0xa, %edi
callq 0xb740
leaq 0x500c3(%rip), %rdi     # 0x5c54d
xorl %eax, %eax
callq 0xc9bd
xorl %eax, %eax
callq 0xc818
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0xb080
leaq 0x4eb64(%rip), %rdi     # 0x5b010
xorl %eax, %eax
callq 0xb080
movl $0xa, %edi
callq 0xb740
callq 0xcac2
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/mh0fm4[P]SCDC/test/demos/convert/compU.c
// Function: compU_run
void compU_run()
{
  const char *file_in = "porsche.stl";
  const char *file_out = "porsche.msh";
  const char *compS_uri = "scdc:/compS/convert";
  const char *compC_uri = "scdc:/compC";

  char s[256];

  scdc_dataset_input_t _inp, *inp = &_inp;
  scdc_dataset_output_t _outp, *outp = &_outp;

  /* step U1: put to compS */
  sprintf(s, "%s put %s", compS_uri, file_in);
  TRACE_F("cmd: '%s'", s);
  inp = scdc_dataset_input_create(inp, "file", file_in);
  scdc_dataset_cmd(SCDC_DATASET_NULL, s, inp, NULL);
  scdc_dataset_input_destroy(inp);

  /* step U2: convert on compC */
  sprintf(s, "%s convert %s/%s %s/%s", compC_uri, compS_uri, file_in, compS_uri, file_out);
  TRACE_F("cmd: '%s'", s);
  scdc_dataset_cmd(SCDC_DATASET_NULL, s, NULL, NULL);

  /* step U3: get from compS */
  sprintf(s, "%s get %s", compS_uri, file_out);
  TRACE_F("cmd: '%s'", s);
  outp = scdc_dataset_output_create(outp, "file", file_out);
  scdc_dataset_cmd(SCDC_DATASET_NULL, s, NULL, outp);
  scdc_dataset_output_destroy(outp);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1c8, %rsp            # imm = 0x1C8
leaq 0x4e858(%rip), %rsi     # 0x5b088
leaq 0x4e8c4(%rip), %r14     # 0x5b0fb
leaq 0x4e8a5(%rip), %r15     # 0x5b0e3
leaq 0xc0(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0xb0d0
leaq 0x4e7eb(%rip), %rdi     # 0x5b048
leaq 0x4e8b7(%rip), %r12     # 0x5b11b
movq %r12, %rsi
xorl %eax, %eax
callq 0xb080
leaq 0x4e7d6(%rip), %r13     # 0x5b04b
movq %r13, %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0xb080
movl $0xa, %edi
callq 0xb740
leaq 0x4fe0b(%rip), %rsi     # 0x5c69e
leaq 0x68(%rsp), %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x200cd
movq %rax, %rbp
xorl %edi, %edi
movq %rbx, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xe400
movq %rbp, %rdi
callq 0x201bd
leaq 0x4e82a(%rip), %rbp     # 0x5b0ef
movq %rbp, (%rsp)
leaq 0x4e853(%rip), %rsi     # 0x5b123
leaq 0x4e838(%rip), %rdx     # 0x5b10f
movq %rbx, %rdi
movq %r14, %rcx
movq %r15, %r8
movq %r14, %r9
xorl %eax, %eax
callq 0xb0d0
leaq 0x4e757(%rip), %r15     # 0x5b048
movq %r15, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0xb080
movq %r13, %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0xb080
movl $0xa, %edi
callq 0xb740
xorl %edi, %edi
movq %rbx, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xe400
leaq 0x4e715(%rip), %rsi     # 0x5b041
movq %rbx, %rdi
movq %r14, %rdx
movq %rbp, %rcx
xorl %eax, %eax
callq 0xb0d0
movq %r15, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0xb080
movq %r13, %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0xb080
movl $0xa, %edi
callq 0xb740
leaq 0x10(%rsp), %rdi
leaq 0x4fd32(%rip), %rsi     # 0x5c69e
movq %rbp, %rdx
xorl %eax, %eax
callq 0x20f2b
movq %rax, %r14
xorl %edi, %edi
movq %rbx, %rsi
xorl %edx, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0xe400
movq %r14, %rdi
callq 0x2101b
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/klyushinmisha[P]GBEmu/./src/GameBoy.cpp
// Function: GameBoy::initParts()
void GameBoy::initParts() {
    cpu = new CPU();
    memory = new Memory();
    lcd = new LCD();
    timer = new Timer();
    ints = new Interrupts();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0x60, %edi
callq 0x21f0
movq %rax, %r14
movq %rax, %rdi
callq 0x2e04
movq %r14, (%rbx)
movl $0x30, %edi
callq 0x21f0
movq %rax, %r14
movq %rax, %rdi
callq 0x55f0
movq %r14, 0x8(%rbx)
movl $0x18, %edi
callq 0x21f0
movq %rax, %r14
movq %rax, %rdi
callq 0x5230
movq %r14, 0x10(%rbx)
movl $0x18, %edi
callq 0x21f0
movq %rax, %r14
movq %rax, %rdi
callq 0x595c
movq %r14, 0x18(%rbx)
movl $0x28, %edi
callq 0x21f0
movq %rax, %r14
movq %rax, %rdi
callq 0x5a28
movq %r14, 0x20(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
movl $0x28, %esi
jmp 0x267f
jmp 0x2663
movq %rax, %rbx
movl $0x18, %esi
jmp 0x267f
movq %rax, %rbx
movl $0x30, %esi
jmp 0x267f
movq %rax, %rbx
movl $0x60, %esi
movq %r14, %rdi
callq 0x2200
movq %rbx, %rdi
callq 0x22f0
nop
// File: /workspace/github_cpp_makefile_star2_O1/klyushinmisha[P]GBEmu/./src/GameBoy.cpp
// Function: GameBoy::GameBoy()
GameBoy::GameBoy() {
    DMATransfer = false;
    IME = true;
    Halt = false;
    Stop = false;
    RAM = new byte[0x10000];
    colors = new std::vector<Uint32>({ 
        0x01C4CFA1U, 
        0x018B956DU, 
        0x016B7353U, 
        0x01414141U 
    });
    setMode(2);
    setOAMInterrupt(true);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movl $0x100, 0x58(%rdi)      # imm = 0x100
movl $0x10000, %edi          # imm = 0x10000
callq 0x2040
movq %rax, 0x48(%rbx)
movl $0x18, %edi
callq 0x21f0
movq %rax, %r14
movaps 0x3949(%rip), %xmm0     # 0x6010
leaq -0x24(%rbp), %rsi
movups %xmm0, (%rsi)
leaq -0x11(%rbp), %rcx
movl $0x4, %edx
movq %rax, %rdi
callq 0x2c78
movq %r14, 0x50(%rbx)
movq 0x48(%rbx), %rax
andb $-0x4, 0xff41(%rax)
movq 0x48(%rbx), %rax
orb $0x2, 0xff41(%rax)
movq 0x48(%rbx), %rax
orb $0x20, 0xff41(%rax)
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
movl $0x18, %esi
movq %r14, %rdi
callq 0x2200
movq %rbx, %rdi
callq 0x22f0
nop
// File: /workspace/github_cpp_makefile_star2_O1/klyushinmisha[P]GBEmu/./src/GameBoy.cpp
// Function: GameBoy::getInstance()
GameBoy* GameBoy::getInstance() {
    if (GameBoy::gb == nullptr) {
        gb = new GameBoy();
        gb->initParts();
    }
    return GameBoy::gb;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
cmpq $0x0, 0x7a93(%rip)      # 0xa1c8
jne 0x275b
movl $0x60, %edi
callq 0x21f0
movq %rax, %rbx
movq %rax, %rdi
callq 0x2690
movq %rbx, 0x7a75(%rip)      # 0xa1c8
movq %rbx, %rdi
callq 0x25cc
movq 0x7a66(%rip), %rax      # 0xa1c8
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %r14
movl $0x60, %esi
movq %rbx, %rdi
callq 0x2200
movq %r14, %rdi
callq 0x22f0
nop
// File: /workspace/github_cpp_makefile_star2_O1/klyushinmisha[P]GBEmu/./src/GameBoy.cpp
// Function: GameBoy::DrawPixel(int, int, int)
void GameBoy::DrawPixel(int x, int y, int color)
{
    for (int i = 0; i < scale; i++) {
        for (int j = 0; j < scale; j++) {
            int pxl = (y * scale + i) * 160 * scale + scale * x + j;
            pixels[pxl] = colors->at(color);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x0, 0x40(%rdi)
jle 0x27f8
movq 0x50(%rdi), %r8
movslq %ecx, %rax
xorl %r9d, %r9d
movl 0x40(%rdi), %r11d
testl %r11d, %r11d
jle 0x27ef
movq (%r8), %r10
movq 0x8(%r8), %rcx
subq %r10, %rcx
sarq $0x2, %rcx
cmpq %rax, %rcx
jbe 0x2803
movq 0x38(%rdi), %rcx
xorl %ebx, %ebx
movl %r11d, %r14d
imull %edx, %r14d
movl (%r10,%rax,4), %r15d
addl %r9d, %r14d
leal (%r14,%r14,4), %r14d
shll $0x5, %r14d
addl %esi, %r14d
imull %r11d, %r14d
movslq %r14d, %r11
addq %rbx, %r11
movl %r15d, (%rcx,%r11,4)
movl 0x40(%rdi), %r11d
incq %rbx
cmpl %r11d, %ebx
jl 0x27bc
incl %r9d
cmpl 0x40(%rdi), %r9d
jl 0x279a
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3877(%rip), %rdi      # 0x6081
movq %rax, %rsi
movq %rcx, %rdx
xorl %eax, %eax
callq 0x2290
nop
// File: /workspace/github_cpp_makefile_star2_O1/klyushinmisha[P]GBEmu/./src/GameBoy.cpp
// Function: GameBoy::KeyDown(SDL_Event)
void GameBoy::KeyDown(SDL_Event e)
{
    byte key = 0;
    
    if (((RAM[0xFF00] >> 4) & 3) == 3 | ((RAM[0xFF00] >> 4) & 3) == 0)
        return;
    
    if (RAM[0xFF00] >> 4 == 0b1101)
        switch (e.key.keysym.sym)
        {
            case SDL_SCANCODE_1:
                key = 0b111;
                break;
            case SDL_SCANCODE_2:
                key = 0b1011;
                break;
            case SDL_SCANCODE_K:
                key = 0b1101;
                break;
            case SDL_SCANCODE_L:
                key = 0b1110;
                break;
            default:
                return;
        }
    else if (RAM[0xFF00] >> 4 == 0b1110)
        switch (e.key.keysym.sym)
        {
            case SDL_SCANCODE_W:
                key = 0b1011;
                break;
            case SDL_SCANCODE_A:
                key = 0b1101;
                break;
            case SDL_SCANCODE_S:
                key = 0b111;
                break;
            case SDL_SCANCODE_D:
                key = 0b1110;
                break;
            default:
                return;
        }
    
    RAM[0xFF0F] |= 0b10000;
    RAM[0xFF00] &= 0xF0;
    RAM[0xFF00] |= key;
    Stop = false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x48(%rdi), %rax
movzbl 0xff00(%rax), %ecx
shrl $0x4, %ecx
movl %ecx, %edx
andl $0x3, %edx
je 0x2b0d
cmpl $0x3, %edx
je 0x2b0d
leaq 0x10(%rbp), %rdx
cmpb $0xe, %cl
je 0x2ab1
movzbl %cl, %ecx
cmpl $0xd, %ecx
jne 0x2ac7
movl 0x14(%rdx), %ecx
cmpl $0x1d, %ecx
jg 0x2acb
cmpl $0xe, %ecx
je 0x2ae7
cmpl $0xf, %ecx
je 0x2ac3
jmp 0x2b0d
movl 0x14(%rdx), %edx
cmpl $0x15, %edx
jg 0x2ad9
cmpl $0x4, %edx
je 0x2ae7
cmpl $0x7, %edx
jne 0x2b0d
movb $0xe, %cl
jmp 0x2aed
xorl %ecx, %ecx
jmp 0x2aed
cmpl $0x1e, %ecx
je 0x2aeb
cmpl $0x1f, %ecx
jne 0x2b0d
movb $0xb, %cl
jmp 0x2aed
cmpl $0x16, %edx
je 0x2aeb
movb $0xb, %cl
cmpl $0x1a, %edx
je 0x2aed
jmp 0x2b0d
movb $0xd, %cl
jmp 0x2aed
movb $0x7, %cl
orb $0x10, 0xff0f(%rax)
movq 0x48(%rdi), %rax
andb $-0x10, 0xff00(%rax)
movq 0x48(%rdi), %rax
orb %cl, 0xff00(%rax)
movb $0x0, 0x5b(%rdi)
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/klyushinmisha[P]GBEmu/./src/GameBoy.cpp
// Function: GameBoy::~GameBoy()
GameBoy::~GameBoy()
{
    delete cpu;
    delete memory;
    delete lcd;
    delete timer;
    delete ints;
    delete[] RAM;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x2b47
movl $0x60, %esi
callq 0x2200
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x2b5a
movl $0x30, %esi
callq 0x2200
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x2b6d
movl $0x18, %esi
callq 0x2200
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x2b80
movl $0x18, %esi
callq 0x2200
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x2b93
movl $0x28, %esi
callq 0x2200
movq 0x48(%rbx), %rdi
addq $0x8, %rsp
testq %rdi, %rdi
je 0x2ba7
popq %rbx
popq %rbp
jmp 0x2260
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::CPU()
CPU::CPU() {
    this->gb = GameBoy::getInstance();
    A = (byte*)&AF + 1;
    F = (byte*)&AF;
    B = (byte*)&BC + 1;
    C = (byte*)&BC;
    D = (byte*)&DE + 1;
    E = (byte*)&DE;
    H = (byte*)&HL + 1;
    L = (byte*)&HL;
    PC = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x2726
movq %rax, 0x58(%rbx)
leaq 0x1(%rbx), %rax
movq %rax, 0x10(%rbx)
movq %rbx, 0x18(%rbx)
leaq 0x2(%rbx), %rax
leaq 0x3(%rbx), %rcx
movq %rcx, 0x20(%rbx)
movq %rax, 0x28(%rbx)
leaq 0x4(%rbx), %rax
leaq 0x5(%rbx), %rcx
movq %rcx, 0x30(%rbx)
movq %rax, 0x38(%rbx)
leaq 0x6(%rbx), %rax
leaq 0x7(%rbx), %rcx
movq %rcx, 0x40(%rbx)
movq %rax, 0x48(%rbx)
movw $0x0, 0x50(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::ADDsbyteToSP()
ushort CPU::ADDsbyteToSP()
{
    Zero = false;
    Substract = false;
    tmp = gb->Read(PC);
    PC++;
    ushort newSP = SP;
    char* sb = (char*)&tmp;
    newSP += *sb;
    
    if (*sb < 0)
    {
        HalfCarry = (newSP & 0xF) <= (SP & 0xF);
        Carry = (newSP & 0xFF) <= (SP & 0xFF);
    }
    else
    {
        HalfCarry = (((SP & 0xF) + (tmp & 0xF)) & 0x10) == 0x10;
        Carry = (((SP & 0xFF) + (tmp & 0xFF)) & 0x100) == 0x100;
    }
    gb->SyncCycles(8);
    return newSP;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movw $0x0, 0x8(%rdi)
movq 0x58(%rdi), %rdi
movzwl 0x50(%rbx), %esi
callq 0x2c08
movb %al, 0x55(%rbx)
incw 0x50(%rbx)
movzwl 0x52(%rbx), %edx
movsbl %al, %esi
leal (%rdx,%rsi), %r14d
movzbl %dl, %ecx
testb %sil, %sil
js 0x49c8
andl $0xf, %edx
movzbl %al, %esi
andb $0xf, %al
movzbl %al, %eax
addl %edx, %eax
cmpl $0x10, %eax
setae 0xa(%rbx)
addl %esi, %ecx
cmpl $0x100, %ecx            # imm = 0x100
setae %al
jmp 0x49e2
movzwl %r14w, %eax
movl %eax, %esi
andl $0xf, %esi
andl $0xf, %edx
cmpl %edx, %esi
setbe 0xa(%rbx)
movzbl %al, %eax
cmpl %ecx, %eax
setbe %al
movb %al, 0xb(%rbx)
movq 0x58(%rbx), %rdi
movl $0x8, %esi
callq 0x2baa
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::POP(unsigned char*, unsigned char*)
void CPU::POP(byte* h, byte* l)
{
    *l = gb->Read(SP);
    SP++;
    *h = gb->Read(SP);
    SP++;
    gb->SyncCycles(4);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x58(%rdi), %rdi
movzwl 0x52(%r15), %esi
callq 0x2c08
movb %al, (%rbx)
movzwl 0x52(%r15), %eax
incl %eax
movw %ax, 0x52(%r15)
movq 0x58(%r15), %rdi
movzwl %ax, %esi
callq 0x2c08
movb %al, (%r14)
incw 0x52(%r15)
movq 0x58(%r15), %rdi
movl $0x4, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2baa
nop
// File: /workspace/github_cpp_makefile_star2_O1/klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::ADD(unsigned char)
void CPU::ADD(byte value)
{
    Substract = false;
    HalfCarry = (((*A & 0xF) + (value & 0xF)) & 0x10) == 0x10;
    Carry = ((*A + value) & 0x100) == 0x100;
    *A += value;
    Zero = (*A) == 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb $0x0, 0x9(%rdi)
movq 0x10(%rdi), %rax
movzbl (%rax), %ecx
andl $0xf, %ecx
movl %esi, %edx
andl $0xf, %edx
addl %ecx, %edx
cmpl $0x10, %edx
setae 0xa(%rdi)
movzbl (%rax), %ecx
addl %esi, %ecx
cmpl $0x100, %ecx            # imm = 0x100
setae 0xb(%rdi)
addb %sil, (%rax)
movq 0x10(%rdi), %rax
cmpb $0x0, (%rax)
sete 0x8(%rdi)
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::ADC(unsigned char)
void CPU::ADC(byte value)
{
    byte carry = Carry ? 1 : 0;
    Substract = false;
    HalfCarry = (((*A & 0xF) + (value & 0xF) + carry) & 0x10) == 0x10;
    Carry = ((*A + value + carry) & 0x100) == 0x100;
    *A += value + carry;
    Zero = (*A) == 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movzbl 0xb(%rdi), %ecx
movb $0x0, 0x9(%rdi)
movq 0x10(%rdi), %rax
movl %ecx, %edx
addl %esi, %edx
leal (%rcx,%rsi), %r8d
movb (%rax), %r9b
andb $0xf, %r9b
andb $0xf, %sil
addb %cl, %sil
addb %r9b, %sil
shrb $0x4, %sil
andb $0x1, %sil
movb %sil, 0xa(%rdi)
movzbl (%rax), %ecx
addl %ecx, %edx
shrl $0x8, %edx
andb $0x1, %dl
movb %dl, 0xb(%rdi)
addb %r8b, (%rax)
movq 0x10(%rdi), %rax
cmpb $0x0, (%rax)
sete 0x8(%rdi)
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::SUB(unsigned char)
void CPU::SUB(byte value)
{
    Substract = true;
    HalfCarry = (*A & 0xF) < (value & 0xF);
    Carry = (*A & 0xFF) < (value & 0xFF);
    *A -= value;
    Zero = (*A) == 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb $0x1, 0x9(%rdi)
movq 0x10(%rdi), %rax
movb (%rax), %cl
andb $0xf, %cl
movl %esi, %edx
andb $0xf, %dl
cmpb %cl, %dl
seta 0xa(%rdi)
cmpb %sil, (%rax)
setb 0xb(%rdi)
subb %sil, (%rax)
movq 0x10(%rdi), %rax
cmpb $0x0, (%rax)
sete 0x8(%rdi)
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::SBC(unsigned char)
void CPU::SBC(byte value)
{
    byte carry = Carry ? 1 : 0;
    Substract = true;
    HalfCarry = (*A & 0xF) < ((value & 0xF) + carry);
    Carry = (*A & 0xFF) < ((value & 0xFF) + carry);
    *A -= value + carry;
    Zero = (*A) == 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movzbl 0xb(%rdi), %eax
movb $0x1, 0x9(%rdi)
movq 0x10(%rdi), %rcx
movzbl (%rcx), %edx
andl $0xf, %edx
movl %esi, %r8d
andl $0xf, %r8d
addl %eax, %r8d
cmpl %edx, %r8d
seta 0xa(%rdi)
movzbl (%rcx), %edx
movl %eax, %r8d
addl %esi, %r8d
cmpl %edx, %r8d
seta 0xb(%rdi)
addl %esi, %eax
subb %al, (%rcx)
movq 0x10(%rdi), %rax
cmpb $0x0, (%rax)
sete 0x8(%rdi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::AND(unsigned char)
void CPU::AND(byte value)
{
    HalfCarry = true;
    Substract = false;
    Carry = false;
    *A &= value;
    Zero = (*A) == 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movw $0x100, 0x9(%rdi)       # imm = 0x100
movb $0x0, 0xb(%rdi)
movq 0x10(%rdi), %rax
andb %sil, (%rax)
movq 0x10(%rdi), %rax
cmpb $0x0, (%rax)
sete 0x8(%rdi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::OR(unsigned char)
void CPU::OR(byte value)
{
    HalfCarry = false;
    Substract = false;
    Carry = false;
    *A |= value;
    Zero = (*A) == 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movw $0x0, 0x9(%rdi)
movb $0x0, 0xb(%rdi)
movq 0x10(%rdi), %rax
orb %sil, (%rax)
movq 0x10(%rdi), %rax
cmpb $0x0, (%rax)
sete 0x8(%rdi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::XOR(unsigned char)
void CPU::XOR(byte value)
{
    HalfCarry = false;
    Substract = false;
    Carry = false;
    *A ^= value;
    Zero = (*A) == 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movw $0x0, 0x9(%rdi)
movb $0x0, 0xb(%rdi)
movq 0x10(%rdi), %rax
xorb %sil, (%rax)
movq 0x10(%rdi), %rax
cmpb $0x0, (%rax)
sete 0x8(%rdi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::INC(unsigned char*)
void CPU::INC(byte* value)
{
    Substract = false;
    HalfCarry = (*value & 0xF) == 0xF;
    (*value)++;
    Zero = *value == 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb $0x0, 0x9(%rdi)
movb (%rsi), %al
notb %al
testb $0xf, %al
sete 0xa(%rdi)
incb (%rsi)
sete 0x8(%rdi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::DEC(unsigned char*)
void CPU::DEC(byte* value)
{
    Substract = true;
    HalfCarry = (*value & 0xF) == 0;
    (*value)--;
    Zero = *value == 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb $0x1, 0x9(%rdi)
testb $0xf, (%rsi)
sete 0xa(%rdi)
decb (%rsi)
sete 0x8(%rdi)
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::ADD(unsigned short)
void CPU::ADD(ushort value)
{
    Substract = false;
    HalfCarry = (((HL & 0xFFF) + (value & 0xFFF)) & 0x1000) == 0x1000;
    Carry = (((HL & 0xFFFF) + (value & 0xFFFF)) & 0x10000) == 0x10000;
    HL += value;
    gb->SyncCycles(4);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb $0x0, 0x9(%rdi)
movzwl 0x6(%rdi), %eax
movl $0xfff, %ecx            # imm = 0xFFF
movl %eax, %edx
andl %ecx, %edx
andl %esi, %ecx
addl %edx, %ecx
cmpl $0x1000, %ecx           # imm = 0x1000
setae 0xa(%rdi)
addl %esi, %eax
cmpl $0x10000, %eax          # imm = 0x10000
setae 0xb(%rdi)
movw %ax, 0x6(%rdi)
movq 0x58(%rdi), %rdi
movl $0x4, %esi
popq %rbp
jmp 0x2baa
nop
// File: /workspace/github_cpp_makefile_star2_O1/klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::SWAP(unsigned char*)
void CPU::SWAP(byte* value)
{
    Zero = (*value) == 0;
    HalfCarry = false;
    Substract = false;
    Carry = false;
    *value = (*value & 0xF0) >> 4 | (*value) << 4;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpb $0x0, (%rsi)
sete 0x8(%rdi)
movw $0x0, 0x9(%rdi)
movb $0x0, 0xb(%rdi)
rolb $0x4, (%rsi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::RLC(unsigned char*)
void CPU::RLC(byte* value)
{
    Carry = ((*value >> 7) & 1) == 1;
    *value = *value >> 7 | (*value) << 1;
    Zero = (*value) == 0;
    HalfCarry = false;
    Substract = false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb (%rsi), %al
shrb $0x7, %al
movb %al, 0xb(%rdi)
movb (%rsi), %al
movl %eax, %ecx
rolb %cl
movb %cl, (%rsi)
testb %al, %al
sete 0x8(%rdi)
movw $0x0, 0x9(%rdi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::RL(unsigned char*)
void CPU::RL(byte* value)
{
    byte temp = (*value);
    *value = *value << 1 | (Carry ? 1 : 0);
    Carry = ((temp >> 7) & 1) == 1;
    Zero = (*value) == 0;
    HalfCarry = false;
    Substract = false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb (%rsi), %al
leal (%rax,%rax), %ecx
orb 0xb(%rdi), %cl
movb %cl, (%rsi)
shrb $0x7, %al
movb %al, 0xb(%rdi)
cmpb $0x0, (%rsi)
sete 0x8(%rdi)
movw $0x0, 0x9(%rdi)
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::RRC(unsigned char*)
void CPU::RRC(byte* value)
{
    Carry = (*value & 1) == 1;
    *value = (*value >> 1) | ((*value & 1) << 7);
    Zero = (*value) == 0;
    HalfCarry = false;
    Substract = false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb (%rsi), %al
andb $0x1, %al
movb %al, 0xb(%rdi)
movb (%rsi), %al
movl %eax, %ecx
rorb %cl
movb %cl, (%rsi)
testb %al, %al
sete 0x8(%rdi)
movw $0x0, 0x9(%rdi)
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::RR(unsigned char*)
void CPU::RR(byte* value)
{
    byte temp = (*value);
    *value = *value >> 1 | (Carry ? 0x80 : 0);
    Carry = (temp & 1) == 1;
    Zero = (*value) == 0;
    HalfCarry = false;
    Substract = false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb (%rsi), %al
movb 0xb(%rdi), %cl
movl %eax, %edx
shrb %dl
shlb $0x7, %cl
orb %dl, %cl
movb %cl, (%rsi)
andb $0x1, %al
movb %al, 0xb(%rdi)
cmpb $0x0, (%rsi)
sete 0x8(%rdi)
movw $0x0, 0x9(%rdi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::SLA(unsigned char*)
void CPU::SLA(byte* value)
{
    Carry = (*value & 0x80) == 0x80;
    *value = *value << 1;
    Zero = (*value) == 0;
    HalfCarry = false;
    Substract = false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb (%rsi), %al
shrb $0x7, %al
movb %al, 0xb(%rdi)
movb (%rsi), %al
addb %al, %al
movb %al, (%rsi)
sete 0x8(%rdi)
movw $0x0, 0x9(%rdi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::SRA(unsigned char*)
void CPU::SRA(byte* value)
{
    Carry = (*value & 1) == 1;
    *value = (*value & 0x80) | (*value) >> 1;
    Zero = *value == 0;
    HalfCarry = false;
    Substract = false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb (%rsi), %al
andb $0x1, %al
movb %al, 0xb(%rdi)
movb (%rsi), %al
movl %eax, %ecx
andb $-0x80, %cl
shrb %al
orb %cl, %al
movb %al, (%rsi)
sete 0x8(%rdi)
movw $0x0, 0x9(%rdi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::SRL(unsigned char*)
void CPU::SRL(byte* value)
{
    Carry = (*value & 1) == 1;
    *value = *value >> 1;
    Zero = (*value) == 0;
    HalfCarry = false;
    Substract = false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb (%rsi), %al
andb $0x1, %al
movb %al, 0xb(%rdi)
movb (%rsi), %al
movl %eax, %ecx
shrb %cl
movb %cl, (%rsi)
cmpb $0x2, %al
setb 0x8(%rdi)
movw $0x0, 0x9(%rdi)
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::DAA()
void CPU::DAA()
{
    byte bias = Carry ? 0x60 : 0;

    bias += HalfCarry ? 0x6 : 0;

    if (Substract)
        *A -= bias;
    else
    {
        if ((*A & 0xF) > 9)
            bias |= 6;
        if (*A > 0x99)
        {
            bias |= 0x60;
            Carry = true;
        }
        *A += bias;
    }

    HalfCarry = false;

    Zero = (*A) == 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorl %eax, %eax
cmpb $0x0, 0xa(%rdi)
movl $0x6, %ecx
cmovel %eax, %ecx
cmpb $0x0, 0xb(%rdi)
movl $0x60, %esi
cmovel %eax, %esi
orl %esi, %ecx
movq 0x10(%rdi), %rax
movb (%rax), %dl
cmpb $0x1, 0x9(%rdi)
jne 0x4e62
subb %cl, %dl
movl %edx, %ecx
jmp 0x4e8b
movl %edx, %r8d
andb $0xe, %r8b
orb $0x6, %sil
cmpb $0xa, %r8b
movzbl %cl, %r8d
movzbl %sil, %ecx
cmovbl %r8d, %ecx
cmpb $-0x66, %dl
jb 0x4e89
orb $0x60, %cl
movb $0x1, 0xb(%rdi)
addb (%rax), %cl
movb %cl, (%rax)
movb $0x0, 0xa(%rdi)
movq 0x10(%rdi), %rax
cmpb $0x0, (%rax)
sete 0x8(%rdi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::HALT()
void CPU::HALT()
{
    bool halt = gb->EnterHALTMode();
    if (!halt) {
        gb->Clock();
        PC--;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x58(%rdi), %rdi
callq 0x2c5c
testb %al, %al
jne 0x4ef3
movq 0x58(%rbx), %rdi
callq 0x2c4e
decw 0x50(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::STOP()
void CPU::STOP()
{
    if (gb->Read(PC) == 0x00)
    {
        gb->Stop = true;
        PC++;
        gb->SyncCycles(-4);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x58(%rdi), %rdi
movzwl 0x50(%rbx), %esi
callq 0x2c08
testb %al, %al
je 0x4f1b
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq 0x58(%rbx), %rdi
movb $0x1, 0x5b(%rdi)
incw 0x50(%rbx)
movl $0xfffffffc, %esi       # imm = 0xFFFFFFFC
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2baa
nop
// File: /workspace/github_cpp_makefile_star2_O1/klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::RLCA()
void CPU::RLCA()
{
    Carry = ((*A >> 7) & 1) == 1;
    *A = *A >> 7 | (*A) << 1;
    Zero = false;
    HalfCarry = false;
    Substract = false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x10(%rdi), %rax
movb (%rax), %cl
shrb $0x7, %cl
movb %cl, 0xb(%rdi)
rolb (%rax)
movw $0x0, 0x8(%rdi)
movb $0x0, 0xa(%rdi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::RLA()
void CPU::RLA()
{
    byte temp = (*A);
    *A = *A << 1 | (Carry ? 1 : 0);
    Carry = ((temp >> 7) & 1) == 1;
    Zero = false;
    HalfCarry = false;
    Substract = false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x10(%rdi), %rax
movb (%rax), %cl
leal (%rcx,%rcx), %edx
orb 0xb(%rdi), %dl
movb %dl, (%rax)
shrb $0x7, %cl
movb %cl, 0xb(%rdi)
movw $0x0, 0x8(%rdi)
movb $0x0, 0xa(%rdi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::RRCA()
void CPU::RRCA()
{
    Carry = (*A & 1) == 1;
    *A = (*A >> 1) | ((*A & 1) << 7);
    Zero = false;
    HalfCarry = false;
    Substract = false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x10(%rdi), %rax
movb (%rax), %cl
andb $0x1, %cl
movb %cl, 0xb(%rdi)
rorb (%rax)
movw $0x0, 0x8(%rdi)
movb $0x0, 0xa(%rdi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::RRA()
void CPU::RRA()
{
    byte temp = (*A);
    *A = *A >> 1 | (Carry ? 0x80 : 0);
    Carry = (temp & 1) == 1;
    Zero = false;
    HalfCarry = false;
    Substract = false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x10(%rdi), %rax
movb (%rax), %cl
movb 0xb(%rdi), %dl
shlb $0x7, %dl
movl %ecx, %esi
shrb %sil
orb %dl, %sil
movb %sil, (%rax)
andb $0x1, %cl
movb %cl, 0xb(%rdi)
movw $0x0, 0x8(%rdi)
movb $0x0, 0xa(%rdi)
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::JP(bool)
void CPU::JP(bool flag)
{
    if (flag)
        PC = gb->ReadWord(PC);
    else
    {
        PC += 2;
        gb->SyncCycles(4);
    }
    gb->SyncCycles(4);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
testl %esi, %esi
je 0x5022
movq 0x58(%rbx), %rdi
movzwl 0x50(%rbx), %esi
callq 0x2c16
movw %ax, 0x50(%rbx)
jmp 0x5035
addw $0x2, 0x50(%rbx)
movq 0x58(%rbx), %rdi
movl $0x4, %esi
callq 0x2baa
movq 0x58(%rbx), %rdi
movl $0x4, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2baa
nop
// File: /workspace/github_cpp_makefile_star2_O1/klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::JR(bool)
void CPU::JR(bool flag)
{
    byte value;
    char* sb;
    if (flag)
    {
        value = gb->Read(PC);
        sb = (char*)&value;
        PC = (ushort)(PC + *sb);
    }
    PC++;
    gb->SyncCycles(4);
    
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
testl %esi, %esi
je 0x506b
movq 0x58(%rbx), %rdi
movzwl 0x50(%rbx), %esi
callq 0x2c08
movsbl %al, %eax
addw %ax, 0x50(%rbx)
incw 0x50(%rbx)
movq 0x58(%rbx), %rdi
movl $0x4, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2baa
nop
// File: /workspace/github_cpp_makefile_star2_O1/klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::CALL(bool)
void CPU::CALL(bool flag)
{
    if (flag)
    {
        SP -= 2;
        gb->WriteWord(SP, (ushort)(PC + 2));
        PC = gb->ReadWord(PC);
    }
    else
    {
        PC += 2;
        gb->SyncCycles(4);
    }
    gb->SyncCycles(4);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
testl %esi, %esi
je 0x50c7
movzwl 0x52(%rbx), %esi
addl $-0x2, %esi
movw %si, 0x52(%rbx)
movq 0x58(%rbx), %rdi
movl $0xffff, %eax           # imm = 0xFFFF
andl %eax, %esi
movl 0x50(%rbx), %edx
addl $0x2, %edx
andl %eax, %edx
callq 0x2c24
movq 0x58(%rbx), %rdi
movzwl 0x50(%rbx), %esi
callq 0x2c16
movw %ax, 0x50(%rbx)
jmp 0x50da
addw $0x2, 0x50(%rbx)
movq 0x58(%rbx), %rdi
movl $0x4, %esi
callq 0x2baa
movq 0x58(%rbx), %rdi
movl $0x4, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2baa
// File: /workspace/github_cpp_makefile_star2_O1/klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::RST(unsigned short)
void CPU::RST(ushort addr)
{
    SP -= 2;
    gb->WriteWord(SP, PC);
    PC = addr;
    gb->SyncCycles(4);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
movzwl 0x52(%rdi), %eax
addl $-0x2, %eax
movw %ax, 0x52(%rdi)
movq 0x58(%rdi), %rdi
movzwl %ax, %esi
movzwl 0x50(%r14), %edx
callq 0x2c24
movw %bx, 0x50(%r14)
movq 0x58(%r14), %rdi
movl $0x4, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x2baa
nop
// File: /workspace/github_cpp_makefile_star2_O1/klyushinmisha[P]GBEmu/./src/CPU.cpp
// Function: CPU::RET(bool)
void CPU::RET(bool flag)
{
    if (flag)
    {
        PC = gb->ReadWord(SP);
        SP += 2;
        gb->SyncCycles(4);
    }
    gb->SyncCycles(4);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
testl %esi, %esi
je 0x515f
movq 0x58(%rbx), %rdi
movzwl 0x52(%rbx), %esi
callq 0x2c16
movw %ax, 0x50(%rbx)
addw $0x2, 0x52(%rbx)
movq 0x58(%rbx), %rdi
movl $0x4, %esi
callq 0x2baa
movq 0x58(%rbx), %rdi
movl $0x4, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2baa
nop
// File: /workspace/github_cpp_makefile_star2_O1/klyushinmisha[P]GBEmu/./src/LCD.cpp
// Function: LCD::GetColor(unsigned short, int, int)
byte LCD::GetColor(ushort startAddr, int xOffset, int yOffset)
{
    byte half1 = (RAM[startAddr] >> (7 - xOffset)) & 1;
    byte half2 = (RAM[startAddr + 1] >> (7 - xOffset)) & 1;
    byte value = (half2 << 1) + half1;
    return value;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x10(%rdi), %rax
movl %esi, %esi
movzbl (%rax,%rsi), %edi
movb $0x7, %cl
subb %dl, %cl
movzbl %cl, %ecx
xorl %edx, %edx
btl %ecx, %edi
setb %dl
movzbl 0x1(%rax,%rsi), %eax
shrl %cl, %eax
andl $0x1, %eax
leal (%rdx,%rax,2), %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/klyushinmisha[P]GBEmu/./src/LCD.cpp
// Function: LCD::LCD()
LCD::LCD()
{
    this->gb = GameBoy::getInstance();
    this->RAM = gb->getRAM();
    background = new Background();
    //s = new Sprite(gb);
    //window = new Window(gb);
    //sID = new byte[10];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x2726
movq %rax, (%rbx)
movq 0x48(%rax), %rax
movq %rax, 0x10(%rbx)
movl $0x10, %edi
callq 0x21f0
movq %rax, %r14
movq %rax, %rdi
callq 0x537c
movq %r14, 0x8(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
movl $0x10, %esi
movq %r14, %rdi
callq 0x2200
movq %rbx, %rdi
callq 0x22f0
// File: /workspace/github_cpp_makefile_star2_O1/klyushinmisha[P]GBEmu/./src/LCD.cpp
// Function: LCD::PixelColor(unsigned char, int, int, bool)
byte LCD::PixelColor(byte ID, int xOffset, int yOffset, bool bank)
{
    ushort startAddr;
    if (bank)
        startAddr = (ushort)(0x8000 + ID * 16);
    else
    {
        char* sb = (char*)&ID;
        startAddr = (ushort)(0x9000 + *sb * 16);
    }
    
    startAddr += (ushort)(yOffset * 2);

    return GetColor(startAddr, xOffset, yOffset);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testl %r8d, %r8d
je 0x530f
movzbl %sil, %eax
shll $0x4, %eax
orl $0x8000, %eax           # imm = 0x8000
jmp 0x531b
movsbl %sil, %eax
shll $0x4, %eax
addl $0x9000, %eax           # imm = 0x9000
leal (%rax,%rcx,2), %eax
movq 0x10(%rdi), %rsi
movzwl %ax, %eax
movzbl (%rsi,%rax), %edi
movb $0x7, %cl
subb %dl, %cl
movzbl %cl, %ecx
xorl %edx, %edx
btl %ecx, %edi
setb %dl
movzbl 0x1(%rsi,%rax), %eax
shrl %cl, %eax
andl $0x1, %eax
leal (%rdx,%rax,2), %eax
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/klyushinmisha[P]GBEmu/./src/Background.cpp
// Function: Background::TileFromMap(int, int)
byte Background::TileFromMap(int x, int y)
{
    ushort startAddr;
    if (gb->getBGTileMapDisplaySelect())
        startAddr = 0x9C00;
    else
        startAddr = 0x9800;
    return RAM[startAddr + y * 32 + x];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
movq 0x48(%rax), %rax
movb 0xff40(%rax), %al
andb $0x8, %al
shrb $0x3, %al
movzbl %al, %eax
shll $0xa, %eax
shll $0x5, %edx
addl %esi, %edx
addl %edx, %eax
addl $0x9800, %eax           # imm = 0x9800
cltq
movb (%rcx,%rax), %al
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/klyushinmisha[P]GBEmu/./src/Background.cpp
// Function: Background::GetPalleteColor(int)
byte Background::GetPalleteColor(int pixel)
{
    byte x = (gb->getScrollX() + pixel) % 256;
    byte y = (gb->getScrollY() + gb->getYCoordinate()) % 256;
    if (gb->getBGDisplayEnable())
        return gb->PixelColor(TileFromMap(x / 8, y / 8), x % 8, y % 8, gb->getBGWindowTileDataSelect());
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, %rax
movq (%rdi), %rdi
movq 0x48(%rdi), %rcx
movb 0xff40(%rcx), %r8b
testb $0x1, %r8b
jne 0x53bb
xorl %eax, %eax
popq %rbp
retq
movb 0xff42(%rcx), %r9b
addb 0xff44(%rcx), %r9b
addb 0xff43(%rcx), %sil
movzbl %sil, %edx
movl %edx, %esi
shrl $0x3, %esi
movzbl %r9b, %ecx
movl %r8d, %r9d
andb $0x8, %r9b
shrb $0x3, %r9b
movzbl %r9b, %r9d
shll $0xa, %r9d
orl %esi, %r9d
movq 0x8(%rax), %rax
movl %ecx, %esi
andl $-0x8, %esi
leal (%r9,%rsi,4), %esi
movzbl 0x9800(%rax,%rsi), %esi
andl $0x7, %edx
andl $0x7, %ecx
andb $0x10, %r8b
shrb $0x4, %r8b
movzbl %r8b, %r8d
popq %rbp
jmp 0x2bde