#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*/ printf(char *, ...);
void dispArray(int *target, int index, int frgBreak) {
  if (index == 0) {
    if (frgBreak) {
      printf("\n");
    }
    return;
  } else {
    printf("%d", *target);
    dispArray(++target, --index, 0);
  }
}


x86 assembly (clang, -O0):
<dispArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1159 <dispArray+0x39>
cmpl   $0x0,-0x10(%rbp)
je     1154 <dispArray+0x34>
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1189 <dispArray+0x69>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
add    $0x4,%rdi
mov    %rdi,-0x8(%rbp)
mov    -0xc(%rbp),%esi
add    $0xffffffff,%esi
mov    %esi,-0xc(%rbp)
xor    %edx,%edx
call   1030 <dispArray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dispArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
je     1163 <dispArray+0x43>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %ebx,%r12d
jne    1140 <dispArray+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
test   %edx,%edx
je     1157 <dispArray+0x37>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
define void @dispArray(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %5, label %9
5: ; preds = %3
%6 = icmp eq i32 %2, 0
br i1 %6, label %17, label %7
7: ; preds = %5
%8 = tail call i32 @putchar(i32 10)
br label %17
9: ; preds = %3, %9
%10 = phi i32 [ %15, %9 ], [ %1, %3 ]
%11 = phi i32* [ %14, %9 ], [ %0, %3 ]
%12 = load i32, i32* %11
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = getelementptr inbounds i32, i32* %11, i64 1
%15 = add nsw i32 %10, -1
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %9
17: ; preds = %9, %5, %7
ret void
}