#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*/ print_mem(int);
int main(int argc, char **argv) {
  long long i = 0;
  for (i = 0; i < 10; i++) {
    print_mem(i);
  }
  for (i = 1010; i < 1050; i += 10) {
    print_mem(i);
  }
  print_mem(1024 * 1024);
  print_mem(128 * 1024);
  print_mem(500 * 1024);
  print_mem(512 * 1024);
  print_mem(600 * 1024);
  print_mem(2032504 / 1024);
  print_mem(4096 * 1024);
  print_mem(65536 * 1024);
  print_mem(128 * 1024 * 1024);
  print_mem(1024 * 1024 * 1024);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0xa,-0x18(%rbp)
jge    115d <main+0x4d>
mov    -0x18(%rbp),%rax
mov    %eax,%edi
call   1030 <print_mem@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1136 <main+0x26>
movq   $0x3f2,-0x18(%rbp)
cmpq   $0x41a,-0x18(%rbp)
jge    118f <main+0x7f>
mov    -0x18(%rbp),%rax
mov    %eax,%edi
call   1030 <print_mem@plt>
mov    -0x18(%rbp),%rax
add    $0xa,%rax
mov    %rax,-0x18(%rbp)
jmp    1165 <main+0x55>
mov    $0x100000,%edi
call   1030 <print_mem@plt>
mov    $0x20000,%edi
call   1030 <print_mem@plt>
mov    $0x7d000,%edi
call   1030 <print_mem@plt>
mov    $0x80000,%edi
call   1030 <print_mem@plt>
mov    $0x96000,%edi
call   1030 <print_mem@plt>
mov    $0x7c0,%edi
call   1030 <print_mem@plt>
mov    $0x400000,%edi
call   1030 <print_mem@plt>
mov    $0x4000000,%edi
call   1030 <print_mem@plt>
mov    $0x8000000,%edi
call   1030 <print_mem@plt>
mov    $0x40000000,%edi
call   1030 <print_mem@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <print_mem@plt>
mov    $0x1,%edi
call   1030 <print_mem@plt>
mov    $0x2,%edi
call   1030 <print_mem@plt>
mov    $0x3,%edi
call   1030 <print_mem@plt>
mov    $0x4,%edi
call   1030 <print_mem@plt>
mov    $0x5,%edi
call   1030 <print_mem@plt>
mov    $0x6,%edi
call   1030 <print_mem@plt>
mov    $0x7,%edi
call   1030 <print_mem@plt>
mov    $0x8,%edi
call   1030 <print_mem@plt>
mov    $0x9,%edi
call   1030 <print_mem@plt>
mov    $0x3f2,%edi
call   1030 <print_mem@plt>
mov    $0x3fc,%edi
call   1030 <print_mem@plt>
mov    $0x406,%edi
call   1030 <print_mem@plt>
mov    $0x410,%edi
call   1030 <print_mem@plt>
mov    $0x100000,%edi
call   1030 <print_mem@plt>
mov    $0x20000,%edi
call   1030 <print_mem@plt>
mov    $0x7d000,%edi
call   1030 <print_mem@plt>
mov    $0x80000,%edi
call   1030 <print_mem@plt>
mov    $0x96000,%edi
call   1030 <print_mem@plt>
mov    $0x7c0,%edi
call   1030 <print_mem@plt>
mov    $0x400000,%edi
call   1030 <print_mem@plt>
mov    $0x4000000,%edi
call   1030 <print_mem@plt>
mov    $0x8000000,%edi
call   1030 <print_mem@plt>
mov    $0x40000000,%edi
call   1030 <print_mem@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 0, i64* %6
store i64 0, i64* %6
br label %7
7: ; preds = %14, %2
%8 = load i64, i64* %6
%9 = icmp slt i64 %8, 10
br i1 %9, label %10, label %17
10: ; preds = %7
%11 = load i64, i64* %6
%12 = trunc i64 %11 to i32
%13 = call i32 @print_mem(i32 %12)
br label %14
14: ; preds = %10
%15 = load i64, i64* %6
%16 = add nsw i64 %15, 1
store i64 %16, i64* %6
br label %7
17: ; preds = %7
store i64 1010, i64* %6
br label %18
18: ; preds = %25, %17
%19 = load i64, i64* %6
%20 = icmp slt i64 %19, 1050
br i1 %20, label %21, label %28
21: ; preds = %18
%22 = load i64, i64* %6
%23 = trunc i64 %22 to i32
%24 = call i32 @print_mem(i32 %23)
br label %25
25: ; preds = %21
%26 = load i64, i64* %6
%27 = add nsw i64 %26, 10
store i64 %27, i64* %6
br label %18
28: ; preds = %18
%29 = call i32 @print_mem(i32 1048576)
%30 = call i32 @print_mem(i32 131072)
%31 = call i32 @print_mem(i32 512000)
%32 = call i32 @print_mem(i32 524288)
%33 = call i32 @print_mem(i32 614400)
%34 = call i32 @print_mem(i32 1984)
%35 = call i32 @print_mem(i32 4194304)
%36 = call i32 @print_mem(i32 67108864)
%37 = call i32 @print_mem(i32 134217728)
%38 = call i32 @print_mem(i32 1073741824)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @print_mem(i32 0)
%4 = tail call i32 @print_mem(i32 1)
%5 = tail call i32 @print_mem(i32 2)
%6 = tail call i32 @print_mem(i32 3)
%7 = tail call i32 @print_mem(i32 4)
%8 = tail call i32 @print_mem(i32 5)
%9 = tail call i32 @print_mem(i32 6)
%10 = tail call i32 @print_mem(i32 7)
%11 = tail call i32 @print_mem(i32 8)
%12 = tail call i32 @print_mem(i32 9)
%13 = tail call i32 @print_mem(i32 1010)
%14 = tail call i32 @print_mem(i32 1020)
%15 = tail call i32 @print_mem(i32 1030)
%16 = tail call i32 @print_mem(i32 1040)
%17 = tail call i32 @print_mem(i32 1048576)
%18 = tail call i32 @print_mem(i32 131072)
%19 = tail call i32 @print_mem(i32 512000)
%20 = tail call i32 @print_mem(i32 524288)
%21 = tail call i32 @print_mem(i32 614400)
%22 = tail call i32 @print_mem(i32 1984)
%23 = tail call i32 @print_mem(i32 4194304)
%24 = tail call i32 @print_mem(i32 67108864)
%25 = tail call i32 @print_mem(i32 134217728)
%26 = tail call i32 @print_mem(i32 1073741824)
ret i32 0
}