#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*/ assert(int);
int rob(int *, int);
int main(int argc, char **argv) {
  int houses[6] = {1, 100, 2, 100, 3, 100};
  int result;
  assert(rob(houses, 6) == 300);
  houses[0] = 200;
  assert(rob(houses, 6) == 400);
  houses[0] = 100;
  houses[4] = 200;
  assert(rob(houses, 6) == 302);
  houses[4] = 300;
  assert(rob(houses, 6) == 402);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x6,%esi
call   1040 <rob@plt>
cmp    $0x12c,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0xc8,-0x30(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x6,%esi
call   1040 <rob@plt>
cmp    $0x190,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x64,-0x30(%rbp)
movl   $0xc8,-0x20(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x6,%esi
call   1040 <rob@plt>
cmp    $0x12e,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x12c,-0x20(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x6,%esi
call   1040 <rob@plt>
cmp    $0x192,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    0xee4(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x6,%esi
call   1040 <rob@plt>
xor    %edi,%edi
cmp    $0x12c,%eax
sete   %dil
call   1030 <assert@plt>
movl   $0xc8,(%rsp)
mov    %rbx,%rdi
mov    $0x6,%esi
call   1040 <rob@plt>
xor    %edi,%edi
cmp    $0x190,%eax
sete   %dil
call   1030 <assert@plt>
movl   $0x64,(%rsp)
movl   $0xc8,0x10(%rsp)
mov    %rbx,%rdi
mov    $0x6,%esi
call   1040 <rob@plt>
xor    %edi,%edi
cmp    $0x12e,%eax
sete   %dil
call   1030 <assert@plt>
movl   $0x12c,0x10(%rsp)
mov    %rbx,%rdi
mov    $0x6,%esi
call   1040 <rob@plt>
xor    %edi,%edi
cmp    $0x192,%eax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.houses = [6 x i32] [i32 1, i32 100, i32 2, i32 100, i32 3, i32 100]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [6 x i32]
%6 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%7 = bitcast [6 x i32]* %5 to i8*
%8 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 0
%9 = call i32 @rob(i32* %8, i32 6)
%10 = icmp eq i32 %9, 300
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 0
store i32 200, i32* %13
%14 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 0
%15 = call i32 @rob(i32* %14, i32 6)
%16 = icmp eq i32 %15, 400
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 0
store i32 100, i32* %19
%20 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 4
store i32 200, i32* %20
%21 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 0
%22 = call i32 @rob(i32* %21, i32 6)
%23 = icmp eq i32 %22, 302
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
%26 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 4
store i32 300, i32* %26
%27 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 0
%28 = call i32 @rob(i32* %27, i32 6)
%29 = icmp eq i32 %28, 402
%30 = zext i1 %29 to i32
%31 = call i32 @assert(i32 %30)
ret i32 0
}

LLVM IR (-O2):
@__const.main.houses = [6 x i32] [i32 1, i32 100, i32 2, i32 100, i32 3, i32 100]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [6 x i32]
%4 = bitcast [6 x i32]* %3 to i8*
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 0
%6 = call i32 @rob(i32* %5, i32 6)
%7 = icmp eq i32 %6, 300
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
store i32 200, i32* %5
%10 = call i32 @rob(i32* %5, i32 6)
%11 = icmp eq i32 %10, 400
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
store i32 100, i32* %5
%14 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 4
store i32 200, i32* %14
%15 = call i32 @rob(i32* %5, i32 6)
%16 = icmp eq i32 %15, 302
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
store i32 300, i32* %14
%19 = call i32 @rob(i32* %5, i32 6)
%20 = icmp eq i32 %19, 402
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
ret i32 0
}