#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);
int strlen(char *);
char *xyz_conf_parse(char *line) {
  char *p;
  if (line == NULL || strlen(line) == 0) {
    return NULL;
  }
  p = strchr(line, '#');
  if (p) {
    *p = '\0';
  }
  p = strchr(line, '=');
  if (p == NULL) {
    return NULL;
  }
  *p = '\0';
  if (strlen(line) < 3 && strlen(p + 1) < 3) {
    return NULL;
  }
  return p + 1;
}


x86 assembly (clang, -O0):
<xyz_conf_parse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1149 <xyz_conf_parse+0x29>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%eax
jne    1156 <xyz_conf_parse+0x36>
movq   $0x0,-0x8(%rbp)
jmp    11ec <xyz_conf_parse+0xcc>
mov    -0x10(%rbp),%rdi
mov    $0x23,%esi
call   1040 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     117a <xyz_conf_parse+0x5a>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
mov    $0x3d,%esi
call   1040 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    11a4 <xyz_conf_parse+0x84>
movq   $0x0,-0x8(%rbp)
jmp    11ec <xyz_conf_parse+0xcc>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x3,%eax
jge    11e0 <xyz_conf_parse+0xc0>
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1030 <strlen@plt>
cmp    $0x3,%eax
jge    11e0 <xyz_conf_parse+0xc0>
movq   $0x0,-0x8(%rbp)
jmp    11ec <xyz_conf_parse+0xcc>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xyz_conf_parse>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     117d <xyz_conf_parse+0x5d>
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
je     117d <xyz_conf_parse+0x5d>
mov    %rbx,%rdi
mov    $0x23,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     114a <xyz_conf_parse+0x2a>
movb   $0x0,(%rax)
mov    %rbx,%rdi
mov    $0x3d,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     117d <xyz_conf_parse+0x5d>
mov    %rax,%r14
movb   $0x0,(%rax)
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    $0x2,%eax
jg     118b <xyz_conf_parse+0x6b>
lea    0x1(%r14),%rdi
call   1030 <strlen@plt>
cmp    $0x3,%eax
jge    118b <xyz_conf_parse+0x6b>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
add    $0x1,%r14
jmp    1180 <xyz_conf_parse+0x60>

LLVM IR (-O0):
define i8* @xyz_conf_parse(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32 @strlen(i8* %8)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i8* null, i8** %2
br label %39
12: ; preds = %7
%13 = load i8*, i8** %3
%14 = call i8* @strchr(i8* %13, i8 signext 35)
store i8* %14, i8** %4
%15 = load i8*, i8** %4
%16 = icmp ne i8* %15, null
br i1 %16, label %17, label %19
17: ; preds = %12
%18 = load i8*, i8** %4
store i8 0, i8* %18
br label %19
19: ; preds = %17, %12
%20 = load i8*, i8** %3
%21 = call i8* @strchr(i8* %20, i8 signext 61)
store i8* %21, i8** %4
%22 = load i8*, i8** %4
%23 = icmp eq i8* %22, null
br i1 %23, label %24, label %25
24: ; preds = %19
store i8* null, i8** %2
br label %39
25: ; preds = %19
%26 = load i8*, i8** %4
store i8 0, i8* %26
%27 = load i8*, i8** %3
%28 = call i32 @strlen(i8* %27)
%29 = icmp slt i32 %28, 3
br i1 %29, label %30, label %36
30: ; preds = %25
%31 = load i8*, i8** %4
%32 = getelementptr inbounds i8, i8* %31, i64 1
%33 = call i32 @strlen(i8* %32)
%34 = icmp slt i32 %33, 3
br i1 %34, label %35, label %36
35: ; preds = %30
store i8* null, i8** %2
br label %39
36: ; preds = %30, %25
%37 = load i8*, i8** %4
%38 = getelementptr inbounds i8, i8* %37, i64 1
store i8* %38, i8** %2
br label %39
39: ; preds = %36, %35, %24, %11
%40 = load i8*, i8** %2
ret i8* %40
}

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