// File: /workspace/github_cpp_makefile_star2_O3/drummyfish[P]flowchart/src/program.cpp
// Function: program::load_from_file(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool program::load_from_file(string filename)
  {
    if (!this->font_mask.load_file(FONT_PATH))
      return false;

    image source_image;
    bool error;

    if (!source_image.load_file(filename))
      return false;

    // cout << "=" << this->string_from_image_area(&source_image,make_coord(0,0),make_coord(100,100),error) << "=" << endl;

    vector<block_function> v = this->get_function_blocks(&source_image);

    unsigned int i;

    cout << "functions:" << endl;

    for (i = 0; i < v.size(); i++)
      {
        cout << v[i].get_string() << ": " << endl;
        print_coord(v[i].get_top_left());
        print_coord(v[i].get_bottom_right());
      }

    cout << "directives:" << endl;
    vector<block_directive> v2 = this->get_directive_blocks(&source_image);

    for (i = 0; i < v2.size(); i++)
      {
        cout << v2[i].get_string() << ": " << endl;
        print_coord(v2[i].get_top_left());
        print_coord(v2[i].get_bottom_right());
      }

    cout << "commands:" << endl;
    vector<block_command> v3 = this->get_command_blocks(&source_image);

    for (i = 0; i < v3.size(); i++)
      {
        cout << v3[i].get_string() << ": " << endl;
        print_coord(v3[i].get_top_left());
        print_coord(v3[i].get_bottom_right());
      }

    return true;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rsi, %rbx
movq %rdi, %r12
leaq 0xb8(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x4876(%rip), %rsi      # 0x135b4
leaq 0x4877(%rip), %rdx      # 0x135bc
leaq 0xa8(%rsp), %r15
movq %r15, %rdi
callq 0xe0ea
movq %r12, %rdi
movq %r15, %rsi
callq 0xe392
movl %eax, %ebp
movq 0xa8(%rsp), %rdi
cmpq %r14, %rdi
je 0xed7f
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x21c0
testb %bpl, %bpl
je 0xf228
leaq 0x8(%rsp), %rdi
callq 0xe180
leaq 0x98(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq 0x88(%rsp), %rdi
callq 0xec7c
leaq 0x8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0xe392
movl %eax, %ebx
movq 0x88(%rsp), %rdi
cmpq %r14, %rdi
je 0xede6
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x21c0
testb %bl, %bl
je 0xf21c
leaq 0x70(%rsp), %rdi
leaq 0x8(%rsp), %rdx
movq %r12, %rsi
callq 0x10564
movq %r12, 0x38(%rsp)
movl %ebx, 0x34(%rsp)
movq 0x91c8(%rip), %rbx      # 0x17fd8
leaq 0x47a6(%rip), %rsi      # 0x135bd
movl $0xa, %edx
movq %rbx, %rdi
callq 0x21f0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq 0x9196(%rip), %rdi      # 0x17fd8
callq 0x2050
movq %rax, %rdi
callq 0x2120
movq 0x70(%rsp), %rsi
cmpq %rsi, 0x78(%rsp)
je 0xef4d
movl $0x1, %r14d
xorl %eax, %eax
leaq 0x10(%rsp), %r15
movq 0x9165(%rip), %r12      # 0x17fd8
leaq 0x474e(%rip), %r13      # 0x135c8
leaq (%rax,%rax,2), %rbp
shlq $0x4, %rbp
addq %rbp, %rsi
movq %r15, %rdi
callq 0x119b2
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %r12, %rdi
callq 0x21f0
movq %rax, %rbx
movl $0x2, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x21f0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2050
movq %rax, %rdi
callq 0x2120
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xeef5
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21c0
movq 0x70(%rsp), %rdi
addq %rbp, %rdi
callq 0x119d4
movq %rax, %rdi
callq 0x11545
addq 0x70(%rsp), %rbp
movq %rbp, %rdi
callq 0x119da
movq %rax, %rdi
callq 0x11545
movl %r14d, %eax
movq 0x70(%rsp), %rsi
movq 0x78(%rsp), %rcx
subq %rsi, %rcx
sarq $0x4, %rcx
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rdx, %rcx
incl %r14d
cmpq %rax, %rcx
ja 0xee7a
movq 0x9084(%rip), %rbx      # 0x17fd8
leaq 0x4670(%rip), %rsi      # 0x135cb
movl $0xb, %edx
movq %rbx, %rdi
callq 0x21f0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq 0x9052(%rip), %rdi      # 0x17fd8
callq 0x2050
movq %rax, %rdi
callq 0x2120
leaq 0x58(%rsp), %rdi
leaq 0x8(%rsp), %rdx
movq 0x38(%rsp), %rsi
callq 0xfec2
movq 0x58(%rsp), %rsi
cmpq %rsi, 0x60(%rsp)
je 0xf0a5
movl $0x1, %r14d
xorl %eax, %eax
leaq 0x10(%rsp), %r15
movq 0x900d(%rip), %r12      # 0x17fd8
leaq 0x45f6(%rip), %r13      # 0x135c8
leaq (%rax,%rax,2), %rbp
shlq $0x4, %rbp
addq %rbp, %rsi
movq %r15, %rdi
callq 0x119b2
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %r12, %rdi
callq 0x21f0
movq %rax, %rbx
movl $0x2, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x21f0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2050
movq %rax, %rdi
callq 0x2120
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xf04d
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21c0
movq 0x58(%rsp), %rdi
addq %rbp, %rdi
callq 0x119d4
movq %rax, %rdi
callq 0x11545
addq 0x58(%rsp), %rbp
movq %rbp, %rdi
callq 0x119da
movq %rax, %rdi
callq 0x11545
movl %r14d, %eax
movq 0x58(%rsp), %rsi
movq 0x60(%rsp), %rcx
subq %rsi, %rcx
sarq $0x4, %rcx
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rdx, %rcx
incl %r14d
cmpq %rax, %rcx
ja 0xefd2
movq 0x8f2c(%rip), %rbx      # 0x17fd8
leaq 0x4524(%rip), %rsi      # 0x135d7
movl $0x9, %edx
movq %rbx, %rdi
callq 0x21f0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq 0x8efa(%rip), %rdi      # 0x17fd8
callq 0x2050
movq %rax, %rdi
callq 0x2120
leaq 0x40(%rsp), %rdi
leaq 0x8(%rsp), %rdx
movq 0x38(%rsp), %rsi
callq 0xf362
movq 0x40(%rsp), %rsi
cmpq %rsi, 0x48(%rsp)
je 0xf1fa
movl $0x1, %ebp
xorl %eax, %eax
leaq 0x10(%rsp), %r14
movq 0x8eb6(%rip), %r15      # 0x17fd8
leaq 0x449f(%rip), %r12      # 0x135c8
leaq (%rax,%rax,2), %r13
shlq $0x4, %r13
addq %r13, %rsi
movq %r14, %rdi
callq 0x119b2
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %r15, %rdi
callq 0x21f0
movq %rax, %rbx
movl $0x2, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x21f0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2050
movq %rax, %rdi
callq 0x2120
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xf1a4
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21c0
movq 0x40(%rsp), %rdi
addq %r13, %rdi
callq 0x119d4
movq %rax, %rdi
callq 0x11545
addq 0x40(%rsp), %r13
movq %r13, %rdi
callq 0x119da
movq %rax, %rdi
callq 0x11545
movl %ebp, %eax
movq 0x40(%rsp), %rsi
movq 0x48(%rsp), %rcx
subq %rsi, %rcx
sarq $0x4, %rcx
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rdx, %rcx
incl %ebp
cmpq %rax, %rcx
ja 0xf129
leaq 0x40(%rsp), %rdi
callq 0xfd52
leaq 0x58(%rsp), %rdi
callq 0xfdb0
leaq 0x70(%rsp), %rdi
callq 0xfe0e
movl 0x34(%rsp), %ebx
leaq 0x8(%rsp), %rdi
callq 0xe188
jmp 0xf22a
xorl %ebx, %ebx
movl %ebx, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xf2aa
jmp 0xf2af
jmp 0xf26d
movq %rax, %rbx
movq 0x88(%rsp), %rdi
cmpq %r14, %rdi
je 0xf312
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x21c0
jmp 0xf312
movq %rax, %rbx
jmp 0xf312
jmp 0xf2aa
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
cmpq %r14, %rdi
je 0xf31c
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x21c0
jmp 0xf31c
jmp 0xf2af
jmp 0xf2a5
jmp 0xf2aa
jmp 0xf2af
movq %rax, %rbx
jmp 0xf2d3
movq %rax, %rbx
jmp 0xf2fe
movq %rax, %rbx
jmp 0xf308
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xf2d3
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21c0
leaq 0x40(%rsp), %rdi
callq 0xfd52
jmp 0xf2fe
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xf2fe
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21c0
leaq 0x58(%rsp), %rdi
callq 0xfdb0
leaq 0x70(%rsp), %rdi
callq 0xfe0e
leaq 0x8(%rsp), %rdi
callq 0xe188
movq %rbx, %rdi
callq 0x2340
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xf308
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21c0
jmp 0xf308
nop