#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 store_start_curve(void) {
  int fail, n;
  int *b;
  printf("\nGive degree of freedom at start curve : ");
  scanf("%d", &n);
  printf("Generating %d complex numbers...\n", n);
  {
    double c[2 * n];
    int i;
    for (i = 0; i < 2 * n; i++)
      c[i] = (double)i;
    fail = _ada_use_c2pieri(6, &n, b, c);
  }
  return fail;
}


x86 assembly (clang, -O0):
<store_start_curve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    0xec1(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x31(%rbp)
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x31(%rbp),%al
mov    -0x8(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@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)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jge    11c7 <store_start_curve+0x97>
mov    -0x30(%rbp),%rax
cvtsi2sdl -0x24(%rbp),%xmm0
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1196 <store_start_curve+0x66>
mov    -0x30(%rbp),%rcx
mov    -0x10(%rbp),%rdx
mov    $0x6,%edi
lea    -0x8(%rbp),%rsi
call   1040 <_ada_use_c2pieri@plt>
mov    %eax,-0x4(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<store_start_curve>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xf0e(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf2a(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x14(%rbp),%esi
lea    0xf1a(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rsp,%r14
mov    -0x14(%rbp),%eax
add    %eax,%eax
mov    %rsp,%rcx
shl    $0x3,%rax
sub    %rax,%rcx
mov    %rcx,%rsp
mov    -0x14(%rbp),%edx
test   %edx,%edx
jle    1285 <store_start_curve+0x155>
add    %edx,%edx
cmp    $0x2,%edx
mov    $0x1,%eax
cmovge %edx,%eax
cmp    $0x4,%eax
jae    11a3 <store_start_curve+0x73>
xor    %edx,%edx
jmp    1270 <store_start_curve+0x140>
mov    %eax,%edx
and    $0x7ffffffc,%edx
lea    -0x4(%rdx),%rsi
mov    %rsi,%rbx
shr    $0x2,%rbx
add    $0x1,%rbx
test   %rsi,%rsi
je     129f <store_start_curve+0x16f>
mov    %rbx,%rsi
and    $0xfffffffffffffffe,%rsi
movdqa 0xe2e(%rip),%xmm0
xor    %edi,%edi
movdqa 0xe34(%rip),%xmm1
movdqa 0xe3c(%rip),%xmm2
movdqa 0xe44(%rip),%xmm3
movdqa 0xe4c(%rip),%xmm4
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movdqa %xmm0,%xmm5
cvtdq2pd %xmm0,%xmm6
paddd  %xmm1,%xmm5
cvtdq2pd %xmm5,%xmm5
movaps %xmm6,(%rcx,%rdi,8)
movaps %xmm5,0x10(%rcx,%rdi,8)
movdqa %xmm0,%xmm5
paddd  %xmm2,%xmm5
movdqa %xmm0,%xmm6
cvtdq2pd %xmm5,%xmm5
paddd  %xmm3,%xmm6
cvtdq2pd %xmm6,%xmm6
movaps %xmm5,0x20(%rcx,%rdi,8)
movaps %xmm6,0x30(%rcx,%rdi,8)
add    $0x8,%rdi
paddd  %xmm4,%xmm0
add    $0xfffffffffffffffe,%rsi
jne    1200 <store_start_curve+0xd0>
test   $0x1,%bl
je     1269 <store_start_curve+0x139>
cvtdq2pd %xmm0,%xmm1
paddd  0xdb6(%rip),%xmm0
cvtdq2pd %xmm0,%xmm0
movdqa %xmm1,(%rcx,%rdi,8)
movdqa %xmm0,0x10(%rcx,%rdi,8)
cmp    %rax,%rdx
je     1285 <store_start_curve+0x155>
xchg   %ax,%ax
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
movsd  %xmm0,(%rcx,%rdx,8)
add    $0x1,%rdx
cmp    %rdx,%rax
jne    1270 <store_start_curve+0x140>
lea    -0x14(%rbp),%rsi
mov    $0x6,%edi
call   1040 <_ada_use_c2pieri@plt>
mov    %r14,%rsp
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
movdqa 0xd59(%rip),%xmm0
xor    %edi,%edi
test   $0x1,%bl
jne    124e <store_start_curve+0x11e>
jmp    1269 <store_start_curve+0x139>

LLVM IR (-O0):
@.str = [42 x i8] c"\0AGive degree of freedom at start curve : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [34 x i8] c"Generating %d complex numbers...\0A\00"
define i32 @store_start_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 ([42 x i8], [42 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 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %2
%12 = mul nsw i32 2, %11
%13 = zext i32 %12 to i64
%14 = call i8* @llvm.stacksave()
store i8* %14, i8** %4
%15 = alloca double, i64 %13
store i64 %13, i64* %5
store i32 0, i32* %6
br label %16
16: ; preds = %27, %0
%17 = load i32, i32* %6
%18 = load i32, i32* %2
%19 = mul nsw i32 2, %18
%20 = icmp slt i32 %17, %19
br i1 %20, label %21, label %30
21: ; preds = %16
%22 = load i32, i32* %6
%23 = sitofp i32 %22 to double
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds double, double* %15, i64 %25
store double %23, double* %26
br label %27
27: ; preds = %21
%28 = load i32, i32* %6
%29 = add nsw i32 %28, 1
store i32 %29, i32* %6
br label %16
30: ; preds = %16
%31 = load i32*, i32** %3
%32 = call i32 @_ada_use_c2pieri(i32 6, i32* %2, i32* %31, double* %15)
store i32 %32, i32* %1
%33 = load i8*, i8** %4
%34 = load i32, i32* %1
ret i32 %34
}

LLVM IR (-O2):
@.str = [42 x i8] c"\0AGive degree of freedom at start curve : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [34 x i8] c"Generating %d complex numbers...\0A\00"
define i32 @store_start_curve() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 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 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = shl nsw i32 %7, 1
%9 = zext i32 %8 to i64
%10 = call i8* @llvm.stacksave()
%11 = alloca double, i64 %9
%12 = load i32, i32* %1
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %75
14: ; preds = %0
%15 = shl nuw i32 %12, 1
%16 = call i32 @llvm.smax.i32(i32 %15, i32 1)
%17 = zext i32 %16 to i64
%18 = icmp ult i32 %16, 4
br i1 %18, label %66, label %19
19: ; preds = %14
%20 = and i64 %17, 2147483644
%21 = add nsw i64 %20, -4
%22 = lshr exact i64 %21, 2
%23 = add nuw nsw i64 %22, 1
%24 = and i64 %23, 1
%25 = icmp eq i64 %21, 0
br i1 %25, label %52, label %26
26: ; preds = %19
%27 = and i64 %23, 9223372036854775806
br label %28
28: ; preds = %28, %26
%29 = phi i64 [ 0, %26 ], [ %48, %28 ]
%30 = phi <2 x i32> [ <i32 0, i32 1>, %26 ], [ %49, %28 ]
%31 = phi i64 [ 0, %26 ], [ %50, %28 ]
%32 = add <2 x i32> %30, <i32 2, i32 2>
%33 = sitofp <2 x i32> %30 to <2 x double>
%34 = sitofp <2 x i32> %32 to <2 x double>
%35 = getelementptr inbounds double, double* %11, i64 %29
%36 = bitcast double* %35 to <2 x double>*
store <2 x double> %33, <2 x double>* %36
%37 = getelementptr inbounds double, double* %35, i64 2
%38 = bitcast double* %37 to <2 x double>*
store <2 x double> %34, <2 x double>* %38
%39 = or i64 %29, 4
%40 = add <2 x i32> %30, <i32 4, i32 4>
%41 = add <2 x i32> %30, <i32 6, i32 6>
%42 = sitofp <2 x i32> %40 to <2 x double>
%43 = sitofp <2 x i32> %41 to <2 x double>
%44 = getelementptr inbounds double, double* %11, i64 %39
%45 = bitcast double* %44 to <2 x double>*
store <2 x double> %42, <2 x double>* %45
%46 = getelementptr inbounds double, double* %44, i64 2
%47 = bitcast double* %46 to <2 x double>*
store <2 x double> %43, <2 x double>* %47
%48 = add nuw i64 %29, 8
%49 = add <2 x i32> %30, <i32 8, i32 8>
%50 = add i64 %31, 2
%51 = icmp eq i64 %50, %27
br i1 %51, label %52, label %28
52: ; preds = %28, %19
%53 = phi i64 [ 0, %19 ], [ %48, %28 ]
%54 = phi <2 x i32> [ <i32 0, i32 1>, %19 ], [ %49, %28 ]
%55 = icmp eq i64 %24, 0
br i1 %55, label %64, label %56
56: ; preds = %52
%57 = add <2 x i32> %54, <i32 2, i32 2>
%58 = sitofp <2 x i32> %54 to <2 x double>
%59 = sitofp <2 x i32> %57 to <2 x double>
%60 = getelementptr inbounds double, double* %11, i64 %53
%61 = bitcast double* %60 to <2 x double>*
store <2 x double> %58, <2 x double>* %61
%62 = getelementptr inbounds double, double* %60, i64 2
%63 = bitcast double* %62 to <2 x double>*
store <2 x double> %59, <2 x double>* %63
br label %64
64: ; preds = %52, %56
%65 = icmp eq i64 %20, %17
br i1 %65, label %75, label %66
66: ; preds = %14, %64
%67 = phi i64 [ 0, %14 ], [ %20, %64 ]
br label %68
68: ; preds = %66, %68
%69 = phi i64 [ %73, %68 ], [ %67, %66 ]
%70 = trunc i64 %69 to i32
%71 = sitofp i32 %70 to double
%72 = getelementptr inbounds double, double* %11, i64 %69
store double %71, double* %72
%73 = add nuw nsw i64 %69, 1
%74 = icmp eq i64 %73, %17
br i1 %74, label %75, label %68
75: ; preds = %68, %64, %0
%76 = call i32 @_ada_use_c2pieri(i32 6, i32* %1, i32* undef, double* %11)
ret i32 %76
}