#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*/ derivative(int *, int *, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int arr[100], result[100], i, N;
  scanf("%d", &N);
  for (i = 0; i < N; i++) {
    scanf("%d", &arr[i]);
  }
  derivative(arr, result, N);
  for (i = 0; i < N; i++) {
    printf("%d ", result[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x340,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
lea    -0x338(%rbp),%rsi
call   1050 <scanf@plt>
movl   $0x0,-0x334(%rbp)
mov    -0x334(%rbp),%eax
cmp    -0x338(%rbp),%eax
jge    11a6 <main+0x76>
movslq -0x334(%rbp),%rax
lea    -0x1a0(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe73(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x334(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x334(%rbp)
jmp    115f <main+0x2f>
lea    -0x1a0(%rbp),%rdi
lea    -0x330(%rbp),%rsi
mov    -0x338(%rbp),%edx
call   1040 <derivative@plt>
movl   $0x0,-0x334(%rbp)
mov    -0x334(%rbp),%eax
cmp    -0x338(%rbp),%eax
jge    1209 <main+0xd9>
movslq -0x334(%rbp),%rax
mov    -0x330(%rbp,%rax,4),%esi
lea    0xe13(%rip),%rdi
call   1030 <printf@plt>
mov    -0x334(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x334(%rbp)
jmp    11c9 <main+0x99>
xor    %eax,%eax
add    $0x340,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x330,%rsp
lea    0xebd(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edx
test   %edx,%edx
jle    118d <main+0x5d>
lea    0x1a0(%rsp),%r15
xor    %ebx,%ebx
lea    0xe9a(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
add    $0x1,%rbx
movslq 0xc(%rsp),%rdx
add    $0x4,%r15
cmp    %rdx,%rbx
jl     1170 <main+0x40>
lea    0x1a0(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1040 <derivative@plt>
cmpl   $0x0,0xc(%rsp)
jle    11ca <main+0x9a>
xor    %ebx,%ebx
lea    0xe54(%rip),%r14
nop
mov    0x10(%rsp,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
movslq 0xc(%rsp),%rax
cmp    %rax,%rbx
jl     11b0 <main+0x80>
xor    %eax,%eax
add    $0x330,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i32]
%3 = alloca [100 x i32]
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
store i32 0, i32* %4
br label %7
7: ; preds = %16, %0
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %19
11: ; preds = %7
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %13
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %14)
br label %16
16: ; preds = %11
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %7
19: ; preds = %7
%20 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 0
%21 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 0
%22 = load i32, i32* %5
%23 = call i32 @derivative(i32* %20, i32* %21, i32 %22)
store i32 0, i32* %4
br label %24
24: ; preds = %34, %19
%25 = load i32, i32* %4
%26 = load i32, i32* %5
%27 = icmp slt i32 %25, %26
br i1 %27, label %28, label %37
28: ; preds = %24
%29 = load i32, i32* %4
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %30
%32 = load i32, i32* %31
%33 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %32)
br label %34
34: ; preds = %28
%35 = load i32, i32* %4
%36 = add nsw i32 %35, 1
store i32 %36, i32* %4
br label %24
37: ; preds = %24
ret i32 0
}

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