#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 letraCoeficiente(int);
int /*<<< orphan*/ mostrarResultado(int *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ system(char *);
void prodVetorial() {
  int i = 0, j, u[3];
  int v[3];
  int vetResult[3];
  int op = 1;
  system("cls");
  while (op) {
    if (i == 0) {
      printf("--vetor %d---\n", i + 1);
      for (j = 0; j < 3; j++) {
        printf("Informe o coeficiente de %c: ", letraCoeficiente(j));
        scanf("%d", &v[j]);
      }
    } else {
      printf("---vetor %d---\n", i + 1);
      for (j = 0; j < 3; j++) {
        printf("Informe o coeficiente de %c: ", letraCoeficiente(j));
        scanf("%d", &u[j]);
      }
      vetResult[0] = ((v[1] * u[2]) - (v[2] * u[1]));
      vetResult[1] = (((v[0] * u[2]) - (v[2] * u[0]))) * (-1);
      vetResult[2] = ((v[0] * u[1]) - (v[1] * u[0]));
    }
    i++;
    if (i > 1) {
      break;
    }
    system("cls");
  }
  printf("---Produto Vetorial---\n");
  mostrarResultado(vetResult);
}


x86 assembly (clang, -O0):
<prodVetorial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x30(%rbp)
lea    0xe93(%rip),%rdi
call   1030 <system@plt>
cmpl   $0x0,-0x30(%rbp)
je     12bc <prodVetorial+0x16c>
cmpl   $0x0,-0x4(%rbp)
jne    11f1 <prodVetorial+0xa1>
mov    -0x4(%rbp),%esi
add    $0x1,%esi
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    11ec <prodVetorial+0x9c>
mov    -0x8(%rbp),%edi
call   1050 <letraCoeficiente@plt>
mov    %eax,%esi
lea    0xe48(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movslq -0x8(%rbp),%rax
lea    -0x20(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe49(%rip),%rdi
call   1070 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11a1 <prodVetorial+0x51>
jmp    1293 <prodVetorial+0x143>
mov    -0x4(%rbp),%esi
add    $0x1,%esi
lea    0xe27(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1257 <prodVetorial+0x107>
mov    -0x8(%rbp),%edi
call   1050 <letraCoeficiente@plt>
mov    %eax,%esi
lea    0xddd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movslq -0x8(%rbp),%rax
lea    -0x14(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xdde(%rip),%rdi
call   1070 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    120c <prodVetorial+0xbc>
mov    -0x1c(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    -0x18(%rbp),%ecx
imul   -0x10(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x20(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    -0x18(%rbp),%ecx
imul   -0x14(%rbp),%ecx
sub    %ecx,%eax
imul   $0xffffffff,%eax,%eax
mov    %eax,-0x28(%rbp)
mov    -0x20(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    -0x1c(%rbp),%ecx
imul   -0x14(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    12ab <prodVetorial+0x15b>
jmp    12bc <prodVetorial+0x16c>
lea    0xd4e(%rip),%rdi
call   1030 <system@plt>
jmp    1172 <prodVetorial+0x22>
lea    0xd72(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x2c(%rbp),%rdi
call   1060 <mostrarResultado@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prodVetorial>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0xe8b(%rip),%r13
mov    %r13,%rdi
call   1040 <system@plt>
lea    0x8(%rsp),%r14
lea    0xc(%rsp),%rbp
lea    0x14(%rsp),%r15
lea    0xe93(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %edi,%edi
call   1060 <letraCoeficiente@plt>
lea    0xe57(%rip),%r12
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe62(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1080 <scanf@plt>
mov    $0x1,%edi
call   1060 <letraCoeficiente@plt>
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1080 <scanf@plt>
mov    $0x2,%edi
call   1060 <letraCoeficiente@plt>
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1080 <scanf@plt>
mov    %r13,%rdi
call   1040 <system@plt>
lea    0xe07(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %edi,%edi
call   1060 <letraCoeficiente@plt>
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1080 <scanf@plt>
mov    $0x1,%edi
call   1060 <letraCoeficiente@plt>
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1080 <scanf@plt>
mov    $0x2,%edi
call   1060 <letraCoeficiente@plt>
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
lea    0x18(%rsp),%rsi
call   1080 <scanf@plt>
mov    0x4(%rsp),%eax
mov    0x8(%rsp),%ecx
mov    0x18(%rsp),%edx
mov    %edx,%esi
imul   %ecx,%esi
mov    0xc(%rsp),%edi
mov    0x10(%rsp),%ebp
mov    0x14(%rsp),%ebx
imul   %eax,%edx
imul   %ebx,%eax
imul   %edi,%ebx
sub    %ebx,%esi
mov    %esi,0x1c(%rsp)
imul   %ebp,%edi
sub    %edx,%edi
mov    %edi,0x20(%rsp)
imul   %ecx,%ebp
sub    %ebp,%eax
mov    %eax,0x24(%rsp)
lea    0xd62(%rip),%rdi
call   1030 <puts@plt>
lea    0x1c(%rsp),%rdi
call   1070 <mostrarResultado@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"cls\00"
@.str.1 = [15 x i8] c"--vetor %d---\0A\00"
@.str.2 = [30 x i8] c"Informe o coeficiente de %c: \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [16 x i8] c"---vetor %d---\0A\00"
@str = [23 x i8] c"---Produto Vetorial---\00"
define void @prodVetorial() {
%1 = alloca [3 x i32]
%2 = alloca [3 x i32]
%3 = alloca [3 x i32]
%4 = bitcast [3 x i32]* %1 to i8*
%5 = bitcast [3 x i32]* %2 to i8*
%6 = bitcast [3 x i32]* %3 to i8*
%7 = tail call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 1
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 2
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
%11 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 1
%12 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%14 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%15 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 1
%16 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 2
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 1)
%18 = call i32 @letraCoeficiente(i32 0)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %18)
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %13)
%21 = call i32 @letraCoeficiente(i32 1)
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %21)
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %8)
%24 = call i32 @letraCoeficiente(i32 2)
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %24)
%26 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %10)
%27 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32 2)
%29 = call i32 @letraCoeficiente(i32 0)
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %29)
%31 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %14)
%32 = call i32 @letraCoeficiente(i32 1)
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %32)
%34 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %11)
%35 = call i32 @letraCoeficiente(i32 2)
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %35)
%37 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %9)
%38 = load i32, i32* %8
%39 = load i32, i32* %9
%40 = mul nsw i32 %39, %38
%41 = load i32, i32* %10
%42 = load i32, i32* %11
%43 = mul nsw i32 %42, %41
%44 = sub nsw i32 %40, %43
store i32 %44, i32* %12
%45 = load i32, i32* %13
%46 = mul nsw i32 %45, %39
%47 = load i32, i32* %14
%48 = mul nsw i32 %47, %41
%49 = sub i32 %48, %46
store i32 %49, i32* %15
%50 = mul nsw i32 %45, %42
%51 = mul nsw i32 %47, %38
%52 = sub nsw i32 %50, %51
store i32 %52, i32* %16
%53 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%54 = call i32 @mostrarResultado(i32* %12)
ret void
}