#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*/ free(int *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int *p, *s, *i, *N;
  p = NULL;
  s = NULL;
  i = NULL;
  N = NULL;
  N = (int *)malloc(sizeof(int));
  printf("Введите кол-во чисел: ");
  scanf("%d", N);
  p = (int *)malloc(*N * sizeof(int));
  s = (int *)malloc(*N * sizeof(int));
  i = (int *)malloc(sizeof(int));
  for (*i = 0; *i < *N; (*i)++) {
    p[*i] = *i + 1;
  }
  for (*i = 0; *i < *N; (*i)++) {
    s[*i] = p[*i] * p[*i];
  }
  printf("Число\tКвадрат\n");
  printf("_______________\n");
  for (*i = 0; *i < *N; (*i)++) {
    printf("  %d\t  |   %d\n", p[*i], s[*i]);
  }
  free(p);
  free(s);
  free(i);
  free(N);
  p = NULL;
  s = NULL;
  i = NULL;
  N = NULL;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x28(%rbp)
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%rsi
lea    0xe92(%rip),%rdi
call   1060 <scanf@plt>
mov    -0x28(%rbp),%rax
movslq (%rax),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x28(%rbp),%rax
movslq (%rax),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jge    1218 <main+0xd8>
mov    -0x20(%rbp),%rax
mov    (%rax),%edx
add    $0x1,%edx
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movslq (%rcx),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
jmp    11df <main+0x9f>
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jge    126f <main+0x12f>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movslq (%rcx),%rcx
imul   (%rax,%rcx,4),%edx
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
movslq (%rcx),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
jmp    1222 <main+0xe2>
lea    0xdb5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdc2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jge    12e1 <main+0x1a1>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,4),%esi
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xd8d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
jmp    1295 <main+0x155>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0x4,%edi
call   1060 <malloc@plt>
mov    %rax,%r14
lea    0xe91(%rip),%rdi
xor    %ebp,%ebp
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xea9(%rip),%rdi
mov    %r14,%rsi
call   1070 <scanf@plt>
mov    (%r14),%edi
shl    $0x2,%edi
call   1060 <malloc@plt>
mov    %rax,%r12
mov    (%r14),%edi
shl    $0x2,%edi
call   1060 <malloc@plt>
mov    %rax,%r15
mov    $0x4,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
movl   $0x0,(%rax)
cmpl   $0x0,(%r14)
jle    11d6 <main+0x86>
nopl   0x0(%rax)
movslq %ebp,%rax
add    $0x1,%ebp
mov    %ebp,(%r12,%rax,4)
mov    (%rbx),%ebp
add    $0x1,%ebp
mov    %ebp,(%rbx)
cmp    (%r14),%ebp
jl     11c0 <main+0x70>
movl   $0x0,(%rbx)
cmpl   $0x0,(%r14)
jle    1209 <main+0xb9>
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cltq
mov    (%r12,%rax,4),%ecx
imul   %ecx,%ecx
mov    %ecx,(%r15,%rax,4)
mov    (%rbx),%eax
add    $0x1,%eax
mov    %eax,(%rbx)
cmp    (%r14),%eax
jl     11f0 <main+0xa0>
lea    0xe2a(%rip),%rdi
call   1040 <puts@plt>
lea    0xe38(%rip),%rdi
call   1040 <puts@plt>
movl   $0x0,(%rbx)
cmpl   $0x0,(%r14)
jle    1260 <main+0x110>
lea    0xdf7(%rip),%r13
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
cltq
mov    (%r12,%rax,4),%esi
mov    (%r15,%rax,4),%edx
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%rbx),%eax
add    $0x1,%eax
mov    %eax,(%rbx)
cmp    (%r14),%eax
jl     1240 <main+0xf0>
mov    %r12,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [40 x i8] c"\D0\92\D0\B2\D0\B5\D0\B4\D0\B8\D1\82\D0\B5 \D0\BA\D0\BE\D0\BB-\D0\B2\D0\BE \D1\87\D0\B8\D1\81\D0\B5\D0\BB: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [27 x i8] c"\D0\A7\D0\B8\D1\81\D0\BB\D0\BE\09\D0\9A\D0\B2\D0\B0\D0\B4\D1\80\D0\B0\D1\82\0A\00"
@.str.3 = [17 x i8] c"_______________\0A\00"
@.str.4 = [15 x i8] c" %d\09 | %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32*
store i32 0, i32* %1
store i32* null, i32** %2
store i32* null, i32** %3
store i32* null, i32** %4
store i32* null, i32** %5
%6 = call i64 @malloc(i32 4)
%7 = inttoptr i64 %6 to i32*
store i32* %7, i32** %5
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%9 = load i32*, i32** %5
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %9)
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = sext i32 %12 to i64
%14 = mul i64 %13, 4
%15 = trunc i64 %14 to i32
%16 = call i64 @malloc(i32 %15)
%17 = inttoptr i64 %16 to i32*
store i32* %17, i32** %2
%18 = load i32*, i32** %5
%19 = load i32, i32* %18
%20 = sext i32 %19 to i64
%21 = mul i64 %20, 4
%22 = trunc i64 %21 to i32
%23 = call i64 @malloc(i32 %22)
%24 = inttoptr i64 %23 to i32*
store i32* %24, i32** %3
%25 = call i64 @malloc(i32 4)
%26 = inttoptr i64 %25 to i32*
store i32* %26, i32** %4
%27 = load i32*, i32** %4
store i32 0, i32* %27
br label %28
28: ; preds = %43, %0
%29 = load i32*, i32** %4
%30 = load i32, i32* %29
%31 = load i32*, i32** %5
%32 = load i32, i32* %31
%33 = icmp slt i32 %30, %32
br i1 %33, label %34, label %47
34: ; preds = %28
%35 = load i32*, i32** %4
%36 = load i32, i32* %35
%37 = add nsw i32 %36, 1
%38 = load i32*, i32** %2
%39 = load i32*, i32** %4
%40 = load i32, i32* %39
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i32, i32* %38, i64 %41
store i32 %37, i32* %42
br label %43
43: ; preds = %34
%44 = load i32*, i32** %4
%45 = load i32, i32* %44
%46 = add nsw i32 %45, 1
store i32 %46, i32* %44
br label %28
47: ; preds = %28
%48 = load i32*, i32** %4
store i32 0, i32* %48
br label %49
49: ; preds = %74, %47
%50 = load i32*, i32** %4
%51 = load i32, i32* %50
%52 = load i32*, i32** %5
%53 = load i32, i32* %52
%54 = icmp slt i32 %51, %53
br i1 %54, label %55, label %78
55: ; preds = %49
%56 = load i32*, i32** %2
%57 = load i32*, i32** %4
%58 = load i32, i32* %57
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds i32, i32* %56, i64 %59
%61 = load i32, i32* %60
%62 = load i32*, i32** %2
%63 = load i32*, i32** %4
%64 = load i32, i32* %63
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds i32, i32* %62, i64 %65
%67 = load i32, i32* %66
%68 = mul nsw i32 %61, %67
%69 = load i32*, i32** %3
%70 = load i32*, i32** %4
%71 = load i32, i32* %70
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds i32, i32* %69, i64 %72
store i32 %68, i32* %73
br label %74
74: ; preds = %55
%75 = load i32*, i32** %4
%76 = load i32, i32* %75
%77 = add nsw i32 %76, 1
store i32 %77, i32* %75
br label %49
78: ; preds = %49
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%81 = load i32*, i32** %4
store i32 0, i32* %81
br label %82
82: ; preds = %102, %78
%83 = load i32*, i32** %4
%84 = load i32, i32* %83
%85 = load i32*, i32** %5
%86 = load i32, i32* %85
%87 = icmp slt i32 %84, %86
br i1 %87, label %88, label %106
88: ; preds = %82
%89 = load i32*, i32** %2
%90 = load i32*, i32** %4
%91 = load i32, i32* %90
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds i32, i32* %89, i64 %92
%94 = load i32, i32* %93
%95 = load i32*, i32** %3
%96 = load i32*, i32** %4
%97 = load i32, i32* %96
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds i32, i32* %95, i64 %98
%100 = load i32, i32* %99
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 %94, i32 %100)
br label %102
102: ; preds = %88
%103 = load i32*, i32** %4
%104 = load i32, i32* %103
%105 = add nsw i32 %104, 1
store i32 %105, i32* %103
br label %82
106: ; preds = %82
%107 = load i32*, i32** %2
%108 = call i32 @free(i32* %107)
%109 = load i32*, i32** %3
%110 = call i32 @free(i32* %109)
%111 = load i32*, i32** %4
%112 = call i32 @free(i32* %111)
%113 = load i32*, i32** %5
%114 = call i32 @free(i32* %113)
store i32* null, i32** %2
store i32* null, i32** %3
store i32* null, i32** %4
store i32* null, i32** %5
ret i32 0
}

