// File: /workspace/github_cpp_makefile_star2_O1/Merulo[P]CompilerJFTT/src/IRs/FirstIR.cpp
// Function: FirstIR::createSecondControlBlock(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
Block FirstIR::createSecondControlBlock(std::string iterator, bool isForTo, std::string name)
{
    Block b = generateBlock();
    b.blockName = name + "_exitFor";    
    Line incLine;
    incLine.operation = "INC";
    incLine.one = iterator;

    Line decLine;
    decLine.operation = "DEC";
    decLine.one = iterator + forControlName;

    Line writeLine;
    writeLine.operation = "WRITE";
    writeLine.one = iterator + forControlName;    

    Line line;
    line.operation = "JZERO";
    line.one = iterator + forControlName;

    if (!isForTo)
    {
        incLine.operation = "DEC";
    }

    b.lines.push_back(incLine);
    b.lines.push_back(decLine);
    b.lines.push_back(line);    

    return b;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1d8, %rsp            # imm = 0x1D8
movq %r8, %r12
movl %ecx, %ebp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
callq 0x2b716
leaq 0x28(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
leaq 0x18(%rsp), %rdi
movq %rbx, 0x8(%rsp)
callq 0xca12
leaq 0x1913e(%rip), %rsi     # 0x384c7
leaq 0x18(%rsp), %rdi
callq 0x4510
leaq 0x18(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4380
movq (%r12), %rdi
cmpq %r13, %rdi
je 0x1f3b9
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x42a0
leaq 0x48(%rsp), %rcx
movq %r13, -0x30(%rcx)
xorl %eax, %eax
movq %rax, -0x28(%rcx)
movb %al, -0x20(%rcx)
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x68(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x18cb3(%rip), %rcx     # 0x3809e
leaq 0x18(%rsp), %rdi
movl $0x3, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x4440
leaq 0x38(%rsp), %rdi
movq %r15, %rsi
callq 0x4170
leaq 0x160(%rsp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x180(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x1a0(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x18c4f(%rip), %rcx     # 0x3809a
leaq 0x150(%rsp), %rdi
movl $0x3, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x4440
addq $0x78, %r14
leaq 0x80(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x1b6da
movl %ebp, 0x14(%rsp)
leaq 0x170(%rsp), %rdi
leaq 0x80(%rsp), %r12
movq %r12, %rsi
callq 0x4380
movq (%r12), %rdi
leaq 0x90(%rsp), %r12
cmpq %r12, %rdi
je 0x1f4b6
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x42a0
leaq 0xb0(%rsp), %rbp
movq %r12, -0x30(%rbp)
xorl %eax, %eax
movq %rax, -0x28(%rbp)
movb %al, -0x20(%rbp)
movq %rbp, -0x10(%rbp)
movq %rax, -0x8(%rbp)
movb %al, (%rbp)
leaq 0xd0(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x18fe1(%rip), %rcx     # 0x384d0
leaq 0x80(%rsp), %rdi
movl $0x5, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x4440
leaq 0xe8(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x1b6da
leaq 0xa0(%rsp), %rdi
leaq 0xe8(%rsp), %r12
movq %r12, %rsi
callq 0x4380
movq (%r12), %rdi
leaq 0xf8(%rsp), %r12
cmpq %r12, %rdi
je 0x1f552
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x42a0
leaq 0x118(%rsp), %r13
movq %r12, -0x30(%r13)
xorl %eax, %eax
movq %rax, -0x28(%r13)
movb %al, -0x20(%r13)
movq %r13, -0x10(%r13)
movq %rax, -0x8(%r13)
movb %al, (%r13)
leaq 0x138(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq %rax, -0x8(%rbx)
movb %al, (%rbx)
leaq 0x18bef(%rip), %rcx     # 0x3817c
leaq 0xe8(%rsp), %rdi
movl $0x5, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x4440
leaq 0x1b8(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x1b6da
leaq 0x108(%rsp), %rdi
leaq 0x1b8(%rsp), %r14
movq %r14, %rsi
callq 0x4380
movq (%r14), %rdi
leaq 0x1c8(%rsp), %rax
cmpq %rax, %rdi
je 0x1f5ef
movq 0x1c8(%rsp), %rsi
incq %rsi
callq 0x42a0
cmpb $0x0, 0x14(%rsp)
jne 0x1f613
leaq 0x18(%rsp), %rdi
movq 0x8(%rdi), %rdx
leaq 0x18a94(%rip), %rcx     # 0x3809a
movl $0x3, %r8d
xorl %esi, %esi
callq 0x4440
movq 0x8(%rsp), %rax
leaq 0x20(%rax), %r14
leaq 0x18(%rsp), %rsi
movq %r14, %rdi
callq 0x1f9be
leaq 0x150(%rsp), %rsi
movq %r14, %rdi
callq 0x1f9be
leaq 0xe8(%rsp), %rsi
movq %r14, %rdi
callq 0x1f9be
movq 0x128(%rsp), %rdi
cmpq %rbx, %rdi
je 0x1f666
movq 0x138(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x108(%rsp), %rdi
cmpq %r13, %rdi
movq 0x8(%rsp), %rbx
je 0x1f688
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0xe8(%rsp), %rdi
cmpq %r12, %rdi
leaq 0x28(%rsp), %r14
leaq 0x68(%rsp), %r12
leaq 0x160(%rsp), %r13
je 0x1f6b7
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0xc0(%rsp), %rdi
leaq 0xd0(%rsp), %rax
cmpq %rax, %rdi
je 0x1f6dc
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0xa0(%rsp), %rdi
cmpq %rbp, %rdi
je 0x1f6f9
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
leaq 0x48(%rsp), %r15
je 0x1f723
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x190(%rsp), %rdi
leaq 0x1a0(%rsp), %rax
cmpq %rax, %rdi
je 0x1f748
movq 0x1a0(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x170(%rsp), %rdi
leaq 0x180(%rsp), %rax
cmpq %rax, %rdi
je 0x1f76d
movq 0x180(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x150(%rsp), %rdi
cmpq %r13, %rdi
je 0x1f78a
movq 0x160(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x58(%rsp), %rdi
cmpq %r12, %rdi
je 0x1f7a1
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x38(%rsp), %rdi
cmpq %r15, %rdi
je 0x1f7b8
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x18(%rsp), %rdi
cmpq %r14, %rdi
je 0x1f7cf
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x42a0
movq %rbx, %rax
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1f81a
jmp 0x1f7e8
movq %rax, %r14
jmp 0x1f82a
jmp 0x1f7ef
movq %rax, %r14
jmp 0x1f837
movq %rax, %r14
movq 0x18(%rsp), %rdi
cmpq %r13, %rdi
je 0x1f84e
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x42a0
jmp 0x1f84e
movq %rax, %r14
jmp 0x1f84e
movq %rax, %r14
jmp 0x1f844
movq %rax, %r14
leaq 0xe8(%rsp), %rdi
callq 0xbf10
leaq 0x80(%rsp), %rdi
callq 0xbf10
leaq 0x150(%rsp), %rdi
callq 0xbf10
leaq 0x18(%rsp), %rdi
callq 0xbf10
movq 0x8(%rsp), %rdi
callq 0x1fa18
movq %r14, %rdi
callq 0x44c0