#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*/ assign(int *, int *, int);
int /*<<< orphan*/ input(int *, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int d, N, b[20], a[30];
  scanf("%d %d", &d, &N);
  input(b, N);
  assign(a, b, d);
  printf("%d", a[N]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xea7(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <scanf@plt>
lea    -0x60(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <input@plt>
lea    -0xe0(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    -0x8(%rbp),%edx
call   1060 <assign@plt>
movslq -0xc(%rbp),%rax
mov    -0xe0(%rbp,%rax,4),%esi
lea    0xe6c(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xe0,%rsp
lea    0xeb1(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1050 <scanf@plt>
mov    0x8(%rsp),%esi
lea    0x90(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <input@plt>
mov    0xc(%rsp),%edx
lea    0x10(%rsp),%rdi
mov    %rbx,%rsi
call   1060 <assign@plt>
movslq 0x8(%rsp),%rax
mov    0x10(%rsp,%rax,4),%esi
lea    0xe70(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [20 x i32]
%5 = alloca [30 x i32]
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%7 = getelementptr inbounds [20 x i32], [20 x i32]* %4, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call i32 @input(i32* %7, i32 %8)
%10 = getelementptr inbounds [30 x i32], [30 x i32]* %5, i64 0, i64 0
%11 = getelementptr inbounds [20 x i32], [20 x i32]* %4, i64 0, i64 0
%12 = load i32, i32* %2
%13 = call i32 @assign(i32* %10, i32* %11, i32 %12)
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [30 x i32], [30 x i32]* %5, i64 0, i64 %15
%17 = load i32, i32* %16
%18 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [20 x i32]
%4 = alloca [30 x i32]
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast [20 x i32]* %3 to i8*
%8 = bitcast [30 x i32]* %4 to i8*
%9 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%10 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 0
%11 = load i32, i32* %2
%12 = call i32 @input(i32* %10, i32 %11)
%13 = getelementptr inbounds [30 x i32], [30 x i32]* %4, i64 0, i64 0
%14 = load i32, i32* %1
%15 = call i32 @assign(i32* %13, i32* %10, i32 %14)
%16 = load i32, i32* %2
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [30 x i32], [30 x i32]* %4, i64 0, i64 %17
%19 = load i32, i32* %18
%20 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %19)
ret i32 0
}