#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*/ errno;
int fs_append_file(char *, char *, ...);
int fs_create_file(char *, char *);
int /*<<< orphan*/ log_debug(char *, char *, ...);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
int strlen(char *);
int create_phpunitxml(char *sources[], int sources_length, char *tests[],
                      int tests_length, char *files[], int files_length,
                      char *cwd) {
  int result = 0;
  int i, j;
  log_debug("Creating file %s/%s\n", cwd, "phpunit.xml");
  result |= fs_create_file(
      "phpunit.xml",
      "<phpunit xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
      "xsi:noNamespaceSchemaLocation=\"http://schema.phpunit.de/5.4/"
      "phpunit.xsd\" colors=\"true\" backupGlobals=\"false\" "
      "bootstrap=\"autoload.php\">\n  <filter>\n    <whitelist "
      "addUncoveredFilesFromWhitelist=\"true\" "
      "processUncoveredFilesFromWhitelist=\"true\">\n");
  for (i = 0; i < sources_length; i++) {
    result |= fs_append_file(
        "phpunit.xml", "      <directory suffix=\".php\">%s</directory>\n",
        sources[i]);
  }
  result |= fs_append_file(
      "phpunit.xml", "    </whitelist>\n  </filter>\n\n  <logging>\n    <log "
                     "type=\"coverage-html\" target=\"coverage\"/>\n  "
                     "</logging>\n\n  <testsuites>\n");
  for (i = 0; i < files_length; i++) {
    if ((strlen(files[i]) >= 8 &&
         strcmp(files[i] + strlen(files[i]) - 8, "Test.php") != 0) &&
        (strlen(files[i]) >= 9 &&
         strcmp(files[i] + strlen(files[i]) - 9, "Test.php3") != 0) &&
        (strlen(files[i]) >= 9 &&
         strcmp(files[i] + strlen(files[i]) - 9, "Test.php4") != 0) &&
        (strlen(files[i]) >= 9 &&
         strcmp(files[i] + strlen(files[i]) - 9, "Test.php5") != 0) &&
        (strlen(files[i]) >= 10 &&
         strcmp(files[i] + strlen(files[i]) - 10, "Test.phtml") != 0)) {
      continue;
    }
    result |= fs_append_file(
        "phpunit.xml", "    <testsuite name=\"%s\">\n      <file>%s</file>\n",
        files[i], files[i]);
    for (j = 0; j < tests_length; j++) {
      result |= fs_append_file(
          "phpunit.xml",
          "      <directory suffix=\"Helper.php\">%s</directory>\n", tests[j]);
    }
    result |= fs_append_file("phpunit.xml", "    </testsuite>\n\n");
  }
  result |= fs_append_file("phpunit.xml", "  </testsuites>\n</phpunit>\n");
  if (-1 == result) {
    log_debug("Failed creating phpunit XML file: %s\n", strerror(errno));
  }
  return result;
}


