#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 == 1)
    printf("No parameters");
  else if (argc == 2)
    printf("Parameters is %s", argv[1]);
  else
    printf("Too many parameters");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1143 <main+0x33>
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    117b <main+0x6b>
cmpl   $0x2,-0x8(%rbp)
jne    1168 <main+0x58>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1176 <main+0x66>
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    117b <main+0x6b>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
je     1124 <main+0x14>
cmp    $0x1,%edi
jne    1138 <main+0x28>
lea    0xede(%rip),%rdi
jmp    113f <main+0x2f>
mov    0x8(%rsi),%rsi
lea    0xedf(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1146 <main+0x36>
lea    0xee0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"No parameters\00"
@.str.1 = [17 x i8] c"Parameters is %s\00"
@.str.2 = [20 x i8] c"Too many parameters\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %21
10: ; preds = %2
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 2
br i1 %12, label %13, label %18
13: ; preds = %10
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %16)
br label %20
18: ; preds = %10
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %20
20: ; preds = %18, %13
br label %21
21: ; preds = %20, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"No parameters\00"
@.str.1 = [17 x i8] c"Parameters is %s\00"
@.str.2 = [20 x i8] c"Too many parameters\00"
define i32 @main(i32 %0, i8** nocapture %1) {
switch i32 %0, label %9 [
i32 1, label %3
i32 2, label %5
]
3: ; preds = %2
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %11
5: ; preds = %2
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %7)
br label %11
9: ; preds = %2
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %5, %9, %3
ret i32 0
}