#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*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void testArguments(int argc, char **argv) {
  if (argc < 2) {
    fprintf(stderr, "Numero invalido de argumentos. (%d)\n", argc);
    fprintf(stderr, "ERRO: Não forneceu o tamanho do buffer!\n");
    exit(-1);
  } else if (argc > 2) {
    fprintf(stderr, "Numero invalido de argumentos. (%d)\n", argc);
    fprintf(stderr, "ERRO: Forneceu argumentos demais!\n");
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<testArguments>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    1174 <testArguments+0x54>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xeb4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
lea    0xec2(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
cmpl   $0x2,-0x4(%rbp)
jle    11b9 <testArguments+0x99>
mov    0x2e5b(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xe6f(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e41(%rip),%rax
mov    (%rax),%edi
lea    0xea7(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
jmp    11be <testArguments+0x9e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testArguments>:
push   %rbx
mov    %edi,%edx
cmp    $0x1,%edi
jle    112f <testArguments+0xf>
cmp    $0x2,%edx
jne    1151 <testArguments+0x31>
pop    %rbx
ret
mov    0x2eaa(%rip),%rbx
mov    (%rbx),%edi
lea    0xec1(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xed6(%rip),%rsi
jmp    1171 <testArguments+0x51>
mov    0x2e88(%rip),%rbx
mov    (%rbx),%edi
lea    0xe9f(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xede(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"Numero invalido de argumentos. (%d)\0A\00"
@.str.1 = [42 x i8] c"ERRO: N\C3\A3o forneceu o tamanho do buffer!\0A\00"
@.str.2 = [35 x i8] c"ERRO: Forneceu argumentos demais!\0A\00"
define void @testArguments(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 2
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = load i32, i32* %3
%10 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* @stderr
%12 = call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 @exit(i32 -1)
unreachable
14: ; preds = %2
%15 = load i32, i32* %3
%16 = icmp sgt i32 %15, 2
br i1 %16, label %17, label %24
17: ; preds = %14
%18 = load i32, i32* @stderr
%19 = load i32, i32* %3
%20 = call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %19)
%21 = load i32, i32* @stderr
%22 = call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
%23 = call i32 @exit(i32 -1)
unreachable
24: ; preds = %14
br label %25
25: ; preds = %24
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"Numero invalido de argumentos. (%d)\0A\00"
@.str.1 = [42 x i8] c"ERRO: N\C3\A3o forneceu o tamanho do buffer!\0A\00"
@.str.2 = [35 x i8] c"ERRO: Forneceu argumentos demais!\0A\00"
define void @testArguments(i32 %0, i8** nocapture readnone %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = load i32, i32* @stderr
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 @exit(i32 -1)
unreachable
10: ; preds = %2
%11 = icmp eq i32 %0, 2
br i1 %11, label %18, label %12
12: ; preds = %10
%13 = load i32, i32* @stderr
%14 = tail call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %0)
%15 = load i32, i32* @stderr
%16 = tail call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
%17 = tail call i32 @exit(i32 -1)
unreachable
18: ; preds = %10
ret void
}