#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 */
scalar_t__ GetEditControl(char *, int, int);
int sscanf(char *, char *, double *);
int GetEditControlDouble(double *d, int Var, int offset) {
  int result;
  char s[80];
  if (GetEditControl(s, Var, offset))
    return 1;
  result = sscanf(s, "%lf", d);
  if (result != 1)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<GetEditControlDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1040 <GetEditControl@plt>
cmp    $0x0,%rax
je     1157 <GetEditControlDouble+0x37>
movl   $0x1,-0x4(%rbp)
jmp    118b <GetEditControlDouble+0x6b>
lea    -0x70(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe9a(%rip),%rsi
call   1030 <sscanf@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x1,-0x1c(%rbp)
je     1184 <GetEditControlDouble+0x64>
movl   $0x1,-0x4(%rbp)
jmp    118b <GetEditControlDouble+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetEditControlDouble>:
push   %rbx
sub    $0x50,%rsp
mov    %rdi,%rbx
mov    %rsp,%rdi
call   1040 <GetEditControl@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jne    1159 <GetEditControlDouble+0x39>
lea    0xebc(%rip),%rsi
mov    %rsp,%rdi
mov    %rbx,%rdx
call   1030 <sscanf@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
setne  %al
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
define i32 @GetEditControlDouble(double* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca double*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [80 x i8]
store double* %0, double** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%10 = getelementptr inbounds [80 x i8], [80 x i8]* %9, i64 0, i64 0
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = call i64 @GetEditControl(i8* %10, i32 %11, i32 %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %3
store i32 1, i32* %4
br label %24
16: ; preds = %3
%17 = getelementptr inbounds [80 x i8], [80 x i8]* %9, i64 0, i64 0
%18 = load double*, double** %5
%19 = call i32 @sscanf(i8* %17, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %18)
store i32 %19, i32* %8
%20 = load i32, i32* %8
%21 = icmp ne i32 %20, 1
br i1 %21, label %22, label %23
22: ; preds = %16
store i32 1, i32* %4
br label %24
23: ; preds = %16
store i32 0, i32* %4
br label %24
24: ; preds = %23, %22, %15
%25 = load i32, i32* %4
ret i32 %25
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
define i32 @GetEditControlDouble(double* %0, i32 %1, i32 %2) {
%4 = alloca [80 x i8]
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%6 = call i64 @GetEditControl(i8* %5, i32 %1, i32 %2)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %3
%9 = call i32 @sscanf(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %0)
%10 = icmp ne i32 %9, 1
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %8, %3
%13 = phi i32 [ 1, %3 ], [ %11, %8 ]
ret i32 %13
}