#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*/ input_append_input_arguments_with_double(char const *,
                                                            double);
char *input_get_argument(int, char **, char const *);
double input_get_double(int argc, char **argv, const char *argument,
                        double _default) {
  char *value = input_get_argument(argc, argv, argument);
  if (value) {
    input_append_input_arguments_with_double(argument, atof(value));
    return atof(value);
  }
  return _default;
}


x86 assembly (clang, -O0):
<input_get_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movsd  %xmm0,-0x28(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <input_get_argument@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     1194 <input_get_double+0x64>
mov    -0x20(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rdi
call   1040 <atof@plt>
mov    -0x38(%rbp),%rdi
call   1050 <input_append_input_arguments_with_double@plt>
mov    -0x30(%rbp),%rdi
call   1040 <atof@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    119e <input_get_double+0x6e>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<input_get_double>:
push   %r14
push   %rbx
push   %rax
movsd  %xmm0,(%rsp)
mov    %rdx,%r14
call   1030 <input_get_argument@plt>
test   %rax,%rax
je     1168 <input_get_double+0x38>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <atof@plt>
mov    %r14,%rdi
call   1050 <input_append_input_arguments_with_double@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <atof@plt>
movsd  (%rsp),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define double @input_get_double(i32 %0, i8** %1, i8* %2, double %3) {
%5 = alloca double
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8*
%9 = alloca double
%10 = alloca i8*
store i32 %0, i32* %6
store i8** %1, i8*** %7
store i8* %2, i8** %8
store double %3, double* %9
%11 = load i32, i32* %6
%12 = load i8**, i8*** %7
%13 = load i8*, i8** %8
%14 = call i8* @input_get_argument(i32 %11, i8** %12, i8* %13)
store i8* %14, i8** %10
%15 = load i8*, i8** %10
%16 = icmp ne i8* %15, null
br i1 %16, label %17, label %24
17: ; preds = %4
%18 = load i8*, i8** %8
%19 = load i8*, i8** %10
%20 = call double @atof(i8* %19)
%21 = call i32 @input_append_input_arguments_with_double(i8* %18, double %20)
%22 = load i8*, i8** %10
%23 = call double @atof(i8* %22)
store double %23, double* %5
br label %26
24: ; preds = %4
%25 = load double, double* %9
store double %25, double* %5
br label %26
26: ; preds = %24, %17
%27 = load double, double* %5
ret double %27
}

LLVM IR (-O2):
define double @input_get_double(i32 %0, i8** %1, i8* %2, double %3) {
%5 = tail call i8* @input_get_argument(i32 %0, i8** %1, i8* %2)
%6 = icmp eq i8* %5, null
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = tail call double @atof(i8* %5)
%9 = tail call i32 @input_append_input_arguments_with_double(i8* %2, double %8)
%10 = tail call double @atof(i8* %5)
br label %11
11: ; preds = %4, %7
%12 = phi double [ %10, %7 ], [ %3, %4 ]
ret double %12
}