#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 atoi(char *);
int /*<<< orphan*/ printf(char *);
int start(int, int);
scalar_t__ strcmp(char *, char *);
int main(int argc, char **argv) {
  int total;
  int flags = 0;
  if (((argc < 2) || (argc > 3)) || ((3 == argc) && strcmp(argv[1], "-c"))) {
    printf("Usage: rap [-c] [users]\n");
    return -1;
  }
  if (3 == argc) {
    flags = 1;
    total = atoi(argv[2]);
  } else
    total = atoi(argv[1]);
  return start(total, flags);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x2,-0x8(%rbp)
jl     119d <main+0x5d>
cmpl   $0x3,-0x8(%rbp)
jg     119d <main+0x5d>
mov    $0x3,%eax
cmp    -0x8(%rbp),%eax
jne    11b5 <main+0x75>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe72(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     11b5 <main+0x75>
lea    0xe5f(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    11fd <main+0xbd>
mov    $0x3,%eax
cmp    -0x8(%rbp),%eax
jne    11df <main+0x9f>
movl   $0x1,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x14(%rbp)
jmp    11ef <main+0xaf>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1050 <start@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%eax
lea    -0x4(%rax),%ecx
cmp    $0xfffffffe,%ecx
jb     116c <main+0x2c>
mov    %rsi,%rbx
xor    %ebp,%ebp
mov    0x8(%rsi),%rdi
cmp    $0x3,%eax
jne    118d <main+0x4d>
lea    0xe9e(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1184 <main+0x44>
lea    0xe90(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    0x10(%rbx),%rdi
mov    $0x1,%ebp
call   1060 <atoi@plt>
mov    %eax,%edi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <start@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"-c\00"
@.str.1 = [25 x i8] c"Usage: rap [-c] [users]\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 2
br i1 %9, label %22, label %10
10: ; preds = %2
%11 = load i32, i32* %4
%12 = icmp sgt i32 %11, 3
br i1 %12, label %22, label %13
13: ; preds = %10
%14 = load i32, i32* %4
%15 = icmp eq i32 3, %14
br i1 %15, label %16, label %24
16: ; preds = %13
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = call i64 @strcmp(i8* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%21 = icmp ne i64 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %16, %10, %2
%23 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %3
br label %41
24: ; preds = %16, %13
%25 = load i32, i32* %4
%26 = icmp eq i32 3, %25
br i1 %26, label %27, label %32
27: ; preds = %24
store i32 1, i32* %7
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 2
%30 = load i8*, i8** %29
%31 = call i32 @atoi(i8* %30)
store i32 %31, i32* %6
br label %37
32: ; preds = %24
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 1
%35 = load i8*, i8** %34
%36 = call i32 @atoi(i8* %35)
store i32 %36, i32* %6
br label %37
37: ; preds = %32, %27
%38 = load i32, i32* %6
%39 = load i32, i32* %7
%40 = call i32 @start(i32 %38, i32 %39)
store i32 %40, i32* %3
br label %41
41: ; preds = %37, %22
%42 = load i32, i32* %3
ret i32 %42
}

LLVM IR (-O2):
@.str = [3 x i8] c"-c\00"
@str = [24 x i8] c"Usage: rap [-c] [users]\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = add i32 %0, -4
%4 = icmp ult i32 %3, -2
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = icmp eq i32 %0, 3
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
br i1 %6, label %9, label %17
9: ; preds = %5
%10 = tail call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %9, %2
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
br label %22
14: ; preds = %9
%15 = getelementptr inbounds i8*, i8** %1, i64 2
%16 = load i8*, i8** %15
br label %17
17: ; preds = %5, %14
%18 = phi i8* [ %16, %14 ], [ %8, %5 ]
%19 = phi i32 [ 1, %14 ], [ 0, %5 ]
%20 = tail call i32 @atoi(i8* %18)
%21 = tail call i32 @start(i32 %20, i32 %19)
br label %22
22: ; preds = %17, %12
%23 = phi i32 [ -1, %12 ], [ %21, %17 ]
ret i32 %23
}