#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 distance(int, int, int, int);
int /*<<< orphan*/ printf(char *, int, int, int, int, double);
int main() {
  printf("distance between two points for points"
         " x%d,y%d  x%d,y%d:  %f\n",
         1, 1, 4, 4, distance(1, 1, 4, 4));
  printf("distance between two points for points"
         " x%d,y%d  x%d,y%d:  %f\n",
         1, -4, -4, 2, distance(1, -4, -4, 2));
  printf("distance between two points for points"
         " x%d,y%d  x%d,y%d:  %f\n",
         2, -5, -3, -7, distance(2, -5, -3, -7));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%esi
mov    $0x4,%ecx
mov    %esi,%edi
mov    %ecx,%edx
call   1040 <distance@plt>
lea    0xec2(%rip),%rdi
mov    $0x1,%edx
mov    $0x4,%r8d
mov    %edx,%esi
mov    %r8d,%ecx
call   1030 <printf@plt>
mov    $0x1,%edi
mov    $0xfffffffc,%edx
mov    $0x2,%ecx
mov    %edx,%esi
call   1040 <distance@plt>
lea    0xe90(%rip),%rdi
mov    $0x1,%esi
mov    $0xfffffffc,%ecx
mov    $0x2,%r8d
mov    %ecx,%edx
call   1030 <printf@plt>
mov    $0x2,%edi
mov    $0xfffffffb,%esi
mov    $0xfffffffd,%edx
mov    $0xfffffff9,%ecx
call   1040 <distance@plt>
lea    0xe59(%rip),%rdi
mov    $0x2,%esi
mov    $0xfffffffb,%edx
mov    $0xfffffffd,%ecx
mov    $0xfffffff9,%r8d
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x4,%edx
mov    $0x4,%ecx
call   1040 <distance@plt>
lea    0xebf(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    $0x4,%ecx
mov    $0x4,%r8d
call   1030 <printf@plt>
mov    $0x1,%edi
mov    $0xfffffffc,%esi
mov    $0xfffffffc,%edx
mov    $0x2,%ecx
call   1040 <distance@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0xfffffffc,%edx
mov    $0xfffffffc,%ecx
mov    $0x2,%r8d
call   1030 <printf@plt>
mov    $0x2,%edi
mov    $0xfffffffb,%esi
mov    $0xfffffffd,%edx
mov    $0xfffffff9,%ecx
call   1040 <distance@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0xfffffffb,%edx
mov    $0xfffffffd,%ecx
mov    $0xfffffff9,%r8d
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [62 x i8] c"distance between two points for points x%d,y%d x%d,y%d: %f\0A\00"
define i32 @main() {
%1 = call double @distance(i32 1, i32 1, i32 4, i32 4)
%2 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i32 1, i32 1, i32 4, i32 4, double %1)
%3 = call double @distance(i32 1, i32 -4, i32 -4, i32 2)
%4 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i32 1, i32 -4, i32 -4, i32 2, double %3)
%5 = call double @distance(i32 2, i32 -5, i32 -3, i32 -7)
%6 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i32 2, i32 -5, i32 -3, i32 -7, double %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [62 x i8] c"distance between two points for points x%d,y%d x%d,y%d: %f\0A\00"
define i32 @main() {
%1 = tail call double @distance(i32 1, i32 1, i32 4, i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i32 1, i32 1, i32 4, i32 4, double %1)
%3 = tail call double @distance(i32 1, i32 -4, i32 -4, i32 2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i32 1, i32 -4, i32 -4, i32 2, double %3)
%5 = tail call double @distance(i32 2, i32 -5, i32 -3, i32 -7)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i32 2, i32 -5, i32 -3, i32 -7, double %5)
ret i32 0
}