#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 */
typedef int /*<<< orphan*/ line;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ ReplaceQuotes(char *, char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ oldParseOneLine(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ stderr;
char *strchr(char *, char);
int /*<<< orphan*/ strncmp(char *, char *, int);
int /*<<< orphan*/ write_auth_entries(int /*<<< orphan*/ *);
void ConvertConf(FILE *file, FILE *out) {
  char line[512];
  char quotedLine[512];
  char *p;
  while (fgets(line, sizeof(line), file)) {
    if ((p = strchr(line, '\n')))
      *p = '\0';
    ReplaceQuotes(quotedLine, line);
    if (!*quotedLine || quotedLine[0] == '#' || quotedLine[0] == '\n' ||
        quotedLine[0] == ' ' || quotedLine[0] == '\t')
      continue;
    if (quotedLine[0] == '.') {
      char *filename;
      char *back;
      if (!strncmp(quotedLine + 1, "include ", 8)) {
        if ((filename = strchr(quotedLine + 8, '"')))
          filename++;
        else {
          fprintf(stderr, "Bad config line: %s", quotedLine);
          continue;
        }
        if ((back = strchr(filename, '"')))
          *back = '\0';
        else {
          fprintf(stderr, "Bad config line: %s", quotedLine);
          continue;
        }
      }
    }
    if (quotedLine[1] == ':')
      oldParseOneLine(out, quotedLine);
  }
  fclose(file);
  write_auth_entries(out);
  fclose(out);
}


x86 assembly (clang, -O0):
<ConvertConf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x200,%esi
call   1070 <fgets@plt>
cmp    $0x0,%rax
je     1357 <ConvertConf+0x1d7>
lea    -0x210(%rbp),%rdi
mov    $0xa,%esi
call   1050 <strchr@plt>
mov    %rax,-0x418(%rbp)
cmp    $0x0,%rax
je     11de <ConvertConf+0x5e>
mov    -0x418(%rbp),%rax
movb   $0x0,(%rax)
lea    -0x410(%rbp),%rdi
lea    -0x210(%rbp),%rsi
call   1090 <ReplaceQuotes@plt>
cmpb   $0x0,-0x410(%rbp)
je     123e <ConvertConf+0xbe>
movsbl -0x410(%rbp),%eax
cmp    $0x23,%eax
je     123e <ConvertConf+0xbe>
movsbl -0x410(%rbp),%eax
cmp    $0xa,%eax
je     123e <ConvertConf+0xbe>
movsbl -0x410(%rbp),%eax
cmp    $0x20,%eax
je     123e <ConvertConf+0xbe>
movsbl -0x410(%rbp),%eax
cmp    $0x9,%eax
jne    1243 <ConvertConf+0xc3>
jmp    1193 <ConvertConf+0x13>
movsbl -0x410(%rbp),%eax
cmp    $0x2e,%eax
jne    1332 <ConvertConf+0x1b2>
lea    -0x410(%rbp),%rdi
add    $0x1,%rdi
lea    0xd9b(%rip),%rsi
mov    $0x8,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    132d <ConvertConf+0x1ad>
lea    -0x410(%rbp),%rdi
add    $0x8,%rdi
mov    $0x22,%esi
call   1050 <strchr@plt>
mov    %rax,-0x420(%rbp)
cmp    $0x0,%rax
je     12b5 <ConvertConf+0x135>
mov    -0x420(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x420(%rbp)
jmp    12d6 <ConvertConf+0x156>
mov    0x2d24(%rip),%rax
mov    (%rax),%edi
lea    -0x410(%rbp),%rdx
lea    0xd3d(%rip),%rsi
call   1080 <fprintf@plt>
jmp    1193 <ConvertConf+0x13>
mov    -0x420(%rbp),%rdi
mov    $0x22,%esi
call   1050 <strchr@plt>
mov    %rax,-0x428(%rbp)
cmp    $0x0,%rax
je     1307 <ConvertConf+0x187>
mov    -0x428(%rbp),%rax
movb   $0x0,(%rax)
jmp    1328 <ConvertConf+0x1a8>
mov    0x2cd2(%rip),%rax
mov    (%rax),%edi
lea    -0x410(%rbp),%rdx
lea    0xceb(%rip),%rsi
call   1080 <fprintf@plt>
jmp    1193 <ConvertConf+0x13>
jmp    132d <ConvertConf+0x1ad>
jmp    1332 <ConvertConf+0x1b2>
movsbl -0x40f(%rbp),%eax
cmp    $0x3a,%eax
jne    1352 <ConvertConf+0x1d2>
mov    -0x10(%rbp),%rdi
lea    -0x410(%rbp),%rsi
call   10a0 <oldParseOneLine@plt>
jmp    1193 <ConvertConf+0x13>
mov    -0x8(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x10(%rbp),%rdi
call   1060 <write_auth_entries@plt>
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConvertConf>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x408,%rsp
mov    %rsi,%r14
mov    %rdi,%r13
lea    0x200(%rsp),%rdi
mov    $0x200,%esi
mov    %r13,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     12ab <ConvertConf+0x12b>
lea    0x200(%rsp),%rbx
mov    %rsp,%rbp
movabs $0x900000601,%r15
lea    0xe2f(%rip),%r12
jmp    1209 <ConvertConf+0x89>
mov    0x2e06(%rip),%rax
mov    (%rax),%edi
lea    0xe26(%rip),%rsi
mov    %rbp,%rdx
call   1080 <fprintf@plt>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x200,%esi
mov    %r13,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     12ab <ConvertConf+0x12b>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1050 <strchr@plt>
test   %rax,%rax
je     121e <ConvertConf+0x9e>
movb   $0x0,(%rax)
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1090 <ReplaceQuotes@plt>
movzbl (%rsp),%eax
cmp    $0x2e,%rax
ja     1255 <ConvertConf+0xd5>
bt     %rax,%r15
jb     11f0 <ConvertConf+0x70>
cmp    $0x2e,%rax
jne    1255 <ConvertConf+0xd5>
lea    0x1(%rsp),%rdi
mov    %r12,%rsi
mov    $0x8,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     1269 <ConvertConf+0xe9>
cmpb   $0x3a,0x1(%rsp)
jne    11f0 <ConvertConf+0x70>
mov    %r14,%rdi
mov    %rbp,%rsi
call   10a0 <oldParseOneLine@plt>
jmp    11f0 <ConvertConf+0x70>
lea    0x8(%rsp),%rdi
mov    $0x22,%esi
call   1050 <strchr@plt>
test   %rax,%rax
je     11d3 <ConvertConf+0x53>
add    $0x1,%rax
mov    %rax,%rdi
mov    $0x22,%esi
call   1050 <strchr@plt>
test   %rax,%rax
je     11d3 <ConvertConf+0x53>
movb   $0x0,(%rax)
cmpb   $0x3a,0x1(%rsp)
jne    11f0 <ConvertConf+0x70>
jmp    125c <ConvertConf+0xdc>
mov    %r13,%rdi
call   1040 <fclose@plt>
mov    %r14,%rdi
call   1060 <write_auth_entries@plt>
mov    %r14,%rdi
call   1040 <fclose@plt>
add    $0x408,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"include \00"
@stderr = global i32 0
@.str.1 = [20 x i8] c"Bad config line: %s\00"
define void @ConvertConf(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [512 x i8]
%6 = alloca [512 x i8]
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
store i32* %0, i32** %3
store i32* %1, i32** %4
br label %10
10: ; preds = %92, %77, %67, %48, %2
%11 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%12 = load i32*, i32** %3
%13 = call i64 @fgets(i8* %11, i32 512, i32* %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %93
15: ; preds = %10
%16 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%17 = call i8* @strchr(i8* %16, i8 signext 10)
store i8* %17, i8** %7
%18 = icmp ne i8* %17, null
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = load i8*, i8** %7
store i8 0, i8* %20
br label %21
21: ; preds = %19, %15
%22 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%23 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%24 = call i32 @ReplaceQuotes(i8* %22, i8* %23)
%25 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%26 = load i8, i8* %25
%27 = icmp ne i8 %26, 0
br i1 %27, label %28, label %48
28: ; preds = %21
%29 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = icmp eq i32 %31, 35
br i1 %32, label %48, label %33
33: ; preds = %28
%34 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = icmp eq i32 %36, 10
br i1 %37, label %48, label %38
38: ; preds = %33
%39 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = icmp eq i32 %41, 32
br i1 %42, label %48, label %43
43: ; preds = %38
%44 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%45 = load i8, i8* %44
%46 = sext i8 %45 to i32
%47 = icmp eq i32 %46, 9
br i1 %47, label %48, label %49
48: ; preds = %43, %38, %33, %28, %21
br label %10
49: ; preds = %43
%50 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%51 = load i8, i8* %50
%52 = sext i8 %51 to i32
%53 = icmp eq i32 %52, 46
br i1 %53, label %54, label %83
54: ; preds = %49
%55 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%56 = getelementptr inbounds i8, i8* %55, i64 1
%57 = call i32 @strncmp(i8* %56, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 8)
%58 = icmp ne i32 %57, 0
br i1 %58, label %82, label %59
59: ; preds = %54
%60 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%61 = getelementptr inbounds i8, i8* %60, i64 8
%62 = call i8* @strchr(i8* %61, i8 signext 34)
store i8* %62, i8** %8
%63 = icmp ne i8* %62, null
br i1 %63, label %64, label %67
64: ; preds = %59
%65 = load i8*, i8** %8
%66 = getelementptr inbounds i8, i8* %65, i32 1
store i8* %66, i8** %8
br label %71
67: ; preds = %59
%68 = load i32, i32* @stderr
%69 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%70 = call i32 @fprintf(i32 %68, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %69)
br label %10
71: ; preds = %64
%72 = load i8*, i8** %8
%73 = call i8* @strchr(i8* %72, i8 signext 34)
store i8* %73, i8** %9
%74 = icmp ne i8* %73, null
br i1 %74, label %75, label %77
75: ; preds = %71
%76 = load i8*, i8** %9
store i8 0, i8* %76
br label %81
77: ; preds = %71
%78 = load i32, i32* @stderr
%79 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%80 = call i32 @fprintf(i32 %78, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %79)
br label %10
81: ; preds = %75
br label %82
82: ; preds = %81, %54
br label %83
83: ; preds = %82, %49
%84 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 1
%85 = load i8, i8* %84
%86 = sext i8 %85 to i32
%87 = icmp eq i32 %86, 58
br i1 %87, label %88, label %92
88: ; preds = %83
%89 = load i32*, i32** %4
%90 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%91 = call i32 @oldParseOneLine(i32* %89, i8* %90)
br label %92
92: ; preds = %88, %83
br label %10
93: ; preds = %10
%94 = load i32*, i32** %3
%95 = call i32 @fclose(i32* %94)
%96 = load i32*, i32** %4
%97 = call i32 @write_auth_entries(i32* %96)
%98 = load i32*, i32** %4
%99 = call i32 @fclose(i32* %98)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"include \00"
@stderr = global i32 0
@.str.1 = [20 x i8] c"Bad config line: %s\00"
define void @ConvertConf(i32* nocapture %0, i32* %1) {
%3 = alloca [512 x i8]
%4 = alloca [512 x i8]
%5 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%7 = call i64 @fgets(i8* %5, i32 512, i32* %0)
%8 = icmp eq i64 %7, 0
br i1 %8, label %44, label %9
9: ; preds = %2
%10 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 1
%11 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 8
br label %12
12: ; preds = %9, %41
%13 = call i8* @strchr(i8* %5, i8 signext 10)
%14 = icmp eq i8* %13, null
br i1 %14, label %16, label %15
15: ; preds = %12
store i8 0, i8* %13
br label %16
16: ; preds = %15, %12
%17 = call i32 @ReplaceQuotes(i8* %6, i8* %5)
%18 = load i8, i8* %6
switch i8 %18, label %36 [
i8 35, label %41
i8 32, label %41
i8 10, label %41
i8 9, label %41
i8 0, label %41
i8 46, label %19
]
19: ; preds = %16
%20 = call i32 @strncmp(i8* %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 8)
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %36
22: ; preds = %19
%23 = call i8* @strchr(i8* %11, i8 signext 34)
%24 = icmp eq i8* %23, null
br i1 %24, label %29, label %25
25: ; preds = %22
%26 = getelementptr inbounds i8, i8* %23, i64 1
%27 = call i8* @strchr(i8* %26, i8 signext 34)
%28 = icmp eq i8* %27, null
br i1 %28, label %33, label %32
29: ; preds = %22
%30 = load i32, i32* @stderr
%31 = call i32 @fprintf(i32 %30, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %6)
br label %41
32: ; preds = %25
store i8 0, i8* %27
br label %36
33: ; preds = %25
%34 = load i32, i32* @stderr
%35 = call i32 @fprintf(i32 %34, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %6)
br label %41
36: ; preds = %19, %32, %16
%37 = load i8, i8* %10
%38 = icmp eq i8 %37, 58
br i1 %38, label %39, label %41
39: ; preds = %36
%40 = call i32 @oldParseOneLine(i32* %1, i8* %6)
br label %41
41: ; preds = %36, %39, %29, %33, %16, %16, %16, %16, %16
%42 = call i64 @fgets(i8* %5, i32 512, i32* %0)
%43 = icmp eq i64 %42, 0
br i1 %43, label %44, label %12
44: ; preds = %41, %2
%45 = call i32 @fclose(i32* %0)
%46 = call i32 @write_auth_entries(i32* %1)
%47 = call i32 @fclose(i32* %1)
ret void
}