#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 */
scalar_t__ fabs(float);
int magComp(const void *a, const void *b) {
  if (fabs(*((float *)a)) > fabs(*((float *)b)))
    return -1;
  if (fabs(*((float *)a)) < fabs(*((float *)b)))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<magComp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
call   1030 <fabs@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
call   1030 <fabs@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
jle    115a <magComp+0x4a>
movl   $0xffffffff,-0x4(%rbp)
jmp    119b <magComp+0x8b>
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
call   1030 <fabs@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
call   1030 <fabs@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
jge    1194 <magComp+0x84>
movl   $0x1,-0x4(%rbp)
jmp    119b <magComp+0x8b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<magComp>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
movss  (%rdi),%xmm0
call   1030 <fabs@plt>
mov    %rax,%rbx
movss  (%r14),%xmm0
call   1030 <fabs@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
cmp    %rcx,%rbx
jg     1160 <magComp+0x50>
movss  (%r15),%xmm0
call   1030 <fabs@plt>
mov    %rax,%rbx
movss  (%r14),%xmm0
call   1030 <fabs@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rbx
setl   %al
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @magComp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to float*
%8 = load float, float* %7
%9 = call i64 @fabs(float %8)
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to float*
%12 = load float, float* %11
%13 = call i64 @fabs(float %12)
%14 = icmp sgt i64 %9, %13
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 -1, i32* %3
br label %28
16: ; preds = %2
%17 = load i8*, i8** %4
%18 = bitcast i8* %17 to float*
%19 = load float, float* %18
%20 = call i64 @fabs(float %19)
%21 = load i8*, i8** %5
%22 = bitcast i8* %21 to float*
%23 = load float, float* %22
%24 = call i64 @fabs(float %23)
%25 = icmp slt i64 %20, %24
br i1 %25, label %26, label %27
26: ; preds = %16
store i32 1, i32* %3
br label %28
27: ; preds = %16
store i32 0, i32* %3
br label %28
28: ; preds = %27, %26, %15
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @magComp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = load float, float* %3
%5 = tail call i64 @fabs(float %4)
%6 = bitcast i8* %1 to float*
%7 = load float, float* %6
%8 = tail call i64 @fabs(float %7)
%9 = icmp sgt i64 %5, %8
br i1 %9, label %17, label %10
10: ; preds = %2
%11 = load float, float* %3
%12 = tail call i64 @fabs(float %11)
%13 = load float, float* %6
%14 = tail call i64 @fabs(float %13)
%15 = icmp slt i64 %12, %14
%16 = zext i1 %15 to i32
br label %17
17: ; preds = %10, %2
%18 = phi i32 [ -1, %2 ], [ %16, %10 ]
ret i32 %18
}