#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 EXIT_FAILURE;
int EXIT_SUCCESS;
double atof(char *);
int /*<<< orphan*/ computeAE(double, double, double);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int getopt(int, char **, char *);
int /*<<< orphan*/ help();
int /*<<< orphan*/ isParallel(double, double, double, double);
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  double AB, AC, AD, AE;
  int opt;
  while ((opt = getopt(argc, argv, "phs")) != -1) {
    switch (opt) {
    case 'p':
      if (argc == 6) {
        AB = atof(argv[2]);
        AC = atof(argv[3]);
        AD = atof(argv[4]);
        AE = atof(argv[5]);
        if (isParallel(AB, AC, AD, AE))
          fprintf(stdout, "(BD) and (CE) are parallels\n");
        else
          fprintf(stdout, "(BD) and (CE) are not parallels\n");
      } else {
        help();
        return EXIT_FAILURE;
      }
      break;
    case 's':
      if (argc == 5) {
        AB = atof(argv[2]);
        AC = atof(argv[3]);
        AD = atof(argv[4]);
        fprintf(stdout, "The lenght of [AE] is %lf\n", computeAE(AB, AC, AD));
      } else {
        help();
        return EXIT_FAILURE;
      }
      break;
    case 'h':
      help();
      return EXIT_SUCCESS;
      break;
    default:
      help();
      return EXIT_FAILURE;
    }
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe7c(%rip),%rdx
call   1070 <getopt@plt>
mov    %eax,-0x34(%rbp)
cmp    $0xffffffff,%eax
je     135e <main+0x1fe>
mov    -0x34(%rbp),%eax
mov    %eax,-0x38(%rbp)
sub    $0x68,%eax
je     1329 <main+0x1c9>
jmp    11a9 <main+0x49>
mov    -0x38(%rbp),%eax
sub    $0x70,%eax
je     11cb <main+0x6b>
jmp    11ba <main+0x5a>
mov    -0x38(%rbp),%eax
sub    $0x73,%eax
je     1294 <main+0x134>
jmp    1341 <main+0x1e1>
cmpl   $0x6,-0x8(%rbp)
jne    1277 <main+0x117>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
call   1060 <isParallel@plt>
cmp    $0x0,%eax
je     125b <main+0xfb>
mov    0x2d92(%rip),%rax
mov    (%rax),%edi
lea    0xdb5(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    1272 <main+0x112>
mov    0x2d76(%rip),%rax
mov    (%rax),%edi
lea    0xdb6(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    128f <main+0x12f>
mov    $0x0,%al
call   1080 <help@plt>
mov    0x2d5b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    136a <main+0x20a>
jmp    1359 <main+0x1f9>
cmpl   $0x5,-0x8(%rbp)
jne    130c <main+0x1ac>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x28(%rbp)
mov    0x2cfd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x3c(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
call   1040 <computeAE@plt>
mov    -0x3c(%rbp),%edi
mov    %eax,%edx
lea    0xd42(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    1324 <main+0x1c4>
mov    $0x0,%al
call   1080 <help@plt>
mov    0x2cc6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    136a <main+0x20a>
jmp    1359 <main+0x1f9>
mov    $0x0,%al
call   1080 <help@plt>
mov    0x2c99(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    136a <main+0x20a>
mov    $0x0,%al
call   1080 <help@plt>
mov    0x2c91(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    136a <main+0x20a>
jmp    1176 <main+0x16>
mov    0x2c6b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xe86(%rip),%r14
mov    0x2e4f(%rip),%rax
mov    %rax,0x8(%rsp)
mov    0x2e4b(%rip),%r12
lea    0xeae(%rip),%r13
jmp    11ae <main+0x4e>
cs nopw 0x0(%rax,%rax,1)
lea    0xe5d(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1070 <getopt@plt>
cmp    $0x72,%eax
jg     1240 <main+0xe0>
cmp    $0x70,%eax
jne    129d <main+0x13d>
cmp    $0x6,%ebp
jne    12a7 <main+0x147>
mov    0x10(%rbx),%rdi
call   1030 <atof@plt>
movsd  %xmm0,0x18(%rsp)
mov    0x18(%rbx),%rdi
call   1030 <atof@plt>
movsd  %xmm0,0x10(%rsp)
mov    0x20(%rbx),%rdi
call   1030 <atof@plt>
movsd  %xmm0,0x20(%rsp)
mov    0x28(%rbx),%rdi
call   1030 <atof@plt>
movaps %xmm0,%xmm3
movsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x20(%rsp),%xmm2
call   1060 <isParallel@plt>
mov    (%r12),%edi
test   %eax,%eax
jne    11a0 <main+0x40>
lea    0xde8(%rip),%rsi
jmp    11a7 <main+0x47>
xchg   %ax,%ax
cmp    $0x73,%eax
jne    12a7 <main+0x147>
cmp    $0x5,%ebp
jne    12a7 <main+0x147>
mov    0x10(%rbx),%rdi
call   1030 <atof@plt>
movsd  %xmm0,0x18(%rsp)
mov    0x18(%rbx),%rdi
call   1030 <atof@plt>
movsd  %xmm0,0x10(%rsp)
mov    0x20(%rbx),%rdi
call   1030 <atof@plt>
movaps %xmm0,%xmm2
mov    (%r12),%r15d
movsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1040 <computeAE@plt>
mov    %r15d,%edi
mov    %r13,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
jmp    11ae <main+0x4e>
cmp    $0xffffffff,%eax
je     12c1 <main+0x161>
cmp    $0x68,%eax
je     12b3 <main+0x153>
mov    0x2d32(%rip),%rax
mov    %rax,0x8(%rsp)
xor    %eax,%eax
call   1080 <help@plt>
mov    0x8(%rsp),%rax
jmp    12c8 <main+0x168>
mov    0x2d08(%rip),%rax
mov    (%rax),%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"phs\00"
@stdout = global i32 0
@.str.1 = [29 x i8] c"(BD) and (CE) are parallels\0A\00"
@.str.2 = [33 x i8] c"(BD) and (CE) are not parallels\0A\00"
@EXIT_FAILURE = global i32 0
@.str.3 = [27 x i8] c"The lenght of [AE] is %lf\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %11
11: ; preds = %87, %2
%12 = load i32, i32* %4
%13 = load i8**, i8*** %5
%14 = call i32 @getopt(i32 %12, i8** %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32 %14, i32* %10
%15 = icmp ne i32 %14, -1
br i1 %15, label %16, label %88
16: ; preds = %11
%17 = load i32, i32* %10
switch i32 %17, label %84 [
i32 112, label %18
i32 115, label %55
i32 104, label %81
]
18: ; preds = %16
%19 = load i32, i32* %4
%20 = icmp eq i32 %19, 6
br i1 %20, label %21, label %51
21: ; preds = %18
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 2
%24 = load i8*, i8** %23
%25 = call double @atof(i8* %24)
store double %25, double* %6
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 3
%28 = load i8*, i8** %27
%29 = call double @atof(i8* %28)
store double %29, double* %7
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 4
%32 = load i8*, i8** %31
%33 = call double @atof(i8* %32)
store double %33, double* %8
%34 = load i8**, i8*** %5
%35 = getelementptr inbounds i8*, i8** %34, i64 5
%36 = load i8*, i8** %35
%37 = call double @atof(i8* %36)
store double %37, double* %9
%38 = load double, double* %6
%39 = load double, double* %7
%40 = load double, double* %8
%41 = load double, double* %9
%42 = call i32 @isParallel(double %38, double %39, double %40, double %41)
%43 = icmp ne i32 %42, 0
br i1 %43, label %44, label %47
44: ; preds = %21
%45 = load i32, i32* @stdout
%46 = call i32 (i32, i8*, ...) @fprintf(i32 %45, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
br label %50
47: ; preds = %21
%48 = load i32, i32* @stdout
%49 = call i32 (i32, i8*, ...) @fprintf(i32 %48, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
br label %50
50: ; preds = %47, %44
br label %54
51: ; preds = %18
%52 = call i32 (...) @help()
%53 = load i32, i32* @EXIT_FAILURE
store i32 %53, i32* %3
br label %90
54: ; preds = %50
br label %87
55: ; preds = %16
%56 = load i32, i32* %4
%57 = icmp eq i32 %56, 5
br i1 %57, label %58, label %77
58: ; preds = %55
%59 = load i8**, i8*** %5
%60 = getelementptr inbounds i8*, i8** %59, i64 2
%61 = load i8*, i8** %60
%62 = call double @atof(i8* %61)
store double %62, double* %6
%63 = load i8**, i8*** %5
%64 = getelementptr inbounds i8*, i8** %63, i64 3
%65 = load i8*, i8** %64
%66 = call double @atof(i8* %65)
store double %66, double* %7
%67 = load i8**, i8*** %5
%68 = getelementptr inbounds i8*, i8** %67, i64 4
%69 = load i8*, i8** %68
%70 = call double @atof(i8* %69)
store double %70, double* %8
%71 = load i32, i32* @stdout
%72 = load double, double* %6
%73 = load double, double* %7
%74 = load double, double* %8
%75 = call i32 @computeAE(double %72, double %73, double %74)
%76 = call i32 (i32, i8*, ...) @fprintf(i32 %71, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 %75)
br label %80
77: ; preds = %55
%78 = call i32 (...) @help()
%79 = load i32, i32* @EXIT_FAILURE
store i32 %79, i32* %3
br label %90
80: ; preds = %58
br label %87
81: ; preds = %16
%82 = call i32 (...) @help()
%83 = load i32, i32* @EXIT_SUCCESS
store i32 %83, i32* %3
br label %90
84: ; preds = %16
%85 = call i32 (...) @help()
%86 = load i32, i32* @EXIT_FAILURE
store i32 %86, i32* %3
br label %90
87: ; preds = %80, %54
br label %11
88: ; preds = %11
%89 = load i32, i32* @EXIT_SUCCESS
store i32 %89, i32* %3
br label %90
90: ; preds = %88, %84, %81, %77, %51
%91 = load i32, i32* %3
ret i32 %91
}

LLVM IR (-O2):
@.str = [4 x i8] c"phs\00"
@stdout = global i32 0
@.str.1 = [29 x i8] c"(BD) and (CE) are parallels\0A\00"
@.str.2 = [33 x i8] c"(BD) and (CE) are not parallels\0A\00"
@EXIT_FAILURE = global i32 0
@.str.3 = [27 x i8] c"The lenght of [AE] is %lf\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = icmp eq i32 %0, 5
%4 = getelementptr inbounds i8*, i8** %1, i64 2
%5 = getelementptr inbounds i8*, i8** %1, i64 3
%6 = getelementptr inbounds i8*, i8** %1, i64 4
%7 = icmp eq i32 %0, 6
%8 = getelementptr inbounds i8*, i8** %1, i64 5
br label %9
9: ; preds = %28, %2
%10 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
switch i32 %10, label %40 [
i32 -1, label %44
i32 112, label %11
i32 115, label %29
i32 104, label %41
]
11: ; preds = %9
br i1 %7, label %12, label %41
12: ; preds = %11
%13 = load i8*, i8** %4
%14 = tail call double @atof(i8* %13)
%15 = load i8*, i8** %5
%16 = tail call double @atof(i8* %15)
%17 = load i8*, i8** %6
%18 = tail call double @atof(i8* %17)
%19 = load i8*, i8** %8
%20 = tail call double @atof(i8* %19)
%21 = tail call i32 @isParallel(double %14, double %16, double %18, double %20)
%22 = icmp eq i32 %21, 0
%23 = load i32, i32* @stdout
br i1 %22, label %26, label %24
24: ; preds = %12
%25 = tail call i32 (i32, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
br label %28
26: ; preds = %12
%27 = tail call i32 (i32, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
br label %28
28: ; preds = %26, %24, %30
br label %9
29: ; preds = %9
br i1 %3, label %30, label %41
30: ; preds = %29
%31 = load i8*, i8** %4
%32 = tail call double @atof(i8* %31)
%33 = load i8*, i8** %5
%34 = tail call double @atof(i8* %33)
%35 = load i8*, i8** %6
%36 = tail call double @atof(i8* %35)
%37 = load i32, i32* @stdout
%38 = tail call i32 @computeAE(double %32, double %34, double %36)
%39 = tail call i32 (i32, i8*, ...) @fprintf(i32 %37, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 %38)
br label %28
40: ; preds = %9
br label %41
41: ; preds = %9, %29, %11, %40
%42 = phi i32* [ @EXIT_FAILURE, %40 ], [ @EXIT_SUCCESS, %9 ], [ @EXIT_FAILURE, %29 ], [ @EXIT_FAILURE, %11 ]
%43 = tail call i32 (...) @help()
br label %44
44: ; preds = %9, %41
%45 = phi i32* [ %42, %41 ], [ @EXIT_SUCCESS, %9 ]
%46 = load i32, i32* %45
ret i32 %46
}