#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 */
typedef int /*<<< orphan*/ line;

/* Variables and functions */
int /*<<< orphan*/ LC_ALL;
int /*<<< orphan*/ printArray(int *, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ reverse(int *, int);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int main() {
  setlocale(LC_ALL, "RUS");
  int line[] = {5, 6, 2, 4, 9, 2, 1}, size;
  size = sizeof(line) / sizeof(line[0]);
  printf("Исходный массив:\n");
  printArray(line, size);
  reverse(line, size);
  printf("\nМассив в обратном порядке:\n");
  printArray(line, size);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
lea    0xea1(%rip),%rsi
call   1050 <setlocale@plt>
mov    0xef5(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xef2(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeef(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xeed(%rip),%eax
mov    %eax,-0x8(%rbp)
movl   $0x7,-0x24(%rbp)
lea    0xe68(%rip),%rdi
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1060 <printArray@plt>
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1030 <reverse@plt>
lea    0xe64(%rip),%rdi
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1060 <printArray@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
lea    0xeab(%rip),%rsi
call   1050 <setlocale@plt>
movups 0xf0b(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xef3(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xe8c(%rip),%rdi
call   1040 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x7,%esi
call   1060 <printArray@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <reverse@plt>
lea    0xe82(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1060 <printArray@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [4 x i8] c"RUS\00"
@__const.main.line = [7 x i32] [i32 5, i32 6, i32 2, i32 4, i32 9, i32 2, i32 1]
@.str.1 = [32 x i8] c"\D0\98\D1\81\D1\85\D0\BE\D0\B4\D0\BD\D1\8B\D0\B9 \D0\BC\D0\B0\D1\81\D1\81\D0\B8\D0\B2:\0A\00"
@.str.2 = [51 x i8] c"\0A\D0\9C\D0\B0\D1\81\D1\81\D0\B8\D0\B2 \D0\B2 \D0\BE\D0\B1\D1\80\D0\B0\D1\82\D0\BD\D0\BE\D0\BC \D0\BF\D0\BE\D1\80\D1\8F\D0\B4\D0\BA\D0\B5:\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* @LC_ALL
%5 = call i32 @setlocale(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = bitcast [7 x i32]* %2 to i8*
store i32 7, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%8 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
%9 = load i32, i32* %3
%10 = call i32 @printArray(i32* %8, i32 %9)
%11 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
%12 = load i32, i32* %3
%13 = call i32 @reverse(i32* %11, i32 %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0))
%15 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
%16 = load i32, i32* %3
%17 = call i32 @printArray(i32* %15, i32 %16)
ret i32 0
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [4 x i8] c"RUS\00"
@__const.main.line = [7 x i32] [i32 5, i32 6, i32 2, i32 4, i32 9, i32 2, i32 1]
@str = [31 x i8] c"\D0\98\D1\81\D1\85\D0\BE\D0\B4\D0\BD\D1\8B\D0\B9 \D0\BC\D0\B0\D1\81\D1\81\D0\B8\D0\B2:\00"
@str.3 = [50 x i8] c"\0A\D0\9C\D0\B0\D1\81\D1\81\D0\B8\D0\B2 \D0\B2 \D0\BE\D0\B1\D1\80\D0\B0\D1\82\D0\BD\D0\BE\D0\BC \D0\BF\D0\BE\D1\80\D1\8F\D0\B4\D0\BA\D0\B5:\00"
define i32 @main() {
%1 = alloca [7 x i32]
%2 = load i32, i32* @LC_ALL
%3 = tail call i32 @setlocale(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = bitcast [7 x i32]* %1 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%6 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%7 = call i32 @printArray(i32* %6, i32 7)
%8 = call i32 @reverse(i32* %6, i32 7)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.3, i64 0, i64 0))
%10 = call i32 @printArray(i32* %6, i32 7)
ret i32 0
}