#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 */
typedef scalar_t__ int32_t;

/* Variables and functions */
int /*<<< orphan*/ __CRAB_assert(int);
int /*<<< orphan*/ __CRAB_assume(int);
int nd();
int32_t compute1(int32_t *t) {
  int i1 = nd();
  __CRAB_assume(i1 >= 0 && i1 < 16);
  __CRAB_assert(t[i1] >= 0);
  return t[2] + t[4] + t[6] + t[15];
}


x86 assembly (clang, -O0):
<compute1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <nd@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jl     115f <compute1+0x2f>
cmpl   $0x10,-0xc(%rbp)
setl   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <__CRAB_assume@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__CRAB_assert@plt>
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rax
mov    -0x8(%rbp),%rcx
add    0x20(%rcx),%rax
mov    -0x8(%rbp),%rcx
add    0x30(%rcx),%rax
mov    -0x8(%rbp),%rcx
add    0x78(%rcx),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute1>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <nd@plt>
mov    %eax,%ebp
xor    %edi,%edi
cmp    $0x10,%eax
setb   %dil
call   1050 <__CRAB_assume@plt>
movslq %ebp,%rax
mov    (%rbx,%rax,8),%rdi
shr    $0x3f,%rdi
xor    $0x1,%edi
call   1040 <__CRAB_assert@plt>
mov    0x20(%rbx),%rax
add    0x10(%rbx),%rax
add    0x30(%rbx),%rax
add    0x78(%rbx),%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i64 @compute1(i64* %0) {
%2 = alloca i64*
%3 = alloca i32
store i64* %0, i64** %2
%4 = call i32 (...) @nd()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 16
br label %10
10: ; preds = %7, %1
%11 = phi i1 [ false, %1 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @__CRAB_assume(i32 %12)
%14 = load i64*, i64** %2
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i64, i64* %14, i64 %16
%18 = load i64, i64* %17
%19 = icmp sge i64 %18, 0
%20 = zext i1 %19 to i32
%21 = call i32 @__CRAB_assert(i32 %20)
%22 = load i64*, i64** %2
%23 = getelementptr inbounds i64, i64* %22, i64 2
%24 = load i64, i64* %23
%25 = load i64*, i64** %2
%26 = getelementptr inbounds i64, i64* %25, i64 4
%27 = load i64, i64* %26
%28 = add nsw i64 %24, %27
%29 = load i64*, i64** %2
%30 = getelementptr inbounds i64, i64* %29, i64 6
%31 = load i64, i64* %30
%32 = add nsw i64 %28, %31
%33 = load i64*, i64** %2
%34 = getelementptr inbounds i64, i64* %33, i64 15
%35 = load i64, i64* %34
%36 = add nsw i64 %32, %35
ret i64 %36
}

LLVM IR (-O2):
define i64 @compute1(i64* nocapture %0) {
%2 = tail call i32 (...) @nd()
%3 = icmp ult i32 %2, 16
%4 = zext i1 %3 to i32
%5 = tail call i32 @__CRAB_assume(i32 %4)
%6 = sext i32 %2 to i64
%7 = getelementptr inbounds i64, i64* %0, i64 %6
%8 = load i64, i64* %7
%9 = lshr i64 %8, 63
%10 = trunc i64 %9 to i32
%11 = xor i32 %10, 1
%12 = tail call i32 @__CRAB_assert(i32 %11)
%13 = getelementptr inbounds i64, i64* %0, i64 2
%14 = load i64, i64* %13
%15 = getelementptr inbounds i64, i64* %0, i64 4
%16 = load i64, i64* %15
%17 = add nsw i64 %16, %14
%18 = getelementptr inbounds i64, i64* %0, i64 6
%19 = load i64, i64* %18
%20 = add nsw i64 %17, %19
%21 = getelementptr inbounds i64, i64* %0, i64 15
%22 = load i64, i64* %21
%23 = add nsw i64 %20, %22
ret i64 %23
}