#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 */
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test2(size_t);
int /*<<< orphan*/ xbzero(void *, int);
int main(int argc, char const *argv[]) {
  size_t size = (1 << 28);
  int *arr = (int *)malloc(sizeof(int) * size);
  xbzero((void *)arr, sizeof(int) * size);
  for (size_t i = 0; i < size; i++) {
    if (arr[i] != 0) {
      printf("Not zero!!\n");
    }
  }
  printf("Yes\n");
  for (int i = 0; i < 28; i++) {
    test2((size_t)(1UL << i));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x10000000,-0x18(%rbp)
10
mov    -0x18(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%esi
call   1040 <xbzero@plt>
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    11ce <main+0x8e>
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     11b8 <main+0x78>
lea    0xe4d(%rip),%rdi
call   1030 <printf@plt>
jmp    11bd <main+0x7d>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    118c <main+0x4c>
lea    0xe37(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x2c(%rbp)
cmpl   $0x1c,-0x2c(%rbp)
jge    120b <main+0xcb>
mov    -0x2c(%rbp),%eax
mov    %eax,%ecx
mov    $0x1,%edi
shl    %cl,%rdi
call   1060 <test2@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11e1 <main+0xa1>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0x40000000,%edi
call   1050 <malloc@plt>
mov    %rax,%r15
mov    %rax,%rdi
mov    $0x40000000,%esi
call   1040 <xbzero@plt>
xor    %ebx,%ebx
lea    0xe9c(%rip),%r14
jmp    117d <main+0x3d>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    $0x10000000,%rbx
je     118e <main+0x4e>
cmpl   $0x0,(%r15,%rbx,4)
je     1170 <main+0x30>
mov    %r14,%rdi
call   1030 <puts@plt>
jmp    1170 <main+0x30>
lea    0xe6b(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1060 <test2@plt>
mov    $0x2,%edi
call   1060 <test2@plt>
mov    $0x4,%edi
call   1060 <test2@plt>
mov    $0x8,%edi
call   1060 <test2@plt>
mov    $0x10,%edi
call   1060 <test2@plt>
mov    $0x20,%edi
call   1060 <test2@plt>
mov    $0x40,%edi
call   1060 <test2@plt>
mov    $0x80,%edi
call   1060 <test2@plt>
mov    $0x100,%edi
call   1060 <test2@plt>
mov    $0x200,%edi
call   1060 <test2@plt>
mov    $0x400,%edi
call   1060 <test2@plt>
mov    $0x800,%edi
call   1060 <test2@plt>
mov    $0x1000,%edi
call   1060 <test2@plt>
mov    $0x2000,%edi
call   1060 <test2@plt>
mov    $0x4000,%edi
call   1060 <test2@plt>
mov    $0x8000,%edi
call   1060 <test2@plt>
mov    $0x10000,%edi
call   1060 <test2@plt>
mov    $0x20000,%edi
call   1060 <test2@plt>
mov    $0x40000,%edi
call   1060 <test2@plt>
mov    $0x80000,%edi
call   1060 <test2@plt>
mov    $0x100000,%edi
call   1060 <test2@plt>
mov    $0x200000,%edi
call   1060 <test2@plt>
mov    $0x400000,%edi
call   1060 <test2@plt>
mov    $0x800000,%edi
call   1060 <test2@plt>
mov    $0x1000000,%edi
call   1060 <test2@plt>
mov    $0x2000000,%edi
call   1060 <test2@plt>
mov    $0x4000000,%edi
call   1060 <test2@plt>
mov    $0x8000000,%edi
call   1060 <test2@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Not zero!!\0A\00"
@.str.1 = [5 x i8] c"Yes\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i32*
%8 = alloca i64
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 268435456, i64* %6
%10 = load i64, i64* %6
%11 = mul i64 4, %10
%12 = trunc i64 %11 to i32
%13 = call i64 @malloc(i32 %12)
%14 = inttoptr i64 %13 to i32*
store i32* %14, i32** %7
%15 = load i32*, i32** %7
%16 = bitcast i32* %15 to i8*
%17 = load i64, i64* %6
%18 = mul i64 4, %17
%19 = trunc i64 %18 to i32
%20 = call i32 @xbzero(i8* %16, i32 %19)
store i64 0, i64* %8
br label %21
21: ; preds = %34, %2
%22 = load i64, i64* %8
%23 = load i64, i64* %6
%24 = icmp ult i64 %22, %23
br i1 %24, label %25, label %37
25: ; preds = %21
%26 = load i32*, i32** %7
%27 = load i64, i64* %8
%28 = getelementptr inbounds i32, i32* %26, i64 %27
%29 = load i32, i32* %28
%30 = icmp ne i32 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %25
%32 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %33
33: ; preds = %31, %25
br label %34
34: ; preds = %33
%35 = load i64, i64* %8
%36 = add i64 %35, 1
store i64 %36, i64* %8
br label %21
37: ; preds = %21
%38 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %9
br label %39
39: ; preds = %47, %37
%40 = load i32, i32* %9
%41 = icmp slt i32 %40, 28
br i1 %41, label %42, label %50
42: ; preds = %39
%43 = load i32, i32* %9
%44 = zext i32 %43 to i64
%45 = shl i64 1, %44
%46 = call i32 @test2(i64 %45)
br label %47
47: ; preds = %42
%48 = load i32, i32* %9
%49 = add nsw i32 %48, 1
store i32 %49, i32* %9
br label %39
50: ; preds = %39
ret i32 0
}

LLVM IR (-O2):
@str = [4 x i8] c"Yes\00"
@str.2 = [11 x i8] c"Not zero!!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @malloc(i32 1073741824)
%4 = inttoptr i64 %3 to i32*
%5 = inttoptr i64 %3 to i8*
%6 = tail call i32 @xbzero(i8* %5, i32 1073741824)
br label %37
7: ; preds = %44
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 @test2(i64 1)
%10 = tail call i32 @test2(i64 2)
%11 = tail call i32 @test2(i64 4)
%12 = tail call i32 @test2(i64 8)
%13 = tail call i32 @test2(i64 16)
%14 = tail call i32 @test2(i64 32)
%15 = tail call i32 @test2(i64 64)
%16 = tail call i32 @test2(i64 128)
%17 = tail call i32 @test2(i64 256)
%18 = tail call i32 @test2(i64 512)
%19 = tail call i32 @test2(i64 1024)
%20 = tail call i32 @test2(i64 2048)
%21 = tail call i32 @test2(i64 4096)
%22 = tail call i32 @test2(i64 8192)
%23 = tail call i32 @test2(i64 16384)
%24 = tail call i32 @test2(i64 32768)
%25 = tail call i32 @test2(i64 65536)
%26 = tail call i32 @test2(i64 131072)
%27 = tail call i32 @test2(i64 262144)
%28 = tail call i32 @test2(i64 524288)
%29 = tail call i32 @test2(i64 1048576)
%30 = tail call i32 @test2(i64 2097152)
%31 = tail call i32 @test2(i64 4194304)
%32 = tail call i32 @test2(i64 8388608)
%33 = tail call i32 @test2(i64 16777216)
%34 = tail call i32 @test2(i64 33554432)
%35 = tail call i32 @test2(i64 67108864)
%36 = tail call i32 @test2(i64 134217728)
ret i32 0
37: ; preds = %2, %44
%38 = phi i64 [ 0, %2 ], [ %45, %44 ]
%39 = getelementptr inbounds i32, i32* %4, i64 %38
%40 = load i32, i32* %39
%41 = icmp eq i32 %40, 0
br i1 %41, label %44, label %42
42: ; preds = %37
%43 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.2, i64 0, i64 0))
br label %44
44: ; preds = %37, %42
%45 = add nuw nsw i64 %38, 1
%46 = icmp eq i64 %45, 268435456
br i1 %46, label %7, label %37
}