// File: /workspace/github_cpp_makefile_star2_O3/instance01[P]chromium-snss-parse/examples/parse_print_urls.cpp
// Function: main
int main(int argc, char* argv[]) {
    if (argc != 2) {
        std::cout << "Usage: " << argv[0] << " <filename>" << std::endl;
        std::cout << "For example on ArchLinux you could try and parse ";
        std::cout << "~/.config/chromium/Default/Current Session" << std::endl;
        return 0;
    }

    std::vector<std::shared_ptr<Command>> cmds = read_session_file(std::string(argv[1]));

    for (auto & x : cmds) {
        if (x->type == 6) {
            std::shared_ptr<CommandUpdateTabNavigation> c = std::static_pointer_cast<CommandUpdateTabNavigation>(x);
            std::cout << c->tabid << " " << c->index << " " << c->url << std::endl;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
cmpl $0x2, %edi
jne 0x4c30
movq 0x8(%r14), %rsi
leaq -0x68(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x4e1e
leaq -0x48(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x4756
leaq -0x58(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4b56
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x3160
movq -0x48(%rbp), %r13
movq -0x40(%rbp), %rbx
cmpq %rbx, %r13
je 0x4c6f
movq (%r13), %r14
cmpl $0x6, 0xc(%r14)
jne 0x4c27
movq 0x8(%r13), %r15
testq %r15, %r15
je 0x4b96
movq 0x5442(%rip), %rax      # 0x9fc8
cmpb $0x0, (%rax)
je 0x4b91
incl 0x8(%r15)
jmp 0x4b96
lock
incl 0x8(%r15)
movl 0x14(%r14), %esi
movq 0x542f(%rip), %rdi      # 0x9fd0
callq 0x3200
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
leaq 0x1536(%rip), %rsi      # 0x60ee
callq 0x3170
movl 0x18(%r14), %esi
movq %r12, %rdi
callq 0x3200
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
leaq 0x1513(%rip), %rsi      # 0x60ee
callq 0x3170
movq 0x20(%r14), %rsi
movq 0x28(%r14), %rdx
movq %r12, %rdi
callq 0x3170
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x3140
movsbl %al, %esi
movq %r12, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x30f0
testq %r15, %r15
je 0x4c27
movq %r15, %rdi
callq 0x4ef2
addq $0x10, %r13
jmp 0x4b5e
movq 0x5399(%rip), %rbx      # 0x9fd0
leaq 0x14f6(%rip), %rsi      # 0x6134
movl $0x7, %edx
movq %rbx, %rdi
callq 0x3170
movq (%r14), %r14
testq %r14, %r14
je 0x4c7d
movq %r14, %rdi
callq 0x30c0
movq 0x536e(%rip), %rdi      # 0x9fd0
movq %r14, %rsi
movq %rax, %rdx
callq 0x3170
jmp 0x4c94
leaq -0x48(%rbp), %rdi
callq 0x4dc2
jmp 0x4d1e
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x31f0
leaq 0x14a1(%rip), %rsi      # 0x613c
movl $0xb, %edx
movq %rbx, %rdi
callq 0x3170
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3140
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x30f0
leaq 0x1472(%rip), %rsi      # 0x6148
movl $0x31, %edx
movq %rbx, %rdi
callq 0x3170
leaq 0x1490(%rip), %rsi      # 0x617a
movl $0x2a, %edx
movq %rbx, %rdi
callq 0x3170
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3140
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x30f0
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x58(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4d6b
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x3160
jmp 0x4d6b
movq %rax, %rbx
jmp 0x4d6b
movq %rax, %rbx
testq %r15, %r15
je 0x4d62
movq %r15, %rdi
callq 0x4ef2
leaq -0x48(%rbp), %rdi
callq 0x4dc2
movq %rbx, %rdi
callq 0x3220
nop