#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 dot(int *, int *);
void updateMotor(int *dcmMatrix, int *targetMatrix, int *rollint,
                 int *motorSpeed) {
  motorSpeed[0] =
      (1 * rollint[1]) + (-1 * dot(&targetMatrix[6], &dcmMatrix[3])) + 2500;
  motorSpeed[2] =
      (1 * rollint[1]) + (1 * dot(&targetMatrix[6], &dcmMatrix[3])) + 2500;
  motorSpeed[1] =
      (1 * rollint[0]) + (1 * dot(&targetMatrix[6], &dcmMatrix[0])) + 2500;
  motorSpeed[3] =
      (1 * rollint[0]) + (1 * dot(&targetMatrix[6], &dcmMatrix[0])) + 2500;
}


x86 assembly (clang, -O0):
<updateMotor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%eax
shl    $0x0,%eax
mov    %eax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x18,%rdi
mov    -0x8(%rbp),%rsi
add    $0xc,%rsi
call   1030 <dot@plt>
mov    -0x30(%rbp),%ecx
imul   $0xffffffff,%eax,%eax
add    %eax,%ecx
add    $0x9c4,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%eax
shl    $0x0,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x18,%rdi
mov    -0x8(%rbp),%rsi
add    $0xc,%rsi
call   1030 <dot@plt>
mov    -0x2c(%rbp),%ecx
shl    $0x0,%eax
add    %eax,%ecx
add    $0x9c4,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
shl    $0x0,%eax
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x18,%rdi
mov    -0x8(%rbp),%rsi
call   1030 <dot@plt>
mov    -0x28(%rbp),%ecx
shl    $0x0,%eax
add    %eax,%ecx
add    $0x9c4,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
shl    $0x0,%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x18,%rdi
mov    -0x8(%rbp),%rsi
call   1030 <dot@plt>
mov    -0x24(%rbp),%ecx
shl    $0x0,%eax
add    %eax,%ecx
add    $0x9c4,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,0xc(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<updateMotor>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rdi,%r14
mov    0x4(%rdx),%ebp
lea    0x18(%rsi),%rbx
lea    0xc(%rdi),%r13
mov    %rbx,%rdi
mov    %r13,%rsi
call   1030 <dot@plt>
sub    %eax,%ebp
add    $0x9c4,%ebp
mov    %ebp,(%r15)
mov    0x4(%r12),%ebp
mov    %rbx,%rdi
mov    %r13,%rsi
call   1030 <dot@plt>
add    %ebp,%eax
add    $0x9c4,%eax
mov    %eax,0x8(%r15)
mov    (%r12),%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <dot@plt>
add    %ebp,%eax
add    $0x9c4,%eax
mov    %eax,0x4(%r15)
mov    (%r12),%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <dot@plt>
add    %ebp,%eax
add    $0x9c4,%eax
mov    %eax,0xc(%r15)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @updateMotor(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %7
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %10
%12 = mul nsw i32 1, %11
%13 = load i32*, i32** %6
%14 = getelementptr inbounds i32, i32* %13, i64 6
%15 = load i32*, i32** %5
%16 = getelementptr inbounds i32, i32* %15, i64 3
%17 = call i32 @dot(i32* %14, i32* %16)
%18 = mul nsw i32 -1, %17
%19 = add nsw i32 %12, %18
%20 = add nsw i32 %19, 2500
%21 = load i32*, i32** %8
%22 = getelementptr inbounds i32, i32* %21, i64 0
store i32 %20, i32* %22
%23 = load i32*, i32** %7
%24 = getelementptr inbounds i32, i32* %23, i64 1
%25 = load i32, i32* %24
%26 = mul nsw i32 1, %25
%27 = load i32*, i32** %6
%28 = getelementptr inbounds i32, i32* %27, i64 6
%29 = load i32*, i32** %5
%30 = getelementptr inbounds i32, i32* %29, i64 3
%31 = call i32 @dot(i32* %28, i32* %30)
%32 = mul nsw i32 1, %31
%33 = add nsw i32 %26, %32
%34 = add nsw i32 %33, 2500
%35 = load i32*, i32** %8
%36 = getelementptr inbounds i32, i32* %35, i64 2
store i32 %34, i32* %36
%37 = load i32*, i32** %7
%38 = getelementptr inbounds i32, i32* %37, i64 0
%39 = load i32, i32* %38
%40 = mul nsw i32 1, %39
%41 = load i32*, i32** %6
%42 = getelementptr inbounds i32, i32* %41, i64 6
%43 = load i32*, i32** %5
%44 = getelementptr inbounds i32, i32* %43, i64 0
%45 = call i32 @dot(i32* %42, i32* %44)
%46 = mul nsw i32 1, %45
%47 = add nsw i32 %40, %46
%48 = add nsw i32 %47, 2500
%49 = load i32*, i32** %8
%50 = getelementptr inbounds i32, i32* %49, i64 1
store i32 %48, i32* %50
%51 = load i32*, i32** %7
%52 = getelementptr inbounds i32, i32* %51, i64 0
%53 = load i32, i32* %52
%54 = mul nsw i32 1, %53
%55 = load i32*, i32** %6
%56 = getelementptr inbounds i32, i32* %55, i64 6
%57 = load i32*, i32** %5
%58 = getelementptr inbounds i32, i32* %57, i64 0
%59 = call i32 @dot(i32* %56, i32* %58)
%60 = mul nsw i32 1, %59
%61 = add nsw i32 %54, %60
%62 = add nsw i32 %61, 2500
%63 = load i32*, i32** %8
%64 = getelementptr inbounds i32, i32* %63, i64 3
store i32 %62, i32* %64
ret void
}

LLVM IR (-O2):
define void @updateMotor(i32* %0, i32* %1, i32* nocapture %2, i32* nocapture writeonly %3) {
%5 = getelementptr inbounds i32, i32* %2, i64 1
%6 = load i32, i32* %5
%7 = getelementptr inbounds i32, i32* %1, i64 6
%8 = getelementptr inbounds i32, i32* %0, i64 3
%9 = tail call i32 @dot(i32* %7, i32* %8)
%10 = add i32 %6, 2500
%11 = sub i32 %10, %9
store i32 %11, i32* %3
%12 = load i32, i32* %5
%13 = tail call i32 @dot(i32* %7, i32* %8)
%14 = add i32 %12, 2500
%15 = add i32 %14, %13
%16 = getelementptr inbounds i32, i32* %3, i64 2
store i32 %15, i32* %16
%17 = load i32, i32* %2
%18 = tail call i32 @dot(i32* %7, i32* %0)
%19 = add i32 %17, 2500
%20 = add i32 %19, %18
%21 = getelementptr inbounds i32, i32* %3, i64 1
store i32 %20, i32* %21
%22 = load i32, i32* %2
%23 = tail call i32 @dot(i32* %7, i32* %0)
%24 = add i32 %22, 2500
%25 = add i32 %24, %23
%26 = getelementptr inbounds i32, i32* %3, i64 3
store i32 %25, i32* %26
ret void
}