#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void print_n_size_t(size_t nelems, const size_t *array) {
  fprintf(stderr, "[");
  while (nelems-- > 0) {
    fprintf(stderr, "%ld", (long)*array++);
    if (nelems > 0)
      fprintf(stderr, " ");
  }
  fprintf(stderr, "]");
}


x86 assembly (clang, -O0):
<print_n_size_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
lea    0xed0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x8(%rbp)
cmp    $0x0,%rax
jbe    11a0 <print_n_size_t+0x90>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rdx
lea    0xe90(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
cmpq   $0x0,-0x8(%rbp)
jbe    119b <print_n_size_t+0x8b>
mov    0x2e55(%rip),%rax
mov    (%rax),%edi
lea    0xe72(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1137 <print_n_size_t+0x27>
mov    0x2e39(%rip),%rax
mov    (%rax),%edi
lea    0xe58(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_n_size_t>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2eb8(%rip),%r13
mov    0x0(%r13),%edi
lea    0xecd(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
test   %rbx,%rbx
je     1199 <print_n_size_t+0x89>
mov    0x0(%r13),%edi
mov    (%r14),%rdx
lea    0xeb5(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
cmp    $0x1,%rbx
je     1199 <print_n_size_t+0x89>
mov    $0x1,%ebp
lea    0xea0(%rip),%r15
lea    0xe95(%rip),%r12
nopl   (%rax)
mov    0x0(%r13),%edi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x0(%r13),%edi
mov    (%r14,%rbp,8),%rdx
mov    %r12,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1170 <print_n_size_t+0x60>
mov    0x0(%r13),%edi
lea    0xe64(%rip),%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [2 x i8] c"[\00"
@.str.1 = [4 x i8] c"%ld\00"
@.str.2 = [2 x i8] c" \00"
@.str.3 = [2 x i8] c"]\00"
define void @print_n_size_t(i64 %0, i64* %1) {
%3 = alloca i64
%4 = alloca i64*
store i64 %0, i64* %3
store i64* %1, i64** %4
%5 = load i32, i32* @stderr
%6 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %22, %2
%8 = load i64, i64* %3
%9 = add i64 %8, -1
store i64 %9, i64* %3
%10 = icmp ugt i64 %8, 0
br i1 %10, label %11, label %23
11: ; preds = %7
%12 = load i32, i32* @stderr
%13 = load i64*, i64** %4
%14 = getelementptr inbounds i64, i64* %13, i32 1
store i64* %14, i64** %4
%15 = load i64, i64* %13
%16 = call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 %15)
%17 = load i64, i64* %3
%18 = icmp ugt i64 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %11
%20 = load i32, i32* @stderr
%21 = call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %22
22: ; preds = %19, %11
br label %7
23: ; preds = %7
%24 = load i32, i32* @stderr
%25 = call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [2 x i8] c"[\00"
@.str.1 = [4 x i8] c"%ld\00"
@.str.2 = [2 x i8] c" \00"
@.str.3 = [2 x i8] c"]\00"
define void @print_n_size_t(i64 %0, i64* nocapture %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %0, 0
br i1 %5, label %23, label %6
6: ; preds = %2
%7 = add i64 %0, -1
%8 = load i32, i32* @stderr
%9 = load i64, i64* %1
%10 = tail call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 %9)
%11 = icmp eq i64 %7, 0
br i1 %11, label %23, label %12
12: ; preds = %6, %12
%13 = phi i64 [ %18, %12 ], [ %7, %6 ]
%14 = phi i64* [ %15, %12 ], [ %1, %6 ]
%15 = getelementptr inbounds i64, i64* %14, i64 1
%16 = load i32, i32* @stderr
%17 = tail call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%18 = add i64 %13, -1
%19 = load i32, i32* @stderr
%20 = load i64, i64* %15
%21 = tail call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 %20)
%22 = icmp eq i64 %18, 0
br i1 %22, label %23, label %12
23: ; preds = %12, %6, %2
%24 = load i32, i32* @stderr
%25 = tail call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret void
}