#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 print_target_indices(const char *prefix, const int *pData) {
  int i, first = 1;
  for (i = 1; i <= pData[0]; i++) {
    if (!first) {
      printf(", ");
    }
    first = 0;
    printf("%s-%d", prefix, pData[i]);
  }
}


x86 assembly (clang, -O0):
<print_target_indices>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x18(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jg     1187 <print_target_indices+0x77>
cmpl   $0x0,-0x18(%rbp)
jne    1155 <print_target_indices+0x45>
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112e <print_target_indices+0x1e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_target_indices>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
cmpl   $0x0,(%rsi)
jle    1189 <print_target_indices+0x79>
mov    %rsi,%r13
mov    %rdi,%r14
mov    0x4(%rsi),%edx
lea    0xed5(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
cmpl   $0x2,0x0(%r13)
jl     1189 <print_target_indices+0x79>
mov    $0x1,%ebx
lea    0xeb5(%rip),%r15
lea    0xeb1(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%r13,%rbx,4),%edx
mov    %r12,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
movslq 0x0(%r13),%rax
add    $0x1,%rbx
cmp    %rax,%rbx
jl     1160 <print_target_indices+0x50>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

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