#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*/ handle_directive(char *, int);
int /*<<< orphan*/ handle_property(char *, char *, int, int);
int /*<<< orphan*/ ltrim_inplace(char *);
int /*<<< orphan*/ rtrim_inplace(char *);
void parse_line(char *line, int lineno) {
  ltrim_inplace(line);
  if (*line == '\0' || *line == '#') {
    return;
  }
  char *s = line;
  while (*line && !((*line == '+' && *(line + 1) == '=') || *line == '=' ||
                    *line == '#')) {
    line++;
  }
  if (*line == '\0' || *line == '#') {
    *line = '\0';
    rtrim_inplace(s);
    handle_directive(s, lineno);
    return;
  }
  bool append = false;
  if (*line == '+' && *(line + 1) == '=') {
    append = true;
    *line = '\0';
    line += 2;
  } else {
    *line++ = '\0';
  }
  rtrim_inplace(s);
  char *value = line;
  ltrim_inplace(value);
  while (*line && *line != '#') {
    line++;
  }
  *line = '\0';
  rtrim_inplace(value);
  handle_property(s, value, append, lineno);
}


x86 assembly (clang, -O0):
<parse_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <ltrim_inplace@plt>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1178 <parse_line+0x38>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
jne    117d <parse_line+0x3d>
jmp    132b <parse_line+0x1eb>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x29(%rbp)
je     11ed <parse_line+0xad>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2b,%eax
jne    11c0 <parse_line+0x80>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%ecx
mov    $0x1,%al
cmp    $0x3d,%ecx
mov    %al,-0x2a(%rbp)
je     11e5 <parse_line+0xa5>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x3d,%ecx
mov    %al,-0x2a(%rbp)
je     11e5 <parse_line+0xa5>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
sete   %al
mov    %al,-0x2a(%rbp)
mov    -0x2a(%rbp),%al
xor    $0xff,%al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
test   $0x1,%al
jne    11fd <parse_line+0xbd>
jmp    120e <parse_line+0xce>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1185 <parse_line+0x45>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     122e <parse_line+0xee>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
jne    124f <parse_line+0x10f>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rdi
call   1030 <rtrim_inplace@plt>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <handle_directive@plt>
jmp    132b <parse_line+0x1eb>
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2b,%eax
jne    1296 <parse_line+0x156>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x3d,%eax
jne    1296 <parse_line+0x156>
movl   $0x1,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
jmp    12a8 <parse_line+0x168>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rdi
call   1030 <rtrim_inplace@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1060 <ltrim_inplace@plt>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x2b(%rbp)
je     12e7 <parse_line+0x1a7>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
setne  %al
mov    %al,-0x2b(%rbp)
mov    -0x2b(%rbp),%al
test   $0x1,%al
jne    12f7 <parse_line+0x1b7>
jmp    1308 <parse_line+0x1c8>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    12c2 <parse_line+0x182>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x28(%rbp),%rdi
call   1030 <rtrim_inplace@plt>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0xc(%rbp),%ecx
call   1050 <handle_property@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_line>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %rdi,%rbx
call   1060 <ltrim_inplace@plt>
mov    (%rbx),%al
test   %al,%al
je     115c <parse_line+0x1c>
cmp    $0x23,%al
jne    1167 <parse_line+0x27>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x1(%rbx),%rbp
cmp    $0x2a,%al
jle    118f <parse_line+0x4f>
nop
cmp    $0x2b,%al
jne    1180 <parse_line+0x40>
mov    0x0(%rbp),%al
cmp    $0x3d,%al
jne    1187 <parse_line+0x47>
jmp    11b8 <parse_line+0x78>
nopl   (%rax)
cmp    $0x3d,%al
je     11c8 <parse_line+0x88>
mov    0x0(%rbp),%al
add    $0x1,%rbp
cmp    $0x2a,%al
jg     1170 <parse_line+0x30>
test   %al,%al
je     1197 <parse_line+0x57>
cmp    $0x23,%al
jne    1184 <parse_line+0x44>
movb   $0x0,-0x1(%rbp)
mov    %rbx,%rdi
call   1030 <rtrim_inplace@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <handle_directive@plt>
movb   $0x0,-0x1(%rbp)
add    $0x1,%rbp
mov    $0x1,%r15d
jmp    11cf <parse_line+0x8f>
movb   $0x0,-0x1(%rbp)
xor    %r15d,%r15d
mov    %rbx,%rdi
call   1030 <rtrim_inplace@plt>
mov    %rbp,%rdi
call   1060 <ltrim_inplace@plt>
mov    %rbp,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rax),%ecx
test   %cl,%cl
je     1202 <parse_line+0xc2>
cmp    $0x23,%cl
je     1202 <parse_line+0xc2>
add    $0x1,%rax
jmp    11f0 <parse_line+0xb0>
movb   $0x0,(%rax)
mov    %rbp,%rdi
call   1030 <rtrim_inplace@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r15d,%edx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <handle_property@plt>

