#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 */
typedef int /*<<< orphan*/ mpf_t;

/* Variables and functions */
int /*<<< orphan*/ gmp_printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ mpf_init(int /*<<< orphan*/);
int /*<<< orphan*/ mpf_set_default_prec(int);
int /*<<< orphan*/ mpf_set_str(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ mpf_sqrt(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  if (argc <= 1) {
    printf("Reference: Add one argument for a.\n");
    return 1;
  }
  mpf_t res, a;
  mpf_set_default_prec(1000000);
  mpf_init(res);
  mpf_init(a);
  mpf_set_str(a, argv[1], 10);
  mpf_sqrt(res, a);
  gmp_printf("%.1000Ff\n", res);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     1198 <main+0x38>
lea    0xe79(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11e8 <main+0x88>
mov    $0xf4240,%edi
call   1060 <mpf_set_default_prec@plt>
mov    -0x14(%rbp),%edi
call   1050 <mpf_init@plt>
mov    -0x18(%rbp),%edi
call   1050 <mpf_init@plt>
mov    -0x18(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    $0xa,%edx
call   1070 <mpf_set_str@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1030 <mpf_sqrt@plt>
mov    -0x14(%rbp),%esi
lea    0xe48(%rip),%rdi
call   1080 <gmp_printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x1,%edi
jg     1179 <main+0x19>
lea    0xe9d(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rbx
ret
mov    %rsi,%rbx
mov    $0xf4240,%edi
call   1060 <mpf_set_default_prec@plt>
call   1050 <mpf_init@plt>
call   1050 <mpf_init@plt>
mov    0x8(%rbx),%rsi
mov    $0xa,%edx
call   1070 <mpf_set_str@plt>
call   1040 <mpf_sqrt@plt>
lea    0xe56(%rip),%rdi
call   1080 <gmp_printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Reference: Add one argument for a.\0A\00"
@.str.1 = [10 x i8] c"%.1000Ff\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp sle i32 %8, 1
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %28
12: ; preds = %2
%13 = call i32 @mpf_set_default_prec(i32 1000000)
%14 = load i32, i32* %6
%15 = call i32 @mpf_init(i32 %14)
%16 = load i32, i32* %7
%17 = call i32 @mpf_init(i32 %16)
%18 = load i32, i32* %7
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = call i32 @mpf_set_str(i32 %18, i8* %21, i32 10)
%23 = load i32, i32* %6
%24 = load i32, i32* %7
%25 = call i32 @mpf_sqrt(i32 %23, i32 %24)
%26 = load i32, i32* %6
%27 = call i32 @gmp_printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %26)
store i32 0, i32* %3
br label %28
28: ; preds = %12, %10
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
@.str.1 = [10 x i8] c"%.1000Ff\0A\00"
@str = [35 x i8] c"Reference: Add one argument for a.\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
br label %15
6: ; preds = %2
%7 = tail call i32 @mpf_set_default_prec(i32 1000000)
%8 = tail call i32 @mpf_init(i32 undef)
%9 = tail call i32 @mpf_init(i32 undef)
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i32 @mpf_set_str(i32 undef, i8* %11, i32 10)
%13 = tail call i32 @mpf_sqrt(i32 undef, i32 undef)
%14 = tail call i32 @gmp_printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 undef)
br label %15
15: ; preds = %6, %4
%16 = phi i32 [ 1, %4 ], [ 0, %6 ]
ret i32 %16
}