#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*/ conf_set(int, char *, char *, char *, int /*<<< orphan*/,
                            int /*<<< orphan*/);
int /*<<< orphan*/ free(char *);
char *malloc(int);
size_t strcspn(char *, char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int strspn(char *, char *);
int /*<<< orphan*/ warnx(char *, int);
void conf_parse_line(int trans, char *line, size_t sz) {
  char *cp = line;
  int i;
  static char *section = 0;
  static int ln = 0;
  ln++;
  if (*line == '#' || *line == ';')
    return;
  if (*line == '[') {
    for (i = 1; i < sz; i++)
      if (line[i] == ']')
        break;
    if (i == sz) {
      warnx("conf_parse_line: %d:"
            "non-matched ']', ignoring until next section",
            ln);
      section = 0;
      return;
    }
    if (section)
      free(section);
    section = malloc(i);
    strncpy(section, line + 1, i - 1);
    section[i - 1] = '\0';
    return;
  }
  for (i = 0; i < sz; i++)
    if (cp[i] == '=') {
      if (!section) {
        warnx("conf_parse_line: %d: ignoring line due to no section", ln);
        return;
      }
      line[strcspn(line, " \t=")] = '\0';
      conf_set(trans, section, line, line + i + 1 + strspn(line + i + 1, " \t"),
               0, 0);
      return;
    }
  i = strspn(line, " \t");
  if (line[i])
    warnx("conf_parse_line: %d: syntax error", ln);
  return;
}


x86 assembly (clang, -O0):
<conf_parse_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    0x2ed7(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ece(%rip)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
je     11ba <conf_parse_line+0x4a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3b,%eax
jne    11bf <conf_parse_line+0x4f>
jmp    13c9 <conf_parse_line+0x259>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5b,%eax
jne    129d <conf_parse_line+0x12d>
movl   $0x1,-0x24(%rbp)
movslq -0x24(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1211 <conf_parse_line+0xa1>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5d,%eax
jne    11fe <conf_parse_line+0x8e>
jmp    1211 <conf_parse_line+0xa1>
jmp    1203 <conf_parse_line+0x93>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11d6 <conf_parse_line+0x66>
movslq -0x24(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    1241 <conf_parse_line+0xd1>
mov    0x2e43(%rip),%esi
lea    0xdd4(%rip),%rdi
call   1060 <warnx@plt>
movq   $0x0,0x2e24(%rip)
jmp    13c9 <conf_parse_line+0x259>
cmpq   $0x0,0x2e17(%rip)
je     125b <conf_parse_line+0xeb>
mov    0x2e0a(%rip),%rdi
call   1030 <free@plt>
mov    -0x24(%rbp),%edi
call   1090 <malloc@plt>
mov    %rax,0x2df6(%rip)
mov    0x2def(%rip),%rdi
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
mov    -0x24(%rbp),%edx
sub    $0x1,%edx
call   1040 <strncpy@plt>
mov    0x2dd5(%rip),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    13c9 <conf_parse_line+0x259>
movl   $0x0,-0x24(%rbp)
movslq -0x24(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    138d <conf_parse_line+0x21d>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3d,%eax
jne    137a <conf_parse_line+0x20a>
cmpq   $0x0,0x2d91(%rip)
jne    12ec <conf_parse_line+0x17c>
mov    0x2d8d(%rip),%esi
lea    0xd5f(%rip),%rdi
call   1060 <warnx@plt>
jmp    13c9 <conf_parse_line+0x259>
mov    -0x10(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xd77(%rip),%rsi
call   1080 <strcspn@plt>
mov    %rax,%rcx
mov    -0x50(%rbp),%rax
movb   $0x0,(%rax,%rcx,1)
mov    -0x4(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    0x2d44(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
add    %rcx,%rax
add    $0x1,%rax
mov    %rax,-0x48(%rbp)
mov    -0x10(%rbp),%rdi
movslq -0x24(%rbp),%rax
add    %rax,%rdi
add    $0x1,%rdi
lea    0xd29(%rip),%rsi
call   1070 <strspn@plt>
mov    -0x48(%rbp),%rcx
mov    -0x3c(%rbp),%edi
mov    -0x38(%rbp),%rsi
mov    -0x30(%rbp),%rdx
cltq
add    %rax,%rcx
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1050 <conf_set@plt>
jmp    13c9 <conf_parse_line+0x259>
jmp    137f <conf_parse_line+0x20f>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    12a4 <conf_parse_line+0x134>
mov    -0x10(%rbp),%rdi
lea    0xce2(%rip),%rsi
call   1070 <strspn@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     13c4 <conf_parse_line+0x254>
mov    0x2cb0(%rip),%esi
lea    0xcbe(%rip),%rdi
call   1060 <warnx@plt>
jmp    13c9 <conf_parse_line+0x259>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conf_parse_line>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    0x2ee9(%rip),%r15d
add    $0x1,%r15d
mov    %r15d,0x2ede(%rip)
mov    (%rsi),%al
cmp    $0x23,%al
je     12f3 <conf_parse_line+0x183>
cmp    $0x3b,%al
je     12f3 <conf_parse_line+0x183>
mov    %rsi,%rbx
cmp    $0x5b,%al
jne    11f8 <conf_parse_line+0x88>
mov    $0x1,%ebp
cmp    $0x2,%rdx
jb     11d2 <conf_parse_line+0x62>
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmpb   $0x5d,(%rbx,%rbp,1)
je     11d2 <conf_parse_line+0x62>
add    $0x1,%rbp
cmp    %rbp,%rdx
jne    11c0 <conf_parse_line+0x50>
mov    %rdx,%rbp
mov    %ebp,%eax
cmp    %rdx,%rax
jne    120d <conf_parse_line+0x9d>
lea    0xe20(%rip),%rdi
mov    %r15d,%esi
call   1060 <warnx@plt>
movq   $0x0,0x2e6d(%rip)
jmp    12f3 <conf_parse_line+0x183>
test   %rdx,%rdx
je     12d3 <conf_parse_line+0x163>
mov    %edi,%r14d
cmp    $0x3d,%al
jne    1253 <conf_parse_line+0xe3>
xor    %r12d,%r12d
jmp    1276 <conf_parse_line+0x106>
mov    0x2e4c(%rip),%rdi
test   %rdi,%rdi
je     121e <conf_parse_line+0xae>
call   1030 <free@plt>
mov    %ebp,%edi
call   1090 <malloc@plt>
mov    %rax,0x2e34(%rip)
add    $0x1,%rbx
movslq %ebp,%rbp
lea    -0x1(%rbp),%rdx
mov    %rax,%rdi
mov    %rbx,%rsi
call   1040 <strncpy@plt>
mov    0x2e17(%rip),%rax
movb   $0x0,-0x1(%rax,%rbp,1)
jmp    12f3 <conf_parse_line+0x183>
add    $0xffffffffffffffff,%rdx
xor    %eax,%eax
nopl   0x0(%rax)
cmp    %rax,%rdx
je     12d3 <conf_parse_line+0x163>
lea    0x1(%rax),%rcx
cmpb   $0x3d,0x1(%rbx,%rax,1)
mov    %rcx,%rax
jne    1260 <conf_parse_line+0xf0>
mov    %ecx,%r12d
mov    0x2de3(%rip),%rbp
test   %rbp,%rbp
je     12fc <conf_parse_line+0x18c>
lea    (%rbx,%r12,1),%r15
lea    0xde9(%rip),%rsi
mov    %rbx,%rdi
call   1080 <strcspn@plt>
movb   $0x0,(%rbx,%rax,1)
lea    (%rbx,%r12,1),%rdi
add    $0x1,%rdi
lea    0xdd2(%rip),%rsi
call   1070 <strspn@plt>
cltq
lea    (%rax,%r15,1),%rcx
add    $0x1,%rcx
mov    %r14d,%edi
mov    %rbp,%rsi
mov    %rbx,%rdx
xor    %r8d,%r8d
xor    %r9d,%r9d
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <conf_set@plt>
lea    0xda0(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strspn@plt>
cltq
cmpb   $0x0,(%rbx,%rax,1)
je     12f3 <conf_parse_line+0x183>
lea    0xd8c(%rip),%rdi
jmp    1303 <conf_parse_line+0x193>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd3e(%rip),%rdi
mov    %r15d,%esi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <warnx@plt>

LLVM IR (-O0):
@conf_parse_line.section = internal global i8* null
@conf_parse_line.ln = internal global i32 0
@.str = [65 x i8] c"conf_parse_line: %d:non-matched ']', ignoring until next section\00"
@.str.1 = [53 x i8] c"conf_parse_line: %d: ignoring line due to no section\00"
@.str.2 = [4 x i8] c" \09=\00"
@.str.3 = [3 x i8] c" \09\00"
@.str.4 = [34 x i8] c"conf_parse_line: %d: syntax error\00"
define void @conf_parse_line(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%9 = load i8*, i8** %5
store i8* %9, i8** %7
%10 = load i32, i32* @conf_parse_line.ln
%11 = add nsw i32 %10, 1
store i32 %11, i32* @conf_parse_line.ln
%12 = load i8*, i8** %5
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 35
br i1 %15, label %21, label %16
16: ; preds = %3
%17 = load i8*, i8** %5
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 59
br i1 %20, label %21, label %22
21: ; preds = %16, %3
br label %133
22: ; preds = %16
%23 = load i8*, i8** %5
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 91
br i1 %26, label %27, label %74
27: ; preds = %22
store i32 1, i32* %8
br label %28
28: ; preds = %43, %27
%29 = load i32, i32* %8
%30 = sext i32 %29 to i64
%31 = load i64, i64* %6
%32 = icmp ult i64 %30, %31
br i1 %32, label %33, label %46
33: ; preds = %28
%34 = load i8*, i8** %5
%35 = load i32, i32* %8
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i8, i8* %34, i64 %36
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = icmp eq i32 %39, 93
br i1 %40, label %41, label %42
41: ; preds = %33
br label %46
42: ; preds = %33
br label %43
43: ; preds = %42
%44 = load i32, i32* %8
%45 = add nsw i32 %44, 1
store i32 %45, i32* %8
br label %28
46: ; preds = %41, %28
%47 = load i32, i32* %8
%48 = sext i32 %47 to i64
%49 = load i64, i64* %6
%50 = icmp eq i64 %48, %49
br i1 %50, label %51, label %54
51: ; preds = %46
%52 = load i32, i32* @conf_parse_line.ln
%53 = call i32 @warnx(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i32 %52)
store i8* null, i8** @conf_parse_line.section
br label %133
54: ; preds = %46
%55 = load i8*, i8** @conf_parse_line.section
%56 = icmp ne i8* %55, null
br i1 %56, label %57, label %60
57: ; preds = %54
%58 = load i8*, i8** @conf_parse_line.section
%59 = call i32 @free(i8* %58)
br label %60
60: ; preds = %57, %54
%61 = load i32, i32* %8
%62 = call i8* @malloc(i32 %61)
store i8* %62, i8** @conf_parse_line.section
%63 = load i8*, i8** @conf_parse_line.section
%64 = load i8*, i8** %5
%65 = getelementptr inbounds i8, i8* %64, i64 1
%66 = load i32, i32* %8
%67 = sub nsw i32 %66, 1
%68 = call i32 @strncpy(i8* %63, i8* %65, i32 %67)
%69 = load i8*, i8** @conf_parse_line.section
%70 = load i32, i32* %8
%71 = sub nsw i32 %70, 1
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds i8, i8* %69, i64 %72
store i8 0, i8* %73
br label %133
74: ; preds = %22
store i32 0, i32* %8
br label %75
75: ; preds = %117, %74
%76 = load i32, i32* %8
%77 = sext i32 %76 to i64
%78 = load i64, i64* %6
%79 = icmp ult i64 %77, %78
br i1 %79, label %80, label %120
80: ; preds = %75
%81 = load i8*, i8** %7
%82 = load i32, i32* %8
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds i8, i8* %81, i64 %83
%85 = load i8, i8* %84
%86 = sext i8 %85 to i32
%87 = icmp eq i32 %86, 61
br i1 %87, label %88, label %116
88: ; preds = %80
%89 = load i8*, i8** @conf_parse_line.section
%90 = icmp ne i8* %89, null
br i1 %90, label %94, label %91
91: ; preds = %88
%92 = load i32, i32* @conf_parse_line.ln
%93 = call i32 @warnx(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0), i32 %92)
br label %133
94: ; preds = %88
%95 = load i8*, i8** %5
%96 = load i8*, i8** %5
%97 = call i64 @strcspn(i8* %96, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%98 = getelementptr inbounds i8, i8* %95, i64 %97
store i8 0, i8* %98
%99 = load i32, i32* %4
%100 = load i8*, i8** @conf_parse_line.section
%101 = load i8*, i8** %5
%102 = load i8*, i8** %5
%103 = load i32, i32* %8
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds i8, i8* %102, i64 %104
%106 = getelementptr inbounds i8, i8* %105, i64 1
%107 = load i8*, i8** %5
%108 = load i32, i32* %8
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds i8, i8* %107, i64 %109
%111 = getelementptr inbounds i8, i8* %110, i64 1
%112 = call i32 @strspn(i8* %111, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds i8, i8* %106, i64 %113
%115 = call i32 @conf_set(i32 %99, i8* %100, i8* %101, i8* %114, i32 0, i32 0)
br label %133
116: ; preds = %80
br label %117
117: ; preds = %116
%118 = load i32, i32* %8
%119 = add nsw i32 %118, 1
store i32 %119, i32* %8
br label %75
120: ; preds = %75
%121 = load i8*, i8** %5
%122 = call i32 @strspn(i8* %121, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i32 %122, i32* %8
%123 = load i8*, i8** %5
%124 = load i32, i32* %8
%125 = sext i32 %124 to i64
%126 = getelementptr inbounds i8, i8* %123, i64 %125
%127 = load i8, i8* %126
%128 = icmp ne i8 %127, 0
br i1 %128, label %129, label %132
129: ; preds = %120
%130 = load i32, i32* @conf_parse_line.ln
%131 = call i32 @warnx(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), i32 %130)
br label %132
132: ; preds = %129, %120
br label %133
133: ; preds = %132, %94, %91, %60, %51, %21
ret void
}

LLVM IR (-O2):
@conf_parse_line.section = internal unnamed_addr global i8* null
@conf_parse_line.ln = internal unnamed_addr global i32 0
@.str = [65 x i8] c"conf_parse_line: %d:non-matched ']', ignoring until next section\00"
@.str.1 = [53 x i8] c"conf_parse_line: %d: ignoring line due to no section\00"
@.str.2 = [4 x i8] c" \09=\00"
@.str.3 = [3 x i8] c" \09\00"
@.str.4 = [34 x i8] c"conf_parse_line: %d: syntax error\00"
define void @conf_parse_line(i32 %0, i8* %1, i64 %2) {
%4 = load i32, i32* @conf_parse_line.ln
%5 = add nsw i32 %4, 1
store i32 %5, i32* @conf_parse_line.ln
%6 = load i8, i8* %1
switch i8 %6, label %9 [
i8 35, label %76
i8 59, label %76
i8 91, label %7
]
7: ; preds = %3
%8 = icmp ugt i64 %2, 1
br i1 %8, label %13, label %24
9: ; preds = %3
%10 = icmp eq i64 %2, 0
br i1 %10, label %68, label %11
11: ; preds = %9
%12 = icmp eq i8 %6, 61
br i1 %12, label %45, label %60
13: ; preds = %7, %18
%14 = phi i64 [ %19, %18 ], [ 1, %7 ]
%15 = getelementptr inbounds i8, i8* %1, i64 %14
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 93
br i1 %17, label %21, label %18
18: ; preds = %13
%19 = add nuw i64 %14, 1
%20 = icmp eq i64 %19, %2
br i1 %20, label %21, label %13
21: ; preds = %13, %18
%22 = phi i64 [ %2, %18 ], [ %14, %13 ]
%23 = trunc i64 %22 to i32
br label %24
24: ; preds = %21, %7
%25 = phi i32 [ 1, %7 ], [ %23, %21 ]
%26 = zext i32 %25 to i64
%27 = icmp eq i64 %26, %2
br i1 %27, label %28, label %30
28: ; preds = %24
%29 = tail call i32 @warnx(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i32 %5)
store i8* null, i8** @conf_parse_line.section
br label %76
30: ; preds = %24
%31 = load i8*, i8** @conf_parse_line.section
%32 = icmp eq i8* %31, null
br i1 %32, label %35, label %33
33: ; preds = %30
%34 = tail call i32 @free(i8* %31)
br label %35
35: ; preds = %33, %30
%36 = tail call i8* @malloc(i32 %25)
store i8* %36, i8** @conf_parse_line.section
%37 = getelementptr inbounds i8, i8* %1, i64 1
%38 = add nsw i32 %25, -1
%39 = tail call i32 @strncpy(i8* %36, i8* %37, i32 %38)
%40 = load i8*, i8** @conf_parse_line.section
%41 = sext i32 %38 to i64
%42 = getelementptr inbounds i8, i8* %40, i64 %41
store i8 0, i8* %42
br label %76
43: ; preds = %64
%44 = and i64 %62, 4294967295
br label %45
45: ; preds = %43, %11
%46 = phi i64 [ %44, %43 ], [ 0, %11 ]
%47 = load i8*, i8** @conf_parse_line.section
%48 = icmp eq i8* %47, null
br i1 %48, label %49, label %51
49: ; preds = %45
%50 = tail call i32 @warnx(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0), i32 %5)
br label %76
51: ; preds = %45
%52 = getelementptr inbounds i8, i8* %1, i64 %46
%53 = tail call i64 @strcspn(i8* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%54 = getelementptr inbounds i8, i8* %1, i64 %53
store i8 0, i8* %54
%55 = getelementptr inbounds i8, i8* %52, i64 1
%56 = tail call i32 @strspn(i8* %55, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds i8, i8* %55, i64 %57
%59 = tail call i32 @conf_set(i32 %0, i8* %47, i8* %1, i8* %58, i32 0, i32 0)
br label %76
60: ; preds = %11, %64
%61 = phi i64 [ %62, %64 ], [ 0, %11 ]
%62 = add nuw i64 %61, 1
%63 = icmp eq i64 %62, %2
br i1 %63, label %68, label %64
64: ; preds = %60
%65 = getelementptr inbounds i8, i8* %1, i64 %62
%66 = load i8, i8* %65
%67 = icmp eq i8 %66, 61
br i1 %67, label %43, label %60
68: ; preds = %60, %9
%69 = tail call i32 @strspn(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds i8, i8* %1, i64 %70
%72 = load i8, i8* %71
%73 = icmp eq i8 %72, 0
br i1 %73, label %76, label %74
74: ; preds = %68
%75 = tail call i32 @warnx(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), i32 %5)
br label %76
76: ; preds = %68, %74, %3, %3, %51, %49, %35, %28
ret void
}