#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*/ init(char *, char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *args[]) {
  if (argc > 3) {
    printf("To much arguments given. Expected 2\n");
  } else if (argc < 3) {
    printf("Not enough arguments. Expected 2\n");
  } else {
    init(args[1], args[2]);
  }
  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   $0x3,-0x8(%rbp)
jle    1151 <main+0x31>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
jmp    1186 <main+0x66>
cmpl   $0x3,-0x8(%rbp)
jge    116c <main+0x4c>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
jmp    1181 <main+0x61>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1040 <init@plt>
jmp    1186 <main+0x66>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x4,%edi
jl     112f <main+0xf>
lea    0xef4(%rip),%rdi
jmp    114a <main+0x2a>
cmp    $0x3,%edi
jne    1143 <main+0x23>
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
call   1040 <init@plt>
jmp    114f <main+0x2f>
lea    0xeb6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"To much arguments given. Expected 2\0A\00"
@.str.1 = [34 x i8] c"Not enough arguments. Expected 2\0A\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 sgt i32 %6, 3
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %24
10: ; preds = %2
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 3
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
br label %23
15: ; preds = %10
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 2
%21 = load i8*, i8** %20
%22 = call i32 @init(i8* %18, i8* %21)
br label %23
23: ; preds = %15, %13
br label %24
24: ; preds = %23, %8
ret i32 0
}

LLVM IR (-O2):
@str = [33 x i8] c"Not enough arguments. Expected 2\00"
@str.2 = [36 x i8] c"To much arguments given. Expected 2\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 3
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.2, i64 0, i64 0))
br label %16
6: ; preds = %2
%7 = icmp eq i32 %0, 3
br i1 %7, label %10, label %8
8: ; preds = %6
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
br label %16
10: ; preds = %6
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = getelementptr inbounds i8*, i8** %1, i64 2
%14 = load i8*, i8** %13
%15 = tail call i32 @init(i8* %12, i8* %14)
br label %16
16: ; preds = %8, %10, %4
ret i32 0
}