// File: /workspace/github_cpp_makefile_star2_O3/Lut99[P]RayTracer/src/lib/Frames.cpp
// Function: RayTracer::Frames::next()
void Frames::next() {
    // Do nothing if we're already at the last frame
    if (this->frame_index == this->n_frames) {
        return;
    }

    // Depending on whether we should keep everything in memory, write current image to disk and delete it
    if (this->dynamic_writing) {
        this->current_frame->to_png(this->temp_dir + "/out" + to_string(this->frame_index) + ".png");

        delete this->current_frame;
    }

    // Create a new frame
    this->frame_index++;
    this->current_frame = new Image(this->width, this->height);

    // If we should keep everything in memory, update the frames list
    if (!this->dynamic_writing) {
        this->frames[this->frame_index] = this->current_frame;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x80, %rsp
movq 0x10(%rdi), %rax
movl 0x44(%rdi), %ecx
cmpq %rcx, %rax
je 0x62962
movq %rdi, %rbx
cmpb $0x1, 0x38(%rdi)
jne 0x6292b
movq (%rbx), %r14
leaq 0x50(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x18(%rbx), %rsi
movq 0x20(%rbx), %rdx
addq %rsi, %rdx
leaq 0x40(%rsp), %r15
movq %r15, %rdi
callq 0x48588
leaq 0x25a56(%rip), %rsi     # 0x88171
movq %r15, %rdi
callq 0x3a810
movq 0x10(%rbx), %r15
movl $0x1, %esi
cmpq $0xa, %r15
jb 0x62781
movl $0x4, %esi
movabsq $0x346dc5d63886594b, %rdi # imm = 0x346DC5D63886594B
movq %r15, %rcx
cmpq $0x63, %rcx
jbe 0x6277a
cmpq $0x3e7, %rcx            # imm = 0x3E7
jbe 0x6277f
cmpq $0x2710, %rcx           # imm = 0x2710
jb 0x62781
movq %rcx, %rax
mulq %rdi
shrq $0xb, %rdx
addl $0x4, %esi
cmpq $0x1869f, %rcx          # imm = 0x1869F
movq %rdx, %rcx
ja 0x62744
addl $-0x3, %esi
jmp 0x62781
addl $-0x2, %esi
jmp 0x62781
decl %esi
movl %esi, %esi
leaq 0x30(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x20(%rsp), %rdi
xorl %edx, %edx
callq 0x3a520
movq 0x20(%rsp), %rdi
movl 0x28(%rsp), %esi
movq %r15, %rdx
callq 0x5d303
movq 0x40(%rsp), %rcx
movq 0x48(%rsp), %r8
movq 0x28(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
cmpq %r12, %rcx
je 0x627cb
movq 0x50(%rsp), %rdi
movq 0x20(%rsp), %rsi
cmpq %rdi, %rax
jbe 0x627e9
movl $0xf, %edi
cmpq %r13, %rsi
je 0x627e4
movq 0x30(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x627f5
leaq 0x40(%rsp), %rdi
callq 0x3a130
jmp 0x62803
leaq 0x20(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3a4e0
leaq 0x10(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0x62826
movq %rsi, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x6282c
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x8(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x258d7(%rip), %rsi     # 0x88127
movq %rsp, %rdi
callq 0x3a810
leaq 0x70(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x6287f
movq %rdx, 0x60(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x70(%rsp)
jmp 0x62886
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq 0x60(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %r14, %rdi
callq 0x640e6
movq 0x60(%rsp), %rdi
cmpq %r15, %rdi
je 0x628c1
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x3a480
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x628dc
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3a480
movq 0x20(%rsp), %rdi
cmpq %r13, %rdi
je 0x628f3
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3a480
movq 0x40(%rsp), %rdi
cmpq %r12, %rdi
je 0x6290a
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x3a480
movq (%rbx), %r14
testq %r14, %r14
je 0x6291a
movq %r14, %rdi
callq 0x639f4
movl $0x10, %esi
movq %r14, %rdi
callq 0x3a480
movq 0x10(%rbx), %rax
incq %rax
movq %rax, 0x10(%rbx)
movl $0x10, %edi
callq 0x3a470
movq %rax, %r14
movl 0x3c(%rbx), %esi
movl 0x40(%rbx), %edx
movq %rax, %rdi
callq 0x63920
movq %r14, (%rbx)
cmpb $0x0, 0x38(%rbx)
jne 0x62962
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rcx
movq %r14, (%rax,%rcx,8)
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x60(%rsp), %rdi
cmpq %r15, %rdi
je 0x62992
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x3a480
jmp 0x62992
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x629b2
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3a480
jmp 0x629b2
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r13, %rdi
je 0x629d0
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3a480
jmp 0x629d0
jmp 0x629cd
movq %rax, %rbx
movq 0x40(%rsp), %rdi
cmpq %r12, %rdi
je 0x629f4
movq 0x50(%rsp), %rsi
incq %rsi
jmp 0x629ef
movq %rax, %rbx
movl $0x10, %esi
movq %r14, %rdi
callq 0x3a480
movq %rbx, %rdi
callq 0x3a790