#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 /*<<< orphan*/ cdoAbort(char *);
int getGlobArgc(int, char **, int);
int skipInputStreams(int argc, char *argv[], int globArgc, int nstreams) {
  while (nstreams > 0) {
    if (globArgc >= argc) {
      cdoAbort("Too few arguments. Check command line!");
      break;
    }
    if (argv[globArgc][0] == '-') {
      globArgc = getGlobArgc(argc, argv, globArgc);
    } else
      globArgc++;
    nstreams--;
  }
  return (globArgc);
}


x86 assembly (clang, -O0):
<skipInputStreams>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jle    11a2 <skipInputStreams+0x82>
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jl     115c <skipInputStreams+0x3c>
lea    0xeae(%rip),%rdi
call   1040 <cdoAbort@plt>
jmp    11a2 <skipInputStreams+0x82>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    118b <skipInputStreams+0x6b>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <getGlobArgc@plt>
mov    %eax,-0x14(%rbp)
jmp    1194 <skipInputStreams+0x74>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    1135 <skipInputStreams+0x15>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipInputStreams>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
test   %ecx,%ecx
jle    1179 <skipInputStreams+0x59>
mov    %ecx,%ebp
mov    %rsi,%r14
mov    %edi,%r15d
add    $0x1,%ebp
jmp    114b <skipInputStreams+0x2b>
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebx
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
jle    1179 <skipInputStreams+0x59>
cmp    %r15d,%ebx
jge    116d <skipInputStreams+0x4d>
movslq %ebx,%rax
mov    (%r14,%rax,8),%rax
cmpb   $0x2d,(%rax)
jne    1140 <skipInputStreams+0x20>
mov    %r15d,%edi
mov    %r14,%rsi
mov    %ebx,%edx
call   1030 <getGlobArgc@plt>
mov    %eax,%ebx
jmp    1143 <skipInputStreams+0x23>
lea    0xe8c(%rip),%rdi
call   1040 <cdoAbort@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [39 x i8] c"Too few arguments. Check command line!\00"
define i32 @skipInputStreams(i32 %0, i8** %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
br label %9
9: ; preds = %36, %4
%10 = load i32, i32* %8
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %39
12: ; preds = %9
%13 = load i32, i32* %7
%14 = load i32, i32* %5
%15 = icmp sge i32 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = call i32 @cdoAbort(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
br label %39
18: ; preds = %12
%19 = load i8**, i8*** %6
%20 = load i32, i32* %7
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8*, i8** %19, i64 %21
%23 = load i8*, i8** %22
%24 = getelementptr inbounds i8, i8* %23, i64 0
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 45
br i1 %27, label %28, label %33
28: ; preds = %18
%29 = load i32, i32* %5
%30 = load i8**, i8*** %6
%31 = load i32, i32* %7
%32 = call i32 @getGlobArgc(i32 %29, i8** %30, i32 %31)
store i32 %32, i32* %7
br label %36
33: ; preds = %18
%34 = load i32, i32* %7
%35 = add nsw i32 %34, 1
store i32 %35, i32* %7
br label %36
36: ; preds = %33, %28
%37 = load i32, i32* %8
%38 = add nsw i32 %37, -1
store i32 %38, i32* %8
br label %9
39: ; preds = %16, %9
%40 = load i32, i32* %7
ret i32 %40
}

LLVM IR (-O2):
@.str = [39 x i8] c"Too few arguments. Check command line!\00"
define i32 @skipInputStreams(i32 %0, i8** %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %3, 0
br i1 %5, label %6, label %26
6: ; preds = %4, %22
%7 = phi i32 [ %24, %22 ], [ %3, %4 ]
%8 = phi i32 [ %23, %22 ], [ %2, %4 ]
%9 = icmp slt i32 %8, %0
br i1 %9, label %12, label %10
10: ; preds = %6
%11 = tail call i32 @cdoAbort(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
br label %26
12: ; preds = %6
%13 = sext i32 %8 to i64
%14 = getelementptr inbounds i8*, i8** %1, i64 %13
%15 = load i8*, i8** %14
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 45
br i1 %17, label %18, label %20
18: ; preds = %12
%19 = tail call i32 @getGlobArgc(i32 %0, i8** %1, i32 %8)
br label %22
20: ; preds = %12
%21 = add nsw i32 %8, 1
br label %22
22: ; preds = %20, %18
%23 = phi i32 [ %19, %18 ], [ %21, %20 ]
%24 = add nsw i32 %7, -1
%25 = icmp sgt i32 %7, 1
br i1 %25, label %6, label %26
26: ; preds = %22, %4, %10
%27 = phi i32 [ %8, %10 ], [ %2, %4 ], [ %23, %22 ]
ret i32 %27
}