#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*/ array_back(void *);
int /*<<< orphan*/ array_begin(void *);
scalar_t__ array_empty(void *);
int /*<<< orphan*/ array_end(void *);
int /*<<< orphan*/ array_front(void *);
int array_size(void *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *, int, char *,
                           int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void array_object_show(void *A) {
  fprintf(stdout,
          "  show object of array :\n"
          "\t__array__ -> {\n"
          "\t  object=>0x%p,\n"
          "\t  size=>%d,\n"
          "\t  empty=>'%s',\n"
          "\t  begin=>0x%p,\n"
          "\t  end=>0x%p,\n"
          "\t  front=>0x%p,\n"
          "\t  back=>0x%p,\n"
          "\t}\n",
          A, array_size(A), (array_empty(A) ? "yes" : "no"), array_begin(A),
          array_end(A), array_front(A), array_back(A));
}


x86 assembly (clang, -O0):
<array_object_show>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e5d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
call   1080 <array_size@plt>
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <array_empty@plt>
mov    %rax,%rdx
lea    0xeed(%rip),%rax
lea    0xee2(%rip),%rcx
cmp    $0x0,%rdx
cmovne %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1090 <array_begin@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <array_end@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <array_front@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <array_back@plt>
mov    -0x34(%rbp),%edi
mov    -0x30(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x14(%rbp),%r9d
mov    -0x10(%rbp),%r11d
mov    -0xc(%rbp),%r10d
lea    0xdf0(%rip),%rsi
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1070 <fprintf@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_object_show>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2e5b(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x4(%rsp)
call   1080 <array_size@plt>
mov    %eax,%r15d
mov    %rbx,%rdi
call   1040 <array_empty@plt>
test   %rax,%rax
lea    0xef7(%rip),%rax
lea    0xeec(%rip),%rbp
cmove  %rax,%rbp
mov    %rbx,%rdi
call   1090 <array_begin@plt>
mov    %eax,%r12d
mov    %rbx,%rdi
call   1050 <array_end@plt>
mov    %eax,%r13d
mov    %rbx,%rdi
call   1060 <array_front@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
call   1030 <array_back@plt>
sub    $0x8,%rsp
lea    0xe1c(%rip),%rsi
mov    0xc(%rsp),%edi
mov    %rbx,%rdx
mov    %r15d,%ecx
mov    %rbp,%r8
mov    %r12d,%r9d
push   %rax
push   %r14
push   %r13
call   1070 <fprintf@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [152 x i8] c" show object of array :\0A\09__array__ -> {\0A\09 object=>0x%p,\0A\09 size=>%d,\0A\09 empty=>'%s',\0A\09 begin=>0x%p,\0A\09 end=>0x%p,\0A\09 front=>0x%p,\0A\09 back=>0x%p,\0A\09}\0A\00"
@.str.1 = [4 x i8] c"yes\00"
@.str.2 = [3 x i8] c"no\00"
define void @array_object_show(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @array_size(i8* %5)
%7 = load i8*, i8** %2
%8 = call i64 @array_empty(i8* %7)
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%12 = load i8*, i8** %2
%13 = call i32 @array_begin(i8* %12)
%14 = load i8*, i8** %2
%15 = call i32 @array_end(i8* %14)
%16 = load i8*, i8** %2
%17 = call i32 @array_front(i8* %16)
%18 = load i8*, i8** %2
%19 = call i32 @array_back(i8* %18)
%20 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str, i64 0, i64 0), i8* %4, i32 %6, i8* %11, i32 %13, i32 %15, i32 %17, i32 %19)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [152 x i8] c" show object of array :\0A\09__array__ -> {\0A\09 object=>0x%p,\0A\09 size=>%d,\0A\09 empty=>'%s',\0A\09 begin=>0x%p,\0A\09 end=>0x%p,\0A\09 front=>0x%p,\0A\09 back=>0x%p,\0A\09}\0A\00"
@.str.1 = [4 x i8] c"yes\00"
@.str.2 = [3 x i8] c"no\00"
define void @array_object_show(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @array_size(i8* %0)
%4 = tail call i64 @array_empty(i8* %0)
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%7 = tail call i32 @array_begin(i8* %0)
%8 = tail call i32 @array_end(i8* %0)
%9 = tail call i32 @array_front(i8* %0)
%10 = tail call i32 @array_back(i8* %0)
%11 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %3, i8* %6, i32 %7, i32 %8, i32 %9, i32 %10)
ret void
}