#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 */
typedef int /*<<< orphan*/ int64_t;
typedef int /*<<< orphan*/ COMPASS;

/* Variables and functions */
char const *hazer_format_nanodegrees2compass(int /*<<< orphan*/, char const **,
                                             int);
const char *hazer_format_nanodegrees2compass8(int64_t nanodegrees) {
  static const char *COMPASS[] = {"N", "NE", "E", "SE", "S", "SW", "W", "NW"};
  return hazer_format_nanodegrees2compass(
      nanodegrees, COMPASS, (sizeof(COMPASS) / sizeof(COMPASS[0])));
}


x86 assembly (clang, -O0):
<hazer_format_nanodegrees2compass8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0x2f0b(%rip),%rsi
mov    $0x8,%edx
call   1030 <hazer_format_nanodegrees2compass@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hazer_format_nanodegrees2compass8>:
lea    0x2f19(%rip),%rsi
mov    $0x8,%edx
jmp    1030 <hazer_format_nanodegrees2compass@plt>

LLVM IR (-O0):
@hazer_format_nanodegrees2compass8.COMPASS = internal global [8 x i8*] [i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i32 0, i32 0)]
@.str = [2 x i8] c"N\00"
@.str.1 = [3 x i8] c"NE\00"
@.str.2 = [2 x i8] c"E\00"
@.str.3 = [3 x i8] c"SE\00"
@.str.4 = [2 x i8] c"S\00"
@.str.5 = [3 x i8] c"SW\00"
@.str.6 = [2 x i8] c"W\00"
@.str.7 = [3 x i8] c"NW\00"
define i8* @hazer_format_nanodegrees2compass8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i8* @hazer_format_nanodegrees2compass(i32 %3, i8** getelementptr inbounds ([8 x i8*], [8 x i8*]* @hazer_format_nanodegrees2compass8.COMPASS, i64 0, i64 0), i32 8)
ret i8* %4
}

LLVM IR (-O2):
@hazer_format_nanodegrees2compass8.COMPASS = internal global [8 x i8*] [i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i32 0, i32 0)]
@.str = [2 x i8] c"N\00"
@.str.1 = [3 x i8] c"NE\00"
@.str.2 = [2 x i8] c"E\00"
@.str.3 = [3 x i8] c"SE\00"
@.str.4 = [2 x i8] c"S\00"
@.str.5 = [3 x i8] c"SW\00"
@.str.6 = [2 x i8] c"W\00"
@.str.7 = [3 x i8] c"NW\00"
define i8* @hazer_format_nanodegrees2compass8(i32 %0) {
%2 = tail call i8* @hazer_format_nanodegrees2compass(i32 %0, i8** getelementptr inbounds ([8 x i8*], [8 x i8*]* @hazer_format_nanodegrees2compass8.COMPASS, i64 0, i64 0), i32 8)
ret i8* %2
}