#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_closefile();
int /*<<< orphan*/ io_openfile(int /*<<< orphan*/);
int /*<<< orphan*/ io_print(char *, ...);
int /*<<< orphan*/ path_join(int /*<<< orphan*/, int /*<<< orphan*/, char *);
int /*<<< orphan*/ prj_get_cfgname();
int /*<<< orphan*/ prj_get_name();
int prj_get_numconfigs();
int prj_get_numpackages();
int /*<<< orphan*/ prj_get_path();
char *prj_get_pkgfilename(char *);
int /*<<< orphan*/ prj_get_pkgname();
int /*<<< orphan*/ prj_select_config(int);
int /*<<< orphan*/ prj_select_package(int);
int /*<<< orphan*/ xmlEscape(int /*<<< orphan*/);
int writeCombine() {
  const char *path;
  int i, j;
  if (!io_openfile(path_join(prj_get_path(), prj_get_name(), "mds")))
    return 0;
  io_print("<Combine name=\"%s\" fileversion=\"2.0\">\n", prj_get_name());
  prj_select_package(0);
  prj_select_config(0);
  io_print("  <Configurations active=\"%s\">\n", xmlEscape(prj_get_cfgname()));
  for (i = 0; i < prj_get_numconfigs(); ++i) {
    prj_select_config(i);
    io_print("    <Configuration name=\"%s\" ctype=\"CombineConfiguration\">\n",
             xmlEscape(prj_get_cfgname()));
    prj_select_config(0);
    for (j = 0; j < prj_get_numpackages(); j++) {
      prj_select_package(j);
      io_print(
          "      <Entry build=\"True\" name=\"%s\" configuration=\"%s\" />\n",
          prj_get_pkgname(), xmlEscape(prj_get_cfgname()));
    }
    io_print("    </Configuration>\n");
  }
  io_print("  </Configurations>\n");
  prj_select_package(0);
  io_print("  <StartMode startupentry=\"%s\" single=\"True\">\n",
           prj_get_pkgname());
  for (i = 0; i < prj_get_numpackages(); ++i) {
    prj_select_package(i);
    io_print("    <Execute type=\"None\" entry=\"%s\" />\n", prj_get_pkgname());
  }
  io_print("  </StartMode>\n");
  io_print("  <Entries>\n");
  for (i = 0; i < prj_get_numpackages(); ++i) {
    prj_select_package(i);
    path = prj_get_pkgfilename("mdp");
    io_print("    <Entry filename=\"");
    if (path[0] != '.')
      io_print("./");
    io_print("%s\" />\n", path);
  }
  io_print("  </Entries>\n");
  io_print("</Combine>");
  io_closefile();
  return 1;
}


