#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 */
scalar_t__ is_param(char *, char const *);
long parse_long_param(char const *);
int parse_param(const char *param, long *pstart_at, long *pend_at) {
  if (is_param("--start-at=", param))
    *pstart_at = parse_long_param(param);
  else if (is_param("--end-at=", param))
    *pend_at = parse_long_param(param);
  else
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<parse_param>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec1(%rip),%rdi
call   1030 <is_param@plt>
cmp    $0x0,%rax
je     1166 <parse_param+0x46>
mov    -0x10(%rbp),%rdi
call   1040 <parse_long_param@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
jmp    11a9 <parse_param+0x89>
mov    -0x10(%rbp),%rsi
lea    0xe9b(%rip),%rdi
call   1030 <is_param@plt>
cmp    $0x0,%rax
je     1198 <parse_param+0x78>
mov    -0x10(%rbp),%rdi
call   1040 <parse_long_param@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
jmp    11a4 <parse_param+0x84>
movl   $0x1,-0x4(%rbp)
jmp    11b0 <parse_param+0x90>
jmp    11a9 <parse_param+0x89>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_param>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0xecb(%rip),%rdi
mov    %rbx,%rsi
call   1030 <is_param@plt>
test   %rax,%rax
jne    1159 <parse_param+0x39>
lea    0xec3(%rip),%rdi
mov    %rbx,%rsi
call   1030 <is_param@plt>
mov    %r14,%r15
test   %rax,%rax
je     116c <parse_param+0x4c>
mov    %rbx,%rdi
call   1040 <parse_long_param@plt>
mov    %rax,(%r15)
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret
mov    $0x1,%eax
jmp    1166 <parse_param+0x46>

LLVM IR (-O0):
@.str = [12 x i8] c"--start-at=\00"
@.str.1 = [10 x i8] c"--end-at=\00"
define i32 @parse_param(i8* %0, i64* %1, i64* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64*
%7 = alloca i64*
store i8* %0, i8** %5
store i64* %1, i64** %6
store i64* %2, i64** %7
%8 = load i8*, i8** %5
%9 = call i64 @is_param(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %3
%12 = load i8*, i8** %5
%13 = call i64 @parse_long_param(i8* %12)
%14 = load i64*, i64** %6
store i64 %13, i64* %14
br label %25
15: ; preds = %3
%16 = load i8*, i8** %5
%17 = call i64 @is_param(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %16)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %23
19: ; preds = %15
%20 = load i8*, i8** %5
%21 = call i64 @parse_long_param(i8* %20)
%22 = load i64*, i64** %7
store i64 %21, i64* %22
br label %24
23: ; preds = %15
store i32 1, i32* %4
br label %26
24: ; preds = %19
br label %25
25: ; preds = %24, %11
store i32 0, i32* %4
br label %26
26: ; preds = %25, %23
%27 = load i32, i32* %4
ret i32 %27
}

LLVM IR (-O2):
@.str = [12 x i8] c"--start-at=\00"
@.str.1 = [10 x i8] c"--end-at=\00"
define i32 @parse_param(i8* %0, i64* nocapture writeonly %1, i64* nocapture writeonly %2) {
%4 = tail call i64 @is_param(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i64 @is_param(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%8 = icmp eq i64 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %6, %3
%10 = phi i64* [ %1, %3 ], [ %2, %6 ]
%11 = tail call i64 @parse_long_param(i8* %0)
store i64 %11, i64* %10
br label %12
12: ; preds = %9, %6
%13 = phi i32 [ 1, %6 ], [ 0, %9 ]
ret i32 %13
}