#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*/ Scr_AddFloat(scalar_t__);
int /*<<< orphan*/ Scr_Error(char *);
scalar_t__ Scr_GetFloat(int);
int Scr_GetNumParam();
scalar_t__ powf(scalar_t__, int);
void GScr_Distance2DSquared() {
  if (Scr_GetNumParam() != 4) {
    Scr_Error("Usage: distance2DSquared(<float>, <float>, <float>, <float>)\n");
    return;
  }
  Scr_AddFloat(powf(Scr_GetFloat(0) - Scr_GetFloat(2), 2) +
               powf(Scr_GetFloat(1) - Scr_GetFloat(3), 2));
}


x86 assembly (clang, -O0):
<GScr_Distance2DSquared>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1040 <Scr_GetNumParam@plt>
cmp    $0x4,%eax
je     1179 <GScr_Distance2DSquared+0x29>
lea    0xe91(%rip),%rdi
call   1060 <Scr_Error@plt>
jmp    11d8 <GScr_Distance2DSquared+0x88>
xor    %edi,%edi
call   1070 <Scr_GetFloat@plt>
mov    %rax,-0x18(%rbp)
mov    $0x2,%edi
call   1070 <Scr_GetFloat@plt>
mov    -0x18(%rbp),%rdi
sub    %rax,%rdi
mov    $0x2,%esi
call   1030 <powf@plt>
mov    %rax,-0x8(%rbp)
mov    $0x1,%edi
call   1070 <Scr_GetFloat@plt>
mov    %rax,-0x10(%rbp)
mov    $0x3,%edi
call   1070 <Scr_GetFloat@plt>
mov    -0x10(%rbp),%rdi
sub    %rax,%rdi
mov    $0x2,%esi
call   1030 <powf@plt>
mov    -0x8(%rbp),%rdi
add    %rax,%rdi
call   1050 <Scr_AddFloat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GScr_Distance2DSquared>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <Scr_GetNumParam@plt>
cmp    $0x4,%eax
jne    11c0 <GScr_Distance2DSquared+0x70>
xor    %edi,%edi
call   1070 <Scr_GetFloat@plt>
mov    %rax,%rbx
mov    $0x2,%edi
call   1070 <Scr_GetFloat@plt>
sub    %rax,%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <powf@plt>
mov    %rax,%r14
mov    $0x1,%edi
call   1070 <Scr_GetFloat@plt>
mov    %rax,%rbx
mov    $0x3,%edi
call   1070 <Scr_GetFloat@plt>
sub    %rax,%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <powf@plt>
add    %rax,%r14
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <Scr_AddFloat@plt>
lea    0xe39(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1060 <Scr_Error@plt>

LLVM IR (-O0):
@.str = [62 x i8] c"Usage: distance2DSquared(<float>, <float>, <float>, <float>)\0A\00"
define void @GScr_Distance2DSquared() {
%1 = call i32 (...) @Scr_GetNumParam()
%2 = icmp ne i32 %1, 4
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @Scr_Error(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
br label %16
5: ; preds = %0
%6 = call i64 @Scr_GetFloat(i32 0)
%7 = call i64 @Scr_GetFloat(i32 2)
%8 = sub nsw i64 %6, %7
%9 = call i64 @powf(i64 %8, i32 2)
%10 = call i64 @Scr_GetFloat(i32 1)
%11 = call i64 @Scr_GetFloat(i32 3)
%12 = sub nsw i64 %10, %11
%13 = call i64 @powf(i64 %12, i32 2)
%14 = add nsw i64 %9, %13
%15 = call i32 @Scr_AddFloat(i64 %14)
br label %16
16: ; preds = %5, %3
ret void
}

LLVM IR (-O2):
@.str = [62 x i8] c"Usage: distance2DSquared(<float>, <float>, <float>, <float>)\0A\00"
define void @GScr_Distance2DSquared() {
%1 = tail call i32 (...) @Scr_GetNumParam()
%2 = icmp eq i32 %1, 4
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @Scr_Error(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
br label %16
5: ; preds = %0
%6 = tail call i64 @Scr_GetFloat(i32 0)
%7 = tail call i64 @Scr_GetFloat(i32 2)
%8 = sub nsw i64 %6, %7
%9 = tail call i64 @powf(i64 %8, i32 2)
%10 = tail call i64 @Scr_GetFloat(i32 1)
%11 = tail call i64 @Scr_GetFloat(i32 3)
%12 = sub nsw i64 %10, %11
%13 = tail call i64 @powf(i64 %12, i32 2)
%14 = add nsw i64 %13, %9
%15 = tail call i32 @Scr_AddFloat(i64 %14)
br label %16
16: ; preds = %5, %3
ret void
}