x86 assembly (clang, -O0):
<writeCombine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    $0x0,%al
call   1030 <prj_get_path@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1060 <prj_get_name@plt>
mov    -0x1c(%rbp),%edi
mov    %eax,%esi
lea    0xdfb(%rip),%rdx
call   1090 <path_join@plt>
mov    %eax,%edi
call   1050 <io_openfile@plt>
cmp    $0x0,%eax
jne    1226 <writeCombine+0x46>
movl   $0x0,-0x4(%rbp)
jmp    147a <writeCombine+0x29a>
mov    $0x0,%al
call   1060 <prj_get_name@plt>
mov    %eax,%esi
lea    0xdce(%rip),%rdi
mov    $0x0,%al
call   1070 <io_print@plt>
xor    %edi,%edi
call   10e0 <prj_select_package@plt>
xor    %edi,%edi
call   10d0 <prj_select_config@plt>
mov    $0x0,%al
call   10f0 <prj_get_cfgname@plt>
mov    %eax,%edi
call   1100 <xmlEscape@plt>
mov    %eax,%esi
lea    0xdc9(%rip),%rdi
mov    $0x0,%al
call   1070 <io_print@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    $0x0,%al
call   10c0 <prj_get_numconfigs@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
cmp    %ecx,%eax
jge    1335 <writeCombine+0x155>
mov    -0x14(%rbp),%edi
call   10d0 <prj_select_config@plt>
mov    $0x0,%al
call   10f0 <prj_get_cfgname@plt>
mov    %eax,%edi
call   1100 <xmlEscape@plt>
mov    %eax,%esi
lea    0xda2(%rip),%rdi
mov    $0x0,%al
call   1070 <io_print@plt>
xor    %edi,%edi
call   10d0 <prj_select_config@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    $0x0,%al
call   1080 <prj_get_numpackages@plt>
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
cmp    %ecx,%eax
jge    1319 <writeCombine+0x139>
mov    -0x18(%rbp),%edi
call   10e0 <prj_select_package@plt>
mov    $0x0,%al
call   10a0 <prj_get_pkgname@plt>
mov    %eax,-0x28(%rbp)
mov    $0x0,%al
call   10f0 <prj_get_cfgname@plt>
mov    %eax,%edi
call   1100 <xmlEscape@plt>
mov    -0x28(%rbp),%esi
mov    %eax,%edx
lea    0xd83(%rip),%rdi
mov    $0x0,%al
call   1070 <io_print@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    12be <writeCombine+0xde>
lea    0xda2(%rip),%rdi
mov    $0x0,%al
call   1070 <io_print@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1270 <writeCombine+0x90>
lea    0xd9c(%rip),%rdi
mov    $0x0,%al
call   1070 <io_print@plt>
xor    %edi,%edi
call   10e0 <prj_select_package@plt>
mov    $0x0,%al
call   10a0 <prj_get_pkgname@plt>
mov    %eax,%esi
lea    0xd93(%rip),%rdi
mov    $0x0,%al
call   1070 <io_print@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    $0x0,%al
call   1080 <prj_get_numpackages@plt>
mov    %eax,%ecx
mov    -0x2c(%rbp),%eax
cmp    %ecx,%eax
jge    13af <writeCombine+0x1cf>
mov    -0x14(%rbp),%edi
call   10e0 <prj_select_package@plt>
mov    $0x0,%al
call   10a0 <prj_get_pkgname@plt>
mov    %eax,%esi
lea    0xd82(%rip),%rdi
mov    $0x0,%al
call   1070 <io_print@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1368 <writeCombine+0x188>
lea    0xd8e(%rip),%rdi
mov    $0x0,%al
call   1070 <io_print@plt>
lea    0xd90(%rip),%rdi
mov    $0x0,%al
call   1070 <io_print@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    $0x0,%al
call   1080 <prj_get_numpackages@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%eax
cmp    %ecx,%eax
jge    1450 <writeCombine+0x270>
mov    -0x14(%rbp),%edi
call   10e0 <prj_select_package@plt>
lea    0xd66(%rip),%rdi
call   10b0 <prj_get_pkgfilename@plt>
mov    %rax,-0x10(%rbp)
lea    0xd5a(%rip),%rdi
mov    $0x0,%al
call   1070 <io_print@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
je     1430 <writeCombine+0x250>
lea    0xd52(%rip),%rdi
mov    $0x0,%al
call   1070 <io_print@plt>
mov    -0x10(%rbp),%rsi
lea    0xc7f(%rip),%rdi
mov    $0x0,%al
call   1070 <io_print@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    13d2 <writeCombine+0x1f2>
lea    0xd27(%rip),%rdi
mov    $0x0,%al
call   1070 <io_print@plt>
lea    0xd27(%rip),%rdi
mov    $0x0,%al
call   1070 <io_print@plt>
mov    $0x0,%al
call   1040 <io_closefile@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeCombine>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <prj_get_path@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1060 <prj_get_name@plt>
lea    0xdfc(%rip),%rdx
mov    %ebp,%edi
mov    %eax,%esi
call   1090 <path_join@plt>
mov    %eax,%edi
call   1050 <io_openfile@plt>
test   %eax,%eax
je     1440 <writeCombine+0x260>
xor    %eax,%eax
call   1060 <prj_get_name@plt>
lea    0xdda(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <io_print@plt>
xor    %edi,%edi
call   10e0 <prj_select_package@plt>
xor    %edi,%edi
call   10d0 <prj_select_config@plt>
xor    %eax,%eax
call   10f0 <prj_get_cfgname@plt>
mov    %eax,%edi
call   1100 <xmlEscape@plt>
lea    0xdd5(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <io_print@plt>
xor    %eax,%eax
call   10c0 <prj_get_numconfigs@plt>
test   %eax,%eax
jle    131f <writeCombine+0x13f>
lea    0xdd6(%rip),%r14
lea    0xe0b(%rip),%r13
lea    0xe3f(%rip),%r15
xor    %r12d,%r12d
jmp    12aa <writeCombine+0xca>
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
xor    %eax,%eax
call   1070 <io_print@plt>
add    $0x1,%r12d
xor    %eax,%eax
call   10c0 <prj_get_numconfigs@plt>
cmp    %eax,%r12d
jge    131f <writeCombine+0x13f>
mov    %r12d,%edi
call   10d0 <prj_select_config@plt>
xor    %eax,%eax
call   10f0 <prj_get_cfgname@plt>
mov    %eax,%edi
call   1100 <xmlEscape@plt>
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <io_print@plt>
xor    %edi,%edi
call   10d0 <prj_select_config@plt>
xor    %eax,%eax
call   1080 <prj_get_numpackages@plt>
test   %eax,%eax
jle    1290 <writeCombine+0xb0>
xor    %ebp,%ebp
mov    %ebp,%edi
call   10e0 <prj_select_package@plt>
xor    %eax,%eax
call   10a0 <prj_get_pkgname@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   10f0 <prj_get_cfgname@plt>
mov    %eax,%edi
call   1100 <xmlEscape@plt>
mov    %r13,%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1070 <io_print@plt>
add    $0x1,%ebp
xor    %eax,%eax
call   1080 <prj_get_numpackages@plt>
cmp    %eax,%ebp
jl     12e0 <writeCombine+0x100>
jmp    1290 <writeCombine+0xb0>
lea    0xdb2(%rip),%rdi
xor    %eax,%eax
call   1070 <io_print@plt>
xor    %edi,%edi
call   10e0 <prj_select_package@plt>
xor    %eax,%eax
call   10a0 <prj_get_pkgname@plt>
lea    0xdab(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <io_print@plt>
xor    %eax,%eax
call   1080 <prj_get_numpackages@plt>
test   %eax,%eax
jle    1388 <writeCombine+0x1a8>
lea    0xdbf(%rip),%rbx
xor    %ebp,%ebp
nop
mov    %ebp,%edi
call   10e0 <prj_select_package@plt>
xor    %eax,%eax
call   10a0 <prj_get_pkgname@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <io_print@plt>
add    $0x1,%ebp
xor    %eax,%eax
call   1080 <prj_get_numpackages@plt>
cmp    %eax,%ebp
jl     1360 <writeCombine+0x180>
lea    0xdb5(%rip),%rdi
xor    %eax,%eax
call   1070 <io_print@plt>
lea    0xdb7(%rip),%rdi
xor    %eax,%eax
call   1070 <io_print@plt>
xor    %eax,%eax
call   1080 <prj_get_numpackages@plt>
test   %eax,%eax
jle    1418 <writeCombine+0x238>
lea    0xdab(%rip),%r14
lea    0xda8(%rip),%r12
lea    0xcf6(%rip),%r13
lea    0xdb0(%rip),%r15
xor    %ebp,%ebp
jmp    13eb <writeCombine+0x20b>
nop
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <io_print@plt>
add    $0x1,%ebp
xor    %eax,%eax
call   1080 <prj_get_numpackages@plt>
cmp    %eax,%ebp
jge    1418 <writeCombine+0x238>
mov    %ebp,%edi
call   10e0 <prj_select_package@plt>
mov    %r14,%rdi
call   10b0 <prj_get_pkgfilename@plt>
mov    %rax,%rbx
mov    %r12,%rdi
xor    %eax,%eax
call   1070 <io_print@plt>
cmpb   $0x2e,(%rbx)
je     13d0 <writeCombine+0x1f0>
mov    %r15,%rdi
xor    %eax,%eax
call   1070 <io_print@plt>
jmp    13d0 <writeCombine+0x1f0>
lea    0xd5f(%rip),%rdi
xor    %eax,%eax
call   1070 <io_print@plt>
lea    0xd5f(%rip),%rdi
xor    %eax,%eax
call   1070 <io_print@plt>
xor    %eax,%eax
call   1040 <io_closefile@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"mds\00"
@.str.1 = [39 x i8] c"<Combine name=\22%s\22 fileversion=\222.0\22>\0A\00"
@.str.2 = [32 x i8] c" <Configurations active=\22%s\22>\0A\00"
@.str.3 = [60 x i8] c" <Configuration name=\22%s\22 ctype=\22CombineConfiguration\22>\0A\00"
@.str.4 = [59 x i8] c" <Entry build=\22True\22 name=\22%s\22 configuration=\22%s\22 />\0A\00"
@.str.5 = [22 x i8] c" </Configuration>\0A\00"
@.str.6 = [21 x i8] c" </Configurations>\0A\00"
@.str.7 = [47 x i8] c" <StartMode startupentry=\22%s\22 single=\22True\22>\0A\00"
@.str.8 = [40 x i8] c" <Execute type=\22None\22 entry=\22%s\22 />\0A\00"
@.str.9 = [16 x i8] c" </StartMode>\0A\00"
@.str.10 = [13 x i8] c" <Entries>\0A\00"
@.str.11 = [4 x i8] c"mdp\00"
@.str.12 = [22 x i8] c" <Entry filename=\22\00"
@.str.13 = [3 x i8] c"./\00"
@.str.14 = [8 x i8] c"%s\22 />\0A\00"
@.str.15 = [14 x i8] c" </Entries>\0A\00"
@.str.16 = [11 x i8] c"</Combine>\00"
define i32 @writeCombine() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = call i32 (...) @prj_get_path()
%6 = call i32 (...) @prj_get_name()
%7 = call i32 @path_join(i32 %5, i32 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @io_openfile(i32 %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %0
store i32 0, i32* %1
br label %95
11: ; preds = %0
%12 = call i32 (...) @prj_get_name()
%13 = call i32 (i8*, ...) @io_print(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = call i32 @prj_select_package(i32 0)
%15 = call i32 @prj_select_config(i32 0)
%16 = call i32 (...) @prj_get_cfgname()
%17 = call i32 @xmlEscape(i32 %16)
%18 = call i32 (i8*, ...) @io_print(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %17)
store i32 0, i32* %3
br label %19
19: ; preds = %46, %11
%20 = load i32, i32* %3
%21 = call i32 (...) @prj_get_numconfigs()
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %49
23: ; preds = %19
%24 = load i32, i32* %3
%25 = call i32 @prj_select_config(i32 %24)
%26 = call i32 (...) @prj_get_cfgname()
%27 = call i32 @xmlEscape(i32 %26)
%28 = call i32 (i8*, ...) @io_print(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.3, i64 0, i64 0), i32 %27)
%29 = call i32 @prj_select_config(i32 0)
store i32 0, i32* %4
br label %30
30: ; preds = %41, %23
%31 = load i32, i32* %4
%32 = call i32 (...) @prj_get_numpackages()
%33 = icmp slt i32 %31, %32
br i1 %33, label %34, label %44
34: ; preds = %30
%35 = load i32, i32* %4
%36 = call i32 @prj_select_package(i32 %35)
%37 = call i32 (...) @prj_get_pkgname()
%38 = call i32 (...) @prj_get_cfgname()
%39 = call i32 @xmlEscape(i32 %38)
%40 = call i32 (i8*, ...) @io_print(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.4, i64 0, i64 0), i32 %37, i32 %39)
br label %41
41: ; preds = %34
%42 = load i32, i32* %4
%43 = add nsw i32 %42, 1
store i32 %43, i32* %4
br label %30
44: ; preds = %30
%45 = call i32 (i8*, ...) @io_print(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
br label %46
46: ; preds = %44
%47 = load i32, i32* %3
%48 = add nsw i32 %47, 1
store i32 %48, i32* %3
br label %19
49: ; preds = %19
%50 = call i32 (i8*, ...) @io_print(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0))
%51 = call i32 @prj_select_package(i32 0)
%52 = call i32 (...) @prj_get_pkgname()
%53 = call i32 (i8*, ...) @io_print(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.7, i64 0, i64 0), i32 %52)
store i32 0, i32* %3
br label %54
54: ; preds = %63, %49
%55 = load i32, i32* %3
%56 = call i32 (...) @prj_get_numpackages()
%57 = icmp slt i32 %55, %56
br i1 %57, label %58, label %66
58: ; preds = %54
%59 = load i32, i32* %3
%60 = call i32 @prj_select_package(i32 %59)
%61 = call i32 (...) @prj_get_pkgname()
%62 = call i32 (i8*, ...) @io_print(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.8, i64 0, i64 0), i32 %61)
br label %63
63: ; preds = %58
%64 = load i32, i32* %3
%65 = add nsw i32 %64, 1
store i32 %65, i32* %3
br label %54
66: ; preds = %54
%67 = call i32 (i8*, ...) @io_print(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0))
%68 = call i32 (i8*, ...) @io_print(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0))
store i32 0, i32* %3
br label %69
69: ; preds = %88, %66
%70 = load i32, i32* %3
%71 = call i32 (...) @prj_get_numpackages()
%72 = icmp slt i32 %70, %71
br i1 %72, label %73, label %91
73: ; preds = %69
%74 = load i32, i32* %3
%75 = call i32 @prj_select_package(i32 %74)
%76 = call i8* @prj_get_pkgfilename(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
store i8* %76, i8** %2
%77 = call i32 (i8*, ...) @io_print(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.12, i64 0, i64 0))
%78 = load i8*, i8** %2
%79 = getelementptr inbounds i8, i8* %78, i64 0
%80 = load i8, i8* %79
%81 = sext i8 %80 to i32
%82 = icmp ne i32 %81, 46
br i1 %82, label %83, label %85
83: ; preds = %73
%84 = call i32 (i8*, ...) @io_print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
br label %85
85: ; preds = %83, %73
%86 = load i8*, i8** %2
%87 = call i32 (i8*, ...) @io_print(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0), i8* %86)
br label %88
88: ; preds = %85
%89 = load i32, i32* %3
%90 = add nsw i32 %89, 1
store i32 %90, i32* %3
br label %69
91: ; preds = %69
%92 = call i32 (i8*, ...) @io_print(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.15, i64 0, i64 0))
%93 = call i32 (i8*, ...) @io_print(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.16, i64 0, i64 0))
%94 = call i32 (...) @io_closefile()
store i32 1, i32* %1
br label %95
95: ; preds = %91, %10
%96 = load i32, i32* %1
ret i32 %96
}

