#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 *, double *);
int main() {
  double u[3];
  double v[3];
  printf("Geben Sie den Vektor u ein \n");
  int j;
  for (j = 0; j < 3; ++j) {
    scanf("%lf", &u[j]);
  }
  printf("Geben Sie den Vektor v ein \n");
  for (j = 0; j < 3; ++j) {
    scanf("%lf", &v[j]);
  }
  double o1, o2, o3;
  o1 = u[1] * v[2] - u[2] * v[1];
  o2 = u[2] * v[0] - u[0] * v[2];
  o3 = u[0] * v[1] - u[1] * v[0];
  double output[3] = {o1, o2, o3};
  for (j = 0; j < 3; ++j) {
    printf("%f\n", output[j]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x44(%rbp)
cmpl   $0x3,-0x44(%rbp)
jge    117a <main+0x5a>
movslq -0x44(%rbp),%rax
lea    -0x20(%rbp),%rsi
shl    $0x3,%rax
add    %rax,%rsi
lea    0xeb6(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1147 <main+0x27>
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x44(%rbp)
cmpl   $0x3,-0x44(%rbp)
jge    11c2 <main+0xa2>
movslq -0x44(%rbp),%rax
lea    -0x40(%rbp),%rsi
shl    $0x3,%rax
add    %rax,%rsi
lea    0xe6e(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    118f <main+0x6f>
movsd  -0x18(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x38(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  -0x40(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movl   $0x0,-0x44(%rbp)
cmpl   $0x3,-0x44(%rbp)
jge    12bf <main+0x19f>
movslq -0x44(%rbp),%rax
movsd  -0x80(%rbp,%rax,8),%xmm0
lea    0xd94(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    128f <main+0x16f>
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb8(%rip),%rbx
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x28(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x30(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xeae(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movsd  0x20(%rsp),%xmm5
movsd  0x28(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
movsd  0x30(%rsp),%xmm6
movsd  (%rsp),%xmm3
movsd  0x8(%rsp),%xmm4
movapd %xmm1,%xmm0
mulsd  %xmm2,%xmm0
mulsd  %xmm5,%xmm2
mulsd  %xmm4,%xmm5
mulsd  %xmm6,%xmm4
subsd  %xmm4,%xmm0
mulsd  %xmm3,%xmm6
subsd  %xmm2,%xmm6
movsd  %xmm6,0x40(%rsp)
mulsd  %xmm1,%xmm3
subsd  %xmm3,%xmm5
movsd  %xmm5,0x48(%rsp)
lea    0xe06(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    %rbx,%rdi
movsd  0x40(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
mov    %rbx,%rdi
movsd  0x48(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Geben Sie den Vektor u ein \0A\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [29 x i8] c"Geben Sie den Vektor v ein \0A\00"
@.str.3 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x double]
%3 = alloca [3 x double]
%4 = alloca i32
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca [3 x double]
store i32 0, i32* %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %4
br label %10
10: ; preds = %18, %0
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 3
br i1 %12, label %13, label %21
13: ; preds = %10
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 %15
%17 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %16)
br label %18
18: ; preds = %13
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 1
store i32 %20, i32* %4
br label %10
21: ; preds = %10
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %4
br label %23
23: ; preds = %31, %21
%24 = load i32, i32* %4
%25 = icmp slt i32 %24, 3
br i1 %25, label %26, label %34
26: ; preds = %23
%27 = load i32, i32* %4
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 %28
%30 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %29)
br label %31
31: ; preds = %26
%32 = load i32, i32* %4
%33 = add nsw i32 %32, 1
store i32 %33, i32* %4
br label %23
34: ; preds = %23
%35 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 1
%36 = load double, double* %35
%37 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 2
%38 = load double, double* %37
%39 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 2
%40 = load double, double* %39
%41 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 1
%42 = load double, double* %41
%43 = fmul double %40, %42
%44 = fneg double %43
%45 = call double @llvm.fmuladd.f64(double %36, double %38, double %44)
store double %45, double* %5
%46 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 2
%47 = load double, double* %46
%48 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
%49 = load double, double* %48
%50 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 0
%51 = load double, double* %50
%52 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 2
%53 = load double, double* %52
%54 = fmul double %51, %53
%55 = fneg double %54
%56 = call double @llvm.fmuladd.f64(double %47, double %49, double %55)
store double %56, double* %6
%57 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 0
%58 = load double, double* %57
%59 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 1
%60 = load double, double* %59
%61 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 1
%62 = load double, double* %61
%63 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
%64 = load double, double* %63
%65 = fmul double %62, %64
%66 = fneg double %65
%67 = call double @llvm.fmuladd.f64(double %58, double %60, double %66)
store double %67, double* %7
%68 = getelementptr inbounds [3 x double], [3 x double]* %8, i64 0, i64 0
%69 = load double, double* %5
store double %69, double* %68
%70 = getelementptr inbounds double, double* %68, i64 1
%71 = load double, double* %6
store double %71, double* %70
%72 = getelementptr inbounds double, double* %70, i64 1
%73 = load double, double* %7
store double %73, double* %72
store i32 0, i32* %4
br label %74
74: ; preds = %83, %34
%75 = load i32, i32* %4
%76 = icmp slt i32 %75, 3
br i1 %76, label %77, label %86
77: ; preds = %74
%78 = load i32, i32* %4
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds [3 x double], [3 x double]* %8, i64 0, i64 %79
%81 = load double, double* %80
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double %81)
br label %83
83: ; preds = %77
%84 = load i32, i32* %4
%85 = add nsw i32 %84, 1
store i32 %85, i32* %4
br label %74
86: ; preds = %74
%87 = load i32, i32* %1
ret i32 %87
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%lf\00"
@.str.3 = [4 x i8] c"%f\0A\00"
@str = [28 x i8] c"Geben Sie den Vektor u ein \00"
@str.4 = [28 x i8] c"Geben Sie den Vektor v ein \00"
define i32 @main() {
%1 = alloca [3 x double]
%2 = alloca [3 x double]
%3 = bitcast [3 x double]* %1 to i8*
%4 = bitcast [3 x double]* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%6 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %6)
%8 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 1
%9 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %8)
%10 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 2
%11 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %10)
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.4, i64 0, i64 0))
%13 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 0
%14 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %13)
%15 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 1
%16 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %15)
%17 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 2
%18 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %17)
%19 = load double, double* %8
%20 = load double, double* %17
%21 = load double, double* %10
%22 = load double, double* %15
%23 = fneg double %21
%24 = fmul double %22, %23
%25 = call double @llvm.fmuladd.f64(double %19, double %20, double %24)
%26 = load double, double* %13
%27 = load double, double* %6
%28 = fneg double %27
%29 = fmul double %20, %28
%30 = call double @llvm.fmuladd.f64(double %21, double %26, double %29)
%31 = fneg double %19
%32 = fmul double %26, %31
%33 = call double @llvm.fmuladd.f64(double %27, double %22, double %32)
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double %25)
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double %30)
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double %33)
ret i32 0
}