#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 */
double atof(char *);
int /*<<< orphan*/ clear_line(char *, int);
int /*<<< orphan*/ getline_my(char *, int);
int /*<<< orphan*/ printf(char *, ...);
void main() {
  char line[1000];
  int i = 0;
  int digit_i = 0;
  double digit = 0.0;
  printf("\nInput please line to convert:");
  clear_line(line, 1000);
  getline_my(line, 1000);
  digit = atof(line);
  printf("Getted from line = %s;\ndigit in double = %f;\n", line, digit);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
movl   $0x0,-0x3f4(%rbp)
movl   $0x0,-0x3f8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x400(%rbp)
ff
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1030 <clear_line@plt>
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1060 <getline_my@plt>
lea    -0x3f0(%rbp),%rdi
call   1040 <atof@plt>
movsd  %xmm0,-0x400(%rbp)
ff
lea    -0x3f0(%rbp),%rsi
movsd  -0x400(%rbp),%xmm0
ff
lea    0xe5b(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x3f0,%rsp
lea    0xeb1(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1030 <clear_line@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1060 <getline_my@plt>
mov    %rbx,%rdi
call   1040 <atof@plt>
lea    0xe9d(%rip),%rdi
mov    %rbx,%rsi
mov    $0x1,%al
call   1050 <printf@plt>
add    $0x3f0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"\0AInput please line to convert:\00"
@.str.1 = [46 x i8] c"Getted from line = %s;\0Adigit in double = %f;\0A\00"
define void @main() {
%1 = alloca [1000 x i8]
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
store i32 0, i32* %2
store i32 0, i32* %3
store double 0.000000e+00, double* %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%7 = call i32 @clear_line(i8* %6, i32 1000)
%8 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%9 = call i32 @getline_my(i8* %8, i32 1000)
%10 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%11 = call double @atof(i8* %10)
store double %11, double* %4
%12 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%13 = load double, double* %4
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i8* %12, double %13)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"\0AInput please line to convert:\00"
@.str.1 = [46 x i8] c"Getted from line = %s;\0Adigit in double = %f;\0A\00"
define void @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @clear_line(i8* %2, i32 1000)
%5 = call i32 @getline_my(i8* %2, i32 1000)
%6 = call double @atof(i8* %2)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i8* %2, double %6)
ret void
}