// File: /workspace/github_c_makefile_star2_O0/yahya-tamur[P]Visualising-Complex-Functions/testImage.cc
// Function: main
int main() {
    auto before_frames = std::chrono::high_resolution_clock::now();
    auto frames = getFrames(function);
    auto after_frames = std::chrono::high_resolution_clock::now();

    ge_GIF *gif = ge_new_gif(file_name, width, height, colors,

        palette_bit_depth,
        0 // for infinite loop
    );

    std::cout << "writing..." << std::endl;
    auto before_fwrite = std::chrono::high_resolution_clock::now();
    for (int i = 0; i < num_frames; i++) {
        for (int j = 0; j < width * height; j++)
            gif->frame[j] = (*frames)[i][j];
        ge_add_frame(gif, delay);
        std::cout << i << " / num frames = " << num_frames << std::endl;
    }
    auto after_fwrite = std::chrono::high_resolution_clock::now();
    ge_close_gif(gif);

    auto frame_duration
        = std::chrono::duration_cast<std::chrono::microseconds>(after_frames - before_frames);
    auto fwrite_duration
        = std::chrono::duration_cast<std::chrono::microseconds>(after_fwrite - before_fwrite);

    FILE *p_file = NULL;
    p_file = fopen(file_name, "rb");
    fseek(p_file, 0, SEEK_END);
    int size = ftell(p_file);
    fclose(p_file);
    double file_size = size / 1000000.0;
    std::cout << "function duration (s) :      " << frame_duration.count() / 1000000.0 << std::endl;
    std::cout << "file write duration (s) : " << fwrite_duration.count() / 1000000.0 << std::endl;
    std::cout << "file size (mb) :          " << file_size << std::endl;
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movl $0x0, -0x4(%rbp)
callq 0x2040
movq %rax, -0x10(%rbp)
leaq 0x27ee(%rip), %rsi      # 0x5b60
leaq -0x38(%rbp), %rdi
movq %rdi, -0xb0(%rbp)
callq 0x3bd0
movq -0xb0(%rbp), %rsi
leaq -0x18(%rbp), %rdi
callq 0x2db0
jmp 0x3394
leaq -0x38(%rbp), %rdi
callq 0x3c60
callq 0x2040
movq %rax, -0x50(%rbp)
leaq 0x6dd7(%rip), %rax      # 0xa184
movzwl (%rax), %esi
leaq 0x6dd1(%rip), %rax      # 0xa188
movzwl (%rax), %edx
leaq 0x6e0f(%rip), %rax      # 0xa1d0
movl (%rax), %r8d
leaq 0x6d85(%rip), %rdi      # 0xa150
leaq 0x6e02(%rip), %rcx      # 0xa1d4
xorl %r9d, %r9d
callq 0x2390
movq %rax, -0xb8(%rbp)
jmp 0x33e3
movq -0xb8(%rbp), %rax
movq %rax, -0x58(%rbp)
movq 0x6be3(%rip), %rdi      # 0x9fd8
leaq 0x2c58(%rip), %rsi      # 0x6054
callq 0x2130
movq %rax, -0xc0(%rbp)
jmp 0x340a
movq -0xc0(%rbp), %rdi
movq 0x6bb0(%rip), %rsi      # 0x9fc8
callq 0x2170
jmp 0x341f
callq 0x2040
movq %rax, -0x60(%rbp)
movl $0x0, -0x64(%rbp)
movl -0x64(%rbp), %eax
leaq 0x6d1f(%rip), %rcx      # 0xa158
cmpl (%rcx), %eax
jge 0x356c
movl $0x0, -0x68(%rbp)
movl -0x68(%rbp), %eax
leaq 0x6d32(%rip), %rcx      # 0xa184
movl (%rcx), %ecx
leaq 0x6d2d(%rip), %rdx      # 0xa188
imull (%rdx), %ecx
cmpl %ecx, %eax
jge 0x34e0
leaq -0x18(%rbp), %rdi
callq 0x3ad0
movq %rax, -0xc8(%rbp)
jmp 0x3474
movq -0xc8(%rbp), %rdi
movslq -0x64(%rbp), %rsi
callq 0x3b00
movq %rax, %rdi
movslq -0x68(%rbp), %rsi
callq 0x3b20
movb (%rax), %dl
movq -0x58(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x68(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
jmp 0x3448
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x3c60
jmp 0x37ea
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x3b70
jmp 0x37ea
movq -0x58(%rbp), %rdi
leaq 0x6c79(%rip), %rax      # 0xa164
movzwl (%rax), %esi
callq 0x2640
jmp 0x34f5
movl -0x64(%rbp), %esi
movq 0x6ad9(%rip), %rdi      # 0x9fd8
callq 0x2210
movq %rax, -0xd0(%rbp)
jmp 0x350d
movq -0xd0(%rbp), %rdi
leaq 0x2b44(%rip), %rsi      # 0x605f
callq 0x2130
movq %rax, -0xd8(%rbp)
jmp 0x3529
movq -0xd8(%rbp), %rdi
leaq 0x6c21(%rip), %rax      # 0xa158
movl (%rax), %esi
callq 0x2210
movq %rax, -0xe0(%rbp)
jmp 0x3547
movq -0xe0(%rbp), %rdi
movq 0x6a73(%rip), %rsi      # 0x9fc8
callq 0x2170
jmp 0x355c
jmp 0x355e
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x342f
callq 0x2040
movq %rax, -0x70(%rbp)
movq -0x58(%rbp), %rdi
callq 0x2a70
jmp 0x3580
leaq -0x50(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x3cb0
movq %rax, -0xe8(%rbp)
jmp 0x3596
movq -0xe8(%rbp), %rax
movq %rax, -0x80(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x3c80
movq %rax, -0xf0(%rbp)
jmp 0x35b3
movq -0xf0(%rbp), %rax
movq %rax, -0x78(%rbp)
leaq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x3cb0
movq %rax, -0xf8(%rbp)
jmp 0x35d4
movq -0xf8(%rbp), %rax
movq %rax, -0x90(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x3c80
movq %rax, -0x100(%rbp)
jmp 0x35f7
movq -0x100(%rbp), %rax
movq %rax, -0x88(%rbp)
movq $0x0, -0x98(%rbp)
leaq 0x6b39(%rip), %rdi      # 0xa150
leaq 0x2a52(%rip), %rsi      # 0x6070
callq 0x2190
movq %rax, -0x108(%rbp)
jmp 0x362c
movq -0x108(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x2, %edx
callq 0x2180
jmp 0x3651
movq -0x98(%rbp), %rdi
callq 0x2030
movq %rax, -0x110(%rbp)
jmp 0x3666
movq -0x110(%rbp), %rax
movl %eax, -0x9c(%rbp)
movq -0x98(%rbp), %rdi
callq 0x2140
jmp 0x3681
cvtsi2sdl -0x9c(%rbp), %xmm0
movsd 0x299f(%rip), %xmm1     # 0x6030
divsd %xmm1, %xmm0
movsd %xmm0, -0xa8(%rbp)
movq 0x6934(%rip), %rdi      # 0x9fd8
leaq 0x29c8(%rip), %rsi      # 0x6073
callq 0x2130
movq %rax, -0x118(%rbp)
jmp 0x36b9
leaq -0x78(%rbp), %rdi
callq 0x3d00
movq %rax, -0x120(%rbp)
jmp 0x36cb
movq -0x118(%rbp), %rdi
movq -0x120(%rbp), %rax
cvtsi2sd %rax, %xmm0
movsd 0x294a(%rip), %xmm1     # 0x6030
divsd %xmm1, %xmm0
callq 0x2230
movq %rax, -0x128(%rbp)
jmp 0x36f8
movq -0x128(%rbp), %rdi
movq 0x68c2(%rip), %rsi      # 0x9fc8
callq 0x2170
jmp 0x370d
movq 0x68c4(%rip), %rdi      # 0x9fd8
leaq 0x2976(%rip), %rsi      # 0x6091
callq 0x2130
movq %rax, -0x130(%rbp)
jmp 0x3729
leaq -0x88(%rbp), %rdi
callq 0x3d00
movq %rax, -0x138(%rbp)
jmp 0x373e
movq -0x130(%rbp), %rdi
movq -0x138(%rbp), %rax
cvtsi2sd %rax, %xmm0
movsd 0x28d7(%rip), %xmm1     # 0x6030
divsd %xmm1, %xmm0
callq 0x2230
movq %rax, -0x140(%rbp)
jmp 0x376b
movq -0x140(%rbp), %rdi
movq 0x684f(%rip), %rsi      # 0x9fc8
callq 0x2170
jmp 0x3780
movq 0x6851(%rip), %rdi      # 0x9fd8
leaq 0x291e(%rip), %rsi      # 0x60ac
callq 0x2130
movq %rax, -0x148(%rbp)
jmp 0x379c
movq -0x148(%rbp), %rdi
movsd -0xa8(%rbp), %xmm0
callq 0x2230
movq %rax, -0x150(%rbp)
jmp 0x37b9
movq -0x150(%rbp), %rdi
movq 0x6801(%rip), %rsi      # 0x9fc8
callq 0x2170
jmp 0x37ce
movl $0x0, -0x4(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x3b70
movl -0x4(%rbp), %eax
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x2220
nopw %cs:(%rax,%rax)
nopl (%rax)