LLVM IR (-O0):
define void @parse_line(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%8 = load i8*, i8** %3
%9 = call i32 @ltrim_inplace(i8* %8)
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 0
br i1 %13, label %19, label %14
14: ; preds = %2
%15 = load i8*, i8** %3
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 35
br i1 %18, label %19, label %20
19: ; preds = %14, %2
br label %121
20: ; preds = %14
%21 = load i8*, i8** %3
store i8* %21, i8** %5
br label %22
22: ; preds = %53, %20
%23 = load i8*, i8** %3
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %51
27: ; preds = %22
%28 = load i8*, i8** %3
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = icmp eq i32 %30, 43
br i1 %31, label %32, label %38
32: ; preds = %27
%33 = load i8*, i8** %3
%34 = getelementptr inbounds i8, i8* %33, i64 1
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = icmp eq i32 %36, 61
br i1 %37, label %48, label %38
38: ; preds = %32, %27
%39 = load i8*, i8** %3
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = icmp eq i32 %41, 61
br i1 %42, label %48, label %43
43: ; preds = %38
%44 = load i8*, i8** %3
%45 = load i8, i8* %44
%46 = sext i8 %45 to i32
%47 = icmp eq i32 %46, 35
br label %48
48: ; preds = %43, %38, %32
%49 = phi i1 [ true, %38 ], [ true, %32 ], [ %47, %43 ]
%50 = xor i1 %49, true
br label %51
51: ; preds = %48, %22
%52 = phi i1 [ false, %22 ], [ %50, %48 ]
br i1 %52, label %53, label %56
53: ; preds = %51
%54 = load i8*, i8** %3
%55 = getelementptr inbounds i8, i8* %54, i32 1
store i8* %55, i8** %3
br label %22
56: ; preds = %51
%57 = load i8*, i8** %3
%58 = load i8, i8* %57
%59 = sext i8 %58 to i32
%60 = icmp eq i32 %59, 0
br i1 %60, label %66, label %61
61: ; preds = %56
%62 = load i8*, i8** %3
%63 = load i8, i8* %62
%64 = sext i8 %63 to i32
%65 = icmp eq i32 %64, 35
br i1 %65, label %66, label %73
66: ; preds = %61, %56
%67 = load i8*, i8** %3
store i8 0, i8* %67
%68 = load i8*, i8** %5
%69 = call i32 @rtrim_inplace(i8* %68)
%70 = load i8*, i8** %5
%71 = load i32, i32* %4
%72 = call i32 @handle_directive(i8* %70, i32 %71)
br label %121
73: ; preds = %61
store i32 0, i32* %6
%74 = load i8*, i8** %3
%75 = load i8, i8* %74
%76 = sext i8 %75 to i32
%77 = icmp eq i32 %76, 43
br i1 %77, label %78, label %88
78: ; preds = %73
%79 = load i8*, i8** %3
%80 = getelementptr inbounds i8, i8* %79, i64 1
%81 = load i8, i8* %80
%82 = sext i8 %81 to i32
%83 = icmp eq i32 %82, 61
br i1 %83, label %84, label %88
84: ; preds = %78
store i32 1, i32* %6
%85 = load i8*, i8** %3
store i8 0, i8* %85
%86 = load i8*, i8** %3
%87 = getelementptr inbounds i8, i8* %86, i64 2
store i8* %87, i8** %3
br label %91
88: ; preds = %78, %73
%89 = load i8*, i8** %3
%90 = getelementptr inbounds i8, i8* %89, i32 1
store i8* %90, i8** %3
store i8 0, i8* %89
br label %91
91: ; preds = %88, %84
%92 = load i8*, i8** %5
%93 = call i32 @rtrim_inplace(i8* %92)
%94 = load i8*, i8** %3
store i8* %94, i8** %7
%95 = load i8*, i8** %7
%96 = call i32 @ltrim_inplace(i8* %95)
br label %97
97: ; preds = %109, %91
%98 = load i8*, i8** %3
%99 = load i8, i8* %98
%100 = sext i8 %99 to i32
%101 = icmp ne i32 %100, 0
br i1 %101, label %102, label %107
102: ; preds = %97
%103 = load i8*, i8** %3
%104 = load i8, i8* %103
%105 = sext i8 %104 to i32
%106 = icmp ne i32 %105, 35
br label %107
107: ; preds = %102, %97
%108 = phi i1 [ false, %97 ], [ %106, %102 ]
br i1 %108, label %109, label %112
109: ; preds = %107
%110 = load i8*, i8** %3
%111 = getelementptr inbounds i8, i8* %110, i32 1
store i8* %111, i8** %3
br label %97
112: ; preds = %107
%113 = load i8*, i8** %3
store i8 0, i8* %113
%114 = load i8*, i8** %7
%115 = call i32 @rtrim_inplace(i8* %114)
%116 = load i8*, i8** %5
%117 = load i8*, i8** %7
%118 = load i32, i32* %6
%119 = load i32, i32* %4
%120 = call i32 @handle_property(i8* %116, i8* %117, i32 %118, i32 %119)
br label %121
121: ; preds = %112, %66, %19
ret void
}

