#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 /*<<< orphan*/ sscanf(char *, char *, double *);
int scan_real_interpolation_points(int n, char *points, double *cff) {
  int i;
  double c;
  char *ptr;
  ptr = points;
  for (i = 0; i < n; i++) {
    while (*ptr == ' ')
      ptr++;
    sscanf(&ptr[0], "%lf", &c);
    cff[i] = c;
    if (i < n - 1)
      while (*ptr != ' ')
        ptr++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<scan_real_interpolation_points>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11d9 <scan_real_interpolation_points+0xc9>
jmp    1143 <scan_real_interpolation_points+0x33>
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1164 <scan_real_interpolation_points+0x54>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    1143 <scan_real_interpolation_points+0x33>
mov    -0x30(%rbp),%rdi
lea    0xe91(%rip),%rsi
lea    -0x28(%rbp),%rdx
call   1030 <sscanf@plt>
movsd  -0x28(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    11c6 <scan_real_interpolation_points+0xb6>
jmp    11a0 <scan_real_interpolation_points+0x90>
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     11c1 <scan_real_interpolation_points+0xb1>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    11a0 <scan_real_interpolation_points+0x90>
jmp    11c6 <scan_real_interpolation_points+0xb6>
jmp    11cb <scan_real_interpolation_points+0xbb>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1132 <scan_real_interpolation_points+0x22>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scan_real_interpolation_points>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    117f <scan_real_interpolation_points+0x6f>
mov    %rdx,%r14
mov    %rsi,%r12
lea    -0x1(%rdi),%r13d
mov    %edi,%ebp
xor    %r15d,%r15d
jmp    1139 <scan_real_interpolation_points+0x29>
add    $0x1,%r15
cmp    %rbp,%r15
je     117f <scan_real_interpolation_points+0x6f>
add    $0xffffffffffffffff,%r12
nopl   (%rax)
mov    %r12,%rbx
add    $0x1,%r12
cmpb   $0x20,0x1(%rbx)
je     1140 <scan_real_interpolation_points+0x30>
mov    %r12,%rdi
lea    0xea9(%rip),%rsi
mov    %rsp,%rdx
call   1030 <sscanf@plt>
movsd  (%rsp),%xmm0
movsd  %xmm0,(%r14,%r15,8)
cmp    %r13,%r15
jae    1130 <scan_real_interpolation_points+0x20>
nop
lea    0x1(%rbx),%r12
cmpb   $0x20,0x1(%rbx)
mov    %r12,%rbx
jne    1170 <scan_real_interpolation_points+0x60>
jmp    1130 <scan_real_interpolation_points+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
define i32 @scan_real_interpolation_points(i32 %0, i8* %1, double* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca double*
%7 = alloca i32
%8 = alloca double
%9 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store double* %2, double** %6
%10 = load i8*, i8** %5
store i8* %10, i8** %9
store i32 0, i32* %7
br label %11
11: ; preds = %48, %3
%12 = load i32, i32* %7
%13 = load i32, i32* %4
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %51
15: ; preds = %11
br label %16
16: ; preds = %21, %15
%17 = load i8*, i8** %9
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 32
br i1 %20, label %21, label %24
21: ; preds = %16
%22 = load i8*, i8** %9
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %9
br label %16
24: ; preds = %16
%25 = load i8*, i8** %9
%26 = getelementptr inbounds i8, i8* %25, i64 0
%27 = call i32 @sscanf(i8* %26, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %8)
%28 = load double, double* %8
%29 = load double*, double** %6
%30 = load i32, i32* %7
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds double, double* %29, i64 %31
store double %28, double* %32
%33 = load i32, i32* %7
%34 = load i32, i32* %4
%35 = sub nsw i32 %34, 1
%36 = icmp slt i32 %33, %35
br i1 %36, label %37, label %47
37: ; preds = %24
br label %38
38: ; preds = %43, %37
%39 = load i8*, i8** %9
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = icmp ne i32 %41, 32
br i1 %42, label %43, label %46
43: ; preds = %38
%44 = load i8*, i8** %9
%45 = getelementptr inbounds i8, i8* %44, i32 1
store i8* %45, i8** %9
br label %38
46: ; preds = %38
br label %47
47: ; preds = %46, %24
br label %48
48: ; preds = %47
%49 = load i32, i32* %7
%50 = add nsw i32 %49, 1
store i32 %50, i32* %7
br label %11
51: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
define i32 @scan_real_interpolation_points(i32 %0, i8* nocapture %1, double* nocapture writeonly %2) {
%4 = alloca double
%5 = bitcast double* %4 to i8*
%6 = icmp sgt i32 %0, 0
br i1 %6, label %7, label %33
7: ; preds = %3
%8 = add nsw i32 %0, -1
%9 = zext i32 %8 to i64
%10 = zext i32 %0 to i64
br label %11
11: ; preds = %7, %29
%12 = phi i64 [ 0, %7 ], [ %31, %29 ]
%13 = phi i8* [ %1, %7 ], [ %30, %29 ]
br label %14
14: ; preds = %14, %11
%15 = phi i8* [ %18, %14 ], [ %13, %11 ]
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 32
%18 = getelementptr inbounds i8, i8* %15, i64 1
br i1 %17, label %14, label %19
19: ; preds = %14
%20 = call i32 @sscanf(i8* %15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %4)
%21 = load double, double* %4
%22 = getelementptr inbounds double, double* %2, i64 %12
store double %21, double* %22
%23 = icmp ult i64 %12, %9
br i1 %23, label %24, label %29
24: ; preds = %19, %24
%25 = phi i8* [ %28, %24 ], [ %15, %19 ]
%26 = load i8, i8* %25
%27 = icmp eq i8 %26, 32
%28 = getelementptr inbounds i8, i8* %25, i64 1
br i1 %27, label %29, label %24
29: ; preds = %24, %19
%30 = phi i8* [ %15, %19 ], [ %25, %24 ]
%31 = add nuw nsw i64 %12, 1
%32 = icmp eq i64 %31, %10
br i1 %32, label %33, label %11
33: ; preds = %29, %3
ret i32 0
}