#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 */
struct line_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ DEBUG4(char *, char const *, double);
char *Find_value(struct line_list *, char const *, char const *);
double strtod(char const *, char **);
double Find_double_value(struct line_list *l, const char *key,
                         const char *sep) {
  const char *s = 0;
  char *e;
  double n = 0;
  if (l && (s = Find_value(l, key, sep))) {
    e = 0;
    n = strtod(s, &e);
  }
  DEBUG4("Find_double_value: key '%s', value '%0.0f'", key, n);
  return (n);
}


x86 assembly (clang, -O0):
<Find_double_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1198 <Find_double_value+0x68>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <Find_value@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     1198 <Find_double_value+0x68>
movq   $0x0,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1040 <strtod@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rsi
movsd  -0x30(%rbp),%xmm0
lea    0xe58(%rip),%rdi
call   1030 <DEBUG4@plt>
movsd  -0x30(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Find_double_value>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
xorps  %xmm0,%xmm0
test   %rdi,%rdi
je     1166 <Find_double_value+0x36>
mov    %rbx,%rsi
call   1050 <Find_value@plt>
xorps  %xmm0,%xmm0
test   %rax,%rax
je     1166 <Find_double_value+0x36>
movq   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rsi
mov    %rax,%rdi
call   1040 <strtod@plt>
lea    0xe93(%rip),%rdi
mov    %rbx,%rsi
movsd  %xmm0,(%rsp)
call   1030 <DEBUG4@plt>
movsd  (%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.line_list = type { i32 }
@.str = [43 x i8] c"Find_double_value: key '%s', value '%0.0f'\00"
define double @Find_double_value(%struct.line_list* %0, i8* %1, i8* %2) {
%4 = alloca %struct.line_list*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca double
store %struct.line_list* %0, %struct.line_list** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
store i8* null, i8** %7
store double 0.000000e+00, double* %9
%10 = load %struct.line_list*, %struct.line_list** %4
%11 = icmp ne %struct.line_list* %10, null
br i1 %11, label %12, label %21
12: ; preds = %3
%13 = load %struct.line_list*, %struct.line_list** %4
%14 = load i8*, i8** %5
%15 = load i8*, i8** %6
%16 = call i8* @Find_value(%struct.line_list* %13, i8* %14, i8* %15)
store i8* %16, i8** %7
%17 = icmp ne i8* %16, null
br i1 %17, label %18, label %21
18: ; preds = %12
store i8* null, i8** %8
%19 = load i8*, i8** %7
%20 = call double @strtod(i8* %19, i8** %8)
store double %20, double* %9
br label %21
21: ; preds = %18, %12, %3
%22 = load i8*, i8** %5
%23 = load double, double* %9
%24 = call i32 @DEBUG4(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %22, double %23)
%25 = load double, double* %9
ret double %25
}

LLVM IR (-O2):
%struct.line_list = type { i32 }
@.str = [43 x i8] c"Find_double_value: key '%s', value '%0.0f'\00"
define double @Find_double_value(%struct.line_list* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = bitcast i8** %4 to i8*
%6 = icmp eq %struct.line_list* %0, null
br i1 %6, label %12, label %7
7: ; preds = %3
%8 = tail call i8* @Find_value(%struct.line_list* %0, i8* %1, i8* %2)
%9 = icmp eq i8* %8, null
br i1 %9, label %12, label %10
10: ; preds = %7
store i8* null, i8** %4
%11 = call double @strtod(i8* %8, i8** %4)
br label %12
12: ; preds = %10, %7, %3
%13 = phi double [ %11, %10 ], [ 0.000000e+00, %7 ], [ 0.000000e+00, %3 ]
%14 = tail call i32 @DEBUG4(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %1, double %13)
ret double %13
}