#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 */
int sscanf(char *, char *, double *, double *, double *, char *);
int input_numbers(char *input, double returns[]) {
  char ch;
  double a, b, c;
  if (sscanf(input, "%lf %lf %lf %c", &a, &b, &c, &ch) != 3)
    return -1;
  returns[0] = a;
  returns[1] = b;
  returns[2] = c;
  return 0;
}


x86 assembly (clang, -O0):
<input_numbers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed5(%rip),%rsi
lea    -0x28(%rbp),%rdx
lea    -0x30(%rbp),%rcx
lea    -0x38(%rbp),%r8
lea    -0x19(%rbp),%r9
call   1030 <sscanf@plt>
cmp    $0x3,%eax
je     1155 <input_numbers+0x45>
movl   $0xffffffff,-0x4(%rbp)
jmp    1185 <input_numbers+0x75>
movsd  -0x28(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x30(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x38(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x10(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<input_numbers>:
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%rbx
lea    0xee1(%rip),%rsi
lea    0x18(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0x8(%rsp),%r8
lea    0x7(%rsp),%r9
call   1030 <sscanf@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    $0x3,%ecx
jne    1166 <input_numbers+0x56>
movsd  0x18(%rsp),%xmm0
movsd  %xmm0,(%rbx)
movsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rbx)
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x10(%rbx)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"%lf %lf %lf %c\00"
define i32 @input_numbers(i8* nocapture %0, double* nocapture writeonly %1) {
%3 = alloca i8
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = bitcast double* %4 to i8*
%8 = bitcast double* %5 to i8*
%9 = bitcast double* %6 to i8*
%10 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double* %4, double* %5, double* %6, i8* %3)
%11 = icmp eq i32 %10, 3
br i1 %11, label %12, label %18
12: ; preds = %2
%13 = load double, double* %4
store double %13, double* %1
%14 = load double, double* %5
%15 = getelementptr inbounds double, double* %1, i64 1
store double %14, double* %15
%16 = load double, double* %6
%17 = getelementptr inbounds double, double* %1, i64 2
store double %16, double* %17
br label %18
18: ; preds = %2, %12
%19 = phi i32 [ 0, %12 ], [ -1, %2 ]
ret i32 %19
}