// File: /workspace/github_c_makefile_star2_O0/patriciogonzalezvivo[P]tprint/include/serial/list_ports_linux.cc
// Function: get_sysfs_info(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
vector<string>
get_sysfs_info(const string& device_path)
{
    string device_name = basename( device_path );

    string friendly_name;

    string hardware_id;

    string sys_device_path = format( "/sys/class/tty/%s/device", device_name.c_str() );

    if( device_name.compare(0,6,"ttyUSB") == 0 )
    {
        sys_device_path = dirname( dirname( realpath( sys_device_path ) ) );

        if( path_exists( sys_device_path ) )
        {
            friendly_name = usb_sysfs_friendly_name( sys_device_path );

            hardware_id = usb_sysfs_hw_string( sys_device_path );
        }
    }
    else if( device_name.compare(0,6,"ttyACM") == 0 )
    {
        sys_device_path = dirname( realpath( sys_device_path ) );

        if( path_exists( sys_device_path ) )
        {
            friendly_name = usb_sysfs_friendly_name( sys_device_path );

            hardware_id = usb_sysfs_hw_string( sys_device_path );
        }
    }
    else
    {
        // Try to read ID string of PCI device

        string sys_id_path = sys_device_path + "/id";

        if( path_exists( sys_id_path ) )
            hardware_id = read_line( sys_id_path );
    }

    if( friendly_name.empty() )
        friendly_name = device_name;

    if( hardware_id.empty() )
        hardware_id = "n/a";

    vector<string> result;
    result.push_back(friendly_name);
    result.push_back(hardware_id);

    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x270, %rsp            # imm = 0x270
movq %rdi, -0x220(%rbp)
movq %rdi, %rax
movq %rax, -0x218(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x30(%rbp), %rdi
movq %rdi, -0x210(%rbp)
callq 0xe6f0
leaq -0x50(%rbp), %rdi
callq 0xd5b0
leaq -0x70(%rbp), %rdi
callq 0xd5b0
movq -0x210(%rbp), %rdi
callq 0xd170
movq %rax, %rdx
leaq 0x1ee2e(%rip), %rsi     # 0x2d03e
xorl %eax, %eax
leaq -0x90(%rbp), %rdi
callq 0xe770
jmp 0xe220
leaq 0x1ee30(%rip), %rcx     # 0x2d057
xorl %eax, %eax
movl %eax, %esi
leaq -0x30(%rbp), %rdi
movl $0x6, %edx
callq 0xd570
movl %eax, -0x224(%rbp)
jmp 0xe241
movl -0x224(%rbp), %eax
cmpl $0x0, %eax
jne 0xe3d8
leaq -0x100(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0xea20
jmp 0xe265
leaq -0xe0(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0xe950
jmp 0xe27a
leaq -0xc0(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0xe950
jmp 0xe28f
leaq -0x90(%rbp), %rdi
movq %rdi, -0x230(%rbp)
leaq -0xc0(%rbp), %rsi
movq %rsi, -0x238(%rbp)
callq 0xd4f0
movq -0x238(%rbp), %rdi
callq 0xd240
leaq -0xe0(%rbp), %rdi
callq 0xd240
leaq -0x100(%rbp), %rdi
callq 0xd240
movq -0x230(%rbp), %rdi
callq 0xeac0
movb %al, -0x225(%rbp)
jmp 0xe2e8
movb -0x225(%rbp), %al
testb $0x1, %al
jne 0xe2f7
jmp 0xe3d3
leaq -0x120(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0xeb10
jmp 0xe30c
leaq -0x50(%rbp), %rdi
leaq -0x120(%rbp), %rsi
movq %rsi, -0x240(%rbp)
callq 0xd4f0
movq -0x240(%rbp), %rdi
callq 0xd240
leaq -0x140(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0xef00
jmp 0xe344
leaq -0x70(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0xd4f0
leaq -0x140(%rbp), %rdi
callq 0xd240
jmp 0xe3d3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0xe6bc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0xe6b0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0xe3c2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0xd240
leaq -0x100(%rbp), %rdi
callq 0xd240
jmp 0xe6b0
jmp 0xe5c1
leaq 0x1ec7f(%rip), %rcx     # 0x2d05e
xorl %eax, %eax
movl %eax, %esi
leaq -0x30(%rbp), %rdi
movl $0x6, %edx
callq 0xd570
movl %eax, -0x244(%rbp)
jmp 0xe3f9
movl -0x244(%rbp), %eax
cmpl $0x0, %eax
jne 0xe521
leaq -0x180(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0xea20
jmp 0xe41d
leaq -0x160(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0xe950
jmp 0xe432
leaq -0x90(%rbp), %rdi
movq %rdi, -0x250(%rbp)
leaq -0x160(%rbp), %rsi
movq %rsi, -0x258(%rbp)
callq 0xd4f0
movq -0x258(%rbp), %rdi
callq 0xd240
leaq -0x180(%rbp), %rdi
callq 0xd240
movq -0x250(%rbp), %rdi
callq 0xeac0
movb %al, -0x245(%rbp)
jmp 0xe47f
movb -0x245(%rbp), %al
testb $0x1, %al
jne 0xe48e
jmp 0xe51c
leaq -0x1a0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0xeb10
jmp 0xe4a3
leaq -0x50(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
movq %rsi, -0x260(%rbp)
callq 0xd4f0
movq -0x260(%rbp), %rdi
callq 0xd240
leaq -0x1c0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0xef00
jmp 0xe4db
leaq -0x70(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
callq 0xd4f0
leaq -0x1c0(%rbp), %rdi
callq 0xd240
jmp 0xe51c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x180(%rbp), %rdi
callq 0xd240
jmp 0xe6b0
jmp 0xe5bf
leaq 0x1eb3d(%rip), %rdx     # 0x2d065
leaq -0x1e0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0xf8f0
jmp 0xe53d
leaq -0x1e0(%rbp), %rdi
callq 0xeac0
movb %al, -0x261(%rbp)
jmp 0xe551
movb -0x261(%rbp), %al
testb $0x1, %al
jne 0xe55d
jmp 0xe5b3
leaq -0x200(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
callq 0xf140
jmp 0xe572
leaq -0x70(%rbp), %rdi
leaq -0x200(%rbp), %rsi
callq 0xd4f0
leaq -0x200(%rbp), %rdi
callq 0xd240
jmp 0xe5b3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x1e0(%rbp), %rdi
callq 0xd240
jmp 0xe6b0
leaq -0x1e0(%rbp), %rdi
callq 0xd240
jmp 0xe5c1
leaq -0x50(%rbp), %rdi
callq 0xd6f0
testb $0x1, %al
jne 0xe5d0
jmp 0xe5e1
leaq -0x50(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0xd050
jmp 0xe5df
jmp 0xe5e1
leaq -0x70(%rbp), %rdi
callq 0xd6f0
testb $0x1, %al
jne 0xe5f0
jmp 0xe604
leaq 0x1ea72(%rip), %rsi     # 0x2d069
leaq -0x70(%rbp), %rdi
callq 0xd590
jmp 0xe602
jmp 0xe604
movq -0x220(%rbp), %rdi
movb $0x0, -0x201(%rbp)
callq 0xf270
movq -0x220(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0xf970
jmp 0xe629
movq -0x220(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0xf970
jmp 0xe63b
movb $0x1, -0x201(%rbp)
testb $0x1, -0x201(%rbp)
jne 0xe679
jmp 0xe66d
movq -0x220(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
callq 0xf580
jmp 0xe6b0
movq -0x220(%rbp), %rdi
callq 0xf580
leaq -0x90(%rbp), %rdi
callq 0xd240
leaq -0x70(%rbp), %rdi
callq 0xd240
leaq -0x50(%rbp), %rdi
callq 0xd240
leaq -0x30(%rbp), %rdi
callq 0xd240
movq -0x218(%rbp), %rax
addq $0x270, %rsp            # imm = 0x270
popq %rbp
retq
leaq -0x90(%rbp), %rdi
callq 0xd240
leaq -0x70(%rbp), %rdi
callq 0xd240
leaq -0x50(%rbp), %rdi
callq 0xd240
leaq -0x30(%rbp), %rdi
callq 0xd240
movq -0x98(%rbp), %rdi
callq 0xd750
nopw %cs:(%rax,%rax)