#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 EXIT_FAILURE;
scalar_t__ EXIT_SUCCESS;
int /*<<< orphan*/ printErr(char *);
scalar_t__ strcmp(char *, char *);
double strtod(char *, char **);
int parseValueAsinSqrt(int argc, char *argv[], double *number) {
  char *tail = argv[2];
  if (argc != 3) {
    printErr("Spatny pocet argumentu.");
    return EXIT_FAILURE;
  }
  *number = strtod(argv[2], &tail);
  if (strcmp(tail, "") == EXIT_SUCCESS) {
    return EXIT_SUCCESS;
  } else {
    printErr("Nejedna se o cislo");
    return EXIT_FAILURE;
  }
}


x86 assembly (clang, -O0):
<parseValueAsinSqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x20(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     1176 <parseValueAsinSqrt+0x46>
lea    0xea0(%rip),%rdi
call   1030 <printErr@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11d9 <parseValueAsinSqrt+0xa9>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <strtod@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rdi
lea    0xe7d(%rip),%rsi
call   1050 <strcmp@plt>
mov    0x2e32(%rip),%rcx
cmp    (%rcx),%rax
jne    11c1 <parseValueAsinSqrt+0x91>
mov    0x2e22(%rip),%rax
mov    (%rax),%rax
mov    %eax,-0x4(%rbp)
jmp    11d9 <parseValueAsinSqrt+0xa9>
lea    0xe50(%rip),%rdi
call   1030 <printErr@plt>
mov    0x2e0c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseValueAsinSqrt>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%eax
mov    0x10(%rsi),%rdi
mov    %rdi,0x8(%rsp)
cmp    $0x3,%eax
jne    117c <parseValueAsinSqrt+0x4c>
mov    %rdx,%rbx
lea    0x8(%rsp),%rsi
call   1040 <strtod@plt>
movsd  %xmm0,(%rbx)
mov    0x8(%rsp),%rdi
lea    0xeb5(%rip),%rsi
call   1050 <strcmp@plt>
mov    0x2e6a(%rip),%rcx
cmp    (%rcx),%rax
je     1191 <parseValueAsinSqrt+0x61>
lea    0xe9e(%rip),%rdi
jmp    1183 <parseValueAsinSqrt+0x53>
lea    0xe7d(%rip),%rdi
call   1030 <printErr@plt>
mov    0x2e51(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Spatny pocet argumentu.\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [1 x i8] zeroinitializer
@EXIT_SUCCESS = global i64 0
@.str.2 = [19 x i8] c"Nejedna se o cislo\00"
define i32 @parseValueAsinSqrt(i32 %0, i8** %1, double* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca double*
%8 = alloca i8*
store i32 %0, i32* %5
store i8** %1, i8*** %6
store double* %2, double** %7
%9 = load i8**, i8*** %6
%10 = getelementptr inbounds i8*, i8** %9, i64 2
%11 = load i8*, i8** %10
store i8* %11, i8** %8
%12 = load i32, i32* %5
%13 = icmp ne i32 %12, 3
br i1 %13, label %14, label %17
14: ; preds = %3
%15 = call i32 @printErr(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%16 = load i32, i32* @EXIT_FAILURE
store i32 %16, i32* %4
br label %33
17: ; preds = %3
%18 = load i8**, i8*** %6
%19 = getelementptr inbounds i8*, i8** %18, i64 2
%20 = load i8*, i8** %19
%21 = call double @strtod(i8* %20, i8** %8)
%22 = load double*, double** %7
store double %21, double* %22
%23 = load i8*, i8** %8
%24 = call i64 @strcmp(i8* %23, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%25 = load i64, i64* @EXIT_SUCCESS
%26 = icmp eq i64 %24, %25
br i1 %26, label %27, label %30
27: ; preds = %17
%28 = load i64, i64* @EXIT_SUCCESS
%29 = trunc i64 %28 to i32
store i32 %29, i32* %4
br label %33
30: ; preds = %17
%31 = call i32 @printErr(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%32 = load i32, i32* @EXIT_FAILURE
store i32 %32, i32* %4
br label %33
33: ; preds = %30, %27, %14
%34 = load i32, i32* %4
ret i32 %34
}

LLVM IR (-O2):
@.str = [24 x i8] c"Spatny pocet argumentu.\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [1 x i8] zeroinitializer
@EXIT_SUCCESS = global i64 0
@.str.2 = [19 x i8] c"Nejedna se o cislo\00"
define i32 @parseValueAsinSqrt(i32 %0, i8** nocapture %1, double* nocapture writeonly %2) {
%4 = alloca i8*
%5 = bitcast i8** %4 to i8*
%6 = getelementptr inbounds i8*, i8** %1, i64 2
%7 = load i8*, i8** %6
store i8* %7, i8** %4
%8 = icmp eq i32 %0, 3
br i1 %8, label %12, label %9
9: ; preds = %3
%10 = tail call i32 @printErr(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
br label %23
12: ; preds = %3
%13 = call double @strtod(i8* %7, i8** %4)
store double %13, double* %2
%14 = load i8*, i8** %4
%15 = tail call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%16 = load i64, i64* @EXIT_SUCCESS
%17 = icmp eq i64 %15, %16
br i1 %17, label %18, label %20
18: ; preds = %12
%19 = trunc i64 %15 to i32
br label %23
20: ; preds = %12
%21 = tail call i32 @printErr(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%22 = load i32, i32* @EXIT_FAILURE
br label %23
23: ; preds = %20, %18, %9
%24 = phi i32 [ %11, %9 ], [ %19, %18 ], [ %22, %20 ]
ret i32 %24
}