#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 */
char *calloc(int, int);
int /*<<< orphan*/ process_Memory_Row(char *, unsigned int);
char *get_memory(unsigned int start) {
  char *result = calloc(4096 * 205 + 1, sizeof(char));
  int i, point;
  point = 0;
  for (i = 0; i < 4096; i = i + 16) {
    process_Memory_Row(result + point, start + i);
    point = point + 205;
  }
  return result;
}


x86 assembly (clang, -O0):
<get_memory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xcd001,%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x1000,-0x14(%rbp)
jge    1188 <get_memory+0x68>
mov    -0x10(%rbp),%rdi
movslq -0x18(%rbp),%rax
add    %rax,%rdi
mov    -0x4(%rbp),%esi
add    -0x14(%rbp),%esi
call   1030 <process_Memory_Row@plt>
mov    -0x18(%rbp),%eax
add    $0xcd,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x10,%eax
mov    %eax,-0x14(%rbp)
jmp    114c <get_memory+0x2c>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_memory>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edi,%r15d
mov    $0xcd001,%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,%r14
mov    $0xfffffff0,%ebx
mov    %rax,%r12
cs nopw 0x0(%rax,%rax,1)
nop
lea    (%r15,%rbx,1),%esi
add    $0x10,%esi
mov    %r12,%rdi
call   1030 <process_Memory_Row@plt>
add    $0xcd,%r12
add    $0x10,%ebx
cmp    $0xff0,%ebx
jb     1150 <get_memory+0x30>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @get_memory(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = call i8* @calloc(i32 839681, i32 1)
store i8* %6, i8** %3
store i32 0, i32* %5
store i32 0, i32* %4
br label %7
7: ; preds = %21, %1
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 4096
br i1 %9, label %10, label %24
10: ; preds = %7
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i32, i32* %2
%16 = load i32, i32* %4
%17 = add i32 %15, %16
%18 = call i32 @process_Memory_Row(i8* %14, i32 %17)
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 205
store i32 %20, i32* %5
br label %21
21: ; preds = %10
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 16
store i32 %23, i32* %4
br label %7
24: ; preds = %7
%25 = load i8*, i8** %3
ret i8* %25
}

LLVM IR (-O2):
define i8* @get_memory(i32 %0) {
%2 = tail call dereferenceable_or_null(839681) i8* @calloc(i32 839681, i32 1)
br label %3
3: ; preds = %1, %3
%4 = phi i64 [ 0, %1 ], [ %9, %3 ]
%5 = phi i32 [ 0, %1 ], [ %10, %3 ]
%6 = getelementptr inbounds i8, i8* %2, i64 %4
%7 = add i32 %5, %0
%8 = tail call i32 @process_Memory_Row(i8* %6, i32 %7)
%9 = add nuw nsw i64 %4, 205
%10 = add nuw nsw i32 %5, 16
%11 = icmp ult i32 %5, 4080
br i1 %11, label %3, label %12
12: ; preds = %3
ret i8* %2
}