#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 get_preuse_bit(int const);
int get_size(int const);
int get_use_bit(int const);
int /*<<< orphan*/ printf(char *, int, ...);
void print_dealloc_info(const int *mem, int address) {
  printf("Freeing memory address %d >> ", address);
  printf("Block Size %d >> Use Bit %d >> Preuse Bit %d\n\n",
         get_size(mem[address]), get_use_bit(mem[address]),
         get_preuse_bit(mem[address]));
  return;
}


x86 assembly (clang, -O0):
<print_dealloc_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <get_size@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1060 <get_use_bit@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1050 <get_preuse_bit@plt>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    %eax,%ecx
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_dealloc_info>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
lea    0xead(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movslq %ebx,%rbx
mov    (%r14,%rbx,4),%edi
call   1030 <get_size@plt>
mov    %eax,%r15d
mov    (%r14,%rbx,4),%edi
call   1060 <get_use_bit@plt>
mov    %eax,%ebp
mov    (%r14,%rbx,4),%edi
call   1050 <get_preuse_bit@plt>
lea    0xe9a(%rip),%rdi
mov    %r15d,%esi
mov    %ebp,%edx
mov    %eax,%ecx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Freeing memory address %d >> \00"
@.str.1 = [47 x i8] c"Block Size %d >> Use Bit %d >> Preuse Bit %d\0A\0A\00"
define void @print_dealloc_info(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32*, i32** %3
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %7, i64 %9
%11 = load i32, i32* %10
%12 = call i32 @get_size(i32 %11)
%13 = load i32*, i32** %3
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = call i32 @get_use_bit(i32 %17)
%19 = load i32*, i32** %3
%20 = load i32, i32* %4
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %19, i64 %21
%23 = load i32, i32* %22
%24 = call i32 @get_preuse_bit(i32 %23)
%25 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i32 %12, i32 %18, i32 %24)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"Freeing memory address %d >> \00"
@.str.1 = [47 x i8] c"Block Size %d >> Use Bit %d >> Preuse Bit %d\0A\0A\00"
define void @print_dealloc_info(i32* nocapture %0, i32 %1) {
%3 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = tail call i32 @get_size(i32 %6)
%8 = load i32, i32* %5
%9 = tail call i32 @get_use_bit(i32 %8)
%10 = load i32, i32* %5
%11 = tail call i32 @get_preuse_bit(i32 %10)
%12 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %9, i32 %11)
ret void
}