#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*/ strcmp(char *, char *);
int parsearParametros(int argc, char **argv) {
  if (argc != 3) {
    return 3;
  } else {
    if (!strcmp(argv[1], "-c")) {
      return 1;
    } else if (!strcmp(argv[1], "-x")) {
      return 2;
    } else {
      return 3;
    }
  }
}


x86 assembly (clang, -O0):
<parsearParametros>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     1135 <parsearParametros+0x25>
movl   $0x3,-0x4(%rbp)
jmp    118e <parsearParametros+0x7e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xebc(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    115e <parsearParametros+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    118e <parsearParametros+0x7e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe96(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1187 <parsearParametros+0x77>
movl   $0x2,-0x4(%rbp)
jmp    118e <parsearParametros+0x7e>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parsearParametros>:
push   %rbx
mov    $0x3,%eax
cmp    $0x3,%edi
jne    114c <parsearParametros+0x3c>
mov    0x8(%rsi),%rbx
lea    0xeda(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     114e <parsearParametros+0x3e>
lea    0xeca(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
cmp    $0x1,%eax
mov    $0x3,%eax
sbb    $0x0,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"-c\00"
@.str.1 = [3 x i8] c"-x\00"
define i32 @parsearParametros(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 3
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 3, i32* %3
br label %24
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @strcmp(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%14 = icmp ne i32 %13, 0
br i1 %14, label %16, label %15
15: ; preds = %9
store i32 1, i32* %3
br label %24
16: ; preds = %9
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = call i32 @strcmp(i8* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%21 = icmp ne i32 %20, 0
br i1 %21, label %23, label %22
22: ; preds = %16
store i32 2, i32* %3
br label %24
23: ; preds = %16
store i32 3, i32* %3
br label %24
24: ; preds = %23, %22, %15, %8
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
@.str = [3 x i8] c"-c\00"
@.str.1 = [3 x i8] c"-x\00"
define i32 @parsearParametros(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %6, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = tail call i32 @strcmp(i8* dereferenceable(1) %6, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i32 %10, 0
%12 = select i1 %11, i32 2, i32 3
br label %13
13: ; preds = %9, %4, %2
%14 = phi i32 [ 3, %2 ], [ 1, %4 ], [ %12, %9 ]
ret i32 %14
}