LLVM IR (-O2):
@.str = [4 x i8] c"mds\00"
@.str.1 = [39 x i8] c"<Combine name=\22%s\22 fileversion=\222.0\22>\0A\00"
@.str.2 = [32 x i8] c" <Configurations active=\22%s\22>\0A\00"
@.str.3 = [60 x i8] c" <Configuration name=\22%s\22 ctype=\22CombineConfiguration\22>\0A\00"
@.str.4 = [59 x i8] c" <Entry build=\22True\22 name=\22%s\22 configuration=\22%s\22 />\0A\00"
@.str.5 = [22 x i8] c" </Configuration>\0A\00"
@.str.6 = [21 x i8] c" </Configurations>\0A\00"
@.str.7 = [47 x i8] c" <StartMode startupentry=\22%s\22 single=\22True\22>\0A\00"
@.str.8 = [40 x i8] c" <Execute type=\22None\22 entry=\22%s\22 />\0A\00"
@.str.9 = [16 x i8] c" </StartMode>\0A\00"
@.str.10 = [13 x i8] c" <Entries>\0A\00"
@.str.11 = [4 x i8] c"mdp\00"
@.str.12 = [22 x i8] c" <Entry filename=\22\00"
@.str.13 = [3 x i8] c"./\00"
@.str.14 = [8 x i8] c"%s\22 />\0A\00"
@.str.15 = [14 x i8] c" </Entries>\0A\00"
@.str.16 = [11 x i8] c"</Combine>\00"
define i32 @writeCombine() {
%1 = tail call i32 (...) @prj_get_path()
%2 = tail call i32 (...) @prj_get_name()
%3 = tail call i32 @path_join(i32 %1, i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @io_openfile(i32 %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %78, label %6
6: ; preds = %0
%7 = tail call i32 (...) @prj_get_name()
%8 = tail call i32 (i8*, ...) @io_print(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = tail call i32 @prj_select_package(i32 0)
%10 = tail call i32 @prj_select_config(i32 0)
%11 = tail call i32 (...) @prj_get_cfgname()
%12 = tail call i32 @xmlEscape(i32 %11)
%13 = tail call i32 (i8*, ...) @io_print(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %12)
%14 = tail call i32 (...) @prj_get_numconfigs()
%15 = icmp sgt i32 %14, 0
br i1 %15, label %16, label %40
16: ; preds = %6, %35
%17 = phi i32 [ %37, %35 ], [ 0, %6 ]
%18 = tail call i32 @prj_select_config(i32 %17)
%19 = tail call i32 (...) @prj_get_cfgname()
%20 = tail call i32 @xmlEscape(i32 %19)
%21 = tail call i32 (i8*, ...) @io_print(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.3, i64 0, i64 0), i32 %20)
%22 = tail call i32 @prj_select_config(i32 0)
%23 = tail call i32 (...) @prj_get_numpackages()
%24 = icmp sgt i32 %23, 0
br i1 %24, label %25, label %35
25: ; preds = %16, %25
%26 = phi i32 [ %32, %25 ], [ 0, %16 ]
%27 = tail call i32 @prj_select_package(i32 %26)
%28 = tail call i32 (...) @prj_get_pkgname()
%29 = tail call i32 (...) @prj_get_cfgname()
%30 = tail call i32 @xmlEscape(i32 %29)
%31 = tail call i32 (i8*, ...) @io_print(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.4, i64 0, i64 0), i32 %28, i32 %30)
%32 = add nuw nsw i32 %26, 1
%33 = tail call i32 (...) @prj_get_numpackages()
%34 = icmp slt i32 %32, %33
br i1 %34, label %25, label %35
35: ; preds = %25, %16
%36 = tail call i32 (i8*, ...) @io_print(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
%37 = add nuw nsw i32 %17, 1
%38 = tail call i32 (...) @prj_get_numconfigs()
%39 = icmp slt i32 %37, %38
br i1 %39, label %16, label %40
40: ; preds = %35, %6
%41 = tail call i32 (i8*, ...) @io_print(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0))
%42 = tail call i32 @prj_select_package(i32 0)
%43 = tail call i32 (...) @prj_get_pkgname()
%44 = tail call i32 (i8*, ...) @io_print(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.7, i64 0, i64 0), i32 %43)
%45 = tail call i32 (...) @prj_get_numpackages()
%46 = icmp sgt i32 %45, 0
br i1 %46, label %47, label %55
47: ; preds = %40, %47
%48 = phi i32 [ %52, %47 ], [ 0, %40 ]
%49 = tail call i32 @prj_select_package(i32 %48)
%50 = tail call i32 (...) @prj_get_pkgname()
%51 = tail call i32 (i8*, ...) @io_print(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.8, i64 0, i64 0), i32 %50)
%52 = add nuw nsw i32 %48, 1
%53 = tail call i32 (...) @prj_get_numpackages()
%54 = icmp slt i32 %52, %53
br i1 %54, label %47, label %55
55: ; preds = %47, %40
%56 = tail call i32 (i8*, ...) @io_print(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0))
%57 = tail call i32 (i8*, ...) @io_print(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0))
%58 = tail call i32 (...) @prj_get_numpackages()
%59 = icmp sgt i32 %58, 0
br i1 %59, label %60, label %74
60: ; preds = %55, %69
%61 = phi i32 [ %71, %69 ], [ 0, %55 ]
%62 = tail call i32 @prj_select_package(i32 %61)
%63 = tail call i8* @prj_get_pkgfilename(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
%64 = tail call i32 (i8*, ...) @io_print(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.12, i64 0, i64 0))
%65 = load i8, i8* %63
%66 = icmp eq i8 %65, 46
br i1 %66, label %69, label %67
67: ; preds = %60
%68 = tail call i32 (i8*, ...) @io_print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
br label %69
69: ; preds = %67, %60
%70 = tail call i32 (i8*, ...) @io_print(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0), i8* %63)
%71 = add nuw nsw i32 %61, 1
%72 = tail call i32 (...) @prj_get_numpackages()
%73 = icmp slt i32 %71, %72
br i1 %73, label %60, label %74
74: ; preds = %69, %55
%75 = tail call i32 (i8*, ...) @io_print(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.15, i64 0, i64 0))
%76 = tail call i32 (i8*, ...) @io_print(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.16, i64 0, i64 0))
%77 = tail call i32 (...) @io_closefile()
br label %78
78: ; preds = %0, %74
%79 = phi i32 [ 1, %74 ], [ 0, %0 ]
ret i32 %79
}