#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*/ printf(char *, int);
int /*<<< orphan*/ right_shift(int *, int, int);
int /*<<< orphan*/ scanf(char *, int *, ...);
int main() {
  int n, m;
  int a[110] = {0};
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++)
    scanf("%d", a + i);
  right_shift(a, n, m);
  for (int i = 0; i < n - 1; i++)
    printf("%d ", a[i]);
  printf("%d", a[n - 1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1e0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x1d0(%rbp),%rdi
xor    %esi,%esi
mov    $0x1b8,%edx
call   1040 <memset@plt>
lea    0xe94(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
mov    $0x0,%al
call   1050 <scanf@plt>
movl   $0x0,-0x1d4(%rbp)
mov    -0x1d4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11cb <main+0x8b>
lea    -0x1d0(%rbp),%rsi
movslq -0x1d4(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x1d4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1d4(%rbp)
jmp    1185 <main+0x45>
lea    -0x1d0(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1060 <right_shift@plt>
movl   $0x0,-0x1d8(%rbp)
mov    -0x1d8(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1229 <main+0xe9>
movslq -0x1d8(%rbp),%rax
mov    -0x1d0(%rbp,%rax,4),%esi
lea    0xdf5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1d8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1d8(%rbp)
jmp    11e7 <main+0xa7>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x1d0(%rbp,%rax,4),%esi
lea    0xdc3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x1e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x1d0,%rsp
lea    0x10(%rsp),%r15
mov    $0x1b8,%edx
mov    %r15,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
lea    0xe99(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x8(%rsp),%esi
test   %esi,%esi
jle    11af <main+0x6f>
lea    0xe7b(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
add    $0x1,%rbx
movslq 0x8(%rsp),%rsi
add    $0x4,%r15
cmp    %rsi,%rbx
jl     1190 <main+0x50>
mov    0xc(%rsp),%edx
lea    0x10(%rsp),%rdi
call   1060 <right_shift@plt>
movslq 0x8(%rsp),%rax
cmp    $0x2,%rax
jl     1200 <main+0xc0>
xor    %ebx,%ebx
lea    0xe34(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x10(%rsp,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
movslq 0x8(%rsp),%rax
add    $0xffffffffffffffff,%rax
cmp    %rax,%rbx
jl     11e0 <main+0xa0>
jmp    1204 <main+0xc4>
add    $0xffffffffffffffff,%rax
mov    0x10(%rsp,%rax,4),%esi
lea    0xdf3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x1d0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

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