#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 subtracao() {
  int i = 0, j, vet[3] = {0, 0, 0};
  int vetResult[3] = {0, 0, 0};
  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", &vetResult[j]);
      }
    } else {
      printf("---vetor %d---\n", i + 1);
      for (j = 0; j < 3; j++) {
        printf("Informe o coeficiente de %c: ", letraCoeficiente(j));
        scanf("%d", &vet[j]);
        vetResult[j] -= vet[j];
      }
    }
    i++;
    if (i > 1) {
      break;
    }
    system("cls");
  }
  printf("---Vetor resultante (subtracao)---\n");
  mostrarResultado(vetResult);
}


x86 assembly (clang, -O0):
<subtracao>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x14(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1050 <memset@plt>
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1050 <memset@plt>
movl   $0x1,-0x24(%rbp)
lea    0xe63(%rip),%rdi
call   1030 <system@plt>
cmpl   $0x0,-0x24(%rbp)
je     12cb <subtracao+0x16b>
cmpl   $0x0,-0x4(%rbp)
jne    1221 <subtracao+0xc1>
mov    -0x4(%rbp),%esi
add    $0x1,%esi
lea    0xe63(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    121c <subtracao+0xbc>
mov    -0x8(%rbp),%edi
call   1060 <letraCoeficiente@plt>
mov    %eax,%esi
lea    0xe18(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movslq -0x8(%rbp),%rax
lea    -0x20(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe19(%rip),%rdi
call   1080 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11d1 <subtracao+0x71>
jmp    12a2 <subtracao+0x142>
mov    -0x4(%rbp),%esi
add    $0x1,%esi
lea    0xdf7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    129d <subtracao+0x13d>
mov    -0x8(%rbp),%edi
call   1060 <letraCoeficiente@plt>
mov    %eax,%esi
lea    0xdad(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movslq -0x8(%rbp),%rax
lea    -0x14(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xdae(%rip),%rdi
call   1080 <scanf@plt>
movslq -0x8(%rbp),%rax
mov    -0x14(%rbp,%rax,4),%edx
movslq -0x8(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%ecx
sub    %edx,%ecx
mov    %ecx,-0x20(%rbp,%rax,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    123c <subtracao+0xdc>
jmp    12a2 <subtracao+0x142>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    12ba <subtracao+0x15a>
jmp    12cb <subtracao+0x16b>
lea    0xd3f(%rip),%rdi
call   1030 <system@plt>
jmp    11a2 <subtracao+0x42>
lea    0xd63(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
call   1070 <mostrarResultado@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<subtracao>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
movl   $0x0,0x20(%rsp)
movq   $0x0,0x18(%rsp)
lea    0x20(%rsp),%r14
movl   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
lea    0x10(%rsp),%rbp
lea    0xe5f(%rip),%r13
mov    %r13,%rdi
call   1040 <system@plt>
lea    0xe76(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %edi,%edi
call   1060 <letraCoeficiente@plt>
lea    0xe3a(%rip),%r12
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe45(%rip),%rbx
lea    0x8(%rsp),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1080 <scanf@plt>
mov    $0x1,%edi
call   1060 <letraCoeficiente@plt>
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
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    0xde5(%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    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1080 <scanf@plt>
mov    0x18(%rsp),%eax
sub    %eax,0x8(%rsp)
mov    $0x1,%edi
call   1060 <letraCoeficiente@plt>
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
call   1080 <scanf@plt>
mov    0x1c(%rsp),%eax
sub    %eax,0xc(%rsp)
mov    $0x2,%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    0x20(%rsp),%eax
sub    %eax,0x10(%rsp)
lea    0xd66(%rip),%rdi
call   1030 <puts@plt>
mov    %r15,%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 = [36 x i8] c"---Vetor resultante (subtracao)---\0A\00"
define void @subtracao() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [3 x i32]
%4 = alloca [3 x i32]
%5 = alloca i32
store i32 0, i32* %1
%6 = bitcast [3 x i32]* %3 to i8*
%7 = bitcast [3 x i32]* %4 to i8*
store i32 1, i32* %5
%8 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %68, %0
%10 = load i32, i32* %5
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %70
12: ; preds = %9
%13 = load i32, i32* %1
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %34
15: ; preds = %12
%16 = load i32, i32* %1
%17 = add nsw i32 %16, 1
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %17)
store i32 0, i32* %2
br label %19
19: ; preds = %30, %15
%20 = load i32, i32* %2
%21 = icmp slt i32 %20, 3
br i1 %21, label %22, label %33
22: ; preds = %19
%23 = load i32, i32* %2
%24 = call i32 @letraCoeficiente(i32 %23)
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %24)
%26 = load i32, i32* %2
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 %27
%29 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %28)
br label %30
30: ; preds = %22
%31 = load i32, i32* %2
%32 = add nsw i32 %31, 1
store i32 %32, i32* %2
br label %19
33: ; preds = %19
br label %62
34: ; preds = %12
%35 = load i32, i32* %1
%36 = add nsw i32 %35, 1
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32 %36)
store i32 0, i32* %2
br label %38
38: ; preds = %58, %34
%39 = load i32, i32* %2
%40 = icmp slt i32 %39, 3
br i1 %40, label %41, label %61
41: ; preds = %38
%42 = load i32, i32* %2
%43 = call i32 @letraCoeficiente(i32 %42)
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %43)
%45 = load i32, i32* %2
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 %46
%48 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %47)
%49 = load i32, i32* %2
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 %50
%52 = load i32, i32* %51
%53 = load i32, i32* %2
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 %54
%56 = load i32, i32* %55
%57 = sub nsw i32 %56, %52
store i32 %57, i32* %55
br label %58
58: ; preds = %41
%59 = load i32, i32* %2
%60 = add nsw i32 %59, 1
store i32 %60, i32* %2
br label %38
61: ; preds = %38
br label %62
62: ; preds = %61, %33
%63 = load i32, i32* %1
%64 = add nsw i32 %63, 1
store i32 %64, i32* %1
%65 = load i32, i32* %1
%66 = icmp sgt i32 %65, 1
br i1 %66, label %67, label %68
67: ; preds = %62
br label %70
68: ; preds = %62
%69 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %9
70: ; preds = %67, %9
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0))
%72 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
%73 = call i32 @mostrarResultado(i32* %72)
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 = [35 x i8] c"---Vetor resultante (subtracao)---\00"
define void @subtracao() {
%1 = alloca [3 x i32]
%2 = alloca [3 x i32]
%3 = bitcast [3 x i32]* %1 to i8*
%4 = bitcast [3 x i32]* %2 to i8*
%5 = tail call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 1)
%7 = call i32 @letraCoeficiente(i32 0)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %7)
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %9)
%11 = call i32 @letraCoeficiente(i32 1)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %11)
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 1
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %13)
%15 = call i32 @letraCoeficiente(i32 2)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %15)
%17 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %17)
%19 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32 2)
%21 = call i32 @letraCoeficiente(i32 0)
%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 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %23)
%25 = load i32, i32* %23
%26 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%27 = load i32, i32* %26
%28 = sub nsw i32 %27, %25
store i32 %28, i32* %26
%29 = call i32 @letraCoeficiente(i32 1)
%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 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 1
%32 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %31)
%33 = load i32, i32* %31
%34 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 1
%35 = load i32, i32* %34
%36 = sub nsw i32 %35, %33
store i32 %36, i32* %34
%37 = call i32 @letraCoeficiente(i32 2)
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %37)
%39 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 2
%40 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %39)
%41 = load i32, i32* %39
%42 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
%43 = load i32, i32* %42
%44 = sub nsw i32 %43, %41
store i32 %44, i32* %42
%45 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%46 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%47 = call i32 @mostrarResultado(i32* %46)
ret void
}