#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*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void shiftCL(int *i, int argc, char *argv[]) {
  if (*i + 1 < argc) {
    (*i)++;
  } else {
    fprintf(stderr, "### error: option '%s' expects a value\n", argv[*i]);
    exit(3);
  }
}


x86 assembly (clang, -O0):
<shiftCL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0x1,%eax
cmp    -0xc(%rbp),%eax
jge    1155 <shiftCL+0x35>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
jmp    1183 <shiftCL+0x63>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xe8c(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x3,%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shiftCL>:
push   %rax
movslq (%rdi),%rax
lea    0x1(%rax),%ecx
cmp    %esi,%ecx
jge    112f <shiftCL+0xf>
mov    %ecx,(%rdi)
pop    %rax
ret
mov    0x2eaa(%rip),%rcx
mov    (%rcx),%edi
mov    (%rdx,%rax,8),%rdx
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x3,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [40 x i8] c"### error: option '%s' expects a value\0A\00"
define void @shiftCL(i32* %0, i32 %1, i8** %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8**
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = add nsw i32 %8, 1
%10 = load i32, i32* %5
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %16
12: ; preds = %3
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = add nsw i32 %14, 1
store i32 %15, i32* %13
br label %26
16: ; preds = %3
%17 = load i32, i32* @stderr
%18 = load i8**, i8*** %6
%19 = load i32*, i32** %4
%20 = load i32, i32* %19
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8*, i8** %18, i64 %21
%23 = load i8*, i8** %22
%24 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %23)
%25 = call i32 @exit(i32 3)
unreachable
26: ; preds = %12
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [40 x i8] c"### error: option '%s' expects a value\0A\00"
define void @shiftCL(i32* nocapture %0, i32 %1, i8** nocapture %2) {
%4 = load i32, i32* %0
%5 = add nsw i32 %4, 1
%6 = icmp slt i32 %5, %1
br i1 %6, label %7, label %8
7: ; preds = %3
store i32 %5, i32* %0
ret void
8: ; preds = %3
%9 = load i32, i32* @stderr
%10 = sext i32 %4 to i64
%11 = getelementptr inbounds i8*, i8** %2, i64 %10
%12 = load i8*, i8** %11
%13 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = tail call i32 @exit(i32 3)
unreachable
}