#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 MEMORIA_CarregueData(int);
int /*<<< orphan*/ printf(char *, ...);
void imprimeMemoria(int mS, int mF) {
  int i;
  printf("Memória \n");
  printf("Endereço  -  Valor\n");
  for (i = mS; i <= mF; i++)
    printf("%d  =  %d\n", i, MEMORIA_CarregueData(i));
  printf("\n ------------------------------------------------\n");
}


x86 assembly (clang, -O0):
<imprimeMemoria>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     118b <imprimeMemoria+0x6b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <MEMORIA_CarregueData@plt>
mov    -0x10(%rbp),%esi
mov    %eax,%edx
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1150 <imprimeMemoria+0x30>
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprimeMemoria>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xecc(%rip),%rdi
call   1040 <puts@plt>
lea    0xeca(%rip),%rdi
call   1040 <puts@plt>
cmp    %ebx,%ebp
jg     117c <imprimeMemoria+0x4c>
add    $0x1,%ebx
lea    0xea2(%rip),%r14
xchg   %ax,%ax
mov    %ebp,%edi
call   1030 <MEMORIA_CarregueData@plt>
mov    %r14,%rdi
mov    %ebp,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1160 <imprimeMemoria+0x30>
lea    0xea6(%rip),%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"Mem\C3\B3ria \0A\00"
@.str.1 = [21 x i8] c"Endere\C3\A7o - Valor\0A\00"
@.str.2 = [11 x i8] c"%d = %d\0A\00"
@.str.3 = [52 x i8] c"\0A ------------------------------------------------\0A\00"
define void @imprimeMemoria(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* %3
store i32 %8, i32* %5
br label %9
9: ; preds = %18, %2
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = icmp sle i32 %10, %11
br i1 %12, label %13, label %21
13: ; preds = %9
%14 = load i32, i32* %5
%15 = load i32, i32* %5
%16 = call i32 @MEMORIA_CarregueData(i32 %15)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %14, i32 %16)
br label %18
18: ; preds = %13
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %9
21: ; preds = %9
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.2 = [11 x i8] c"%d = %d\0A\00"
@str = [10 x i8] c"Mem\C3\B3ria \00"
@str.4 = [20 x i8] c"Endere\C3\A7o - Valor\00"
@str.5 = [51 x i8] c"\0A ------------------------------------------------\00"
define void @imprimeMemoria(i32 %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.4, i64 0, i64 0))
%5 = icmp sgt i32 %0, %1
br i1 %5, label %12, label %6
6: ; preds = %2, %6
%7 = phi i32 [ %10, %6 ], [ %0, %2 ]
%8 = tail call i32 @MEMORIA_CarregueData(i32 %7)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %8)
%10 = add i32 %7, 1
%11 = icmp eq i32 %7, %1
br i1 %11, label %12, label %6
12: ; preds = %6, %2
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.5, i64 0, i64 0))
ret void
}