#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ add_usb_bus(char const *);
int /*<<< orphan*/ add_usb_device(char const *);
int /*<<< orphan*/ add_usb_interface(char const *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
scalar_t__ isdigit(char const);
int /*<<< orphan*/ stderr;
scalar_t__ strchr(char const *, char);
void inspect_bus_entry(const char *d_name) {
  if (d_name[0] == '.' && (!d_name[1] || (d_name[1] == '.' && !d_name[2])))
    return;
  if (d_name[0] == 'u' && d_name[1] == 's' && d_name[2] == 'b' &&
      isdigit(d_name[3])) {
    add_usb_bus(d_name);
  } else if (isdigit(d_name[0])) {
    if (strchr(d_name, ':'))
      add_usb_interface(d_name);
    else
      add_usb_device(d_name);
  } else
    fprintf(stderr, "ignoring '%s'\n", d_name);
}


x86 assembly (clang, -O0):
<inspect_bus_entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    11ae <inspect_bus_entry+0x4e>
mov    -0x8(%rbp),%rax
cmpb   $0x0,0x1(%rax)
je     11a9 <inspect_bus_entry+0x49>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x2e,%eax
jne    11ae <inspect_bus_entry+0x4e>
mov    -0x8(%rbp),%rax
cmpb   $0x0,0x2(%rax)
jne    11ae <inspect_bus_entry+0x4e>
jmp    126d <inspect_bus_entry+0x10d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x75,%eax
jne    1205 <inspect_bus_entry+0xa5>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x73,%eax
jne    1205 <inspect_bus_entry+0xa5>
mov    -0x8(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x62,%eax
jne    1205 <inspect_bus_entry+0xa5>
mov    -0x8(%rbp),%rax
movsbl 0x3(%rax),%edi
call   1040 <isdigit@plt>
cmp    $0x0,%rax
je     1205 <inspect_bus_entry+0xa5>
mov    -0x8(%rbp),%rdi
call   1080 <add_usb_bus@plt>
jmp    126d <inspect_bus_entry+0x10d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isdigit@plt>
cmp    $0x0,%rax
je     124f <inspect_bus_entry+0xef>
mov    -0x8(%rbp),%rdi
mov    $0x3a,%esi
call   1050 <strchr@plt>
cmp    $0x0,%rax
je     1241 <inspect_bus_entry+0xe1>
mov    -0x8(%rbp),%rdi
call   1030 <add_usb_interface@plt>
jmp    124a <inspect_bus_entry+0xea>
mov    -0x8(%rbp),%rdi
call   1060 <add_usb_device@plt>
jmp    1268 <inspect_bus_entry+0x108>
mov    0x2d8a(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xd9d(%rip),%rsi
call   1070 <fprintf@plt>
jmp    126d <inspect_bus_entry+0x10d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inspect_bus_entry>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
cmp    $0x75,%al
je     1184 <inspect_bus_entry+0x24>
cmp    $0x2e,%al
jne    11ab <inspect_bus_entry+0x4b>
mov    0x1(%rbx),%cl
test   %cl,%cl
je     1182 <inspect_bus_entry+0x22>
mov    $0x2e,%al
cmp    $0x2e,%cl
jne    11ab <inspect_bus_entry+0x4b>
cmpb   $0x0,0x2(%rbx)
jne    11ab <inspect_bus_entry+0x4b>
pop    %rbx
ret
mov    $0x75,%al
cmpb   $0x73,0x1(%rbx)
jne    11ab <inspect_bus_entry+0x4b>
cmpb   $0x62,0x2(%rbx)
jne    11ab <inspect_bus_entry+0x4b>
movsbl 0x3(%rbx),%edi
call   1040 <isdigit@plt>
test   %rax,%rax
je     11a9 <inspect_bus_entry+0x49>
mov    %rbx,%rdi
pop    %rbx
jmp    1080 <add_usb_bus@plt>
mov    (%rbx),%al
movsbl %al,%edi
call   1040 <isdigit@plt>
test   %rax,%rax
je     11d3 <inspect_bus_entry+0x73>
mov    %rbx,%rdi
mov    $0x3a,%esi
call   1050 <strchr@plt>
mov    %rbx,%rdi
test   %rax,%rax
je     11ec <inspect_bus_entry+0x8c>
pop    %rbx
jmp    1030 <add_usb_interface@plt>
mov    0x2e06(%rip),%rax
mov    (%rax),%edi
lea    0xe1d(%rip),%rsi
mov    %rbx,%rdx
pop    %rbx
jmp    1070 <fprintf@plt>
pop    %rbx
jmp    1060 <add_usb_device@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"ignoring '%s'\0A\00"
define void @inspect_bus_entry(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 46
br i1 %7, label %8, label %25
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = icmp ne i8 %11, 0
br i1 %12, label %13, label %24
13: ; preds = %8
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 46
br i1 %18, label %19, label %25
19: ; preds = %13
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 2
%22 = load i8, i8* %21
%23 = icmp ne i8 %22, 0
br i1 %23, label %25, label %24
24: ; preds = %19, %8
br label %74
25: ; preds = %19, %13, %1
%26 = load i8*, i8** %2
%27 = getelementptr inbounds i8, i8* %26, i64 0
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 117
br i1 %30, label %31, label %52
31: ; preds = %25
%32 = load i8*, i8** %2
%33 = getelementptr inbounds i8, i8* %32, i64 1
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = icmp eq i32 %35, 115
br i1 %36, label %37, label %52
37: ; preds = %31
%38 = load i8*, i8** %2
%39 = getelementptr inbounds i8, i8* %38, i64 2
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = icmp eq i32 %41, 98
br i1 %42, label %43, label %52
43: ; preds = %37
%44 = load i8*, i8** %2
%45 = getelementptr inbounds i8, i8* %44, i64 3
%46 = load i8, i8* %45
%47 = call i64 @isdigit(i8 signext %46)
%48 = icmp ne i64 %47, 0
br i1 %48, label %49, label %52
49: ; preds = %43
%50 = load i8*, i8** %2
%51 = call i32 @add_usb_bus(i8* %50)
br label %74
52: ; preds = %43, %37, %31, %25
%53 = load i8*, i8** %2
%54 = getelementptr inbounds i8, i8* %53, i64 0
%55 = load i8, i8* %54
%56 = call i64 @isdigit(i8 signext %55)
%57 = icmp ne i64 %56, 0
br i1 %57, label %58, label %69
58: ; preds = %52
%59 = load i8*, i8** %2
%60 = call i64 @strchr(i8* %59, i8 signext 58)
%61 = icmp ne i64 %60, 0
br i1 %61, label %62, label %65
62: ; preds = %58
%63 = load i8*, i8** %2
%64 = call i32 @add_usb_interface(i8* %63)
br label %68
65: ; preds = %58
%66 = load i8*, i8** %2
%67 = call i32 @add_usb_device(i8* %66)
br label %68
68: ; preds = %65, %62
br label %73
69: ; preds = %52
%70 = load i32, i32* @stderr
%71 = load i8*, i8** %2
%72 = call i32 @fprintf(i32 %70, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %71)
br label %73
73: ; preds = %69, %68
br label %74
74: ; preds = %24, %73, %49
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"ignoring '%s'\0A\00"
define void @inspect_bus_entry(i8* %0) {
%2 = load i8, i8* %0
switch i8 %2, label %27 [
i8 46, label %3
i8 117, label %10
]
3: ; preds = %1
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
switch i8 %5, label %27 [
i8 0, label %41
i8 46, label %6
]
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %0, i64 2
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %41, label %27
10: ; preds = %1
%11 = getelementptr inbounds i8, i8* %0, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 115
br i1 %13, label %14, label %27
14: ; preds = %10
%15 = getelementptr inbounds i8, i8* %0, i64 2
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 98
br i1 %17, label %18, label %27
18: ; preds = %14
%19 = getelementptr inbounds i8, i8* %0, i64 3
%20 = load i8, i8* %19
%21 = tail call i64 @isdigit(i8 signext %20)
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %18
%24 = load i8, i8* %0
br label %27
25: ; preds = %18
%26 = tail call i32 @add_usb_bus(i8* %0)
br label %41
27: ; preds = %23, %1, %6, %3, %14, %10
%28 = phi i8 [ %24, %23 ], [ %2, %1 ], [ 46, %6 ], [ 46, %3 ], [ 117, %14 ], [ 117, %10 ]
%29 = tail call i64 @isdigit(i8 signext %28)
%30 = icmp eq i64 %29, 0
br i1 %30, label %38, label %31
31: ; preds = %27
%32 = tail call i64 @strchr(i8* %0, i8 signext 58)
%33 = icmp eq i64 %32, 0
br i1 %33, label %36, label %34
34: ; preds = %31
%35 = tail call i32 @add_usb_interface(i8* %0)
br label %41
36: ; preds = %31
%37 = tail call i32 @add_usb_device(i8* %0)
br label %41
38: ; preds = %27
%39 = load i32, i32* @stderr
%40 = tail call i32 @fprintf(i32 %39, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %41
41: ; preds = %3, %38, %36, %34, %6, %25
ret void
}