#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*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ remove_space(char **);
int /*<<< orphan*/ stderr;
char *strchr(char *, char);
int strlen(char *);
int parse_line(char **pkw, char **pval, char *linebuf) {
  char *p;
  p = linebuf + strlen(linebuf) - 1;
  if (*p != '\n') {
    fprintf(stderr, "FATAL: missing EOL\n");
    exit(1);
  }
  p = strchr(linebuf, '#');
  if (p)
    *p = '\0';
  p = strchr(linebuf, '=');
  if (!p)
    return 0;
  *p++ = '\0';
  *pkw = linebuf;
  *pval = p;
  remove_space(pkw);
  remove_space(pval);
  return 1;
}


x86 assembly (clang, -O0):
<parse_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     11b8 <parse_line+0x68>
mov    0x2e40(%rip),%rax
mov    (%rax),%edi
lea    0xe57(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0x20(%rbp),%rdi
mov    $0x23,%esi
call   1040 <strchr@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     11dc <parse_line+0x8c>
mov    -0x28(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rdi
mov    $0x3d,%esi
call   1040 <strchr@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1205 <parse_line+0xb5>
movl   $0x0,-0x4(%rbp)
jmp    1246 <parse_line+0xf6>
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x28(%rbp)
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rdi
call   1050 <remove_space@plt>
mov    -0x18(%rbp),%rdi
call   1050 <remove_space@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_line>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rdx,%rdi
call   1030 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rbx,%rax,1)
jne    11c5 <parse_line+0x75>
mov    %rbx,%rdi
mov    $0x23,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     1184 <parse_line+0x34>
movb   $0x0,(%rax)
mov    %rbx,%rdi
mov    $0x3d,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     11bd <parse_line+0x6d>
mov    %rax,%rcx
add    $0x1,%rcx
movb   $0x0,(%rax)
mov    %rbx,(%r15)
mov    %rcx,(%r14)
mov    %r15,%rdi
call   1050 <remove_space@plt>
mov    %r14,%rdi
call   1050 <remove_space@plt>
mov    $0x1,%eax
jmp    11bf <parse_line+0x6f>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret
mov    0x2e14(%rip),%rax
mov    (%rax),%edi
lea    0xe2b(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"FATAL: missing EOL\0A\00"
define i32 @parse_line(i8** %0, i8** %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8**
%7 = alloca i8*
%8 = alloca i8*
store i8** %0, i8*** %5
store i8** %1, i8*** %6
store i8* %2, i8** %7
%9 = load i8*, i8** %7
%10 = load i8*, i8** %7
%11 = call i32 @strlen(i8* %10)
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %9, i64 %12
%14 = getelementptr inbounds i8, i8* %13, i64 -1
store i8* %14, i8** %8
%15 = load i8*, i8** %8
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp ne i32 %17, 10
br i1 %18, label %19, label %23
19: ; preds = %3
%20 = load i32, i32* @stderr
%21 = call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%22 = call i32 @exit(i32 1)
unreachable
23: ; preds = %3
%24 = load i8*, i8** %7
%25 = call i8* @strchr(i8* %24, i8 signext 35)
store i8* %25, i8** %8
%26 = load i8*, i8** %8
%27 = icmp ne i8* %26, null
br i1 %27, label %28, label %30
28: ; preds = %23
%29 = load i8*, i8** %8
store i8 0, i8* %29
br label %30
30: ; preds = %28, %23
%31 = load i8*, i8** %7
%32 = call i8* @strchr(i8* %31, i8 signext 61)
store i8* %32, i8** %8
%33 = load i8*, i8** %8
%34 = icmp ne i8* %33, null
br i1 %34, label %36, label %35
35: ; preds = %30
store i32 0, i32* %4
br label %47
36: ; preds = %30
%37 = load i8*, i8** %8
%38 = getelementptr inbounds i8, i8* %37, i32 1
store i8* %38, i8** %8
store i8 0, i8* %37
%39 = load i8*, i8** %7
%40 = load i8**, i8*** %5
store i8* %39, i8** %40
%41 = load i8*, i8** %8
%42 = load i8**, i8*** %6
store i8* %41, i8** %42
%43 = load i8**, i8*** %5
%44 = call i32 @remove_space(i8** %43)
%45 = load i8**, i8*** %6
%46 = call i32 @remove_space(i8** %45)
store i32 1, i32* %4
br label %47
47: ; preds = %36, %35
%48 = load i32, i32* %4
ret i32 %48
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"FATAL: missing EOL\0A\00"
define i32 @parse_line(i8** %0, i8** %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %2)
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %2, i64 %5
%7 = getelementptr inbounds i8, i8* %6, i64 -1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 10
br i1 %9, label %14, label %10
10: ; preds = %3
%11 = load i32, i32* @stderr
%12 = tail call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%13 = tail call i32 @exit(i32 1)
unreachable
14: ; preds = %3
%15 = tail call i8* @strchr(i8* dereferenceable(1) %2, i8 signext 35)
%16 = icmp eq i8* %15, null
br i1 %16, label %18, label %17
17: ; preds = %14
store i8 0, i8* %15
br label %18
18: ; preds = %17, %14
%19 = tail call i8* @strchr(i8* dereferenceable(1) %2, i8 signext 61)
%20 = icmp eq i8* %19, null
br i1 %20, label %25, label %21
21: ; preds = %18
%22 = getelementptr inbounds i8, i8* %19, i64 1
store i8 0, i8* %19
store i8* %2, i8** %0
store i8* %22, i8** %1
%23 = tail call i32 @remove_space(i8** %0)
%24 = tail call i32 @remove_space(i8** %1)
br label %25
25: ; preds = %18, %21
%26 = phi i32 [ 1, %21 ], [ 0, %18 ]
ret i32 %26
}