#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*/ __VERIFIER_assert(int);
int *foo() {
  int x, y;
  int *a;
  int i;
  int len;
  if (x < 0 || y < 0 || y > x)
    return (int *)0;
  len = x;
  for (i = 0; i < y; ++i) {
    a[i] = 0;
  }
  i = 0;
  while (i < y) {
    if (i < 0 || i >= len)
      __VERIFIER_assert(0 == 1);
    i++;
  }
  return a;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
cmpl   $0x0,-0xc(%rbp)
jl     1138 <foo+0x28>
cmpl   $0x0,-0x10(%rbp)
jl     1138 <foo+0x28>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1145 <foo+0x35>
movq   $0x0,-0x8(%rbp)
jmp    11c1 <foo+0xb1>
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    117b <foo+0x6b>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1152 <foo+0x42>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11b9 <foo+0xa9>
cmpl   $0x0,-0x1c(%rbp)
jl     11a4 <foo+0x94>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jl     11ab <foo+0x9b>
xor    %edi,%edi
call   1030 <__VERIFIER_assert@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1182 <foo+0x72>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32* @foo() {
%1 = alloca i32*
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 0
br i1 %8, label %16, label %9
9: ; preds = %0
%10 = load i32, i32* %3
%11 = icmp slt i32 %10, 0
br i1 %11, label %16, label %12
12: ; preds = %9
%13 = load i32, i32* %3
%14 = load i32, i32* %2
%15 = icmp sgt i32 %13, %14
br i1 %15, label %16, label %17
16: ; preds = %12, %9, %0
store i32* null, i32** %1
br label %50
17: ; preds = %12
%18 = load i32, i32* %2
store i32 %18, i32* %6
store i32 0, i32* %5
br label %19
19: ; preds = %28, %17
%20 = load i32, i32* %5
%21 = load i32, i32* %3
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %31
23: ; preds = %19
%24 = load i32*, i32** %4
%25 = load i32, i32* %5
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i32, i32* %24, i64 %26
store i32 0, i32* %27
br label %28
28: ; preds = %23
%29 = load i32, i32* %5
%30 = add nsw i32 %29, 1
store i32 %30, i32* %5
br label %19
31: ; preds = %19
store i32 0, i32* %5
br label %32
32: ; preds = %45, %31
%33 = load i32, i32* %5
%34 = load i32, i32* %3
%35 = icmp slt i32 %33, %34
br i1 %35, label %36, label %48
36: ; preds = %32
%37 = load i32, i32* %5
%38 = icmp slt i32 %37, 0
br i1 %38, label %43, label %39
39: ; preds = %36
%40 = load i32, i32* %5
%41 = load i32, i32* %6
%42 = icmp sge i32 %40, %41
br i1 %42, label %43, label %45
43: ; preds = %39, %36
%44 = call i32 @__VERIFIER_assert(i32 0)
br label %45
45: ; preds = %43, %39
%46 = load i32, i32* %5
%47 = add nsw i32 %46, 1
store i32 %47, i32* %5
br label %32
48: ; preds = %32
%49 = load i32*, i32** %4
store i32* %49, i32** %1
br label %50
50: ; preds = %48, %16
%51 = load i32*, i32** %1
ret i32* %51
}

LLVM IR (-O2):
define noalias i32* @foo() {
ret i32* null
}