#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 */
struct fibheap {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fh_deleteheap(struct fibheap *);
scalar_t__ fh_extractmin(struct fibheap *);
void *fh_insertkey(struct fibheap *, int /*<<< orphan*/, void *);
struct fibheap *fh_makekeyheap();
int fh_minkey(struct fibheap *);
int /*<<< orphan*/ fh_replacekey(struct fibheap *, void *, int);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  struct fibheap *a;
  void *arr[10];
  int i;
  a = fh_makekeyheap();
  for (i = 1; i < 10; i++) {
    arr[i] = fh_insertkey(a, 0, (void *)i);
    printf("adding: 0 %d \n", i);
  }
  printf(" \n");
  fh_replacekey(a, arr[1], -1);
  fh_replacekey(a, arr[6], -1);
  fh_replacekey(a, arr[4], -1);
  fh_replacekey(a, arr[2], -1);
  fh_replacekey(a, arr[8], -1);
  printf("value(minkey) %d\n", fh_minkey(a));
  printf("id: %d\n\n", (int)fh_extractmin(a));
  fh_replacekey(a, arr[7], -33);
  fh_replacekey(a, arr[4], -36);
  fh_replacekey(a, arr[3], -1);
  fh_replacekey(a, arr[9], -81);
  printf("value(minkey) %d\n", fh_minkey(a));
  printf("id: %d\n\n", (int)fh_extractmin(a));
  fh_replacekey(a, arr[6], -68);
  fh_replacekey(a, arr[2], -69);
  printf("value(minkey) %d\n", fh_minkey(a));
  printf("id: %d\n\n", (int)fh_extractmin(a));
  fh_replacekey(a, arr[1], -52);
  fh_replacekey(a, arr[3], -2);
  fh_replacekey(a, arr[4], -120);
  fh_replacekey(a, arr[5], -48);
  printf("value(minkey) %d\n", fh_minkey(a));
  printf("id: %d\n\n", (int)fh_extractmin(a));
  fh_replacekey(a, arr[3], -3);
  fh_replacekey(a, arr[5], -63);
  printf("value(minkey) %d\n", fh_minkey(a));
  printf("id: %d\n\n", (int)fh_extractmin(a));
  fh_replacekey(a, arr[5], -110);
  fh_replacekey(a, arr[7], -115);
  printf("value(minkey) %d\n", fh_minkey(a));
  printf("id: %d\n\n", (int)fh_extractmin(a));
  fh_replacekey(a, arr[5], -188);
  printf("value(minkey) %d\n", fh_minkey(a));
  printf("id: %d\n\n", (int)fh_extractmin(a));
  fh_replacekey(a, arr[3], -4);
  printf("value(minkey) %d\n", fh_minkey(a));
  printf("id: %d\n\n", (int)fh_extractmin(a));
  printf("value(minkey) %d\n", fh_minkey(a));
  printf("id: %d\n\n", (int)fh_extractmin(a));
  fh_deleteheap(a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <fh_makekeyheap@plt>
mov    %rax,-0x10(%rbp)
movl   $0x1,-0x64(%rbp)
cmpl   $0xa,-0x64(%rbp)
jge    11d5 <main+0x65>
mov    -0x10(%rbp),%rdi
movslq -0x64(%rbp),%rdx
xor    %esi,%esi
call   1080 <fh_insertkey@plt>
mov    %rax,%rcx
movslq -0x64(%rbp),%rax
mov    %rcx,-0x60(%rbp,%rax,8)
mov    -0x64(%rbp),%esi
lea    0xe40(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1191 <main+0x21>
lea    0xe30(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x58(%rbp),%rsi
mov    $0xffffffff,%edx
call   1050 <fh_replacekey@plt>
mov    -0x10(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    $0xffffffff,%edx
call   1050 <fh_replacekey@plt>
mov    -0x10(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    $0xffffffff,%edx
call   1050 <fh_replacekey@plt>
mov    -0x10(%rbp),%rdi
mov    -0x50(%rbp),%rsi
mov    $0xffffffff,%edx
call   1050 <fh_replacekey@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0xffffffff,%edx
call   1050 <fh_replacekey@plt>
mov    -0x10(%rbp),%rdi
call   1070 <fh_minkey@plt>
mov    %eax,%esi
lea    0xdc0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1090 <fh_extractmin@plt>
mov    %eax,%esi
lea    0xdb9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    $0xffffffdf,%edx
call   1050 <fh_replacekey@plt>
mov    -0x10(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    $0xffffffdc,%edx
call   1050 <fh_replacekey@plt>
mov    -0x10(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    $0xffffffff,%edx
call   1050 <fh_replacekey@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0xffffffaf,%edx
call   1050 <fh_replacekey@plt>
mov    -0x10(%rbp),%rdi
call   1070 <fh_minkey@plt>
mov    %eax,%esi
lea    0xd46(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1090 <fh_extractmin@plt>
mov    %eax,%esi
lea    0xd3f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    $0xffffffbc,%edx
call   1050 <fh_replacekey@plt>
mov    -0x10(%rbp),%rdi
mov    -0x50(%rbp),%rsi
mov    $0xffffffbb,%edx
call   1050 <fh_replacekey@plt>
mov    -0x10(%rbp),%rdi
call   1070 <fh_minkey@plt>
mov    %eax,%esi
lea    0xcf0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1090 <fh_extractmin@plt>
mov    %eax,%esi
lea    0xce9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x58(%rbp),%rsi
mov    $0xffffffcc,%edx
call   1050 <fh_replacekey@plt>
mov    -0x10(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    $0xfffffffe,%edx
call   1050 <fh_replacekey@plt>
mov    -0x10(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    $0xffffff88,%edx
call   1050 <fh_replacekey@plt>
mov    -0x10(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    $0xffffffd0,%edx
call   1050 <fh_replacekey@plt>
mov    -0x10(%rbp),%rdi
call   1070 <fh_minkey@plt>
mov    %eax,%esi
lea    0xc76(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1090 <fh_extractmin@plt>
mov    %eax,%esi
lea    0xc6f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    $0xfffffffd,%edx
call   1050 <fh_replacekey@plt>
mov    -0x10(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    $0xffffffc1,%edx
call   1050 <fh_replacekey@plt>
mov    -0x10(%rbp),%rdi
call   1070 <fh_minkey@plt>
mov    %eax,%esi
lea    0xc20(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1090 <fh_extractmin@plt>
mov    %eax,%esi
lea    0xc19(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    $0xffffff92,%edx
call   1050 <fh_replacekey@plt>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    $0xffffff8d,%edx
call   1050 <fh_replacekey@plt>
mov    -0x10(%rbp),%rdi
call   1070 <fh_minkey@plt>
mov    %eax,%esi
lea    0xbca(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1090 <fh_extractmin@plt>
mov    %eax,%esi
lea    0xbc3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    $0xffffff44,%edx
call   1050 <fh_replacekey@plt>
mov    -0x10(%rbp),%rdi
call   1070 <fh_minkey@plt>
mov    %eax,%esi
lea    0xb86(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1090 <fh_extractmin@plt>
mov    %eax,%esi
lea    0xb7f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    $0xfffffffc,%edx
call   1050 <fh_replacekey@plt>
mov    -0x10(%rbp),%rdi
call   1070 <fh_minkey@plt>
mov    %eax,%esi
lea    0xb42(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1090 <fh_extractmin@plt>
mov    %eax,%esi
lea    0xb3b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1070 <fh_minkey@plt>
mov    %eax,%esi
lea    0xb10(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1090 <fh_extractmin@plt>
mov    %eax,%esi
lea    0xb09(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fh_deleteheap@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
xor    %eax,%eax
call   1070 <fh_makekeyheap@plt>
mov    %rax,%rbx
mov    $0x1,%edx
mov    %rax,%rdi
xor    %esi,%esi
call   1090 <fh_insertkey@plt>
mov    %rax,%r14
mov    %rax,0x28(%rsp)
lea    0xe4a(%rip),%rbp
mov    %rbp,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x2,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1090 <fh_insertkey@plt>
mov    %rax,0x20(%rsp)
mov    %rbp,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x3,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1090 <fh_insertkey@plt>
mov    %rax,0x30(%rsp)
mov    %rbp,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x4,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1090 <fh_insertkey@plt>
mov    %rax,0x18(%rsp)
mov    %rbp,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x5,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1090 <fh_insertkey@plt>
mov    %rax,0x40(%rsp)
mov    %rbp,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x6,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1090 <fh_insertkey@plt>
mov    %rax,%r15
mov    %rax,0x10(%rsp)
mov    %rbp,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x7,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1090 <fh_insertkey@plt>
mov    %rax,%r13
mov    %rax,0x38(%rsp)
mov    %rbp,%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x8,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1090 <fh_insertkey@plt>
mov    %rax,%r12
mov    %rbp,%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x9,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1090 <fh_insertkey@plt>
mov    %rax,0x8(%rsp)
mov    %rbp,%rdi
mov    $0x9,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xd42(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xffffffff,%edx
call   1060 <fh_replacekey@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0xffffffff,%edx
call   1060 <fh_replacekey@plt>
mov    %rbx,%rdi
mov    0x18(%rsp),%rbp
mov    %rbp,%rsi
mov    $0xffffffff,%edx
call   1060 <fh_replacekey@plt>
mov    %rbx,%rdi
mov    0x20(%rsp),%r14
mov    %r14,%rsi
mov    $0xffffffff,%edx
call   1060 <fh_replacekey@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    $0xffffffff,%edx
call   1060 <fh_replacekey@plt>
mov    %rbx,%rdi
call   1080 <fh_minkey@plt>
lea    0xcb9(%rip),%r15
mov    %r15,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   10a0 <fh_extractmin@plt>
lea    0xcb0(%rip),%r12
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    $0xffffffdf,%edx
call   1060 <fh_replacekey@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %rbp,%r13
mov    $0xffffffdc,%edx
call   1060 <fh_replacekey@plt>
mov    %rbx,%rdi
mov    0x30(%rsp),%rbp
mov    %rbp,%rsi
mov    $0xffffffff,%edx
call   1060 <fh_replacekey@plt>
mov    %rbx,%rdi
mov    0x8(%rsp),%rsi
mov    $0xffffffaf,%edx
call   1060 <fh_replacekey@plt>
mov    %rbx,%rdi
call   1080 <fh_minkey@plt>
mov    %r15,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   10a0 <fh_extractmin@plt>
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    0x10(%rsp),%rsi
mov    $0xffffffbc,%edx
call   1060 <fh_replacekey@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xffffffbb,%edx
call   1060 <fh_replacekey@plt>
mov    %rbx,%rdi
call   1080 <fh_minkey@plt>
mov    %r15,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   10a0 <fh_extractmin@plt>
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    0x28(%rsp),%rsi
mov    $0xffffffcc,%edx
call   1060 <fh_replacekey@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %rbp,%r14
mov    $0xfffffffe,%edx
call   1060 <fh_replacekey@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    $0xffffff88,%edx
call   1060 <fh_replacekey@plt>
mov    %rbx,%rdi
mov    0x40(%rsp),%rbp
mov    %rbp,%rsi
mov    $0xffffffd0,%edx
call   1060 <fh_replacekey@plt>
mov    %rbx,%rdi
call   1080 <fh_minkey@plt>
mov    %r15,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   10a0 <fh_extractmin@plt>
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xfffffffd,%edx
call   1060 <fh_replacekey@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0xffffffc1,%edx
call   1060 <fh_replacekey@plt>
mov    %rbx,%rdi
call   1080 <fh_minkey@plt>
mov    %r15,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   10a0 <fh_extractmin@plt>
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0xffffff92,%edx
call   1060 <fh_replacekey@plt>
mov    %rbx,%rdi
mov    0x38(%rsp),%rsi
mov    $0xffffff8d,%edx
call   1060 <fh_replacekey@plt>
mov    %rbx,%rdi
call   1080 <fh_minkey@plt>
mov    %r15,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   10a0 <fh_extractmin@plt>
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0xffffff44,%edx
call   1060 <fh_replacekey@plt>
mov    %rbx,%rdi
call   1080 <fh_minkey@plt>
mov    %r15,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   10a0 <fh_extractmin@plt>
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xfffffffc,%edx
call   1060 <fh_replacekey@plt>
mov    %rbx,%rdi
call   1080 <fh_minkey@plt>
mov    %r15,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   10a0 <fh_extractmin@plt>
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1080 <fh_minkey@plt>
mov    %r15,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   10a0 <fh_extractmin@plt>
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <fh_deleteheap@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.fibheap = type { i32 }
@.str = [15 x i8] c"adding: 0 %d \0A\00"
@.str.1 = [3 x i8] c" \0A\00"
@.str.2 = [18 x i8] c"value(minkey) %d\0A\00"
@.str.3 = [9 x i8] c"id: %d\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.fibheap*
%3 = alloca [10 x i8*]
%4 = alloca i32
store i32 0, i32* %1
%5 = call %struct.fibheap* (...) @fh_makekeyheap()
store %struct.fibheap* %5, %struct.fibheap** %2
store i32 1, i32* %4
br label %6
6: ; preds = %20, %0
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 10
br i1 %8, label %9, label %23
9: ; preds = %6
%10 = load %struct.fibheap*, %struct.fibheap** %2
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i8*
%14 = call i8* @fh_insertkey(%struct.fibheap* %10, i32 0, i8* %13)
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 %16
store i8* %14, i8** %17
%18 = load i32, i32* %4
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %18)
br label %20
20: ; preds = %9
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
br label %6
23: ; preds = %6
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%25 = load %struct.fibheap*, %struct.fibheap** %2
%26 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 1
%27 = load i8*, i8** %26
%28 = call i32 @fh_replacekey(%struct.fibheap* %25, i8* %27, i32 -1)
%29 = load %struct.fibheap*, %struct.fibheap** %2
%30 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 6
%31 = load i8*, i8** %30
%32 = call i32 @fh_replacekey(%struct.fibheap* %29, i8* %31, i32 -1)
%33 = load %struct.fibheap*, %struct.fibheap** %2
%34 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 4
%35 = load i8*, i8** %34
%36 = call i32 @fh_replacekey(%struct.fibheap* %33, i8* %35, i32 -1)
%37 = load %struct.fibheap*, %struct.fibheap** %2
%38 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 2
%39 = load i8*, i8** %38
%40 = call i32 @fh_replacekey(%struct.fibheap* %37, i8* %39, i32 -1)
%41 = load %struct.fibheap*, %struct.fibheap** %2
%42 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 8
%43 = load i8*, i8** %42
%44 = call i32 @fh_replacekey(%struct.fibheap* %41, i8* %43, i32 -1)
%45 = load %struct.fibheap*, %struct.fibheap** %2
%46 = call i32 @fh_minkey(%struct.fibheap* %45)
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %46)
%48 = load %struct.fibheap*, %struct.fibheap** %2
%49 = call i64 @fh_extractmin(%struct.fibheap* %48)
%50 = trunc i64 %49 to i32
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %50)
%52 = load %struct.fibheap*, %struct.fibheap** %2
%53 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 7
%54 = load i8*, i8** %53
%55 = call i32 @fh_replacekey(%struct.fibheap* %52, i8* %54, i32 -33)
%56 = load %struct.fibheap*, %struct.fibheap** %2
%57 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 4
%58 = load i8*, i8** %57
%59 = call i32 @fh_replacekey(%struct.fibheap* %56, i8* %58, i32 -36)
%60 = load %struct.fibheap*, %struct.fibheap** %2
%61 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 3
%62 = load i8*, i8** %61
%63 = call i32 @fh_replacekey(%struct.fibheap* %60, i8* %62, i32 -1)
%64 = load %struct.fibheap*, %struct.fibheap** %2
%65 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 9
%66 = load i8*, i8** %65
%67 = call i32 @fh_replacekey(%struct.fibheap* %64, i8* %66, i32 -81)
%68 = load %struct.fibheap*, %struct.fibheap** %2
%69 = call i32 @fh_minkey(%struct.fibheap* %68)
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %69)
%71 = load %struct.fibheap*, %struct.fibheap** %2
%72 = call i64 @fh_extractmin(%struct.fibheap* %71)
%73 = trunc i64 %72 to i32
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %73)
%75 = load %struct.fibheap*, %struct.fibheap** %2
%76 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 6
%77 = load i8*, i8** %76
%78 = call i32 @fh_replacekey(%struct.fibheap* %75, i8* %77, i32 -68)
%79 = load %struct.fibheap*, %struct.fibheap** %2
%80 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 2
%81 = load i8*, i8** %80
%82 = call i32 @fh_replacekey(%struct.fibheap* %79, i8* %81, i32 -69)
%83 = load %struct.fibheap*, %struct.fibheap** %2
%84 = call i32 @fh_minkey(%struct.fibheap* %83)
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %84)
%86 = load %struct.fibheap*, %struct.fibheap** %2
%87 = call i64 @fh_extractmin(%struct.fibheap* %86)
%88 = trunc i64 %87 to i32
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %88)
%90 = load %struct.fibheap*, %struct.fibheap** %2
%91 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 1
%92 = load i8*, i8** %91
%93 = call i32 @fh_replacekey(%struct.fibheap* %90, i8* %92, i32 -52)
%94 = load %struct.fibheap*, %struct.fibheap** %2
%95 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 3
%96 = load i8*, i8** %95
%97 = call i32 @fh_replacekey(%struct.fibheap* %94, i8* %96, i32 -2)
%98 = load %struct.fibheap*, %struct.fibheap** %2
%99 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 4
%100 = load i8*, i8** %99
%101 = call i32 @fh_replacekey(%struct.fibheap* %98, i8* %100, i32 -120)
%102 = load %struct.fibheap*, %struct.fibheap** %2
%103 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 5
%104 = load i8*, i8** %103
%105 = call i32 @fh_replacekey(%struct.fibheap* %102, i8* %104, i32 -48)
%106 = load %struct.fibheap*, %struct.fibheap** %2
%107 = call i32 @fh_minkey(%struct.fibheap* %106)
%108 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %107)
%109 = load %struct.fibheap*, %struct.fibheap** %2
%110 = call i64 @fh_extractmin(%struct.fibheap* %109)
%111 = trunc i64 %110 to i32
%112 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %111)
%113 = load %struct.fibheap*, %struct.fibheap** %2
%114 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 3
%115 = load i8*, i8** %114
%116 = call i32 @fh_replacekey(%struct.fibheap* %113, i8* %115, i32 -3)
%117 = load %struct.fibheap*, %struct.fibheap** %2
%118 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 5
%119 = load i8*, i8** %118
%120 = call i32 @fh_replacekey(%struct.fibheap* %117, i8* %119, i32 -63)
%121 = load %struct.fibheap*, %struct.fibheap** %2
%122 = call i32 @fh_minkey(%struct.fibheap* %121)
%123 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %122)
%124 = load %struct.fibheap*, %struct.fibheap** %2
%125 = call i64 @fh_extractmin(%struct.fibheap* %124)
%126 = trunc i64 %125 to i32
%127 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %126)
%128 = load %struct.fibheap*, %struct.fibheap** %2
%129 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 5
%130 = load i8*, i8** %129
%131 = call i32 @fh_replacekey(%struct.fibheap* %128, i8* %130, i32 -110)
%132 = load %struct.fibheap*, %struct.fibheap** %2
%133 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 7
%134 = load i8*, i8** %133
%135 = call i32 @fh_replacekey(%struct.fibheap* %132, i8* %134, i32 -115)
%136 = load %struct.fibheap*, %struct.fibheap** %2
%137 = call i32 @fh_minkey(%struct.fibheap* %136)
%138 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %137)
%139 = load %struct.fibheap*, %struct.fibheap** %2
%140 = call i64 @fh_extractmin(%struct.fibheap* %139)
%141 = trunc i64 %140 to i32
%142 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %141)
%143 = load %struct.fibheap*, %struct.fibheap** %2
%144 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 5
%145 = load i8*, i8** %144
%146 = call i32 @fh_replacekey(%struct.fibheap* %143, i8* %145, i32 -188)
%147 = load %struct.fibheap*, %struct.fibheap** %2
%148 = call i32 @fh_minkey(%struct.fibheap* %147)
%149 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %148)
%150 = load %struct.fibheap*, %struct.fibheap** %2
%151 = call i64 @fh_extractmin(%struct.fibheap* %150)
%152 = trunc i64 %151 to i32
%153 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %152)
%154 = load %struct.fibheap*, %struct.fibheap** %2
%155 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 3
%156 = load i8*, i8** %155
%157 = call i32 @fh_replacekey(%struct.fibheap* %154, i8* %156, i32 -4)
%158 = load %struct.fibheap*, %struct.fibheap** %2
%159 = call i32 @fh_minkey(%struct.fibheap* %158)
%160 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %159)
%161 = load %struct.fibheap*, %struct.fibheap** %2
%162 = call i64 @fh_extractmin(%struct.fibheap* %161)
%163 = trunc i64 %162 to i32
%164 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %163)
%165 = load %struct.fibheap*, %struct.fibheap** %2
%166 = call i32 @fh_minkey(%struct.fibheap* %165)
%167 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %166)
%168 = load %struct.fibheap*, %struct.fibheap** %2
%169 = call i64 @fh_extractmin(%struct.fibheap* %168)
%170 = trunc i64 %169 to i32
%171 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %170)
%172 = load %struct.fibheap*, %struct.fibheap** %2
%173 = call i32 @fh_deleteheap(%struct.fibheap* %172)
ret i32 0
}

LLVM IR (-O2):
%struct.fibheap = type { i32 }
@.str = [15 x i8] c"adding: 0 %d \0A\00"
@.str.2 = [18 x i8] c"value(minkey) %d\0A\00"
@.str.3 = [9 x i8] c"id: %d\0A\0A\00"
@str = [2 x i8] c" \00"
define i32 @main() {
%1 = tail call %struct.fibheap* (...) @fh_makekeyheap()
%2 = tail call i8* @fh_insertkey(%struct.fibheap* %1, i32 0, i8* inttoptr (i64 1 to i8*))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = tail call i8* @fh_insertkey(%struct.fibheap* %1, i32 0, i8* inttoptr (i64 2 to i8*))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 2)
%6 = tail call i8* @fh_insertkey(%struct.fibheap* %1, i32 0, i8* inttoptr (i64 3 to i8*))
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 3)
%8 = tail call i8* @fh_insertkey(%struct.fibheap* %1, i32 0, i8* inttoptr (i64 4 to i8*))
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 4)
%10 = tail call i8* @fh_insertkey(%struct.fibheap* %1, i32 0, i8* inttoptr (i64 5 to i8*))
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 5)
%12 = tail call i8* @fh_insertkey(%struct.fibheap* %1, i32 0, i8* inttoptr (i64 6 to i8*))
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 6)
%14 = tail call i8* @fh_insertkey(%struct.fibheap* %1, i32 0, i8* inttoptr (i64 7 to i8*))
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 7)
%16 = tail call i8* @fh_insertkey(%struct.fibheap* %1, i32 0, i8* inttoptr (i64 8 to i8*))
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 8)
%18 = tail call i8* @fh_insertkey(%struct.fibheap* %1, i32 0, i8* inttoptr (i64 9 to i8*))
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 9)
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%21 = tail call i32 @fh_replacekey(%struct.fibheap* %1, i8* %2, i32 -1)
%22 = tail call i32 @fh_replacekey(%struct.fibheap* %1, i8* %12, i32 -1)
%23 = tail call i32 @fh_replacekey(%struct.fibheap* %1, i8* %8, i32 -1)
%24 = tail call i32 @fh_replacekey(%struct.fibheap* %1, i8* %4, i32 -1)
%25 = tail call i32 @fh_replacekey(%struct.fibheap* %1, i8* %16, i32 -1)
%26 = tail call i32 @fh_minkey(%struct.fibheap* %1)
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %26)
%28 = tail call i64 @fh_extractmin(%struct.fibheap* %1)
%29 = trunc i64 %28 to i32
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %29)
%31 = tail call i32 @fh_replacekey(%struct.fibheap* %1, i8* %14, i32 -33)
%32 = tail call i32 @fh_replacekey(%struct.fibheap* %1, i8* %8, i32 -36)
%33 = tail call i32 @fh_replacekey(%struct.fibheap* %1, i8* %6, i32 -1)
%34 = tail call i32 @fh_replacekey(%struct.fibheap* %1, i8* %18, i32 -81)
%35 = tail call i32 @fh_minkey(%struct.fibheap* %1)
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %35)
%37 = tail call i64 @fh_extractmin(%struct.fibheap* %1)
%38 = trunc i64 %37 to i32
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %38)
%40 = tail call i32 @fh_replacekey(%struct.fibheap* %1, i8* %12, i32 -68)
%41 = tail call i32 @fh_replacekey(%struct.fibheap* %1, i8* %4, i32 -69)
%42 = tail call i32 @fh_minkey(%struct.fibheap* %1)
%43 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %42)
%44 = tail call i64 @fh_extractmin(%struct.fibheap* %1)
%45 = trunc i64 %44 to i32
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %45)
%47 = tail call i32 @fh_replacekey(%struct.fibheap* %1, i8* %2, i32 -52)
%48 = tail call i32 @fh_replacekey(%struct.fibheap* %1, i8* %6, i32 -2)
%49 = tail call i32 @fh_replacekey(%struct.fibheap* %1, i8* %8, i32 -120)
%50 = tail call i32 @fh_replacekey(%struct.fibheap* %1, i8* %10, i32 -48)
%51 = tail call i32 @fh_minkey(%struct.fibheap* %1)
%52 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %51)
%53 = tail call i64 @fh_extractmin(%struct.fibheap* %1)
%54 = trunc i64 %53 to i32
%55 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %54)
%56 = tail call i32 @fh_replacekey(%struct.fibheap* %1, i8* %6, i32 -3)
%57 = tail call i32 @fh_replacekey(%struct.fibheap* %1, i8* %10, i32 -63)
%58 = tail call i32 @fh_minkey(%struct.fibheap* %1)
%59 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %58)
%60 = tail call i64 @fh_extractmin(%struct.fibheap* %1)
%61 = trunc i64 %60 to i32
%62 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %61)
%63 = tail call i32 @fh_replacekey(%struct.fibheap* %1, i8* %10, i32 -110)
%64 = tail call i32 @fh_replacekey(%struct.fibheap* %1, i8* %14, i32 -115)
%65 = tail call i32 @fh_minkey(%struct.fibheap* %1)
%66 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %65)
%67 = tail call i64 @fh_extractmin(%struct.fibheap* %1)
%68 = trunc i64 %67 to i32
%69 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %68)
%70 = tail call i32 @fh_replacekey(%struct.fibheap* %1, i8* %10, i32 -188)
%71 = tail call i32 @fh_minkey(%struct.fibheap* %1)
%72 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %71)
%73 = tail call i64 @fh_extractmin(%struct.fibheap* %1)
%74 = trunc i64 %73 to i32
%75 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %74)
%76 = tail call i32 @fh_replacekey(%struct.fibheap* %1, i8* %6, i32 -4)
%77 = tail call i32 @fh_minkey(%struct.fibheap* %1)
%78 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %77)
%79 = tail call i64 @fh_extractmin(%struct.fibheap* %1)
%80 = trunc i64 %79 to i32
%81 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %80)
%82 = tail call i32 @fh_minkey(%struct.fibheap* %1)
%83 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %82)
%84 = tail call i64 @fh_extractmin(%struct.fibheap* %1)
%85 = trunc i64 %84 to i32
%86 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %85)
%87 = tail call i32 @fh_deleteheap(%struct.fibheap* %1)
ret i32 0
}