#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 parse_segment_index(char *, unsigned int, int, char *);
void parse_segment_range(unsigned int *start, unsigned int *end, int argc,
                         char **argv) {
  *start = (argc > (((1 + 1) + 1))
                ? parse_segment_index(argv[(((1 + 1) + 1))], (0), (834),
                                      ("Bad start segment"))
                : (0));
  *end = (argc > ((((1 + 1) + 1) + 1))
              ? parse_segment_index(argv[((((1 + 1) + 1) + 1))], (*start),
                                    (834), ("Bad end segment"))
              : (834));
}


x86 assembly (clang, -O0):
<parse_segment_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
cmpl   $0x3,-0x14(%rbp)
jle    1154 <parse_segment_range+0x44>
mov    -0x20(%rbp),%rax
mov    0x18(%rax),%rdi
xor    %esi,%esi
mov    $0x342,%edx
lea    0xeb9(%rip),%rcx
call   1030 <parse_segment_index@plt>
mov    %eax,-0x24(%rbp)
jmp    115e <parse_segment_range+0x4e>
xor    %eax,%eax
mov    %eax,-0x24(%rbp)
jmp    115e <parse_segment_range+0x4e>
mov    -0x24(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
cmpl   $0x4,-0x14(%rbp)
jle    1198 <parse_segment_range+0x88>
mov    -0x20(%rbp),%rax
mov    0x20(%rax),%rdi
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
mov    $0x342,%edx
lea    0xe87(%rip),%rcx
call   1030 <parse_segment_index@plt>
mov    %eax,-0x28(%rbp)
jmp    11a5 <parse_segment_range+0x95>
mov    $0x342,%eax
mov    %eax,-0x28(%rbp)
jmp    11a5 <parse_segment_range+0x95>
mov    -0x28(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_segment_range>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r12
cmp    $0x3,%edx
jle    1168 <parse_segment_range+0x58>
mov    %rcx,%r15
mov    %edx,%ebx
mov    0x18(%rcx),%rdi
lea    0xecd(%rip),%rcx
mov    $0x342,%ebp
xor    %esi,%esi
mov    $0x342,%edx
call   1030 <parse_segment_index@plt>
mov    %eax,(%r12)
cmp    $0x4,%ebx
je     1175 <parse_segment_range+0x65>
mov    0x20(%r15),%rdi
lea    0xeba(%rip),%rcx
mov    %eax,%esi
mov    $0x342,%edx
call   1030 <parse_segment_index@plt>
mov    %eax,%ebp
jmp    1175 <parse_segment_range+0x65>
movl   $0x0,(%r12)
mov    $0x342,%ebp
mov    %ebp,(%r14)
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Bad start segment\00"
@.str.1 = [16 x i8] c"Bad end segment\00"
define void @parse_segment_range(i32* %0, i32* %1, i32 %2, i8** %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i8**
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i8** %3, i8*** %8
%9 = load i32, i32* %7
%10 = icmp sgt i32 %9, 3
br i1 %10, label %11, label %16
11: ; preds = %4
%12 = load i8**, i8*** %8
%13 = getelementptr inbounds i8*, i8** %12, i64 3
%14 = load i8*, i8** %13
%15 = call i32 @parse_segment_index(i8* %14, i32 0, i32 834, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %17
16: ; preds = %4
br label %17
17: ; preds = %16, %11
%18 = phi i32 [ %15, %11 ], [ 0, %16 ]
%19 = load i32*, i32** %5
store i32 %18, i32* %19
%20 = load i32, i32* %7
%21 = icmp sgt i32 %20, 4
br i1 %21, label %22, label %29
22: ; preds = %17
%23 = load i8**, i8*** %8
%24 = getelementptr inbounds i8*, i8** %23, i64 4
%25 = load i8*, i8** %24
%26 = load i32*, i32** %5
%27 = load i32, i32* %26
%28 = call i32 @parse_segment_index(i8* %25, i32 %27, i32 834, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %30
29: ; preds = %17
br label %30
30: ; preds = %29, %22
%31 = phi i32 [ %28, %22 ], [ 834, %29 ]
%32 = load i32*, i32** %6
store i32 %31, i32* %32
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Bad start segment\00"
@.str.1 = [16 x i8] c"Bad end segment\00"
define void @parse_segment_range(i32* nocapture writeonly %0, i32* nocapture writeonly %1, i32 %2, i8** nocapture %3) {
%5 = icmp sgt i32 %2, 3
br i1 %5, label %7, label %6
6: ; preds = %4
store i32 0, i32* %0
br label %16
7: ; preds = %4
%8 = getelementptr inbounds i8*, i8** %3, i64 3
%9 = load i8*, i8** %8
%10 = tail call i32 @parse_segment_index(i8* %9, i32 0, i32 834, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
store i32 %10, i32* %0
%11 = icmp eq i32 %2, 4
br i1 %11, label %16, label %12
12: ; preds = %7
%13 = getelementptr inbounds i8*, i8** %3, i64 4
%14 = load i8*, i8** %13
%15 = tail call i32 @parse_segment_index(i8* %14, i32 %10, i32 834, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %16
16: ; preds = %6, %7, %12
%17 = phi i32 [ %15, %12 ], [ 834, %7 ], [ 834, %6 ]
store i32 %17, i32* %1
ret void
}