#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*/ __CRAB_assert(int);
int /*<<< orphan*/ __CRAB_assume(int);
int int_nd();
int /*<<< orphan*/ rec_init(int *, int);
int main() {
  int a[10];
  rec_init(&a[0], 9);
  int i = int_nd();
  __CRAB_assume(i >= 0);
  __CRAB_assume(i < 10);
  int res = a[i - 1];
  __CRAB_assert(res == 5);
  return res;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x9,%esi
call   1030 <rec_init@plt>
mov    $0x0,%al
call   1060 <int_nd@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <__CRAB_assume@plt>
cmpl   $0xa,-0x34(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <__CRAB_assume@plt>
mov    -0x34(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x30(%rbp,%rax,4),%eax
mov    %eax,-0x38(%rbp)
cmpl   $0x5,-0x38(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__CRAB_assert@plt>
mov    -0x38(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    %rsp,%rdi
mov    $0x9,%esi
call   1030 <rec_init@plt>
xor    %eax,%eax
call   1060 <int_nd@plt>
mov    %eax,%ebx
mov    %eax,%edi
not    %edi
shr    $0x1f,%edi
call   1050 <__CRAB_assume@plt>
xor    %edi,%edi
cmp    $0xa,%ebx
setl   %dil
call   1050 <__CRAB_assume@plt>
movslq %ebx,%rax
mov    -0x4(%rsp,%rax,4),%ebx
xor    %edi,%edi
cmp    $0x5,%ebx
sete   %dil
call   1040 <__CRAB_assert@plt>
mov    %ebx,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%6 = call i32 @rec_init(i32* %5, i32 9)
%7 = call i32 (...) @int_nd()
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp sge i32 %8, 0
%10 = zext i1 %9 to i32
%11 = call i32 @__CRAB_assume(i32 %10)
%12 = load i32, i32* %3
%13 = icmp slt i32 %12, 10
%14 = zext i1 %13 to i32
%15 = call i32 @__CRAB_assume(i32 %14)
%16 = load i32, i32* %3
%17 = sub nsw i32 %16, 1
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %18
%20 = load i32, i32* %19
store i32 %20, i32* %4
%21 = load i32, i32* %4
%22 = icmp eq i32 %21, 5
%23 = zext i1 %22 to i32
%24 = call i32 @__CRAB_assert(i32 %23)
%25 = load i32, i32* %4
ret i32 %25
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @rec_init(i32* %3, i32 9)
%5 = call i32 (...) @int_nd()
%6 = xor i32 %5, -1
%7 = lshr i32 %6, 31
%8 = call i32 @__CRAB_assume(i32 %7)
%9 = icmp slt i32 %5, 10
%10 = zext i1 %9 to i32
%11 = call i32 @__CRAB_assume(i32 %10)
%12 = add nsw i32 %5, -1
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %13
%15 = load i32, i32* %14
%16 = icmp eq i32 %15, 5
%17 = zext i1 %16 to i32
%18 = call i32 @__CRAB_assert(i32 %17)
ret i32 %15
}