#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);
scalar_t__ nam_access(unsigned char *, int, int, int);
int /*<<< orphan*/ puts(char *);
void internal(void) {
  unsigned char matrix[2];
  puts("\ntesting calling internal functions with invalid arguments (warnings "
       "will be printed)");
  assert(0 == nam_access(0, 0, 0, 0));
  assert(0 == nam_access(matrix, 0, 0, 0));
  assert(0 == nam_access(matrix, 2, 3, 0));
  assert(0 == nam_access(matrix, 2, 0, 3));
  puts("success!");
}


x86 assembly (clang, -O0):
<internal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
mov    %eax,%edi
xor    %ecx,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1050 <nam_access@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x2(%rbp),%rdi
xor    %ecx,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1050 <nam_access@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x2(%rbp),%rdi
mov    $0x2,%esi
mov    $0x3,%edx
xor    %ecx,%ecx
call   1050 <nam_access@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x2(%rbp),%rdi
mov    $0x2,%esi
xor    %edx,%edx
mov    $0x3,%ecx
call   1050 <nam_access@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xe6f(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<internal>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1050 <nam_access@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
lea    0xe(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1050 <nam_access@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x3,%edx
xor    %ecx,%ecx
call   1050 <nam_access@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %edx,%edx
mov    $0x3,%ecx
call   1050 <nam_access@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
lea    0xe8e(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [86 x i8] c"\0Atesting calling internal functions with invalid arguments (warnings will be printed)\00"
@.str.1 = [9 x i8] c"success!\00"
define void @internal() {
%1 = alloca [2 x i8]
%2 = call i32 @puts(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0))
%3 = call i64 @nam_access(i8* null, i32 0, i32 0, i32 0)
%4 = icmp eq i64 0, %3
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%8 = call i64 @nam_access(i8* %7, i32 0, i32 0, i32 0)
%9 = icmp eq i64 0, %8
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%13 = call i64 @nam_access(i8* %12, i32 2, i32 3, i32 0)
%14 = icmp eq i64 0, %13
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%18 = call i64 @nam_access(i8* %17, i32 2, i32 0, i32 3)
%19 = icmp eq i64 0, %18
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
%22 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [86 x i8] c"\0Atesting calling internal functions with invalid arguments (warnings will be printed)\00"
@.str.1 = [9 x i8] c"success!\00"
define void @internal() {
%1 = alloca [2 x i8]
%2 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0))
%4 = tail call i64 @nam_access(i8* null, i32 0, i32 0, i32 0)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = call i64 @nam_access(i8* %2, i32 0, i32 0, i32 0)
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = call i64 @nam_access(i8* %2, i32 2, i32 3, i32 0)
%13 = icmp eq i64 %12, 0
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = call i64 @nam_access(i8* %2, i32 2, i32 0, i32 3)
%17 = icmp eq i64 %16, 0
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret void
}