int main() {
  struct ponto {
    int x;
    int y;
  } ponto1;
  struct ponto pont;
  ponto1 = pont;
  printf("digite o valor de x1: ");
  scanf("%d", &pont.x);
  printf("Digite o valor de y1: ");
  scanf("%d", &pont.y);
  printf("Digite o valor de x2: ");
  scanf("%d", &ponto1.x);
  printf("Digite o valor de y2: ");
  scanf("%d", &ponto1.y);
  int quadx;
  int quady;
  quadx = pow((ponto1.x - pont.x), 2);
  quady = pow((ponto1.y - pont.y), 2);
  int raiz;
  raiz = sqrt(quadx + quady);
  printf("O calculo da distancia é %d", raiz);
  getch();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x10(%rbp),%rsi
lea    0xf05(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x10(%rbp),%rsi
add    $0x4,%rsi
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x8(%rbp),%rsi
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x8(%rbp),%rsi
add    $0x4,%rsi
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
sub    -0x10(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xe06(%rip),%xmm1
call   1060 <pow@plt>
cvttsd2si %xmm0,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
sub    -0xc(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xde8(%rip),%xmm1
call   1060 <pow@plt>
cvttsd2si %xmm0,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
cvtsi2sd %eax,%xmm0
call   1070 <sqrt@plt>
cvttsd2si %xmm0,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xe20(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <getch@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeb4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf1c(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xea9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xea3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xe9d(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
movq   0x8(%rsp),%xmm0
movq   (%rsp),%xmm1
psubd  %xmm1,%xmm0
cvtdq2pd %xmm0,%xmm0
mulpd  %xmm0,%xmm0
cvttpd2dq %xmm0,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
movd   %xmm1,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pxor   %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     11fd <main+0xbd>
sqrtsd %xmm0,%xmm0
jmp    1202 <main+0xc2>
call   1060 <sqrt@plt>
cvttsd2si %xmm0,%esi
lea    0xe4f(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <getch@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.ponto = type { i32, i32 }
@.str = [23 x i8] c"digite o valor de x1: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [23 x i8] c"Digite o valor de y1: \00"
@.str.3 = [23 x i8] c"Digite o valor de x2: \00"
@.str.4 = [23 x i8] c"Digite o valor de y2: \00"
@.str.5 = [29 x i8] c"O calculo da distancia \C3\A9 %d\00"
define i32 @main() {
%1 = alloca %struct.ponto
%2 = alloca %struct.ponto
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast %struct.ponto* %1 to i8*
%7 = bitcast %struct.ponto* %2 to i8*
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds %struct.ponto, %struct.ponto* %2, i32 0, i32 0
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%12 = getelementptr inbounds %struct.ponto, %struct.ponto* %2, i32 0, i32 1
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %12)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%15 = getelementptr inbounds %struct.ponto, %struct.ponto* %1, i32 0, i32 0
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %15)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
%18 = getelementptr inbounds %struct.ponto, %struct.ponto* %1, i32 0, i32 1
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %18)
%20 = getelementptr inbounds %struct.ponto, %struct.ponto* %1, i32 0, i32 0
%21 = load i32, i32* %20
%22 = getelementptr inbounds %struct.ponto, %struct.ponto* %2, i32 0, i32 0
%23 = load i32, i32* %22
%24 = sub nsw i32 %21, %23
%25 = sitofp i32 %24 to double
%26 = call double @pow(double %25, double 2.000000e+00)
%27 = fptosi double %26 to i32
store i32 %27, i32* %3
%28 = getelementptr inbounds %struct.ponto, %struct.ponto* %1, i32 0, i32 1
%29 = load i32, i32* %28
%30 = getelementptr inbounds %struct.ponto, %struct.ponto* %2, i32 0, i32 1
%31 = load i32, i32* %30
%32 = sub nsw i32 %29, %31
%33 = sitofp i32 %32 to double
%34 = call double @pow(double %33, double 2.000000e+00)
%35 = fptosi double %34 to i32
store i32 %35, i32* %4
%36 = load i32, i32* %3
%37 = load i32, i32* %4
%38 = add nsw i32 %36, %37
%39 = sitofp i32 %38 to double
%40 = call double @sqrt(double %39)
%41 = fptosi double %40 to i32
store i32 %41, i32* %5
%42 = load i32, i32* %5
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), i32 %42)
%44 = call i32 (...) @getch()
ret i32 0
}

LLVM IR (-O2):
%struct.ponto = type { i32, i32 }
@.str = [23 x i8] c"digite o valor de x1: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [23 x i8] c"Digite o valor de y1: \00"
@.str.3 = [23 x i8] c"Digite o valor de x2: \00"
@.str.4 = [23 x i8] c"Digite o valor de y2: \00"
@.str.5 = [29 x i8] c"O calculo da distancia \C3\A9 %d\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to %struct.ponto*
%3 = alloca i64
%4 = bitcast i64* %3 to %struct.ponto*
%5 = bitcast i64* %1 to i8*
%6 = bitcast i64* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i64* %3)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%10 = getelementptr inbounds %struct.ponto, %struct.ponto* %4, i64 0, i32 1
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %10)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i64* %1)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
%15 = getelementptr inbounds %struct.ponto, %struct.ponto* %2, i64 0, i32 1
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %15)
%17 = bitcast i64* %1 to <2 x i32>*
%18 = load <2 x i32>, <2 x i32>* %17
%19 = bitcast i64* %3 to <2 x i32>*
%20 = load <2 x i32>, <2 x i32>* %19
%21 = sub nsw <2 x i32> %18, %20
%22 = sitofp <2 x i32> %21 to <2 x double>
%23 = fmul <2 x double> %22, %22
%24 = fptosi <2 x double> %23 to <2 x i32>
%25 = shufflevector <2 x i32> %24, <2 x i32> poison, <2 x i32> <i32 1, i32 undef>
%26 = add nsw <2 x i32> %25, %24
%27 = extractelement <2 x i32> %26, i64 0
%28 = sitofp i32 %27 to double
%29 = call double @sqrt(double %28)
%30 = fptosi double %29 to i32
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), i32 %30)
%32 = call i32 (...) @getch()
ret i32 0
}