#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 */
size_t strtoll(char const *, char **, int /*<<< orphan*/);
int parse_intrange(const char *s, size_t *a, size_t *b) {
  char *p;
  *a = strtoll(s, &p, 0);
  if (!p || !*p) {
    *b = *a;
    return 1;
  }
  if (*p != '-')
    return 0;
  p++;
  *b = strtoll(p, &p, 0);
  return 1;
}


x86 assembly (clang, -O0):
<parse_intrange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x28(%rbp),%rsi
xor    %edx,%edx
call   1030 <strtoll@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
cmpq   $0x0,-0x28(%rbp)
je     1155 <parse_intrange+0x45>
mov    -0x28(%rbp),%rax
cmpb   $0x0,(%rax)
jne    116f <parse_intrange+0x5f>
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    11b7 <parse_intrange+0xa7>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
je     118b <parse_intrange+0x7b>
movl   $0x0,-0x4(%rbp)
jmp    11b7 <parse_intrange+0xa7>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
lea    -0x28(%rbp),%rsi
xor    %edx,%edx
call   1030 <strtoll@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_intrange>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
xor    %ebp,%ebp
xor    %edx,%edx
call   1030 <strtoll@plt>
mov    %rax,(%rbx)
mov    0x8(%rsp),%rdi
test   %rdi,%rdi
je     1159 <parse_intrange+0x49>
mov    (%rdi),%cl
test   %cl,%cl
je     1159 <parse_intrange+0x49>
cmp    $0x2d,%cl
jne    1161 <parse_intrange+0x51>
add    $0x1,%rdi
mov    %rdi,0x8(%rsp)
lea    0x8(%rsp),%rsi
xor    %edx,%edx
call   1030 <strtoll@plt>
mov    %rax,(%r14)
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @parse_intrange(i8* %0, i64* nocapture %1, i64* nocapture writeonly %2) {
%4 = alloca i8*
%5 = bitcast i8** %4 to i8*
%6 = call i64 @strtoll(i8* %0, i8** %4, i32 0)
store i64 %6, i64* %1
%7 = load i8*, i8** %4
%8 = icmp eq i8* %7, null
br i1 %8, label %14, label %9
9: ; preds = %3
%10 = load i8, i8* %7
switch i8 %10, label %16 [
i8 0, label %14
i8 45, label %11
]
11: ; preds = %9
%12 = getelementptr inbounds i8, i8* %7, i64 1
store i8* %12, i8** %4
%13 = call i64 @strtoll(i8* %12, i8** %4, i32 0)
br label %14
14: ; preds = %3, %9, %11
%15 = phi i64 [ %13, %11 ], [ %6, %9 ], [ %6, %3 ]
store i64 %15, i64* %2
br label %16
16: ; preds = %14, %9
%17 = phi i32 [ 0, %9 ], [ 1, %14 ]
ret i32 %17
}