#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 atoi(char *);
char *strchr(char *, char);
int ParseListFileLine(char *linetxt, char **file, int *pagenum) {
  char *sep = strchr(linetxt, ':');
  if (!sep || (sep == linetxt))
    return 1;
  *pagenum = atoi(linetxt);
  *file = sep + 1;
  if (**file == '\0')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<ParseListFileLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x3a,%esi
call   1030 <strchr@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     115f <ParseListFileLine+0x3f>
mov    -0x28(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    116b <ParseListFileLine+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    11b1 <ParseListFileLine+0x91>
mov    -0x10(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x28(%rbp),%rcx
add    $0x1,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    11aa <ParseListFileLine+0x8a>
movl   $0x1,-0x4(%rbp)
jmp    11b1 <ParseListFileLine+0x91>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ParseListFileLine>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%r12
mov    $0x3a,%esi
call   1030 <strchr@plt>
mov    %rax,%rbx
mov    $0x1,%eax
test   %rbx,%rbx
je     116b <ParseListFileLine+0x4b>
cmp    %r12,%rbx
je     116b <ParseListFileLine+0x4b>
mov    %r12,%rdi
call   1040 <atoi@plt>
mov    %eax,(%r15)
mov    %rbx,%rax
add    $0x1,%rax
mov    %rax,(%r14)
xor    %eax,%eax
cmpb   $0x0,0x1(%rbx)
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @ParseListFileLine(i8* %0, i8** %1, i32* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i32*
%8 = alloca i8*
store i8* %0, i8** %5
store i8** %1, i8*** %6
store i32* %2, i32** %7
%9 = load i8*, i8** %5
%10 = call i8* @strchr(i8* %9, i8 signext 58)
store i8* %10, i8** %8
%11 = load i8*, i8** %8
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %17
13: ; preds = %3
%14 = load i8*, i8** %8
%15 = load i8*, i8** %5
%16 = icmp eq i8* %14, %15
br i1 %16, label %17, label %18
17: ; preds = %13, %3
store i32 1, i32* %4
br label %32
18: ; preds = %13
%19 = load i8*, i8** %5
%20 = call i32 @atoi(i8* %19)
%21 = load i32*, i32** %7
store i32 %20, i32* %21
%22 = load i8*, i8** %8
%23 = getelementptr inbounds i8, i8* %22, i64 1
%24 = load i8**, i8*** %6
store i8* %23, i8** %24
%25 = load i8**, i8*** %6
%26 = load i8*, i8** %25
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %31
30: ; preds = %18
store i32 1, i32* %4
br label %32
31: ; preds = %18
store i32 0, i32* %4
br label %32
32: ; preds = %31, %30, %17
%33 = load i32, i32* %4
ret i32 %33
}

LLVM IR (-O2):
define i32 @ParseListFileLine(i8* %0, i8** nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 58)
%5 = icmp eq i8* %4, null
%6 = icmp eq i8* %4, %0
%7 = or i1 %5, %6
br i1 %7, label %14, label %8
8: ; preds = %3
%9 = tail call i32 @atoi(i8* %0)
store i32 %9, i32* %2
%10 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %10, i8** %1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %8, %3
%15 = phi i32 [ 1, %3 ], [ %13, %8 ]
ret i32 %15
}