x86 assembly (clang, -O0):
<create_phpunitxml>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
mov    0x10(%rbp),%rsi
lea    0xe6c(%rip),%rdi
lea    0xe7a(%rip),%rdx
mov    $0x0,%al
call   1050 <log_debug@plt>
lea    0xe6c(%rip),%rdi
lea    0xe71(%rip),%rsi
call   1070 <fs_create_file@plt>
or     -0x30(%rbp),%eax
mov    %eax,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1203 <create_phpunitxml+0xa3>
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xe34(%rip),%rdi
lea    0xf6b(%rip),%rsi
mov    $0x0,%al
call   1030 <fs_append_file@plt>
or     -0x30(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11c2 <create_phpunitxml+0x62>
lea    0xe0b(%rip),%rdi
lea    0xf71(%rip),%rsi
mov    $0x0,%al
call   1030 <fs_append_file@plt>
or     -0x30(%rbp),%eax
mov    %eax,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    14b0 <create_phpunitxml+0x350>
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <strlen@plt>
cmp    $0x8,%eax
jl     140c <create_phpunitxml+0x2ac>
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x40(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <strlen@plt>
mov    -0x40(%rbp),%rdi
cltq
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
lea    0xf7c(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     140c <create_phpunitxml+0x2ac>
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <strlen@plt>
cmp    $0x9,%eax
jl     140c <create_phpunitxml+0x2ac>
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x48(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <strlen@plt>
mov    -0x48(%rbp),%rdi
cltq
add    %rax,%rdi
add    $0xfffffffffffffff7,%rdi
lea    0xf27(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     140c <create_phpunitxml+0x2ac>
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <strlen@plt>
cmp    $0x9,%eax
jl     140c <create_phpunitxml+0x2ac>
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x50(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <strlen@plt>
mov    -0x50(%rbp),%rdi
cltq
add    %rax,%rdi
add    $0xfffffffffffffff7,%rdi
lea    0xed3(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     140c <create_phpunitxml+0x2ac>
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <strlen@plt>
cmp    $0x9,%eax
jl     140c <create_phpunitxml+0x2ac>
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x58(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <strlen@plt>
mov    -0x58(%rbp),%rdi
cltq
add    %rax,%rdi
add    $0xfffffffffffffff7,%rdi
lea    0xe7f(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     140c <create_phpunitxml+0x2ac>
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <strlen@plt>
cmp    $0xa,%eax
jl     140c <create_phpunitxml+0x2ac>
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x60(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <strlen@plt>
mov    -0x60(%rbp),%rdi
cltq
add    %rax,%rdi
add    $0xfffffffffffffff6,%rdi
lea    0xe2b(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     140c <create_phpunitxml+0x2ac>
jmp    14a2 <create_phpunitxml+0x342>
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
lea    0xbea(%rip),%rdi
lea    0xdfc(%rip),%rsi
mov    $0x0,%al
call   1030 <fs_append_file@plt>
or     -0x30(%rbp),%eax
mov    %eax,-0x30(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1487 <create_phpunitxml+0x327>
mov    -0x18(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xbb0(%rip),%rdi
lea    0xdf3(%rip),%rsi
mov    $0x0,%al
call   1030 <fs_append_file@plt>
or     -0x30(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1446 <create_phpunitxml+0x2e6>
lea    0xb87(%rip),%rdi
lea    0xdff(%rip),%rsi
mov    $0x0,%al
call   1030 <fs_append_file@plt>
or     -0x30(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1225 <create_phpunitxml+0xc5>
lea    0xb5e(%rip),%rdi
lea    0xde9(%rip),%rsi
mov    $0x0,%al
call   1030 <fs_append_file@plt>
or     -0x30(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    $0xffffffff,%eax
cmp    -0x30(%rbp),%eax
jne    14f8 <create_phpunitxml+0x398>
mov    0x2b00(%rip),%rax
mov    (%rax),%edi
call   1080 <strerror@plt>
movslq %eax,%rsi
lea    0xdd2(%rip),%rdi
mov    $0x0,%al
call   1050 <log_debug@plt>
mov    -0x30(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_phpunitxml>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r9d,%r14d
mov    %r8,0x8(%rsp)
mov    %ecx,0x4(%rsp)
mov    %rdx,%rbp
mov    %esi,%r15d
mov    %rdi,%r12
mov    0x60(%rsp),%rsi
lea    0xe71(%rip),%rdi
lea    0xe7f(%rip),%rbx
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <log_debug@plt>
lea    0xe7a(%rip),%rsi
mov    %rbx,%rdi
call   1070 <fs_create_file@plt>
mov    %eax,%ebx
test   %r15d,%r15d
mov    %rbp,0x10(%rsp)
mov    %r14d,%ebp
jle    11f0 <create_phpunitxml+0x90>
mov    %r15d,%r14d
lea    0xf8b(%rip),%r15
xor    %r13d,%r13d
nopl   0x0(%rax,%rax,1)
mov    (%r12,%r13,8),%rdx
lea    0xe3a(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <fs_append_file@plt>
or     %eax,%ebx
add    $0x1,%r13
cmp    %r13,%r14
jne    11d0 <create_phpunitxml+0x70>
lea    0xe1e(%rip),%rdi
lea    0xf84(%rip),%rsi
xor    %eax,%eax
call   1030 <fs_append_file@plt>
mov    %eax,%r14d
or     %ebx,%r14d
test   %ebp,%ebp
jle    13f5 <create_phpunitxml+0x295>
mov    %ebp,%eax
mov    %rax,0x18(%rsp)
mov    0x4(%rsp),%ebp
lea    0xdf0(%rip),%r12
xor    %r13d,%r13d
mov    0x8(%rsp),%r15
nopl   (%rax)
mov    (%r15,%r13,8),%rdi
call   1040 <strlen@plt>
cmp    $0x8,%eax
jl     1360 <create_phpunitxml+0x200>
mov    (%r15,%r13,8),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
cltq
lea    (%rbx,%rax,1),%rdi
add    $0xfffffffffffffff8,%rdi
lea    0xf9d(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1360 <create_phpunitxml+0x200>
mov    (%r15,%r13,8),%rdi
call   1040 <strlen@plt>
cmp    $0x9,%eax
jl     1360 <create_phpunitxml+0x200>
mov    (%r15,%r13,8),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
cltq
lea    (%rbx,%rax,1),%rdi
add    $0xfffffffffffffff7,%rdi
lea    0xf69(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1360 <create_phpunitxml+0x200>
mov    (%r15,%r13,8),%rdi
call   1040 <strlen@plt>
cmp    $0x9,%eax
jl     1360 <create_phpunitxml+0x200>
mov    (%r15,%r13,8),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
cltq
lea    (%rbx,%rax,1),%rdi
add    $0xfffffffffffffff7,%rdi
lea    0xf36(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1360 <create_phpunitxml+0x200>
mov    (%r15,%r13,8),%rdi
call   1040 <strlen@plt>
cmp    $0x9,%eax
jl     1360 <create_phpunitxml+0x200>
mov    (%r15,%r13,8),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
cltq
lea    (%rbx,%rax,1),%rdi
add    $0xfffffffffffffff7,%rdi
lea    0xf0b(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1360 <create_phpunitxml+0x200>
mov    (%r15,%r13,8),%rdi
call   1040 <strlen@plt>
cmp    $0xa,%eax
jl     1360 <create_phpunitxml+0x200>
mov    (%r15,%r13,8),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
cltq
lea    (%rbx,%rax,1),%rdi
add    $0xfffffffffffffff6,%rdi
lea    0xee0(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    13e6 <create_phpunitxml+0x286>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r15,%r13,8),%rcx
mov    %r12,%rdi
lea    0xec0(%rip),%rsi
mov    %rcx,%rdx
xor    %eax,%eax
call   1030 <fs_append_file@plt>
mov    %eax,%ebx
or     %r14d,%ebx
cmpl   $0x0,0x4(%rsp)
mov    %r13,0x20(%rsp)
jle    13c0 <create_phpunitxml+0x260>
xor    %r15d,%r15d
mov    %r12,%r14
lea    0xec9(%rip),%r12
mov    0x10(%rsp),%r13
nopl   0x0(%rax,%rax,1)
mov    0x0(%r13,%r15,8),%rdx
mov    %r14,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1030 <fs_append_file@plt>
or     %eax,%ebx
add    $0x1,%r15
cmp    %r15,%rbp
jne    13a0 <create_phpunitxml+0x240>
jmp    13c3 <create_phpunitxml+0x263>
nop
mov    %r12,%r14
mov    %r14,%rdi
lea    0xec7(%rip),%rsi
xor    %eax,%eax
call   1030 <fs_append_file@plt>
or     %ebx,%eax
mov    0x8(%rsp),%r15
mov    0x20(%rsp),%r13
mov    %r14,%r12
mov    %eax,%r14d
add    $0x1,%r13
cmp    0x18(%rsp),%r13
jne    1230 <create_phpunitxml+0xd0>
lea    0xc19(%rip),%rdi
lea    0xea4(%rip),%rsi
xor    %eax,%eax
call   1030 <fs_append_file@plt>
mov    %eax,%ebx
or     %r14d,%ebx
cmp    $0xffffffff,%ebx
jne    1433 <create_phpunitxml+0x2d3>
mov    0x2bc5(%rip),%rax
mov    (%rax),%edi
call   1080 <strerror@plt>
movslq %eax,%rsi
lea    0xe97(%rip),%rdi
xor    %eax,%eax
call   1050 <log_debug@plt>
mov    %ebx,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Creating file %s/%s\0A\00"
@.str.1 = [12 x i8] c"phpunit.xml\00"
@.str.2 = [306 x i8] c"<phpunit xmlns:xsi=\22http://www.w3.org/2001/XMLSchema-instance\22 xsi:noNamespaceSchemaLocation=\22http://schema.phpunit.de/5.4/phpunit.xsd\22 colors=\22true\22 backupGlobals=\22false\22 bootstrap=\22autoload.php\22>\0A <filter>\0A <whitelist addUncoveredFilesFromWhitelist=\22true\22 processUncoveredFilesFromWhitelist=\22true\22>\0A\00"
@.str.3 = [47 x i8] c" <directory suffix=\22.php\22>%s</directory>\0A\00"
@.str.4 = [122 x i8] c" </whitelist>\0A </filter>\0A\0A <logging>\0A <log type=\22coverage-html\22 target=\22coverage\22/>\0A </logging>\0A\0A <testsuites>\0A\00"
@.str.5 = [9 x i8] c"Test.php\00"
@.str.6 = [10 x i8] c"Test.php3\00"
@.str.7 = [10 x i8] c"Test.php4\00"
@.str.8 = [10 x i8] c"Test.php5\00"
@.str.9 = [11 x i8] c"Test.phtml\00"
@.str.10 = [49 x i8] c" <testsuite name=\22%s\22>\0A <file>%s</file>\0A\00"
@.str.11 = [53 x i8] c" <directory suffix=\22Helper.php\22>%s</directory>\0A\00"
@.str.12 = [19 x i8] c" </testsuite>\0A\0A\00"
@.str.13 = [28 x i8] c" </testsuites>\0A</phpunit>\0A\00"
@.str.14 = [38 x i8] c"Failed creating phpunit XML file: %s\0A\00"
@errno = global i32 0
define i32 @create_phpunitxml(i8** %0, i32 %1, i8** %2, i32 %3, i8** %4, i32 %5, i8* %6) {
%8 = alloca i8**
%9 = alloca i32
%10 = alloca i8**
%11 = alloca i32
%12 = alloca i8**
%13 = alloca i32
%14 = alloca i8*
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
store i8** %0, i8*** %8
store i32 %1, i32* %9
store i8** %2, i8*** %10
store i32 %3, i32* %11
store i8** %4, i8*** %12
store i32 %5, i32* %13
store i8* %6, i8** %14
store i32 0, i32* %15
%18 = load i8*, i8** %14
%19 = call i32 (i8*, i8*, ...) @log_debug(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %18, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%20 = call i32 @fs_create_file(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([306 x i8], [306 x i8]* @.str.2, i64 0, i64 0))
%21 = load i32, i32* %15
%22 = or i32 %21, %20
store i32 %22, i32* %15
store i32 0, i32* %16
br label %23
23: ; preds = %36, %7
%24 = load i32, i32* %16
%25 = load i32, i32* %9
%26 = icmp slt i32 %24, %25
br i1 %26, label %27, label %39
27: ; preds = %23
%28 = load i8**, i8*** %8
%29 = load i32, i32* %16
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8*, i8** %28, i64 %30
%32 = load i8*, i8** %31
%33 = call i32 (i8*, i8*, ...) @fs_append_file(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0), i8* %32)
%34 = load i32, i32* %15
%35 = or i32 %34, %33
store i32 %35, i32* %15
br label %36
36: ; preds = %27
%37 = load i32, i32* %16
%38 = add nsw i32 %37, 1
store i32 %38, i32* %16
br label %23
39: ; preds = %23
%40 = call i32 (i8*, i8*, ...) @fs_append_file(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([122 x i8], [122 x i8]* @.str.4, i64 0, i64 0))
%41 = load i32, i32* %15
%42 = or i32 %41, %40
store i32 %42, i32* %15
store i32 0, i32* %16
br label %43
43: ; preds = %207, %39
%44 = load i32, i32* %16
%45 = load i32, i32* %13
%46 = icmp slt i32 %44, %45
br i1 %46, label %47, label %210
47: ; preds = %43
%48 = load i8**, i8*** %12
%49 = load i32, i32* %16
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds i8*, i8** %48, i64 %50
%52 = load i8*, i8** %51
%53 = call i32 @strlen(i8* %52)
%54 = icmp sge i32 %53, 8
br i1 %54, label %55, label %173
55: ; preds = %47
%56 = load i8**, i8*** %12
%57 = load i32, i32* %16
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds i8*, i8** %56, i64 %58
%60 = load i8*, i8** %59
%61 = load i8**, i8*** %12
%62 = load i32, i32* %16
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds i8*, i8** %61, i64 %63
%65 = load i8*, i8** %64
%66 = call i32 @strlen(i8* %65)
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds i8, i8* %60, i64 %67
%69 = getelementptr inbounds i8, i8* %68, i64 -8
%70 = call i64 @strcmp(i8* %69, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
%71 = icmp ne i64 %70, 0
br i1 %71, label %72, label %173
72: ; preds = %55
%73 = load i8**, i8*** %12
%74 = load i32, i32* %16
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds i8*, i8** %73, i64 %75
%77 = load i8*, i8** %76
%78 = call i32 @strlen(i8* %77)
%79 = icmp sge i32 %78, 9
br i1 %79, label %80, label %173
80: ; preds = %72
%81 = load i8**, i8*** %12
%82 = load i32, i32* %16
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds i8*, i8** %81, i64 %83
%85 = load i8*, i8** %84
%86 = load i8**, i8*** %12
%87 = load i32, i32* %16
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds i8*, i8** %86, i64 %88
%90 = load i8*, i8** %89
%91 = call i32 @strlen(i8* %90)
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds i8, i8* %85, i64 %92
%94 = getelementptr inbounds i8, i8* %93, i64 -9
%95 = call i64 @strcmp(i8* %94, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%96 = icmp ne i64 %95, 0
br i1 %96, label %97, label %173
97: ; preds = %80
%98 = load i8**, i8*** %12
%99 = load i32, i32* %16
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds i8*, i8** %98, i64 %100
%102 = load i8*, i8** %101
%103 = call i32 @strlen(i8* %102)
%104 = icmp sge i32 %103, 9
br i1 %104, label %105, label %173
105: ; preds = %97
%106 = load i8**, i8*** %12
%107 = load i32, i32* %16
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds i8*, i8** %106, i64 %108
%110 = load i8*, i8** %109
%111 = load i8**, i8*** %12
%112 = load i32, i32* %16
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds i8*, i8** %111, i64 %113
%115 = load i8*, i8** %114
%116 = call i32 @strlen(i8* %115)
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds i8, i8* %110, i64 %117
%119 = getelementptr inbounds i8, i8* %118, i64 -9
%120 = call i64 @strcmp(i8* %119, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
%121 = icmp ne i64 %120, 0
br i1 %121, label %122, label %173
122: ; preds = %105
%123 = load i8**, i8*** %12
%124 = load i32, i32* %16
%125 = sext i32 %124 to i64
%126 = getelementptr inbounds i8*, i8** %123, i64 %125
%127 = load i8*, i8** %126
%128 = call i32 @strlen(i8* %127)
%129 = icmp sge i32 %128, 9
br i1 %129, label %130, label %173
130: ; preds = %122
%131 = load i8**, i8*** %12
%132 = load i32, i32* %16
%133 = sext i32 %132 to i64
%134 = getelementptr inbounds i8*, i8** %131, i64 %133
%135 = load i8*, i8** %134
%136 = load i8**, i8*** %12
%137 = load i32, i32* %16
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds i8*, i8** %136, i64 %138
%140 = load i8*, i8** %139
%141 = call i32 @strlen(i8* %140)
%142 = sext i32 %141 to i64
%143 = getelementptr inbounds i8, i8* %135, i64 %142
%144 = getelementptr inbounds i8, i8* %143, i64 -9
%145 = call i64 @strcmp(i8* %144, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
%146 = icmp ne i64 %145, 0
br i1 %146, label %147, label %173
147: ; preds = %130
%148 = load i8**, i8*** %12
%149 = load i32, i32* %16
%150 = sext i32 %149 to i64
%151 = getelementptr inbounds i8*, i8** %148, i64 %150
%152 = load i8*, i8** %151
%153 = call i32 @strlen(i8* %152)
%154 = icmp sge i32 %153, 10
br i1 %154, label %155, label %173
155: ; preds = %147
%156 = load i8**, i8*** %12
%157 = load i32, i32* %16
%158 = sext i32 %157 to i64
%159 = getelementptr inbounds i8*, i8** %156, i64 %158
%160 = load i8*, i8** %159
%161 = load i8**, i8*** %12
%162 = load i32, i32* %16
%163 = sext i32 %162 to i64
%164 = getelementptr inbounds i8*, i8** %161, i64 %163
%165 = load i8*, i8** %164
%166 = call i32 @strlen(i8* %165)
%167 = sext i32 %166 to i64
%168 = getelementptr inbounds i8, i8* %160, i64 %167
%169 = getelementptr inbounds i8, i8* %168, i64 -10
%170 = call i64 @strcmp(i8* %169, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0))
%171 = icmp ne i64 %170, 0
br i1 %171, label %172, label %173
172: ; preds = %155
br label %207
173: ; preds = %155, %147, %130, %122, %105, %97, %80, %72, %55, %47
%174 = load i8**, i8*** %12
%175 = load i32, i32* %16
%176 = sext i32 %175 to i64
%177 = getelementptr inbounds i8*, i8** %174, i64 %176
%178 = load i8*, i8** %177
%179 = load i8**, i8*** %12
%180 = load i32, i32* %16
%181 = sext i32 %180 to i64
%182 = getelementptr inbounds i8*, i8** %179, i64 %181
%183 = load i8*, i8** %182
%184 = call i32 (i8*, i8*, ...) @fs_append_file(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.10, i64 0, i64 0), i8* %178, i8* %183)
%185 = load i32, i32* %15
%186 = or i32 %185, %184
store i32 %186, i32* %15
store i32 0, i32* %17
br label %187
187: ; preds = %200, %173
%188 = load i32, i32* %17
%189 = load i32, i32* %11
%190 = icmp slt i32 %188, %189
br i1 %190, label %191, label %203
191: ; preds = %187
%192 = load i8**, i8*** %10
%193 = load i32, i32* %17
%194 = sext i32 %193 to i64
%195 = getelementptr inbounds i8*, i8** %192, i64 %194
%196 = load i8*, i8** %195
%197 = call i32 (i8*, i8*, ...) @fs_append_file(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.11, i64 0, i64 0), i8* %196)
%198 = load i32, i32* %15
%199 = or i32 %198, %197
store i32 %199, i32* %15
br label %200
200: ; preds = %191
%201 = load i32, i32* %17
%202 = add nsw i32 %201, 1
store i32 %202, i32* %17
br label %187
203: ; preds = %187
%204 = call i32 (i8*, i8*, ...) @fs_append_file(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0))
%205 = load i32, i32* %15
%206 = or i32 %205, %204
store i32 %206, i32* %15
br label %207
207: ; preds = %203, %172
%208 = load i32, i32* %16
%209 = add nsw i32 %208, 1
store i32 %209, i32* %16
br label %43
210: ; preds = %43
%211 = call i32 (i8*, i8*, ...) @fs_append_file(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.13, i64 0, i64 0))
%212 = load i32, i32* %15
%213 = or i32 %212, %211
store i32 %213, i32* %15
%214 = load i32, i32* %15
%215 = icmp eq i32 -1, %214
br i1 %215, label %216, label %222
216: ; preds = %210
%217 = load i32, i32* @errno
%218 = call i32 @strerror(i32 %217)
%219 = sext i32 %218 to i64
%220 = inttoptr i64 %219 to i8*
%221 = call i32 (i8*, i8*, ...) @log_debug(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.14, i64 0, i64 0), i8* %220)
br label %222
222: ; preds = %216, %210
%223 = load i32, i32* %15
ret i32 %223
}

LLVM IR (-O2):
@.str = [21 x i8] c"Creating file %s/%s\0A\00"
@.str.1 = [12 x i8] c"phpunit.xml\00"
@.str.2 = [306 x i8] c"<phpunit xmlns:xsi=\22http://www.w3.org/2001/XMLSchema-instance\22 xsi:noNamespaceSchemaLocation=\22http://schema.phpunit.de/5.4/phpunit.xsd\22 colors=\22true\22 backupGlobals=\22false\22 bootstrap=\22autoload.php\22>\0A <filter>\0A <whitelist addUncoveredFilesFromWhitelist=\22true\22 processUncoveredFilesFromWhitelist=\22true\22>\0A\00"
@.str.3 = [47 x i8] c" <directory suffix=\22.php\22>%s</directory>\0A\00"
@.str.4 = [122 x i8] c" </whitelist>\0A </filter>\0A\0A <logging>\0A <log type=\22coverage-html\22 target=\22coverage\22/>\0A </logging>\0A\0A <testsuites>\0A\00"
@.str.5 = [9 x i8] c"Test.php\00"
@.str.6 = [10 x i8] c"Test.php3\00"
@.str.7 = [10 x i8] c"Test.php4\00"
@.str.8 = [10 x i8] c"Test.php5\00"
@.str.9 = [11 x i8] c"Test.phtml\00"
@.str.10 = [49 x i8] c" <testsuite name=\22%s\22>\0A <file>%s</file>\0A\00"
@.str.11 = [53 x i8] c" <directory suffix=\22Helper.php\22>%s</directory>\0A\00"
@.str.12 = [19 x i8] c" </testsuite>\0A\0A\00"
@.str.13 = [28 x i8] c" </testsuites>\0A</phpunit>\0A\00"
@.str.14 = [38 x i8] c"Failed creating phpunit XML file: %s\0A\00"
@errno = global i32 0
define i32 @create_phpunitxml(i8** nocapture %0, i32 %1, i8** nocapture %2, i32 %3, i8** nocapture %4, i32 %5, i8* %6) {
%8 = tail call i32 (i8*, i8*, ...) @log_debug(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 @fs_create_file(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([306 x i8], [306 x i8]* @.str.2, i64 0, i64 0))
%10 = icmp sgt i32 %1, 0
br i1 %10, label %11, label %22
11: ; preds = %7
%12 = zext i32 %1 to i64
br label %13
13: ; preds = %11, %13
%14 = phi i64 [ 0, %11 ], [ %20, %13 ]
%15 = phi i32 [ %9, %11 ], [ %19, %13 ]
%16 = getelementptr inbounds i8*, i8** %0, i64 %14
%17 = load i8*, i8** %16
%18 = tail call i32 (i8*, i8*, ...) @fs_append_file(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0), i8* %17)
%19 = or i32 %18, %15
%20 = add nuw nsw i64 %14, 1
%21 = icmp eq i64 %20, %12
br i1 %21, label %22, label %13
22: ; preds = %13, %7
%23 = phi i32 [ %9, %7 ], [ %19, %13 ]
%24 = tail call i32 (i8*, i8*, ...) @fs_append_file(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([122 x i8], [122 x i8]* @.str.4, i64 0, i64 0))
%25 = or i32 %24, %23
%26 = icmp sgt i32 %5, 0
br i1 %26, label %27, label %115
27: ; preds = %22
%28 = icmp sgt i32 %3, 0
%29 = zext i32 %5 to i64
%30 = zext i32 %3 to i64
br label %31
31: ; preds = %27, %111
%32 = phi i64 [ 0, %27 ], [ %113, %111 ]
%33 = phi i32 [ %25, %27 ], [ %112, %111 ]
%34 = getelementptr inbounds i8*, i8** %4, i64 %32
%35 = load i8*, i8** %34
%36 = tail call i32 @strlen(i8* %35)
%37 = icmp sgt i32 %36, 7
br i1 %37, label %38, label %94
38: ; preds = %31
%39 = load i8*, i8** %34
%40 = tail call i32 @strlen(i8* %39)
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i8, i8* %39, i64 -8
%43 = getelementptr inbounds i8, i8* %42, i64 %41
%44 = tail call i64 @strcmp(i8* %43, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
%45 = icmp eq i64 %44, 0
br i1 %45, label %94, label %46
46: ; preds = %38
%47 = load i8*, i8** %34
%48 = tail call i32 @strlen(i8* %47)
%49 = icmp sgt i32 %48, 8
br i1 %49, label %50, label %94
50: ; preds = %46
%51 = load i8*, i8** %34
%52 = tail call i32 @strlen(i8* %51)
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds i8, i8* %51, i64 -9
%55 = getelementptr inbounds i8, i8* %54, i64 %53
%56 = tail call i64 @strcmp(i8* %55, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%57 = icmp eq i64 %56, 0
br i1 %57, label %94, label %58
58: ; preds = %50
%59 = load i8*, i8** %34
%60 = tail call i32 @strlen(i8* %59)
%61 = icmp sgt i32 %60, 8
br i1 %61, label %62, label %94
62: ; preds = %58
%63 = load i8*, i8** %34
%64 = tail call i32 @strlen(i8* %63)
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds i8, i8* %63, i64 -9
%67 = getelementptr inbounds i8, i8* %66, i64 %65
%68 = tail call i64 @strcmp(i8* %67, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
%69 = icmp eq i64 %68, 0
br i1 %69, label %94, label %70
70: ; preds = %62
%71 = load i8*, i8** %34
%72 = tail call i32 @strlen(i8* %71)
%73 = icmp sgt i32 %72, 8
br i1 %73, label %74, label %94
74: ; preds = %70
%75 = load i8*, i8** %34
%76 = tail call i32 @strlen(i8* %75)
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds i8, i8* %75, i64 -9
%79 = getelementptr inbounds i8, i8* %78, i64 %77
%80 = tail call i64 @strcmp(i8* %79, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
%81 = icmp eq i64 %80, 0
br i1 %81, label %94, label %82
82: ; preds = %74
%83 = load i8*, i8** %34
%84 = tail call i32 @strlen(i8* %83)
%85 = icmp sgt i32 %84, 9
br i1 %85, label %86, label %94
86: ; preds = %82
%87 = load i8*, i8** %34
%88 = tail call i32 @strlen(i8* %87)
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds i8, i8* %87, i64 -10
%91 = getelementptr inbounds i8, i8* %90, i64 %89
%92 = tail call i64 @strcmp(i8* %91, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0))
%93 = icmp eq i64 %92, 0
br i1 %93, label %94, label %111
94: ; preds = %86, %82, %74, %70, %62, %58, %50, %46, %38, %31
%95 = load i8*, i8** %34
%96 = tail call i32 (i8*, i8*, ...) @fs_append_file(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.10, i64 0, i64 0), i8* %95, i8* %95)
%97 = or i32 %96, %33
br i1 %28, label %98, label %107
98: ; preds = %94, %98
%99 = phi i64 [ %105, %98 ], [ 0, %94 ]
%100 = phi i32 [ %104, %98 ], [ %97, %94 ]
%101 = getelementptr inbounds i8*, i8** %2, i64 %99
%102 = load i8*, i8** %101
%103 = tail call i32 (i8*, i8*, ...) @fs_append_file(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.11, i64 0, i64 0), i8* %102)
%104 = or i32 %103, %100
%105 = add nuw nsw i64 %99, 1
%106 = icmp eq i64 %105, %30
br i1 %106, label %107, label %98
107: ; preds = %98, %94
%108 = phi i32 [ %97, %94 ], [ %104, %98 ]
%109 = tail call i32 (i8*, i8*, ...) @fs_append_file(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0))
%110 = or i32 %109, %108
br label %111
111: ; preds = %86, %107
%112 = phi i32 [ %33, %86 ], [ %110, %107 ]
%113 = add nuw nsw i64 %32, 1
%114 = icmp eq i64 %113, %29
br i1 %114, label %115, label %31
115: ; preds = %111, %22
%116 = phi i32 [ %25, %22 ], [ %112, %111 ]
%117 = tail call i32 (i8*, i8*, ...) @fs_append_file(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.13, i64 0, i64 0))
%118 = or i32 %117, %116
%119 = icmp eq i32 %118, -1
br i1 %119, label %120, label %126
120: ; preds = %115
%121 = load i32, i32* @errno
%122 = tail call i32 @strerror(i32 %121)
%123 = sext i32 %122 to i64
%124 = inttoptr i64 %123 to i8*
%125 = tail call i32 (i8*, i8*, ...) @log_debug(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.14, i64 0, i64 0), i8* %124)
br label %126
126: ; preds = %120, %115
ret i32 %118
}