#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 *);
void main() {
  int A[10], B[10];
  for (int i = 0; i < 10; i++) {
    printf("Informe o valor da posicao %d: ", i + 1);
    scanf("%d", &A[i]);
    if (A[i] > 0) {
      B[i] = A[i];
    } else {
      B[i] = 0;
    }
  }
  printf("Vetor A\t\tVetor B\n");
  for (int i = 0; i < 10; i++) {
    printf("%d\t\t%d\n", A[i], B[i]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x64(%rbp)
cmpl   $0xa,-0x64(%rbp)
jge    11ab <main+0x8b>
mov    -0x64(%rbp),%esi
add    $0x1,%esi
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x64(%rbp),%rax
lea    -0x30(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xebd(%rip),%rdi
call   1040 <scanf@plt>
movslq -0x64(%rbp),%rax
cmpl   $0x0,-0x30(%rbp,%rax,4)
jle    118c <main+0x6c>
movslq -0x64(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%ecx
movslq -0x64(%rbp),%rax
mov    %ecx,-0x60(%rbp,%rax,4)
jmp    1198 <main+0x78>
movslq -0x64(%rbp),%rax
movl   $0x0,-0x60(%rbp,%rax,4)
jmp    119d <main+0x7d>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    112f <main+0xf>
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x68(%rbp)
cmpl   $0xa,-0x68(%rbp)
jge    11f6 <main+0xd6>
movslq -0x68(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
movslq -0x68(%rbp),%rax
mov    -0x60(%rbp,%rax,4),%edx
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    11c0 <main+0xa0>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x60,%rsp
lea    0xec1(%rip),%r14
xor    %ebp,%ebp
mov    %r14,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec9(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    (%rsp),%eax
test   %eax,%eax
cmovs  %ebp,%eax
mov    %eax,0x30(%rsp)
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    0x4(%rsp),%eax
test   %eax,%eax
cmovs  %ebp,%eax
mov    %eax,0x34(%rsp)
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    0x8(%rsp),%eax
test   %eax,%eax
cmovs  %ebp,%eax
mov    %eax,0x38(%rsp)
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    0xc(%rsp),%eax
test   %eax,%eax
cmovs  %ebp,%eax
mov    %eax,0x3c(%rsp)
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    0x10(%rsp),%eax
test   %eax,%eax
cmovs  %ebp,%eax
mov    %eax,0x40(%rsp)
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    0x14(%rsp),%eax
test   %eax,%eax
cmovs  %ebp,%eax
mov    %eax,0x44(%rsp)
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    0x18(%rsp),%eax
test   %eax,%eax
cmovs  %ebp,%eax
mov    %eax,0x48(%rsp)
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    0x1c(%rsp),%eax
test   %eax,%eax
cmovs  %ebp,%eax
mov    %eax,0x4c(%rsp)
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    0x20(%rsp),%eax
test   %eax,%eax
cmovs  %ebp,%eax
mov    %eax,0x50(%rsp)
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),%eax
test   %eax,%eax
mov    $0x0,%ecx
cmovns %eax,%ecx
mov    %ecx,0x54(%rsp)
lea    0xd40(%rip),%rdi
call   1030 <puts@plt>
mov    (%rsp),%esi
mov    0x30(%rsp),%edx
lea    0xd25(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%esi
mov    0x34(%rsp),%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%esi
mov    0x38(%rsp),%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%esi
mov    0x3c(%rsp),%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rsp),%esi
mov    0x40(%rsp),%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rsp),%esi
mov    0x44(%rsp),%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%rsp),%esi
mov    0x48(%rsp),%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1c(%rsp),%esi
mov    0x4c(%rsp),%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x20(%rsp),%esi
mov    0x50(%rsp),%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x24(%rsp),%esi
mov    0x54(%rsp),%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x60,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [32 x i8] c"Informe o valor da posicao %d: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [8 x i8] c"%d\09\09%d\0A\00"
@str = [17 x i8] c"Vetor A\09\09Vetor B\00"
define void @main() {
%1 = alloca [10 x i32]
%2 = alloca [10 x i32]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [10 x i32]* %2 to i8*
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 1)
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%8 = load i32, i32* %6
%9 = icmp sgt i32 %8, 0
%10 = select i1 %9, i32 %8, i32 0
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
store i32 %10, i32* %11
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 2)
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 1
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %13)
%15 = load i32, i32* %13
%16 = icmp sgt i32 %15, 0
%17 = select i1 %16, i32 %15, i32 0
%18 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 1
store i32 %17, i32* %18
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 3)
%20 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 2
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %20)
%22 = load i32, i32* %20
%23 = icmp sgt i32 %22, 0
%24 = select i1 %23, i32 %22, i32 0
%25 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 2
store i32 %24, i32* %25
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 4)
%27 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 3
%28 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %27)
%29 = load i32, i32* %27
%30 = icmp sgt i32 %29, 0
%31 = select i1 %30, i32 %29, i32 0
%32 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 3
store i32 %31, i32* %32
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 5)
%34 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 4
%35 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %34)
%36 = load i32, i32* %34
%37 = icmp sgt i32 %36, 0
%38 = select i1 %37, i32 %36, i32 0
%39 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 4
store i32 %38, i32* %39
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 6)
%41 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 5
%42 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %41)
%43 = load i32, i32* %41
%44 = icmp sgt i32 %43, 0
%45 = select i1 %44, i32 %43, i32 0
%46 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 5
store i32 %45, i32* %46
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 7)
%48 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 6
%49 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %48)
%50 = load i32, i32* %48
%51 = icmp sgt i32 %50, 0
%52 = select i1 %51, i32 %50, i32 0
%53 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 6
store i32 %52, i32* %53
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 8)
%55 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 7
%56 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %55)
%57 = load i32, i32* %55
%58 = icmp sgt i32 %57, 0
%59 = select i1 %58, i32 %57, i32 0
%60 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 7
store i32 %59, i32* %60
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 9)
%62 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 8
%63 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %62)
%64 = load i32, i32* %62
%65 = icmp sgt i32 %64, 0
%66 = select i1 %65, i32 %64, i32 0
%67 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 8
store i32 %66, i32* %67
%68 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 10)
%69 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
%70 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %69)
%71 = load i32, i32* %69
%72 = icmp sgt i32 %71, 0
%73 = select i1 %72, i32 %71, i32 0
%74 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 9
store i32 %73, i32* %74
%75 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%76 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%77 = load i32, i32* %76
%78 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%79 = load i32, i32* %78
%80 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %77, i32 %79)
%81 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 1
%82 = load i32, i32* %81
%83 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 1
%84 = load i32, i32* %83
%85 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %82, i32 %84)
%86 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 2
%87 = load i32, i32* %86
%88 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 2
%89 = load i32, i32* %88
%90 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %87, i32 %89)
%91 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 3
%92 = load i32, i32* %91
%93 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 3
%94 = load i32, i32* %93
%95 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %92, i32 %94)
%96 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 4
%97 = load i32, i32* %96
%98 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 4
%99 = load i32, i32* %98
%100 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %97, i32 %99)
%101 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 5
%102 = load i32, i32* %101
%103 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 5
%104 = load i32, i32* %103
%105 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %102, i32 %104)
%106 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 6
%107 = load i32, i32* %106
%108 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 6
%109 = load i32, i32* %108
%110 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %107, i32 %109)
%111 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 7
%112 = load i32, i32* %111
%113 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 7
%114 = load i32, i32* %113
%115 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %112, i32 %114)
%116 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 8
%117 = load i32, i32* %116
%118 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 8
%119 = load i32, i32* %118
%120 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %117, i32 %119)
%121 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
%122 = load i32, i32* %121
%123 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 9
%124 = load i32, i32* %123
%125 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %122, i32 %124)
ret void
}