#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*/ getSinValue(int, float *, float *, float *, float *, int,
                               int);
int /*<<< orphan*/ setMotorRelativePosition(int, int);
void walk(int t, int gain, int speed) {
  float i, j, k, l;
  float coef_left = 1.0;
  float coef_right = 1.0;
  getSinValue(t, &i, &j, &k, &l, gain, speed);
  setMotorRelativePosition(4, (int)i);
  setMotorRelativePosition(16, (int)i);
  setMotorRelativePosition(9, (int)i);
  setMotorRelativePosition(15, (int)j);
  setMotorRelativePosition(10, (int)j);
  setMotorRelativePosition(3, (int)j);
  setMotorRelativePosition(14, (int)(k * coef_left));
  setMotorRelativePosition(7, (int)-(k * 1.1 * coef_left));
  setMotorRelativePosition(2, (int)(k * coef_left));
  setMotorRelativePosition(13, (int)(-l * coef_right));
  setMotorRelativePosition(1, (int)(-l * coef_right));
  setMotorRelativePosition(8, (int)(l * 1.1 * coef_right));
}


x86 assembly (clang, -O0):
<walk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movss  0xecf(%rip),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  0xec2(%rip),%xmm0
movss  %xmm0,-0x24(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%r9d
mov    -0xc(%rbp),%eax
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x18(%rbp),%rcx
lea    -0x1c(%rbp),%r8
mov    %eax,(%rsp)
call   1030 <getSinValue@plt>
cvttss2si -0x10(%rbp),%esi
mov    $0x4,%edi
call   1040 <setMotorRelativePosition@plt>
cvttss2si -0x10(%rbp),%esi
mov    $0x10,%edi
call   1040 <setMotorRelativePosition@plt>
cvttss2si -0x10(%rbp),%esi
mov    $0x9,%edi
call   1040 <setMotorRelativePosition@plt>
cvttss2si -0x14(%rbp),%esi
mov    $0xf,%edi
call   1040 <setMotorRelativePosition@plt>
cvttss2si -0x14(%rbp),%esi
mov    $0xa,%edi
call   1040 <setMotorRelativePosition@plt>
cvttss2si -0x14(%rbp),%esi
mov    $0x3,%edi
call   1040 <setMotorRelativePosition@plt>
movss  -0x18(%rbp),%xmm0
mulss  -0x20(%rbp),%xmm0
cvttss2si %xmm0,%esi
mov    $0xe,%edi
call   1040 <setMotorRelativePosition@plt>
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe10(%rip),%xmm1
mulsd  %xmm1,%xmm0
movss  -0x20(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
cvttsd2si %xmm0,%esi
mov    $0x7,%edi
call   1040 <setMotorRelativePosition@plt>
movss  -0x18(%rbp),%xmm0
mulss  -0x20(%rbp),%xmm0
cvttss2si %xmm0,%esi
mov    $0x2,%edi
call   1040 <setMotorRelativePosition@plt>
movss  -0x1c(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  -0x24(%rbp),%xmm0
cvttss2si %xmm0,%esi
mov    $0xd,%edi
call   1040 <setMotorRelativePosition@plt>
movss  -0x1c(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  -0x24(%rbp),%xmm0
cvttss2si %xmm0,%esi
mov    $0x1,%edi
call   1040 <setMotorRelativePosition@plt>
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd67(%rip),%xmm1
mulsd  %xmm1,%xmm0
movss  -0x24(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
mov    $0x8,%edi
call   1040 <setMotorRelativePosition@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<walk>:
sub    $0x18,%rsp
mov    %esi,%r9d
mov    %edx,(%rsp)
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
call   1030 <getSinValue@plt>
cvttss2si 0x14(%rsp),%esi
mov    $0x4,%edi
call   1040 <setMotorRelativePosition@plt>
cvttss2si 0x14(%rsp),%esi
mov    $0x10,%edi
call   1040 <setMotorRelativePosition@plt>
cvttss2si 0x14(%rsp),%esi
mov    $0x9,%edi
call   1040 <setMotorRelativePosition@plt>
cvttss2si 0x10(%rsp),%esi
mov    $0xf,%edi
call   1040 <setMotorRelativePosition@plt>
cvttss2si 0x10(%rsp),%esi
mov    $0xa,%edi
call   1040 <setMotorRelativePosition@plt>
cvttss2si 0x10(%rsp),%esi
mov    $0x3,%edi
call   1040 <setMotorRelativePosition@plt>
cvttss2si 0xc(%rsp),%esi
mov    $0xe,%edi
call   1040 <setMotorRelativePosition@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xe3b(%rip),%xmm0
cvttsd2si %xmm0,%esi
mov    $0x7,%edi
call   1040 <setMotorRelativePosition@plt>
cvttss2si 0xc(%rsp),%esi
mov    $0x2,%edi
call   1040 <setMotorRelativePosition@plt>
movss  0x8(%rsp),%xmm0
xorps  0xe20(%rip),%xmm0
cvttss2si %xmm0,%esi
mov    $0xd,%edi
call   1040 <setMotorRelativePosition@plt>
movss  0x8(%rsp),%xmm0
xorps  0xe05(%rip),%xmm0
cvttss2si %xmm0,%esi
mov    $0x1,%edi
call   1040 <setMotorRelativePosition@plt>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xddd(%rip),%xmm0
cvttsd2si %xmm0,%esi
mov    $0x8,%edi
call   1040 <setMotorRelativePosition@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @walk(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store float 1.000000e+00, float* %11
store float 1.000000e+00, float* %12
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = call i32 @getSinValue(i32 %13, float* %7, float* %8, float* %9, float* %10, i32 %14, i32 %15)
%17 = load float, float* %7
%18 = fptosi float %17 to i32
%19 = call i32 @setMotorRelativePosition(i32 4, i32 %18)
%20 = load float, float* %7
%21 = fptosi float %20 to i32
%22 = call i32 @setMotorRelativePosition(i32 16, i32 %21)
%23 = load float, float* %7
%24 = fptosi float %23 to i32
%25 = call i32 @setMotorRelativePosition(i32 9, i32 %24)
%26 = load float, float* %8
%27 = fptosi float %26 to i32
%28 = call i32 @setMotorRelativePosition(i32 15, i32 %27)
%29 = load float, float* %8
%30 = fptosi float %29 to i32
%31 = call i32 @setMotorRelativePosition(i32 10, i32 %30)
%32 = load float, float* %8
%33 = fptosi float %32 to i32
%34 = call i32 @setMotorRelativePosition(i32 3, i32 %33)
%35 = load float, float* %9
%36 = load float, float* %11
%37 = fmul float %35, %36
%38 = fptosi float %37 to i32
%39 = call i32 @setMotorRelativePosition(i32 14, i32 %38)
%40 = load float, float* %9
%41 = fpext float %40 to double
%42 = fmul double %41, 1.100000e+00
%43 = load float, float* %11
%44 = fpext float %43 to double
%45 = fmul double %42, %44
%46 = fneg double %45
%47 = fptosi double %46 to i32
%48 = call i32 @setMotorRelativePosition(i32 7, i32 %47)
%49 = load float, float* %9
%50 = load float, float* %11
%51 = fmul float %49, %50
%52 = fptosi float %51 to i32
%53 = call i32 @setMotorRelativePosition(i32 2, i32 %52)
%54 = load float, float* %10
%55 = fneg float %54
%56 = load float, float* %12
%57 = fmul float %55, %56
%58 = fptosi float %57 to i32
%59 = call i32 @setMotorRelativePosition(i32 13, i32 %58)
%60 = load float, float* %10
%61 = fneg float %60
%62 = load float, float* %12
%63 = fmul float %61, %62
%64 = fptosi float %63 to i32
%65 = call i32 @setMotorRelativePosition(i32 1, i32 %64)
%66 = load float, float* %10
%67 = fpext float %66 to double
%68 = fmul double %67, 1.100000e+00
%69 = load float, float* %12
%70 = fpext float %69 to double
%71 = fmul double %68, %70
%72 = fptosi double %71 to i32
%73 = call i32 @setMotorRelativePosition(i32 8, i32 %72)
ret void
}

LLVM IR (-O2):
define void @walk(i32 %0, i32 %1, i32 %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = bitcast float* %4 to i8*
%9 = bitcast float* %5 to i8*
%10 = bitcast float* %6 to i8*
%11 = bitcast float* %7 to i8*
%12 = call i32 @getSinValue(i32 %0, float* %4, float* %5, float* %6, float* %7, i32 %1, i32 %2)
%13 = load float, float* %4
%14 = fptosi float %13 to i32
%15 = call i32 @setMotorRelativePosition(i32 4, i32 %14)
%16 = load float, float* %4
%17 = fptosi float %16 to i32
%18 = call i32 @setMotorRelativePosition(i32 16, i32 %17)
%19 = load float, float* %4
%20 = fptosi float %19 to i32
%21 = call i32 @setMotorRelativePosition(i32 9, i32 %20)
%22 = load float, float* %5
%23 = fptosi float %22 to i32
%24 = call i32 @setMotorRelativePosition(i32 15, i32 %23)
%25 = load float, float* %5
%26 = fptosi float %25 to i32
%27 = call i32 @setMotorRelativePosition(i32 10, i32 %26)
%28 = load float, float* %5
%29 = fptosi float %28 to i32
%30 = call i32 @setMotorRelativePosition(i32 3, i32 %29)
%31 = load float, float* %6
%32 = fptosi float %31 to i32
%33 = call i32 @setMotorRelativePosition(i32 14, i32 %32)
%34 = load float, float* %6
%35 = fpext float %34 to double
%36 = fmul double %35, -1.100000e+00
%37 = fptosi double %36 to i32
%38 = call i32 @setMotorRelativePosition(i32 7, i32 %37)
%39 = load float, float* %6
%40 = fptosi float %39 to i32
%41 = call i32 @setMotorRelativePosition(i32 2, i32 %40)
%42 = load float, float* %7
%43 = fneg float %42
%44 = fptosi float %43 to i32
%45 = call i32 @setMotorRelativePosition(i32 13, i32 %44)
%46 = load float, float* %7
%47 = fneg float %46
%48 = fptosi float %47 to i32
%49 = call i32 @setMotorRelativePosition(i32 1, i32 %48)
%50 = load float, float* %7
%51 = fpext float %50 to double
%52 = fmul double %51, 1.100000e+00
%53 = fptosi double %52 to i32
%54 = call i32 @setMotorRelativePosition(i32 8, i32 %53)
ret void
}