#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 /*<<< orphan*/ scanf(char *, int *);
int main() {
  int c, vetor[10];
  for (c = 0; c <= 9; c++) {
    printf("Digite o %d numero", c + 1);
    scanf("%d", &vetor[c]);
  }
  for (c = 9; c >= 0; c--) {
    if (vetor[c] < 0) {
      printf("NEGATIVO\n");
    } else {
      printf("%d\n", vetor[c]);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x9,-0x8(%rbp)
jg     117d <main+0x5d>
mov    -0x8(%rbp),%esi
add    $0x1,%esi
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x8(%rbp),%rax
lea    -0x30(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xea9(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
movl   $0x9,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     11d9 <main+0xb9>
movslq -0x8(%rbp),%rax
cmpl   $0x0,-0x30(%rbp,%rax,4)
jge    11b0 <main+0x90>
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c6 <main+0xa6>
movslq -0x8(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11cb <main+0xab>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1184 <main+0x64>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
lea    0xec2(%rip),%r14
mov    %r14,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xebf(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    %r14,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    %r14,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    %r14,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    %r14,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    %r14,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    %r14,%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    %r14,%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    %r14,%rdi
mov    $0x9,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    %r14,%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x24(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0x24(%rsp),%esi
test   %esi,%esi
js     1273 <main+0x143>
lea    0xdac(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    127f <main+0x14f>
lea    0xda0(%rip),%rdi
call   1030 <puts@plt>
mov    0x20(%rsp),%esi
test   %esi,%esi
js     1297 <main+0x167>
lea    0xd88(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    12a3 <main+0x173>
lea    0xd7c(%rip),%rdi
call   1030 <puts@plt>
mov    0x1c(%rsp),%esi
test   %esi,%esi
js     12bb <main+0x18b>
lea    0xd64(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    12c7 <main+0x197>
lea    0xd58(%rip),%rdi
call   1030 <puts@plt>
mov    0x18(%rsp),%esi
test   %esi,%esi
js     12df <main+0x1af>
lea    0xd40(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    12eb <main+0x1bb>
lea    0xd34(%rip),%rdi
call   1030 <puts@plt>
mov    0x14(%rsp),%esi
test   %esi,%esi
js     1303 <main+0x1d3>
lea    0xd1c(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    130f <main+0x1df>
lea    0xd10(%rip),%rdi
call   1030 <puts@plt>
mov    0x10(%rsp),%esi
test   %esi,%esi
js     1327 <main+0x1f7>
lea    0xcf8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1333 <main+0x203>
lea    0xcec(%rip),%rdi
call   1030 <puts@plt>
mov    0xc(%rsp),%esi
test   %esi,%esi
js     134b <main+0x21b>
lea    0xcd4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1357 <main+0x227>
lea    0xcc8(%rip),%rdi
call   1030 <puts@plt>
mov    0x8(%rsp),%esi
test   %esi,%esi
js     136f <main+0x23f>
lea    0xcb0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    137b <main+0x24b>
lea    0xca4(%rip),%rdi
call   1030 <puts@plt>
mov    0x4(%rsp),%esi
test   %esi,%esi
js     1393 <main+0x263>
lea    0xc8c(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    139f <main+0x26f>
lea    0xc80(%rip),%rdi
call   1030 <puts@plt>
mov    (%rsp),%esi
test   %esi,%esi
js     13b6 <main+0x286>
lea    0xc69(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    13c2 <main+0x292>
lea    0xc5d(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"Digite o %d numero\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [4 x i8] c"%d\0A\00"
@str = [9 x i8] c"NEGATIVO\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 2)
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 1
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 3)
%10 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 2
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %10)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 4)
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 3
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %13)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 5)
%16 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 4
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %16)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 6)
%19 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 5
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %19)
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 7)
%22 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 6
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %22)
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 8)
%25 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 7
%26 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %25)
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 9)
%28 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 8
%29 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %28)
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 10)
%31 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
%32 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %31)
%33 = load i32, i32* %31
%34 = icmp slt i32 %33, 0
br i1 %34, label %35, label %37
35: ; preds = %0
%36 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
br label %39
37: ; preds = %0
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %33)
br label %39
39: ; preds = %35, %37
%40 = load i32, i32* %28
%41 = icmp slt i32 %40, 0
br i1 %41, label %44, label %42
42: ; preds = %39
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %40)
br label %46
44: ; preds = %39
%45 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
br label %46
46: ; preds = %44, %42
%47 = load i32, i32* %25
%48 = icmp slt i32 %47, 0
br i1 %48, label %51, label %49
49: ; preds = %46
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %47)
br label %53
51: ; preds = %46
%52 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
br label %53
53: ; preds = %51, %49
%54 = load i32, i32* %22
%55 = icmp slt i32 %54, 0
br i1 %55, label %58, label %56
56: ; preds = %53
%57 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %54)
br label %60
58: ; preds = %53
%59 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
br label %60
60: ; preds = %58, %56
%61 = load i32, i32* %19
%62 = icmp slt i32 %61, 0
br i1 %62, label %65, label %63
63: ; preds = %60
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %61)
br label %67
65: ; preds = %60
%66 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
br label %67
67: ; preds = %65, %63
%68 = load i32, i32* %16
%69 = icmp slt i32 %68, 0
br i1 %69, label %72, label %70
70: ; preds = %67
%71 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %68)
br label %74
72: ; preds = %67
%73 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
br label %74
74: ; preds = %72, %70
%75 = load i32, i32* %13
%76 = icmp slt i32 %75, 0
br i1 %76, label %79, label %77
77: ; preds = %74
%78 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %75)
br label %81
79: ; preds = %74
%80 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
br label %81
81: ; preds = %79, %77
%82 = load i32, i32* %10
%83 = icmp slt i32 %82, 0
br i1 %83, label %86, label %84
84: ; preds = %81
%85 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %82)
br label %88
86: ; preds = %81
%87 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
br label %88
88: ; preds = %86, %84
%89 = load i32, i32* %7
%90 = icmp slt i32 %89, 0
br i1 %90, label %93, label %91
91: ; preds = %88
%92 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %89)
br label %95
93: ; preds = %88
%94 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
br label %95
95: ; preds = %93, %91
%96 = load i32, i32* %4
%97 = icmp slt i32 %96, 0
br i1 %97, label %100, label %98
98: ; preds = %95
%99 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %96)
br label %102
100: ; preds = %95
%101 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
br label %102
102: ; preds = %100, %98
ret i32 0
}