#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*/ arMultiCleanup();
int arMultiGetIdsMarker(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ arMultiInit(int /*<<< orphan*/ *);
double arMultiMarkerTrigDist(char *);
char getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sleep(int);
int main(int argc, char **argv) {
  char objs[] = "";
  int j = arMultiGetIdsMarker(NULL, objs);
  printf("salio test %d\n", j);
  int i;
  sleep(2);
  printf("%s \n", objs);
  arMultiInit(NULL);
  printf("PASO Init\n");
  char c = 'c';
  int x = 3;
  double z;
  while ((x > 0)) {
    c = getchar();
    z = arMultiMarkerTrigDist("Left");
    if (z == -1) {
      printf("ERRORO \n");
    } else {
      printf(" QUAT: Pos x: %3.1f\n", z);
    }
  }
  arMultiCleanup();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x11(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1050 <memset@plt>
lea    -0x11(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1080 <arMultiGetIdsMarker@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe48(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x2,%edi
call   10a0 <sleep@plt>
lea    -0x11(%rbp),%rsi
lea    0xe3b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1070 <arMultiInit@plt>
lea    0xe29(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movb   $0x63,-0x1d(%rbp)
movl   $0x3,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jle    1272 <main+0xf2>
mov    $0x0,%al
call   1060 <getchar@plt>
mov    %al,-0x1d(%rbp)
lea    0xe07(%rip),%rdi
call   1030 <arMultiMarkerTrigDist@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  0xdc9(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    125a <main+0xda>
jp     125a <main+0xda>
lea    0xdde(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    126d <main+0xed>
movsd  -0x30(%rbp),%xmm0
lea    0xdcf(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    1205 <main+0x85>
mov    $0x0,%al
call   1090 <arMultiCleanup@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xf(%rsp)
lea    0xf(%rsp),%rbx
xor    %edi,%edi
mov    %rbx,%rsi
call   1080 <arMultiGetIdsMarker@plt>
lea    0xe74(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x2,%edi
call   1090 <sleep@plt>
lea    0xe69(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %edi,%edi
call   1070 <arMultiInit@plt>
lea    0xe70(%rip),%rdi
call   1030 <puts@plt>
lea    0xe4a(%rip),%rbx
lea    0xe67(%rip),%r14
lea    0xe41(%rip),%r15
jmp    11fa <main+0x8a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    %rbx,%rdi
call   1040 <arMultiMarkerTrigDist@plt>
ucomisd 0xdef(%rip),%xmm0
jne    11f0 <main+0x80>
jp     11f0 <main+0x80>
mov    %r14,%rdi
call   1030 <puts@plt>
jmp    11fa <main+0x8a>

LLVM IR (-O0):
@.str = [15 x i8] c"salio test %d\0A\00"
@.str.1 = [5 x i8] c"%s \0A\00"
@.str.2 = [11 x i8] c"PASO Init\0A\00"
@.str.3 = [5 x i8] c"Left\00"
@.str.4 = [9 x i8] c"ERRORO \0A\00"
@.str.5 = [21 x i8] c" QUAT: Pos x: %3.1f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [1 x i8]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8
%10 = alloca i32
%11 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = bitcast [1 x i8]* %6 to i8*
%13 = getelementptr inbounds [1 x i8], [1 x i8]* %6, i64 0, i64 0
%14 = call i32 @arMultiGetIdsMarker(i32* null, i8* %13)
store i32 %14, i32* %7
%15 = load i32, i32* %7
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = call i32 @sleep(i32 2)
%18 = getelementptr inbounds [1 x i8], [1 x i8]* %6, i64 0, i64 0
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %18)
%20 = call i32 @arMultiInit(i32* null)
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
store i8 99, i8* %9
store i32 3, i32* %10
br label %22
22: ; preds = %35, %2
%23 = load i32, i32* %10
%24 = icmp sgt i32 %23, 0
br i1 %24, label %25, label %36
25: ; preds = %22
%26 = call signext i8 (...) @getchar()
store i8 %26, i8* %9
%27 = call double @arMultiMarkerTrigDist(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
store double %27, double* %11
%28 = load double, double* %11
%29 = fcmp oeq double %28, -1.000000e+00
br i1 %29, label %30, label %32
30: ; preds = %25
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
br label %35
32: ; preds = %25
%33 = load double, double* %11
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), double %33)
br label %35
35: ; preds = %32, %30
br label %22
36: ; preds = %22
%37 = call i32 (...) @arMultiCleanup()
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"salio test %d\0A\00"
@.str.1 = [5 x i8] c"%s \0A\00"
@.str.3 = [5 x i8] c"Left\00"
@.str.5 = [21 x i8] c" QUAT: Pos x: %3.1f\0A\00"
@str = [10 x i8] c"PASO Init\00"
@str.6 = [8 x i8] c"ERRORO \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [1 x i8]
%4 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0, i64 0
store i8 0, i8* %4
%5 = call i32 @arMultiGetIdsMarker(i32* null, i8* %4)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @sleep(i32 2)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%9 = call i32 @arMultiInit(i32* null)
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
br label %11
11: ; preds = %19, %2
%12 = call signext i8 (...) @getchar()
%13 = call double @arMultiMarkerTrigDist(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%14 = fcmp oeq double %13, -1.000000e+00
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.6, i64 0, i64 0))
br label %19
17: ; preds = %11
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), double %13)
br label %19
19: ; preds = %17, %15
br label %11
}