#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*/ printf(char *, ...);
int printDir(char *point, char *vector, int dir) {
  if (dir == 1)
    printf("%s is CLOCKWISE of %s; ", point, vector);
  else if (dir == -1)
    printf("%s is COUNTERCLOCKWISE of %s; ", point, vector);
  else if (dir == 0)
    printf("%s is PARALLEL to %s; ", point, vector);
  else
    printf("Bad comparison (shouldn't get this; ");
  return 0;
}


x86 assembly (clang, -O0):
<printDir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    1148 <printDir+0x38>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11aa <printDir+0x9a>
cmpl   $0xffffffff,-0x14(%rbp)
jne    116d <printDir+0x5d>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a5 <printDir+0x95>
cmpl   $0x0,-0x14(%rbp)
jne    1192 <printDir+0x82>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a0 <printDir+0x90>
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a5 <printDir+0x95>
jmp    11aa <printDir+0x9a>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printDir>:
push   %rax
mov    %rsi,%rax
mov    %rdi,%rsi
cmp    $0xffffffff,%edx
je     112e <printDir+0x1e>
test   %edx,%edx
je     1137 <printDir+0x27>
cmp    $0x1,%edx
jne    114a <printDir+0x3a>
lea    0xed4(%rip),%rdi
jmp    113e <printDir+0x2e>
lea    0xee3(%rip),%rdi
jmp    113e <printDir+0x2e>
lea    0xef9(%rip),%rdi
mov    %rax,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1158 <printDir+0x48>
lea    0xefd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"%s is CLOCKWISE of %s; \00"
@.str.1 = [31 x i8] c"%s is COUNTERCLOCKWISE of %s; \00"
@.str.2 = [23 x i8] c"%s is PARALLEL to %s; \00"
@.str.3 = [37 x i8] c"Bad comparison (shouldn't get this; \00"
define i32 @printDir(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load i8*, i8** %4
%11 = load i8*, i8** %5
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11)
br label %31
13: ; preds = %3
%14 = load i32, i32* %6
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = load i8*, i8** %4
%18 = load i8*, i8** %5
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8* %17, i8* %18)
br label %30
20: ; preds = %13
%21 = load i32, i32* %6
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %27
23: ; preds = %20
%24 = load i8*, i8** %4
%25 = load i8*, i8** %5
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* %24, i8* %25)
br label %29
27: ; preds = %20
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0))
br label %29
29: ; preds = %27, %23
br label %30
30: ; preds = %29, %16
br label %31
31: ; preds = %30, %9
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"%s is CLOCKWISE of %s; \00"
@.str.1 = [31 x i8] c"%s is COUNTERCLOCKWISE of %s; \00"
@.str.2 = [23 x i8] c"%s is PARALLEL to %s; \00"
@.str.3 = [37 x i8] c"Bad comparison (shouldn't get this; \00"
define i32 @printDir(i8* %0, i8* %1, i32 %2) {
switch i32 %2, label %10 [
i32 1, label %4
i32 -1, label %6
i32 0, label %8
]
4: ; preds = %3
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
br label %12
6: ; preds = %3
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %1)
br label %12
8: ; preds = %3
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* %0, i8* %1)
br label %12
10: ; preds = %3
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0))
br label %12
12: ; preds = %6, %10, %8, %4
ret i32 0
}