#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*/ free(int *);
int /*<<< orphan*/ printf(char *, ...);
void deleteIntArray(int **arr) {
  printf("arr  = %p\n", arr);
  printf("*arr = %p\n", *arr);
  if (*arr) {
    printf("Deletando dados cadastrados...");
    free(*arr);
    *arr = 0;
    printf("[ok]\n");
  }
}


x86 assembly (clang, -O0):
<deleteIntArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1194 <deleteIntArray+0x74>
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deleteIntArray>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%rbx),%rsi
lea    0xebc(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmpq   $0x0,(%rbx)
je     1186 <deleteIntArray+0x56>
lea    0xeb3(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%rbx),%rdi
call   1030 <free@plt>
movq   $0x0,(%rbx)
lea    0xeb5(%rip),%rdi
pop    %rbx
jmp    1040 <puts@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"arr = %p\0A\00"
@.str.1 = [11 x i8] c"*arr = %p\0A\00"
@.str.2 = [31 x i8] c"Deletando dados cadastrados...\00"
@.str.3 = [6 x i8] c"[ok]\0A\00"
define void @deleteIntArray(i32** %0) {
%2 = alloca i32**
store i32** %0, i32*** %2
%3 = load i32**, i32*** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32** %3)
%5 = load i32**, i32*** %2
%6 = load i32*, i32** %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%8 = load i32**, i32*** %2
%9 = load i32*, i32** %8
%10 = icmp ne i32* %9, null
br i1 %10, label %11, label %18
11: ; preds = %1
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%13 = load i32**, i32*** %2
%14 = load i32*, i32** %13
%15 = call i32 @free(i32* %14)
%16 = load i32**, i32*** %2
store i32* null, i32** %16
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %18
18: ; preds = %11, %1
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"arr = %p\0A\00"
@.str.1 = [11 x i8] c"*arr = %p\0A\00"
@.str.2 = [31 x i8] c"Deletando dados cadastrados...\00"
@str = [5 x i8] c"[ok]\00"
define void @deleteIntArray(i32** %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32** %0)
%3 = load i32*, i32** %0
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%5 = load i32*, i32** %0
%6 = icmp eq i32* %5, null
br i1 %6, label %12, label %7
7: ; preds = %1
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%9 = load i32*, i32** %0
%10 = tail call i32 @free(i32* %9)
store i32* null, i32** %0
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
br label %12
12: ; preds = %7, %1
ret void
}