#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*/ printArray(float *, int);
int /*<<< orphan*/ printSub(float *, float *, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, float *);
int /*<<< orphan*/ system(char *);
void ex2() {
  float a[10], b[10], dif[10];
  for (int k = 0; k < 10; k++) {
    printf("Digite um numero(VETOR A): ");
    scanf("%f", &a[k]);
    printf("Digite um numero(VETOR B): ");
    scanf("%f", &b[k]);
    dif[k] = a[k] - b[k];
  }
  system("clear");
  printSub(a, b, 10);
  printArray(dif, 10);
}


x86 assembly (clang, -O0):
<ex2>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x94(%rbp)
cmpl   $0xa,-0x94(%rbp)
jge    1204 <ex2+0xb4>
lea    0xe87(%rip),%rdi
call   1040 <printf@plt>
movslq -0x94(%rbp),%rax
lea    -0x30(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe85(%rip),%rdi
call   1050 <scanf@plt>
lea    0xe7c(%rip),%rdi
call   1040 <printf@plt>
movslq -0x94(%rbp),%rax
lea    -0x60(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe5b(%rip),%rdi
call   1050 <scanf@plt>
movslq -0x94(%rbp),%rax
movss  -0x30(%rbp,%rax,4),%xmm0
movslq -0x94(%rbp),%rax
subss  -0x60(%rbp,%rax,4),%xmm0
movslq -0x94(%rbp),%rax
movss  %xmm0,-0x90(%rbp,%rax,4)
ff ff
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    1165 <ex2+0x15>
lea    0xe30(%rip),%rdi
call   1030 <system@plt>
lea    -0x30(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    $0xa,%edx
call   1070 <printSub@plt>
lea    -0x90(%rbp),%rdi
mov    $0xa,%esi
call   1060 <printArray@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ex2>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x88,%rsp
xor    %ebx,%ebx
lea    0xe99(%rip),%r14
lea    0xeae(%rip),%r12
lea    0xeaa(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
call   1040 <printf@plt>
lea    (%rsp,%rbx,1),%rsi
add    $0x30,%rsi
mov    %r12,%rdi
call   1050 <scanf@plt>
mov    %r15,%rdi
call   1040 <printf@plt>
lea    (%rsp,%rbx,1),%rsi
mov    %r12,%rdi
call   1050 <scanf@plt>
movss  0x30(%rsp,%rbx,1),%xmm0
subss  (%rsp,%rbx,1),%xmm0
movss  %xmm0,0x60(%rsp,%rbx,1)
add    $0x4,%rbx
cmp    $0x28,%rbx
jne    1180 <ex2+0x30>
lea    0xe6d(%rip),%rdi
call   1030 <system@plt>
lea    0x30(%rsp),%rdi
mov    %rsp,%rsi
mov    $0xa,%edx
call   1070 <printSub@plt>
lea    0x60(%rsp),%rdi
mov    $0xa,%esi
call   1060 <printArray@plt>
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Digite um numero(VETOR A): \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [28 x i8] c"Digite um numero(VETOR B): \00"
@.str.3 = [6 x i8] c"clear\00"
define void @ex2() {
%1 = alloca [10 x float]
%2 = alloca [10 x float]
%3 = alloca [10 x float]
%4 = alloca i32
store i32 0, i32* %4
br label %5
5: ; preds = %31, %0
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %34
8: ; preds = %5
%9 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 %11
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [10 x float], [10 x float]* %2, i64 0, i64 %16
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %17)
%19 = load i32, i32* %4
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 %20
%22 = load float, float* %21
%23 = load i32, i32* %4
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [10 x float], [10 x float]* %2, i64 0, i64 %24
%26 = load float, float* %25
%27 = fsub float %22, %26
%28 = load i32, i32* %4
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [10 x float], [10 x float]* %3, i64 0, i64 %29
store float %27, float* %30
br label %31
31: ; preds = %8
%32 = load i32, i32* %4
%33 = add nsw i32 %32, 1
store i32 %33, i32* %4
br label %5
34: ; preds = %5
%35 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%36 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 0
%37 = getelementptr inbounds [10 x float], [10 x float]* %2, i64 0, i64 0
%38 = call i32 @printSub(float* %36, float* %37, i32 10)
%39 = getelementptr inbounds [10 x float], [10 x float]* %3, i64 0, i64 0
%40 = call i32 @printArray(float* %39, i32 10)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"Digite um numero(VETOR A): \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [28 x i8] c"Digite um numero(VETOR B): \00"
@.str.3 = [6 x i8] c"clear\00"
define void @ex2() {
%1 = alloca [10 x float]
%2 = alloca [10 x float]
%3 = alloca [10 x float]
%4 = bitcast [10 x float]* %1 to i8*
%5 = bitcast [10 x float]* %2 to i8*
%6 = bitcast [10 x float]* %3 to i8*
br label %14
7: ; preds = %14
%8 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%9 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 0
%10 = getelementptr inbounds [10 x float], [10 x float]* %2, i64 0, i64 0
%11 = call i32 @printSub(float* %9, float* %10, i32 10)
%12 = getelementptr inbounds [10 x float], [10 x float]* %3, i64 0, i64 0
%13 = call i32 @printArray(float* %12, i32 10)
ret void
14: ; preds = %0, %14
%15 = phi i64 [ 0, %0 ], [ %26, %14 ]
%16 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%17 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 %15
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %17)
%19 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%20 = getelementptr inbounds [10 x float], [10 x float]* %2, i64 0, i64 %15
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %20)
%22 = load float, float* %17
%23 = load float, float* %20
%24 = fsub float %22, %23
%25 = getelementptr inbounds [10 x float], [10 x float]* %3, i64 0, i64 %15
store float %24, float* %25
%26 = add nuw nsw i64 %15, 1
%27 = icmp eq i64 %26, 10
br i1 %27, label %7, label %14
}