#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 *strchr(char *, char);
char *strstrip(char *);
int parse_config_line(char *line, char **option, char **value) {
  char *p;
  p = line;
  while ((p[0] == ' ') || (p[0] == '\t'))
    p++;
  if ((p[0] == '#') || (p[0] == '\n'))
    return 0;
  p = strchr(line, '=');
  if (!p)
    return 0;
  p[0] = 0;
  *option = strstrip(line);
  *value = strstrip(++p);
  p = strchr(p, '\n');
  if (p)
    p[0] = 0;
  return 1;
}


x86 assembly (clang, -O0):
<parse_config_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x29(%rbp)
je     1161 <parse_config_line+0x41>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
test   $0x1,%al
jne    1171 <parse_config_line+0x51>
jmp    1182 <parse_config_line+0x62>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    113c <parse_config_line+0x1c>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
je     11a2 <parse_config_line+0x82>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    11ae <parse_config_line+0x8e>
movl   $0x0,-0x4(%rbp)
jmp    1237 <parse_config_line+0x117>
mov    -0x10(%rbp),%rdi
mov    $0x3d,%esi
call   1030 <strchr@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    11d7 <parse_config_line+0xb7>
movl   $0x0,-0x4(%rbp)
jmp    1237 <parse_config_line+0x117>
mov    -0x28(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
call   1040 <strstrip@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rdi
add    $0x1,%rdi
mov    %rdi,-0x28(%rbp)
call   1040 <strstrip@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1230 <parse_config_line+0x110>
mov    -0x28(%rbp),%rax
movb   $0x0,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_config_line>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0xec8(%rip),%rax
mov    %rdi,%rcx
nopl   0x0(%rax,%rax,1)
movzbl (%rcx),%edx
add    $0xf7,%dl
cmp    $0x1a,%dl
ja     115d <parse_config_line+0x3d>
movzbl %dl,%edx
movslq (%rax,%rdx,4),%rdx
add    %rax,%rdx
jmp    *%rdx
add    $0x1,%rcx
jmp    1140 <parse_config_line+0x20>
mov    %rbx,%rdi
mov    $0x3d,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     11ae <parse_config_line+0x8e>
mov    %rax,%r12
movb   $0x0,(%rax)
mov    %rbx,%rdi
call   1040 <strstrip@plt>
mov    %rax,(%r15)
add    $0x1,%r12
mov    %r12,%rdi
call   1040 <strstrip@plt>
mov    %rax,(%r14)
mov    %r12,%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     11b0 <parse_config_line+0x90>
movb   $0x0,(%rcx)
jmp    11b0 <parse_config_line+0x90>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @parse_config_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** %5
store i8* %9, i8** %8
br label %10
10: ; preds = %24, %3
%11 = load i8*, i8** %8
%12 = getelementptr inbounds i8, i8* %11, i64 0
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 32
br i1 %15, label %22, label %16
16: ; preds = %10
%17 = load i8*, i8** %8
%18 = getelementptr inbounds i8, i8* %17, i64 0
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 9
br label %22
22: ; preds = %16, %10
%23 = phi i1 [ true, %10 ], [ %21, %16 ]
br i1 %23, label %24, label %27
24: ; preds = %22
%25 = load i8*, i8** %8
%26 = getelementptr inbounds i8, i8* %25, i32 1
store i8* %26, i8** %8
br label %10
27: ; preds = %22
%28 = load i8*, i8** %8
%29 = getelementptr inbounds i8, i8* %28, i64 0
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = icmp eq i32 %31, 35
br i1 %32, label %39, label %33
33: ; preds = %27
%34 = load i8*, i8** %8
%35 = getelementptr inbounds i8, i8* %34, i64 0
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
%38 = icmp eq i32 %37, 10
br i1 %38, label %39, label %40
39: ; preds = %33, %27
store i32 0, i32* %4
br label %64
40: ; preds = %33
%41 = load i8*, i8** %5
%42 = call i8* @strchr(i8* %41, i8 signext 61)
store i8* %42, i8** %8
%43 = load i8*, i8** %8
%44 = icmp ne i8* %43, null
br i1 %44, label %46, label %45
45: ; preds = %40
store i32 0, i32* %4
br label %64
46: ; preds = %40
%47 = load i8*, i8** %8
%48 = getelementptr inbounds i8, i8* %47, i64 0
store i8 0, i8* %48
%49 = load i8*, i8** %5
%50 = call i8* @strstrip(i8* %49)
%51 = load i8**, i8*** %6
store i8* %50, i8** %51
%52 = load i8*, i8** %8
%53 = getelementptr inbounds i8, i8* %52, i32 1
store i8* %53, i8** %8
%54 = call i8* @strstrip(i8* %53)
%55 = load i8**, i8*** %7
store i8* %54, i8** %55
%56 = load i8*, i8** %8
%57 = call i8* @strchr(i8* %56, i8 signext 10)
store i8* %57, i8** %8
%58 = load i8*, i8** %8
%59 = icmp ne i8* %58, null
br i1 %59, label %60, label %63
60: ; preds = %46
%61 = load i8*, i8** %8
%62 = getelementptr inbounds i8, i8* %61, i64 0
store i8 0, i8* %62
br label %63
63: ; preds = %60, %46
store i32 1, i32* %4
br label %64
64: ; preds = %63, %45, %39
%65 = load i32, i32* %4
ret i32 %65
}

LLVM IR (-O2):
define i32 @parse_config_line(i8* %0, i8** nocapture writeonly %1, i8** nocapture writeonly %2) {
br label %4
4: ; preds = %7, %3
%5 = phi i8* [ %0, %3 ], [ %8, %7 ]
%6 = load i8, i8* %5
switch i8 %6, label %9 [
i8 32, label %7
i8 9, label %7
i8 35, label %19
i8 10, label %19
]
7: ; preds = %4, %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
br label %4
9: ; preds = %4
%10 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 61)
%11 = icmp eq i8* %10, null
br i1 %11, label %19, label %12
12: ; preds = %9
store i8 0, i8* %10
%13 = tail call i8* @strstrip(i8* %0)
store i8* %13, i8** %1
%14 = getelementptr inbounds i8, i8* %10, i64 1
%15 = tail call i8* @strstrip(i8* %14)
store i8* %15, i8** %2
%16 = tail call i8* @strchr(i8* %14, i8 signext 10)
%17 = icmp eq i8* %16, null
br i1 %17, label %19, label %18
18: ; preds = %12
store i8 0, i8* %16
br label %19
19: ; preds = %4, %4, %12, %18, %9
%20 = phi i32 [ 0, %9 ], [ 1, %18 ], [ 1, %12 ], [ 0, %4 ], [ 0, %4 ]
ret i32 %20
}