#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__ less_than(int, int);
void s2_symbolic_widened_Bad(int *n) {
  int a[*n];
  for (int i = *n; less_than(i, 2 * *n); i++) {
    a[i] = 0;
  }
}


x86 assembly (clang, -O0):
<s2_symbolic_widened_Bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x28(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
shl    $0x1,%esi
call   1030 <less_than@plt>
cmp    $0x0,%rax
je     1187 <s2_symbolic_widened_Bad+0x77>
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    114f <s2_symbolic_widened_Bad+0x3f>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2_symbolic_widened_Bad>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%ebx
lea    (%rbx,%rbx,1),%esi
mov    %ebx,%edi
call   1030 <less_than@plt>
test   %rax,%rax
je     1144 <s2_symbolic_widened_Bad+0x34>
add    $0x1,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r14),%esi
add    %esi,%esi
mov    %ebx,%edi
call   1030 <less_than@plt>
add    $0x1,%ebx
test   %rax,%rax
jne    1130 <s2_symbolic_widened_Bad+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @s2_symbolic_widened_Bad(i32* %0) {
%2 = alloca i32*
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %3
%10 = alloca i32, i64 %8
store i64 %8, i64* %4
%11 = load i32*, i32** %2
%12 = load i32, i32* %11
store i32 %12, i32* %5
br label %13
13: ; preds = %24, %1
%14 = load i32, i32* %5
%15 = load i32*, i32** %2
%16 = load i32, i32* %15
%17 = mul nsw i32 2, %16
%18 = call i64 @less_than(i32 %14, i32 %17)
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %27
20: ; preds = %13
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %10, i64 %22
store i32 0, i32* %23
br label %24
24: ; preds = %20
%25 = load i32, i32* %5
%26 = add nsw i32 %25, 1
store i32 %26, i32* %5
br label %13
27: ; preds = %13
%28 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
define void @s2_symbolic_widened_Bad(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl nsw i32 %2, 1
%4 = tail call i64 @less_than(i32 %2, i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %1, %6
%7 = phi i32 [ %8, %6 ], [ %2, %1 ]
%8 = add nsw i32 %7, 1
%9 = load i32, i32* %0
%10 = shl nsw i32 %9, 1
%11 = tail call i64 @less_than(i32 %8, i32 %10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %1
ret void
}