#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 */
struct saxs_document {
  int dummy;
};
struct line {
  int dummy;
};

/* Variables and functions */
int ENOSYS;
int saxs_reader_columns_scan(struct line const *, struct line const **,
                             struct line const **, struct line const **);
int saxs_reader_columns_parse_lines(
    struct saxs_document *doc, const struct line *firstline,
    const struct line *lastline,
    int (*parse_header)(struct saxs_document *, const struct line *,
                        const struct line *),
    int (*parse_data)(struct saxs_document *, const struct line *,
                      const struct line *),
    int (*parse_footer)(struct saxs_document *, const struct line *,
                        const struct line *)) {
  ;
  int res;
  const struct line *header = NULL, *data = NULL, *footer = NULL;
  if ((res = saxs_reader_columns_scan(firstline, &header, &data, &footer)) != 0)
    return res;
  if (!header && !data && !footer)
    return ENOSYS;
  if (parse_header && header && (res = parse_header(doc, header, data) != 0))
    return res;
  if (parse_data && data && (res = parse_data(doc, data, footer) != 0))
    return res;
  if (parse_footer && footer &&
      (res = parse_footer(doc, footer, lastline) != 0))
    return res;
  return 0;
}


x86 assembly (clang, -O0):
<saxs_reader_columns_parse_lines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
movq   $0x0,-0x48(%rbp)
movq   $0x0,-0x50(%rbp)
movq   $0x0,-0x58(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x48(%rbp),%rsi
lea    -0x50(%rbp),%rdx
lea    -0x58(%rbp),%rcx
call   1030 <saxs_reader_columns_scan@plt>
mov    %eax,-0x3c(%rbp)
cmp    $0x0,%eax
je     1174 <saxs_reader_columns_parse_lines+0x64>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    12a0 <saxs_reader_columns_parse_lines+0x190>
cmpq   $0x0,-0x48(%rbp)
jne    11a6 <saxs_reader_columns_parse_lines+0x96>
cmpq   $0x0,-0x50(%rbp)
jne    11a6 <saxs_reader_columns_parse_lines+0x96>
cmpq   $0x0,-0x58(%rbp)
jne    11a6 <saxs_reader_columns_parse_lines+0x96>
mov    0x2e4c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12a0 <saxs_reader_columns_parse_lines+0x190>
cmpq   $0x0,-0x28(%rbp)
je     11f7 <saxs_reader_columns_parse_lines+0xe7>
cmpq   $0x0,-0x48(%rbp)
je     11f7 <saxs_reader_columns_parse_lines+0xe7>
mov    -0x28(%rbp),%rax
mov    -0x10(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    -0x50(%rbp),%rdx
call   *%rax
cmp    $0x0,%eax
setne  %al
mov    %al,%cl
and    $0x1,%cl
movzbl %cl,%ecx
mov    %ecx,-0x3c(%rbp)
test   $0x1,%al
jne    11ec <saxs_reader_columns_parse_lines+0xdc>
jmp    11f7 <saxs_reader_columns_parse_lines+0xe7>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    12a0 <saxs_reader_columns_parse_lines+0x190>
cmpq   $0x0,-0x30(%rbp)
je     1248 <saxs_reader_columns_parse_lines+0x138>
cmpq   $0x0,-0x50(%rbp)
je     1248 <saxs_reader_columns_parse_lines+0x138>
mov    -0x30(%rbp),%rax
mov    -0x10(%rbp),%rdi
mov    -0x50(%rbp),%rsi
mov    -0x58(%rbp),%rdx
call   *%rax
cmp    $0x0,%eax
setne  %al
mov    %al,%cl
and    $0x1,%cl
movzbl %cl,%ecx
mov    %ecx,-0x3c(%rbp)
test   $0x1,%al
jne    123d <saxs_reader_columns_parse_lines+0x12d>
jmp    1248 <saxs_reader_columns_parse_lines+0x138>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    12a0 <saxs_reader_columns_parse_lines+0x190>
cmpq   $0x0,-0x38(%rbp)
je     1299 <saxs_reader_columns_parse_lines+0x189>
cmpq   $0x0,-0x58(%rbp)
je     1299 <saxs_reader_columns_parse_lines+0x189>
mov    -0x38(%rbp),%rax
mov    -0x10(%rbp),%rdi
mov    -0x58(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   *%rax
cmp    $0x0,%eax
setne  %al
mov    %al,%cl
and    $0x1,%cl
movzbl %cl,%ecx
mov    %ecx,-0x3c(%rbp)
test   $0x1,%al
jne    128e <saxs_reader_columns_parse_lines+0x17e>
jmp    1299 <saxs_reader_columns_parse_lines+0x189>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    12a0 <saxs_reader_columns_parse_lines+0x190>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<saxs_reader_columns_parse_lines>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x20,%rsp
mov    %r9,%r15
mov    %r8,%r13
mov    %rcx,%rbx
mov    %rdx,%r14
mov    %rsi,%rax
mov    %rdi,%r12
movq   $0x0,0x18(%rsp)
movq   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
lea    0x18(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0x8(%rsp),%rcx
mov    %rax,%rdi
call   1030 <saxs_reader_columns_scan@plt>
test   %eax,%eax
jne    11f8 <saxs_reader_columns_parse_lines+0xe8>
mov    0x18(%rsp),%rsi
mov    0x10(%rsp),%rdx
test   %rsi,%rsi
jne    1190 <saxs_reader_columns_parse_lines+0x80>
test   %rdx,%rdx
jne    1190 <saxs_reader_columns_parse_lines+0x80>
cmpq   $0x0,0x8(%rsp)
jne    1190 <saxs_reader_columns_parse_lines+0x80>
mov    0x2e5c(%rip),%rax
mov    (%rax),%eax
jmp    11f8 <saxs_reader_columns_parse_lines+0xe8>
test   %rbx,%rbx
je     11af <saxs_reader_columns_parse_lines+0x9f>
test   %rsi,%rsi
je     11af <saxs_reader_columns_parse_lines+0x9f>
mov    %r12,%rdi
call   *%rbx
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
jne    11f8 <saxs_reader_columns_parse_lines+0xe8>
mov    0x10(%rsp),%rdx
test   %r13,%r13
je     11d5 <saxs_reader_columns_parse_lines+0xc5>
test   %rdx,%rdx
je     11d5 <saxs_reader_columns_parse_lines+0xc5>
mov    0x8(%rsp),%rax
mov    %r12,%rdi
mov    %rdx,%rsi
mov    %rax,%rdx
call   *%r13
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
jne    11f8 <saxs_reader_columns_parse_lines+0xe8>
xor    %eax,%eax
test   %r15,%r15
je     11f8 <saxs_reader_columns_parse_lines+0xe8>
mov    0x8(%rsp),%rsi
test   %rsi,%rsi
je     11f8 <saxs_reader_columns_parse_lines+0xe8>
mov    %r12,%rdi
mov    %r14,%rdx
call   *%r15
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.saxs_document = type { i32 }
%struct.line = type { i32 }
@ENOSYS = global i32 0
define i32 @saxs_reader_columns_parse_lines(%struct.saxs_document* %0, %struct.line* %1, %struct.line* %2, i32 (%struct.saxs_document*, %struct.line*, %struct.line*)* %3, i32 (%struct.saxs_document*, %struct.line*, %struct.line*)* %4, i32 (%struct.saxs_document*, %struct.line*, %struct.line*)* %5) {
%7 = alloca i32
%8 = alloca %struct.saxs_document*
%9 = alloca %struct.line*
%10 = alloca %struct.line*
%11 = alloca i32 (%struct.saxs_document*, %struct.line*, %struct.line*)*
%12 = alloca i32 (%struct.saxs_document*, %struct.line*, %struct.line*)*
%13 = alloca i32 (%struct.saxs_document*, %struct.line*, %struct.line*)*
%14 = alloca i32
%15 = alloca %struct.line*
%16 = alloca %struct.line*
%17 = alloca %struct.line*
store %struct.saxs_document* %0, %struct.saxs_document** %8
store %struct.line* %1, %struct.line** %9
store %struct.line* %2, %struct.line** %10
store i32 (%struct.saxs_document*, %struct.line*, %struct.line*)* %3, i32 (%struct.saxs_document*, %struct.line*, %struct.line*)** %11
store i32 (%struct.saxs_document*, %struct.line*, %struct.line*)* %4, i32 (%struct.saxs_document*, %struct.line*, %struct.line*)** %12
store i32 (%struct.saxs_document*, %struct.line*, %struct.line*)* %5, i32 (%struct.saxs_document*, %struct.line*, %struct.line*)** %13
store %struct.line* null, %struct.line** %15
store %struct.line* null, %struct.line** %16
store %struct.line* null, %struct.line** %17
%18 = load %struct.line*, %struct.line** %9
%19 = call i32 @saxs_reader_columns_scan(%struct.line* %18, %struct.line** %15, %struct.line** %16, %struct.line** %17)
store i32 %19, i32* %14
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %6
%22 = load i32, i32* %14
store i32 %22, i32* %7
br label %83
23: ; preds = %6
%24 = load %struct.line*, %struct.line** %15
%25 = icmp ne %struct.line* %24, null
br i1 %25, label %34, label %26
26: ; preds = %23
%27 = load %struct.line*, %struct.line** %16
%28 = icmp ne %struct.line* %27, null
br i1 %28, label %34, label %29
29: ; preds = %26
%30 = load %struct.line*, %struct.line** %17
%31 = icmp ne %struct.line* %30, null
br i1 %31, label %34, label %32
32: ; preds = %29
%33 = load i32, i32* @ENOSYS
store i32 %33, i32* %7
br label %83
34: ; preds = %29, %26, %23
%35 = load i32 (%struct.saxs_document*, %struct.line*, %struct.line*)*, i32 (%struct.saxs_document*, %struct.line*, %struct.line*)** %11
%36 = icmp ne i32 (%struct.saxs_document*, %struct.line*, %struct.line*)* %35, null
br i1 %36, label %37, label %50
37: ; preds = %34
%38 = load %struct.line*, %struct.line** %15
%39 = icmp ne %struct.line* %38, null
br i1 %39, label %40, label %50
40: ; preds = %37
%41 = load i32 (%struct.saxs_document*, %struct.line*, %struct.line*)*, i32 (%struct.saxs_document*, %struct.line*, %struct.line*)** %11
%42 = load %struct.saxs_document*, %struct.saxs_document** %8
%43 = load %struct.line*, %struct.line** %15
%44 = load %struct.line*, %struct.line** %16
%45 = call i32 %41(%struct.saxs_document* %42, %struct.line* %43, %struct.line* %44)
%46 = icmp ne i32 %45, 0
%47 = zext i1 %46 to i32
store i32 %47, i32* %14
br i1 %46, label %48, label %50
48: ; preds = %40
%49 = load i32, i32* %14
store i32 %49, i32* %7
br label %83
50: ; preds = %40, %37, %34
%51 = load i32 (%struct.saxs_document*, %struct.line*, %struct.line*)*, i32 (%struct.saxs_document*, %struct.line*, %struct.line*)** %12
%52 = icmp ne i32 (%struct.saxs_document*, %struct.line*, %struct.line*)* %51, null
br i1 %52, label %53, label %66
53: ; preds = %50
%54 = load %struct.line*, %struct.line** %16
%55 = icmp ne %struct.line* %54, null
br i1 %55, label %56, label %66
56: ; preds = %53
%57 = load i32 (%struct.saxs_document*, %struct.line*, %struct.line*)*, i32 (%struct.saxs_document*, %struct.line*, %struct.line*)** %12
%58 = load %struct.saxs_document*, %struct.saxs_document** %8
%59 = load %struct.line*, %struct.line** %16
%60 = load %struct.line*, %struct.line** %17
%61 = call i32 %57(%struct.saxs_document* %58, %struct.line* %59, %struct.line* %60)
%62 = icmp ne i32 %61, 0
%63 = zext i1 %62 to i32
store i32 %63, i32* %14
br i1 %62, label %64, label %66
64: ; preds = %56
%65 = load i32, i32* %14
store i32 %65, i32* %7
br label %83
66: ; preds = %56, %53, %50
%67 = load i32 (%struct.saxs_document*, %struct.line*, %struct.line*)*, i32 (%struct.saxs_document*, %struct.line*, %struct.line*)** %13
%68 = icmp ne i32 (%struct.saxs_document*, %struct.line*, %struct.line*)* %67, null
br i1 %68, label %69, label %82
69: ; preds = %66
%70 = load %struct.line*, %struct.line** %17
%71 = icmp ne %struct.line* %70, null
br i1 %71, label %72, label %82
72: ; preds = %69
%73 = load i32 (%struct.saxs_document*, %struct.line*, %struct.line*)*, i32 (%struct.saxs_document*, %struct.line*, %struct.line*)** %13
%74 = load %struct.saxs_document*, %struct.saxs_document** %8
%75 = load %struct.line*, %struct.line** %17
%76 = load %struct.line*, %struct.line** %10
%77 = call i32 %73(%struct.saxs_document* %74, %struct.line* %75, %struct.line* %76)
%78 = icmp ne i32 %77, 0
%79 = zext i1 %78 to i32
store i32 %79, i32* %14
br i1 %78, label %80, label %82
80: ; preds = %72
%81 = load i32, i32* %14
store i32 %81, i32* %7
br label %83
82: ; preds = %72, %69, %66
store i32 0, i32* %7
br label %83
83: ; preds = %82, %80, %64, %48, %32, %21
%84 = load i32, i32* %7
ret i32 %84
}

LLVM IR (-O2):
%struct.saxs_document = type { i32 }
%struct.line = type { i32 }
@ENOSYS = global i32 0
define i32 @saxs_reader_columns_parse_lines(%struct.saxs_document* %0, %struct.line* %1, %struct.line* %2, i32 (%struct.saxs_document*, %struct.line*, %struct.line*)* %3, i32 (%struct.saxs_document*, %struct.line*, %struct.line*)* %4, i32 (%struct.saxs_document*, %struct.line*, %struct.line*)* %5) {
%7 = alloca %struct.line*
%8 = alloca %struct.line*
%9 = alloca %struct.line*
%10 = bitcast %struct.line** %7 to i8*
store %struct.line* null, %struct.line** %7
%11 = bitcast %struct.line** %8 to i8*
store %struct.line* null, %struct.line** %8
%12 = bitcast %struct.line** %9 to i8*
store %struct.line* null, %struct.line** %9
%13 = call i32 @saxs_reader_columns_scan(%struct.line* %1, %struct.line** %7, %struct.line** %8, %struct.line** %9)
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %52
15: ; preds = %6
%16 = load %struct.line*, %struct.line** %7
%17 = icmp ne %struct.line* %16, null
%18 = load %struct.line*, %struct.line** %8
%19 = icmp ne %struct.line* %18, null
%20 = select i1 %17, i1 true, i1 %19
%21 = load %struct.line*, %struct.line** %9
%22 = icmp ne %struct.line* %21, null
%23 = select i1 %20, i1 true, i1 %22
br i1 %23, label %26, label %24
24: ; preds = %15
%25 = load i32, i32* @ENOSYS
br label %52
26: ; preds = %15
%27 = icmp ne i32 (%struct.saxs_document*, %struct.line*, %struct.line*)* %3, null
%28 = select i1 %27, i1 %17, i1 false
br i1 %28, label %29, label %34
29: ; preds = %26
%30 = call i32 %3(%struct.saxs_document* %0, %struct.line* %16, %struct.line* %18)
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %52
32: ; preds = %29
%33 = load %struct.line*, %struct.line** %8
br label %34
34: ; preds = %32, %26
%35 = phi %struct.line* [ %33, %32 ], [ %18, %26 ]
%36 = icmp ne i32 (%struct.saxs_document*, %struct.line*, %struct.line*)* %4, null
%37 = icmp ne %struct.line* %35, null
%38 = select i1 %36, i1 %37, i1 false
br i1 %38, label %39, label %43
39: ; preds = %34
%40 = load %struct.line*, %struct.line** %9
%41 = call i32 %4(%struct.saxs_document* %0, %struct.line* %35, %struct.line* %40)
%42 = icmp eq i32 %41, 0
br i1 %42, label %43, label %52
43: ; preds = %39, %34
%44 = icmp ne i32 (%struct.saxs_document*, %struct.line*, %struct.line*)* %5, null
%45 = load %struct.line*, %struct.line** %9
%46 = icmp ne %struct.line* %45, null
%47 = select i1 %44, i1 %46, i1 false
br i1 %47, label %48, label %52
48: ; preds = %43
%49 = call i32 %5(%struct.saxs_document* %0, %struct.line* %45, %struct.line* %2)
%50 = icmp ne i32 %49, 0
%51 = zext i1 %50 to i32
br label %52
52: ; preds = %39, %29, %48, %43, %6, %24
%53 = phi i32 [ %25, %24 ], [ %13, %6 ], [ 0, %43 ], [ %51, %48 ], [ 1, %29 ], [ 1, %39 ]
ret i32 %53
}