#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);
void example4a(void) {
  int a[42];
  int j;
  int i = 0;
  while (i <= 9) {
    a[i] = 9;
    j = i + 5;
    a[j] = 42;
    assert(a[i] == 9);
    if (i > 0) {
      assert(a[i - 1] == 9);
    }
    i++;
  }
}


x86 assembly (clang, -O0):
<example4a>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0xb8(%rbp)
cmpl   $0x9,-0xb8(%rbp)
jg     11c2 <example4a+0xb2>
movslq -0xb8(%rbp),%rax
movl   $0x9,-0xb0(%rbp,%rax,4)
mov    -0xb8(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0xb4(%rbp)
movslq -0xb4(%rbp),%rax
movl   $0x2a,-0xb0(%rbp,%rax,4)
movslq -0xb8(%rbp),%rax
cmpl   $0x9,-0xb0(%rbp,%rax,4)
09
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x0,-0xb8(%rbp)
jle    11ae <example4a+0x9e>
mov    -0xb8(%rbp),%eax
sub    $0x1,%eax
cltq
cmpl   $0x9,-0xb0(%rbp,%rax,4)
09
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0xb8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb8(%rbp)
jmp    1125 <example4a+0x15>
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<example4a>:
sub    $0xa8,%rsp
movl   $0x9,(%rsp)
movl   $0x2a,0x14(%rsp)
mov    $0x1,%edi
call   1030 <assert@plt>
movl   $0x9,0x4(%rsp)
movl   $0x2a,0x18(%rsp)
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %edi,%edi
cmpl   $0x9,(%rsp)
sete   %dil
call   1030 <assert@plt>
movl   $0x9,0x8(%rsp)
movl   $0x2a,0x1c(%rsp)
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %edi,%edi
cmpl   $0x9,0x4(%rsp)
sete   %dil
call   1030 <assert@plt>
movl   $0x9,0xc(%rsp)
movl   $0x2a,0x20(%rsp)
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %edi,%edi
cmpl   $0x9,0x8(%rsp)
sete   %dil
call   1030 <assert@plt>
movl   $0x9,0x10(%rsp)
movl   $0x2a,0x24(%rsp)
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %edi,%edi
cmpl   $0x9,0xc(%rsp)
sete   %dil
call   1030 <assert@plt>
movl   $0x9,0x14(%rsp)
movl   $0x2a,0x28(%rsp)
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %edi,%edi
cmpl   $0x9,0x10(%rsp)
sete   %dil
call   1030 <assert@plt>
movl   $0x9,0x18(%rsp)
movl   $0x2a,0x2c(%rsp)
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %edi,%edi
cmpl   $0x9,0x14(%rsp)
sete   %dil
call   1030 <assert@plt>
movl   $0x9,0x1c(%rsp)
movl   $0x2a,0x30(%rsp)
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %edi,%edi
cmpl   $0x9,0x18(%rsp)
sete   %dil
call   1030 <assert@plt>
movl   $0x9,0x20(%rsp)
movl   $0x2a,0x34(%rsp)
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %edi,%edi
cmpl   $0x9,0x1c(%rsp)
sete   %dil
call   1030 <assert@plt>
movl   $0x9,0x24(%rsp)
movl   $0x2a,0x38(%rsp)
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %edi,%edi
cmpl   $0x9,0x20(%rsp)
sete   %dil
add    $0xa8,%rsp
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @example4a() {
%1 = alloca [42 x i32]
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %3
br label %4
4: ; preds = %34, %0
%5 = load i32, i32* %3
%6 = icmp sle i32 %5, 9
br i1 %6, label %7, label %37
7: ; preds = %4
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 %9
store i32 9, i32* %10
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 5
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 %14
store i32 42, i32* %15
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 %17
%19 = load i32, i32* %18
%20 = icmp eq i32 %19, 9
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
%23 = load i32, i32* %3
%24 = icmp sgt i32 %23, 0
br i1 %24, label %25, label %34
25: ; preds = %7
%26 = load i32, i32* %3
%27 = sub nsw i32 %26, 1
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 %28
%30 = load i32, i32* %29
%31 = icmp eq i32 %30, 9
%32 = zext i1 %31 to i32
%33 = call i32 @assert(i32 %32)
br label %34
34: ; preds = %25, %7
%35 = load i32, i32* %3
%36 = add nsw i32 %35, 1
store i32 %36, i32* %3
br label %4
37: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @example4a() {
%1 = alloca [42 x i32]
%2 = bitcast [42 x i32]* %1 to i8*
%3 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 0
store i32 9, i32* %3
%4 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 5
store i32 42, i32* %4
%5 = tail call i32 @assert(i32 1)
%6 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 1
store i32 9, i32* %6
%7 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 6
store i32 42, i32* %7
%8 = tail call i32 @assert(i32 1)
%9 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 0
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, 9
%12 = zext i1 %11 to i32
%13 = tail call i32 @assert(i32 %12)
%14 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 2
store i32 9, i32* %14
%15 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 7
store i32 42, i32* %15
%16 = tail call i32 @assert(i32 1)
%17 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 1
%18 = load i32, i32* %17
%19 = icmp eq i32 %18, 9
%20 = zext i1 %19 to i32
%21 = tail call i32 @assert(i32 %20)
%22 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 3
store i32 9, i32* %22
%23 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 8
store i32 42, i32* %23
%24 = tail call i32 @assert(i32 1)
%25 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 2
%26 = load i32, i32* %25
%27 = icmp eq i32 %26, 9
%28 = zext i1 %27 to i32
%29 = tail call i32 @assert(i32 %28)
%30 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 4
store i32 9, i32* %30
%31 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 9
store i32 42, i32* %31
%32 = tail call i32 @assert(i32 1)
%33 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 3
%34 = load i32, i32* %33
%35 = icmp eq i32 %34, 9
%36 = zext i1 %35 to i32
%37 = tail call i32 @assert(i32 %36)
%38 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 5
store i32 9, i32* %38
%39 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 10
store i32 42, i32* %39
%40 = tail call i32 @assert(i32 1)
%41 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 4
%42 = load i32, i32* %41
%43 = icmp eq i32 %42, 9
%44 = zext i1 %43 to i32
%45 = tail call i32 @assert(i32 %44)
%46 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 6
store i32 9, i32* %46
%47 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 11
store i32 42, i32* %47
%48 = tail call i32 @assert(i32 1)
%49 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 5
%50 = load i32, i32* %49
%51 = icmp eq i32 %50, 9
%52 = zext i1 %51 to i32
%53 = tail call i32 @assert(i32 %52)
%54 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 7
store i32 9, i32* %54
%55 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 12
store i32 42, i32* %55
%56 = tail call i32 @assert(i32 1)
%57 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 6
%58 = load i32, i32* %57
%59 = icmp eq i32 %58, 9
%60 = zext i1 %59 to i32
%61 = tail call i32 @assert(i32 %60)
%62 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 8
store i32 9, i32* %62
%63 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 13
store i32 42, i32* %63
%64 = tail call i32 @assert(i32 1)
%65 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 7
%66 = load i32, i32* %65
%67 = icmp eq i32 %66, 9
%68 = zext i1 %67 to i32
%69 = tail call i32 @assert(i32 %68)
%70 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 9
store i32 9, i32* %70
%71 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 14
store i32 42, i32* %71
%72 = tail call i32 @assert(i32 1)
%73 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 8
%74 = load i32, i32* %73
%75 = icmp eq i32 %74, 9
%76 = zext i1 %75 to i32
%77 = tail call i32 @assert(i32 %76)
ret void
}