#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 *Create1(int);
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n, *p, i;
  printf("Please input n:");
  scanf("%d", &n);
  p = Create1(n);
  printf("Please input %d integers:\n", n);
  for (i = 0; i < n; i++)
    scanf("%d", &p[i]);
  for (i = 0; i < n; i++)
    printf("%d ", -p[i] * 10);
  free(p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xeac(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <Create1@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11c6 <main+0x86>
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe5d(%rip),%rdi
call   1060 <scanf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1191 <main+0x51>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1205 <main+0xc5>
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
xor    %eax,%eax
sub    (%rcx,%rdx,4),%eax
imul   $0xa,%eax,%esi
lea    0xe3e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11cd <main+0x8d>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xeb1(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeb3(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <Create1@plt>
mov    %rax,%r15
mov    0x4(%rsp),%esi
lea    0xe95(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x0,0x4(%rsp)
jle    11f3 <main+0xb3>
xor    %r12d,%r12d
lea    0xe7a(%rip),%r14
mov    %r15,%rbx
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
add    $0x1,%r12
movslq 0x4(%rsp),%rax
add    $0x4,%rbx
cmp    %rax,%r12
jl     11a0 <main+0x60>
test   %eax,%eax
jle    11f3 <main+0xb3>
lea    0xe66(%rip),%r14
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%eax
add    %eax,%eax
lea    (%rax,%rax,4),%esi
neg    %esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
movslq 0x4(%rsp),%rax
cmp    %rax,%rbx
jl     11d0 <main+0x90>
mov    %r15,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

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