// File: p-ranav[P]video_device_discovery/src/main.cpp
// Function: main
int main() {
  for (auto& vd: find_video_devices()) {
    std::cout << vd.file.string() << "\n";
    std::cout << " Driver: " << vd.driver << "\n";
    std::cout << " Card: " << vd.card << "\n";
    std::cout << " Bus info: " << vd.bus_info << "\n";

    std::cout << " Pixel Format:\n";
    for (auto& fmt: vd.pixel_formats) {
      std::cout << " - " << fmt << "\n";
    }
    std::cout << " Resolutions:\n";
    for (auto& r: vd.resolutions) {
      std::cout << " - " << r.first << "x" << r.second << "\n";
    }
    std::cout << "\n\n";
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movl $0x0, -0x4(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
movq $0x0, -0x30(%rbp)
leaq -0x40(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
callq 0x7b90
movq -0xd0(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x9b40
jmp 0x7773
leaq -0x40(%rbp), %rdi
callq 0x7bb0
leaq -0x28(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x7c10
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rdi
callq 0x7c40
movq %rax, -0x60(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x7c70
testb $0x1, %al
jne 0x77d7
leaq -0x28(%rbp), %rdi
callq 0x7f30
jmp 0x7b76
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x7bb0
jmp 0x7b82
leaq -0x58(%rbp), %rdi
callq 0x7cb0
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rsi
addq $0x8, %rsi
leaq -0x88(%rbp), %rdi
callq 0x7cd0
jmp 0x77fa
movq 0x2e7b7(%rip), %rdi     # 0x35fb8
leaq -0x88(%rbp), %rsi
callq 0x5450
movq %rax, -0xd8(%rbp)
jmp 0x7816
movq -0xd8(%rbp), %rdi
leaq 0x21822(%rip), %rsi     # 0x29046
callq 0x5480
jmp 0x782b
leaq -0x88(%rbp), %rdi
callq 0x52f0
movq 0x2e77a(%rip), %rdi     # 0x35fb8
leaq 0x217bf(%rip), %rsi     # 0x29004
callq 0x5480
movq %rax, -0xe0(%rbp)
jmp 0x7853
movq -0xe0(%rbp), %rdi
movq -0x68(%rbp), %rsi
addq $0x78, %rsi
callq 0x5450
movq %rax, -0xe8(%rbp)
jmp 0x7870
movq -0xe8(%rbp), %rdi
leaq 0x217c8(%rip), %rsi     # 0x29046
callq 0x5480
jmp 0x7885
movq 0x2e72c(%rip), %rdi     # 0x35fb8
leaq 0x2177b(%rip), %rsi     # 0x2900e
callq 0x5480
movq %rax, -0xf0(%rbp)
jmp 0x78a1
movq -0xf0(%rbp), %rdi
movq -0x68(%rbp), %rsi
addq $0x98, %rsi
callq 0x5450
movq %rax, -0xf8(%rbp)
jmp 0x78c1
movq -0xf8(%rbp), %rdi
leaq 0x21777(%rip), %rsi     # 0x29046
callq 0x5480
jmp 0x78d6
movq 0x2e6db(%rip), %rdi     # 0x35fb8
leaq 0x21732(%rip), %rsi     # 0x29016
callq 0x5480
movq %rax, -0x100(%rbp)
jmp 0x78f2
movq -0x100(%rbp), %rdi
movq -0x68(%rbp), %rsi
addq $0xb8, %rsi
callq 0x5450
movq %rax, -0x108(%rbp)
jmp 0x7912
movq -0x108(%rbp), %rdi
leaq 0x21726(%rip), %rsi     # 0x29046
callq 0x5480
jmp 0x7927
movq 0x2e68a(%rip), %rdi     # 0x35fb8
leaq 0x216ed(%rip), %rsi     # 0x29022
callq 0x5480
jmp 0x793c
movq -0x68(%rbp), %rax
addq $0x48, %rax
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rdi
callq 0x7d50
movq %rax, -0x98(%rbp)
movq -0x90(%rbp), %rdi
callq 0x7d80
movq %rax, -0xa0(%rbp)
leaq -0x98(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x7db0
testb $0x1, %al
jne 0x798d
jmp 0x7a2e
leaq -0x98(%rbp), %rdi
callq 0x7df0
movq %rax, -0xa8(%rbp)
movq 0x2e611(%rip), %rdi     # 0x35fb8
leaq 0x21684(%rip), %rsi     # 0x29032
callq 0x5480
movq %rax, -0x110(%rbp)
jmp 0x79bc
movq -0x110(%rbp), %rdi
movq -0xa8(%rbp), %rsi
callq 0x5450
movq %rax, -0x118(%rbp)
jmp 0x79d8
movq -0x118(%rbp), %rdi
leaq 0x21660(%rip), %rsi     # 0x29046
callq 0x5480
jmp 0x79ed
jmp 0x79ef
leaq -0x98(%rbp), %rdi
callq 0x7e10
jmp 0x7971
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x7b6b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x52f0
jmp 0x7b6b
movq 0x2e583(%rip), %rdi     # 0x35fb8
leaq 0x215fa(%rip), %rsi     # 0x29036
callq 0x5480
jmp 0x7a43
movq -0x68(%rbp), %rax
addq $0x60, %rax
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rdi
callq 0x7e30
movq %rax, -0xb8(%rbp)
movq -0xb0(%rbp), %rdi
callq 0x7e60
movq %rax, -0xc0(%rbp)
leaq -0xb8(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x7e90
testb $0x1, %al
jne 0x7a94
jmp 0x7b46
leaq -0xb8(%rbp), %rdi
callq 0x7ed0
movq %rax, -0xc8(%rbp)
movq 0x2e50a(%rip), %rdi     # 0x35fb8
leaq 0x2157d(%rip), %rsi     # 0x29032
callq 0x5480
movq %rax, -0x120(%rbp)
jmp 0x7ac3
movq -0x120(%rbp), %rdi
movq -0xc8(%rbp), %rax
movq (%rax), %rsi
callq 0x50f0
movq %rax, -0x128(%rbp)
jmp 0x7ae2
movq -0x128(%rbp), %rdi
leaq 0x2226f(%rip), %rsi     # 0x29d5f
callq 0x5480
movq %rax, -0x130(%rbp)
jmp 0x7afe
movq -0x130(%rbp), %rdi
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x50f0
movq %rax, -0x138(%rbp)
jmp 0x7b1e
movq -0x138(%rbp), %rdi
leaq 0x2151a(%rip), %rsi     # 0x29046
callq 0x5480
jmp 0x7b33
jmp 0x7b35
leaq -0xb8(%rbp), %rdi
callq 0x7ef0
jmp 0x7a78
movq 0x2e46b(%rip), %rdi     # 0x35fb8
leaq 0x214f1(%rip), %rsi     # 0x29045
callq 0x5480
jmp 0x7b5b
jmp 0x7b5d
leaq -0x58(%rbp), %rdi
callq 0x7f10
jmp 0x779e
leaq -0x28(%rbp), %rdi
callq 0x7f30
jmp 0x7b82
movl -0x4(%rbp), %eax
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x5790
nopl (%rax,%rax)