#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*/ exit(int);
int /*<<< orphan*/ printf(char *);
void validaParametrosInput(int argc, char *argv[]) {
  if (argc != 2) {
    printf("\nDebe recibir la cantidad de cables de la bomba\n\n");
    exit(1);
  }
  int val = atoi(argv[1]);
  if (val < 1 || val > 999) {
    printf(
        "\nLa cantidad de cables de la bomba no cumple con los permitido.\n\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<validaParametrosInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x4(%rbp)
je     115f <validaParametrosInput+0x2f>
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jl     1186 <validaParametrosInput+0x56>
cmpl   $0x3e7,-0x14(%rbp)
jle    119c <validaParametrosInput+0x6c>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<validaParametrosInput>:
push   %rax
cmp    $0x2,%edi
jne    114d <validaParametrosInput+0x1d>
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
add    $0xfffffc18,%eax
cmp    $0xfffffc18,%eax
jbe    1156 <validaParametrosInput+0x26>
pop    %rax
ret
lea    0xeed(%rip),%rdi
jmp    115d <validaParametrosInput+0x2d>
lea    0xea3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [50 x i8] c"\0ADebe recibir la cantidad de cables de la bomba\0A\0A\00"
@.str.1 = [66 x i8] c"\0ALa cantidad de cables de la bomba no cumple con los permitido.\0A\0A\00"
define void @validaParametrosInput(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %2
%12 = load i8**, i8*** %4
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @atoi(i8* %14)
store i32 %15, i32* %5
%16 = load i32, i32* %5
%17 = icmp slt i32 %16, 1
br i1 %17, label %21, label %18
18: ; preds = %11
%19 = load i32, i32* %5
%20 = icmp sgt i32 %19, 999
br i1 %20, label %21, label %24
21: ; preds = %18, %11
%22 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.1, i64 0, i64 0))
%23 = call i32 @exit(i32 1)
unreachable
24: ; preds = %18
ret void
}

LLVM IR (-O2):
@str = [65 x i8] c"\0ALa cantidad de cables de la bomba no cumple con los permitido.\0A\00"
@str.2 = [49 x i8] c"\0ADebe recibir la cantidad de cables de la bomba\0A\00"
define void @validaParametrosInput(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.2, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @atoi(i8* %9)
%11 = add i32 %10, -1000
%12 = icmp ult i32 %11, -999
br i1 %12, label %13, label %16
13: ; preds = %7
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str, i64 0, i64 0))
%15 = tail call i32 @exit(i32 1)
unreachable
16: ; preds = %7
ret void
}