#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 */
scalar_t__ argue(int, char *);
int /*<<< orphan*/ help();
int process_args(int argc, char **argv) {
  int i;
  if (argc != 2) {
    help();
    return -1;
  }
  for (i = 1; i < argc; i++) {
    if (argue(argc, argv[i]) != 0) {
      return -1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<process_args>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     114c <process_args+0x2c>
mov    $0x0,%al
call   1040 <help@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    11a3 <process_args+0x83>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    119c <process_args+0x7c>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   1030 <argue@plt>
cmp    $0x0,%rax
je     1189 <process_args+0x69>
movl   $0xffffffff,-0x4(%rbp)
jmp    11a3 <process_args+0x83>
jmp    118e <process_args+0x6e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1153 <process_args+0x33>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_args>:
push   %rax
cmp    $0x2,%edi
jne    113b <process_args+0x1b>
mov    0x8(%rsi),%rsi
mov    $0x2,%edi
call   1030 <argue@plt>
neg    %rax
sbb    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1040 <help@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @process_args(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @help()
br label %12
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i64 @argue(i32 2, i8* %8)
%10 = icmp ne i64 %9, 0
%11 = sext i1 %10 to i32
br label %12
12: ; preds = %6, %4
%13 = phi i32 [ -1, %4 ], [ %11, %6 ]
ret i32 %13
}