#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*/ HCHANGE(double *, int *, int *, int, int, double, int,
                           int *);
void HDELETE(double HA[], int HJ[], int HK[], int *N, int K, int *HOPS) {
  int JV, NX;
  double V;
  NX = *N;
  V = HA[NX];
  JV = HJ[NX];
  (*N)--;
  *HOPS = 0;
  if (K < NX)
    HCHANGE(HA, HJ, HK, NX, K, V, JV, HOPS);
}


x86 assembly (clang, -O0):
<HDELETE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x34(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
add    $0xffffffff,%ecx
mov    %ecx,(%rax)
mov    -0x30(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x24(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    11a3 <HDELETE+0x93>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x38(%rbp),%ecx
mov    -0x24(%rbp),%r8d
movsd  -0x40(%rbp),%xmm0
mov    -0x34(%rbp),%r9d
mov    -0x30(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <HCHANGE@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HDELETE>:
push   %rax
mov    %rcx,%r11
movslq (%rcx),%rcx
movsd  (%rdi,%rcx,8),%xmm0
mov    (%rsi,%rcx,4),%r10d
lea    -0x1(%rcx),%eax
mov    %eax,(%r11)
movl   $0x0,(%r9)
cmp    %r8d,%ecx
jle    113e <HDELETE+0x2e>
mov    %r9,(%rsp)
mov    %r10d,%r9d
call   1030 <HCHANGE@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @HDELETE(double* %0, i32* %1, i32* %2, i32* %3, i32 %4, i32* %5) {
%7 = alloca double*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32
%14 = alloca i32
%15 = alloca double
store double* %0, double** %7
store i32* %1, i32** %8
store i32* %2, i32** %9
store i32* %3, i32** %10
store i32 %4, i32* %11
store i32* %5, i32** %12
%16 = load i32*, i32** %10
%17 = load i32, i32* %16
store i32 %17, i32* %14
%18 = load double*, double** %7
%19 = load i32, i32* %14
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds double, double* %18, i64 %20
%22 = load double, double* %21
store double %22, double* %15
%23 = load i32*, i32** %8
%24 = load i32, i32* %14
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
%27 = load i32, i32* %26
store i32 %27, i32* %13
%28 = load i32*, i32** %10
%29 = load i32, i32* %28
%30 = add nsw i32 %29, -1
store i32 %30, i32* %28
%31 = load i32*, i32** %12
store i32 0, i32* %31
%32 = load i32, i32* %11
%33 = load i32, i32* %14
%34 = icmp slt i32 %32, %33
br i1 %34, label %35, label %45
35: ; preds = %6
%36 = load double*, double** %7
%37 = load i32*, i32** %8
%38 = load i32*, i32** %9
%39 = load i32, i32* %14
%40 = load i32, i32* %11
%41 = load double, double* %15
%42 = load i32, i32* %13
%43 = load i32*, i32** %12
%44 = call i32 @HCHANGE(double* %36, i32* %37, i32* %38, i32 %39, i32 %40, double %41, i32 %42, i32* %43)
br label %45
45: ; preds = %35, %6
ret void
}

LLVM IR (-O2):
define void @HDELETE(double* %0, i32* %1, i32* %2, i32* nocapture %3, i32 %4, i32* %5) {
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds double, double* %0, i64 %8
%10 = load double, double* %9
%11 = getelementptr inbounds i32, i32* %1, i64 %8
%12 = load i32, i32* %11
%13 = add nsw i32 %7, -1
store i32 %13, i32* %3
store i32 0, i32* %5
%14 = icmp sgt i32 %7, %4
br i1 %14, label %15, label %17
15: ; preds = %6
%16 = tail call i32 @HCHANGE(double* %0, i32* %1, i32* %2, i32 %7, i32 %4, double %10, i32 %12, i32* %5)
br label %17
17: ; preds = %15, %6
ret void
}