#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*/ parse(int /*<<< orphan*/ *, int /*<<< orphan*/ *, char *);
char *strchr(char *, char);
void ConvertConf(FILE *file, FILE *outkline, FILE *outdline) {
  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[1] == ':') {
      parse(outkline, outdline, quotedLine);
    }
  }
  fclose(file);
}


x86 assembly (clang, -O0):
<ConvertConf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x220(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x200,%esi
call   1050 <fgets@plt>
cmp    $0x0,%rax
je     1240 <ConvertConf+0xf0>
lea    -0x220(%rbp),%rdi
mov    $0xa,%esi
call   1040 <strchr@plt>
mov    %rax,-0x428(%rbp)
cmp    $0x0,%rax
je     11b2 <ConvertConf+0x62>
mov    -0x428(%rbp),%rax
movb   $0x0,(%rax)
lea    -0x420(%rbp),%rdi
lea    -0x220(%rbp),%rsi
call   1060 <ReplaceQuotes@plt>
cmpb   $0x0,-0x420(%rbp)
je     1212 <ConvertConf+0xc2>
movsbl -0x420(%rbp),%eax
cmp    $0x23,%eax
je     1212 <ConvertConf+0xc2>
movsbl -0x420(%rbp),%eax
cmp    $0xa,%eax
je     1212 <ConvertConf+0xc2>
movsbl -0x420(%rbp),%eax
cmp    $0x20,%eax
je     1212 <ConvertConf+0xc2>
movsbl -0x420(%rbp),%eax
cmp    $0x9,%eax
jne    1217 <ConvertConf+0xc7>
jmp    1167 <ConvertConf+0x17>
movsbl -0x41f(%rbp),%eax
cmp    $0x3a,%eax
jne    123b <ConvertConf+0xeb>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x420(%rbp),%rdx
call   1070 <parse@plt>
jmp    1167 <ConvertConf+0x17>
mov    -0x8(%rbp),%rdi
call   1030 <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    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
lea    0x200(%rsp),%rdi
mov    $0x200,%esi
mov    %r12,%rdx
call   1050 <fgets@plt>
test   %rax,%rax
je     11fc <ConvertConf+0xac>
lea    0x200(%rsp),%rbx
mov    %rsp,%r13
movabs $0x900000601,%rbp
jmp    11b5 <ConvertConf+0x65>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x200,%esi
mov    %r12,%rdx
call   1050 <fgets@plt>
test   %rax,%rax
je     11fc <ConvertConf+0xac>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     11ca <ConvertConf+0x7a>
movb   $0x0,(%rax)
mov    %r13,%rdi
mov    %rbx,%rsi
call   1060 <ReplaceQuotes@plt>
movzbl (%rsp),%eax
cmp    $0x23,%rax
ja     11e5 <ConvertConf+0x95>
bt     %rax,%rbp
jb     11a0 <ConvertConf+0x50>
cmpb   $0x3a,0x1(%rsp)
jne    11a0 <ConvertConf+0x50>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %r13,%rdx
call   1070 <parse@plt>
jmp    11a0 <ConvertConf+0x50>
mov    %r12,%rdi
call   1030 <fclose@plt>
add    $0x408,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @ConvertConf(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca [512 x i8]
%8 = alloca [512 x i8]
%9 = alloca i8*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
br label %10
10: ; preds = %59, %48, %3
%11 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%12 = load i32*, i32** %4
%13 = call i64 @fgets(i8* %11, i32 512, i32* %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %60
15: ; preds = %10
%16 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%17 = call i8* @strchr(i8* %16, i8 signext 10)
store i8* %17, i8** %9
%18 = icmp ne i8* %17, null
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = load i8*, i8** %9
store i8 0, i8* %20
br label %21
21: ; preds = %19, %15
%22 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%23 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%24 = call i32 @ReplaceQuotes(i8* %22, i8* %23)
%25 = getelementptr inbounds [512 x i8], [512 x i8]* %8, 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]* %8, 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]* %8, 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]* %8, 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]* %8, 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]* %8, i64 0, i64 1
%51 = load i8, i8* %50
%52 = sext i8 %51 to i32
%53 = icmp eq i32 %52, 58
br i1 %53, label %54, label %59
54: ; preds = %49
%55 = load i32*, i32** %5
%56 = load i32*, i32** %6
%57 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%58 = call i32 @parse(i32* %55, i32* %56, i8* %57)
br label %59
59: ; preds = %54, %49
br label %10
60: ; preds = %10
%61 = load i32*, i32** %4
%62 = call i32 @fclose(i32* %61)
ret void
}

LLVM IR (-O2):
define void @ConvertConf(i32* nocapture %0, i32* %1, i32* %2) {
%4 = alloca [512 x i8]
%5 = alloca [512 x i8]
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%7 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%8 = call i64 @fgets(i8* %6, i32 512, i32* %0)
%9 = icmp eq i64 %8, 0
br i1 %9, label %27, label %10
10: ; preds = %3
%11 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 1
br label %12
12: ; preds = %10, %24
%13 = call i8* @strchr(i8* %6, 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* %7, i8* %6)
%18 = load i8, i8* %7
switch i8 %18, label %19 [
i8 35, label %24
i8 32, label %24
i8 10, label %24
i8 9, label %24
i8 0, label %24
]
19: ; preds = %16
%20 = load i8, i8* %11
%21 = icmp eq i8 %20, 58
br i1 %21, label %22, label %24
22: ; preds = %19
%23 = call i32 @parse(i32* %1, i32* %2, i8* %7)
br label %24
24: ; preds = %19, %22, %16, %16, %16, %16, %16
%25 = call i64 @fgets(i8* %6, i32 512, i32* %0)
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %12
27: ; preds = %24, %3
%28 = call i32 @fclose(i32* %0)
ret void
}