#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*/ delay(int);
int joystickGetAnalog(int, int);
int /*<<< orphan*/ motorSet(int, int);
void holonomic() {
  while (1) {
    int C1LX = joystickGetAnalog(1, 4);
    int C1LY = joystickGetAnalog(1, 3);
    int C1RX = joystickGetAnalog(1, 1);
    motorSet(1, -C1LX - C1RX);
    motorSet(2, -C1LY - C1RX);
    motorSet(3, C1LY - C1RX);
    motorSet(4, C1LX - C1RX);
    delay(20);
  }
}


x86 assembly (clang, -O0):
<holonomic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    $0x1,%edi
mov    $0x4,%esi
call   1050 <joystickGetAnalog@plt>
mov    %eax,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x3,%esi
call   1050 <joystickGetAnalog@plt>
mov    %eax,-0x8(%rbp)
mov    $0x1,%esi
mov    %esi,%edi
call   1050 <joystickGetAnalog@plt>
mov    %eax,-0xc(%rbp)
xor    %esi,%esi
sub    -0x4(%rbp),%esi
mov    %esi,-0x24(%rbp)
sub    -0xc(%rbp),%esi
mov    %esi,-0x20(%rbp)
mov    $0x1,%edi
call   1030 <motorSet@plt>
xor    %esi,%esi
sub    -0x8(%rbp),%esi
mov    %esi,-0x1c(%rbp)
sub    -0xc(%rbp),%esi
mov    %esi,-0x18(%rbp)
mov    $0x2,%edi
call   1030 <motorSet@plt>
mov    -0x8(%rbp),%esi
sub    -0xc(%rbp),%esi
mov    %esi,-0x14(%rbp)
mov    $0x3,%edi
call   1030 <motorSet@plt>
mov    -0x4(%rbp),%esi
sub    -0xc(%rbp),%esi
mov    %esi,-0x10(%rbp)
mov    $0x4,%edi
call   1030 <motorSet@plt>
mov    $0x14,%edi
call   1040 <delay@plt>
jmp    1138 <holonomic+0x8>

x86 assembly (clang, -O2):
<holonomic>:
push   %r15
push   %r14
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x1,%edi
mov    $0x4,%esi
call   1050 <joystickGetAnalog@plt>
mov    %eax,%r14d
mov    $0x1,%edi
mov    $0x3,%esi
call   1050 <joystickGetAnalog@plt>
mov    %eax,%r15d
mov    $0x1,%edi
mov    $0x1,%esi
call   1050 <joystickGetAnalog@plt>
mov    %eax,%ebx
lea    (%r14,%rbx,1),%esi
neg    %esi
mov    $0x1,%edi
call   1030 <motorSet@plt>
lea    (%r15,%rbx,1),%esi
neg    %esi
mov    $0x2,%edi
call   1030 <motorSet@plt>
sub    %ebx,%r15d
mov    $0x3,%edi
mov    %r15d,%esi
call   1030 <motorSet@plt>
sub    %ebx,%r14d
mov    $0x4,%edi
mov    %r14d,%esi
call   1030 <motorSet@plt>
mov    $0x14,%edi
call   1040 <delay@plt>
jmp    1140 <holonomic+0x10>

LLVM IR (-O0):
define void @holonomic() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
br label %4
4: ; preds = %0, %4
%5 = call i32 @joystickGetAnalog(i32 1, i32 4)
store i32 %5, i32* %1
%6 = call i32 @joystickGetAnalog(i32 1, i32 3)
store i32 %6, i32* %2
%7 = call i32 @joystickGetAnalog(i32 1, i32 1)
store i32 %7, i32* %3
%8 = load i32, i32* %1
%9 = sub nsw i32 0, %8
%10 = load i32, i32* %3
%11 = sub nsw i32 %9, %10
%12 = call i32 @motorSet(i32 1, i32 %11)
%13 = load i32, i32* %2
%14 = sub nsw i32 0, %13
%15 = load i32, i32* %3
%16 = sub nsw i32 %14, %15
%17 = call i32 @motorSet(i32 2, i32 %16)
%18 = load i32, i32* %2
%19 = load i32, i32* %3
%20 = sub nsw i32 %18, %19
%21 = call i32 @motorSet(i32 3, i32 %20)
%22 = load i32, i32* %1
%23 = load i32, i32* %3
%24 = sub nsw i32 %22, %23
%25 = call i32 @motorSet(i32 4, i32 %24)
%26 = call i32 @delay(i32 20)
br label %4
}

LLVM IR (-O2):
define void @holonomic() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @joystickGetAnalog(i32 1, i32 4)
%3 = tail call i32 @joystickGetAnalog(i32 1, i32 3)
%4 = tail call i32 @joystickGetAnalog(i32 1, i32 1)
%5 = add i32 %2, %4
%6 = sub i32 0, %5
%7 = tail call i32 @motorSet(i32 1, i32 %6)
%8 = add i32 %3, %4
%9 = sub i32 0, %8
%10 = tail call i32 @motorSet(i32 2, i32 %9)
%11 = sub nsw i32 %3, %4
%12 = tail call i32 @motorSet(i32 3, i32 %11)
%13 = sub nsw i32 %2, %4
%14 = tail call i32 @motorSet(i32 4, i32 %13)
%15 = tail call i32 @delay(i32 20)
br label %1
}