// File: /workspace/github_cpp_makefile_star2_O1/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 0x631c3
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 0x48976
movq %r12, %rdi
leaq 0x261c8(%rip), %rsi     # 0x89171
callq 0x3a800
movl $0x1, %esi
cmpq $0xa, %r15
jb 0x62ffe
movl $0x4, %esi
movq %r15, %rcx
cmpq $0x63, %rcx
jbe 0x62ff7
cmpq $0x3e7, %rcx            # imm = 0x3E7
jbe 0x62ffc
cmpq $0x2710, %rcx           # imm = 0x2710
jb 0x62ffe
movq %rcx, %rax
mulq %rbp
shrq $0xb, %rdx
addl $0x4, %esi
cmpq $0x1869f, %rcx          # imm = 0x1869F
movq %rdx, %rcx
ja 0x62fc1
addl $-0x3, %esi
jmp 0x62ffe
addl $-0x2, %esi
jmp 0x62ffe
decl %esi
movl %esi, %esi
leaq 0x30(%rsp), %rax
movq %rax, 0x20(%rsp)
leaq 0x20(%rsp), %rdi
xorl %edx, %edx
callq 0x3a510
movq 0x20(%rsp), %rdi
movl 0x28(%rsp), %esi
movq %r15, %rdx
callq 0x5d707
movq (%rsp), %rcx
movl $0xf, %esi
leaq 0x10(%rsp), %rax
cmpq %rax, %rcx
je 0x6303f
movq 0x10(%rsp), %rsi
movq 0x8(%rsp), %r8
movq 0x28(%rsp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rsi, %rax
jbe 0x6306d
movl $0xf, %esi
leaq 0x30(%rsp), %rdi
cmpq %rdi, 0x20(%rsp)
je 0x63068
movq 0x30(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x6307c
movq 0x20(%rsp), %rsi
movq %r12, %rdi
callq 0x3a130
jmp 0x6308a
leaq 0x20(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3a4d0
movq %rbx, 0x40(%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x630aa
movq %rdx, 0x40(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x50(%rsp)
jmp 0x630b0
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 0x2604e(%rip), %rsi     # 0x89127
callq 0x3a800
leaq 0x90(%rsp), %rsi
movq %rsi, 0x80(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x63112
movq %rdx, 0x80(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x90(%rsp)
jmp 0x63118
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 0x645ce
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x63168
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x3a470
movq 0x40(%rsp), %rdi
cmpq %rbx, %rdi
je 0x6317f
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x3a470
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x6319b
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3a470
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x631b6
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3a470
incq %r15
cmpq 0x10(%r14), %r15
jbe 0x62f7b
leaq 0x50(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x25fa3(%rip), %rsi     # 0x89176
leaq 0x25fa3(%rip), %rdx     # 0x8917d
leaq 0x40(%rsp), %rdi
callq 0x44728
movl 0x48(%r14), %ebx
movl $0x1, %eax
cmpl $0xa, %ebx
jb 0x63236
movl $0x4, %eax
movl $0xd1b71759, %ecx       # imm = 0xD1B71759
movl %ebx, %edx
cmpl $0x63, %edx
jbe 0x6322f
cmpl $0x3e7, %edx            # imm = 0x3E7
jbe 0x63234
cmpl $0x2710, %edx           # imm = 0x2710
jb 0x63236
movl %edx, %esi
imulq %rcx, %rsi
shrq $0x2d, %rsi
addl $0x4, %eax
cmpl $0x1869f, %edx          # imm = 0x1869F
movl %esi, %edx
ja 0x631fe
addl $-0x3, %eax
jmp 0x63236
addl $-0x2, %eax
jmp 0x63236
decl %eax
movl %eax, %esi
leaq 0x30(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x20(%rsp), %rdi
xorl %edx, %edx
callq 0x3a510
leaq 0x20(%rsp), %r15
movq (%r15), %rdi
movl 0x8(%r15), %esi
movl %ebx, %edx
callq 0x583c8
leaq 0x25eb6(%rip), %rcx     # 0x8911e
movl $0x3, %r8d
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3a4d0
leaq 0x10(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x632a0
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x632a7
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 0x632e8
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3a470
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x632ff
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3a470
leaq 0x25e78(%rip), %rsi     # 0x8917e
leaq 0x40(%rsp), %rdi
callq 0x3a800
movl 0x3c(%r14), %ebx
movl $0x1, %eax
cmpl $0xa, %ebx
jb 0x63362
movl $0x4, %eax
movl $0xd1b71759, %ecx       # imm = 0xD1B71759
movl %ebx, %edx
cmpl $0x63, %edx
jbe 0x6335b
cmpl $0x3e7, %edx            # imm = 0x3E7
jbe 0x63360
cmpl $0x2710, %edx           # imm = 0x2710
jb 0x63362
movl %edx, %esi
imulq %rcx, %rsi
shrq $0x2d, %rsi
addl $0x4, %eax
cmpl $0x1869f, %edx          # imm = 0x1869F
movl %esi, %edx
ja 0x6332a
addl $-0x3, %eax
jmp 0x63362
addl $-0x2, %eax
jmp 0x63362
decl %eax
movl %eax, %esi
leaq 0xd8(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0xc8(%rsp), %rdi
xorl %edx, %edx
callq 0x3a510
leaq 0xc8(%rsp), %r15
movq (%r15), %rdi
movl 0x8(%r15), %esi
movl %ebx, %edx
callq 0x583c8
leaq 0x25dec(%rip), %rcx     # 0x89189
movl $0x4, %r8d
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3a4d0
leaq 0xb8(%rsp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x633e2
movq %rsi, %r13
movq %rdx, 0xa8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xb8(%rsp)
jmp 0x633eb
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 0x21ce7(%rip), %rsi     # 0x850f8
callq 0x3a800
leaq 0x30(%rsp), %rsi
movq %rsi, 0x20(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x6343e
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x63444
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 0x634ae
movl $0x4, %eax
movl $0xd1b71759, %ecx       # imm = 0xD1B71759
movl %ebx, %edx
cmpl $0x63, %edx
jbe 0x634a7
cmpl $0x3e7, %edx            # imm = 0x3E7
jbe 0x634ac
cmpl $0x2710, %edx           # imm = 0x2710
jb 0x634ae
movl %edx, %esi
imulq %rcx, %rsi
shrq $0x2d, %rsi
addl $0x4, %eax
cmpl $0x1869f, %edx          # imm = 0x1869F
movl %esi, %edx
ja 0x63476
addl $-0x3, %eax
jmp 0x634ae
addl $-0x2, %eax
jmp 0x634ae
decl %eax
movq %r12, %r15
movl %eax, %esi
leaq 0x70(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x60(%rsp), %rdi
xorl %edx, %edx
callq 0x3a510
movq 0x60(%rsp), %rdi
movl 0x68(%rsp), %esi
movl %ebx, %edx
callq 0x583c8
movq 0x20(%rsp), %rcx
movq 0x28(%rsp), %r8
movq 0x68(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
leaq 0x30(%rsp), %rdi
cmpq %rdi, %rcx
je 0x63500
movq 0x30(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x6351b
movl $0xf, %esi
cmpq %r12, 0x60(%rsp)
je 0x63516
movq 0x70(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x6352c
movq 0x60(%rsp), %rsi
leaq 0x20(%rsp), %rdi
callq 0x3a130
jmp 0x6353a
leaq 0x60(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3a4d0
movq %rbp, (%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x63558
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x6355f
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
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 0x635a5
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3a470
movq 0x60(%rsp), %rdi
cmpq %r12, %rdi
je 0x635bc
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x3a470
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %r12
cmpq %r12, %rdi
je 0x635d8
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3a470
movq 0xa8(%rsp), %rdi
cmpq %r13, %rdi
je 0x635f5
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x3a470
movq 0xc8(%rsp), %rdi
cmpq %r15, %rdi
je 0x63612
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x3a470
addq $0x18, %r14
leaq 0x25b71(%rip), %rsi     # 0x8918e
leaq 0x20(%rsp), %rdi
movq %r14, %rdx
callq 0x4459c
leaq 0x25b63(%rip), %rsi     # 0x89194
leaq 0x20(%rsp), %rdi
callq 0x3a800
movq %rbp, (%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x6365c
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x63663
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 0x636a4
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3a470
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x636bb
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3a470
leaq 0x25ade(%rip), %rsi     # 0x891a0
leaq 0x40(%rsp), %rdi
callq 0x3a800
leaq 0x25ade(%rip), %rsi     # 0x891b1
leaq 0x40(%rsp), %rdi
callq 0x3a800
leaq 0x25ad6(%rip), %rsi     # 0x891ba
leaq 0x40(%rsp), %rdi
callq 0x3a800
leaq 0x217d9(%rip), %rsi     # 0x84ece
leaq 0x20(%rsp), %rdi
movq 0xa0(%rsp), %rdx
callq 0x4459c
leaq 0x217c1(%rip), %rsi     # 0x84ecf
leaq 0x20(%rsp), %rdi
callq 0x3a800
movq %rbp, (%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x63739
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x63740
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 0x63781
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3a470
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x63798
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3a470
leaq 0x25a2d(%rip), %rsi     # 0x891cc
leaq 0x20(%rsp), %rdi
leaq 0x40(%rsp), %rdx
callq 0x4459c
leaq 0x24160(%rip), %rsi     # 0x87915
leaq 0x20(%rsp), %rdi
callq 0x3a800
movq %rbp, (%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x637e0
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x637e7
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
movq 0x41779(%rip), %rdi     # 0xa4f88
callq 0x3a4f0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3a430
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3a050
movq %rax, %rdi
callq 0x3a300
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x63854
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3a470
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x6386b
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3a470
movq 0x40(%rsp), %rdi
callq 0x3a3c0
testl %eax, %eax
je 0x638bf
movq 0x41760(%rip), %rbx     # 0xa4fe0
leaq 0x25964(%rip), %rsi     # 0x891eb
movl $0x1b, %edx
movq %rbx, %rdi
callq 0x3a4f0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x3a430
movsbl %al, %esi
movq 0x4172e(%rip), %rdi     # 0xa4fe0
callq 0x3a050
movq %rax, %rdi
callq 0x3a300
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x638db
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x3a470
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x639b3
jmp 0x639fb
jmp 0x639c4
jmp 0x639b3
jmp 0x639fb
jmp 0x639c4
jmp 0x639b3
jmp 0x639fb
movq %rax, %r14
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x63933
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3a470
jmp 0x63933
movq %rax, %r14
movq 0x60(%rsp), %rdi
cmpq %r12, %rdi
je 0x6394f
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x3a470
jmp 0x6394f
movq %rax, %r14
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x63973
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3a470
jmp 0x63973
movq %r12, %r15
movq %rax, %r14
movq 0xa8(%rsp), %rdi
cmpq %r13, %rdi
je 0x63998
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x3a470
jmp 0x63998
movq %r12, %r15
movq %rax, %r14
movq 0xc8(%rsp), %rdi
cmpq %r15, %rdi
je 0x639fe
movq 0xd8(%rsp), %rsi
jmp 0x639f1
jmp 0x639fb
jmp 0x639c4
movq %rax, %r14
jmp 0x639dd
jmp 0x639fb
movq %rax, %r14
jmp 0x63a9f
jmp 0x639fb
movq %rax, %r14
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x639dd
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3a470
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x639fe
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3a470
jmp 0x639fe
movq %rax, %r14
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x63a9f
movq 0x50(%rsp), %rsi
jmp 0x63a97
jmp 0x63a1a
movq %rax, %r14
jmp 0x63a84
movq %rax, %r14
jmp 0x63a68
movq %rax, %r14
jmp 0x63a51
movq %rax, %r14
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x63a51
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x3a470
movq 0x40(%rsp), %rdi
cmpq %rbx, %rdi
je 0x63a68
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x3a470
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x63a84
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3a470
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x63a9f
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3a470
movq %r14, %rdi
callq 0x3a780
nop