#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_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  int i;
  if (argc < 2) {
    fprintf(stderr, "Numero de argumentos incompleto\n");
    exit(EXIT_FAILURE);
  }
  if (strcmp(argv[1], "al") == 0)
    printf("hemos recibido \"al\"\n");
  else if (strcmp(argv[1], "va") == 0)
    printf("hemos recibido \"va\"\n");
  else if (strcmp(argv[1], "ro") == 0)
    printf("hemos recibido \"ro\"\n");
  else {
    fprintf(stderr, "Parametro incorrecto\n");
    exit(EXIT_FAILURE);
  }
  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)
jge    1183 <main+0x43>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
lea    0xe90(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2e5c(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe8f(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11b2 <main+0x72>
lea    0xe7c(%rip),%rdi
call   1030 <printf@plt>
jmp    123d <main+0xfd>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe78(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11e1 <main+0xa1>
lea    0xe65(%rip),%rdi
call   1030 <printf@plt>
jmp    1238 <main+0xf8>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe61(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1210 <main+0xd0>
lea    0xe4e(%rip),%rdi
call   1030 <printf@plt>
jmp    1233 <main+0xf3>
mov    0x2dc9(%rip),%rax
mov    (%rax),%edi
lea    0xe49(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2dac(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
jmp    1238 <main+0xf8>
jmp    123d <main+0xfd>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x1,%edi
jle    11aa <main+0x6a>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
lea    0xecd(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1191 <main+0x51>
mov    0x8(%rbx),%rdi
lea    0xebb(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     119a <main+0x5a>
mov    0x8(%rbx),%rdi
lea    0xea9(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    11bc <main+0x7c>
lea    0xeb1(%rip),%rdi
jmp    11a1 <main+0x61>
lea    0xed0(%rip),%rdi
jmp    11a1 <main+0x61>
lea    0xeb3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    0x2e2f(%rip),%rax
mov    (%rax),%edi
lea    0xe46(%rip),%rsi
jmp    11cc <main+0x8c>
mov    0x2e1d(%rip),%rax
mov    (%rax),%edi
lea    0xe5e(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2e00(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"Numero de argumentos incompleto\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [3 x i8] c"al\00"
@.str.2 = [21 x i8] c"hemos recibido \22al\22\0A\00"
@.str.3 = [3 x i8] c"va\00"
@.str.4 = [21 x i8] c"hemos recibido \22va\22\0A\00"
@.str.5 = [3 x i8] c"ro\00"
@.str.6 = [21 x i8] c"hemos recibido \22ro\22\0A\00"
@.str.7 = [22 x i8] c"Parametro incorrecto\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 slt i32 %7, 2
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @exit(i32 %12)
unreachable
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %14
%21 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
br label %45
22: ; preds = %14
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 1
%25 = load i8*, i8** %24
%26 = call i64 @strcmp(i8* %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %30
28: ; preds = %22
%29 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0))
br label %44
30: ; preds = %22
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 1
%33 = load i8*, i8** %32
%34 = call i64 @strcmp(i8* %33, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %38
36: ; preds = %30
%37 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0))
br label %43
38: ; preds = %30
%39 = load i32, i32* @stderr
%40 = call i32 @fprintf(i32 %39, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0))
%41 = load i32, i32* @EXIT_FAILURE
%42 = call i32 @exit(i32 %41)
unreachable
43: ; preds = %36
br label %44
44: ; preds = %43, %28
br label %45
45: ; preds = %44, %20
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"Numero de argumentos incompleto\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [3 x i8] c"al\00"
@.str.3 = [3 x i8] c"va\00"
@.str.5 = [3 x i8] c"ro\00"
@.str.7 = [22 x i8] c"Parametro incorrecto\0A\00"
@str = [20 x i8] c"hemos recibido \22ro\22\00"
@str.8 = [20 x i8] c"hemos recibido \22va\22\00"
@str.9 = [20 x i8] c"hemos recibido \22al\22\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i64 @strcmp(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %27, label %14
14: ; preds = %9
%15 = load i8*, i8** %10
%16 = tail call i64 @strcmp(i8* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %27, label %18
18: ; preds = %14
%19 = load i8*, i8** %10
%20 = tail call i64 @strcmp(i8* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %27, label %22
22: ; preds = %18
%23 = load i32, i32* @stderr
%24 = tail call i32 @fprintf(i32 %23, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0))
%25 = load i32, i32* @EXIT_FAILURE
%26 = tail call i32 @exit(i32 %25)
unreachable
27: ; preds = %18, %14, %9
%28 = phi i8* [ getelementptr inbounds ([20 x i8], [20 x i8]* @str.9, i64 0, i64 0), %9 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @str.8, i64 0, i64 0), %14 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0), %18 ]
%29 = tail call i32 @puts(i8* dereferenceable(1) %28)
ret i32 0
}