#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int PATH_MAX;
scalar_t__ encode_body(int /*<<< orphan*/ *, int /*<<< orphan*/ *, long,
                       unsigned int *);
int /*<<< orphan*/ err(char *, char *, ...);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int ferror(int /*<<< orphan*/ *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
scalar_t__ getpid();
scalar_t__ rename(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, ...);
int /*<<< orphan*/ unlink(char *);
int /*<<< orphan*/ write_header(int /*<<< orphan*/ *, char *, char *, int, int);
int /*<<< orphan*/ write_trailer(int /*<<< orphan*/ *, unsigned int);
int chop_and_queue(FILE *dfp, char *delta, long msg_size, int npieces,
                   char *mail_alias, char *queue_dir) {
  int pce;
  FILE *qfp;
  unsigned sum;
  char tname[PATH_MAX];
  char qname[PATH_MAX];
  for (pce = 1; pce <= npieces; pce++) {
    int write_error;
    sprintf((tname), "%s/.%08ld.%03d", (queue_dir), (long)getpid(), (pce));
    if ((qfp = fopen(tname, "w")) == NULL) {
      err("cannot open '%s' for writing", tname);
      return 1;
    }
    write_header(qfp, mail_alias, delta, pce, npieces);
    if (encode_body(qfp, dfp, msg_size, &sum))
      return 1;
    write_trailer(qfp, sum);
    fflush(qfp);
    write_error = ferror(qfp);
    fclose(qfp);
    if (write_error) {
      err("error writing '%s'", tname);
      return 1;
    }
    err("%s %d/%d queued for %s", delta, pce, npieces, mail_alias);
  }
  for (pce = 1; pce <= npieces; pce++) {
    sprintf((tname), "%s/.%08ld.%03d", (queue_dir), (long)getpid(), (pce));
    sprintf((qname), "%s/%s+%03d-%03d", (queue_dir), (delta), (pce), (npieces));
    if (rename(tname, qname) < 0) {
      err("*rename: '%s' to '%s'", tname, qname);
      unlink(tname);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<chop_and_queue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    0x2e07(%rip),%rax
mov    (%rax),%ecx
mov    %rsp,%rdx
mov    %rdx,-0x58(%rbp)
mov    %rcx,%rsi
add    $0xf,%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x80(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x60(%rbp)
mov    (%rax),%eax
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x78(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x68(%rbp)
movl   $0x1,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x24(%rbp),%eax
jg     1381 <chop_and_queue+0x1c1>
mov    -0x38(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    $0x0,%al
call   1050 <getpid@plt>
mov    -0x88(%rbp),%rdx
mov    -0x80(%rbp),%rdi
mov    %rax,%rcx
mov    -0x3c(%rbp),%r8d
lea    0xd96(%rip),%rsi
mov    $0x0,%al
call   10d0 <sprintf@plt>
mov    -0x80(%rbp),%rdi
lea    0xd93(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x48(%rbp)
cmp    $0x0,%rax
jne    12b4 <chop_and_queue+0xf4>
mov    -0x80(%rbp),%rsi
lea    0xd77(%rip),%rdi
mov    $0x0,%al
call   1070 <err@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x70(%rbp)
jmp    143f <chop_and_queue+0x27f>
mov    -0x48(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x3c(%rbp),%ecx
mov    -0x24(%rbp),%r8d
call   10e0 <write_header@plt>
mov    -0x48(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    -0x4c(%rbp),%rcx
call   1090 <encode_body@plt>
cmp    $0x0,%rax
je     12fe <chop_and_queue+0x13e>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x70(%rbp)
jmp    143f <chop_and_queue+0x27f>
mov    -0x48(%rbp),%rdi
mov    -0x4c(%rbp),%esi
call   10c0 <write_trailer@plt>
mov    -0x48(%rbp),%rdi
call   1080 <fflush@plt>
mov    -0x48(%rbp),%rdi
call   1040 <ferror@plt>
mov    %eax,-0x6c(%rbp)
mov    -0x48(%rbp),%rdi
call   1060 <fclose@plt>
cmpl   $0x0,-0x6c(%rbp)
je     1357 <chop_and_queue+0x197>
mov    -0x80(%rbp),%rsi
lea    0xcf1(%rip),%rdi
mov    $0x0,%al
call   1070 <err@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x70(%rbp)
jmp    143f <chop_and_queue+0x27f>
mov    -0x18(%rbp),%rsi
mov    -0x3c(%rbp),%edx
mov    -0x24(%rbp),%ecx
mov    -0x30(%rbp),%r8
lea    0xcd5(%rip),%rdi
mov    $0x0,%al
call   1070 <err@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1233 <chop_and_queue+0x73>
movl   $0x1,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x24(%rbp),%eax
jg     1431 <chop_and_queue+0x271>
mov    -0x38(%rbp),%rax
mov    %rax,-0x90(%rbp)
mov    $0x0,%al
call   1050 <getpid@plt>
mov    -0x90(%rbp),%rdx
mov    -0x80(%rbp),%rdi
mov    %rax,%rcx
mov    -0x3c(%rbp),%r8d
lea    0xc41(%rip),%rsi
mov    $0x0,%al
call   10d0 <sprintf@plt>
mov    -0x78(%rbp),%rdi
mov    -0x38(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x3c(%rbp),%r8d
mov    -0x24(%rbp),%r9d
lea    0xc77(%rip),%rsi
mov    $0x0,%al
call   10d0 <sprintf@plt>
mov    -0x80(%rbp),%rdi
mov    -0x78(%rbp),%rsi
call   10b0 <rename@plt>
cmp    $0x0,%rax
jge    141e <chop_and_queue+0x25e>
mov    -0x80(%rbp),%rsi
mov    -0x78(%rbp),%rdx
lea    0xc5a(%rip),%rdi
mov    $0x0,%al
call   1070 <err@plt>
mov    -0x80(%rbp),%rdi
call   1030 <unlink@plt>
jmp    1423 <chop_and_queue+0x263>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1388 <chop_and_queue+0x1c8>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x70(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chop_and_queue>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %r9,-0x60(%rbp)
mov    %ecx,%r12d
mov    %rdx,-0x70(%rbp)
mov    %rsi,-0x38(%rbp)
mov    %rdi,-0x68(%rbp)
mov    %rsp,%rdx
mov    0x2e02(%rip),%rax
mov    (%rax),%ecx
mov    %rsp,%r15
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
sub    %rcx,%r15
mov    %r15,%rsp
mov    (%rax),%eax
mov    %rsp,%rcx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rcx
mov    %rcx,-0x48(%rbp)
mov    %rcx,%rsp
test   %r12d,%r12d
jle    13ca <chop_and_queue+0x20a>
mov    %r8,%r14
mov    %rdx,-0x30(%rbp)
mov    %r12d,%eax
neg    %eax
mov    %rax,-0x58(%rbp)
mov    $0x1,%r13d
mov    %r15,-0x50(%rbp)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <getpid@plt>
mov    %r15,%rdi
lea    0xdaf(%rip),%rsi
mov    -0x60(%rbp),%rdx
mov    %rax,%rcx
mov    %r13d,%r8d
xor    %eax,%eax
call   10d0 <sprintf@plt>
mov    %r15,%rdi
lea    0xda3(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     13ce <chop_and_queue+0x20e>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    -0x38(%rbp),%rdx
mov    %r13d,%ecx
mov    %r12d,%r8d
call   10e0 <write_header@plt>
mov    %rbx,%rdi
mov    -0x68(%rbp),%rsi
mov    -0x70(%rbp),%rdx
lea    -0x3c(%rbp),%rcx
call   1090 <encode_body@plt>
test   %rax,%rax
jne    13ec <chop_and_queue+0x22c>
mov    -0x3c(%rbp),%esi
mov    %rbx,%rdi
call   10c0 <write_trailer@plt>
mov    %rbx,%rdi
call   1080 <fflush@plt>
mov    %rbx,%rdi
call   1040 <ferror@plt>
mov    %eax,%r15d
mov    %rbx,%rdi
call   1060 <fclose@plt>
test   %r15d,%r15d
jne    13d7 <chop_and_queue+0x217>
lea    0xd5c(%rip),%rdi
mov    -0x38(%rbp),%rsi
mov    %r13d,%edx
mov    %r12d,%ecx
mov    %r14,%r8
xor    %eax,%eax
call   1070 <err@plt>
mov    -0x58(%rbp),%rax
add    %r13d,%eax
add    $0x1,%eax
mov    %r13d,%ecx
add    $0x1,%ecx
mov    %ecx,%r13d
cmp    $0x1,%eax
mov    -0x50(%rbp),%r15
jne    1240 <chop_and_queue+0x80>
test   %r12d,%r12d
jle    13f3 <chop_and_queue+0x233>
mov    $0x1,%ebx
mov    -0x60(%rbp),%r14
mov    -0x48(%rbp),%r13
jmp    1359 <chop_and_queue+0x199>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    -0x58(%rbp),%rax
add    %ebx,%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x1,%eax
je     13f3 <chop_and_queue+0x233>
xor    %eax,%eax
call   1050 <getpid@plt>
mov    %r15,%rdi
lea    0xc96(%rip),%rsi
mov    %r14,%rdx
mov    %rax,%rcx
mov    %ebx,%r8d
xor    %eax,%eax
call   10d0 <sprintf@plt>
mov    %r13,%rdi
lea    0xcd4(%rip),%rsi
mov    %r14,%rdx
mov    -0x38(%rbp),%rcx
mov    %ebx,%r8d
mov    %r12d,%r9d
xor    %eax,%eax
call   10d0 <sprintf@plt>
mov    %r15,%rdi
mov    %r13,%rsi
call   10b0 <rename@plt>
test   %rax,%rax
jns    1340 <chop_and_queue+0x180>
lea    0xcb9(%rip),%rdi
mov    %r15,%rsi
mov    -0x48(%rbp),%rdx
xor    %eax,%eax
call   1070 <err@plt>
mov    %r15,%rdi
call   1030 <unlink@plt>
jmp    1340 <chop_and_queue+0x180>
xor    %eax,%eax
jmp    13f9 <chop_and_queue+0x239>
lea    0xc3c(%rip),%rdi
jmp    13e2 <chop_and_queue+0x222>
lea    0xc50(%rip),%rdi
mov    -0x50(%rbp),%r15
mov    %r15,%rsi
xor    %eax,%eax
call   1070 <err@plt>
mov    $0x1,%eax
jmp    13f5 <chop_and_queue+0x235>
xor    %eax,%eax
mov    -0x30(%rbp),%rdx
mov    %rdx,%rsp
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@PATH_MAX = global i32 0
@.str = [15 x i8] c"%s/.%08ld.%03d\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [29 x i8] c"cannot open '%s' for writing\00"
@.str.3 = [19 x i8] c"error writing '%s'\00"
@.str.4 = [23 x i8] c"%s %d/%d queued for %s\00"
@.str.5 = [16 x i8] c"%s/%s+%03d-%03d\00"
@.str.6 = [22 x i8] c"*rename: '%s' to '%s'\00"
define i32 @chop_and_queue(i32* %0, i8* %1, i64 %2, i32 %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i32
%15 = alloca i32*
%16 = alloca i32
%17 = alloca i8*
%18 = alloca i64
%19 = alloca i64
%20 = alloca i32
%21 = alloca i32
store i32* %0, i32** %8
store i8* %1, i8** %9
store i64 %2, i64* %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i8* %5, i8** %13
%22 = load i32, i32* @PATH_MAX
%23 = zext i32 %22 to i64
%24 = call i8* @llvm.stacksave()
store i8* %24, i8** %17
%25 = alloca i8, i64 %23
store i64 %23, i64* %18
%26 = load i32, i32* @PATH_MAX
%27 = zext i32 %26 to i64
%28 = alloca i8, i64 %27
store i64 %27, i64* %19
store i32 1, i32* %14
br label %29
29: ; preds = %75, %6
%30 = load i32, i32* %14
%31 = load i32, i32* %11
%32 = icmp sle i32 %30, %31
br i1 %32, label %33, label %78
33: ; preds = %29
%34 = load i8*, i8** %13
%35 = call i64 (...) @getpid()
%36 = load i32, i32* %14
%37 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %25, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %34, i64 %35, i32 %36)
%38 = call i32* @fopen(i8* %25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %38, i32** %15
%39 = icmp eq i32* %38, null
br i1 %39, label %40, label %42
40: ; preds = %33
%41 = call i32 (i8*, i8*, ...) @err(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8* %25)
store i32 1, i32* %7
store i32 1, i32* %21
br label %103
42: ; preds = %33
%43 = load i32*, i32** %15
%44 = load i8*, i8** %12
%45 = load i8*, i8** %9
%46 = load i32, i32* %14
%47 = load i32, i32* %11
%48 = call i32 @write_header(i32* %43, i8* %44, i8* %45, i32 %46, i32 %47)
%49 = load i32*, i32** %15
%50 = load i32*, i32** %8
%51 = load i64, i64* %10
%52 = call i64 @encode_body(i32* %49, i32* %50, i64 %51, i32* %16)
%53 = icmp ne i64 %52, 0
br i1 %53, label %54, label %55
54: ; preds = %42
store i32 1, i32* %7
store i32 1, i32* %21
br label %103
55: ; preds = %42
%56 = load i32*, i32** %15
%57 = load i32, i32* %16
%58 = call i32 @write_trailer(i32* %56, i32 %57)
%59 = load i32*, i32** %15
%60 = call i32 @fflush(i32* %59)
%61 = load i32*, i32** %15
%62 = call i32 @ferror(i32* %61)
store i32 %62, i32* %20
%63 = load i32*, i32** %15
%64 = call i32 @fclose(i32* %63)
%65 = load i32, i32* %20
%66 = icmp ne i32 %65, 0
br i1 %66, label %67, label %69
67: ; preds = %55
%68 = call i32 (i8*, i8*, ...) @err(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* %25)
store i32 1, i32* %7
store i32 1, i32* %21
br label %103
69: ; preds = %55
%70 = load i8*, i8** %9
%71 = load i32, i32* %14
%72 = load i32, i32* %11
%73 = load i8*, i8** %12
%74 = call i32 (i8*, i8*, ...) @err(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i8* %70, i32 %71, i32 %72, i8* %73)
br label %75
75: ; preds = %69
%76 = load i32, i32* %14
%77 = add nsw i32 %76, 1
store i32 %77, i32* %14
br label %29
78: ; preds = %29
store i32 1, i32* %14
br label %79
79: ; preds = %99, %78
%80 = load i32, i32* %14
%81 = load i32, i32* %11
%82 = icmp sle i32 %80, %81
br i1 %82, label %83, label %102
83: ; preds = %79
%84 = load i8*, i8** %13
%85 = call i64 (...) @getpid()
%86 = load i32, i32* %14
%87 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %25, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %84, i64 %85, i32 %86)
%88 = load i8*, i8** %13
%89 = load i8*, i8** %9
%90 = load i32, i32* %14
%91 = load i32, i32* %11
%92 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %28, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i8* %88, i8* %89, i32 %90, i32 %91)
%93 = call i64 @rename(i8* %25, i8* %28)
%94 = icmp slt i64 %93, 0
br i1 %94, label %95, label %98
95: ; preds = %83
%96 = call i32 (i8*, i8*, ...) @err(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), i8* %25, i8* %28)
%97 = call i32 @unlink(i8* %25)
br label %98
98: ; preds = %95, %83
br label %99
99: ; preds = %98
%100 = load i32, i32* %14
%101 = add nsw i32 %100, 1
store i32 %101, i32* %14
br label %79
102: ; preds = %79
store i32 0, i32* %7
store i32 1, i32* %21
br label %103
103: ; preds = %102, %67, %54, %40
%104 = load i8*, i8** %17
%105 = load i32, i32* %7
ret i32 %105
}

LLVM IR (-O2):
@PATH_MAX = global i32 0
@.str = [15 x i8] c"%s/.%08ld.%03d\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [29 x i8] c"cannot open '%s' for writing\00"
@.str.3 = [19 x i8] c"error writing '%s'\00"
@.str.4 = [23 x i8] c"%s %d/%d queued for %s\00"
@.str.5 = [16 x i8] c"%s/%s+%03d-%03d\00"
@.str.6 = [22 x i8] c"*rename: '%s' to '%s'\00"
define i32 @chop_and_queue(i32* %0, i8* %1, i64 %2, i32 %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = bitcast i32* %7 to i8*
%9 = load i32, i32* @PATH_MAX
%10 = zext i32 %9 to i64
%11 = tail call i8* @llvm.stacksave()
%12 = alloca i8, i64 %10
%13 = load i32, i32* @PATH_MAX
%14 = zext i32 %13 to i64
%15 = alloca i8, i64 %14
%16 = icmp slt i32 %3, 1
br i1 %16, label %55, label %18
17: ; preds = %35
br i1 %16, label %55, label %39
18: ; preds = %6, %35
%19 = phi i32 [ %37, %35 ], [ 1, %6 ]
%20 = call i64 (...) @getpid()
%21 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %12, i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %5, i64 %20, i32 %19)
%22 = call i32* @fopen(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%23 = icmp eq i32* %22, null
br i1 %23, label %52, label %24
24: ; preds = %18
%25 = call i32 @write_header(i32* %22, i8* %4, i8* %1, i32 %19, i32 %3)
%26 = call i64 @encode_body(i32* %22, i32* %0, i64 %2, i32* %7)
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %55
28: ; preds = %24
%29 = load i32, i32* %7
%30 = call i32 @write_trailer(i32* %22, i32 %29)
%31 = call i32 @fflush(i32* %22)
%32 = call i32 @ferror(i32* %22)
%33 = call i32 @fclose(i32* %22)
%34 = icmp eq i32 %32, 0
br i1 %34, label %35, label %52
35: ; preds = %28
%36 = call i32 (i8*, i8*, ...) @err(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i8* %1, i32 %19, i32 %3, i8* %4)
%37 = add nuw i32 %19, 1
%38 = icmp eq i32 %19, %3
br i1 %38, label %17, label %18
39: ; preds = %17, %49
%40 = phi i32 [ %50, %49 ], [ 1, %17 ]
%41 = call i64 (...) @getpid()
%42 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %12, i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %5, i64 %41, i32 %40)
%43 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %15, i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i8* %5, i8* %1, i32 %40, i32 %3)
%44 = call i64 @rename(i8* %12, i8* %15)
%45 = icmp slt i64 %44, 0
br i1 %45, label %46, label %49
46: ; preds = %39
%47 = call i32 (i8*, i8*, ...) @err(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), i8* %12, i8* %15)
%48 = call i32 @unlink(i8* %12)
br label %49
49: ; preds = %39, %46
%50 = add nuw i32 %40, 1
%51 = icmp eq i32 %40, %3
br i1 %51, label %55, label %39
52: ; preds = %28, %18
%53 = phi i8* [ getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), %18 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), %28 ]
%54 = call i32 (i8*, i8*, ...) @err(i8* %53, i8* %12)
br label %55
55: ; preds = %24, %49, %52, %6, %17
%56 = phi i32 [ 0, %17 ], [ 0, %6 ], [ 1, %52 ], [ 0, %49 ], [ 1, %24 ]
ret i32 %56
}