#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 vetorA[10], vetorB[10], result[10];
  for (int i = 0; i < 10; i++) {
    printf("Informe a posicao %d do vetor A: ", i + 1);
    scanf("%d", &vetorA[i]);
    printf("Informe a posicao %d do vetor B: ", i + 1);
    scanf("%d", &vetorB[i]);
    result[i] = vetorA[i] * vetorB[i];
    printf("\n");
  }
  for (int i = 0; i < 10; i++) {
    printf("Vetor resultante: %d\n", result[i]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x94(%rbp)
cmpl   $0xa,-0x94(%rbp)
jge    11f3 <main+0xd3>
mov    -0x94(%rbp),%esi
add    $0x1,%esi
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x94(%rbp),%rax
lea    -0x30(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xeb0(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x94(%rbp),%esi
add    $0x1,%esi
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x94(%rbp),%rax
lea    -0x60(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe7b(%rip),%rdi
call   1040 <scanf@plt>
movslq -0x94(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%ecx
movslq -0x94(%rbp),%rax
imul   -0x60(%rbp,%rax,4),%ecx
movslq -0x94(%rbp),%rax
mov    %ecx,-0x90(%rbp,%rax,4)
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    1135 <main+0x15>
movl   $0x0,-0x98(%rbp)
cmpl   $0xa,-0x98(%rbp)
jge    123a <main+0x11a>
movslq -0x98(%rbp),%rax
mov    -0x90(%rbp,%rax,4),%esi
lea    0xe28(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
jmp    11fd <main+0xdd>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x90,%rsp
mov    $0x1,%ebp
lea    0xeb5(%rip),%r14
lea    0xed0(%rip),%r15
lea    0xecc(%rip),%r12
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    (%rsp,%rbx,1),%rsi
add    $0x60,%rsi
mov    %r15,%rdi
call   1050 <scanf@plt>
mov    %r12,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    (%rsp,%rbx,1),%rsi
add    $0x30,%rsi
mov    %r15,%rdi
call   1050 <scanf@plt>
mov    0x30(%rsp,%rbx,1),%eax
imul   0x60(%rsp,%rbx,1),%eax
mov    %eax,(%rsp,%rbx,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x4,%rbx
add    $0x1,%ebp
cmp    $0x28,%rbx
jne    1160 <main+0x30>
mov    (%rsp),%esi
lea    0xe82(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1c(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x20(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x24(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x90,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

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