#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__ floor(double);
int /*<<< orphan*/ pca_group_heapsort_heapify(char **, unsigned long,
                                              unsigned long);
void pca_group_heapsort_build(char **memb, unsigned long n) {
  signed long i;
  for (i = (signed long)floor((double)n / 2.0) - 1; i >= 0; i--)
    pca_group_heapsort_heapify(memb, n, (unsigned long)i);
}


x86 assembly (clang, -O0):
<pca_group_heapsort_build>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movaps 0xed9(%rip),%xmm1
movq   -0x10(%rbp),%xmm0
punpckldq %xmm1,%xmm0
movapd 0xed8(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0xea1(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <floor@plt>
sub    $0x1,%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jl     119d <pca_group_heapsort_build+0x7d>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <pca_group_heapsort_heapify@plt>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    1170 <pca_group_heapsort_build+0x50>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pca_group_heapsort_build>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
movq   %rsi,%xmm1
punpckldq 0xec8(%rip),%xmm1
subpd  0xed0(%rip),%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
mulsd  0xecc(%rip),%xmm0
call   1040 <floor@plt>
test   %rax,%rax
jle    1189 <pca_group_heapsort_build+0x69>
mov    %rax,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
lea    -0x2(%rbx),%rdx
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <pca_group_heapsort_heapify@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     1170 <pca_group_heapsort_build+0x50>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @pca_group_heapsort_build(i8** %0, i64 %1) {
%3 = alloca i8**
%4 = alloca i64
%5 = alloca i64
store i8** %0, i8*** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = uitofp i64 %6 to double
%8 = fdiv double %7, 2.000000e+00
%9 = call i64 @floor(double %8)
%10 = sub nsw i64 %9, 1
store i64 %10, i64* %5
br label %11
11: ; preds = %19, %2
%12 = load i64, i64* %5
%13 = icmp sge i64 %12, 0
br i1 %13, label %14, label %22
14: ; preds = %11
%15 = load i8**, i8*** %3
%16 = load i64, i64* %4
%17 = load i64, i64* %5
%18 = call i32 @pca_group_heapsort_heapify(i8** %15, i64 %16, i64 %17)
br label %19
19: ; preds = %14
%20 = load i64, i64* %5
%21 = add nsw i64 %20, -1
store i64 %21, i64* %5
br label %11
22: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @pca_group_heapsort_build(i8** %0, i64 %1) {
%3 = uitofp i64 %1 to double
%4 = fmul double %3, 5.000000e-01
%5 = tail call i64 @floor(double %4)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %2, %7
%8 = phi i64 [ %9, %7 ], [ %5, %2 ]
%9 = add nsw i64 %8, -1
%10 = tail call i32 @pca_group_heapsort_heapify(i8** %0, i64 %1, i64 %9)
%11 = icmp ugt i64 %8, 1
br i1 %11, label %7, label %12
12: ; preds = %7, %2
ret void
}