#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 line_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Clean_meta(char *);
char *Get_file_image(char const *, int);
int /*<<< orphan*/ ISNULL(char const *);
int /*<<< orphan*/ Split(struct line_list *, char *, char const *, int,
                         char const *, int, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ free(char *);
int Get_file_image_and_split(const char *file, int maxsize, int clean,
                             struct line_list *l, const char *sep, int sort,
                             const char *keysep, int uniq, int trim,
                             int nocomments, char **return_image) {
  char *s = 0;
  if (return_image)
    *return_image = 0;
  if (!ISNULL(file))
    s = Get_file_image(file, maxsize);
  if (s == 0)
    return 1;
  if (clean)
    Clean_meta(s);
  Split(l, s, sep, sort, keysep, uniq, trim, nocomments, 0);
  if (return_image) {
    *return_image = s;
  } else {
    if (s)
      free(s);
    s = 0;
  }
  return (0);
}


x86 assembly (clang, -O0):
<Get_file_image_and_split>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
movq   $0x0,-0x38(%rbp)
cmpq   $0x0,0x30(%rbp)
je     119d <Get_file_image_and_split+0x4d>
mov    0x30(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <ISNULL@plt>
cmp    $0x0,%eax
jne    11bf <Get_file_image_and_split+0x6f>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1060 <Get_file_image@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    11d6 <Get_file_image_and_split+0x86>
movl   $0x1,-0x4(%rbp)
jmp    125d <Get_file_image_and_split+0x10d>
cmpl   $0x0,-0x18(%rbp)
je     11e9 <Get_file_image_and_split+0x99>
mov    -0x38(%rbp),%rdi
call   1040 <Clean_meta@plt>
mov    -0x20(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
mov    0x10(%rbp),%r8
mov    0x18(%rbp),%r9d
mov    0x20(%rbp),%r10d
mov    0x28(%rbp),%eax
xor    %r11d,%r11d
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
movl   $0x0,0x10(%rsp)
call   1070 <Split@plt>
cmpq   $0x0,0x30(%rbp)
je     123a <Get_file_image_and_split+0xea>
mov    -0x38(%rbp),%rcx
mov    0x30(%rbp),%rax
mov    %rcx,(%rax)
jmp    1256 <Get_file_image_and_split+0x106>
cmpq   $0x0,-0x38(%rbp)
je     124e <Get_file_image_and_split+0xfe>
mov    -0x38(%rbp),%rdi
call   1050 <free@plt>
movq   $0x0,-0x38(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Get_file_image_and_split>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9d,0xc(%rsp)
mov    %r8,0x10(%rsp)
mov    %rcx,%r12
mov    %edx,%r14d
mov    %esi,%r13d
mov    %rdi,%rbp
mov    0x70(%rsp),%r15
test   %r15,%r15
je     1185 <Get_file_image_and_split+0x35>
movq   $0x0,(%r15)
mov    %rbp,%rdi
call   1030 <ISNULL@plt>
mov    $0x1,%ebx
test   %eax,%eax
jne    120a <Get_file_image_and_split+0xba>
mov    %rbp,%rdi
mov    %r13d,%esi
call   1060 <Get_file_image@plt>
test   %rax,%rax
je     120a <Get_file_image_and_split+0xba>
mov    %rax,%r13
mov    0x68(%rsp),%ebx
mov    0x60(%rsp),%eax
mov    0x58(%rsp),%r9d
mov    0x50(%rsp),%rbp
test   %r14d,%r14d
je     11d3 <Get_file_image_and_split+0x83>
mov    %r13,%rdi
mov    %rax,%r14
call   1040 <Clean_meta@plt>
mov    0x58(%rsp),%r9d
mov    %r14,%rax
sub    $0x8,%rsp
mov    %r12,%rdi
mov    %r13,%rsi
mov    0x18(%rsp),%rdx
mov    0x14(%rsp),%ecx
mov    %rbp,%r8
push   $0x0
push   %rbx
push   %rax
call   1070 <Split@plt>
add    $0x20,%rsp
test   %r15,%r15
je     1200 <Get_file_image_and_split+0xb0>
mov    %r13,(%r15)
jmp    1208 <Get_file_image_and_split+0xb8>
mov    %r13,%rdi
call   1050 <free@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.line_list = type { i32 }
define i32 @Get_file_image_and_split(i8* %0, i32 %1, i32 %2, %struct.line_list* %3, i8* %4, i32 %5, i8* %6, i32 %7, i32 %8, i32 %9, i8** %10) {
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i32
%15 = alloca i32
%16 = alloca %struct.line_list*
%17 = alloca i8*
%18 = alloca i32
%19 = alloca i8*
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i8**
%24 = alloca i8*
store i8* %0, i8** %13
store i32 %1, i32* %14
store i32 %2, i32* %15
store %struct.line_list* %3, %struct.line_list** %16
store i8* %4, i8** %17
store i32 %5, i32* %18
store i8* %6, i8** %19
store i32 %7, i32* %20
store i32 %8, i32* %21
store i32 %9, i32* %22
store i8** %10, i8*** %23
store i8* null, i8** %24
%25 = load i8**, i8*** %23
%26 = icmp ne i8** %25, null
br i1 %26, label %27, label %29
27: ; preds = %11
%28 = load i8**, i8*** %23
store i8* null, i8** %28
br label %29
29: ; preds = %27, %11
%30 = load i8*, i8** %13
%31 = call i32 @ISNULL(i8* %30)
%32 = icmp ne i32 %31, 0
br i1 %32, label %37, label %33
33: ; preds = %29
%34 = load i8*, i8** %13
%35 = load i32, i32* %14
%36 = call i8* @Get_file_image(i8* %34, i32 %35)
store i8* %36, i8** %24
br label %37
37: ; preds = %33, %29
%38 = load i8*, i8** %24
%39 = icmp eq i8* %38, null
br i1 %39, label %40, label %41
40: ; preds = %37
store i32 1, i32* %12
br label %70
41: ; preds = %37
%42 = load i32, i32* %15
%43 = icmp ne i32 %42, 0
br i1 %43, label %44, label %47
44: ; preds = %41
%45 = load i8*, i8** %24
%46 = call i32 @Clean_meta(i8* %45)
br label %47
47: ; preds = %44, %41
%48 = load %struct.line_list*, %struct.line_list** %16
%49 = load i8*, i8** %24
%50 = load i8*, i8** %17
%51 = load i32, i32* %18
%52 = load i8*, i8** %19
%53 = load i32, i32* %20
%54 = load i32, i32* %21
%55 = load i32, i32* %22
%56 = call i32 @Split(%struct.line_list* %48, i8* %49, i8* %50, i32 %51, i8* %52, i32 %53, i32 %54, i32 %55, i32 0)
%57 = load i8**, i8*** %23
%58 = icmp ne i8** %57, null
br i1 %58, label %59, label %62
59: ; preds = %47
%60 = load i8*, i8** %24
%61 = load i8**, i8*** %23
store i8* %60, i8** %61
br label %69
62: ; preds = %47
%63 = load i8*, i8** %24
%64 = icmp ne i8* %63, null
br i1 %64, label %65, label %68
65: ; preds = %62
%66 = load i8*, i8** %24
%67 = call i32 @free(i8* %66)
br label %68
68: ; preds = %65, %62
store i8* null, i8** %24
br label %69
69: ; preds = %68, %59
store i32 0, i32* %12
br label %70
70: ; preds = %69, %40
%71 = load i32, i32* %12
ret i32 %71
}

LLVM IR (-O2):
%struct.line_list = type { i32 }
define i32 @Get_file_image_and_split(i8* %0, i32 %1, i32 %2, %struct.line_list* %3, i8* %4, i32 %5, i8* %6, i32 %7, i32 %8, i32 %9, i8** writeonly %10) {
%12 = icmp eq i8** %10, null
br i1 %12, label %14, label %13
13: ; preds = %11
store i8* null, i8** %10
br label %14
14: ; preds = %13, %11
%15 = tail call i32 @ISNULL(i8* %0)
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %29
17: ; preds = %14
%18 = tail call i8* @Get_file_image(i8* %0, i32 %1)
%19 = icmp eq i8* %18, null
br i1 %19, label %29, label %20
20: ; preds = %17
%21 = icmp eq i32 %2, 0
br i1 %21, label %24, label %22
22: ; preds = %20
%23 = tail call i32 @Clean_meta(i8* %18)
br label %24
24: ; preds = %22, %20
%25 = tail call i32 @Split(%struct.line_list* %3, i8* %18, i8* %4, i32 %5, i8* %6, i32 %7, i32 %8, i32 %9, i32 0)
br i1 %12, label %27, label %26
26: ; preds = %24
store i8* %18, i8** %10
br label %29
27: ; preds = %24
%28 = tail call i32 @free(i8* %18)
br label %29
29: ; preds = %14, %26, %27, %17
%30 = phi i32 [ 1, %17 ], [ 0, %27 ], [ 0, %26 ], [ 1, %14 ]
ret i32 %30
}