// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/device.c
// Function: query_usb_interface_info
static void query_usb_interface_info(char *path, struct usb_interface_info *p) {
    char driver[128];
    size_t offset = strlen(path);
    int n;

    memset(p, 0, sizeof(*p));

    path[offset] = '\0';
    strcat(path, "/bNumEndpoints");
    p->bInterfaceClass = file_get_value(path, 16);

    path[offset] = '\0';
    strcat(path, "/bInterfaceClass");
    p->bInterfaceClass = file_get_value(path, 16);

    path[offset] = '\0';
    strcat(path, "/bInterfaceSubClass");
    p->bInterfaceSubClass = file_get_value(path, 16);

    path[offset] = '\0';
    strcat(path, "/bInterfaceProtocol");
    p->bInterfaceProtocol = file_get_value(path, 16);

    path[offset] = '\0';
    strcat(path, "/driver");
    n = readlink(path, driver, sizeof(driver));
    if (n > 0) {
        driver[n] = 0;
        if (debug_qmi) dbg_time("driver -> %s", driver);
        n = strlen(driver);
        while (n > 0) {
            if (driver[n] == '/')
                break;
            n--;
        }
        strncpy(p->driver, &driver[n+1], sizeof(p->driver));
    }

    path[offset] = '\0';
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x5160
movq %rax, -0x98(%rbp)
movq -0x10(%rbp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x5200
movq -0x8(%rbp), %rax
movq -0x98(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x8(%rbp), %rdi
leaq 0xece9(%rip), %rsi      # 0x300a6
callq 0x54d0
movq -0x8(%rbp), %rdi
movl $0x10, %esi
callq 0x22ee0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x8(%rbp), %rax
movq -0x98(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x8(%rbp), %rdi
leaq 0xecc2(%rip), %rsi      # 0x300b5
callq 0x54d0
movq -0x8(%rbp), %rdi
movl $0x10, %esi
callq 0x22ee0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x8(%rbp), %rax
movq -0x98(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x8(%rbp), %rdi
leaq 0xec9d(%rip), %rsi      # 0x300c6
callq 0x54d0
movq -0x8(%rbp), %rdi
movl $0x10, %esi
callq 0x22ee0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq -0x98(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x8(%rbp), %rdi
leaq 0xec7b(%rip), %rsi      # 0x300da
callq 0x54d0
movq -0x8(%rbp), %rdi
movl $0x10, %esi
callq 0x22ee0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x8(%rbp), %rax
movq -0x98(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x8(%rbp), %rdi
leaq 0xce6a(%rip), %rsi      # 0x2e2ff
callq 0x54d0
movq -0x8(%rbp), %rdi
leaq -0x90(%rbp), %rsi
movl $0x80, %edx
callq 0x50d0
movl %eax, -0x9c(%rbp)
cmpl $0x0, -0x9c(%rbp)
jle 0x215c3
movslq -0x9c(%rbp), %rax
movb $0x0, -0x90(%rbp,%rax)
leaq 0x160b4(%rip), %rax     # 0x3758c
cmpl $0x0, (%rax)
je 0x2155a
jmp 0x214df
movq 0x15afa(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0xa8(%rbp)
callq 0x13930
movq -0xa8(%rbp), %rdi
movq %rax, %rdx
leaq -0x90(%rbp), %rcx
leaq 0xebe1(%rip), %rsi      # 0x300ee
movb $0x0, %al
callq 0x52c0
leaq 0x1694d(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0x21556
leaq 0x16940(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0xb0(%rbp)
callq 0x13930
movq -0xb0(%rbp), %rdi
movq %rax, %rdx
leaq -0x90(%rbp), %rcx
leaq 0xeb9f(%rip), %rsi      # 0x300ee
movb $0x0, %al
callq 0x52c0
jmp 0x21558
jmp 0x2155a
leaq -0x90(%rbp), %rdi
callq 0x5160
movl %eax, -0x9c(%rbp)
cmpl $0x0, -0x9c(%rbp)
jle 0x2159c
movslq -0x9c(%rbp), %rax
movsbl -0x90(%rbp,%rax), %eax
cmpl $0x2f, %eax
jne 0x2158b
jmp 0x2159c
movl -0x9c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x9c(%rbp)
jmp 0x2156c
movq -0x10(%rbp), %rdi
addq $0x10, %rdi
movl -0x9c(%rbp), %eax
addl $0x1, %eax
cltq
leaq -0x90(%rbp), %rsi
addq %rax, %rsi
movl $0x20, %edx
callq 0x5080
movq -0x8(%rbp), %rax
movq -0x98(%rbp), %rcx
movb $0x0, (%rax,%rcx)
addq $0xb0, %rsp
popq %rbp
retq
nopl (%rax,%rax)