#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*/ inc_arr(int *, int);
int /*<<< orphan*/ printChar(char);
int /*<<< orphan*/ printInt(int);
void print_arr(int arr[], int len) {
  int i;
  printInt(len);
  printChar('\n');
  inc_arr(arr, len);
  for (i = 0; i < len; i++) {
    printInt(arr[i]);
    printChar(' ');
  }
}


x86 assembly (clang, -O0):
<print_arr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <printInt@plt>
mov    $0xa,%edi
call   1050 <printChar@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <inc_arr@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1198 <print_arr+0x68>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <printInt@plt>
mov    $0x20,%edi
call   1050 <printChar@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1164 <print_arr+0x34>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_arr>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%edi
call   1030 <printInt@plt>
mov    $0xa,%edi
call   1050 <printChar@plt>
mov    %r14,%rdi
mov    %ebp,%esi
call   1040 <inc_arr@plt>
test   %ebp,%ebp
jle    117c <print_arr+0x4c>
mov    %ebp,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r14,%rbx,4),%edi
call   1030 <printInt@plt>
mov    $0x20,%edi
call   1050 <printChar@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1160 <print_arr+0x30>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @print_arr(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i32 @printInt(i32 %6)
%8 = call i32 @printChar(i8 signext 10)
%9 = load i32*, i32** %3
%10 = load i32, i32* %4
%11 = call i32 @inc_arr(i32* %9, i32 %10)
store i32 0, i32* %5
br label %12
12: ; preds = %24, %2
%13 = load i32, i32* %5
%14 = load i32, i32* %4
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %27
16: ; preds = %12
%17 = load i32*, i32** %3
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %17, i64 %19
%21 = load i32, i32* %20
%22 = call i32 @printInt(i32 %21)
%23 = call i32 @printChar(i8 signext 32)
br label %24
24: ; preds = %16
%25 = load i32, i32* %5
%26 = add nsw i32 %25, 1
store i32 %26, i32* %5
br label %12
27: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @print_arr(i32* %0, i32 %1) {
%3 = tail call i32 @printInt(i32 %1)
%4 = tail call i32 @printChar(i8 signext 10)
%5 = tail call i32 @inc_arr(i32* %0, i32 %1)
%6 = icmp sgt i32 %1, 0
br i1 %6, label %7, label %17
7: ; preds = %2
%8 = zext i32 %1 to i64
br label %9
9: ; preds = %7, %9
%10 = phi i64 [ 0, %7 ], [ %15, %9 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = tail call i32 @printInt(i32 %12)
%14 = tail call i32 @printChar(i8 signext 32)
%15 = add nuw nsw i64 %10, 1
%16 = icmp eq i64 %15, %8
br i1 %16, label %17, label %9
17: ; preds = %9, %2
ret void
}