#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*/ endwin();
int /*<<< orphan*/ getch();
int /*<<< orphan*/ getmaxyx(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ mvprintw(int, int, char *, ...);
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ stdscr;
int strlen(char *);
int main() {
  char mesg[] = "Accelerometer Test";
  int row, col;
  initscr();
  getmaxyx(stdscr, row, col);
  mvprintw(row / 2, (col - strlen(mesg)) / 2, "%s", mesg);
  mvprintw(1, 0, "Gyro");
  mvprintw(2, 0, "X: %4.2f\n", 73.25);
  mvprintw(3, 0, "Y: %4.2f\n", -14.82);
  mvprintw(4, 0, "Z: %4.2f\n", 124.37);
  mvprintw(1, 16, "Acc-Angle");
  mvprintw(2, 16, "X: %4.2f\n", 73.25);
  mvprintw(3, 16, "Y: %4.2f\n", -14.82);
  mvprintw(4, 16, "Z: %4.2f\n", 124.37);
  mvprintw(1, 32, "CF-Angle");
  mvprintw(2, 32, "X: %4.2f\n", 73.25);
  mvprintw(3, 32, "Y: %4.2f\n", -14.82);
  mvprintw(4, 32, "Z: %4.2f\n", 124.37);
  mvprintw(6, 0, "Loop Time %3.1f", 20.0);
  refresh();
  getch();
  endwin();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xe9a(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe97(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xe94(%rip),%ax
mov    %ax,-0x10(%rbp)
mov    0xe8c(%rip),%al
mov    %al,-0xe(%rbp)
mov    $0x0,%al
call   1040 <initscr@plt>
mov    0x2e31(%rip),%rax
mov    (%rax),%edi
mov    -0x24(%rbp),%esi
mov    -0x28(%rbp),%edx
call   1050 <getmaxyx@plt>
mov    -0x24(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x30(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x2c(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x30(%rbp),%edi
mov    %eax,%ecx
mov    -0x2c(%rbp),%eax
sub    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    -0x20(%rbp),%rcx
lea    0xe33(%rip),%rdx
mov    $0x0,%al
call   1090 <mvprintw@plt>
mov    $0x1,%edi
xor    %esi,%esi
lea    0xe21(%rip),%rdx
mov    $0x0,%al
call   1090 <mvprintw@plt>
mov    $0x2,%edi
xor    %esi,%esi
lea    0xe11(%rip),%rdx
movsd  0xde6(%rip),%xmm0
mov    $0x1,%al
call   1090 <mvprintw@plt>
mov    $0x3,%edi
xor    %esi,%esi
lea    0xdfe(%rip),%rdx
movsd  0xdc1(%rip),%xmm0
mov    $0x1,%al
call   1090 <mvprintw@plt>
mov    $0x4,%edi
xor    %esi,%esi
lea    0xdeb(%rip),%rdx
movsd  0xd9c(%rip),%xmm0
mov    $0x1,%al
call   1090 <mvprintw@plt>
mov    $0x1,%edi
mov    $0x10,%esi
lea    0xdd5(%rip),%rdx
mov    $0x0,%al
call   1090 <mvprintw@plt>
mov    $0x2,%edi
mov    $0x10,%esi
lea    0xd9f(%rip),%rdx
movsd  0xd74(%rip),%xmm0
mov    $0x1,%al
call   1090 <mvprintw@plt>
mov    $0x3,%edi
mov    $0x10,%esi
lea    0xd89(%rip),%rdx
movsd  0xd4c(%rip),%xmm0
mov    $0x1,%al
call   1090 <mvprintw@plt>
mov    $0x4,%edi
mov    $0x10,%esi
lea    0xd73(%rip),%rdx
movsd  0xd24(%rip),%xmm0
mov    $0x1,%al
call   1090 <mvprintw@plt>
mov    $0x1,%edi
mov    $0x20,%esi
lea    0xd67(%rip),%rdx
mov    $0x0,%al
call   1090 <mvprintw@plt>
mov    $0x2,%edi
mov    $0x20,%esi
lea    0xd27(%rip),%rdx
movsd  0xcfc(%rip),%xmm0
mov    $0x1,%al
call   1090 <mvprintw@plt>
mov    $0x3,%edi
mov    $0x20,%esi
lea    0xd11(%rip),%rdx
movsd  0xcd4(%rip),%xmm0
mov    $0x1,%al
call   1090 <mvprintw@plt>
mov    $0x4,%edi
mov    $0x20,%esi
lea    0xcfb(%rip),%rdx
movsd  0xcac(%rip),%xmm0
mov    $0x1,%al
call   1090 <mvprintw@plt>
mov    $0x6,%edi
xor    %esi,%esi
lea    0xcfb(%rip),%rdx
movsd  0xc87(%rip),%xmm0
mov    $0x1,%al
call   1090 <mvprintw@plt>
mov    $0x0,%al
call   1060 <refresh@plt>
mov    $0x0,%al
call   1070 <getch@plt>
mov    $0x0,%al
call   1080 <endwin@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
movaps 0xea0(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x747365,0xf(%rsp)
xor    %eax,%eax
call   1040 <initscr@plt>
mov    0x2e4e(%rip),%rax
mov    (%rax),%edi
call   1050 <getmaxyx@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xe80(%rip),%rdx
xor    %edi,%edi
xor    %esi,%esi
mov    %rbx,%rcx
xor    %eax,%eax
call   1090 <mvprintw@plt>
lea    0xe6e(%rip),%rdx
mov    $0x1,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1090 <mvprintw@plt>
lea    0xe5e(%rip),%r14
movsd  0xe1b(%rip),%xmm0
mov    $0x2,%edi
xor    %esi,%esi
mov    %r14,%rdx
mov    $0x1,%al
call   1090 <mvprintw@plt>
lea    0xe48(%rip),%r15
movsd  0xe03(%rip),%xmm0
mov    $0x3,%edi
xor    %esi,%esi
mov    %r15,%rdx
mov    $0x1,%al
call   1090 <mvprintw@plt>
lea    0xe32(%rip),%rbx
movsd  0xdeb(%rip),%xmm0
mov    $0x4,%edi
xor    %esi,%esi
mov    %rbx,%rdx
mov    $0x1,%al
call   1090 <mvprintw@plt>
lea    0xe1c(%rip),%rdx
mov    $0x1,%edi
mov    $0x10,%esi
xor    %eax,%eax
call   1090 <mvprintw@plt>
mov    $0x2,%edi
mov    $0x10,%esi
mov    %r14,%rdx
movsd  0xd9d(%rip),%xmm0
mov    $0x1,%al
call   1090 <mvprintw@plt>
mov    $0x3,%edi
mov    $0x10,%esi
mov    %r15,%rdx
movsd  0xd89(%rip),%xmm0
mov    $0x1,%al
call   1090 <mvprintw@plt>
mov    $0x4,%edi
mov    $0x10,%esi
mov    %rbx,%rdx
movsd  0xd75(%rip),%xmm0
mov    $0x1,%al
call   1090 <mvprintw@plt>
lea    0xdba(%rip),%rdx
mov    $0x1,%edi
mov    $0x20,%esi
xor    %eax,%eax
call   1090 <mvprintw@plt>
mov    $0x2,%edi
mov    $0x20,%esi
mov    %r14,%rdx
movsd  0xd31(%rip),%xmm0
mov    $0x1,%al
call   1090 <mvprintw@plt>
mov    $0x3,%edi
mov    $0x20,%esi
mov    %r15,%rdx
movsd  0xd1d(%rip),%xmm0
mov    $0x1,%al
call   1090 <mvprintw@plt>
mov    $0x4,%edi
mov    $0x20,%esi
mov    %rbx,%rdx
movsd  0xd09(%rip),%xmm0
mov    $0x1,%al
call   1090 <mvprintw@plt>
lea    0xd57(%rip),%rdx
movsd  0xcfb(%rip),%xmm0
mov    $0x6,%edi
xor    %esi,%esi
mov    $0x1,%al
call   1090 <mvprintw@plt>
xor    %eax,%eax
call   1060 <refresh@plt>
xor    %eax,%eax
call   1070 <getch@plt>
xor    %eax,%eax
call   1080 <endwin@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.mesg = [19 x i8] c"Accelerometer Test\00"
@stdscr = global i32 0
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"Gyro\00"
@.str.2 = [10 x i8] c"X: %4.2f\0A\00"
@.str.3 = [10 x i8] c"Y: %4.2f\0A\00"
@.str.4 = [10 x i8] c"Z: %4.2f\0A\00"
@.str.5 = [10 x i8] c"Acc-Angle\00"
@.str.6 = [9 x i8] c"CF-Angle\00"
@.str.7 = [16 x i8] c"Loop Time %3.1f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [19 x i8]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [19 x i8]* %2 to i8*
%6 = call i32 (...) @initscr()
%7 = load i32, i32* @stdscr
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @getmaxyx(i32 %7, i32 %8, i32 %9)
%11 = load i32, i32* %3
%12 = sdiv i32 %11, 2
%13 = load i32, i32* %4
%14 = getelementptr inbounds [19 x i8], [19 x i8]* %2, i64 0, i64 0
%15 = call i32 @strlen(i8* %14)
%16 = sub nsw i32 %13, %15
%17 = sdiv i32 %16, 2
%18 = getelementptr inbounds [19 x i8], [19 x i8]* %2, i64 0, i64 0
%19 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 %12, i32 %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %18)
%20 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 1, i32 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%21 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 2, i32 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), double 7.325000e+01)
%22 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 3, i32 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), double -1.482000e+01)
%23 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 4, i32 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), double 1.243700e+02)
%24 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 1, i32 16, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%25 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 2, i32 16, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), double 7.325000e+01)
%26 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 3, i32 16, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), double -1.482000e+01)
%27 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 4, i32 16, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), double 1.243700e+02)
%28 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 1, i32 32, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%29 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 2, i32 32, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), double 7.325000e+01)
%30 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 3, i32 32, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), double -1.482000e+01)
%31 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 4, i32 32, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), double 1.243700e+02)
%32 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 6, i32 0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), double 2.000000e+01)
%33 = call i32 (...) @refresh()
%34 = call i32 (...) @getch()
%35 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
@__const.main.mesg = [19 x i8] c"Accelerometer Test\00"
@stdscr = global i32 0
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"Gyro\00"
@.str.2 = [10 x i8] c"X: %4.2f\0A\00"
@.str.3 = [10 x i8] c"Y: %4.2f\0A\00"
@.str.4 = [10 x i8] c"Z: %4.2f\0A\00"
@.str.5 = [10 x i8] c"Acc-Angle\00"
@.str.6 = [9 x i8] c"CF-Angle\00"
@.str.7 = [16 x i8] c"Loop Time %3.1f\00"
define i32 @main() {
%1 = alloca [19 x i8]
%2 = getelementptr inbounds [19 x i8], [19 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (...) @initscr()
%4 = load i32, i32* @stdscr
%5 = tail call i32 @getmaxyx(i32 %4, i32 undef, i32 undef)
%6 = call i32 @strlen(i8* %2)
%7 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 0, i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%8 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 1, i32 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 2, i32 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), double 7.325000e+01)
%10 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 3, i32 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), double -1.482000e+01)
%11 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 4, i32 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), double 1.243700e+02)
%12 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 1, i32 16, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%13 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 2, i32 16, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), double 7.325000e+01)
%14 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 3, i32 16, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), double -1.482000e+01)
%15 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 4, i32 16, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), double 1.243700e+02)
%16 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 1, i32 32, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%17 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 2, i32 32, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), double 7.325000e+01)
%18 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 3, i32 32, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), double -1.482000e+01)
%19 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 4, i32 32, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), double 1.243700e+02)
%20 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 6, i32 0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), double 2.000000e+01)
%21 = call i32 (...) @refresh()
%22 = call i32 (...) @getch()
%23 = call i32 (...) @endwin()
ret i32 0
}