#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_conversion_instance();
int /*<<< orphan*/ print_usage();
int /*<<< orphan*/ set_details_option();
int /*<<< orphan*/ set_fixed_point(char *);
int /*<<< orphan*/ set_rawdata_input(char *);
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ strncmp(char *, char *, int);
void select_parameter(int argc, char **argv) {
  int count;
  if (2 > argc || NULL == argv) {
    print_usage();
    return;
  }
  init_conversion_instance();
  count = 1;
  while (count < argc) {
    if (!strcmp("-d", argv[count]))
      set_details_option();
    else if (!strncmp("-f", argv[count], 2)) {
      count++;
      set_fixed_point(argv[count]);
    } else
      set_rawdata_input(argv[count]);
    count++;
  }
}


x86 assembly (clang, -O0):
<select_parameter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x2,%eax
cmp    -0x4(%rbp),%eax
jg     1199 <select_parameter+0x29>
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    11a5 <select_parameter+0x35>
mov    $0x0,%al
call   1090 <print_usage@plt>
jmp    1255 <select_parameter+0xe5>
mov    $0x0,%al
call   1080 <init_conversion_instance@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1255 <select_parameter+0xe5>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe2e(%rip),%rdi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    11ec <select_parameter+0x7c>
mov    $0x0,%al
call   1050 <set_details_option@plt>
jmp    1247 <select_parameter+0xd7>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe04(%rip),%rdi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1231 <select_parameter+0xc1>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <set_fixed_point@plt>
jmp    1242 <select_parameter+0xd2>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1060 <set_rawdata_input@plt>
jmp    1247 <select_parameter+0xd7>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11b3 <select_parameter+0x43>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<select_parameter>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     1210 <select_parameter+0xa0>
mov    %rsi,%r13
test   %rsi,%rsi
je     1210 <select_parameter+0xa0>
mov    %edi,%r12d
xor    %eax,%eax
call   1080 <init_conversion_instance@plt>
mov    $0x1,%ebx
lea    0xe5a(%rip),%r14
jmp    11bf <select_parameter+0x4f>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <set_details_option@plt>
add    $0x1,%ebx
cmp    %r12d,%ebx
jge    1225 <select_parameter+0xb5>
movslq %ebx,%r15
mov    0x0(%r13,%r15,8),%rbp
mov    %r14,%rdi
mov    %rbp,%rsi
call   1070 <strcmp@plt>
test   %eax,%eax
je     11b0 <select_parameter+0x40>
lea    0xe26(%rip),%rdi
mov    %rbp,%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     1200 <select_parameter+0x90>
mov    0x0(%r13,%r15,8),%rdi
call   1060 <set_rawdata_input@plt>
jmp    11b7 <select_parameter+0x47>
nopw   0x0(%rax,%rax,1)
lea    0x1(%r15),%ebx
mov    0x8(%r13,%r15,8),%rdi
call   1040 <set_fixed_point@plt>
jmp    11b7 <select_parameter+0x47>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1090 <print_usage@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"-d\00"
@.str.1 = [3 x i8] c"-f\00"
define void @select_parameter(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 sgt i32 2, %6
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i8**, i8*** %4
%10 = icmp eq i8** null, %9
br i1 %10, label %11, label %13
11: ; preds = %8, %2
%12 = call i32 (...) @print_usage()
br label %57
13: ; preds = %8
%14 = call i32 (...) @init_conversion_instance()
store i32 1, i32* %5
br label %15
15: ; preds = %54, %13
%16 = load i32, i32* %5
%17 = load i32, i32* %3
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %57
19: ; preds = %15
%20 = load i8**, i8*** %4
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8*, i8** %20, i64 %22
%24 = load i8*, i8** %23
%25 = call i32 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %24)
%26 = icmp ne i32 %25, 0
br i1 %26, label %29, label %27
27: ; preds = %19
%28 = call i32 (...) @set_details_option()
br label %54
29: ; preds = %19
%30 = load i8**, i8*** %4
%31 = load i32, i32* %5
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8*, i8** %30, i64 %32
%34 = load i8*, i8** %33
%35 = call i32 @strncmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %34, i32 2)
%36 = icmp ne i32 %35, 0
br i1 %36, label %46, label %37
37: ; preds = %29
%38 = load i32, i32* %5
%39 = add nsw i32 %38, 1
store i32 %39, i32* %5
%40 = load i8**, i8*** %4
%41 = load i32, i32* %5
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds i8*, i8** %40, i64 %42
%44 = load i8*, i8** %43
%45 = call i32 @set_fixed_point(i8* %44)
br label %53
46: ; preds = %29
%47 = load i8**, i8*** %4
%48 = load i32, i32* %5
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds i8*, i8** %47, i64 %49
%51 = load i8*, i8** %50
%52 = call i32 @set_rawdata_input(i8* %51)
br label %53
53: ; preds = %46, %37
br label %54
54: ; preds = %53, %27
%55 = load i32, i32* %5
%56 = add nsw i32 %55, 1
store i32 %56, i32* %5
br label %15
57: ; preds = %11, %15
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"-d\00"
@.str.1 = [3 x i8] c"-f\00"
define void @select_parameter(i32 %0, i8** %1) {
%3 = icmp slt i32 %0, 2
%4 = icmp eq i8** %1, null
%5 = or i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (...) @print_usage()
br label %35
8: ; preds = %2
%9 = tail call i32 (...) @init_conversion_instance()
br label %10
10: ; preds = %8, %31
%11 = phi i32 [ %33, %31 ], [ 1, %8 ]
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8*, i8** %1, i64 %12
%14 = load i8*, i8** %13
%15 = tail call i32 @strcmp(i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* dereferenceable(1) %14)
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %10
%18 = tail call i32 (...) @set_details_option()
br label %31
19: ; preds = %10
%20 = tail call i32 @strncmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %14, i32 2)
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %28
22: ; preds = %19
%23 = add nsw i32 %11, 1
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8*, i8** %1, i64 %24
%26 = load i8*, i8** %25
%27 = tail call i32 @set_fixed_point(i8* %26)
br label %31
28: ; preds = %19
%29 = load i8*, i8** %13
%30 = tail call i32 @set_rawdata_input(i8* %29)
br label %31
31: ; preds = %22, %28, %17
%32 = phi i32 [ %11, %28 ], [ %23, %22 ], [ %11, %17 ]
%33 = add nsw i32 %32, 1
%34 = icmp slt i32 %33, %0
br i1 %34, label %10, label %35
35: ; preds = %31, %6
ret void
}