#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 error(int, char *);
int sscanf(char *, char *, int *);
int /*<<< orphan*/ usleep(int);
int /*<<< orphan*/ zaber_goto_fixed_position(int, int);
int cmd_xyf(int argc, char *argv[]) {
  int new_fixed = 0;
  if (argc != 2)
    return error((-2), "Usage: xyf [fixed_position]");
  if (sscanf(argv[1], "%d", &new_fixed) != 1)
    return error((-2), "Error parsing new_fixed.");
  zaber_goto_fixed_position(2, new_fixed);
  usleep(1000);
  zaber_goto_fixed_position(1, new_fixed);
  return 0;
}


x86 assembly (clang, -O0):
<cmd_xyf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1179 <cmd_xyf+0x39>
mov    $0xfffffffe,%edi
lea    0xe94(%rip),%rsi
call   1050 <error@plt>
mov    %eax,-0x4(%rbp)
jmp    11de <cmd_xyf+0x9e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe94(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1040 <sscanf@plt>
cmp    $0x1,%eax
je     11b3 <cmd_xyf+0x73>
mov    $0xfffffffe,%edi
lea    0xe79(%rip),%rsi
call   1050 <error@plt>
mov    %eax,-0x4(%rbp)
jmp    11de <cmd_xyf+0x9e>
mov    -0x14(%rbp),%esi
mov    $0x2,%edi
call   1030 <zaber_goto_fixed_position@plt>
mov    $0x3e8,%edi
call   1060 <usleep@plt>
mov    -0x14(%rbp),%esi
mov    $0x1,%edi
call   1030 <zaber_goto_fixed_position@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_xyf>:
push   %rax
movl   $0x0,0x4(%rsp)
cmp    $0x2,%edi
jne    1192 <cmd_xyf+0x52>
mov    0x8(%rsi),%rdi
lea    0xec3(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1040 <sscanf@plt>
cmp    $0x1,%eax
jne    11a4 <cmd_xyf+0x64>
mov    0x4(%rsp),%esi
mov    $0x2,%edi
call   1030 <zaber_goto_fixed_position@plt>
mov    $0x3e8,%edi
call   1060 <usleep@plt>
mov    0x4(%rsp),%esi
mov    $0x1,%edi
call   1030 <zaber_goto_fixed_position@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xe67(%rip),%rsi
mov    $0xfffffffe,%edi
pop    %rax
jmp    1050 <error@plt>
lea    0xe74(%rip),%rsi
mov    $0xfffffffe,%edi
call   1050 <error@plt>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Usage: xyf [fixed_position]\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [25 x i8] c"Error parsing new_fixed.\00"
define i32 @cmd_xyf(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @error(i32 -2, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
store i32 %10, i32* %3
br label %25
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @sscanf(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%16 = icmp ne i32 %15, 1
br i1 %16, label %17, label %19
17: ; preds = %11
%18 = call i32 @error(i32 -2, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
store i32 %18, i32* %3
br label %25
19: ; preds = %11
%20 = load i32, i32* %6
%21 = call i32 @zaber_goto_fixed_position(i32 2, i32 %20)
%22 = call i32 @usleep(i32 1000)
%23 = load i32, i32* %6
%24 = call i32 @zaber_goto_fixed_position(i32 1, i32 %23)
store i32 0, i32* %3
br label %25
25: ; preds = %19, %17, %9
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
@.str = [28 x i8] c"Usage: xyf [fixed_position]\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [25 x i8] c"Error parsing new_fixed.\00"
define i32 @cmd_xyf(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = icmp eq i32 %0, 2
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @error(i32 -2, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %21
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @sscanf(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%12 = icmp eq i32 %11, 1
br i1 %12, label %15, label %13
13: ; preds = %8
%14 = call i32 @error(i32 -2, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
br label %21
15: ; preds = %8
%16 = load i32, i32* %3
%17 = call i32 @zaber_goto_fixed_position(i32 2, i32 %16)
%18 = call i32 @usleep(i32 1000)
%19 = load i32, i32* %3
%20 = call i32 @zaber_goto_fixed_position(i32 1, i32 %19)
br label %21
21: ; preds = %15, %13, %6
%22 = phi i32 [ %7, %6 ], [ %14, %13 ], [ 0, %15 ]
ret i32 %22
}