#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 */
long atol(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ print_help();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strcpy(char *, char *);
void read_input_parameters(int argc, char **argv, char *docfile,
                           char *modelfile, char *predictionsfile,
                           long int *verbosity, long int *pred_format) {
  long i;
  strcpy(modelfile, "svm_model");
  strcpy(predictionsfile, "svm_predictions");
  (*verbosity) = 2;
  (*pred_format) = 1;
  for (i = 1; (i < argc) && ((argv[i])[0] == '-'); i++) {
    switch ((argv[i])[1]) {
    case 'h':
      print_help();
      exit(0);
    case 'v':
      i++;
      (*verbosity) = atol(argv[i]);
      break;
    case 'f':
      i++;
      (*pred_format) = atol(argv[i]);
      break;
    default:
      printf("\nUnrecognized option %s!\n\n", argv[i]);
      print_help();
      exit(0);
    }
  }
  if ((i + 1) >= argc) {
    printf("\nNot enough input parameters!\n\n");
    print_help();
    exit(0);
  }
  strcpy(docfile, argv[i]);
  strcpy(modelfile, argv[i + 1]);
  if ((i + 2) < argc) {
    strcpy(predictionsfile, argv[i + 2]);
  }
  if (((*pred_format) != 0) && ((*pred_format) != 1)) {
    printf("\nOutput format can only take the values 0 or 1!\n\n");
    print_help();
    exit(0);
  }
}


x86 assembly (clang, -O0):
<read_input_parameters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xe82(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x28(%rbp),%rdi
lea    0xe7c(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x30(%rbp),%rax
movq   $0x2,(%rax)
mov    0x10(%rbp),%rax
movq   $0x1,(%rax)
movq   $0x1,-0x38(%rbp)
mov    -0x38(%rbp),%rcx
movslq -0x4(%rbp),%rdx
xor    %eax,%eax
cmp    %rdx,%rcx
mov    %al,-0x39(%rbp)
jge    11df <read_input_parameters+0x8f>
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
sete   %al
mov    %al,-0x39(%rbp)
mov    -0x39(%rbp),%al
test   $0x1,%al
jne    11ef <read_input_parameters+0x9f>
jmp    12d6 <read_input_parameters+0x186>
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl 0x1(%rax),%eax
mov    %eax,-0x40(%rbp)
sub    $0x66,%eax
je     126c <read_input_parameters+0x11c>
jmp    1210 <read_input_parameters+0xc0>
mov    -0x40(%rbp),%eax
sub    $0x68,%eax
je     1232 <read_input_parameters+0xe2>
jmp    1221 <read_input_parameters+0xd1>
mov    -0x40(%rbp),%eax
sub    $0x76,%eax
je     1240 <read_input_parameters+0xf0>
jmp    1298 <read_input_parameters+0x148>
mov    $0x0,%al
call   1060 <print_help@plt>
xor    %edi,%edi
call   1070 <exit@plt>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1050 <atol@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
mov    %rcx,(%rax)
jmp    12c0 <read_input_parameters+0x170>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1050 <atol@plt>
mov    %rax,%rcx
mov    0x10(%rbp),%rax
mov    %rcx,(%rax)
jmp    12c0 <read_input_parameters+0x170>
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xd6f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <print_help@plt>
xor    %edi,%edi
call   1070 <exit@plt>
jmp    12c5 <read_input_parameters+0x175>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    11b1 <read_input_parameters+0x61>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
movslq -0x4(%rbp),%rcx
cmp    %rcx,%rax
jl     1307 <read_input_parameters+0x1b7>
lea    0xd43(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <print_help@plt>
xor    %edi,%edi
call   1070 <exit@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    0x8(%rax,%rcx,8),%rsi
call   1030 <strcpy@plt>
mov    -0x38(%rbp),%rax
add    $0x2,%rax
movslq -0x4(%rbp),%rcx
cmp    %rcx,%rax
jge    135d <read_input_parameters+0x20d>
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    0x10(%rax,%rcx,8),%rsi
call   1030 <strcpy@plt>
mov    0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1395 <read_input_parameters+0x245>
mov    0x10(%rbp),%rax
cmpq   $0x1,(%rax)
je     1395 <read_input_parameters+0x245>
lea    0xcd5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <print_help@plt>
xor    %edi,%edi
call   1070 <exit@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_input_parameters>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9,%r15
mov    %r8,%rbp
mov    %rdx,0x8(%rsp)
mov    %rsi,%rbx
mov    %edi,%r14d
mov    0x50(%rsp),%r12
lea    0xe75(%rip),%rsi
mov    %rcx,0x10(%rsp)
mov    %rcx,%rdi
call   1030 <strcpy@plt>
lea    0xe6b(%rip),%rsi
mov    %rbp,(%rsp)
mov    %rbp,%rdi
call   1030 <strcpy@plt>
movq   $0x2,(%r15)
movq   $0x1,(%r12)
movslq %r14d,%r14
mov    $0x1,%ebp
cmp    $0x2,%r14d
jl     1219 <read_input_parameters+0xb9>
mov    $0x1,%ebp
jmp    11e7 <read_input_parameters+0x87>
nop
mov    0x8(%rbx,%rbp,8),%rdi
call   1060 <atol@plt>
mov    %rax,0x0(%r13)
add    $0x2,%rbp
cmp    %r14,%rbp
jge    1219 <read_input_parameters+0xb9>
mov    (%rbx,%rbp,8),%rsi
cmpb   $0x2d,(%rsi)
jne    1219 <read_input_parameters+0xb9>
movsbl 0x1(%rsi),%eax
mov    %r12,%r13
cmp    $0x66,%eax
je     11d0 <read_input_parameters+0x70>
mov    %r15,%r13
cmp    $0x76,%eax
je     11d0 <read_input_parameters+0x70>
cmp    $0x68,%eax
je     1281 <read_input_parameters+0x121>
lea    0xe0a(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1281 <read_input_parameters+0x121>
lea    0x1(%rbp),%rax
cmp    %r14,%rax
jge    126c <read_input_parameters+0x10c>
mov    (%rbx,%rbp,8),%rsi
mov    0x8(%rsp),%rdi
call   1030 <strcpy@plt>
mov    0x8(%rbx,%rbp,8),%rsi
mov    0x10(%rsp),%rdi
call   1030 <strcpy@plt>
lea    0x2(%rbp),%rax
cmp    %r14,%rax
jge    1256 <read_input_parameters+0xf6>
mov    0x10(%rbx,%rbp,8),%rsi
mov    (%rsp),%rdi
call   1030 <strcpy@plt>
cmpq   $0x2,(%r12)
jae    1275 <read_input_parameters+0x115>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xdf3(%rip),%rdi
jmp    127c <read_input_parameters+0x11c>
lea    0xdb9(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1070 <print_help@plt>
xor    %edi,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"svm_model\00"
@.str.1 = [16 x i8] c"svm_predictions\00"
@.str.2 = [27 x i8] c"\0AUnrecognized option %s!\0A\0A\00"
@.str.3 = [32 x i8] c"\0ANot enough input parameters!\0A\0A\00"
@.str.4 = [50 x i8] c"\0AOutput format can only take the values 0 or 1!\0A\0A\00"
define void @read_input_parameters(i32 %0, i8** %1, i8* %2, i8* %3, i8* %4, i64* %5, i64* %6) {
%8 = alloca i32
%9 = alloca i8**
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i64*
%14 = alloca i64*
%15 = alloca i64
store i32 %0, i32* %8
store i8** %1, i8*** %9
store i8* %2, i8** %10
store i8* %3, i8** %11
store i8* %4, i8** %12
store i64* %5, i64** %13
store i64* %6, i64** %14
%16 = load i8*, i8** %11
%17 = call i32 @strcpy(i8* %16, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%18 = load i8*, i8** %12
%19 = call i32 @strcpy(i8* %18, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%20 = load i64*, i64** %13
store i64 2, i64* %20
%21 = load i64*, i64** %14
store i64 1, i64* %21
store i64 1, i64* %15
br label %22
22: ; preds = %76, %7
%23 = load i64, i64* %15
%24 = load i32, i32* %8
%25 = sext i32 %24 to i64
%26 = icmp slt i64 %23, %25
br i1 %26, label %27, label %36
27: ; preds = %22
%28 = load i8**, i8*** %9
%29 = load i64, i64* %15
%30 = getelementptr inbounds i8*, i8** %28, i64 %29
%31 = load i8*, i8** %30
%32 = getelementptr inbounds i8, i8* %31, i64 0
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = icmp eq i32 %34, 45
br label %36
36: ; preds = %27, %22
%37 = phi i1 [ false, %22 ], [ %35, %27 ]
br i1 %37, label %38, label %79
38: ; preds = %36
%39 = load i8**, i8*** %9
%40 = load i64, i64* %15
%41 = getelementptr inbounds i8*, i8** %39, i64 %40
%42 = load i8*, i8** %41
%43 = getelementptr inbounds i8, i8* %42, i64 1
%44 = load i8, i8* %43
%45 = sext i8 %44 to i32
switch i32 %45, label %67 [
i32 104, label %46
i32 118, label %49
i32 102, label %58
]
46: ; preds = %38
%47 = call i32 (...) @print_help()
%48 = call i32 @exit(i32 0)
unreachable
49: ; preds = %38
%50 = load i64, i64* %15
%51 = add nsw i64 %50, 1
store i64 %51, i64* %15
%52 = load i8**, i8*** %9
%53 = load i64, i64* %15
%54 = getelementptr inbounds i8*, i8** %52, i64 %53
%55 = load i8*, i8** %54
%56 = call i64 @atol(i8* %55)
%57 = load i64*, i64** %13
store i64 %56, i64* %57
br label %75
58: ; preds = %38
%59 = load i64, i64* %15
%60 = add nsw i64 %59, 1
store i64 %60, i64* %15
%61 = load i8**, i8*** %9
%62 = load i64, i64* %15
%63 = getelementptr inbounds i8*, i8** %61, i64 %62
%64 = load i8*, i8** %63
%65 = call i64 @atol(i8* %64)
%66 = load i64*, i64** %14
store i64 %65, i64* %66
br label %75
67: ; preds = %38
%68 = load i8**, i8*** %9
%69 = load i64, i64* %15
%70 = getelementptr inbounds i8*, i8** %68, i64 %69
%71 = load i8*, i8** %70
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i8* %71)
%73 = call i32 (...) @print_help()
%74 = call i32 @exit(i32 0)
unreachable
75: ; preds = %58, %49
br label %76
76: ; preds = %75
%77 = load i64, i64* %15
%78 = add nsw i64 %77, 1
store i64 %78, i64* %15
br label %22
79: ; preds = %36
%80 = load i64, i64* %15
%81 = add nsw i64 %80, 1
%82 = load i32, i32* %8
%83 = sext i32 %82 to i64
%84 = icmp sge i64 %81, %83
br i1 %84, label %85, label %89
85: ; preds = %79
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
%87 = call i32 (...) @print_help()
%88 = call i32 @exit(i32 0)
unreachable
89: ; preds = %79
%90 = load i8*, i8** %10
%91 = load i8**, i8*** %9
%92 = load i64, i64* %15
%93 = getelementptr inbounds i8*, i8** %91, i64 %92
%94 = load i8*, i8** %93
%95 = call i32 @strcpy(i8* %90, i8* %94)
%96 = load i8*, i8** %11
%97 = load i8**, i8*** %9
%98 = load i64, i64* %15
%99 = add nsw i64 %98, 1
%100 = getelementptr inbounds i8*, i8** %97, i64 %99
%101 = load i8*, i8** %100
%102 = call i32 @strcpy(i8* %96, i8* %101)
%103 = load i64, i64* %15
%104 = add nsw i64 %103, 2
%105 = load i32, i32* %8
%106 = sext i32 %105 to i64
%107 = icmp slt i64 %104, %106
br i1 %107, label %108, label %116
108: ; preds = %89
%109 = load i8*, i8** %12
%110 = load i8**, i8*** %9
%111 = load i64, i64* %15
%112 = add nsw i64 %111, 2
%113 = getelementptr inbounds i8*, i8** %110, i64 %112
%114 = load i8*, i8** %113
%115 = call i32 @strcpy(i8* %109, i8* %114)
br label %116
116: ; preds = %108, %89
%117 = load i64*, i64** %14
%118 = load i64, i64* %117
%119 = icmp ne i64 %118, 0
br i1 %119, label %120, label %128
120: ; preds = %116
%121 = load i64*, i64** %14
%122 = load i64, i64* %121
%123 = icmp ne i64 %122, 1
br i1 %123, label %124, label %128
124: ; preds = %120
%125 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.4, i64 0, i64 0))
%126 = call i32 (...) @print_help()
%127 = call i32 @exit(i32 0)
unreachable
128: ; preds = %120, %116
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"svm_model\00"
@.str.1 = [16 x i8] c"svm_predictions\00"
@.str.2 = [27 x i8] c"\0AUnrecognized option %s!\0A\0A\00"
@str = [49 x i8] c"\0AOutput format can only take the values 0 or 1!\0A\00"
@str.5 = [31 x i8] c"\0ANot enough input parameters!\0A\00"
define void @read_input_parameters(i32 %0, i8** nocapture %1, i8* %2, i8* %3, i8* %4, i64* nocapture writeonly %5, i64* nocapture %6) {
%8 = tail call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
store i64 2, i64* %5
store i64 1, i64* %6
%10 = sext i32 %0 to i64
%11 = icmp sgt i32 %0, 1
br i1 %11, label %12, label %38
12: ; preds = %7, %30
%13 = phi i64 [ %36, %30 ], [ 1, %7 ]
%14 = getelementptr inbounds i8*, i8** %1, i64 %13
%15 = load i8*, i8** %14
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 45
br i1 %17, label %18, label %38
18: ; preds = %12
%19 = getelementptr inbounds i8, i8* %15, i64 1
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
switch i32 %21, label %26 [
i32 104, label %22
i32 118, label %30
i32 102, label %25
]
22: ; preds = %18
%23 = tail call i32 (...) @print_help()
%24 = tail call i32 @exit(i32 0)
unreachable
25: ; preds = %18
br label %30
26: ; preds = %18
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i8* %15)
%28 = tail call i32 (...) @print_help()
%29 = tail call i32 @exit(i32 0)
unreachable
30: ; preds = %18, %25
%31 = phi i64* [ %6, %25 ], [ %5, %18 ]
%32 = add nuw nsw i64 %13, 1
%33 = getelementptr inbounds i8*, i8** %1, i64 %32
%34 = load i8*, i8** %33
%35 = tail call i64 @atol(i8* %34)
store i64 %35, i64* %31
%36 = add nuw nsw i64 %13, 2
%37 = icmp slt i64 %36, %10
br i1 %37, label %12, label %38
38: ; preds = %12, %30, %7
%39 = phi i64 [ 1, %7 ], [ %36, %30 ], [ %13, %12 ]
%40 = add nsw i64 %39, 1
%41 = icmp slt i64 %40, %10
br i1 %41, label %46, label %42
42: ; preds = %38
%43 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.5, i64 0, i64 0))
%44 = tail call i32 (...) @print_help()
%45 = tail call i32 @exit(i32 0)
unreachable
46: ; preds = %38
%47 = getelementptr inbounds i8*, i8** %1, i64 %39
%48 = load i8*, i8** %47
%49 = tail call i32 @strcpy(i8* %2, i8* %48)
%50 = getelementptr inbounds i8*, i8** %1, i64 %40
%51 = load i8*, i8** %50
%52 = tail call i32 @strcpy(i8* %3, i8* %51)
%53 = add nsw i64 %39, 2
%54 = icmp slt i64 %53, %10
br i1 %54, label %55, label %59
55: ; preds = %46
%56 = getelementptr inbounds i8*, i8** %1, i64 %53
%57 = load i8*, i8** %56
%58 = tail call i32 @strcpy(i8* %4, i8* %57)
br label %59
59: ; preds = %55, %46
%60 = load i64, i64* %6
%61 = icmp ult i64 %60, 2
br i1 %61, label %66, label %62
62: ; preds = %59
%63 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
%64 = tail call i32 (...) @print_help()
%65 = tail call i32 @exit(i32 0)
unreachable
66: ; preds = %59
ret void
}