#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 _ada_use_c2pieri(int, int *, int *, double *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int retrieve_target_curve(void) {
  int fail, n;
  int *b;
  printf("\nGive degree of freedom of target curve : ");
  scanf("%d", &n);
  {
    double c[2 * n];
    int i;
    fail = _ada_use_c2pieri(7, &n, b, c);
    printf("the coefficients of the target curve :\n");
    for (i = 0; i < n; i = i + 2)
      printf("  %.15le  %.15le \n", c[i], c[i + 1]);
  }
  return fail;
}


x86 assembly (clang, -O0):
<retrieve_target_curve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xec1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
add    %eax,%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rdx
shl    $0x3,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdx
mov    $0x7,%edi
lea    -0x8(%rbp),%rsi
call   1040 <_ada_use_c2pieri@plt>
mov    %eax,-0x4(%rbp)
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11e7 <retrieve_target_curve+0xb7>
mov    -0x30(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
lea    0xe84(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x24(%rbp)
jmp    11a4 <retrieve_target_curve+0x74>
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<retrieve_target_curve>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xeab(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec8(%rip),%rdi
lea    -0x2c(%rbp),%r14
mov    %r14,%rsi
call   1060 <scanf@plt>
mov    %rsp,%r12
mov    -0x2c(%rbp),%eax
add    %eax,%eax
mov    %rsp,%r13
shl    $0x3,%rax
sub    %rax,%r13
mov    %r13,%rsp
mov    $0x7,%edi
mov    %r14,%rsi
mov    %r13,%rcx
call   1050 <_ada_use_c2pieri@plt>
mov    %eax,%r14d
lea    0xea3(%rip),%rdi
call   1030 <puts@plt>
cmpl   $0x0,-0x2c(%rbp)
jle    11e1 <retrieve_target_curve+0xa1>
xor    %ebx,%ebx
lea    0xe7c(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  0x0(%r13,%rbx,8),%xmm0
movsd  0x8(%r13,%rbx,8),%xmm1
mov    %r15,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
add    $0x2,%rbx
cmp    %ebx,-0x2c(%rbp)
jg     11c0 <retrieve_target_curve+0x80>
mov    %r12,%rsp
mov    %r14d,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [43 x i8] c"\0AGive degree of freedom of target curve : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [40 x i8] c"the coefficients of the target curve :\0A\00"
@.str.3 = [19 x i8] c" %.15le %.15le \0A\00"
define i32 @retrieve_target_curve() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %2
%10 = mul nsw i32 2, %9
%11 = zext i32 %10 to i64
%12 = call i8* @llvm.stacksave()
store i8* %12, i8** %4
%13 = alloca double, i64 %11
store i64 %11, i64* %5
%14 = load i32*, i32** %3
%15 = call i32 @_ada_use_c2pieri(i32 7, i32* %2, i32* %14, double* %13)
store i32 %15, i32* %1
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %6
br label %17
17: ; preds = %32, %0
%18 = load i32, i32* %6
%19 = load i32, i32* %2
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %35
21: ; preds = %17
%22 = load i32, i32* %6
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds double, double* %13, i64 %23
%25 = load double, double* %24
%26 = load i32, i32* %6
%27 = add nsw i32 %26, 1
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds double, double* %13, i64 %28
%30 = load double, double* %29
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), double %25, double %30)
br label %32
32: ; preds = %21
%33 = load i32, i32* %6
%34 = add nsw i32 %33, 2
store i32 %34, i32* %6
br label %17
35: ; preds = %17
%36 = load i8*, i8** %4
%37 = load i32, i32* %1
ret i32 %37
}

LLVM IR (-O2):
@.str = [43 x i8] c"\0AGive degree of freedom of target curve : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [19 x i8] c" %.15le %.15le \0A\00"
@str = [39 x i8] c"the coefficients of the target curve :\00"
define i32 @retrieve_target_curve() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = shl nsw i32 %5, 1
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
%9 = alloca double, i64 %7
%10 = call i32 @_ada_use_c2pieri(i32 7, i32* %1, i32* undef, double* %9)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%12 = load i32, i32* %1
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %26
14: ; preds = %0, %14
%15 = phi i64 [ %22, %14 ], [ 0, %0 ]
%16 = getelementptr inbounds double, double* %9, i64 %15
%17 = load double, double* %16
%18 = or i64 %15, 1
%19 = getelementptr inbounds double, double* %9, i64 %18
%20 = load double, double* %19
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), double %17, double %20)
%22 = add nuw i64 %15, 2
%23 = load i32, i32* %1
%24 = trunc i64 %22 to i32
%25 = icmp sgt i32 %23, %24
br i1 %25, label %14, label %26
26: ; preds = %14, %0
ret i32 %10
}