#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*/ io_print(char *, char const *);
scalar_t__ matches(int /*<<< orphan*/, char const *);
int prj_get_numpackages();
int /*<<< orphan*/ prj_get_pkgname_for(int);
const char *printProjectDependencies(const char *name) {
  int i;
  for (i = 0; i < prj_get_numpackages(); ++i) {
    if (matches(prj_get_pkgname_for(i), name)) {
      io_print("    <Project Name=\"%s\"/>\n", name);
    }
  }
  return NULL;
}


x86 assembly (clang, -O0):
<printProjectDependencies>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <prj_get_numpackages@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    11ad <printProjectDependencies+0x6d>
mov    -0xc(%rbp),%edi
call   1050 <prj_get_pkgname_for@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1030 <matches@plt>
cmp    $0x0,%rax
je     119a <printProjectDependencies+0x5a>
mov    -0x8(%rbp),%rsi
lea    0xe6b(%rip),%rdi
call   1040 <io_print@plt>
jmp    119f <printProjectDependencies+0x5f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1153 <printProjectDependencies+0x13>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printProjectDependencies>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1060 <prj_get_numpackages@plt>
test   %eax,%eax
jle    1191 <printProjectDependencies+0x51>
lea    0xea7(%rip),%r14
xor    %ebp,%ebp
jmp    116e <printProjectDependencies+0x2e>
nopl   (%rax)
add    $0x1,%ebp
xor    %eax,%eax
call   1060 <prj_get_numpackages@plt>
cmp    %eax,%ebp
jge    1191 <printProjectDependencies+0x51>
mov    %ebp,%edi
call   1050 <prj_get_pkgname_for@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1030 <matches@plt>
test   %rax,%rax
je     1160 <printProjectDependencies+0x20>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <io_print@plt>
jmp    1160 <printProjectDependencies+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [26 x i8] c" <Project Name=\22%s\22/>\0A\00"
define i8* @printProjectDependencies(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %18, %1
%5 = load i32, i32* %3
%6 = call i32 (...) @prj_get_numpackages()
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %21
8: ; preds = %4
%9 = load i32, i32* %3
%10 = call i32 @prj_get_pkgname_for(i32 %9)
%11 = load i8*, i8** %2
%12 = call i64 @matches(i32 %10, i8* %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %8
%15 = load i8*, i8** %2
%16 = call i32 @io_print(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %15)
br label %17
17: ; preds = %14, %8
br label %18
18: ; preds = %17
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %4
21: ; preds = %4
ret i8* null
}

LLVM IR (-O2):
@.str = [26 x i8] c" <Project Name=\22%s\22/>\0A\00"
define noalias i8* @printProjectDependencies(i8* %0) {
%2 = tail call i32 (...) @prj_get_numpackages()
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %15
4: ; preds = %1, %11
%5 = phi i32 [ %12, %11 ], [ 0, %1 ]
%6 = tail call i32 @prj_get_pkgname_for(i32 %5)
%7 = tail call i64 @matches(i32 %6, i8* %0)
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %4
%10 = tail call i32 @io_print(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %11
11: ; preds = %4, %9
%12 = add nuw nsw i32 %5, 1
%13 = tail call i32 (...) @prj_get_numpackages()
%14 = icmp slt i32 %12, %13
br i1 %14, label %4, label %15
15: ; preds = %11, %1
ret i8* null
}