#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 */
char *strip_line(char *);
int /*<<< orphan*/ strncmp(char *, char *, int);
int parse_start(char **cp) {
  char *p;
  p = strip_line(*cp);
  if (*p == '\0' || *p == '#')
    return 0;
  if (!strncmp(p, "<device", 7)) {
    ;
    p += 7;
    *cp = p;
    return 1;
  }
  if (*p == '<')
    return 0;
  return -14;
}


x86 assembly (clang, -O0):
<parse_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <strip_line@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115c <parse_start+0x3c>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
jne    1168 <parse_start+0x48>
movl   $0x0,-0x4(%rbp)
jmp    11cc <parse_start+0xac>
mov    -0x18(%rbp),%rdi
lea    0xe8d(%rip),%rsi
mov    $0x7,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    11a9 <parse_start+0x89>
mov    -0x18(%rbp),%rax
add    $0x7,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    11cc <parse_start+0xac>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3c,%eax
jne    11c5 <parse_start+0xa5>
movl   $0x0,-0x4(%rbp)
jmp    11cc <parse_start+0xac>
movl   $0xfffffff2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_start>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
call   1040 <strip_line@plt>
mov    %rax,%rbx
mov    (%rax),%cl
xor    %eax,%eax
test   %cl,%cl
je     1172 <parse_start+0x52>
cmp    $0x23,%cl
je     1172 <parse_start+0x52>
lea    0xeba(%rip),%rsi
mov    %rbx,%rdi
mov    $0x7,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     1166 <parse_start+0x46>
xor    %ecx,%ecx
cmpb   $0x3c,(%rbx)
mov    $0xfffffff2,%eax
cmove  %ecx,%eax
jmp    1172 <parse_start+0x52>
add    $0x7,%rbx
mov    %rbx,(%r14)
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [8 x i8] c"<device\00"
define i32 @parse_start(i8** %0) {
%2 = alloca i32
%3 = alloca i8**
%4 = alloca i8*
store i8** %0, i8*** %3
%5 = load i8**, i8*** %3
%6 = load i8*, i8** %5
%7 = call i8* @strip_line(i8* %6)
store i8* %7, i8** %4
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 0
br i1 %11, label %17, label %12
12: ; preds = %1
%13 = load i8*, i8** %4
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 35
br i1 %16, label %17, label %18
17: ; preds = %12, %1
store i32 0, i32* %2
br label %34
18: ; preds = %12
%19 = load i8*, i8** %4
%20 = call i32 @strncmp(i8* %19, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
%21 = icmp ne i32 %20, 0
br i1 %21, label %27, label %22
22: ; preds = %18
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i64 7
store i8* %24, i8** %4
%25 = load i8*, i8** %4
%26 = load i8**, i8*** %3
store i8* %25, i8** %26
store i32 1, i32* %2
br label %34
27: ; preds = %18
%28 = load i8*, i8** %4
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = icmp eq i32 %30, 60
br i1 %31, label %32, label %33
32: ; preds = %27
store i32 0, i32* %2
br label %34
33: ; preds = %27
store i32 -14, i32* %2
br label %34
34: ; preds = %33, %32, %22, %17
%35 = load i32, i32* %2
ret i32 %35
}

LLVM IR (-O2):
@.str = [8 x i8] c"<device\00"
define i32 @parse_start(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i8* @strip_line(i8* %2)
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %14
i8 35, label %14
]
5: ; preds = %1
%6 = tail call i32 @strncmp(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = getelementptr inbounds i8, i8* %3, i64 7
store i8* %9, i8** %0
br label %14
10: ; preds = %5
%11 = load i8, i8* %3
%12 = icmp eq i8 %11, 60
%13 = select i1 %12, i32 0, i32 -14
br label %14
14: ; preds = %10, %1, %1, %8
%15 = phi i32 [ 1, %8 ], [ 0, %1 ], [ 0, %1 ], [ %13, %10 ]
ret i32 %15
}