#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*/ parse(char *, char *);
int main(void) {
  parse("empty string", "");
  parse("basic", "[section]\nfoo = bar\nbazz = buzz quxx");
  parse("crlf", "[section]\r\nhello = world\r\nforty_two = 42\r\n");
  parse("long line", "[sec]\nfoo = 01234567890123456789\nbar=4321\n");
  parse("long continued", "[sec]\nfoo = 0123456789012bix=1234\n");
  parse("error", "[s]\na=1\nb\nc=3");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    0xf3a(%rip),%rsi
call   1030 <parse@plt>
lea    0xed4(%rip),%rdi
lea    0xed3(%rip),%rsi
call   1030 <parse@plt>
lea    0xeec(%rip),%rdi
lea    0xeea(%rip),%rsi
call   1030 <parse@plt>
lea    0xf09(%rip),%rdi
lea    0xf0c(%rip),%rsi
call   1030 <parse@plt>
lea    0xf2b(%rip),%rdi
lea    0xf33(%rip),%rsi
call   1030 <parse@plt>
lea    0xf4a(%rip),%rdi
lea    0xf49(%rip),%rsi
call   1030 <parse@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xf48(%rip),%rsi
call   1030 <parse@plt>
lea    0xee2(%rip),%rdi
lea    0xee1(%rip),%rsi
call   1030 <parse@plt>
lea    0xefa(%rip),%rdi
lea    0xef8(%rip),%rsi
call   1030 <parse@plt>
lea    0xf17(%rip),%rdi
lea    0xf1a(%rip),%rsi
call   1030 <parse@plt>
lea    0xf39(%rip),%rdi
lea    0xf41(%rip),%rsi
call   1030 <parse@plt>
lea    0xf58(%rip),%rdi
lea    0xf57(%rip),%rsi
call   1030 <parse@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"empty string\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [6 x i8] c"basic\00"
@.str.3 = [37 x i8] c"[section]\0Afoo = bar\0Abazz = buzz quxx\00"
@.str.4 = [5 x i8] c"crlf\00"
@.str.5 = [43 x i8] c"[section]\0D\0Ahello = world\0D\0Aforty_two = 42\0D\0A\00"
@.str.6 = [10 x i8] c"long line\00"
@.str.7 = [43 x i8] c"[sec]\0Afoo = 01234567890123456789\0Abar=4321\0A\00"
@.str.8 = [15 x i8] c"long continued\00"
@.str.9 = [35 x i8] c"[sec]\0Afoo = 0123456789012bix=1234\0A\00"
@.str.10 = [6 x i8] c"error\00"
@.str.11 = [14 x i8] c"[s]\0Aa=1\0Ab\0Ac=3\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @parse(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @parse(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0))
%4 = call i32 @parse(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0))
%5 = call i32 @parse(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.7, i64 0, i64 0))
%6 = call i32 @parse(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.9, i64 0, i64 0))
%7 = call i32 @parse(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.11, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"empty string\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [6 x i8] c"basic\00"
@.str.3 = [37 x i8] c"[section]\0Afoo = bar\0Abazz = buzz quxx\00"
@.str.4 = [5 x i8] c"crlf\00"
@.str.5 = [43 x i8] c"[section]\0D\0Ahello = world\0D\0Aforty_two = 42\0D\0A\00"
@.str.6 = [10 x i8] c"long line\00"
@.str.7 = [43 x i8] c"[sec]\0Afoo = 01234567890123456789\0Abar=4321\0A\00"
@.str.8 = [15 x i8] c"long continued\00"
@.str.9 = [35 x i8] c"[sec]\0Afoo = 0123456789012bix=1234\0A\00"
@.str.10 = [6 x i8] c"error\00"
@.str.11 = [14 x i8] c"[s]\0Aa=1\0Ab\0Ac=3\00"
define i32 @main() {
%1 = tail call i32 @parse(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @parse(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0))
%3 = tail call i32 @parse(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0))
%4 = tail call i32 @parse(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.7, i64 0, i64 0))
%5 = tail call i32 @parse(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.9, i64 0, i64 0))
%6 = tail call i32 @parse(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.11, i64 0, i64 0))
ret i32 0
}