#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*/ move2globalxyz(float, float, float, int /*<<< orphan*/,
                                  int *, int *, int *, int *);
int /*<<< orphan*/ printf(char *, int, int, int);
int gotoPositionCheck(float x, float y, float z) {
  int ns[3], sv;
  move2globalxyz(x, y, z, 0, &ns[0], &ns[1], &ns[2], &sv);
  for (int i = 0; i < 3; i++) {
    if ((ns[i] > 0) || (ns[i] < -99999)) {
      printf("could not reach global xyz %f, %f, %f.\n", x, y, z);
      printf("steppers %d, %d, %d", ns[0], ns[1], ns[2]);
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<gotoPositionCheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
lea    -0x1c(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
add    $0x4,%rdx
lea    -0x1c(%rbp),%rcx
add    $0x8,%rcx
xor    %edi,%edi
lea    -0x20(%rbp),%r8
call   1030 <move2globalxyz@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0x3,-0x24(%rbp)
jge    11e6 <gotoPositionCheck+0xc6>
movslq -0x24(%rbp),%rax
cmpl   $0x0,-0x1c(%rbp,%rax,4)
jg     1197 <gotoPositionCheck+0x77>
movslq -0x24(%rbp),%rax
cmpl   $0xfffe7961,-0x1c(%rbp,%rax,4)
ff
jge    11d3 <gotoPositionCheck+0xb3>
cvttss2si -0x8(%rbp),%esi
cvttss2si -0xc(%rbp),%edx
cvttss2si -0x10(%rbp),%ecx
lea    0xe53(%rip),%rdi
call   1040 <printf@plt>
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xe66(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11ed <gotoPositionCheck+0xcd>
jmp    11d8 <gotoPositionCheck+0xb8>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    116c <gotoPositionCheck+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gotoPositionCheck>:
sub    $0x28,%rsp
lea    0x10(%rsp),%rdx
lea    0x14(%rsp),%rcx
lea    0xc(%rsp),%rsi
lea    0x24(%rsp),%r8
movss  %xmm0,0x18(%rsp)
movss  %xmm1,0x1c(%rsp)
movss  %xmm2,0x20(%rsp)
xor    %edi,%edi
call   1030 <move2globalxyz@plt>
mov    0xc(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0xfffe7960,%eax
jb     117e <gotoPositionCheck+0x5e>
mov    0x10(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0xfffe7960,%eax
jb     117e <gotoPositionCheck+0x5e>
mov    0x14(%rsp),%ecx
add    $0xffffffff,%ecx
xor    %eax,%eax
cmp    $0xfffe795f,%ecx
ja     11b9 <gotoPositionCheck+0x99>
cvttss2si 0x18(%rsp),%esi
cvttss2si 0x1c(%rsp),%edx
cvttss2si 0x20(%rsp),%ecx
lea    0xe69(%rip),%rdi
call   1040 <printf@plt>
mov    0xc(%rsp),%esi
mov    0x10(%rsp),%edx
mov    0x14(%rsp),%ecx
lea    0xe79(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [40 x i8] c"could not reach global xyz %f, %f, %f.\0A\00"
@.str.1 = [20 x i8] c"steppers %d, %d, %d\00"
define i32 @gotoPositionCheck(float %0, float %1, float %2) {
%4 = alloca i32
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca [3 x i32]
%9 = alloca i32
%10 = alloca i32
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
%11 = load float, float* %5
%12 = load float, float* %6
%13 = load float, float* %7
%14 = getelementptr inbounds [3 x i32], [3 x i32]* %8, i64 0, i64 0
%15 = getelementptr inbounds [3 x i32], [3 x i32]* %8, i64 0, i64 1
%16 = getelementptr inbounds [3 x i32], [3 x i32]* %8, i64 0, i64 2
%17 = call i32 @move2globalxyz(float %11, float %12, float %13, i32 0, i32* %14, i32* %15, i32* %16, i32* %9)
store i32 0, i32* %10
br label %18
18: ; preds = %49, %3
%19 = load i32, i32* %10
%20 = icmp slt i32 %19, 3
br i1 %20, label %21, label %52
21: ; preds = %18
%22 = load i32, i32* %10
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [3 x i32], [3 x i32]* %8, i64 0, i64 %23
%25 = load i32, i32* %24
%26 = icmp sgt i32 %25, 0
br i1 %26, label %33, label %27
27: ; preds = %21
%28 = load i32, i32* %10
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [3 x i32], [3 x i32]* %8, i64 0, i64 %29
%31 = load i32, i32* %30
%32 = icmp slt i32 %31, -99999
br i1 %32, label %33, label %48
33: ; preds = %27, %21
%34 = load float, float* %5
%35 = fptosi float %34 to i32
%36 = load float, float* %6
%37 = fptosi float %36 to i32
%38 = load float, float* %7
%39 = fptosi float %38 to i32
%40 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %35, i32 %37, i32 %39)
%41 = getelementptr inbounds [3 x i32], [3 x i32]* %8, i64 0, i64 0
%42 = load i32, i32* %41
%43 = getelementptr inbounds [3 x i32], [3 x i32]* %8, i64 0, i64 1
%44 = load i32, i32* %43
%45 = getelementptr inbounds [3 x i32], [3 x i32]* %8, i64 0, i64 2
%46 = load i32, i32* %45
%47 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %42, i32 %44, i32 %46)
store i32 1, i32* %4
br label %53
48: ; preds = %27
br label %49
49: ; preds = %48
%50 = load i32, i32* %10
%51 = add nsw i32 %50, 1
store i32 %51, i32* %10
br label %18
52: ; preds = %18
store i32 0, i32* %4
br label %53
53: ; preds = %52, %33
%54 = load i32, i32* %4
ret i32 %54
}

LLVM IR (-O2):
@.str = [40 x i8] c"could not reach global xyz %f, %f, %f.\0A\00"
@.str.1 = [20 x i8] c"steppers %d, %d, %d\00"
define i32 @gotoPositionCheck(float %0, float %1, float %2) {
%4 = alloca [3 x i32]
%5 = alloca i32
%6 = bitcast [3 x i32]* %4 to i8*
%7 = bitcast i32* %5 to i8*
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 1
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 2
%11 = call i32 @move2globalxyz(float %0, float %1, float %2, i32 0, i32* %8, i32* %9, i32* %10, i32* %5)
%12 = load i32, i32* %8
%13 = add i32 %12, -1
%14 = icmp ult i32 %13, -100000
br i1 %14, label %23, label %15
15: ; preds = %3
%16 = load i32, i32* %9
%17 = add i32 %16, -1
%18 = icmp ult i32 %17, -100000
br i1 %18, label %23, label %19
19: ; preds = %15
%20 = load i32, i32* %10
%21 = add i32 %20, -1
%22 = icmp ult i32 %21, -100000
br i1 %22, label %23, label %32
23: ; preds = %19, %15, %3
%24 = fptosi float %0 to i32
%25 = fptosi float %1 to i32
%26 = fptosi float %2 to i32
%27 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %24, i32 %25, i32 %26)
%28 = load i32, i32* %8
%29 = load i32, i32* %9
%30 = load i32, i32* %10
%31 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %28, i32 %29, i32 %30)
br label %32
32: ; preds = %19, %23
%33 = phi i32 [ 1, %23 ], [ 0, %19 ]
ret i32 %33
}