#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 */
struct stat {
  int /*<<< orphan*/ member_0;
};
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int R_OK;
int S_IFBLK;
int S_IFCHR;
int S_IFIFO;
int S_IFSOCK;
int S_IRWXG;
int S_IRWXU;
int W_OK;
int access(char *, int);
int chmod(char *, int);
int chown(char *, int, int);
int /*<<< orphan*/ close(int);
int creat(char *, int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int getxattr(char *, char *, int /*<<< orphan*/ *, int /*<<< orphan*/);
int link(char *, char *);
int listxattr(char *, int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ makedev(int, int);
int mknod(char *, int, int /*<<< orphan*/);
int readlink(char *, char *, int);
int removexattr(char *, char *);
int rename(char *, char *);
int setxattr(char *, char *, char *, int, int /*<<< orphan*/);
int stat(char *, struct stat *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *strerror(int /*<<< orphan*/);
int symlink(char *, char *);
int truncate(char *, int /*<<< orphan*/);
int /*<<< orphan*/ unlink(char *);
int path_based_fops(char *filename) {
  int ret = -1;
  int fd = 0;
  int result = 0;
  struct stat stbuf = {
      0,
  };
  char newfilename[255] = {
      0,
  };
  char *hardlink = "linkfile-hard.txt";
  char *symlnk = "linkfile-soft.txt";
  char buf[1024] = {
      0,
  };
  fd = creat(filename, 0644);
  if (fd < 0) {
    fprintf(stderr, "creat failed: %s\n", strerror(errno));
    return ret;
  }
  ret = truncate(filename, 0);
  if (ret < 0) {
    fprintf(stderr, "truncate failed: %s\n", strerror(errno));
    result |= ret;
  }
  ret = stat(filename, &stbuf);
  if (ret < 0) {
    fprintf(stderr, "stat failed: %s\n", strerror(errno));
    result |= ret;
  }
  ret = chmod(filename, 0640);
  if (ret < 0) {
    fprintf(stderr, "chmod failed: %s\n", strerror(errno));
    result |= ret;
  }
  ret = chown(filename, 10001, 10001);
  if (ret < 0) {
    fprintf(stderr, "chown failed: %s\n", strerror(errno));
    result |= ret;
  }
  ret = setxattr(filename, "trusted.xattr-test", "working", 8, 0);
  if (ret < 0) {
    fprintf(stderr, "setxattr failed: %s\n", strerror(errno));
    result |= ret;
  }
  ret = listxattr(filename, NULL, 0);
  if (ret <= 0) {
    ret = -1;
    fprintf(stderr, "listxattr failed: %s\n", strerror(errno));
    result |= ret;
  }
  ret = getxattr(filename, "trusted.xattr-test", NULL, 0);
  if (ret <= 0) {
    fprintf(stderr, "getxattr failed: %s\n", strerror(errno));
    result |= ret;
  }
  ret = removexattr(filename, "trusted.xattr-test");
  if (ret < 0) {
    fprintf(stderr, "removexattr failed: %s\n", strerror(errno));
    result |= ret;
  }
  ret = access(filename, R_OK | W_OK);
  if (ret < 0) {
    fprintf(stderr, "access failed: %s\n", strerror(errno));
    result |= ret;
  }
  ret = link(filename, hardlink);
  if (ret < 0) {
    fprintf(stderr, "link failed: %s\n", strerror(errno));
    result |= ret;
  }
  unlink(hardlink);
  ret = symlink(filename, symlnk);
  if (ret < 0) {
    fprintf(stderr, "symlink failed: %s\n", strerror(errno));
    result |= ret;
  }
  ret = readlink(symlnk, buf, sizeof(buf));
  if (ret < 0) {
    fprintf(stderr, "readlink failed: %s\n", strerror(errno));
    result |= ret;
  }
  unlink(symlnk);
  ret = mknod("cspecial", S_IFCHR | S_IRWXU | S_IRWXG, makedev(2, 3));
  if (ret < 0) {
    fprintf(stderr, "cpsecial mknod failed: %s\n", strerror(errno));
    result |= ret;
  }
  unlink("cspecial");
  ret = mknod("bspecial", S_IFBLK | S_IRWXU | S_IRWXG, makedev(4, 5));
  if (ret < 0) {
    fprintf(stderr, "bspecial mknod failed: %s\n", strerror(errno));
    result |= ret;
  }
  unlink("bspecial");
  ret = mknod("fifo", S_IFIFO | S_IRWXU | S_IRWXG, 0);
  if (ret < 0) {
    fprintf(stderr, "fifo mknod failed: %s\n", strerror(errno));
    result |= ret;
  }
  unlink("fifo");
  ret = mknod("sock", S_IFSOCK | S_IRWXU | S_IRWXG, 0);
  if (ret < 0) {
    fprintf(stderr, "sock mknod failed: %s\n", strerror(errno));
    result |= ret;
  }
  unlink("sock");
  strcpy(newfilename, filename);
  strcat(newfilename, "_new");
  ret = rename(filename, newfilename);
  if (ret < 0) {
    fprintf(stderr, "rename failed: %s\n", strerror(errno));
    result |= ret;
  }
  unlink(newfilename);
  if (fd)
    close(fd);
  unlink(filename);
  return result;
}


x86 assembly (clang, -O0):
<path_based_fops>:
push   %rbp
mov    %rsp,%rbp
sub    $0x580,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1080 <memset@plt>
lea    -0x120(%rbp),%rdi
xor    %esi,%esi
mov    $0xff,%edx
call   1080 <memset@plt>
lea    0xd42(%rip),%rax
mov    %rax,-0x128(%rbp)
lea    0xd46(%rip),%rax
mov    %rax,-0x130(%rbp)
lea    -0x530(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1080 <memset@plt>
mov    -0x10(%rbp),%rdi
mov    $0x1a4,%esi
call   1160 <creat@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    133e <path_based_fops+0xce>
mov    0x2cb0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x534(%rbp)
mov    0x2c91(%rip),%rax
mov    (%rax),%edi
call   1190 <strerror@plt>
mov    -0x534(%rbp),%edi
mov    %rax,%rdx
lea    0xcf6(%rip),%rsi
call   10a0 <fprintf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1a6c <path_based_fops+0x7fc>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   10d0 <truncate@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1391 <path_based_fops+0x121>
mov    0x2c5b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x538(%rbp)
mov    0x2c3c(%rip),%rax
mov    (%rax),%edi
call   1190 <strerror@plt>
mov    -0x538(%rbp),%edi
mov    %rax,%rdx
lea    0xcb3(%rip),%rsi
call   10a0 <fprintf@plt>
mov    -0x14(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   10b0 <stat@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    13e6 <path_based_fops+0x176>
mov    0x2c06(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x53c(%rbp)
mov    0x2be7(%rip),%rax
mov    (%rax),%edi
call   1190 <strerror@plt>
mov    -0x53c(%rbp),%edi
mov    %rax,%rdx
lea    0xc73(%rip),%rsi
call   10a0 <fprintf@plt>
mov    -0x14(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1a0,%esi
call   10f0 <chmod@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    143c <path_based_fops+0x1cc>
mov    0x2bb0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x540(%rbp)
mov    0x2b91(%rip),%rax
mov    (%rax),%edi
call   1190 <strerror@plt>
mov    -0x540(%rbp),%edi
mov    %rax,%rdx
lea    0xc2e(%rip),%rsi
call   10a0 <fprintf@plt>
mov    -0x14(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2711,%edx
mov    %edx,%esi
call   10e0 <chown@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1494 <path_based_fops+0x224>
mov    0x2b58(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x544(%rbp)
mov    0x2b39(%rip),%rax
mov    (%rax),%edi
call   1190 <strerror@plt>
mov    -0x544(%rbp),%edi
mov    %rax,%rdx
lea    0xbe8(%rip),%rsi
call   10a0 <fprintf@plt>
mov    -0x14(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xbe1(%rip),%rsi
lea    0xbed(%rip),%rdx
mov    $0x8,%ecx
xor    %r8d,%r8d
call   1180 <setxattr@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    14fb <path_based_fops+0x28b>
mov    0x2af1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x548(%rbp)
mov    0x2ad2(%rip),%rax
mov    (%rax),%edi
call   1190 <strerror@plt>
mov    -0x548(%rbp),%edi
mov    %rax,%rdx
lea    0xbae(%rip),%rsi
call   10a0 <fprintf@plt>
mov    -0x14(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1060 <listxattr@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jg     1559 <path_based_fops+0x2e9>
movl   $0xffffffff,-0x14(%rbp)
mov    0x2a93(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x54c(%rbp)
mov    0x2a74(%rip),%rax
mov    (%rax),%edi
call   1190 <strerror@plt>
mov    -0x54c(%rbp),%edi
mov    %rax,%rdx
lea    0xb65(%rip),%rsi
call   10a0 <fprintf@plt>
mov    -0x14(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xb1c(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
xor    %ecx,%ecx
call   1150 <getxattr@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jg     15b7 <path_based_fops+0x347>
mov    0x2a35(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x550(%rbp)
mov    0x2a16(%rip),%rax
mov    (%rax),%edi
call   1190 <strerror@plt>
mov    -0x550(%rbp),%edi
mov    %rax,%rdx
lea    0xb1d(%rip),%rsi
call   10a0 <fprintf@plt>
mov    -0x14(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xabe(%rip),%rsi
call   1100 <removexattr@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    160f <path_based_fops+0x39f>
mov    0x29dd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x554(%rbp)
mov    0x29be(%rip),%rax
mov    (%rax),%edi
call   1190 <strerror@plt>
mov    -0x554(%rbp),%edi
mov    %rax,%rdx
lea    0xada(%rip),%rsi
call   10a0 <fprintf@plt>
mov    -0x14(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2986(%rip),%rax
mov    (%rax),%esi
mov    0x29b5(%rip),%rax
or     (%rax),%esi
call   1110 <access@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1672 <path_based_fops+0x402>
mov    0x297a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x558(%rbp)
mov    0x295b(%rip),%rax
mov    (%rax),%edi
call   1190 <strerror@plt>
mov    -0x558(%rbp),%edi
mov    %rax,%rdx
lea    0xa8f(%rip),%rsi
call   10a0 <fprintf@plt>
mov    -0x14(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x128(%rbp),%rsi
call   1170 <link@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    16ca <path_based_fops+0x45a>
mov    0x2922(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x55c(%rbp)
mov    0x2903(%rip),%rax
mov    (%rax),%edi
call   1190 <strerror@plt>
mov    -0x55c(%rbp),%edi
mov    %rax,%rdx
lea    0xa62(%rip),%rsi
call   10a0 <fprintf@plt>
mov    -0x14(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x128(%rbp),%rdi
call   1030 <unlink@plt>
mov    -0x10(%rbp),%rdi
mov    -0x130(%rbp),%rsi
call   1070 <symlink@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    172e <path_based_fops+0x4be>
mov    0x28be(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x560(%rbp)
mov    0x289f(%rip),%rax
mov    (%rax),%edi
call   1190 <strerror@plt>
mov    -0x560(%rbp),%edi
mov    %rax,%rdx
lea    0x9e6(%rip),%rsi
call   10a0 <fprintf@plt>
mov    -0x14(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x130(%rbp),%rdi
lea    -0x530(%rbp),%rsi
mov    $0x400,%edx
call   1050 <readlink@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    178e <path_based_fops+0x51e>
mov    0x285e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x564(%rbp)
mov    0x283f(%rip),%rax
mov    (%rax),%edi
call   1190 <strerror@plt>
mov    -0x564(%rbp),%edi
mov    %rax,%rdx
lea    0x99a(%rip),%rsi
call   10a0 <fprintf@plt>
mov    -0x14(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x130(%rbp),%rdi
call   1030 <unlink@plt>
mov    0x280f(%rip),%rax
mov    (%rax),%eax
mov    0x283e(%rip),%rcx
or     (%rcx),%eax
mov    0x282d(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x568(%rbp)
mov    $0x2,%edi
mov    $0x3,%esi
call   1130 <makedev@plt>
mov    -0x568(%rbp),%esi
mov    %eax,%edx
lea    0x956(%rip),%rdi
call   10c0 <mknod@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1826 <path_based_fops+0x5b6>
mov    0x27c6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x56c(%rbp)
mov    0x27a7(%rip),%rax
mov    (%rax),%edi
call   1190 <strerror@plt>
mov    -0x56c(%rbp),%edi
mov    %rax,%rdx
lea    0x920(%rip),%rsi
call   10a0 <fprintf@plt>
mov    -0x14(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
lea    0x902(%rip),%rdi
call   1030 <unlink@plt>
mov    0x2787(%rip),%rax
mov    (%rax),%eax
mov    0x27a6(%rip),%rcx
or     (%rcx),%eax
mov    0x2795(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x570(%rbp)
mov    $0x4,%edi
mov    $0x5,%esi
call   1130 <makedev@plt>
mov    -0x570(%rbp),%esi
mov    %eax,%edx
lea    0x8e2(%rip),%rdi
call   10c0 <mknod@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    18be <path_based_fops+0x64e>
mov    0x272e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x574(%rbp)
mov    0x270f(%rip),%rax
mov    (%rax),%edi
call   1190 <strerror@plt>
mov    -0x574(%rbp),%edi
mov    %rax,%rdx
lea    0x8ac(%rip),%rsi
call   10a0 <fprintf@plt>
mov    -0x14(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
lea    0x88e(%rip),%rdi
call   1030 <unlink@plt>
mov    0x26c7(%rip),%rax
mov    (%rax),%esi
mov    0x270e(%rip),%rax
or     (%rax),%esi
mov    0x26fd(%rip),%rax
or     (%rax),%esi
lea    0x88b(%rip),%rdi
xor    %edx,%edx
call   10c0 <mknod@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    193b <path_based_fops+0x6cb>
mov    0x26b1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x578(%rbp)
mov    0x2692(%rip),%rax
mov    (%rax),%edi
call   1190 <strerror@plt>
mov    -0x578(%rbp),%edi
mov    %rax,%rdx
lea    0x84f(%rip),%rsi
call   10a0 <fprintf@plt>
mov    -0x14(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
lea    0x835(%rip),%rdi
call   1030 <unlink@plt>
mov    0x267a(%rip),%rax
mov    (%rax),%esi
mov    0x2691(%rip),%rax
or     (%rax),%esi
mov    0x2680(%rip),%rax
or     (%rax),%esi
lea    0x82a(%rip),%rdi
xor    %edx,%edx
call   10c0 <mknod@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    19b8 <path_based_fops+0x748>
mov    0x2634(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x57c(%rbp)
mov    0x2615(%rip),%rax
mov    (%rax),%edi
call   1190 <strerror@plt>
mov    -0x57c(%rbp),%edi
mov    %rax,%rdx
lea    0x7ee(%rip),%rsi
call   10a0 <fprintf@plt>
mov    -0x14(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
lea    0x7d4(%rip),%rdi
call   1030 <unlink@plt>
lea    -0x120(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcpy@plt>
lea    -0x120(%rbp),%rdi
lea    0x7cd(%rip),%rsi
call   1140 <strcat@plt>
mov    -0x10(%rbp),%rdi
lea    -0x120(%rbp),%rsi
call   1120 <rename@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1a3f <path_based_fops+0x7cf>
mov    0x25ad(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x580(%rbp)
mov    0x258e(%rip),%rax
mov    (%rax),%edi
call   1190 <strerror@plt>
mov    -0x580(%rbp),%edi
mov    %rax,%rdx
lea    0x783(%rip),%rsi
call   10a0 <fprintf@plt>
mov    -0x14(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
lea    -0x120(%rbp),%rdi
call   1030 <unlink@plt>
cmpl   $0x0,-0x18(%rbp)
je     1a5d <path_based_fops+0x7ed>
mov    -0x18(%rbp),%edi
call   1090 <close@plt>
mov    -0x10(%rbp),%rdi
call   1030 <unlink@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x580,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_based_fops>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x518,%rsp
mov    %rdi,%rbx
movl   $0x0,0x8(%rsp)
xorps  %xmm0,%xmm0
movups %xmm0,0xff(%rsp)
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
lea    0x110(%rsp),%rdi
xor    %r15d,%r15d
mov    $0x400,%edx
xor    %esi,%esi
call   1080 <memset@plt>
mov    %rbx,%rdi
mov    $0x1a4,%esi
call   1160 <creat@plt>
test   %eax,%eax
js     189a <path_based_fops+0x62a>
mov    %eax,0xc(%rsp)
mov    %rbx,%rdi
xor    %esi,%esi
call   10d0 <truncate@plt>
test   %eax,%eax
jns    1367 <path_based_fops+0xf7>
mov    %eax,%ebp
mov    0x2c77(%rip),%rax
mov    (%rax),%r15d
mov    0x2c5d(%rip),%rax
mov    (%rax),%edi
call   1190 <strerror@plt>
lea    0xcdd(%rip),%rsi
mov    %r15d,%edi
mov    %rax,%rdx
call   10a0 <fprintf@plt>
mov    %ebp,%r15d
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   10b0 <stat@plt>
test   %eax,%eax
jns    13a7 <path_based_fops+0x137>
mov    %eax,%ebp
mov    0x2c37(%rip),%rax
mov    (%rax),%r12d
mov    0x2c1d(%rip),%rax
mov    (%rax),%edi
call   1190 <strerror@plt>
lea    0xcb2(%rip),%rsi
mov    %r12d,%edi
mov    %rax,%rdx
call   10a0 <fprintf@plt>
or     %ebp,%r15d
mov    %rbx,%rdi
mov    $0x1a0,%esi
call   10f0 <chmod@plt>
test   %eax,%eax
jns    13e7 <path_based_fops+0x177>
mov    %eax,%ebp
mov    0x2bf7(%rip),%rax
mov    (%rax),%r12d
mov    0x2bdd(%rip),%rax
mov    (%rax),%edi
call   1190 <strerror@plt>
lea    0xc83(%rip),%rsi
mov    %r12d,%edi
mov    %rax,%rdx
call   10a0 <fprintf@plt>
or     %ebp,%r15d
mov    %rbx,%rdi
mov    $0x2711,%esi
mov    $0x2711,%edx
call   10e0 <chown@plt>
test   %eax,%eax
jns    142c <path_based_fops+0x1bc>
mov    %eax,%ebp
mov    0x2bb2(%rip),%rax
mov    (%rax),%r12d
mov    0x2b98(%rip),%rax
mov    (%rax),%edi
call   1190 <strerror@plt>
lea    0xc50(%rip),%rsi
mov    %r12d,%edi
mov    %rax,%rdx
call   10a0 <fprintf@plt>
or     %ebp,%r15d
lea    0xc4d(%rip),%rsi
lea    0xc59(%rip),%rdx
mov    %rbx,%rdi
mov    $0x8,%ecx
xor    %r8d,%r8d
call   1180 <setxattr@plt>
test   %eax,%eax
jns    147d <path_based_fops+0x20d>
mov    %eax,%ebp
mov    0x2b61(%rip),%rax
mov    (%rax),%r12d
mov    0x2b47(%rip),%rax
mov    (%rax),%edi
call   1190 <strerror@plt>
lea    0xc2c(%rip),%rsi
mov    %r12d,%edi
mov    %rax,%rdx
call   10a0 <fprintf@plt>
or     %ebp,%r15d
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1060 <listxattr@plt>
test   %eax,%eax
jg     14bb <path_based_fops+0x24b>
mov    0x2b24(%rip),%rax
mov    (%rax),%ebp
mov    0x2b0b(%rip),%rax
mov    (%rax),%edi
call   1190 <strerror@plt>
lea    0xc05(%rip),%rsi
mov    %ebp,%edi
mov    %rax,%rdx
call   10a0 <fprintf@plt>
mov    $0xffffffff,%r15d
lea    0xbbe(%rip),%rsi
mov    %rbx,%rdi
xor    %edx,%edx
xor    %ecx,%ecx
call   1150 <getxattr@plt>
test   %eax,%eax
jg     1501 <path_based_fops+0x291>
mov    %eax,%ebp
mov    0x2add(%rip),%rax
mov    (%rax),%r12d
mov    0x2ac3(%rip),%rax
mov    (%rax),%edi
call   1190 <strerror@plt>
lea    0xbd3(%rip),%rsi
mov    %r12d,%edi
mov    %rax,%rdx
call   10a0 <fprintf@plt>
or     %ebp,%r15d
lea    0xb78(%rip),%rsi
mov    %rbx,%rdi
call   1100 <removexattr@plt>
test   %eax,%eax
jns    1543 <path_based_fops+0x2d3>
mov    %eax,%ebp
mov    0x2a9b(%rip),%rax
mov    (%rax),%r12d
mov    0x2a81(%rip),%rax
mov    (%rax),%edi
call   1190 <strerror@plt>
lea    0xba6(%rip),%rsi
mov    %r12d,%edi
mov    %rax,%rdx
call   10a0 <fprintf@plt>
or     %ebp,%r15d
mov    0x2a56(%rip),%rax
mov    0x2a87(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    %rbx,%rdi
call   1110 <access@plt>
test   %eax,%eax
jns    1590 <path_based_fops+0x320>
mov    %eax,%ebp
mov    0x2a4e(%rip),%rax
mov    (%rax),%r12d
mov    0x2a34(%rip),%rax
mov    (%rax),%edi
call   1190 <strerror@plt>
lea    0xb71(%rip),%rsi
mov    %r12d,%edi
mov    %rax,%rdx
call   10a0 <fprintf@plt>
or     %ebp,%r15d
lea    0xa69(%rip),%rsi
mov    %rbx,%rdi
call   1170 <link@plt>
test   %eax,%eax
jns    15d2 <path_based_fops+0x362>
mov    %eax,%ebp
mov    0x2a0c(%rip),%rax
mov    (%rax),%r12d
mov    0x29f2(%rip),%rax
mov    (%rax),%edi
call   1190 <strerror@plt>
lea    0xb5a(%rip),%rsi
mov    %r12d,%edi
mov    %rax,%rdx
call   10a0 <fprintf@plt>
or     %ebp,%r15d
lea    0xa27(%rip),%rdi
call   1030 <unlink@plt>
lea    0xa2d(%rip),%rsi
mov    %rbx,%rdi
call   1070 <symlink@plt>
test   %eax,%eax
jns    1620 <path_based_fops+0x3b0>
mov    %eax,%ebp
mov    0x29be(%rip),%rax
mov    (%rax),%r12d
mov    0x29a4(%rip),%rax
mov    (%rax),%edi
call   1190 <strerror@plt>
lea    0xaf4(%rip),%rsi
mov    %r12d,%edi
mov    %rax,%rdx
call   10a0 <fprintf@plt>
or     %ebp,%r15d
lea    0x9eb(%rip),%rdi
lea    0x110(%rsp),%rsi
mov    $0x400,%edx
call   1050 <readlink@plt>
test   %eax,%eax
jns    166c <path_based_fops+0x3fc>
mov    %eax,%ebp
mov    0x2972(%rip),%rax
mov    (%rax),%r12d
mov    0x2958(%rip),%rax
mov    (%rax),%edi
call   1190 <strerror@plt>
lea    0xabc(%rip),%rsi
mov    %r12d,%edi
mov    %rax,%rdx
call   10a0 <fprintf@plt>
or     %ebp,%r15d
lea    0x99f(%rip),%rdi
call   1030 <unlink@plt>
mov    0x2931(%rip),%rax
mov    0x2962(%rip),%r13
mov    0x0(%r13),%ebp
or     (%rax),%ebp
mov    0x294d(%rip),%r14
or     (%r14),%ebp
mov    $0x2,%edi
mov    $0x3,%esi
call   1130 <makedev@plt>
lea    0xa83(%rip),%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   10c0 <mknod@plt>
test   %eax,%eax
jns    16e8 <path_based_fops+0x478>
mov    %eax,%ebp
mov    0x28f6(%rip),%rax
mov    (%rax),%r12d
mov    0x28dc(%rip),%rax
mov    (%rax),%edi
call   1190 <strerror@plt>
lea    0xa5e(%rip),%rsi
mov    %r12d,%edi
mov    %rax,%rdx
call   10a0 <fprintf@plt>
or     %ebp,%r15d
lea    0xa40(%rip),%rdi
call   1030 <unlink@plt>
mov    0x28c5(%rip),%rax
mov    0x0(%r13),%ebp
or     (%rax),%ebp
or     (%r14),%ebp
mov    $0x4,%edi
mov    $0x5,%esi
call   1130 <makedev@plt>
lea    0xa39(%rip),%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   10c0 <mknod@plt>
test   %eax,%eax
jns    1756 <path_based_fops+0x4e6>
mov    %eax,%ebp
mov    0x2888(%rip),%rax
mov    (%rax),%r12d
mov    0x286e(%rip),%rax
mov    (%rax),%edi
call   1190 <strerror@plt>
lea    0xa14(%rip),%rsi
mov    %r12d,%edi
mov    %rax,%rdx
call   10a0 <fprintf@plt>
or     %ebp,%r15d
lea    0x9f6(%rip),%rdi
call   1030 <unlink@plt>
mov    0x282f(%rip),%rax
mov    0x0(%r13),%esi
or     (%rax),%esi
or     (%r14),%esi
lea    0x9fe(%rip),%rdi
xor    %edx,%edx
call   10c0 <mknod@plt>
test   %eax,%eax
jns    17b3 <path_based_fops+0x543>
mov    %eax,%ebp
mov    0x282b(%rip),%rax
mov    (%rax),%r12d
mov    0x2811(%rip),%rax
mov    (%rax),%edi
call   1190 <strerror@plt>
lea    0x9d7(%rip),%rsi
mov    %r12d,%edi
mov    %rax,%rdx
call   10a0 <fprintf@plt>
or     %ebp,%r15d
lea    0x9bd(%rip),%rdi
call   1030 <unlink@plt>
mov    0x2802(%rip),%rax
mov    0x0(%r13),%esi
or     (%rax),%esi
or     (%r14),%esi
lea    0x9bd(%rip),%rdi
xor    %edx,%edx
call   10c0 <mknod@plt>
test   %eax,%eax
jns    1810 <path_based_fops+0x5a0>
mov    %eax,%ebp
mov    0x27ce(%rip),%rax
mov    (%rax),%r12d
mov    0x27b4(%rip),%rax
mov    (%rax),%edi
call   1190 <strerror@plt>
lea    0x996(%rip),%rsi
mov    %r12d,%edi
mov    %rax,%rdx
call   10a0 <fprintf@plt>
or     %ebp,%r15d
lea    0x97c(%rip),%rdi
call   1030 <unlink@plt>
lea    0x10(%rsp),%rbp
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1040 <strcpy@plt>
lea    0x97c(%rip),%rsi
mov    %rbp,%rdi
call   1140 <strcat@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1120 <rename@plt>
test   %eax,%eax
jns    1879 <path_based_fops+0x609>
mov    %eax,%ebp
mov    0x2765(%rip),%rax
mov    (%rax),%r12d
mov    0x274b(%rip),%rax
mov    (%rax),%edi
call   1190 <strerror@plt>
lea    0x949(%rip),%rsi
mov    %r12d,%edi
mov    %rax,%rdx
call   10a0 <fprintf@plt>
or     %ebp,%r15d
lea    0x10(%rsp),%rdi
call   1030 <unlink@plt>
mov    0xc(%rsp),%edi
test   %edi,%edi
je     1890 <path_based_fops+0x620>
call   1090 <close@plt>
mov    %rbx,%rdi
call   1030 <unlink@plt>
jmp    18c8 <path_based_fops+0x658>
mov    0x2717(%rip),%rax
mov    (%rax),%ebx
mov    0x26fe(%rip),%rax
mov    (%rax),%edi
call   1190 <strerror@plt>
lea    0x76c(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   10a0 <fprintf@plt>
mov    $0xffffffff,%r15d
mov    %r15d,%eax
add    $0x518,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [18 x i8] c"linkfile-hard.txt\00"
@.str.1 = [18 x i8] c"linkfile-soft.txt\00"
@stderr = global i32 0
@.str.2 = [18 x i8] c"creat failed: %s\0A\00"
@errno = global i32 0
@.str.3 = [21 x i8] c"truncate failed: %s\0A\00"
@.str.4 = [17 x i8] c"stat failed: %s\0A\00"
@.str.5 = [18 x i8] c"chmod failed: %s\0A\00"
@.str.6 = [18 x i8] c"chown failed: %s\0A\00"
@.str.7 = [19 x i8] c"trusted.xattr-test\00"
@.str.8 = [8 x i8] c"working\00"
@.str.9 = [21 x i8] c"setxattr failed: %s\0A\00"
@.str.10 = [22 x i8] c"listxattr failed: %s\0A\00"
@.str.11 = [21 x i8] c"getxattr failed: %s\0A\00"
@.str.12 = [24 x i8] c"removexattr failed: %s\0A\00"
@R_OK = global i32 0
@W_OK = global i32 0
@.str.13 = [19 x i8] c"access failed: %s\0A\00"
@.str.14 = [17 x i8] c"link failed: %s\0A\00"
@.str.15 = [20 x i8] c"symlink failed: %s\0A\00"
@.str.16 = [21 x i8] c"readlink failed: %s\0A\00"
@.str.17 = [9 x i8] c"cspecial\00"
@S_IFCHR = global i32 0
@S_IRWXU = global i32 0
@S_IRWXG = global i32 0
@.str.18 = [27 x i8] c"cpsecial mknod failed: %s\0A\00"
@.str.19 = [9 x i8] c"bspecial\00"
@S_IFBLK = global i32 0
@.str.20 = [27 x i8] c"bspecial mknod failed: %s\0A\00"
@.str.21 = [5 x i8] c"fifo\00"
@S_IFIFO = global i32 0
@.str.22 = [23 x i8] c"fifo mknod failed: %s\0A\00"
@.str.23 = [5 x i8] c"sock\00"
@S_IFSOCK = global i32 0
@.str.24 = [23 x i8] c"sock mknod failed: %s\0A\00"
@.str.25 = [5 x i8] c"_new\00"
@.str.26 = [19 x i8] c"rename failed: %s\0A\00"
define i32 @path_based_fops(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.stat
%8 = alloca [255 x i8]
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca [1024 x i8]
store i8* %0, i8** %3
store i32 -1, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
%12 = bitcast %struct.stat* %7 to i8*
%13 = bitcast [255 x i8]* %8 to i8*
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8** %9
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8** %10
%14 = bitcast [1024 x i8]* %11 to i8*
%15 = load i8*, i8** %3
%16 = call i32 @creat(i8* %15, i32 420)
store i32 %16, i32* %5
%17 = load i32, i32* %5
%18 = icmp slt i32 %17, 0
br i1 %18, label %19, label %25
19: ; preds = %1
%20 = load i32, i32* @stderr
%21 = load i32, i32* @errno
%22 = call i8* @strerror(i32 %21)
%23 = call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %22)
%24 = load i32, i32* %4
store i32 %24, i32* %2
br label %296
25: ; preds = %1
%26 = load i8*, i8** %3
%27 = call i32 @truncate(i8* %26, i32 0)
store i32 %27, i32* %4
%28 = load i32, i32* %4
%29 = icmp slt i32 %28, 0
br i1 %29, label %30, label %38
30: ; preds = %25
%31 = load i32, i32* @stderr
%32 = load i32, i32* @errno
%33 = call i8* @strerror(i32 %32)
%34 = call i32 @fprintf(i32 %31, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* %33)
%35 = load i32, i32* %4
%36 = load i32, i32* %6
%37 = or i32 %36, %35
store i32 %37, i32* %6
br label %38
38: ; preds = %30, %25
%39 = load i8*, i8** %3
%40 = call i32 @stat(i8* %39, %struct.stat* %7)
store i32 %40, i32* %4
%41 = load i32, i32* %4
%42 = icmp slt i32 %41, 0
br i1 %42, label %43, label %51
43: ; preds = %38
%44 = load i32, i32* @stderr
%45 = load i32, i32* @errno
%46 = call i8* @strerror(i32 %45)
%47 = call i32 @fprintf(i32 %44, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8* %46)
%48 = load i32, i32* %4
%49 = load i32, i32* %6
%50 = or i32 %49, %48
store i32 %50, i32* %6
br label %51
51: ; preds = %43, %38
%52 = load i8*, i8** %3
%53 = call i32 @chmod(i8* %52, i32 416)
store i32 %53, i32* %4
%54 = load i32, i32* %4
%55 = icmp slt i32 %54, 0
br i1 %55, label %56, label %64
56: ; preds = %51
%57 = load i32, i32* @stderr
%58 = load i32, i32* @errno
%59 = call i8* @strerror(i32 %58)
%60 = call i32 @fprintf(i32 %57, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i8* %59)
%61 = load i32, i32* %4
%62 = load i32, i32* %6
%63 = or i32 %62, %61
store i32 %63, i32* %6
br label %64
64: ; preds = %56, %51
%65 = load i8*, i8** %3
%66 = call i32 @chown(i8* %65, i32 10001, i32 10001)
store i32 %66, i32* %4
%67 = load i32, i32* %4
%68 = icmp slt i32 %67, 0
br i1 %68, label %69, label %77
69: ; preds = %64
%70 = load i32, i32* @stderr
%71 = load i32, i32* @errno
%72 = call i8* @strerror(i32 %71)
%73 = call i32 @fprintf(i32 %70, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i8* %72)
%74 = load i32, i32* %4
%75 = load i32, i32* %6
%76 = or i32 %75, %74
store i32 %76, i32* %6
br label %77
77: ; preds = %69, %64
%78 = load i8*, i8** %3
%79 = call i32 @setxattr(i8* %78, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i32 8, i32 0)
store i32 %79, i32* %4
%80 = load i32, i32* %4
%81 = icmp slt i32 %80, 0
br i1 %81, label %82, label %90
82: ; preds = %77
%83 = load i32, i32* @stderr
%84 = load i32, i32* @errno
%85 = call i8* @strerror(i32 %84)
%86 = call i32 @fprintf(i32 %83, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), i8* %85)
%87 = load i32, i32* %4
%88 = load i32, i32* %6
%89 = or i32 %88, %87
store i32 %89, i32* %6
br label %90
90: ; preds = %82, %77
%91 = load i8*, i8** %3
%92 = call i32 @listxattr(i8* %91, i32* null, i32 0)
store i32 %92, i32* %4
%93 = load i32, i32* %4
%94 = icmp sle i32 %93, 0
br i1 %94, label %95, label %103
95: ; preds = %90
store i32 -1, i32* %4
%96 = load i32, i32* @stderr
%97 = load i32, i32* @errno
%98 = call i8* @strerror(i32 %97)
%99 = call i32 @fprintf(i32 %96, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0), i8* %98)
%100 = load i32, i32* %4
%101 = load i32, i32* %6
%102 = or i32 %101, %100
store i32 %102, i32* %6
br label %103
103: ; preds = %95, %90
%104 = load i8*, i8** %3
%105 = call i32 @getxattr(i8* %104, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i32* null, i32 0)
store i32 %105, i32* %4
%106 = load i32, i32* %4
%107 = icmp sle i32 %106, 0
br i1 %107, label %108, label %116
108: ; preds = %103
%109 = load i32, i32* @stderr
%110 = load i32, i32* @errno
%111 = call i8* @strerror(i32 %110)
%112 = call i32 @fprintf(i32 %109, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0), i8* %111)
%113 = load i32, i32* %4
%114 = load i32, i32* %6
%115 = or i32 %114, %113
store i32 %115, i32* %6
br label %116
116: ; preds = %108, %103
%117 = load i8*, i8** %3
%118 = call i32 @removexattr(i8* %117, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0))
store i32 %118, i32* %4
%119 = load i32, i32* %4
%120 = icmp slt i32 %119, 0
br i1 %120, label %121, label %129
121: ; preds = %116
%122 = load i32, i32* @stderr
%123 = load i32, i32* @errno
%124 = call i8* @strerror(i32 %123)
%125 = call i32 @fprintf(i32 %122, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.12, i64 0, i64 0), i8* %124)
%126 = load i32, i32* %4
%127 = load i32, i32* %6
%128 = or i32 %127, %126
store i32 %128, i32* %6
br label %129
129: ; preds = %121, %116
%130 = load i8*, i8** %3
%131 = load i32, i32* @R_OK
%132 = load i32, i32* @W_OK
%133 = or i32 %131, %132
%134 = call i32 @access(i8* %130, i32 %133)
store i32 %134, i32* %4
%135 = load i32, i32* %4
%136 = icmp slt i32 %135, 0
br i1 %136, label %137, label %145
137: ; preds = %129
%138 = load i32, i32* @stderr
%139 = load i32, i32* @errno
%140 = call i8* @strerror(i32 %139)
%141 = call i32 @fprintf(i32 %138, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.13, i64 0, i64 0), i8* %140)
%142 = load i32, i32* %4
%143 = load i32, i32* %6
%144 = or i32 %143, %142
store i32 %144, i32* %6
br label %145
145: ; preds = %137, %129
%146 = load i8*, i8** %3
%147 = load i8*, i8** %9
%148 = call i32 @link(i8* %146, i8* %147)
store i32 %148, i32* %4
%149 = load i32, i32* %4
%150 = icmp slt i32 %149, 0
br i1 %150, label %151, label %159
151: ; preds = %145
%152 = load i32, i32* @stderr
%153 = load i32, i32* @errno
%154 = call i8* @strerror(i32 %153)
%155 = call i32 @fprintf(i32 %152, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i64 0, i64 0), i8* %154)
%156 = load i32, i32* %4
%157 = load i32, i32* %6
%158 = or i32 %157, %156
store i32 %158, i32* %6
br label %159
159: ; preds = %151, %145
%160 = load i8*, i8** %9
%161 = call i32 @unlink(i8* %160)
%162 = load i8*, i8** %3
%163 = load i8*, i8** %10
%164 = call i32 @symlink(i8* %162, i8* %163)
store i32 %164, i32* %4
%165 = load i32, i32* %4
%166 = icmp slt i32 %165, 0
br i1 %166, label %167, label %175
167: ; preds = %159
%168 = load i32, i32* @stderr
%169 = load i32, i32* @errno
%170 = call i8* @strerror(i32 %169)
%171 = call i32 @fprintf(i32 %168, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.15, i64 0, i64 0), i8* %170)
%172 = load i32, i32* %4
%173 = load i32, i32* %6
%174 = or i32 %173, %172
store i32 %174, i32* %6
br label %175
175: ; preds = %167, %159
%176 = load i8*, i8** %10
%177 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%178 = call i32 @readlink(i8* %176, i8* %177, i32 1024)
store i32 %178, i32* %4
%179 = load i32, i32* %4
%180 = icmp slt i32 %179, 0
br i1 %180, label %181, label %189
181: ; preds = %175
%182 = load i32, i32* @stderr
%183 = load i32, i32* @errno
%184 = call i8* @strerror(i32 %183)
%185 = call i32 @fprintf(i32 %182, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.16, i64 0, i64 0), i8* %184)
%186 = load i32, i32* %4
%187 = load i32, i32* %6
%188 = or i32 %187, %186
store i32 %188, i32* %6
br label %189
189: ; preds = %181, %175
%190 = load i8*, i8** %10
%191 = call i32 @unlink(i8* %190)
%192 = load i32, i32* @S_IFCHR
%193 = load i32, i32* @S_IRWXU
%194 = or i32 %192, %193
%195 = load i32, i32* @S_IRWXG
%196 = or i32 %194, %195
%197 = call i32 @makedev(i32 2, i32 3)
%198 = call i32 @mknod(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.17, i64 0, i64 0), i32 %196, i32 %197)
store i32 %198, i32* %4
%199 = load i32, i32* %4
%200 = icmp slt i32 %199, 0
br i1 %200, label %201, label %209
201: ; preds = %189
%202 = load i32, i32* @stderr
%203 = load i32, i32* @errno
%204 = call i8* @strerror(i32 %203)
%205 = call i32 @fprintf(i32 %202, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.18, i64 0, i64 0), i8* %204)
%206 = load i32, i32* %4
%207 = load i32, i32* %6
%208 = or i32 %207, %206
store i32 %208, i32* %6
br label %209
209: ; preds = %201, %189
%210 = call i32 @unlink(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.17, i64 0, i64 0))
%211 = load i32, i32* @S_IFBLK
%212 = load i32, i32* @S_IRWXU
%213 = or i32 %211, %212
%214 = load i32, i32* @S_IRWXG
%215 = or i32 %213, %214
%216 = call i32 @makedev(i32 4, i32 5)
%217 = call i32 @mknod(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.19, i64 0, i64 0), i32 %215, i32 %216)
store i32 %217, i32* %4
%218 = load i32, i32* %4
%219 = icmp slt i32 %218, 0
br i1 %219, label %220, label %228
220: ; preds = %209
%221 = load i32, i32* @stderr
%222 = load i32, i32* @errno
%223 = call i8* @strerror(i32 %222)
%224 = call i32 @fprintf(i32 %221, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.20, i64 0, i64 0), i8* %223)
%225 = load i32, i32* %4
%226 = load i32, i32* %6
%227 = or i32 %226, %225
store i32 %227, i32* %6
br label %228
228: ; preds = %220, %209
%229 = call i32 @unlink(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.19, i64 0, i64 0))
%230 = load i32, i32* @S_IFIFO
%231 = load i32, i32* @S_IRWXU
%232 = or i32 %230, %231
%233 = load i32, i32* @S_IRWXG
%234 = or i32 %232, %233
%235 = call i32 @mknod(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0), i32 %234, i32 0)
store i32 %235, i32* %4
%236 = load i32, i32* %4
%237 = icmp slt i32 %236, 0
br i1 %237, label %238, label %246
238: ; preds = %228
%239 = load i32, i32* @stderr
%240 = load i32, i32* @errno
%241 = call i8* @strerror(i32 %240)
%242 = call i32 @fprintf(i32 %239, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.22, i64 0, i64 0), i8* %241)
%243 = load i32, i32* %4
%244 = load i32, i32* %6
%245 = or i32 %244, %243
store i32 %245, i32* %6
br label %246
246: ; preds = %238, %228
%247 = call i32 @unlink(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0))
%248 = load i32, i32* @S_IFSOCK
%249 = load i32, i32* @S_IRWXU
%250 = or i32 %248, %249
%251 = load i32, i32* @S_IRWXG
%252 = or i32 %250, %251
%253 = call i32 @mknod(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.23, i64 0, i64 0), i32 %252, i32 0)
store i32 %253, i32* %4
%254 = load i32, i32* %4
%255 = icmp slt i32 %254, 0
br i1 %255, label %256, label %264
256: ; preds = %246
%257 = load i32, i32* @stderr
%258 = load i32, i32* @errno
%259 = call i8* @strerror(i32 %258)
%260 = call i32 @fprintf(i32 %257, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.24, i64 0, i64 0), i8* %259)
%261 = load i32, i32* %4
%262 = load i32, i32* %6
%263 = or i32 %262, %261
store i32 %263, i32* %6
br label %264
264: ; preds = %256, %246
%265 = call i32 @unlink(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.23, i64 0, i64 0))
%266 = getelementptr inbounds [255 x i8], [255 x i8]* %8, i64 0, i64 0
%267 = load i8*, i8** %3
%268 = call i32 @strcpy(i8* %266, i8* %267)
%269 = getelementptr inbounds [255 x i8], [255 x i8]* %8, i64 0, i64 0
%270 = call i32 @strcat(i8* %269, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.25, i64 0, i64 0))
%271 = load i8*, i8** %3
%272 = getelementptr inbounds [255 x i8], [255 x i8]* %8, i64 0, i64 0
%273 = call i32 @rename(i8* %271, i8* %272)
store i32 %273, i32* %4
%274 = load i32, i32* %4
%275 = icmp slt i32 %274, 0
br i1 %275, label %276, label %284
276: ; preds = %264
%277 = load i32, i32* @stderr
%278 = load i32, i32* @errno
%279 = call i8* @strerror(i32 %278)
%280 = call i32 @fprintf(i32 %277, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.26, i64 0, i64 0), i8* %279)
%281 = load i32, i32* %4
%282 = load i32, i32* %6
%283 = or i32 %282, %281
store i32 %283, i32* %6
br label %284
284: ; preds = %276, %264
%285 = getelementptr inbounds [255 x i8], [255 x i8]* %8, i64 0, i64 0
%286 = call i32 @unlink(i8* %285)
%287 = load i32, i32* %5
%288 = icmp ne i32 %287, 0
br i1 %288, label %289, label %292
289: ; preds = %284
%290 = load i32, i32* %5
%291 = call i32 @close(i32 %290)
br label %292
292: ; preds = %289, %284
%293 = load i8*, i8** %3
%294 = call i32 @unlink(i8* %293)
%295 = load i32, i32* %6
store i32 %295, i32* %2
br label %296
296: ; preds = %292, %19
%297 = load i32, i32* %2
ret i32 %297
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [18 x i8] c"linkfile-hard.txt\00"
@.str.1 = [18 x i8] c"linkfile-soft.txt\00"
@stderr = global i32 0
@.str.2 = [18 x i8] c"creat failed: %s\0A\00"
@errno = global i32 0
@.str.3 = [21 x i8] c"truncate failed: %s\0A\00"
@.str.4 = [17 x i8] c"stat failed: %s\0A\00"
@.str.5 = [18 x i8] c"chmod failed: %s\0A\00"
@.str.6 = [18 x i8] c"chown failed: %s\0A\00"
@.str.7 = [19 x i8] c"trusted.xattr-test\00"
@.str.8 = [8 x i8] c"working\00"
@.str.9 = [21 x i8] c"setxattr failed: %s\0A\00"
@.str.10 = [22 x i8] c"listxattr failed: %s\0A\00"
@.str.11 = [21 x i8] c"getxattr failed: %s\0A\00"
@.str.12 = [24 x i8] c"removexattr failed: %s\0A\00"
@R_OK = global i32 0
@W_OK = global i32 0
@.str.13 = [19 x i8] c"access failed: %s\0A\00"
@.str.14 = [17 x i8] c"link failed: %s\0A\00"
@.str.15 = [20 x i8] c"symlink failed: %s\0A\00"
@.str.16 = [21 x i8] c"readlink failed: %s\0A\00"
@.str.17 = [9 x i8] c"cspecial\00"
@S_IFCHR = global i32 0
@S_IRWXU = global i32 0
@S_IRWXG = global i32 0
@.str.18 = [27 x i8] c"cpsecial mknod failed: %s\0A\00"
@.str.19 = [9 x i8] c"bspecial\00"
@S_IFBLK = global i32 0
@.str.20 = [27 x i8] c"bspecial mknod failed: %s\0A\00"
@.str.21 = [5 x i8] c"fifo\00"
@S_IFIFO = global i32 0
@.str.22 = [23 x i8] c"fifo mknod failed: %s\0A\00"
@.str.23 = [5 x i8] c"sock\00"
@S_IFSOCK = global i32 0
@.str.24 = [23 x i8] c"sock mknod failed: %s\0A\00"
@.str.25 = [5 x i8] c"_new\00"
@.str.26 = [19 x i8] c"rename failed: %s\0A\00"
define i32 @path_based_fops(i8* %0) {
%2 = alloca %struct.stat
%3 = alloca [255 x i8]
%4 = alloca [1024 x i8]
%5 = bitcast %struct.stat* %2 to i8*
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
store i32 0, i32* %6
%7 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%9 = tail call i32 @creat(i8* %0, i32 420)
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %1
%12 = load i32, i32* @stderr
%13 = load i32, i32* @errno
%14 = tail call i8* @strerror(i32 %13)
%15 = tail call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %14)
br label %224
16: ; preds = %1
%17 = tail call i32 @truncate(i8* %0, i32 0)
%18 = icmp slt i32 %17, 0
br i1 %18, label %19, label %24
19: ; preds = %16
%20 = load i32, i32* @stderr
%21 = load i32, i32* @errno
%22 = tail call i8* @strerror(i32 %21)
%23 = tail call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* %22)
br label %24
24: ; preds = %19, %16
%25 = phi i32 [ %17, %19 ], [ 0, %16 ]
%26 = call i32 @stat(i8* %0, %struct.stat* %2)
%27 = icmp slt i32 %26, 0
br i1 %27, label %28, label %34
28: ; preds = %24
%29 = load i32, i32* @stderr
%30 = load i32, i32* @errno
%31 = tail call i8* @strerror(i32 %30)
%32 = tail call i32 @fprintf(i32 %29, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8* %31)
%33 = or i32 %26, %25
br label %34
34: ; preds = %28, %24
%35 = phi i32 [ %33, %28 ], [ %25, %24 ]
%36 = tail call i32 @chmod(i8* %0, i32 416)
%37 = icmp slt i32 %36, 0
br i1 %37, label %38, label %44
38: ; preds = %34
%39 = load i32, i32* @stderr
%40 = load i32, i32* @errno
%41 = tail call i8* @strerror(i32 %40)
%42 = tail call i32 @fprintf(i32 %39, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i8* %41)
%43 = or i32 %36, %35
br label %44
44: ; preds = %38, %34
%45 = phi i32 [ %43, %38 ], [ %35, %34 ]
%46 = tail call i32 @chown(i8* %0, i32 10001, i32 10001)
%47 = icmp slt i32 %46, 0
br i1 %47, label %48, label %54
48: ; preds = %44
%49 = load i32, i32* @stderr
%50 = load i32, i32* @errno
%51 = tail call i8* @strerror(i32 %50)
%52 = tail call i32 @fprintf(i32 %49, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i8* %51)
%53 = or i32 %46, %45
br label %54
54: ; preds = %48, %44
%55 = phi i32 [ %53, %48 ], [ %45, %44 ]
%56 = tail call i32 @setxattr(i8* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i32 8, i32 0)
%57 = icmp slt i32 %56, 0
br i1 %57, label %58, label %64
58: ; preds = %54
%59 = load i32, i32* @stderr
%60 = load i32, i32* @errno
%61 = tail call i8* @strerror(i32 %60)
%62 = tail call i32 @fprintf(i32 %59, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), i8* %61)
%63 = or i32 %56, %55
br label %64
64: ; preds = %58, %54
%65 = phi i32 [ %63, %58 ], [ %55, %54 ]
%66 = tail call i32 @listxattr(i8* %0, i32* null, i32 0)
%67 = icmp slt i32 %66, 1
br i1 %67, label %68, label %73
68: ; preds = %64
%69 = load i32, i32* @stderr
%70 = load i32, i32* @errno
%71 = tail call i8* @strerror(i32 %70)
%72 = tail call i32 @fprintf(i32 %69, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0), i8* %71)
br label %73
73: ; preds = %68, %64
%74 = phi i32 [ -1, %68 ], [ %65, %64 ]
%75 = tail call i32 @getxattr(i8* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i32* null, i32 0)
%76 = icmp slt i32 %75, 1
br i1 %76, label %77, label %83
77: ; preds = %73
%78 = load i32, i32* @stderr
%79 = load i32, i32* @errno
%80 = tail call i8* @strerror(i32 %79)
%81 = tail call i32 @fprintf(i32 %78, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0), i8* %80)
%82 = or i32 %75, %74
br label %83
83: ; preds = %77, %73
%84 = phi i32 [ %82, %77 ], [ %74, %73 ]
%85 = tail call i32 @removexattr(i8* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0))
%86 = icmp slt i32 %85, 0
br i1 %86, label %87, label %93
87: ; preds = %83
%88 = load i32, i32* @stderr
%89 = load i32, i32* @errno
%90 = tail call i8* @strerror(i32 %89)
%91 = tail call i32 @fprintf(i32 %88, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.12, i64 0, i64 0), i8* %90)
%92 = or i32 %85, %84
br label %93
93: ; preds = %87, %83
%94 = phi i32 [ %92, %87 ], [ %84, %83 ]
%95 = load i32, i32* @R_OK
%96 = load i32, i32* @W_OK
%97 = or i32 %96, %95
%98 = tail call i32 @access(i8* %0, i32 %97)
%99 = icmp slt i32 %98, 0
br i1 %99, label %100, label %106
100: ; preds = %93
%101 = load i32, i32* @stderr
%102 = load i32, i32* @errno
%103 = tail call i8* @strerror(i32 %102)
%104 = tail call i32 @fprintf(i32 %101, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.13, i64 0, i64 0), i8* %103)
%105 = or i32 %98, %94
br label %106
106: ; preds = %100, %93
%107 = phi i32 [ %105, %100 ], [ %94, %93 ]
%108 = tail call i32 @link(i8* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%109 = icmp slt i32 %108, 0
br i1 %109, label %110, label %116
110: ; preds = %106
%111 = load i32, i32* @stderr
%112 = load i32, i32* @errno
%113 = tail call i8* @strerror(i32 %112)
%114 = tail call i32 @fprintf(i32 %111, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i64 0, i64 0), i8* %113)
%115 = or i32 %108, %107
br label %116
116: ; preds = %110, %106
%117 = phi i32 [ %115, %110 ], [ %107, %106 ]
%118 = tail call i32 @unlink(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%119 = tail call i32 @symlink(i8* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%120 = icmp slt i32 %119, 0
br i1 %120, label %121, label %127
121: ; preds = %116
%122 = load i32, i32* @stderr
%123 = load i32, i32* @errno
%124 = tail call i8* @strerror(i32 %123)
%125 = tail call i32 @fprintf(i32 %122, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.15, i64 0, i64 0), i8* %124)
%126 = or i32 %119, %117
br label %127
127: ; preds = %121, %116
%128 = phi i32 [ %126, %121 ], [ %117, %116 ]
%129 = call i32 @readlink(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %8, i32 1024)
%130 = icmp slt i32 %129, 0
br i1 %130, label %131, label %137
131: ; preds = %127
%132 = load i32, i32* @stderr
%133 = load i32, i32* @errno
%134 = tail call i8* @strerror(i32 %133)
%135 = tail call i32 @fprintf(i32 %132, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.16, i64 0, i64 0), i8* %134)
%136 = or i32 %129, %128
br label %137
137: ; preds = %131, %127
%138 = phi i32 [ %136, %131 ], [ %128, %127 ]
%139 = tail call i32 @unlink(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%140 = load i32, i32* @S_IFCHR
%141 = load i32, i32* @S_IRWXU
%142 = or i32 %141, %140
%143 = load i32, i32* @S_IRWXG
%144 = or i32 %142, %143
%145 = tail call i32 @makedev(i32 2, i32 3)
%146 = tail call i32 @mknod(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.17, i64 0, i64 0), i32 %144, i32 %145)
%147 = icmp slt i32 %146, 0
br i1 %147, label %148, label %154
148: ; preds = %137
%149 = load i32, i32* @stderr
%150 = load i32, i32* @errno
%151 = tail call i8* @strerror(i32 %150)
%152 = tail call i32 @fprintf(i32 %149, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.18, i64 0, i64 0), i8* %151)
%153 = or i32 %146, %138
br label %154
154: ; preds = %148, %137
%155 = phi i32 [ %153, %148 ], [ %138, %137 ]
%156 = tail call i32 @unlink(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.17, i64 0, i64 0))
%157 = load i32, i32* @S_IFBLK
%158 = load i32, i32* @S_IRWXU
%159 = or i32 %158, %157
%160 = load i32, i32* @S_IRWXG
%161 = or i32 %159, %160
%162 = tail call i32 @makedev(i32 4, i32 5)
%163 = tail call i32 @mknod(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.19, i64 0, i64 0), i32 %161, i32 %162)
%164 = icmp slt i32 %163, 0
br i1 %164, label %165, label %171
165: ; preds = %154
%166 = load i32, i32* @stderr
%167 = load i32, i32* @errno
%168 = tail call i8* @strerror(i32 %167)
%169 = tail call i32 @fprintf(i32 %166, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.20, i64 0, i64 0), i8* %168)
%170 = or i32 %163, %155
br label %171
171: ; preds = %165, %154
%172 = phi i32 [ %170, %165 ], [ %155, %154 ]
%173 = tail call i32 @unlink(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.19, i64 0, i64 0))
%174 = load i32, i32* @S_IFIFO
%175 = load i32, i32* @S_IRWXU
%176 = or i32 %175, %174
%177 = load i32, i32* @S_IRWXG
%178 = or i32 %176, %177
%179 = tail call i32 @mknod(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0), i32 %178, i32 0)
%180 = icmp slt i32 %179, 0
br i1 %180, label %181, label %187
181: ; preds = %171
%182 = load i32, i32* @stderr
%183 = load i32, i32* @errno
%184 = tail call i8* @strerror(i32 %183)
%185 = tail call i32 @fprintf(i32 %182, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.22, i64 0, i64 0), i8* %184)
%186 = or i32 %179, %172
br label %187
187: ; preds = %181, %171
%188 = phi i32 [ %186, %181 ], [ %172, %171 ]
%189 = tail call i32 @unlink(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0))
%190 = load i32, i32* @S_IFSOCK
%191 = load i32, i32* @S_IRWXU
%192 = or i32 %191, %190
%193 = load i32, i32* @S_IRWXG
%194 = or i32 %192, %193
%195 = tail call i32 @mknod(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.23, i64 0, i64 0), i32 %194, i32 0)
%196 = icmp slt i32 %195, 0
br i1 %196, label %197, label %203
197: ; preds = %187
%198 = load i32, i32* @stderr
%199 = load i32, i32* @errno
%200 = tail call i8* @strerror(i32 %199)
%201 = tail call i32 @fprintf(i32 %198, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.24, i64 0, i64 0), i8* %200)
%202 = or i32 %195, %188
br label %203
203: ; preds = %197, %187
%204 = phi i32 [ %202, %197 ], [ %188, %187 ]
%205 = tail call i32 @unlink(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.23, i64 0, i64 0))
%206 = call i32 @strcpy(i8* %7, i8* %0)
%207 = call i32 @strcat(i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.25, i64 0, i64 0))
%208 = call i32 @rename(i8* %0, i8* %7)
%209 = icmp slt i32 %208, 0
br i1 %209, label %210, label %216
210: ; preds = %203
%211 = load i32, i32* @stderr
%212 = load i32, i32* @errno
%213 = call i8* @strerror(i32 %212)
%214 = call i32 @fprintf(i32 %211, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.26, i64 0, i64 0), i8* %213)
%215 = or i32 %208, %204
br label %216
216: ; preds = %210, %203
%217 = phi i32 [ %215, %210 ], [ %204, %203 ]
%218 = call i32 @unlink(i8* %7)
%219 = icmp eq i32 %9, 0
br i1 %219, label %222, label %220
220: ; preds = %216
%221 = call i32 @close(i32 %9)
br label %222
222: ; preds = %220, %216
%223 = call i32 @unlink(i8* %0)
br label %224
224: ; preds = %222, %11
%225 = phi i32 [ -1, %11 ], [ %217, %222 ]
ret i32 %225
}