LLVM IR (-O2):
@.str = [40 x i8] c"\D0\92\D0\B2\D0\B5\D0\B4\D0\B8\D1\82\D0\B5 \D0\BA\D0\BE\D0\BB-\D0\B2\D0\BE \D1\87\D0\B8\D1\81\D0\B5\D0\BB: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.4 = [15 x i8] c" %d\09 | %d\0A\00"
@str = [26 x i8] c"\D0\A7\D0\B8\D1\81\D0\BB\D0\BE\09\D0\9A\D0\B2\D0\B0\D0\B4\D1\80\D0\B0\D1\82\00"
@str.5 = [16 x i8] c"_______________\00"
define i32 @main() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = shl i32 %5, 2
%7 = tail call i64 @malloc(i32 %6)
%8 = inttoptr i64 %7 to i32*
%9 = load i32, i32* %2
%10 = shl i32 %9, 2
%11 = tail call i64 @malloc(i32 %10)
%12 = inttoptr i64 %11 to i32*
%13 = tail call i64 @malloc(i32 4)
%14 = inttoptr i64 %13 to i32*
store i32 0, i32* %14
%15 = load i32, i32* %2
%16 = icmp sgt i32 %15, 0
br i1 %16, label %20, label %17
17: ; preds = %20, %0
store i32 0, i32* %14
%18 = load i32, i32* %2
%19 = icmp sgt i32 %18, 0
br i1 %19, label %29, label %40
20: ; preds = %0, %20
%21 = phi i32 [ %26, %20 ], [ 0, %0 ]
%22 = add nsw i32 %21, 1
%23 = sext i32 %21 to i64
%24 = getelementptr inbounds i32, i32* %8, i64 %23
store i32 %22, i32* %24
%25 = load i32, i32* %14
%26 = add nsw i32 %25, 1
store i32 %26, i32* %14
%27 = load i32, i32* %2
%28 = icmp slt i32 %26, %27
br i1 %28, label %20, label %17
29: ; preds = %17, %29
%30 = phi i32 [ %37, %29 ], [ 0, %17 ]
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i32, i32* %8, i64 %31
%33 = load i32, i32* %32
%34 = mul nsw i32 %33, %33
%35 = getelementptr inbounds i32, i32* %12, i64 %31
store i32 %34, i32* %35
%36 = load i32, i32* %14
%37 = add nsw i32 %36, 1
store i32 %37, i32* %14
%38 = load i32, i32* %2
%39 = icmp slt i32 %37, %38
br i1 %39, label %29, label %40
40: ; preds = %29, %17
%41 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%42 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.5, i64 0, i64 0))
store i32 0, i32* %14
%43 = load i32, i32* %2
%44 = icmp sgt i32 %43, 0
br i1 %44, label %45, label %57
45: ; preds = %40, %45
%46 = phi i32 [ %54, %45 ], [ 0, %40 ]
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds i32, i32* %8, i64 %47
%49 = load i32, i32* %48
%50 = getelementptr inbounds i32, i32* %12, i64 %47
%51 = load i32, i32* %50
%52 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 %49, i32 %51)
%53 = load i32, i32* %14
%54 = add nsw i32 %53, 1
store i32 %54, i32* %14
%55 = load i32, i32* %2
%56 = icmp slt i32 %54, %55
br i1 %56, label %45, label %57
57: ; preds = %45, %40
%58 = tail call i32 @free(i32* %8)
%59 = tail call i32 @free(i32* %12)
%60 = tail call i32 @free(i32* %14)
%61 = tail call i32 @free(i32* %2)
ret i32 0
}