#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*/ memmove(char *, char *, size_t);
size_t strlen(char *);
void lirc_parse_include(char *s, const char *name, int line) {
  char last;
  size_t len;
  len = strlen(s);
  if (len < 2) {
    return;
  }
  last = s[len - 1];
  if (*s != '"' && *s != '<') {
    return;
  }
  if (*s == '"' && last != '"') {
    return;
  } else if (*s == '<' && last != '>') {
    return;
  }
  s[len - 1] = 0;
  memmove(s, s + 1, len - 2 + 1);
}


x86 assembly (clang, -O0):
<lirc_parse_include>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x2,-0x20(%rbp)
jae    1150 <lirc_parse_include+0x30>
jmp    11fd <lirc_parse_include+0xdd>
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    $0x1,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x15(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
je     1187 <lirc_parse_include+0x67>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3c,%eax
je     1187 <lirc_parse_include+0x67>
jmp    11fd <lirc_parse_include+0xdd>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
jne    11a9 <lirc_parse_include+0x89>
movsbl -0x15(%rbp),%eax
cmp    $0x22,%eax
je     11a9 <lirc_parse_include+0x89>
jmp    11fd <lirc_parse_include+0xdd>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3c,%eax
jne    11cb <lirc_parse_include+0xab>
movsbl -0x15(%rbp),%eax
cmp    $0x3e,%eax
je     11cb <lirc_parse_include+0xab>
jmp    11fd <lirc_parse_include+0xdd>
jmp    11d0 <lirc_parse_include+0xb0>
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x1,%rsi
mov    -0x20(%rbp),%rdx
sub    $0x2,%rdx
add    $0x1,%rdx
call   1040 <memmove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lirc_parse_include>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmp    $0x2,%rax
jb     1153 <lirc_parse_include+0x33>
mov    -0x1(%rbx,%rax,1),%cl
mov    (%rbx),%dl
cmp    $0x3c,%dl
je     113f <lirc_parse_include+0x1f>
cmp    $0x22,%dl
jne    1153 <lirc_parse_include+0x33>
cmp    $0x22,%dl
jne    1149 <lirc_parse_include+0x29>
cmp    $0x22,%cl
jne    1153 <lirc_parse_include+0x33>
cmp    $0x3c,%dl
jne    1155 <lirc_parse_include+0x35>
cmp    $0x3e,%cl
je     1155 <lirc_parse_include+0x35>
pop    %rbx
ret
add    $0xffffffffffffffff,%rax
movb   $0x0,(%rbx,%rax,1)
lea    0x1(%rbx),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
pop    %rbx
jmp    1040 <memmove@plt>

LLVM IR (-O0):
define void @lirc_parse_include(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8
%8 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%9 = load i8*, i8** %4
%10 = call i64 @strlen(i8* %9)
store i64 %10, i64* %8
%11 = load i64, i64* %8
%12 = icmp ult i64 %11, 2
br i1 %12, label %13, label %14
13: ; preds = %3
br label %63
14: ; preds = %3
%15 = load i8*, i8** %4
%16 = load i64, i64* %8
%17 = sub i64 %16, 1
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = load i8, i8* %18
store i8 %19, i8* %7
%20 = load i8*, i8** %4
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp ne i32 %22, 34
br i1 %23, label %24, label %30
24: ; preds = %14
%25 = load i8*, i8** %4
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp ne i32 %27, 60
br i1 %28, label %29, label %30
29: ; preds = %24
br label %63
30: ; preds = %24, %14
%31 = load i8*, i8** %4
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %33, 34
br i1 %34, label %35, label %40
35: ; preds = %30
%36 = load i8, i8* %7
%37 = sext i8 %36 to i32
%38 = icmp ne i32 %37, 34
br i1 %38, label %39, label %40
39: ; preds = %35
br label %63
40: ; preds = %35, %30
%41 = load i8*, i8** %4
%42 = load i8, i8* %41
%43 = sext i8 %42 to i32
%44 = icmp eq i32 %43, 60
br i1 %44, label %45, label %50
45: ; preds = %40
%46 = load i8, i8* %7
%47 = sext i8 %46 to i32
%48 = icmp ne i32 %47, 62
br i1 %48, label %49, label %50
49: ; preds = %45
br label %63
50: ; preds = %45, %40
br label %51
51: ; preds = %50
%52 = load i8*, i8** %4
%53 = load i64, i64* %8
%54 = sub i64 %53, 1
%55 = getelementptr inbounds i8, i8* %52, i64 %54
store i8 0, i8* %55
%56 = load i8*, i8** %4
%57 = load i8*, i8** %4
%58 = getelementptr inbounds i8, i8* %57, i64 1
%59 = load i64, i64* %8
%60 = sub i64 %59, 2
%61 = add i64 %60, 1
%62 = call i32 @memmove(i8* %56, i8* %58, i64 %61)
br label %63
63: ; preds = %51, %49, %39, %29, %13
ret void
}

LLVM IR (-O2):
define void @lirc_parse_include(i8* %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%5 = icmp ult i64 %4, 2
br i1 %5, label %22, label %6
6: ; preds = %3
%7 = add i64 %4, -1
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = load i8, i8* %0
switch i8 %10, label %22 [
i8 34, label %11
i8 60, label %11
]
11: ; preds = %6, %6
%12 = icmp eq i8 %10, 34
%13 = icmp ne i8 %9, 34
%14 = select i1 %12, i1 %13, i1 false
br i1 %14, label %22, label %15
15: ; preds = %11
%16 = icmp eq i8 %10, 60
%17 = icmp ne i8 %9, 62
%18 = select i1 %16, i1 %17, i1 false
br i1 %18, label %22, label %19
19: ; preds = %15
store i8 0, i8* %8
%20 = getelementptr inbounds i8, i8* %0, i64 1
%21 = tail call i32 @memmove(i8* %0, i8* %20, i64 %7)
br label %22
22: ; preds = %15, %11, %6, %3, %19
ret void
}