#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 foo5(int n, int m, int a[n][m]) {
  int x = (*(a + 29))[7];
  assert(x == 23);
  int y = (*(a + 7))[13];
  assert(y == 23);
  assert(a[7][13] == 23);
}


x86 assembly (clang, -O0):
<foo5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
imul   $0x1d,%rcx,%rcx
mov    0x1c(%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x17,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
imul   $0x7,%rcx,%rcx
mov    0x34(%rax,%rcx,4),%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x17,-0x18(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
imul   $0x7,%rcx,%rcx
cmpl   $0x17,0x34(%rax,%rcx,4)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo5>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%r15d
imul   $0x74,%r15,%rax
xor    %edi,%edi
cmpl   $0x17,0x1c(%rdx,%rax,1)
sete   %dil
call   1030 <assert@plt>
lea    (%r15,%r15,8),%rax
lea    (%rax,%rax,2),%rbx
add    %r15,%rbx
xor    %edi,%edi
cmpl   $0x17,0x34(%r14,%rbx,1)
sete   %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmpl   $0x17,0x34(%r14,%rbx,1)
sete   %dil
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @foo5(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = load i32, i32* %5
%12 = zext i32 %11 to i64
%13 = load i32*, i32** %6
%14 = mul nsw i64 29, %12
%15 = getelementptr inbounds i32, i32* %13, i64 %14
%16 = getelementptr inbounds i32, i32* %15, i64 7
%17 = load i32, i32* %16
store i32 %17, i32* %7
%18 = load i32, i32* %7
%19 = icmp eq i32 %18, 23
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
%22 = load i32*, i32** %6
%23 = mul nsw i64 7, %12
%24 = getelementptr inbounds i32, i32* %22, i64 %23
%25 = getelementptr inbounds i32, i32* %24, i64 13
%26 = load i32, i32* %25
store i32 %26, i32* %8
%27 = load i32, i32* %8
%28 = icmp eq i32 %27, 23
%29 = zext i1 %28 to i32
%30 = call i32 @assert(i32 %29)
%31 = load i32*, i32** %6
%32 = mul nsw i64 7, %12
%33 = getelementptr inbounds i32, i32* %31, i64 %32
%34 = getelementptr inbounds i32, i32* %33, i64 13
%35 = load i32, i32* %34
%36 = icmp eq i32 %35, 23
%37 = zext i1 %36 to i32
%38 = call i32 @assert(i32 %37)
ret void
}

LLVM IR (-O2):
define void @foo5(i32 %0, i32 %1, i32* nocapture %2) {
%4 = zext i32 %1 to i64
%5 = mul nuw nsw i64 %4, 29
%6 = getelementptr inbounds i32, i32* %2, i64 %5
%7 = getelementptr inbounds i32, i32* %6, i64 7
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, 23
%10 = zext i1 %9 to i32
%11 = tail call i32 @assert(i32 %10)
%12 = mul nuw nsw i64 %4, 7
%13 = getelementptr inbounds i32, i32* %2, i64 %12
%14 = getelementptr inbounds i32, i32* %13, i64 13
%15 = load i32, i32* %14
%16 = icmp eq i32 %15, 23
%17 = zext i1 %16 to i32
%18 = tail call i32 @assert(i32 %17)
%19 = load i32, i32* %14
%20 = icmp eq i32 %19, 23
%21 = zext i1 %20 to i32
%22 = tail call i32 @assert(i32 %21)
ret void
}