#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 */
struct Tuple2_Int_Int {
  int dummy;
};

/* Variables and functions */
int fst_0(struct Tuple2_Int_Int *);
int snd_0(struct Tuple2_Int_Int *);
int distant2_0(struct Tuple2_Int_Int *pointA, struct Tuple2_Int_Int *pointB) {
  int _tmp013;
  int _tmp012;
  _tmp013 = (fst_0(pointA) - fst_0(pointB));
  if (1) {
    int _tmp015;
    int pvar6_dx = _tmp013;
    int _tmp014;
    _tmp015 = (snd_0(pointA) - snd_0(pointB));
    if (1) {
      int pvar7_dy = _tmp015;
      _tmp014 = ((pvar6_dx * pvar6_dx) + (pvar7_dy * pvar7_dy));
    }
    _tmp012 = _tmp014;
  }
  return _tmp012;
}


x86 assembly (clang, -O0):
<distant2_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fst_0@plt>
mov    %eax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fst_0@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <snd_0@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <snd_0@plt>
mov    %eax,%ecx
mov    -0x2c(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x20(%rbp),%eax
imul   -0x20(%rbp),%eax
mov    -0x28(%rbp),%ecx
imul   -0x28(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<distant2_0>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <fst_0@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1030 <fst_0@plt>
sub    %eax,%ebp
mov    %rbx,%rdi
call   1040 <snd_0@plt>
mov    %eax,%ebx
mov    %r14,%rdi
call   1040 <snd_0@plt>
sub    %eax,%ebx
imul   %ebp,%ebp
imul   %ebx,%ebx
add    %ebp,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.Tuple2_Int_Int = type { i32 }
define i32 @distant2_0(%struct.Tuple2_Int_Int* %0, %struct.Tuple2_Int_Int* %1) {
%3 = alloca %struct.Tuple2_Int_Int*
%4 = alloca %struct.Tuple2_Int_Int*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store %struct.Tuple2_Int_Int* %0, %struct.Tuple2_Int_Int** %3
store %struct.Tuple2_Int_Int* %1, %struct.Tuple2_Int_Int** %4
%11 = load %struct.Tuple2_Int_Int*, %struct.Tuple2_Int_Int** %3
%12 = call i32 @fst_0(%struct.Tuple2_Int_Int* %11)
%13 = load %struct.Tuple2_Int_Int*, %struct.Tuple2_Int_Int** %4
%14 = call i32 @fst_0(%struct.Tuple2_Int_Int* %13)
%15 = sub nsw i32 %12, %14
store i32 %15, i32* %5
%16 = load i32, i32* %5
store i32 %16, i32* %8
%17 = load %struct.Tuple2_Int_Int*, %struct.Tuple2_Int_Int** %3
%18 = call i32 @snd_0(%struct.Tuple2_Int_Int* %17)
%19 = load %struct.Tuple2_Int_Int*, %struct.Tuple2_Int_Int** %4
%20 = call i32 @snd_0(%struct.Tuple2_Int_Int* %19)
%21 = sub nsw i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %7
store i32 %22, i32* %10
%23 = load i32, i32* %8
%24 = load i32, i32* %8
%25 = mul nsw i32 %23, %24
%26 = load i32, i32* %10
%27 = load i32, i32* %10
%28 = mul nsw i32 %26, %27
%29 = add nsw i32 %25, %28
store i32 %29, i32* %9
%30 = load i32, i32* %9
store i32 %30, i32* %6
%31 = load i32, i32* %6
ret i32 %31
}

LLVM IR (-O2):
%struct.Tuple2_Int_Int = type { i32 }
define i32 @distant2_0(%struct.Tuple2_Int_Int* %0, %struct.Tuple2_Int_Int* %1) {
%3 = tail call i32 @fst_0(%struct.Tuple2_Int_Int* %0)
%4 = tail call i32 @fst_0(%struct.Tuple2_Int_Int* %1)
%5 = sub nsw i32 %3, %4
%6 = tail call i32 @snd_0(%struct.Tuple2_Int_Int* %0)
%7 = tail call i32 @snd_0(%struct.Tuple2_Int_Int* %1)
%8 = sub nsw i32 %6, %7
%9 = mul nsw i32 %5, %5
%10 = mul nsw i32 %8, %8
%11 = add nuw nsw i32 %10, %9
ret i32 %11
}