#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*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  if (argc == 2) {
    printf("You only have one argument. You suck.\n");
  } else if (argc > 2 && argc < 5) {
    printf("Here's your arguments:\n");
    for (int i = 0; i++, i < argc;) {
      printf("%s ", argv[i]);
    }
    printf("\n");
  } else if (argc == 1) {
    printf("No arguments\n");
  } else {
    printf("There are too many arguments. You suck.\n");
  }
  return 0;
}


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)
cmpl   $0x2,-0x8(%rbp)
jne    1143 <main+0x33>
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e8 <main+0xd8>
cmpl   $0x2,-0x8(%rbp)
jle    11b3 <main+0xa3>
cmpl   $0x5,-0x8(%rbp)
jge    11b3 <main+0xa3>
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11a0 <main+0x90>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    116c <main+0x5c>
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e3 <main+0xd3>
cmpl   $0x1,-0x8(%rbp)
jne    11d0 <main+0xc0>
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11de <main+0xce>
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e3 <main+0xd3>
jmp    11e8 <main+0xd8>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jne    1146 <main+0x16>
lea    0xf0c(%rip),%rdi
jmp    11a9 <main+0x79>
mov    %edi,%r14d
lea    -0x3(%r14),%eax
cmp    $0x1,%eax
ja     1193 <main+0x63>
mov    %rsi,%r15
lea    0xedd(%rip),%rdi
call   1040 <puts@plt>
mov    %r14d,%r12d
mov    $0x1,%ebx
lea    0xe90(%rip),%r14
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1170 <main+0x40>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    11ae <main+0x7e>
cmp    $0x1,%r14d
jne    11a2 <main+0x72>
lea    0xe8c(%rip),%rdi
jmp    11a9 <main+0x79>
lea    0xe5b(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [39 x i8] c"You only have one argument. You suck.\0A\00"
@.str.1 = [24 x i8] c"Here's your arguments:\0A\00"
@.str.2 = [4 x i8] c"%s \00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [14 x i8] c"No arguments\0A\00"
@.str.5 = [41 x i8] c"There are too many arguments. You suck.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 2
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
br label %43
11: ; preds = %2
%12 = load i32, i32* %4
%13 = icmp sgt i32 %12, 2
br i1 %13, label %14, label %34
14: ; preds = %11
%15 = load i32, i32* %4
%16 = icmp slt i32 %15, 5
br i1 %16, label %17, label %34
17: ; preds = %14
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %6
br label %19
19: ; preds = %25, %17
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
store i32 %21, i32* %6
%22 = load i32, i32* %6
%23 = load i32, i32* %4
%24 = icmp slt i32 %22, %23
br i1 %24, label %25, label %32
25: ; preds = %19
%26 = load i8**, i8*** %5
%27 = load i32, i32* %6
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8*, i8** %26, i64 %28
%30 = load i8*, i8** %29
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %30)
br label %19
32: ; preds = %19
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %42
34: ; preds = %14, %11
%35 = load i32, i32* %4
%36 = icmp eq i32 %35, 1
br i1 %36, label %37, label %39
37: ; preds = %34
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
br label %41
39: ; preds = %34
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0))
br label %41
41: ; preds = %39, %37
br label %42
42: ; preds = %41, %32
br label %43
43: ; preds = %42, %9
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [4 x i8] c"%s \00"
@str = [40 x i8] c"There are too many arguments. You suck.\00"
@str.6 = [13 x i8] c"No arguments\00"
@str.7 = [23 x i8] c"Here's your arguments:\00"
@str.8 = [38 x i8] c"You only have one argument. You suck.\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.8, i64 0, i64 0))
br label %27
6: ; preds = %2
%7 = add i32 %0, -3
%8 = icmp ult i32 %7, 2
br i1 %8, label %9, label %21
9: ; preds = %6
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.7, i64 0, i64 0))
%11 = zext i32 %0 to i64
br label %14
12: ; preds = %14
%13 = tail call i32 @putchar(i32 10)
br label %27
14: ; preds = %9, %14
%15 = phi i64 [ 1, %9 ], [ %19, %14 ]
%16 = getelementptr inbounds i8*, i8** %1, i64 %15
%17 = load i8*, i8** %16
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %17)
%19 = add nuw nsw i64 %15, 1
%20 = icmp eq i64 %19, %11
br i1 %20, label %12, label %14
21: ; preds = %6
%22 = icmp eq i32 %0, 1
br i1 %22, label %23, label %25
23: ; preds = %21
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.6, i64 0, i64 0))
br label %27
25: ; preds = %21
%26 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
br label %27
27: ; preds = %12, %25, %23, %4
ret i32 0
}