// File: /workspace/github_cpp_makefile_star2_O3/Lut99[P]RayTracer/src/lib/Frames.cpp
// Function: RayTracer::Frames::to_mp4(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Frames::to_mp4(string path) {
    // If we haven't, write all images to file
    if (!this->dynamic_writing) {
        for (std::size_t i = 0; i <= this->frame_index; i++) {
            this->frames[i]->to_png(this->temp_dir + "/out" + to_string(i) + ".png");
        }
    }

    // Release ffmpeg on the files
    string command = "ffmpeg ";
    command += "-r " + to_string(this->fps);
    command += " -f image2";
    command += " -s " + to_string(this->width) + "x" + to_string(this->height);
    command += " -i \"" + this->temp_dir + "/out%d.png\"";
    command += " -vcodec libx264";
    command += " -crf 25";
    command += " -pix_fmt yuv420p";
    command += " \"" + path + "\"";

    cout << "Running ffmpeg with command: '" + command + "'" << endl;

    int res = system(command.c_str());
    if (res != 0) {
        cerr << "WARNING: ffmpeg run failed." << endl;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rsi, 0xa0(%rsp)
movq %rdi, %r14
cmpb $0x0, 0x38(%rdi)
jne 0x62c89
leaq 0x50(%rsp), %rbx
xorl %r15d, %r15d
movq %rsp, %r12
movabsq $0x346dc5d63886594b, %rbp # imm = 0x346DC5D63886594B
movq 0x8(%r14), %rax
movq (%rax,%r15,8), %r13
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq 0x18(%r14), %rsi
movq 0x20(%r14), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x48588
movq %r12, %rdi
leaq 0x25700(%rip), %rsi     # 0x88171
callq 0x3a810
movl $0x1, %esi
cmpq $0xa, %r15
jb 0x62ac6
movl $0x4, %esi
movq %r15, %rcx
cmpq $0x63, %rcx
jbe 0x62abf
cmpq $0x3e7, %rcx            # imm = 0x3E7
jbe 0x62ac4
cmpq $0x2710, %rcx           # imm = 0x2710
jb 0x62ac6
movq %rcx, %rax
mulq %rbp
shrq $0xb, %rdx
addl $0x4, %esi
cmpq $0x1869f, %rcx          # imm = 0x1869F
movq %rdx, %rcx
ja 0x62a89
addl $-0x3, %esi
jmp 0x62ac6
addl $-0x2, %esi
jmp 0x62ac6
decl %esi
movl %esi, %esi
leaq 0x30(%rsp), %rax
movq %rax, 0x20(%rsp)
leaq 0x20(%rsp), %rdi
xorl %edx, %edx
callq 0x3a520
movq 0x20(%rsp), %rdi
movl 0x28(%rsp), %esi
movq %r15, %rdx
callq 0x5d303
movq (%rsp), %rcx
movl $0xf, %edi
leaq 0x10(%rsp), %rax
cmpq %rax, %rcx
je 0x62b07
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %r8
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rdi, %rax
jbe 0x62b38
movl $0xf, %edi
leaq 0x30(%rsp), %r9
cmpq %r9, %rsi
je 0x62b33
movq 0x30(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x62b42
movq %r12, %rdi
callq 0x3a130
jmp 0x62b50
leaq 0x20(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3a4e0
movq %rbx, 0x40(%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x62b70
movq %rdx, 0x40(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x50(%rsp)
jmp 0x62b76
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x48(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x40(%rsp), %rdi
leaq 0x25588(%rip), %rsi     # 0x88127
callq 0x3a810
leaq 0x90(%rsp), %rsi
movq %rsi, 0x80(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x62bd8
movq %rdx, 0x80(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x90(%rsp)
jmp 0x62bde
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x88(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %r13, %rdi
leaq 0x80(%rsp), %rsi
callq 0x640e6
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x62c2e
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x3a480
movq 0x40(%rsp), %rdi
cmpq %rbx, %rdi
je 0x62c45
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x3a480
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x62c61
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3a480
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x62c7c
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3a480
incq %r15
cmpq 0x10(%r14), %r15
jbe 0x62a43
leaq 0x50(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x254dd(%rip), %rsi     # 0x88176
leaq 0x254dd(%rip), %rdx     # 0x8817d
leaq 0x40(%rsp), %rdi
callq 0x44390
movl 0x48(%r14), %ebx
movl $0x1, %eax
cmpl $0xa, %ebx
jb 0x62cfc
movl $0x4, %eax
movl $0xd1b71759, %ecx       # imm = 0xD1B71759
movl %ebx, %edx
cmpl $0x63, %edx
jbe 0x62cf5
cmpl $0x3e7, %edx            # imm = 0x3E7
jbe 0x62cfa
cmpl $0x2710, %edx           # imm = 0x2710
jb 0x62cfc
movl %edx, %esi
imulq %rcx, %rsi
shrq $0x2d, %rsi
addl $0x4, %eax
cmpl $0x1869f, %edx          # imm = 0x1869F
movl %esi, %edx
ja 0x62cc4
addl $-0x3, %eax
jmp 0x62cfc
addl $-0x2, %eax
jmp 0x62cfc
decl %eax
movl %eax, %esi
leaq 0x30(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x20(%rsp), %rdi
xorl %edx, %edx
callq 0x3a520
leaq 0x20(%rsp), %r15
movq (%r15), %rdi
movl 0x8(%r15), %esi
movl %ebx, %edx
callq 0x581f2
leaq 0x253f0(%rip), %rcx     # 0x8811e
movl $0x3, %r8d
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3a4e0
leaq 0x10(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x62d66
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x62d6d
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0x40(%rsp), %rdi
callq 0x3a130
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x62dae
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3a480
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x62dc5
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3a480
leaq 0x253b2(%rip), %rsi     # 0x8817e
leaq 0x40(%rsp), %rdi
callq 0x3a810
movl 0x3c(%r14), %ebx
movl $0x1, %eax
cmpl $0xa, %ebx
jb 0x62e28
movl $0x4, %eax
movl $0xd1b71759, %ecx       # imm = 0xD1B71759
movl %ebx, %edx
cmpl $0x63, %edx
jbe 0x62e21
cmpl $0x3e7, %edx            # imm = 0x3E7
jbe 0x62e26
cmpl $0x2710, %edx           # imm = 0x2710
jb 0x62e28
movl %edx, %esi
imulq %rcx, %rsi
shrq $0x2d, %rsi
addl $0x4, %eax
cmpl $0x1869f, %edx          # imm = 0x1869F
movl %esi, %edx
ja 0x62df0
addl $-0x3, %eax
jmp 0x62e28
addl $-0x2, %eax
jmp 0x62e28
decl %eax
movl %eax, %esi
leaq 0xd8(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0xc8(%rsp), %rdi
xorl %edx, %edx
callq 0x3a520
leaq 0xc8(%rsp), %r15
movq (%r15), %rdi
movl 0x8(%r15), %esi
movl %ebx, %edx
callq 0x581f2
leaq 0x25326(%rip), %rcx     # 0x88189
movl $0x4, %r8d
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3a4e0
leaq 0xb8(%rsp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x62ea8
movq %rsi, %r13
movq %rdx, 0xa8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xb8(%rsp)
jmp 0x62eb1
movups (%rcx), %xmm0
movq %rsi, %r13
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
leaq 0xa8(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x2121e(%rip), %rsi     # 0x840f5
callq 0x3a810
leaq 0x30(%rsp), %rsi
movq %rsi, 0x20(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x62f04
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x62f0a
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x28(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movl 0x40(%r14), %ebx
movl $0x1, %eax
cmpl $0xa, %ebx
jb 0x62f74
movl $0x4, %eax
movl $0xd1b71759, %ecx       # imm = 0xD1B71759
movl %ebx, %edx
cmpl $0x63, %edx
jbe 0x62f6d
cmpl $0x3e7, %edx            # imm = 0x3E7
jbe 0x62f72
cmpl $0x2710, %edx           # imm = 0x2710
jb 0x62f74
movl %edx, %esi
imulq %rcx, %rsi
shrq $0x2d, %rsi
addl $0x4, %eax
cmpl $0x1869f, %edx          # imm = 0x1869F
movl %esi, %edx
ja 0x62f3c
addl $-0x3, %eax
jmp 0x62f74
addl $-0x2, %eax
jmp 0x62f74
decl %eax
movq %r12, %r15
movl %eax, %esi
leaq 0x70(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x60(%rsp), %rdi
xorl %edx, %edx
callq 0x3a520
movq 0x60(%rsp), %rdi
movl 0x68(%rsp), %esi
movl %ebx, %edx
callq 0x581f2
movq 0x20(%rsp), %rcx
movq 0x28(%rsp), %r8
movq 0x68(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
leaq 0x30(%rsp), %rsi
cmpq %rsi, %rcx
je 0x62fc6
movq 0x30(%rsp), %rdi
movq 0x60(%rsp), %rsi
cmpq %rdi, %rax
jbe 0x62fe4
movl $0xf, %edi
cmpq %r12, %rsi
je 0x62fdf
movq 0x70(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x62ff0
leaq 0x20(%rsp), %rdi
callq 0x3a130
jmp 0x62ffe
leaq 0x60(%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 0x63021
movq %rsi, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x63027
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)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0x40(%rsp), %rdi
callq 0x3a130
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x6306d
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3a480
movq 0x60(%rsp), %rdi
cmpq %r12, %rdi
je 0x63084
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x3a480
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %r12
cmpq %r12, %rdi
je 0x630a0
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3a480
movq 0xa8(%rsp), %rdi
cmpq %r13, %rdi
je 0x630bd
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x3a480
movq 0xc8(%rsp), %rdi
cmpq %r15, %rdi
je 0x630da
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x3a480
addq $0x18, %r14
leaq 0x250a9(%rip), %rsi     # 0x8818e
leaq 0x20(%rsp), %rdi
movq %r14, %rdx
callq 0x44204
leaq 0x2509b(%rip), %rsi     # 0x88194
leaq 0x20(%rsp), %rdi
callq 0x3a810
movq %rbp, (%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x63124
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x6312b
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0x40(%rsp), %rdi
callq 0x3a130
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x6316c
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3a480
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x63183
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3a480
leaq 0x25016(%rip), %rsi     # 0x881a0
leaq 0x40(%rsp), %rdi
callq 0x3a810
leaq 0x25016(%rip), %rsi     # 0x881b1
leaq 0x40(%rsp), %rdi
callq 0x3a810
leaq 0x2500e(%rip), %rsi     # 0x881ba
leaq 0x40(%rsp), %rdi
callq 0x3a810
leaq 0x20d11(%rip), %rsi     # 0x83ece
leaq 0x20(%rsp), %rdi
movq 0xa0(%rsp), %rdx
callq 0x44204
leaq 0x20cf9(%rip), %rsi     # 0x83ecf
leaq 0x20(%rsp), %rdi
callq 0x3a810
movq %rbp, (%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x63201
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x63208
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0x40(%rsp), %rdi
callq 0x3a130
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x63249
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3a480
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x63260
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3a480
leaq 0x24f65(%rip), %rsi     # 0x881cc
leaq 0x20(%rsp), %rdi
leaq 0x40(%rsp), %rdx
callq 0x44204
leaq 0x23695(%rip), %rsi     # 0x86912
leaq 0x20(%rsp), %rdi
callq 0x3a810
movq %rbp, (%rsp)
movq (%rax), %rsi
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rsi
je 0x632a8
movq %rsi, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x632b2
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
movq %rbp, %rsi
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x40caf(%rip), %rdi     # 0xa3f80
callq 0x3a500
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3a440
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3a050
movq %rax, %rdi
callq 0x3a310
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x63316
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3a480
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x6332d
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3a480
movq 0x40(%rsp), %rdi
callq 0x3a3d0
testl %eax, %eax
je 0x63381
movq 0x40c96(%rip), %rbx     # 0xa3fd8
leaq 0x24ea2(%rip), %rsi     # 0x881eb
movl $0x1b, %edx
movq %rbx, %rdi
callq 0x3a500
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x3a440
movsbl %al, %esi
movq 0x40c64(%rip), %rdi     # 0xa3fd8
callq 0x3a050
movq %rax, %rdi
callq 0x3a310
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x6339d
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x3a480
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x63475
jmp 0x634bd
jmp 0x63486
jmp 0x63475
jmp 0x634bd
jmp 0x63486
jmp 0x63475
jmp 0x634bd
movq %rax, %r14
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x633f5
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3a480
jmp 0x633f5
movq %rax, %r14
movq 0x60(%rsp), %rdi
cmpq %r12, %rdi
je 0x63411
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x3a480
jmp 0x63411
movq %rax, %r14
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x63435
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3a480
jmp 0x63435
movq %r12, %r15
movq %rax, %r14
movq 0xa8(%rsp), %rdi
cmpq %r13, %rdi
je 0x6345a
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x3a480
jmp 0x6345a
movq %r12, %r15
movq %rax, %r14
movq 0xc8(%rsp), %rdi
cmpq %r15, %rdi
je 0x634c0
movq 0xd8(%rsp), %rsi
jmp 0x634b3
jmp 0x634bd
jmp 0x63486
movq %rax, %r14
jmp 0x6349f
jmp 0x634bd
movq %rax, %r14
jmp 0x63561
jmp 0x634bd
movq %rax, %r14
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x6349f
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3a480
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x634c0
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3a480
jmp 0x634c0
movq %rax, %r14
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x63561
movq 0x50(%rsp), %rsi
jmp 0x63559
jmp 0x634dc
movq %rax, %r14
jmp 0x63546
movq %rax, %r14
jmp 0x6352a
movq %rax, %r14
jmp 0x63513
movq %rax, %r14
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x63513
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x3a480
movq 0x40(%rsp), %rdi
cmpq %rbx, %rdi
je 0x6352a
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x3a480
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x63546
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3a480
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x63561
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3a480
movq %r14, %rdi
callq 0x3a790
nop