#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*/ LC_ALL;
int /*<<< orphan*/ getch();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
main() {
  setlocale(LC_ALL, "Portuguese");
  int vetorA[100] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
  int vetorB[100] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
  int x = 0;
  int a;
  int b = 0;
  int prod;
  for (a = 0; a < 10; a++) {
    prod = (vetorA[a] * vetorB[b]) + prod;
    b++;
  }
  printf("O produto escalar vetor[a] por vetor [b] é %d \n", prod);
  getch();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x340,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rsi
call   1050 <setlocale@plt>
lea    -0x1a0(%rbp),%rdi
lea    0xecb(%rip),%rsi
mov    $0x190,%edx
call   1040 <memcpy@plt>
lea    -0x330(%rbp),%rdi
lea    0x1043(%rip),%rsi
mov    $0x190,%edx
call   1040 <memcpy@plt>
movl   $0x0,-0x334(%rbp)
movl   $0x0,-0x33c(%rbp)
movl   $0x0,-0x338(%rbp)
cmpl   $0xa,-0x338(%rbp)
jge    120e <main+0xce>
movslq -0x338(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%eax
movslq -0x33c(%rbp),%rcx
imul   -0x330(%rbp,%rcx,4),%eax
ff
add    -0x340(%rbp),%eax
mov    %eax,-0x340(%rbp)
mov    -0x33c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x33c(%rbp)
mov    -0x338(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x338(%rbp)
jmp    11b5 <main+0x75>
mov    -0x340(%rbp),%esi
lea    0xdf0(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1060 <getch@plt>
mov    -0x4(%rbp),%eax
add    $0x340,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    0xebf(%rip),%rsi
call   1040 <setlocale@plt>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <getch@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [11 x i8] c"Portuguese\00"
@__const.main.vetorA = <{ [10 x i32], [90 x i32] }> <{ [10 x i32] [i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1], [90 x i32] zeroinitializer }>
@__const.main.vetorB = <{ [10 x i32], [90 x i32] }> <{ [10 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10], [90 x i32] zeroinitializer }>
@.str.1 = [49 x i8] c"O produto escalar vetor[a] por vetor [b] \C3\A9 %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i32]
%3 = alloca [100 x i32]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = load i32, i32* @LC_ALL
%9 = call i32 @setlocale(i32 %8, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%10 = bitcast [100 x i32]* %2 to i8*
%11 = bitcast [100 x i32]* %3 to i8*
store i32 0, i32* %4
store i32 0, i32* %6
store i32 0, i32* %5
br label %12
12: ; preds = %29, %0
%13 = load i32, i32* %5
%14 = icmp slt i32 %13, 10
br i1 %14, label %15, label %32
15: ; preds = %12
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %17
%19 = load i32, i32* %18
%20 = load i32, i32* %6
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %21
%23 = load i32, i32* %22
%24 = mul nsw i32 %19, %23
%25 = load i32, i32* %7
%26 = add nsw i32 %24, %25
store i32 %26, i32* %7
%27 = load i32, i32* %6
%28 = add nsw i32 %27, 1
store i32 %28, i32* %6
br label %29
29: ; preds = %15
%30 = load i32, i32* %5
%31 = add nsw i32 %30, 1
store i32 %31, i32* %5
br label %12
32: ; preds = %12
%33 = load i32, i32* %7
%34 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0), i32 %33)
%35 = call i32 (...) @getch()
%36 = load i32, i32* %1
ret i32 %36
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [11 x i8] c"Portuguese\00"
@.str.1 = [49 x i8] c"O produto escalar vetor[a] por vetor [b] \C3\A9 %d \0A\00"
define i32 @main() {
%1 = load i32, i32* @LC_ALL
%2 = tail call i32 @setlocale(i32 %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0), i32 undef)
%4 = tail call i32 (...) @getch()
ret i32 0
}