#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 args_to_next_opt(int, int, char **);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, int,
                           char *);
int /*<<< orphan*/ option_name(char *, char *, char *);
int /*<<< orphan*/ stderr;
int args_eq(int Num, int *Opt_i, int argc, char **argv, char *shortopt,
            char *longopt, int *Error) {
  char tempStr[1000];
  int i = *Opt_i;
  int act;
  act = args_to_next_opt(i, argc, argv);
  if (act == Num)
    return (1);
  option_name(tempStr, shortopt, longopt);
  fprintf(stderr,
          "Error Processing Option %s!   Incorrect number of arguments (%d "
          "instead of %d) to option %s\n",
          tempStr, act, Num, tempStr);
  *Error = 1;
  for (i = 0; i < act; i++) {
    (*Opt_i) = (*Opt_i) + 1;
  }
  return (0);
}


x86 assembly (clang, -O0):
<args_eq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
mov    0x10(%rbp),%rax
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x424(%rbp)
mov    -0x424(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1050 <args_to_next_opt@plt>
mov    %eax,-0x428(%rbp)
mov    -0x428(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1194 <args_eq+0x64>
movl   $0x1,-0x4(%rbp)
jmp    1225 <args_eq+0xf5>
lea    -0x420(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
call   1030 <option_name@plt>
mov    0x2e31(%rip),%rax
mov    (%rax),%edi
lea    -0x420(%rbp),%rdx
mov    -0x428(%rbp),%ecx
mov    -0x8(%rbp),%r8d
lea    -0x420(%rbp),%r9
lea    0xe30(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x10(%rbp),%rax
movl   $0x1,(%rax)
movl   $0x0,-0x424(%rbp)
mov    -0x424(%rbp),%eax
cmp    -0x428(%rbp),%eax
jge    121e <args_eq+0xee>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x424(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x424(%rbp)
jmp    11e9 <args_eq+0xb9>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<args_eq>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x3e8,%rsp
mov    %r9,%r15
mov    %r8,%r12
mov    %rsi,%r14
mov    %edi,%ebx
mov    (%rsi),%edi
mov    %edx,%esi
mov    %rcx,%rdx
call   1050 <args_to_next_opt@plt>
mov    %eax,%ebp
mov    $0x1,%eax
cmp    %ebx,%ebp
je     11ab <args_eq+0x7b>
mov    %rsp,%r13
mov    %r13,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
call   1030 <option_name@plt>
mov    0x2e65(%rip),%rax
mov    (%rax),%edi
lea    0xe7c(%rip),%rsi
mov    %r13,%rdx
mov    %ebp,%ecx
mov    %ebx,%r8d
mov    %r13,%r9
call   1040 <fprintf@plt>
mov    0x420(%rsp),%rax
movl   $0x1,(%rax)
xor    %eax,%eax
test   %ebp,%ebp
jle    11ab <args_eq+0x7b>
add    %ebp,(%r14)
add    $0x3e8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [93 x i8] c"Error Processing Option %s! Incorrect number of arguments (%d instead of %d) to option %s\0A\00"
define i32 @args_eq(i32 %0, i32* %1, i32 %2, i8** %3, i8* %4, i8* %5, i32* %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i32
%12 = alloca i8**
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i32*
%16 = alloca [1000 x i8]
%17 = alloca i32
%18 = alloca i32
store i32 %0, i32* %9
store i32* %1, i32** %10
store i32 %2, i32* %11
store i8** %3, i8*** %12
store i8* %4, i8** %13
store i8* %5, i8** %14
store i32* %6, i32** %15
%19 = load i32*, i32** %10
%20 = load i32, i32* %19
store i32 %20, i32* %17
%21 = load i32, i32* %17
%22 = load i32, i32* %11
%23 = load i8**, i8*** %12
%24 = call i32 @args_to_next_opt(i32 %21, i32 %22, i8** %23)
store i32 %24, i32* %18
%25 = load i32, i32* %18
%26 = load i32, i32* %9
%27 = icmp eq i32 %25, %26
br i1 %27, label %28, label %29
28: ; preds = %7
store i32 1, i32* %8
br label %54
29: ; preds = %7
%30 = getelementptr inbounds [1000 x i8], [1000 x i8]* %16, i64 0, i64 0
%31 = load i8*, i8** %13
%32 = load i8*, i8** %14
%33 = call i32 @option_name(i8* %30, i8* %31, i8* %32)
%34 = load i32, i32* @stderr
%35 = getelementptr inbounds [1000 x i8], [1000 x i8]* %16, i64 0, i64 0
%36 = load i32, i32* %18
%37 = load i32, i32* %9
%38 = getelementptr inbounds [1000 x i8], [1000 x i8]* %16, i64 0, i64 0
%39 = call i32 @fprintf(i32 %34, i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str, i64 0, i64 0), i8* %35, i32 %36, i32 %37, i8* %38)
%40 = load i32*, i32** %15
store i32 1, i32* %40
store i32 0, i32* %17
br label %41
41: ; preds = %50, %29
%42 = load i32, i32* %17
%43 = load i32, i32* %18
%44 = icmp slt i32 %42, %43
br i1 %44, label %45, label %53
45: ; preds = %41
%46 = load i32*, i32** %10
%47 = load i32, i32* %46
%48 = add nsw i32 %47, 1
%49 = load i32*, i32** %10
store i32 %48, i32* %49
br label %50
50: ; preds = %45
%51 = load i32, i32* %17
%52 = add nsw i32 %51, 1
store i32 %52, i32* %17
br label %41
53: ; preds = %41
store i32 0, i32* %8
br label %54
54: ; preds = %53, %28
%55 = load i32, i32* %8
ret i32 %55
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [93 x i8] c"Error Processing Option %s! Incorrect number of arguments (%d instead of %d) to option %s\0A\00"
define i32 @args_eq(i32 %0, i32* nocapture %1, i32 %2, i8** %3, i8* %4, i8* %5, i32* nocapture writeonly %6) {
%8 = alloca [1000 x i8]
%9 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
%10 = load i32, i32* %1
%11 = tail call i32 @args_to_next_opt(i32 %10, i32 %2, i8** %3)
%12 = icmp eq i32 %11, %0
br i1 %12, label %21, label %13
13: ; preds = %7
%14 = call i32 @option_name(i8* %9, i8* %4, i8* %5)
%15 = load i32, i32* @stderr
%16 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str, i64 0, i64 0), i8* %9, i32 %11, i32 %0, i8* %9)
store i32 1, i32* %6
%17 = icmp sgt i32 %11, 0
br i1 %17, label %18, label %21
18: ; preds = %13
%19 = load i32, i32* %1
%20 = add i32 %11, %19
store i32 %20, i32* %1
br label %21
21: ; preds = %13, %18, %7
%22 = phi i32 [ 1, %7 ], [ 0, %18 ], [ 0, %13 ]
ret i32 %22
}