#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 *clonestr(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stripstr(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
char *parse_conf_line(char *line, char *field) {
  line += strlen(field);
  for (; *line != '=' && *line != 0; line++)
    break;
  if (*line == 0)
    return (0);
  if (*line == '=')
    line++;
  stripstr(line, strlen(line));
  printf("[%s]\n", line);
  return (clonestr(line));
}


x86 assembly (clang, -O0):
<parse_conf_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x3d,%ecx
mov    %al,-0x19(%rbp)
je     118e <parse_conf_line+0x4e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    119e <parse_conf_line+0x5e>
jmp    11a3 <parse_conf_line+0x63>
jmp    11a3 <parse_conf_line+0x63>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    11c0 <parse_conf_line+0x80>
movq   $0x0,-0x8(%rbp)
jmp    1215 <parse_conf_line+0xd5>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3d,%eax
jne    11dc <parse_conf_line+0x9c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
call   1050 <stripstr@plt>
mov    -0x10(%rbp),%rsi
lea    0xdfd(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1060 <clonestr@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_conf_line>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <strlen@plt>
movslq %eax,%rcx
mov    (%rbx,%rcx,1),%al
test   %al,%al
je     118b <parse_conf_line+0x4b>
add    %rcx,%rbx
cmp    $0x3d,%al
jne    1161 <parse_conf_line+0x21>
add    $0x1,%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <stripstr@plt>
lea    0xe86(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1060 <clonestr@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"[%s]\0A\00"
define i8* @parse_conf_line(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %5
%7 = call i32 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = sext i32 %7 to i64
%10 = getelementptr inbounds i8, i8* %8, i64 %9
store i8* %10, i8** %4
br label %11
11: ; preds = %24, %2
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 61
br i1 %15, label %16, label %21
16: ; preds = %11
%17 = load i8*, i8** %4
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp ne i32 %19, 0
br label %21
21: ; preds = %16, %11
%22 = phi i1 [ false, %11 ], [ %20, %16 ]
br i1 %22, label %23, label %27
23: ; preds = %21
br label %27
24: ; No predecessors!
%25 = load i8*, i8** %4
%26 = getelementptr inbounds i8, i8* %25, i32 1
store i8* %26, i8** %4
br label %11
27: ; preds = %23, %21
%28 = load i8*, i8** %4
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %33
32: ; preds = %27
store i8* null, i8** %3
br label %50
33: ; preds = %27
%34 = load i8*, i8** %4
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = icmp eq i32 %36, 61
br i1 %37, label %38, label %41
38: ; preds = %33
%39 = load i8*, i8** %4
%40 = getelementptr inbounds i8, i8* %39, i32 1
store i8* %40, i8** %4
br label %41
41: ; preds = %38, %33
%42 = load i8*, i8** %4
%43 = load i8*, i8** %4
%44 = call i32 @strlen(i8* %43)
%45 = call i32 @stripstr(i8* %42, i32 %44)
%46 = load i8*, i8** %4
%47 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %46)
%48 = load i8*, i8** %4
%49 = call i8* @clonestr(i8* %48)
store i8* %49, i8** %3
br label %50
50: ; preds = %41, %32
%51 = load i8*, i8** %3
ret i8* %51
}

LLVM IR (-O2):
@.str = [6 x i8] c"[%s]\0A\00"
define i8* @parse_conf_line(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
switch i8 %6, label %9 [
i8 0, label %15
i8 61, label %7
]
7: ; preds = %2
%8 = getelementptr inbounds i8, i8* %5, i64 1
br label %9
9: ; preds = %2, %7
%10 = phi i8* [ %8, %7 ], [ %5, %2 ]
%11 = tail call i32 @strlen(i8* %10)
%12 = tail call i32 @stripstr(i8* %10, i32 %11)
%13 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %10)
%14 = tail call i8* @clonestr(i8* %10)
br label %15
15: ; preds = %2, %9
%16 = phi i8* [ %14, %9 ], [ null, %2 ]
ret i8* %16
}