#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 */
double pow(int, int);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, int *);
double sqrt(double);
int main() {
  int x1, x2, y1, y2;
  scanf("%i", &x1);
  scanf("%i", &y1);
  scanf("%i", &x2);
  scanf("%i", &y2);
  double e1 = pow(x2 - x1, 2);
  double e2 = pow(y2 - y1, 2);
  double d = sqrt(e1 + e2);
  printf("A DISTANCIA ENTRE A e B = %0.2f\n", d);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xe9a(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xe8a(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xe7a(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%edi
sub    -0x8(%rbp),%edi
mov    $0x2,%esi
call   1050 <pow@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x14(%rbp),%edi
sub    -0x10(%rbp),%edi
mov    $0x2,%esi
call   1050 <pow@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
call   1060 <sqrt@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
lea    0xe2a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xeb4(%rip),%rbx
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x10(%rsp),%edi
sub    0x14(%rsp),%edi
mov    $0x2,%esi
call   1050 <pow@plt>
movsd  %xmm0,0x18(%rsp)
mov    0x8(%rsp),%edi
sub    0xc(%rsp),%edi
mov    $0x2,%esi
call   1050 <pow@plt>
addsd  0x18(%rsp),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     11c0 <main+0x80>
sqrtsd %xmm0,%xmm0
jmp    11c5 <main+0x85>
call   1060 <sqrt@plt>
lea    0xe37(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%i\00"
@.str.1 = [33 x i8] c"A DISTANCIA ENTRE A e B = %0.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
%7 = alloca double
%8 = alloca double
store i32 0, i32* %1
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
%13 = load i32, i32* %3
%14 = load i32, i32* %2
%15 = sub nsw i32 %13, %14
%16 = call double @pow(i32 %15, i32 2)
store double %16, double* %6
%17 = load i32, i32* %5
%18 = load i32, i32* %4
%19 = sub nsw i32 %17, %18
%20 = call double @pow(i32 %19, i32 2)
store double %20, double* %7
%21 = load double, double* %6
%22 = load double, double* %7
%23 = fadd double %21, %22
%24 = call double @sqrt(double %23)
store double %24, double* %8
%25 = load double, double* %8
%26 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), double %25)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
@.str.1 = [33 x i8] c"A DISTANCIA ENTRE A e B = %0.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%13 = load i32, i32* %2
%14 = load i32, i32* %1
%15 = sub nsw i32 %13, %14
%16 = call double @pow(i32 %15, i32 2)
%17 = load i32, i32* %4
%18 = load i32, i32* %3
%19 = sub nsw i32 %17, %18
%20 = call double @pow(i32 %19, i32 2)
%21 = fadd double %16, %20
%22 = call double @sqrt(double %21)
%23 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), double %22)
ret i32 0
}