#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 GetSlewStatus();
int /*<<< orphan*/ StopSlew(int);
int /*<<< orphan*/ StopTrack();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ usleep(int);
void FullStop(void) {
  if (GetSlewStatus() == 1) {
    printf("NexStar FullStop: stopping N slew.\n");
    StopSlew(1);
    printf("NexStar FullStop: stopping S slew.\n");
    StopSlew(2);
    printf("NexStar FullStop: stopping E slew.\n");
    StopSlew(4);
    printf("NexStar FullStop: stopping W slew.\n");
    StopSlew(8);
    usleep(1000000.);
  }
  printf("NexStar: stopping sidereal tracking.\n");
  StopTrack();
}


x86 assembly (clang, -O0):
<FullStop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <GetSlewStatus@plt>
cmp    $0x1,%eax
jne    11c6 <FullStop+0x76>
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <StopSlew@plt>
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x2,%edi
call   1050 <StopSlew@plt>
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
mov    $0x4,%edi
call   1050 <StopSlew@plt>
lea    0xebf(%rip),%rdi
call   1040 <printf@plt>
mov    $0x8,%edi
call   1050 <StopSlew@plt>
mov    $0xf4240,%edi
call   1070 <usleep@plt>
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <StopTrack@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<FullStop>:
push   %rax
xor    %eax,%eax
call   1030 <GetSlewStatus@plt>
cmp    $0x1,%eax
jne    11bf <FullStop+0x6f>
lea    0xec1(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1050 <StopSlew@plt>
lea    0xece(%rip),%rdi
call   1040 <puts@plt>
mov    $0x2,%edi
call   1050 <StopSlew@plt>
lea    0xedb(%rip),%rdi
call   1040 <puts@plt>
mov    $0x4,%edi
call   1050 <StopSlew@plt>
lea    0xee8(%rip),%rdi
call   1040 <puts@plt>
mov    $0x8,%edi
call   1050 <StopSlew@plt>
mov    $0xf4240,%edi
call   1070 <usleep@plt>
lea    0xe3a(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <StopTrack@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"NexStar FullStop: stopping N slew.\0A\00"
@.str.1 = [36 x i8] c"NexStar FullStop: stopping S slew.\0A\00"
@.str.2 = [36 x i8] c"NexStar FullStop: stopping E slew.\0A\00"
@.str.3 = [36 x i8] c"NexStar FullStop: stopping W slew.\0A\00"
@.str.4 = [38 x i8] c"NexStar: stopping sidereal tracking.\0A\00"
define void @FullStop() {
%1 = call i32 (...) @GetSlewStatus()
%2 = icmp eq i32 %1, 1
br i1 %2, label %3, label %13
3: ; preds = %0
%4 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @StopSlew(i32 1)
%6 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @StopSlew(i32 2)
%8 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @StopSlew(i32 4)
%10 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 @StopSlew(i32 8)
%12 = call i32 @usleep(i32 1000000)
br label %13
13: ; preds = %3, %0
%14 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0))
%15 = call i32 (...) @StopTrack()
ret void
}

LLVM IR (-O2):
@str = [37 x i8] c"NexStar: stopping sidereal tracking.\00"
@str.5 = [35 x i8] c"NexStar FullStop: stopping N slew.\00"
@str.6 = [35 x i8] c"NexStar FullStop: stopping S slew.\00"
@str.7 = [35 x i8] c"NexStar FullStop: stopping E slew.\00"
@str.8 = [35 x i8] c"NexStar FullStop: stopping W slew.\00"
define void @FullStop() {
%1 = tail call i32 (...) @GetSlewStatus()
%2 = icmp eq i32 %1, 1
br i1 %2, label %3, label %13
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.5, i64 0, i64 0))
%5 = tail call i32 @StopSlew(i32 1)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.6, i64 0, i64 0))
%7 = tail call i32 @StopSlew(i32 2)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.7, i64 0, i64 0))
%9 = tail call i32 @StopSlew(i32 4)
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.8, i64 0, i64 0))
%11 = tail call i32 @StopSlew(i32 8)
%12 = tail call i32 @usleep(i32 1000000)
br label %13
13: ; preds = %3, %0
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%15 = tail call i32 (...) @StopTrack()
ret void
}