LLVM IR (-O2):
define void @parse_line(i8* %0, i32 %1) {
%3 = tail call i32 @ltrim_inplace(i8* %0)
%4 = load i8, i8* %0
switch i8 %4, label %5 [
i8 0, label %38
i8 35, label %38
]
5: ; preds = %2, %15
%6 = phi i8 [ %16, %15 ], [ %4, %2 ]
%7 = phi i8* [ %17, %15 ], [ %0, %2 ]
switch i8 %6, label %8 [
i8 0, label %18
i8 43, label %11
i8 35, label %18
i8 61, label %23
]
8: ; preds = %5
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %9
br label %15
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 61
br i1 %14, label %21, label %15
15: ; preds = %8, %11
%16 = phi i8 [ %10, %8 ], [ %13, %11 ]
%17 = getelementptr inbounds i8, i8* %7, i64 1
br label %5
18: ; preds = %5, %5
store i8 0, i8* %7
%19 = tail call i32 @rtrim_inplace(i8* %0)
%20 = tail call i32 @handle_directive(i8* %0, i32 %1)
br label %38
21: ; preds = %11
store i8 0, i8* %7
%22 = getelementptr inbounds i8, i8* %7, i64 2
br label %25
23: ; preds = %5
%24 = getelementptr inbounds i8, i8* %7, i64 1
store i8 0, i8* %7
br label %25
25: ; preds = %23, %21
%26 = phi i32 [ 1, %21 ], [ 0, %23 ]
%27 = phi i8* [ %22, %21 ], [ %24, %23 ]
%28 = tail call i32 @rtrim_inplace(i8* %0)
%29 = tail call i32 @ltrim_inplace(i8* %27)
br label %30
30: ; preds = %33, %25
%31 = phi i8* [ %27, %25 ], [ %34, %33 ]
%32 = load i8, i8* %31
switch i8 %32, label %33 [
i8 0, label %35
i8 35, label %35
]
33: ; preds = %30
%34 = getelementptr inbounds i8, i8* %31, i64 1
br label %30
35: ; preds = %30, %30
store i8 0, i8* %31
%36 = tail call i32 @rtrim_inplace(i8* %27)
%37 = tail call i32 @handle_property(i8* %0, i8* %27, i32 %26, i32 %1)
br label %38
38: ; preds = %18, %35, %2, %2
ret void
}