#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 */
float atof(char const *);
int /*<<< orphan*/ move2globalxyz(float, float, float, float, int *, int *,
                                  int *, int *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ readSettings();
int main(int argc, const char *argv[]) {
  readSettings();
  if (argc != 4) {
    printf("check arguments");
    return 0;
  }
  const char *stringx = argv[1], *stringy = argv[2], *stringz = argv[3];
  float x = atof(stringx), y = atof(stringy), z = atof(stringz), theta = 0.0;
  int h1, h2, h3, sv;
  move2globalxyz(x, y, z, theta, &h1, &h2, &h3, &sv);
  sv *= -1;
  printf("%05d, %05d, %05d, %04d\n", h1, h2, h3, sv);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1060 <readSettings@plt>
cmpl   $0x4,-0x8(%rbp)
je     1181 <main+0x41>
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1229 <main+0xe9>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x2c(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x30(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x34(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x38(%rbp)
movss  -0x2c(%rbp),%xmm0
movss  -0x30(%rbp),%xmm1
movss  -0x34(%rbp),%xmm2
movss  -0x38(%rbp),%xmm3
lea    -0x3c(%rbp),%rdi
lea    -0x40(%rbp),%rsi
lea    -0x44(%rbp),%rdx
lea    -0x48(%rbp),%rcx
call   1040 <move2globalxyz@plt>
imul   $0xffffffff,-0x48(%rbp),%eax
mov    %eax,-0x48(%rbp)
mov    -0x3c(%rbp),%esi
mov    -0x40(%rbp),%edx
mov    -0x44(%rbp),%ecx
mov    -0x48(%rbp),%r8d
lea    0xdf5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1060 <readSettings@plt>
cmp    $0x4,%ebp
jne    11d4 <main+0x94>
mov    0x8(%rbx),%rdi
mov    0x10(%rbx),%rbp
mov    0x18(%rbx),%rbx
call   1030 <atof@plt>
movss  %xmm0,0x8(%rsp)
mov    %rbp,%rdi
call   1030 <atof@plt>
movss  %xmm0,0x4(%rsp)
mov    %rbx,%rdi
call   1030 <atof@plt>
movaps %xmm0,%xmm2
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
mov    %rsp,%rcx
xorps  %xmm3,%xmm3
movss  0x8(%rsp),%xmm0
movss  0x4(%rsp),%xmm1
call   1040 <move2globalxyz@plt>
xor    %r8d,%r8d
sub    (%rsp),%r8d
mov    %r8d,(%rsp)
mov    0x14(%rsp),%esi
mov    0x10(%rsp),%edx
mov    0xc(%rsp),%ecx
lea    0xe45(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    11e2 <main+0xa2>
lea    0xe25(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"check arguments\00"
@.str.1 = [24 x i8] c"%05d, %05d, %05d, %04d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%17 = call i32 (...) @readSettings()
%18 = load i32, i32* %4
%19 = icmp ne i32 %18, 4
br i1 %19, label %20, label %22
20: ; preds = %2
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %50
22: ; preds = %2
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 1
%25 = load i8*, i8** %24
store i8* %25, i8** %6
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 2
%28 = load i8*, i8** %27
store i8* %28, i8** %7
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 3
%31 = load i8*, i8** %30
store i8* %31, i8** %8
%32 = load i8*, i8** %6
%33 = call float @atof(i8* %32)
store float %33, float* %9
%34 = load i8*, i8** %7
%35 = call float @atof(i8* %34)
store float %35, float* %10
%36 = load i8*, i8** %8
%37 = call float @atof(i8* %36)
store float %37, float* %11
store float 0.000000e+00, float* %12
%38 = load float, float* %9
%39 = load float, float* %10
%40 = load float, float* %11
%41 = load float, float* %12
%42 = call i32 @move2globalxyz(float %38, float %39, float %40, float %41, i32* %13, i32* %14, i32* %15, i32* %16)
%43 = load i32, i32* %16
%44 = mul nsw i32 %43, -1
store i32 %44, i32* %16
%45 = load i32, i32* %13
%46 = load i32, i32* %14
%47 = load i32, i32* %15
%48 = load i32, i32* %16
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %45, i32 %46, i32 %47, i32 %48)
store i32 0, i32* %3
br label %50
50: ; preds = %22, %20
%51 = load i32, i32* %3
ret i32 %51
}

LLVM IR (-O2):
@.str = [16 x i8] c"check arguments\00"
@.str.1 = [24 x i8] c"%05d, %05d, %05d, %04d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = tail call i32 (...) @readSettings()
%8 = icmp eq i32 %0, 4
br i1 %8, label %11, label %9
9: ; preds = %2
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %32
11: ; preds = %2
%12 = getelementptr inbounds i8*, i8** %1, i64 1
%13 = load i8*, i8** %12
%14 = getelementptr inbounds i8*, i8** %1, i64 2
%15 = load i8*, i8** %14
%16 = getelementptr inbounds i8*, i8** %1, i64 3
%17 = load i8*, i8** %16
%18 = tail call float @atof(i8* %13)
%19 = tail call float @atof(i8* %15)
%20 = tail call float @atof(i8* %17)
%21 = bitcast i32* %3 to i8*
%22 = bitcast i32* %4 to i8*
%23 = bitcast i32* %5 to i8*
%24 = bitcast i32* %6 to i8*
%25 = call i32 @move2globalxyz(float %18, float %19, float %20, float 0.000000e+00, i32* %3, i32* %4, i32* %5, i32* %6)
%26 = load i32, i32* %6
%27 = sub nsw i32 0, %26
store i32 %27, i32* %6
%28 = load i32, i32* %3
%29 = load i32, i32* %4
%30 = load i32, i32* %5
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %28, i32 %29, i32 %30, i32 %27)
br label %32
32: ; preds = %11, %9
ret i32 0
}