#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*/ move2localxyz(float, float, float, 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;
  move2localxyz(x, y, z, &h1, &h2, &h3);
  printf("%05d, %05d, %05d\n", h1, h2, h3);
  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   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1215 <main+0xd5>
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
lea    -0x3c(%rbp),%rdi
lea    -0x40(%rbp),%rsi
lea    -0x44(%rbp),%rdx
call   1050 <move2localxyz@plt>
mov    -0x3c(%rbp),%esi
mov    -0x40(%rbp),%edx
mov    -0x44(%rbp),%ecx
lea    0xe09(%rip),%rdi
mov    $0x0,%al
call   1040 <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    11c3 <main+0x83>
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
movss  0x8(%rsp),%xmm0
movss  0x4(%rsp),%xmm1
call   1050 <move2localxyz@plt>
mov    0x14(%rsp),%esi
mov    0x10(%rsp),%edx
mov    0xc(%rsp),%ecx
lea    0xe56(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11d1 <main+0x91>
lea    0xe36(%rip),%rdi
xor    %eax,%eax
call   1040 <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 = [18 x i8] c"%05d, %05d, %05d\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 %46
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 = call i32 @move2localxyz(float %38, float %39, float %40, i32* %13, i32* %14, i32* %15)
%42 = load i32, i32* %13
%43 = load i32, i32* %14
%44 = load i32, i32* %15
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %42, i32 %43, i32 %44)
store i32 0, i32* %3
br label %46
46: ; preds = %22, %20
%47 = load i32, i32* %3
ret i32 %47
}

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