// File: /workspace/github_cpp_makefile_star2_O3/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 0x2b47a
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 0xc7aa
leaq 0x18406(%rip), %rsi     # 0x374c7
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 0x1f0f1
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 0x17f7b(%rip), %rcx     # 0x3709e
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 0x17f17(%rip), %rcx     # 0x3709a
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 0x1b41c
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 0x1f1ee
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 0x182a9(%rip), %rcx     # 0x374d0
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 0x1b41c
leaq 0xa0(%rsp), %rdi
leaq 0xe8(%rsp), %r12
movq %r12, %rsi
callq 0x4380
movq (%r12), %rdi
leaq 0xf8(%rsp), %r12
cmpq %r12, %rdi
je 0x1f28a
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 0x17eb7(%rip), %rcx     # 0x3717c
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 0x1b41c
leaq 0x108(%rsp), %rdi
leaq 0x1b8(%rsp), %r14
movq %r14, %rsi
callq 0x4380
movq (%r14), %rdi
leaq 0x1c8(%rsp), %rax
cmpq %rax, %rdi
je 0x1f327
movq 0x1c8(%rsp), %rsi
incq %rsi
callq 0x42a0
cmpb $0x0, 0x14(%rsp)
jne 0x1f34b
leaq 0x18(%rsp), %rdi
movq 0x8(%rdi), %rdx
leaq 0x17d5c(%rip), %rcx     # 0x3709a
movl $0x3, %r8d
xorl %esi, %esi
callq 0x4440
movq 0x8(%rsp), %rax
leaq 0x20(%rax), %r14
leaq 0x18(%rsp), %rsi
movq %r14, %rdi
callq 0x1f6f6
leaq 0x150(%rsp), %rsi
movq %r14, %rdi
callq 0x1f6f6
leaq 0xe8(%rsp), %rsi
movq %r14, %rdi
callq 0x1f6f6
movq 0x128(%rsp), %rdi
cmpq %rbx, %rdi
je 0x1f39e
movq 0x138(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x108(%rsp), %rdi
cmpq %r13, %rdi
movq 0x8(%rsp), %rbx
je 0x1f3c0
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 0x1f3ef
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0xc0(%rsp), %rdi
leaq 0xd0(%rsp), %rax
cmpq %rax, %rdi
je 0x1f414
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0xa0(%rsp), %rdi
cmpq %rbp, %rdi
je 0x1f431
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
leaq 0x48(%rsp), %r15
je 0x1f45b
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x190(%rsp), %rdi
leaq 0x1a0(%rsp), %rax
cmpq %rax, %rdi
je 0x1f480
movq 0x1a0(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x170(%rsp), %rdi
leaq 0x180(%rsp), %rax
cmpq %rax, %rdi
je 0x1f4a5
movq 0x180(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x150(%rsp), %rdi
cmpq %r13, %rdi
je 0x1f4c2
movq 0x160(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x58(%rsp), %rdi
cmpq %r12, %rdi
je 0x1f4d9
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x38(%rsp), %rdi
cmpq %r15, %rdi
je 0x1f4f0
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x18(%rsp), %rdi
cmpq %r14, %rdi
je 0x1f507
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 0x1f552
jmp 0x1f520
movq %rax, %r14
jmp 0x1f562
jmp 0x1f527
movq %rax, %r14
jmp 0x1f56f
movq %rax, %r14
movq 0x18(%rsp), %rdi
cmpq %r13, %rdi
je 0x1f586
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x42a0
jmp 0x1f586
movq %rax, %r14
jmp 0x1f586
movq %rax, %r14
jmp 0x1f57c
movq %rax, %r14
leaq 0xe8(%rsp), %rdi
callq 0xbca2
leaq 0x80(%rsp), %rdi
callq 0xbca2
leaq 0x150(%rsp), %rdi
callq 0xbca2
leaq 0x18(%rsp), %rdi
callq 0xbca2
movq 0x8(%rsp), %rdi
callq 0x1f750
movq %r14, %rdi
callq 0x44c0