#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*/ dev_find(char *);
int /*<<< orphan*/ isxdigit(char);
scalar_t__ strncmp(char *, char *, int);
void process_device_line(char *line) {
  char *id;
  int i;
  if (strncmp(line, "Device ", 7) != 0)
    return;
  line += 7;
  id = line;
  for (i = 0; i < 6; ++i) {
    if (!isxdigit(line[0]) || !isxdigit(line[1]))
      return;
    line += 2;
    if (i < 5) {
      if (line[0] != ':')
        return;
      ++line;
    }
  }
  *line = 0;
  dev_find(id);
}


x86 assembly (clang, -O0):
<process_device_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
mov    $0x7,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     1160 <process_device_line+0x30>
jmp    120f <process_device_line+0xdf>
mov    -0x8(%rbp),%rax
add    $0x7,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x6,-0x14(%rbp)
jge    11ff <process_device_line+0xcf>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1050 <isxdigit@plt>
cmp    $0x0,%eax
je     11b0 <process_device_line+0x80>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%edi
call   1050 <isxdigit@plt>
cmp    $0x0,%eax
jne    11b5 <process_device_line+0x85>
jmp    120f <process_device_line+0xdf>
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
cmpl   $0x5,-0x14(%rbp)
jge    11ec <process_device_line+0xbc>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
je     11e0 <process_device_line+0xb0>
jmp    120f <process_device_line+0xdf>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    11f1 <process_device_line+0xc1>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    117b <process_device_line+0x4b>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
call   1040 <dev_find@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_device_line>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rsi
mov    $0x7,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     114c <process_device_line+0x1c>
pop    %rbx
ret
movsbl 0x7(%rbx),%edi
call   1050 <isxdigit@plt>
test   %eax,%eax
je     114a <process_device_line+0x1a>
movsbl 0x8(%rbx),%edi
call   1050 <isxdigit@plt>
test   %eax,%eax
je     114a <process_device_line+0x1a>
cmpb   $0x3a,0x9(%rbx)
jne    114a <process_device_line+0x1a>
movsbl 0xa(%rbx),%edi
call   1050 <isxdigit@plt>
test   %eax,%eax
je     114a <process_device_line+0x1a>
movsbl 0xb(%rbx),%edi
call   1050 <isxdigit@plt>
test   %eax,%eax
je     114a <process_device_line+0x1a>
cmpb   $0x3a,0xc(%rbx)
jne    114a <process_device_line+0x1a>
movsbl 0xd(%rbx),%edi
call   1050 <isxdigit@plt>
test   %eax,%eax
je     114a <process_device_line+0x1a>
movsbl 0xe(%rbx),%edi
call   1050 <isxdigit@plt>
test   %eax,%eax
je     114a <process_device_line+0x1a>
cmpb   $0x3a,0xf(%rbx)
jne    114a <process_device_line+0x1a>
movsbl 0x10(%rbx),%edi
call   1050 <isxdigit@plt>
test   %eax,%eax
je     114a <process_device_line+0x1a>
movsbl 0x11(%rbx),%edi
call   1050 <isxdigit@plt>
test   %eax,%eax
je     114a <process_device_line+0x1a>
cmpb   $0x3a,0x12(%rbx)
jne    114a <process_device_line+0x1a>
movsbl 0x13(%rbx),%edi
call   1050 <isxdigit@plt>
test   %eax,%eax
je     114a <process_device_line+0x1a>
movsbl 0x14(%rbx),%edi
call   1050 <isxdigit@plt>
test   %eax,%eax
je     114a <process_device_line+0x1a>
cmpb   $0x3a,0x15(%rbx)
jne    114a <process_device_line+0x1a>
movsbl 0x16(%rbx),%edi
call   1050 <isxdigit@plt>
test   %eax,%eax
je     114a <process_device_line+0x1a>
movsbl 0x17(%rbx),%edi
call   1050 <isxdigit@plt>
test   %eax,%eax
je     114a <process_device_line+0x1a>
movb   $0x0,0x18(%rbx)
add    $0x7,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <dev_find@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Device \00"
define void @process_device_line(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strncmp(i8* %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
br label %52
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 7
store i8* %11, i8** %2
%12 = load i8*, i8** %2
store i8* %12, i8** %3
store i32 0, i32* %4
br label %13
13: ; preds = %45, %9
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, 6
br i1 %15, label %16, label %48
16: ; preds = %13
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i64 0
%19 = load i8, i8* %18
%20 = call i32 @isxdigit(i8 signext %19)
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %28
22: ; preds = %16
%23 = load i8*, i8** %2
%24 = getelementptr inbounds i8, i8* %23, i64 1
%25 = load i8, i8* %24
%26 = call i32 @isxdigit(i8 signext %25)
%27 = icmp ne i32 %26, 0
br i1 %27, label %29, label %28
28: ; preds = %22, %16
br label %52
29: ; preds = %22
%30 = load i8*, i8** %2
%31 = getelementptr inbounds i8, i8* %30, i64 2
store i8* %31, i8** %2
%32 = load i32, i32* %4
%33 = icmp slt i32 %32, 5
br i1 %33, label %34, label %44
34: ; preds = %29
%35 = load i8*, i8** %2
%36 = getelementptr inbounds i8, i8* %35, i64 0
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = icmp ne i32 %38, 58
br i1 %39, label %40, label %41
40: ; preds = %34
br label %52
41: ; preds = %34
%42 = load i8*, i8** %2
%43 = getelementptr inbounds i8, i8* %42, i32 1
store i8* %43, i8** %2
br label %44
44: ; preds = %41, %29
br label %45
45: ; preds = %44
%46 = load i32, i32* %4
%47 = add nsw i32 %46, 1
store i32 %47, i32* %4
br label %13
48: ; preds = %13
%49 = load i8*, i8** %2
store i8 0, i8* %49
%50 = load i8*, i8** %3
%51 = call i32 @dev_find(i8* %50)
br label %52
52: ; preds = %48, %40, %28, %8
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"Device \00"
define void @process_device_line(i8* %0) {
%2 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %87
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 7
%6 = load i8, i8* %5
%7 = tail call i32 @isxdigit(i8 signext %6)
%8 = icmp eq i32 %7, 0
br i1 %8, label %87, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %0, i64 8
%11 = load i8, i8* %10
%12 = tail call i32 @isxdigit(i8 signext %11)
%13 = icmp eq i32 %12, 0
br i1 %13, label %87, label %14
14: ; preds = %9
%15 = getelementptr inbounds i8, i8* %0, i64 9
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 58
br i1 %17, label %18, label %87
18: ; preds = %14
%19 = getelementptr inbounds i8, i8* %0, i64 10
%20 = load i8, i8* %19
%21 = tail call i32 @isxdigit(i8 signext %20)
%22 = icmp eq i32 %21, 0
br i1 %22, label %87, label %23
23: ; preds = %18
%24 = getelementptr inbounds i8, i8* %0, i64 11
%25 = load i8, i8* %24
%26 = tail call i32 @isxdigit(i8 signext %25)
%27 = icmp eq i32 %26, 0
br i1 %27, label %87, label %28
28: ; preds = %23
%29 = getelementptr inbounds i8, i8* %0, i64 12
%30 = load i8, i8* %29
%31 = icmp eq i8 %30, 58
br i1 %31, label %32, label %87
32: ; preds = %28
%33 = getelementptr inbounds i8, i8* %0, i64 13
%34 = load i8, i8* %33
%35 = tail call i32 @isxdigit(i8 signext %34)
%36 = icmp eq i32 %35, 0
br i1 %36, label %87, label %37
37: ; preds = %32
%38 = getelementptr inbounds i8, i8* %0, i64 14
%39 = load i8, i8* %38
%40 = tail call i32 @isxdigit(i8 signext %39)
%41 = icmp eq i32 %40, 0
br i1 %41, label %87, label %42
42: ; preds = %37
%43 = getelementptr inbounds i8, i8* %0, i64 15
%44 = load i8, i8* %43
%45 = icmp eq i8 %44, 58
br i1 %45, label %46, label %87
46: ; preds = %42
%47 = getelementptr inbounds i8, i8* %0, i64 16
%48 = load i8, i8* %47
%49 = tail call i32 @isxdigit(i8 signext %48)
%50 = icmp eq i32 %49, 0
br i1 %50, label %87, label %51
51: ; preds = %46
%52 = getelementptr inbounds i8, i8* %0, i64 17
%53 = load i8, i8* %52
%54 = tail call i32 @isxdigit(i8 signext %53)
%55 = icmp eq i32 %54, 0
br i1 %55, label %87, label %56
56: ; preds = %51
%57 = getelementptr inbounds i8, i8* %0, i64 18
%58 = load i8, i8* %57
%59 = icmp eq i8 %58, 58
br i1 %59, label %60, label %87
60: ; preds = %56
%61 = getelementptr inbounds i8, i8* %0, i64 19
%62 = load i8, i8* %61
%63 = tail call i32 @isxdigit(i8 signext %62)
%64 = icmp eq i32 %63, 0
br i1 %64, label %87, label %65
65: ; preds = %60
%66 = getelementptr inbounds i8, i8* %0, i64 20
%67 = load i8, i8* %66
%68 = tail call i32 @isxdigit(i8 signext %67)
%69 = icmp eq i32 %68, 0
br i1 %69, label %87, label %70
70: ; preds = %65
%71 = getelementptr inbounds i8, i8* %0, i64 21
%72 = load i8, i8* %71
%73 = icmp eq i8 %72, 58
br i1 %73, label %74, label %87
74: ; preds = %70
%75 = getelementptr inbounds i8, i8* %0, i64 22
%76 = load i8, i8* %75
%77 = tail call i32 @isxdigit(i8 signext %76)
%78 = icmp eq i32 %77, 0
br i1 %78, label %87, label %79
79: ; preds = %74
%80 = getelementptr inbounds i8, i8* %0, i64 23
%81 = load i8, i8* %80
%82 = tail call i32 @isxdigit(i8 signext %81)
%83 = icmp eq i32 %82, 0
br i1 %83, label %87, label %84
84: ; preds = %79
%85 = getelementptr inbounds i8, i8* %0, i64 24
store i8 0, i8* %85
%86 = tail call i32 @dev_find(i8* %5)
br label %87
87: ; preds = %14, %4, %9, %18, %23, %28, %32, %37, %42, %46, %51, %56, %60, %65, %70, %74, %79, %1, %84
ret void
}