#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 *, int *);
int sqrt(int);
int main() {
  int a[3];
  int b[3];
  int c[3];
  int modulo;
  printf("introduzca la coordenada x de a\n");
  scanf("%d", &a[0]);
  printf("introduzca la coordenada y de a\n");
  scanf("%d", &a[1]);
  printf("introduzca la coordenada z de a\n");
  scanf("%d", &a[2]);
  printf("introduzca la coordemada x de b\n");
  scanf("%d", &b[0]);
  printf("introduzca la coordemada y de b\n");
  scanf("%d", &b[1]);
  printf("introduzca la coordemada z de b\n");
  scanf("%d", &b[2]);
  c[0] = a[0] + b[0];
  c[1] = a[1] + b[1];
  c[2] = a[2] + b[2];
  modulo = sqrt(c[0] * c[0] + c[1] * c[1] + c[2] * c[2]);
  printf("Las coordenadas de c son C=(%d, %d, %d)\n", c[0], c[1], c[2]);
  printf("El modulo de c es %d", modulo);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x10(%rbp),%rsi
lea    0xfa9(%rip),%rdi
call   1040 <scanf@plt>
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x10(%rbp),%rsi
add    $0x4,%rsi
lea    0xf87(%rip),%rdi
call   1040 <scanf@plt>
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x10(%rbp),%rsi
add    $0x8,%rsi
lea    0xf65(%rip),%rdi
call   1040 <scanf@plt>
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x1c(%rbp),%rsi
lea    0xf47(%rip),%rdi
call   1040 <scanf@plt>
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x1c(%rbp),%rsi
add    $0x4,%rsi
lea    0xf25(%rip),%rdi
call   1040 <scanf@plt>
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x1c(%rbp),%rsi
add    $0x8,%rsi
lea    0xf03(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x28(%rbp),%edi
imul   -0x28(%rbp),%edi
mov    -0x24(%rbp),%eax
imul   -0x24(%rbp),%eax
add    %eax,%edi
mov    -0x20(%rbp),%eax
imul   -0x20(%rbp),%eax
add    %eax,%edi
call   1050 <sqrt@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0x20(%rbp),%ecx
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x2c(%rbp),%esi
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xeed(%rip),%rdi
call   1030 <puts@plt>
lea    0xede(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xeed(%rip),%rdi
call   1030 <puts@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xef4(%rip),%rdi
call   1030 <puts@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xefb(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xf04(%rip),%rdi
call   1030 <puts@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xf0b(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    (%rsp),%r14d
mov    0x4(%rsp),%ebp
add    0xc(%rsp),%r14d
add    0x10(%rsp),%ebp
mov    0x8(%rsp),%ebx
add    0x14(%rsp),%ebx
mov    %r14d,%eax
imul   %r14d,%eax
mov    %ebp,%ecx
imul   %ebp,%ecx
add    %eax,%ecx
mov    %ebx,%edi
imul   %ebx,%edi
add    %ecx,%edi
call   1060 <sqrt@plt>
mov    %eax,%r15d
lea    0xdde(%rip),%rdi
mov    %r14d,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xdf2(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [33 x i8] c"introduzca la coordenada x de a\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [33 x i8] c"introduzca la coordenada y de a\0A\00"
@.str.3 = [33 x i8] c"introduzca la coordenada z de a\0A\00"
@.str.4 = [33 x i8] c"introduzca la coordemada x de b\0A\00"
@.str.5 = [33 x i8] c"introduzca la coordemada y de b\0A\00"
@.str.6 = [33 x i8] c"introduzca la coordemada z de b\0A\00"
@.str.7 = [41 x i8] c"Las coordenadas de c son C=(%d, %d, %d)\0A\00"
@.str.8 = [21 x i8] c"El modulo de c es %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
%3 = alloca [3 x i32]
%4 = alloca [3 x i32]
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 1
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %10)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %13)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0))
%16 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %16)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0))
%19 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 1
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %19)
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0))
%22 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 2
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %22)
%24 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%25 = load i32, i32* %24
%26 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%27 = load i32, i32* %26
%28 = add nsw i32 %25, %27
%29 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
store i32 %28, i32* %29
%30 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 1
%31 = load i32, i32* %30
%32 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 1
%33 = load i32, i32* %32
%34 = add nsw i32 %31, %33
%35 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 1
store i32 %34, i32* %35
%36 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
%37 = load i32, i32* %36
%38 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 2
%39 = load i32, i32* %38
%40 = add nsw i32 %37, %39
%41 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 2
store i32 %40, i32* %41
%42 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
%43 = load i32, i32* %42
%44 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
%45 = load i32, i32* %44
%46 = mul nsw i32 %43, %45
%47 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 1
%48 = load i32, i32* %47
%49 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 1
%50 = load i32, i32* %49
%51 = mul nsw i32 %48, %50
%52 = add nsw i32 %46, %51
%53 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 2
%54 = load i32, i32* %53
%55 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 2
%56 = load i32, i32* %55
%57 = mul nsw i32 %54, %56
%58 = add nsw i32 %52, %57
%59 = call i32 @sqrt(i32 %58)
store i32 %59, i32* %5
%60 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
%61 = load i32, i32* %60
%62 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 1
%63 = load i32, i32* %62
%64 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 2
%65 = load i32, i32* %64
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.7, i64 0, i64 0), i32 %61, i32 %63, i32 %65)
%67 = load i32, i32* %5
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0), i32 %67)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.7 = [41 x i8] c"Las coordenadas de c son C=(%d, %d, %d)\0A\00"
@.str.8 = [21 x i8] c"El modulo de c es %d\00"
@str = [32 x i8] c"introduzca la coordenada x de a\00"
@str.9 = [32 x i8] c"introduzca la coordenada y de a\00"
@str.10 = [32 x i8] c"introduzca la coordenada z de a\00"
@str.11 = [32 x i8] c"introduzca la coordemada x de b\00"
@str.12 = [32 x i8] c"introduzca la coordemada y de b\00"
@str.13 = [32 x i8] c"introduzca la coordemada z de b\00"
define i32 @main() {
%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 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.9, i64 0, i64 0))
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 1
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %9)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.10, i64 0, i64 0))
%12 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 2
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %12)
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.11, i64 0, i64 0))
%15 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %15)
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.12, i64 0, i64 0))
%18 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 1
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %18)
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.13, i64 0, i64 0))
%21 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %21)
%23 = load i32, i32* %6
%24 = load i32, i32* %15
%25 = add nsw i32 %24, %23
%26 = load i32, i32* %9
%27 = load i32, i32* %18
%28 = add nsw i32 %27, %26
%29 = load i32, i32* %12
%30 = load i32, i32* %21
%31 = add nsw i32 %30, %29
%32 = mul nsw i32 %25, %25
%33 = mul nsw i32 %28, %28
%34 = add nuw nsw i32 %33, %32
%35 = mul nsw i32 %31, %31
%36 = add nuw nsw i32 %34, %35
%37 = call i32 @sqrt(i32 %36)
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.7, i64 0, i64 0), i32 %25, i32 %28, i32 %31)
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0), i32 %37)
ret i32 0
}