#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 */
struct js_event {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ js_maths(int, float, int);
int open_joystick(int);
int /*<<< orphan*/ read_joystick_axis(int, struct js_event, int, int, float,
                                      int, int);
int /*<<< orphan*/ stdout;
int main() {
  int fd;
  struct js_event js;
  int thrust;
  int rudder;
  int js_range;
  float js_d;
  int js_m;
  js_maths(js_range, js_d, js_m);
  fd = open_joystick(fd);
  while (1) {
    read_joystick_axis(fd, js, thrust, js_range, js_d, js_m, rudder);
    fflush(stdout);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x1c(%rbp),%edi
movss  -0x20(%rbp),%xmm0
mov    -0x24(%rbp),%esi
call   1030 <js_maths@plt>
mov    -0x8(%rbp),%edi
call   1040 <open_joystick@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x14(%rbp),%edx
mov    -0x1c(%rbp),%ecx
movss  -0x20(%rbp),%xmm0
mov    -0x24(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    -0x10(%rbp),%esi
call   1060 <read_joystick_axis@plt>
mov    0x2e51(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
jmp    116a <main+0x2a>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
call   1030 <js_maths@plt>
call   1040 <open_joystick@plt>
mov    %eax,%ebx
mov    0x2e89(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1060 <read_joystick_axis@plt>
mov    (%r14),%edi
call   1050 <fflush@plt>
jmp    1160 <main+0x20>

LLVM IR (-O0):
%struct.js_event = type { i32 }
@stdout = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.js_event
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
%8 = alloca i32
store i32 0, i32* %1
%9 = load i32, i32* %6
%10 = load float, float* %7
%11 = load i32, i32* %8
%12 = call i32 @js_maths(i32 %9, float %10, i32 %11)
%13 = load i32, i32* %2
%14 = call i32 @open_joystick(i32 %13)
store i32 %14, i32* %2
br label %15
15: ; preds = %0, %15
%16 = load i32, i32* %2
%17 = load i32, i32* %4
%18 = load i32, i32* %6
%19 = load float, float* %7
%20 = load i32, i32* %8
%21 = load i32, i32* %5
%22 = getelementptr inbounds %struct.js_event, %struct.js_event* %3, i32 0, i32 0
%23 = load i32, i32* %22
%24 = call i32 @read_joystick_axis(i32 %16, i32 %23, i32 %17, i32 %18, float %19, i32 %20, i32 %21)
%25 = load i32, i32* @stdout
%26 = call i32 @fflush(i32 %25)
br label %15
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @main() {
%1 = tail call i32 @js_maths(i32 undef, float undef, i32 undef)
%2 = tail call i32 @open_joystick(i32 undef)
br label %3
3: ; preds = %3, %0
%4 = tail call i32 @read_joystick_axis(i32 %2, i32 undef, i32 undef, i32 undef, float undef, i32 undef, i32 undef)
%5 = load i32, i32* @stdout
%6 = tail call i32 @fflush(i32 %5)
br label %3
}