#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 uid_t;
struct stat {
  int st_size;
  int st_uid;
  int st_gid;
  int st_mode;
};
typedef int gid_t;

/* Variables and functions */
int /*<<< orphan*/ F_OK;
int O_CREAT;
int O_RDWR;
int O_TRUNC;
int /*<<< orphan*/ S_IRWXU;
int /*<<< orphan*/ access_test(char *, int /*<<< orphan*/);
int /*<<< orphan*/ close_test(int);
int expect_gez(int /*<<< orphan*/, int);
int expect_gid(int /*<<< orphan*/, int);
int expect_uid(int /*<<< orphan*/, int);
int expect_val(int, int);
int expect_zng(int, int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int getgid_test();
int getuid_test();
int /*<<< orphan*/ lchown_test(char *, int, int);
int /*<<< orphan*/ link_test(char *, char *);
int /*<<< orphan*/ lstat_test(char *, struct stat *);
int open_test(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int readlink_test(char *, char *, int);
int /*<<< orphan*/ stat_test(char *, struct stat *);
int /*<<< orphan*/ symlink_test(char *, char *);
int /*<<< orphan*/ testbreak();
int /*<<< orphan*/ unlink_test(char *);
int /*<<< orphan*/ xtmpnam(char *);
int BasicLink(void) {
  char tf[8192] = {0};
  char slink[8192] = {0};
  char hlink[8192] = {0};
  char readlink_buf[8192] = {0};
  int fd;
  int passed;
  int block = 0;
  struct stat buf;
  struct stat buf2;
  uid_t uid;
  gid_t gid;
  int ls;
  xtmpnam(tf);
  xtmpnam(slink);
  xtmpnam(hlink);
  testbreak();
  passed =
      expect_gez(0, fd = open_test(tf, O_RDWR | O_TRUNC | O_CREAT, S_IRWXU));
  if (passed != 0) {
    printf("\tFailed Phase 2: This call did something unexpected.\n");
    fflush(NULL);
    block = -1;
  };
  if (passed == -1) {
    printf("\tFail Phase 2: Aborting test because of catastrophic failure\n");
    fflush(NULL);
    return passed;
  };
  passed = expect_zng(0, close_test(fd));
  if (passed != 0) {
    printf("\tFailed Phase 2: This call did something unexpected.\n");
    fflush(NULL);
    block = -1;
  };
  passed = expect_zng(0, symlink_test(tf, slink));
  if (passed != 0) {
    printf("\tFailed Phase 2: This call did something unexpected.\n");
    fflush(NULL);
    block = -1;
  };
  if (passed == -1) {
    printf("\tFail Phase 2: Aborting test because of catastrophic failure\n");
    fflush(NULL);
    return passed;
  };
  passed = expect_gez(0, ls = readlink_test(slink, readlink_buf, 8192));
  if (passed != 0) {
    printf("\tFailed Phase 2: This call did something unexpected.\n");
    fflush(NULL);
    block = -1;
  };
  passed = expect_zng(0, lstat_test(slink, &buf));
  if (passed != 0) {
    printf("\tFailed Phase 2: This call did something unexpected.\n");
    fflush(NULL);
    block = -1;
  };
  passed = expect_val(ls, buf.st_size);
  if (passed != 0) {
    printf("\tFailed Phase 2: This call did something unexpected.\n");
    fflush(NULL);
    block = -1;
  };
  passed = expect_uid(0, uid = getuid_test());
  if (passed != 0) {
    printf("\tFailed Phase 2: This call did something unexpected.\n");
    fflush(NULL);
    block = -1;
  };
  passed = expect_gid(0, gid = getgid_test());
  if (passed != 0) {
    printf("\tFailed Phase 2: This call did something unexpected.\n");
    fflush(NULL);
    block = -1;
  };
  passed = expect_zng(0, lchown_test(slink, uid, gid));
  if (passed != 0) {
    printf("\tFailed Phase 2: This call did something unexpected.\n");
    fflush(NULL);
    block = -1;
  };
  passed = expect_zng(0, lstat_test(slink, &buf2));
  if (passed != 0) {
    printf("\tFailed Phase 2: This call did something unexpected.\n");
    fflush(NULL);
    block = -1;
  };
  passed = expect_val(uid, buf2.st_uid);
  if (passed != 0) {
    printf("\tFailed Phase 2: This call did something unexpected.\n");
    fflush(NULL);
    block = -1;
  };
  passed = expect_val(gid, buf2.st_gid);
  if (passed != 0) {
    printf("\tFailed Phase 2: This call did something unexpected.\n");
    fflush(NULL);
    block = -1;
  };
  passed = expect_val(buf.st_size, buf2.st_size);
  if (passed != 0) {
    printf("\tFailed Phase 2: This call did something unexpected.\n");
    fflush(NULL);
    block = -1;
  };
  passed = expect_val(buf.st_mode, buf2.st_mode);
  if (passed != 0) {
    printf("\tFailed Phase 2: This call did something unexpected.\n");
    fflush(NULL);
    block = -1;
  };
  passed = expect_zng(0, unlink_test(tf));
  if (passed != 0) {
    printf("\tFailed Phase 2: This call did something unexpected.\n");
    fflush(NULL);
    block = -1;
  };
  passed = expect_zng(-1, access_test(tf, F_OK));
  if (passed != 0) {
    printf("\tFailed Phase 2: This call did something unexpected.\n");
    fflush(NULL);
    block = -1;
  };
  passed = expect_zng(-1, access_test(slink, F_OK));
  if (passed != 0) {
    printf("\tFailed Phase 2: This call did something unexpected.\n");
    fflush(NULL);
    block = -1;
  };
  passed = expect_zng(0, lstat_test(slink, &buf));
  if (passed != 0) {
    printf("\tFailed Phase 2: This call did something unexpected.\n");
    fflush(NULL);
    block = -1;
  };
  passed = expect_zng(0, unlink_test(slink));
  if (passed != 0) {
    printf("\tFailed Phase 2: This call did something unexpected.\n");
    fflush(NULL);
    block = -1;
  };
  passed = expect_zng(-1, access_test(slink, F_OK));
  if (passed != 0) {
    printf("\tFailed Phase 2: This call did something unexpected.\n");
    fflush(NULL);
    block = -1;
  };
  passed = expect_zng(-1, lstat_test(slink, &buf));
  if (passed != 0) {
    printf("\tFailed Phase 2: This call did something unexpected.\n");
    fflush(NULL);
    block = -1;
  };
  testbreak();
  passed =
      expect_gez(0, fd = open_test(tf, O_RDWR | O_TRUNC | O_CREAT, S_IRWXU));
  if (passed != 0) {
    printf("\tFailed Phase 2: This call did something unexpected.\n");
    fflush(NULL);
    block = -1;
  };
  if (passed == -1) {
    printf("\tFail Phase 2: Aborting test because of catastrophic failure\n");
    fflush(NULL);
    return passed;
  };
  passed = expect_zng(0, close_test(fd));
  if (passed != 0) {
    printf("\tFailed Phase 2: This call did something unexpected.\n");
    fflush(NULL);
    block = -1;
  };
  passed = expect_zng(0, link_test(tf, hlink));
  if (passed != 0) {
    printf("\tFailed Phase 2: This call did something unexpected.\n");
    fflush(NULL);
    block = -1;
  };
  if (passed == -1) {
    printf("\tFail Phase 2: Aborting test because of catastrophic failure\n");
    fflush(NULL);
    return passed;
  };
  passed = expect_zng(0, stat_test(tf, &buf));
  if (passed != 0) {
    printf("\tFailed Phase 2: This call did something unexpected.\n");
    fflush(NULL);
    block = -1;
  };
  passed = expect_zng(0, lstat_test(hlink, &buf2));
  if (passed != 0) {
    printf("\tFailed Phase 2: This call did something unexpected.\n");
    fflush(NULL);
    block = -1;
  };
  passed = expect_val(buf.st_size, buf2.st_size);
  if (passed != 0) {
    printf("\tFailed Phase 2: This call did something unexpected.\n");
    fflush(NULL);
    block = -1;
  };
  passed = expect_val(buf.st_mode, buf2.st_mode);
  if (passed != 0) {
    printf("\tFailed Phase 2: This call did something unexpected.\n");
    fflush(NULL);
    block = -1;
  };
  passed = expect_zng(0, unlink_test(tf));
  if (passed != 0) {
    printf("\tFailed Phase 2: This call did something unexpected.\n");
    fflush(NULL);
    block = -1;
  };
  passed = expect_zng(-1, access_test(tf, F_OK));
  if (passed != 0) {
    printf("\tFailed Phase 2: This call did something unexpected.\n");
    fflush(NULL);
    block = -1;
  };
  passed = expect_zng(0, access_test(hlink, F_OK));
  if (passed != 0) {
    printf("\tFailed Phase 2: This call did something unexpected.\n");
    fflush(NULL);
    block = -1;
  };
  passed = expect_zng(0, stat_test(hlink, &buf2));
  if (passed != 0) {
    printf("\tFailed Phase 2: This call did something unexpected.\n");
    fflush(NULL);
    block = -1;
  };
  passed = expect_val(buf2.st_mode, buf.st_mode);
  if (passed != 0) {
    printf("\tFailed Phase 2: This call did something unexpected.\n");
    fflush(NULL);
    block = -1;
  };
  passed = expect_zng(0, unlink_test(hlink));
  if (passed != 0) {
    printf("\tFailed Phase 2: This call did something unexpected.\n");
    fflush(NULL);
    block = -1;
  };
  passed = expect_zng(-1, access_test(hlink, F_OK));
  if (passed != 0) {
    printf("\tFailed Phase 2: This call did something unexpected.\n");
    fflush(NULL);
    block = -1;
  };
  testbreak();
  return block;
}


x86 assembly (clang, -O0):
<BasicLink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x8050,%rsp
lea    -0x2010(%rbp),%rdi
xor    %esi,%esi
mov    $0x2000,%edx
call   1090 <memset@plt>
lea    -0x4010(%rbp),%rdi
xor    %esi,%esi
mov    $0x2000,%edx
call   1090 <memset@plt>
lea    -0x6010(%rbp),%rdi
xor    %esi,%esi
mov    $0x2000,%edx
call   1090 <memset@plt>
lea    -0x8010(%rbp),%rdi
xor    %esi,%esi
mov    $0x2000,%edx
call   1090 <memset@plt>
movl   $0x0,-0x801c(%rbp)
lea    -0x2010(%rbp),%rdi
call   1040 <xtmpnam@plt>
lea    -0x4010(%rbp),%rdi
call   1040 <xtmpnam@plt>
lea    -0x6010(%rbp),%rdi
call   1040 <xtmpnam@plt>
mov    $0x0,%al
call   1100 <testbreak@plt>
lea    -0x2010(%rbp),%rdi
mov    0x2cd6(%rip),%rax
mov    (%rax),%esi
mov    0x2ced(%rip),%rax
or     (%rax),%esi
mov    0x2cec(%rip),%rax
or     (%rax),%esi
mov    0x2cc3(%rip),%rax
mov    (%rax),%edx
call   10b0 <open_test@plt>
mov    %eax,%esi
mov    %esi,-0x8014(%rbp)
xor    %edi,%edi
call   1170 <expect_gez@plt>
mov    %eax,-0x8018(%rbp)
cmpl   $0x0,-0x8018(%rbp)
je     135d <BasicLink+0xfd>
lea    0xcbb(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10f0 <fflush@plt>
movl   $0xffffffff,-0x801c(%rbp)
ff ff ff
cmpl   $0xffffffff,-0x8018(%rbp)
jne    138d <BasicLink+0x12d>
lea    0xcc5(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10f0 <fflush@plt>
mov    -0x8018(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1e51 <BasicLink+0xbf1>
mov    -0x8014(%rbp),%edi
call   1060 <close_test@plt>
mov    %eax,%esi
xor    %edi,%edi
call   10d0 <expect_zng@plt>
mov    %eax,-0x8018(%rbp)
cmpl   $0x0,-0x8018(%rbp)
je     13d3 <BasicLink+0x173>
lea    0xc45(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10f0 <fflush@plt>
movl   $0xffffffff,-0x801c(%rbp)
ff ff ff
lea    -0x2010(%rbp),%rdi
lea    -0x4010(%rbp),%rsi
call   1180 <symlink_test@plt>
mov    %eax,%esi
xor    %edi,%edi
call   10d0 <expect_zng@plt>
mov    %eax,-0x8018(%rbp)
cmpl   $0x0,-0x8018(%rbp)
je     1421 <BasicLink+0x1c1>
lea    0xbf7(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10f0 <fflush@plt>
movl   $0xffffffff,-0x801c(%rbp)
ff ff ff
cmpl   $0xffffffff,-0x8018(%rbp)
jne    1451 <BasicLink+0x1f1>
lea    0xc01(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10f0 <fflush@plt>
mov    -0x8018(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1e51 <BasicLink+0xbf1>
lea    -0x4010(%rbp),%rdi
lea    -0x8010(%rbp),%rsi
mov    $0x2000,%edx
call   1160 <readlink_test@plt>
mov    %eax,%esi
mov    %esi,-0x804c(%rbp)
xor    %edi,%edi
call   1170 <expect_gez@plt>
mov    %eax,-0x8018(%rbp)
cmpl   $0x0,-0x8018(%rbp)
je     14aa <BasicLink+0x24a>
lea    0xb6e(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10f0 <fflush@plt>
movl   $0xffffffff,-0x801c(%rbp)
ff ff ff
lea    -0x4010(%rbp),%rdi
lea    -0x8030(%rbp),%rsi
call   10a0 <lstat_test@plt>
mov    %eax,%esi
xor    %edi,%edi
call   10d0 <expect_zng@plt>
mov    %eax,-0x8018(%rbp)
cmpl   $0x0,-0x8018(%rbp)
je     14f8 <BasicLink+0x298>
lea    0xb20(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10f0 <fflush@plt>
movl   $0xffffffff,-0x801c(%rbp)
ff ff ff
mov    -0x804c(%rbp),%edi
mov    -0x8030(%rbp),%esi
call   1110 <expect_val@plt>
mov    %eax,-0x8018(%rbp)
cmpl   $0x0,-0x8018(%rbp)
je     153b <BasicLink+0x2db>
lea    0xadd(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10f0 <fflush@plt>
movl   $0xffffffff,-0x801c(%rbp)
ff ff ff
mov    $0x0,%al
call   10e0 <getuid_test@plt>
mov    %eax,%esi
mov    %esi,-0x8044(%rbp)
xor    %edi,%edi
call   1030 <expect_uid@plt>
mov    %eax,-0x8018(%rbp)
cmpl   $0x0,-0x8018(%rbp)
je     1583 <BasicLink+0x323>
lea    0xa95(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10f0 <fflush@plt>
movl   $0xffffffff,-0x801c(%rbp)
ff ff ff
mov    $0x0,%al
call   10c0 <getgid_test@plt>
mov    %eax,%esi
mov    %esi,-0x8048(%rbp)
xor    %edi,%edi
call   1140 <expect_gid@plt>
mov    %eax,-0x8018(%rbp)
cmpl   $0x0,-0x8018(%rbp)
je     15cb <BasicLink+0x36b>
lea    0xa4d(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10f0 <fflush@plt>
movl   $0xffffffff,-0x801c(%rbp)
ff ff ff
lea    -0x4010(%rbp),%rdi
mov    -0x8044(%rbp),%esi
mov    -0x8048(%rbp),%edx
call   1070 <lchown_test@plt>
mov    %eax,%esi
xor    %edi,%edi
call   10d0 <expect_zng@plt>
mov    %eax,-0x8018(%rbp)
cmpl   $0x0,-0x8018(%rbp)
je     161e <BasicLink+0x3be>
lea    0x9fa(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10f0 <fflush@plt>
movl   $0xffffffff,-0x801c(%rbp)
ff ff ff
lea    -0x4010(%rbp),%rdi
lea    -0x8040(%rbp),%rsi
call   10a0 <lstat_test@plt>
mov    %eax,%esi
xor    %edi,%edi
call   10d0 <expect_zng@plt>
mov    %eax,-0x8018(%rbp)
cmpl   $0x0,-0x8018(%rbp)
je     166c <BasicLink+0x40c>
lea    0x9ac(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10f0 <fflush@plt>
movl   $0xffffffff,-0x801c(%rbp)
ff ff ff
mov    -0x8044(%rbp),%edi
mov    -0x803c(%rbp),%esi
call   1110 <expect_val@plt>
mov    %eax,-0x8018(%rbp)
cmpl   $0x0,-0x8018(%rbp)
je     16af <BasicLink+0x44f>
lea    0x969(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10f0 <fflush@plt>
movl   $0xffffffff,-0x801c(%rbp)
ff ff ff
mov    -0x8048(%rbp),%edi
mov    -0x8038(%rbp),%esi
call   1110 <expect_val@plt>
mov    %eax,-0x8018(%rbp)
cmpl   $0x0,-0x8018(%rbp)
je     16f2 <BasicLink+0x492>
lea    0x926(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10f0 <fflush@plt>
movl   $0xffffffff,-0x801c(%rbp)
ff ff ff
mov    -0x8030(%rbp),%edi
mov    -0x8040(%rbp),%esi
call   1110 <expect_val@plt>
mov    %eax,-0x8018(%rbp)
cmpl   $0x0,-0x8018(%rbp)
je     1735 <BasicLink+0x4d5>
lea    0x8e3(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10f0 <fflush@plt>
movl   $0xffffffff,-0x801c(%rbp)
ff ff ff
mov    -0x8024(%rbp),%edi
mov    -0x8034(%rbp),%esi
call   1110 <expect_val@plt>
mov    %eax,-0x8018(%rbp)
cmpl   $0x0,-0x8018(%rbp)
je     1778 <BasicLink+0x518>
lea    0x8a0(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10f0 <fflush@plt>
movl   $0xffffffff,-0x801c(%rbp)
ff ff ff
lea    -0x2010(%rbp),%rdi
call   1120 <unlink_test@plt>
mov    %eax,%esi
xor    %edi,%edi
call   10d0 <expect_zng@plt>
mov    %eax,-0x8018(%rbp)
cmpl   $0x0,-0x8018(%rbp)
je     17bf <BasicLink+0x55f>
lea    0x859(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10f0 <fflush@plt>
movl   $0xffffffff,-0x801c(%rbp)
ff ff ff
lea    -0x2010(%rbp),%rdi
mov    0x27eb(%rip),%rax
mov    (%rax),%esi
call   1130 <access_test@plt>
mov    %eax,%esi
mov    $0xffffffff,%edi
call   10d0 <expect_zng@plt>
mov    %eax,-0x8018(%rbp)
cmpl   $0x0,-0x8018(%rbp)
je     1812 <BasicLink+0x5b2>
lea    0x806(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10f0 <fflush@plt>
movl   $0xffffffff,-0x801c(%rbp)
ff ff ff
lea    -0x4010(%rbp),%rdi
mov    0x2798(%rip),%rax
mov    (%rax),%esi
call   1130 <access_test@plt>
mov    %eax,%esi
mov    $0xffffffff,%edi
call   10d0 <expect_zng@plt>
mov    %eax,-0x8018(%rbp)
cmpl   $0x0,-0x8018(%rbp)
je     1865 <BasicLink+0x605>
lea    0x7b3(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10f0 <fflush@plt>
movl   $0xffffffff,-0x801c(%rbp)
ff ff ff
lea    -0x4010(%rbp),%rdi
lea    -0x8030(%rbp),%rsi
call   10a0 <lstat_test@plt>
mov    %eax,%esi
xor    %edi,%edi
call   10d0 <expect_zng@plt>
mov    %eax,-0x8018(%rbp)
cmpl   $0x0,-0x8018(%rbp)
je     18b3 <BasicLink+0x653>
lea    0x765(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10f0 <fflush@plt>
movl   $0xffffffff,-0x801c(%rbp)
ff ff ff
lea    -0x4010(%rbp),%rdi
call   1120 <unlink_test@plt>
mov    %eax,%esi
xor    %edi,%edi
call   10d0 <expect_zng@plt>
mov    %eax,-0x8018(%rbp)
cmpl   $0x0,-0x8018(%rbp)
je     18fa <BasicLink+0x69a>
lea    0x71e(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10f0 <fflush@plt>
movl   $0xffffffff,-0x801c(%rbp)
ff ff ff
lea    -0x4010(%rbp),%rdi
mov    0x26b0(%rip),%rax
mov    (%rax),%esi
call   1130 <access_test@plt>
mov    %eax,%esi
mov    $0xffffffff,%edi
call   10d0 <expect_zng@plt>
mov    %eax,-0x8018(%rbp)
cmpl   $0x0,-0x8018(%rbp)
je     194d <BasicLink+0x6ed>
lea    0x6cb(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10f0 <fflush@plt>
movl   $0xffffffff,-0x801c(%rbp)
ff ff ff
lea    -0x4010(%rbp),%rdi
lea    -0x8030(%rbp),%rsi
call   10a0 <lstat_test@plt>
mov    %eax,%esi
mov    $0xffffffff,%edi
call   10d0 <expect_zng@plt>
mov    %eax,-0x8018(%rbp)
cmpl   $0x0,-0x8018(%rbp)
je     199e <BasicLink+0x73e>
lea    0x67a(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10f0 <fflush@plt>
movl   $0xffffffff,-0x801c(%rbp)
ff ff ff
mov    $0x0,%al
call   1100 <testbreak@plt>
lea    -0x2010(%rbp),%rdi
mov    0x261d(%rip),%rax
mov    (%rax),%esi
mov    0x2634(%rip),%rax
or     (%rax),%esi
mov    0x2633(%rip),%rax
or     (%rax),%esi
mov    0x260a(%rip),%rax
mov    (%rax),%edx
call   10b0 <open_test@plt>
mov    %eax,%esi
mov    %esi,-0x8014(%rbp)
xor    %edi,%edi
call   1170 <expect_gez@plt>
mov    %eax,-0x8018(%rbp)
cmpl   $0x0,-0x8018(%rbp)
je     1a16 <BasicLink+0x7b6>
lea    0x602(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10f0 <fflush@plt>
movl   $0xffffffff,-0x801c(%rbp)
ff ff ff
cmpl   $0xffffffff,-0x8018(%rbp)
jne    1a46 <BasicLink+0x7e6>
lea    0x60c(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10f0 <fflush@plt>
mov    -0x8018(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1e51 <BasicLink+0xbf1>
mov    -0x8014(%rbp),%edi
call   1060 <close_test@plt>
mov    %eax,%esi
xor    %edi,%edi
call   10d0 <expect_zng@plt>
mov    %eax,-0x8018(%rbp)
cmpl   $0x0,-0x8018(%rbp)
je     1a8c <BasicLink+0x82c>
lea    0x58c(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10f0 <fflush@plt>
movl   $0xffffffff,-0x801c(%rbp)
ff ff ff
lea    -0x2010(%rbp),%rdi
lea    -0x6010(%rbp),%rsi
call   1050 <link_test@plt>
mov    %eax,%esi
xor    %edi,%edi
call   10d0 <expect_zng@plt>
mov    %eax,-0x8018(%rbp)
cmpl   $0x0,-0x8018(%rbp)
je     1ada <BasicLink+0x87a>
lea    0x53e(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10f0 <fflush@plt>
movl   $0xffffffff,-0x801c(%rbp)
ff ff ff
cmpl   $0xffffffff,-0x8018(%rbp)
jne    1b0a <BasicLink+0x8aa>
lea    0x548(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10f0 <fflush@plt>
mov    -0x8018(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1e51 <BasicLink+0xbf1>
lea    -0x2010(%rbp),%rdi
lea    -0x8030(%rbp),%rsi
call   1150 <stat_test@plt>
mov    %eax,%esi
xor    %edi,%edi
call   10d0 <expect_zng@plt>
mov    %eax,-0x8018(%rbp)
cmpl   $0x0,-0x8018(%rbp)
je     1b58 <BasicLink+0x8f8>
lea    0x4c0(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10f0 <fflush@plt>
movl   $0xffffffff,-0x801c(%rbp)
ff ff ff
lea    -0x6010(%rbp),%rdi
lea    -0x8040(%rbp),%rsi
call   10a0 <lstat_test@plt>
mov    %eax,%esi
xor    %edi,%edi
call   10d0 <expect_zng@plt>
mov    %eax,-0x8018(%rbp)
cmpl   $0x0,-0x8018(%rbp)
je     1ba6 <BasicLink+0x946>
lea    0x472(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10f0 <fflush@plt>
movl   $0xffffffff,-0x801c(%rbp)
ff ff ff
mov    -0x8030(%rbp),%edi
mov    -0x8040(%rbp),%esi
call   1110 <expect_val@plt>
mov    %eax,-0x8018(%rbp)
cmpl   $0x0,-0x8018(%rbp)
je     1be9 <BasicLink+0x989>
lea    0x42f(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10f0 <fflush@plt>
movl   $0xffffffff,-0x801c(%rbp)
ff ff ff
mov    -0x8024(%rbp),%edi
mov    -0x8034(%rbp),%esi
call   1110 <expect_val@plt>
mov    %eax,-0x8018(%rbp)
cmpl   $0x0,-0x8018(%rbp)
je     1c2c <BasicLink+0x9cc>
lea    0x3ec(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10f0 <fflush@plt>
movl   $0xffffffff,-0x801c(%rbp)
ff ff ff
lea    -0x2010(%rbp),%rdi
call   1120 <unlink_test@plt>
mov    %eax,%esi
xor    %edi,%edi
call   10d0 <expect_zng@plt>
mov    %eax,-0x8018(%rbp)
cmpl   $0x0,-0x8018(%rbp)
je     1c73 <BasicLink+0xa13>
lea    0x3a5(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10f0 <fflush@plt>
movl   $0xffffffff,-0x801c(%rbp)
ff ff ff
lea    -0x2010(%rbp),%rdi
mov    0x2337(%rip),%rax
mov    (%rax),%esi
call   1130 <access_test@plt>
mov    %eax,%esi
mov    $0xffffffff,%edi
call   10d0 <expect_zng@plt>
mov    %eax,-0x8018(%rbp)
cmpl   $0x0,-0x8018(%rbp)
je     1cc6 <BasicLink+0xa66>
lea    0x352(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10f0 <fflush@plt>
movl   $0xffffffff,-0x801c(%rbp)
ff ff ff
lea    -0x6010(%rbp),%rdi
mov    0x22e4(%rip),%rax
mov    (%rax),%esi
call   1130 <access_test@plt>
mov    %eax,%esi
xor    %edi,%edi
call   10d0 <expect_zng@plt>
mov    %eax,-0x8018(%rbp)
cmpl   $0x0,-0x8018(%rbp)
je     1d16 <BasicLink+0xab6>
lea    0x302(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10f0 <fflush@plt>
movl   $0xffffffff,-0x801c(%rbp)
ff ff ff
lea    -0x6010(%rbp),%rdi
lea    -0x8040(%rbp),%rsi
call   1150 <stat_test@plt>
mov    %eax,%esi
xor    %edi,%edi
call   10d0 <expect_zng@plt>
mov    %eax,-0x8018(%rbp)
cmpl   $0x0,-0x8018(%rbp)
je     1d64 <BasicLink+0xb04>
lea    0x2b4(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10f0 <fflush@plt>
movl   $0xffffffff,-0x801c(%rbp)
ff ff ff
mov    -0x8034(%rbp),%edi
mov    -0x8024(%rbp),%esi
call   1110 <expect_val@plt>
mov    %eax,-0x8018(%rbp)
cmpl   $0x0,-0x8018(%rbp)
je     1da7 <BasicLink+0xb47>
lea    0x271(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10f0 <fflush@plt>
movl   $0xffffffff,-0x801c(%rbp)
ff ff ff
lea    -0x6010(%rbp),%rdi
call   1120 <unlink_test@plt>
mov    %eax,%esi
xor    %edi,%edi
call   10d0 <expect_zng@plt>
mov    %eax,-0x8018(%rbp)
cmpl   $0x0,-0x8018(%rbp)
je     1dee <BasicLink+0xb8e>
lea    0x22a(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10f0 <fflush@plt>
movl   $0xffffffff,-0x801c(%rbp)
ff ff ff
lea    -0x6010(%rbp),%rdi
mov    0x21bc(%rip),%rax
mov    (%rax),%esi
call   1130 <access_test@plt>
mov    %eax,%esi
mov    $0xffffffff,%edi
call   10d0 <expect_zng@plt>
mov    %eax,-0x8018(%rbp)
cmpl   $0x0,-0x8018(%rbp)
je     1e41 <BasicLink+0xbe1>
lea    0x1d7(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10f0 <fflush@plt>
movl   $0xffffffff,-0x801c(%rbp)
ff ff ff
mov    $0x0,%al
call   1100 <testbreak@plt>
mov    -0x801c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x8050,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BasicLink>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x8028,%rsp
lea    0x2020(%rsp),%r14
xor    %r15d,%r15d
mov    $0x2000,%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1090 <memset@plt>
lea    0x20(%rsp),%rbx
mov    $0x2000,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1090 <memset@plt>
lea    0x4020(%rsp),%rbp
mov    $0x2000,%edx
mov    %rbp,%rdi
xor    %esi,%esi
call   1090 <memset@plt>
lea    0x6020(%rsp),%rdi
mov    $0x2000,%edx
xor    %esi,%esi
call   1090 <memset@plt>
mov    %r14,%rdi
call   1050 <xtmpnam@plt>
mov    %rbx,%rdi
call   1050 <xtmpnam@plt>
mov    %rbp,%rdi
call   1050 <xtmpnam@plt>
xor    %eax,%eax
call   1100 <testbreak@plt>
mov    0x2ce0(%rip),%rax
mov    0x2cf9(%rip),%r13
mov    0x0(%r13),%esi
or     (%rax),%esi
mov    0x2cf4(%rip),%rax
or     (%rax),%esi
mov    0x2ccb(%rip),%r12
mov    (%r12),%edx
mov    %r14,%rdi
call   10b0 <open_test@plt>
mov    %eax,%ebp
xor    %edi,%edi
mov    %eax,%esi
call   1170 <expect_gez@plt>
test   %eax,%eax
je     134c <BasicLink+0xec>
mov    %eax,%ebx
lea    0xd0c(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   10f0 <fflush@plt>
mov    $0xffffffff,%r15d
cmp    $0xffffffff,%ebx
je     1a4b <BasicLink+0x7eb>
mov    %ebp,%edi
call   1070 <close_test@plt>
xor    %edi,%edi
mov    %eax,%esi
call   10d0 <expect_zng@plt>
test   %eax,%eax
je     1379 <BasicLink+0x119>
lea    0xcd6(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   10f0 <fflush@plt>
mov    $0xffffffff,%r15d
lea    0x2020(%rsp),%rdi
lea    0x20(%rsp),%rsi
call   1180 <symlink_test@plt>
xor    %edi,%edi
mov    %eax,%esi
call   10d0 <expect_zng@plt>
test   %eax,%eax
je     13bc <BasicLink+0x15c>
mov    %eax,%ebx
lea    0xc9c(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   10f0 <fflush@plt>
mov    $0xffffffff,%r15d
cmp    $0xffffffff,%ebx
je     1a4b <BasicLink+0x7eb>
lea    0x20(%rsp),%rdi
lea    0x6020(%rsp),%rsi
mov    $0x2000,%edx
call   1160 <readlink_test@plt>
mov    %eax,%ebp
xor    %edi,%edi
mov    %eax,%esi
call   1170 <expect_gez@plt>
test   %eax,%eax
je     13fb <BasicLink+0x19b>
lea    0xc54(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   10f0 <fflush@plt>
mov    $0xffffffff,%r15d
lea    0x20(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   10a0 <lstat_test@plt>
xor    %edi,%edi
mov    %eax,%esi
call   10d0 <expect_zng@plt>
test   %eax,%eax
je     1430 <BasicLink+0x1d0>
lea    0xc1f(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   10f0 <fflush@plt>
mov    $0xffffffff,%r15d
mov    0x10(%rsp),%esi
mov    %ebp,%edi
call   1110 <expect_val@plt>
test   %eax,%eax
je     1458 <BasicLink+0x1f8>
lea    0xbf7(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   10f0 <fflush@plt>
mov    $0xffffffff,%r15d
xor    %eax,%eax
call   10e0 <getuid_test@plt>
mov    %eax,%r14d
xor    %edi,%edi
mov    %eax,%esi
call   1030 <expect_uid@plt>
test   %eax,%eax
je     1488 <BasicLink+0x228>
lea    0xbc7(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   10f0 <fflush@plt>
mov    $0xffffffff,%r15d
xor    %eax,%eax
call   10c0 <getgid_test@plt>
mov    %eax,%ebp
xor    %edi,%edi
mov    %eax,%esi
call   1140 <expect_gid@plt>
test   %eax,%eax
je     14b7 <BasicLink+0x257>
lea    0xb98(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   10f0 <fflush@plt>
mov    $0xffffffff,%r15d
lea    0x20(%rsp),%rdi
mov    %r14d,%esi
mov    %ebp,%edx
call   1080 <lchown_test@plt>
xor    %edi,%edi
mov    %eax,%esi
call   10d0 <expect_zng@plt>
test   %eax,%eax
je     14ec <BasicLink+0x28c>
lea    0xb63(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   10f0 <fflush@plt>
mov    $0xffffffff,%r15d
lea    0x20(%rsp),%rdi
mov    %rsp,%rsi
call   10a0 <lstat_test@plt>
xor    %edi,%edi
mov    %eax,%esi
call   10d0 <expect_zng@plt>
test   %eax,%eax
je     151f <BasicLink+0x2bf>
lea    0xb30(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   10f0 <fflush@plt>
mov    $0xffffffff,%r15d
mov    0x4(%rsp),%esi
mov    %r14d,%edi
call   1110 <expect_val@plt>
test   %eax,%eax
je     1548 <BasicLink+0x2e8>
lea    0xb07(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   10f0 <fflush@plt>
mov    $0xffffffff,%r15d
mov    0x8(%rsp),%esi
mov    %ebp,%edi
call   1110 <expect_val@plt>
test   %eax,%eax
je     1570 <BasicLink+0x310>
lea    0xadf(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   10f0 <fflush@plt>
mov    $0xffffffff,%r15d
mov    0x10(%rsp),%edi
mov    (%rsp),%esi
call   1110 <expect_val@plt>
test   %eax,%eax
je     1599 <BasicLink+0x339>
lea    0xab6(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   10f0 <fflush@plt>
mov    $0xffffffff,%r15d
mov    0x1c(%rsp),%edi
mov    0xc(%rsp),%esi
call   1110 <expect_val@plt>
test   %eax,%eax
je     15c3 <BasicLink+0x363>
lea    0xa8c(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   10f0 <fflush@plt>
mov    $0xffffffff,%r15d
lea    0x2020(%rsp),%rdi
call   1120 <unlink_test@plt>
xor    %edi,%edi
mov    %eax,%esi
call   10d0 <expect_zng@plt>
test   %eax,%eax
je     15f6 <BasicLink+0x396>
lea    0xa59(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   10f0 <fflush@plt>
mov    $0xffffffff,%r15d
mov    0x29bb(%rip),%r14
mov    (%r14),%esi
lea    0x2020(%rsp),%rdi
call   1130 <access_test@plt>
mov    $0xffffffff,%edi
mov    %eax,%esi
call   10d0 <expect_zng@plt>
test   %eax,%eax
je     1636 <BasicLink+0x3d6>
lea    0xa19(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   10f0 <fflush@plt>
mov    $0xffffffff,%r15d
mov    (%r14),%esi
lea    0x20(%rsp),%rdi
call   1130 <access_test@plt>
mov    $0xffffffff,%edi
mov    %eax,%esi
call   10d0 <expect_zng@plt>
test   %eax,%eax
je     166c <BasicLink+0x40c>
lea    0x9e3(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   10f0 <fflush@plt>
mov    $0xffffffff,%r15d
lea    0x20(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   10a0 <lstat_test@plt>
xor    %edi,%edi
mov    %eax,%esi
call   10d0 <expect_zng@plt>
test   %eax,%eax
je     16a1 <BasicLink+0x441>
lea    0x9ae(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   10f0 <fflush@plt>
mov    $0xffffffff,%r15d
lea    0x20(%rsp),%rdi
call   1120 <unlink_test@plt>
xor    %edi,%edi
mov    %eax,%esi
call   10d0 <expect_zng@plt>
test   %eax,%eax
je     16d1 <BasicLink+0x471>
lea    0x97e(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   10f0 <fflush@plt>
mov    $0xffffffff,%r15d
mov    (%r14),%esi
lea    0x20(%rsp),%rdi
call   1130 <access_test@plt>
mov    $0xffffffff,%edi
mov    %eax,%esi
call   10d0 <expect_zng@plt>
test   %eax,%eax
je     1707 <BasicLink+0x4a7>
lea    0x948(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   10f0 <fflush@plt>
mov    $0xffffffff,%r15d
lea    0x20(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   10a0 <lstat_test@plt>
mov    $0xffffffff,%edi
mov    %eax,%esi
call   10d0 <expect_zng@plt>
test   %eax,%eax
je     173f <BasicLink+0x4df>
lea    0x910(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   10f0 <fflush@plt>
mov    $0xffffffff,%r15d
xor    %eax,%eax
call   1100 <testbreak@plt>
mov    0x0(%r13),%esi
mov    0x287f(%rip),%rax
or     (%rax),%esi
mov    0x289e(%rip),%rax
or     (%rax),%esi
mov    (%r12),%edx
lea    0x2020(%rsp),%rdi
call   10b0 <open_test@plt>
mov    %eax,%ebp
xor    %edi,%edi
mov    %eax,%esi
call   1170 <expect_gez@plt>
test   %eax,%eax
je     17a0 <BasicLink+0x540>
mov    %eax,%ebx
lea    0x8b8(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   10f0 <fflush@plt>
mov    $0xffffffff,%r15d
cmp    $0xffffffff,%ebx
je     1a4b <BasicLink+0x7eb>
mov    %ebp,%edi
call   1070 <close_test@plt>
xor    %edi,%edi
mov    %eax,%esi
call   10d0 <expect_zng@plt>
test   %eax,%eax
je     17cd <BasicLink+0x56d>
lea    0x882(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   10f0 <fflush@plt>
mov    $0xffffffff,%r15d
lea    0x2020(%rsp),%rdi
lea    0x4020(%rsp),%rsi
call   1060 <link_test@plt>
xor    %edi,%edi
mov    %eax,%esi
call   10d0 <expect_zng@plt>
test   %eax,%eax
je     1813 <BasicLink+0x5b3>
mov    %eax,%ebx
lea    0x845(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   10f0 <fflush@plt>
mov    $0xffffffff,%r15d
cmp    $0xffffffff,%ebx
je     1a4b <BasicLink+0x7eb>
lea    0x2020(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1150 <stat_test@plt>
xor    %edi,%edi
mov    %eax,%esi
call   10d0 <expect_zng@plt>
test   %eax,%eax
je     184b <BasicLink+0x5eb>
lea    0x804(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   10f0 <fflush@plt>
mov    $0xffffffff,%r15d
lea    0x4020(%rsp),%rdi
mov    %rsp,%rsi
call   10a0 <lstat_test@plt>
xor    %edi,%edi
mov    %eax,%esi
call   10d0 <expect_zng@plt>
test   %eax,%eax
je     1881 <BasicLink+0x621>
lea    0x7ce(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   10f0 <fflush@plt>
mov    $0xffffffff,%r15d
mov    0x10(%rsp),%edi
mov    (%rsp),%esi
call   1110 <expect_val@plt>
test   %eax,%eax
je     18aa <BasicLink+0x64a>
lea    0x7a5(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   10f0 <fflush@plt>
mov    $0xffffffff,%r15d
mov    0x1c(%rsp),%edi
mov    0xc(%rsp),%esi
call   1110 <expect_val@plt>
test   %eax,%eax
je     18d4 <BasicLink+0x674>
lea    0x77b(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   10f0 <fflush@plt>
mov    $0xffffffff,%r15d
lea    0x2020(%rsp),%rdi
call   1120 <unlink_test@plt>
xor    %edi,%edi
mov    %eax,%esi
call   10d0 <expect_zng@plt>
test   %eax,%eax
je     1907 <BasicLink+0x6a7>
lea    0x748(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   10f0 <fflush@plt>
mov    $0xffffffff,%r15d
mov    (%r14),%esi
lea    0x2020(%rsp),%rdi
call   1130 <access_test@plt>
mov    $0xffffffff,%edi
mov    %eax,%esi
call   10d0 <expect_zng@plt>
test   %eax,%eax
je     1940 <BasicLink+0x6e0>
lea    0x70f(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   10f0 <fflush@plt>
mov    $0xffffffff,%r15d
mov    (%r14),%esi
lea    0x4020(%rsp),%rdi
call   1130 <access_test@plt>
xor    %edi,%edi
mov    %eax,%esi
call   10d0 <expect_zng@plt>
test   %eax,%eax
je     1976 <BasicLink+0x716>
lea    0x6d9(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   10f0 <fflush@plt>
mov    $0xffffffff,%r15d
lea    0x4020(%rsp),%rdi
mov    %rsp,%rsi
call   1150 <stat_test@plt>
xor    %edi,%edi
mov    %eax,%esi
call   10d0 <expect_zng@plt>
test   %eax,%eax
je     19ac <BasicLink+0x74c>
lea    0x6a3(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   10f0 <fflush@plt>
mov    $0xffffffff,%r15d
mov    0xc(%rsp),%edi
mov    0x1c(%rsp),%esi
call   1110 <expect_val@plt>
test   %eax,%eax
je     19d6 <BasicLink+0x776>
lea    0x679(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   10f0 <fflush@plt>
mov    $0xffffffff,%r15d
lea    0x4020(%rsp),%rdi
call   1120 <unlink_test@plt>
xor    %edi,%edi
mov    %eax,%esi
call   10d0 <expect_zng@plt>
test   %eax,%eax
je     1a09 <BasicLink+0x7a9>
lea    0x646(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   10f0 <fflush@plt>
mov    $0xffffffff,%r15d
mov    (%r14),%esi
lea    0x4020(%rsp),%rdi
call   1130 <access_test@plt>
mov    $0xffffffff,%edi
mov    %eax,%esi
call   10d0 <expect_zng@plt>
test   %eax,%eax
je     1a42 <BasicLink+0x7e2>
lea    0x60d(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   10f0 <fflush@plt>
mov    $0xffffffff,%r15d
xor    %eax,%eax
call   1100 <testbreak@plt>
jmp    1a64 <BasicLink+0x804>
lea    0x5ae(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   10f0 <fflush@plt>
mov    $0xffffffff,%r15d
mov    %r15d,%eax
add    $0x8028,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.stat = type { i32, i32, i32, i32 }
@O_RDWR = global i32 0
@O_TRUNC = global i32 0
@O_CREAT = global i32 0
@S_IRWXU = global i32 0
@.str = [54 x i8] c"\09Failed Phase 2: This call did something unexpected.\0A\00"
@.str.1 = [62 x i8] c"\09Fail Phase 2: Aborting test because of catastrophic failure\0A\00"
@F_OK = global i32 0
define i32 @BasicLink() {
%1 = alloca i32
%2 = alloca [8192 x i8]
%3 = alloca [8192 x i8]
%4 = alloca [8192 x i8]
%5 = alloca [8192 x i8]
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca %struct.stat
%10 = alloca %struct.stat
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = bitcast [8192 x i8]* %2 to i8*
%15 = bitcast [8192 x i8]* %3 to i8*
%16 = bitcast [8192 x i8]* %4 to i8*
%17 = bitcast [8192 x i8]* %5 to i8*
store i32 0, i32* %8
%18 = getelementptr inbounds [8192 x i8], [8192 x i8]* %2, i64 0, i64 0
%19 = call i32 @xtmpnam(i8* %18)
%20 = getelementptr inbounds [8192 x i8], [8192 x i8]* %3, i64 0, i64 0
%21 = call i32 @xtmpnam(i8* %20)
%22 = getelementptr inbounds [8192 x i8], [8192 x i8]* %4, i64 0, i64 0
%23 = call i32 @xtmpnam(i8* %22)
%24 = call i32 (...) @testbreak()
%25 = getelementptr inbounds [8192 x i8], [8192 x i8]* %2, i64 0, i64 0
%26 = load i32, i32* @O_RDWR
%27 = load i32, i32* @O_TRUNC
%28 = or i32 %26, %27
%29 = load i32, i32* @O_CREAT
%30 = or i32 %28, %29
%31 = load i32, i32* @S_IRWXU
%32 = call i32 @open_test(i8* %25, i32 %30, i32 %31)
store i32 %32, i32* %6
%33 = call i32 @expect_gez(i32 0, i32 %32)
store i32 %33, i32* %7
%34 = load i32, i32* %7
%35 = icmp ne i32 %34, 0
br i1 %35, label %36, label %39
36: ; preds = %0
%37 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%38 = call i32 @fflush(i32* null)
store i32 -1, i32* %8
br label %39
39: ; preds = %36, %0
%40 = load i32, i32* %7
%41 = icmp eq i32 %40, -1
br i1 %41, label %42, label %46
42: ; preds = %39
%43 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0))
%44 = call i32 @fflush(i32* null)
%45 = load i32, i32* %7
store i32 %45, i32* %1
br label %405
46: ; preds = %39
%47 = load i32, i32* %6
%48 = call i32 @close_test(i32 %47)
%49 = call i32 @expect_zng(i32 0, i32 %48)
store i32 %49, i32* %7
%50 = load i32, i32* %7
%51 = icmp ne i32 %50, 0
br i1 %51, label %52, label %55
52: ; preds = %46
%53 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%54 = call i32 @fflush(i32* null)
store i32 -1, i32* %8
br label %55
55: ; preds = %52, %46
%56 = getelementptr inbounds [8192 x i8], [8192 x i8]* %2, i64 0, i64 0
%57 = getelementptr inbounds [8192 x i8], [8192 x i8]* %3, i64 0, i64 0
%58 = call i32 @symlink_test(i8* %56, i8* %57)
%59 = call i32 @expect_zng(i32 0, i32 %58)
store i32 %59, i32* %7
%60 = load i32, i32* %7
%61 = icmp ne i32 %60, 0
br i1 %61, label %62, label %65
62: ; preds = %55
%63 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%64 = call i32 @fflush(i32* null)
store i32 -1, i32* %8
br label %65
65: ; preds = %62, %55
%66 = load i32, i32* %7
%67 = icmp eq i32 %66, -1
br i1 %67, label %68, label %72
68: ; preds = %65
%69 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0))
%70 = call i32 @fflush(i32* null)
%71 = load i32, i32* %7
store i32 %71, i32* %1
br label %405
72: ; preds = %65
%73 = getelementptr inbounds [8192 x i8], [8192 x i8]* %3, i64 0, i64 0
%74 = getelementptr inbounds [8192 x i8], [8192 x i8]* %5, i64 0, i64 0
%75 = call i32 @readlink_test(i8* %73, i8* %74, i32 8192)
store i32 %75, i32* %13
%76 = call i32 @expect_gez(i32 0, i32 %75)
store i32 %76, i32* %7
%77 = load i32, i32* %7
%78 = icmp ne i32 %77, 0
br i1 %78, label %79, label %82
79: ; preds = %72
%80 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%81 = call i32 @fflush(i32* null)
store i32 -1, i32* %8
br label %82
82: ; preds = %79, %72
%83 = getelementptr inbounds [8192 x i8], [8192 x i8]* %3, i64 0, i64 0
%84 = call i32 @lstat_test(i8* %83, %struct.stat* %9)
%85 = call i32 @expect_zng(i32 0, i32 %84)
store i32 %85, i32* %7
%86 = load i32, i32* %7
%87 = icmp ne i32 %86, 0
br i1 %87, label %88, label %91
88: ; preds = %82
%89 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%90 = call i32 @fflush(i32* null)
store i32 -1, i32* %8
br label %91
91: ; preds = %88, %82
%92 = load i32, i32* %13
%93 = getelementptr inbounds %struct.stat, %struct.stat* %9, i32 0, i32 0
%94 = load i32, i32* %93
%95 = call i32 @expect_val(i32 %92, i32 %94)
store i32 %95, i32* %7
%96 = load i32, i32* %7
%97 = icmp ne i32 %96, 0
br i1 %97, label %98, label %101
98: ; preds = %91
%99 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%100 = call i32 @fflush(i32* null)
store i32 -1, i32* %8
br label %101
101: ; preds = %98, %91
%102 = call i32 (...) @getuid_test()
store i32 %102, i32* %11
%103 = call i32 @expect_uid(i32 0, i32 %102)
store i32 %103, i32* %7
%104 = load i32, i32* %7
%105 = icmp ne i32 %104, 0
br i1 %105, label %106, label %109
106: ; preds = %101
%107 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%108 = call i32 @fflush(i32* null)
store i32 -1, i32* %8
br label %109
109: ; preds = %106, %101
%110 = call i32 (...) @getgid_test()
store i32 %110, i32* %12
%111 = call i32 @expect_gid(i32 0, i32 %110)
store i32 %111, i32* %7
%112 = load i32, i32* %7
%113 = icmp ne i32 %112, 0
br i1 %113, label %114, label %117
114: ; preds = %109
%115 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%116 = call i32 @fflush(i32* null)
store i32 -1, i32* %8
br label %117
117: ; preds = %114, %109
%118 = getelementptr inbounds [8192 x i8], [8192 x i8]* %3, i64 0, i64 0
%119 = load i32, i32* %11
%120 = load i32, i32* %12
%121 = call i32 @lchown_test(i8* %118, i32 %119, i32 %120)
%122 = call i32 @expect_zng(i32 0, i32 %121)
store i32 %122, i32* %7
%123 = load i32, i32* %7
%124 = icmp ne i32 %123, 0
br i1 %124, label %125, label %128
125: ; preds = %117
%126 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%127 = call i32 @fflush(i32* null)
store i32 -1, i32* %8
br label %128
128: ; preds = %125, %117
%129 = getelementptr inbounds [8192 x i8], [8192 x i8]* %3, i64 0, i64 0
%130 = call i32 @lstat_test(i8* %129, %struct.stat* %10)
%131 = call i32 @expect_zng(i32 0, i32 %130)
store i32 %131, i32* %7
%132 = load i32, i32* %7
%133 = icmp ne i32 %132, 0
br i1 %133, label %134, label %137
134: ; preds = %128
%135 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%136 = call i32 @fflush(i32* null)
store i32 -1, i32* %8
br label %137
137: ; preds = %134, %128
%138 = load i32, i32* %11
%139 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 1
%140 = load i32, i32* %139
%141 = call i32 @expect_val(i32 %138, i32 %140)
store i32 %141, i32* %7
%142 = load i32, i32* %7
%143 = icmp ne i32 %142, 0
br i1 %143, label %144, label %147
144: ; preds = %137
%145 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%146 = call i32 @fflush(i32* null)
store i32 -1, i32* %8
br label %147
147: ; preds = %144, %137
%148 = load i32, i32* %12
%149 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 2
%150 = load i32, i32* %149
%151 = call i32 @expect_val(i32 %148, i32 %150)
store i32 %151, i32* %7
%152 = load i32, i32* %7
%153 = icmp ne i32 %152, 0
br i1 %153, label %154, label %157
154: ; preds = %147
%155 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%156 = call i32 @fflush(i32* null)
store i32 -1, i32* %8
br label %157
157: ; preds = %154, %147
%158 = getelementptr inbounds %struct.stat, %struct.stat* %9, i32 0, i32 0
%159 = load i32, i32* %158
%160 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 0
%161 = load i32, i32* %160
%162 = call i32 @expect_val(i32 %159, i32 %161)
store i32 %162, i32* %7
%163 = load i32, i32* %7
%164 = icmp ne i32 %163, 0
br i1 %164, label %165, label %168
165: ; preds = %157
%166 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%167 = call i32 @fflush(i32* null)
store i32 -1, i32* %8
br label %168
168: ; preds = %165, %157
%169 = getelementptr inbounds %struct.stat, %struct.stat* %9, i32 0, i32 3
%170 = load i32, i32* %169
%171 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 3
%172 = load i32, i32* %171
%173 = call i32 @expect_val(i32 %170, i32 %172)
store i32 %173, i32* %7
%174 = load i32, i32* %7
%175 = icmp ne i32 %174, 0
br i1 %175, label %176, label %179
176: ; preds = %168
%177 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%178 = call i32 @fflush(i32* null)
store i32 -1, i32* %8
br label %179
179: ; preds = %176, %168
%180 = getelementptr inbounds [8192 x i8], [8192 x i8]* %2, i64 0, i64 0
%181 = call i32 @unlink_test(i8* %180)
%182 = call i32 @expect_zng(i32 0, i32 %181)
store i32 %182, i32* %7
%183 = load i32, i32* %7
%184 = icmp ne i32 %183, 0
br i1 %184, label %185, label %188
185: ; preds = %179
%186 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%187 = call i32 @fflush(i32* null)
store i32 -1, i32* %8
br label %188
188: ; preds = %185, %179
%189 = getelementptr inbounds [8192 x i8], [8192 x i8]* %2, i64 0, i64 0
%190 = load i32, i32* @F_OK
%191 = call i32 @access_test(i8* %189, i32 %190)
%192 = call i32 @expect_zng(i32 -1, i32 %191)
store i32 %192, i32* %7
%193 = load i32, i32* %7
%194 = icmp ne i32 %193, 0
br i1 %194, label %195, label %198
195: ; preds = %188
%196 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%197 = call i32 @fflush(i32* null)
store i32 -1, i32* %8
br label %198
198: ; preds = %195, %188
%199 = getelementptr inbounds [8192 x i8], [8192 x i8]* %3, i64 0, i64 0
%200 = load i32, i32* @F_OK
%201 = call i32 @access_test(i8* %199, i32 %200)
%202 = call i32 @expect_zng(i32 -1, i32 %201)
store i32 %202, i32* %7
%203 = load i32, i32* %7
%204 = icmp ne i32 %203, 0
br i1 %204, label %205, label %208
205: ; preds = %198
%206 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%207 = call i32 @fflush(i32* null)
store i32 -1, i32* %8
br label %208
208: ; preds = %205, %198
%209 = getelementptr inbounds [8192 x i8], [8192 x i8]* %3, i64 0, i64 0
%210 = call i32 @lstat_test(i8* %209, %struct.stat* %9)
%211 = call i32 @expect_zng(i32 0, i32 %210)
store i32 %211, i32* %7
%212 = load i32, i32* %7
%213 = icmp ne i32 %212, 0
br i1 %213, label %214, label %217
214: ; preds = %208
%215 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%216 = call i32 @fflush(i32* null)
store i32 -1, i32* %8
br label %217
217: ; preds = %214, %208
%218 = getelementptr inbounds [8192 x i8], [8192 x i8]* %3, i64 0, i64 0
%219 = call i32 @unlink_test(i8* %218)
%220 = call i32 @expect_zng(i32 0, i32 %219)
store i32 %220, i32* %7
%221 = load i32, i32* %7
%222 = icmp ne i32 %221, 0
br i1 %222, label %223, label %226
223: ; preds = %217
%224 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%225 = call i32 @fflush(i32* null)
store i32 -1, i32* %8
br label %226
226: ; preds = %223, %217
%227 = getelementptr inbounds [8192 x i8], [8192 x i8]* %3, i64 0, i64 0
%228 = load i32, i32* @F_OK
%229 = call i32 @access_test(i8* %227, i32 %228)
%230 = call i32 @expect_zng(i32 -1, i32 %229)
store i32 %230, i32* %7
%231 = load i32, i32* %7
%232 = icmp ne i32 %231, 0
br i1 %232, label %233, label %236
233: ; preds = %226
%234 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%235 = call i32 @fflush(i32* null)
store i32 -1, i32* %8
br label %236
236: ; preds = %233, %226
%237 = getelementptr inbounds [8192 x i8], [8192 x i8]* %3, i64 0, i64 0
%238 = call i32 @lstat_test(i8* %237, %struct.stat* %9)
%239 = call i32 @expect_zng(i32 -1, i32 %238)
store i32 %239, i32* %7
%240 = load i32, i32* %7
%241 = icmp ne i32 %240, 0
br i1 %241, label %242, label %245
242: ; preds = %236
%243 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%244 = call i32 @fflush(i32* null)
store i32 -1, i32* %8
br label %245
245: ; preds = %242, %236
%246 = call i32 (...) @testbreak()
%247 = getelementptr inbounds [8192 x i8], [8192 x i8]* %2, i64 0, i64 0
%248 = load i32, i32* @O_RDWR
%249 = load i32, i32* @O_TRUNC
%250 = or i32 %248, %249
%251 = load i32, i32* @O_CREAT
%252 = or i32 %250, %251
%253 = load i32, i32* @S_IRWXU
%254 = call i32 @open_test(i8* %247, i32 %252, i32 %253)
store i32 %254, i32* %6
%255 = call i32 @expect_gez(i32 0, i32 %254)
store i32 %255, i32* %7
%256 = load i32, i32* %7
%257 = icmp ne i32 %256, 0
br i1 %257, label %258, label %261
258: ; preds = %245
%259 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%260 = call i32 @fflush(i32* null)
store i32 -1, i32* %8
br label %261
261: ; preds = %258, %245
%262 = load i32, i32* %7
%263 = icmp eq i32 %262, -1
br i1 %263, label %264, label %268
264: ; preds = %261
%265 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0))
%266 = call i32 @fflush(i32* null)
%267 = load i32, i32* %7
store i32 %267, i32* %1
br label %405
268: ; preds = %261
%269 = load i32, i32* %6
%270 = call i32 @close_test(i32 %269)
%271 = call i32 @expect_zng(i32 0, i32 %270)
store i32 %271, i32* %7
%272 = load i32, i32* %7
%273 = icmp ne i32 %272, 0
br i1 %273, label %274, label %277
274: ; preds = %268
%275 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%276 = call i32 @fflush(i32* null)
store i32 -1, i32* %8
br label %277
277: ; preds = %274, %268
%278 = getelementptr inbounds [8192 x i8], [8192 x i8]* %2, i64 0, i64 0
%279 = getelementptr inbounds [8192 x i8], [8192 x i8]* %4, i64 0, i64 0
%280 = call i32 @link_test(i8* %278, i8* %279)
%281 = call i32 @expect_zng(i32 0, i32 %280)
store i32 %281, i32* %7
%282 = load i32, i32* %7
%283 = icmp ne i32 %282, 0
br i1 %283, label %284, label %287
284: ; preds = %277
%285 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%286 = call i32 @fflush(i32* null)
store i32 -1, i32* %8
br label %287
287: ; preds = %284, %277
%288 = load i32, i32* %7
%289 = icmp eq i32 %288, -1
br i1 %289, label %290, label %294
290: ; preds = %287
%291 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0))
%292 = call i32 @fflush(i32* null)
%293 = load i32, i32* %7
store i32 %293, i32* %1
br label %405
294: ; preds = %287
%295 = getelementptr inbounds [8192 x i8], [8192 x i8]* %2, i64 0, i64 0
%296 = call i32 @stat_test(i8* %295, %struct.stat* %9)
%297 = call i32 @expect_zng(i32 0, i32 %296)
store i32 %297, i32* %7
%298 = load i32, i32* %7
%299 = icmp ne i32 %298, 0
br i1 %299, label %300, label %303
300: ; preds = %294
%301 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%302 = call i32 @fflush(i32* null)
store i32 -1, i32* %8
br label %303
303: ; preds = %300, %294
%304 = getelementptr inbounds [8192 x i8], [8192 x i8]* %4, i64 0, i64 0
%305 = call i32 @lstat_test(i8* %304, %struct.stat* %10)
%306 = call i32 @expect_zng(i32 0, i32 %305)
store i32 %306, i32* %7
%307 = load i32, i32* %7
%308 = icmp ne i32 %307, 0
br i1 %308, label %309, label %312
309: ; preds = %303
%310 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%311 = call i32 @fflush(i32* null)
store i32 -1, i32* %8
br label %312
312: ; preds = %309, %303
%313 = getelementptr inbounds %struct.stat, %struct.stat* %9, i32 0, i32 0
%314 = load i32, i32* %313
%315 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 0
%316 = load i32, i32* %315
%317 = call i32 @expect_val(i32 %314, i32 %316)
store i32 %317, i32* %7
%318 = load i32, i32* %7
%319 = icmp ne i32 %318, 0
br i1 %319, label %320, label %323
320: ; preds = %312
%321 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%322 = call i32 @fflush(i32* null)
store i32 -1, i32* %8
br label %323
323: ; preds = %320, %312
%324 = getelementptr inbounds %struct.stat, %struct.stat* %9, i32 0, i32 3
%325 = load i32, i32* %324
%326 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 3
%327 = load i32, i32* %326
%328 = call i32 @expect_val(i32 %325, i32 %327)
store i32 %328, i32* %7
%329 = load i32, i32* %7
%330 = icmp ne i32 %329, 0
br i1 %330, label %331, label %334
331: ; preds = %323
%332 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%333 = call i32 @fflush(i32* null)
store i32 -1, i32* %8
br label %334
334: ; preds = %331, %323
%335 = getelementptr inbounds [8192 x i8], [8192 x i8]* %2, i64 0, i64 0
%336 = call i32 @unlink_test(i8* %335)
%337 = call i32 @expect_zng(i32 0, i32 %336)
store i32 %337, i32* %7
%338 = load i32, i32* %7
%339 = icmp ne i32 %338, 0
br i1 %339, label %340, label %343
340: ; preds = %334
%341 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%342 = call i32 @fflush(i32* null)
store i32 -1, i32* %8
br label %343
343: ; preds = %340, %334
%344 = getelementptr inbounds [8192 x i8], [8192 x i8]* %2, i64 0, i64 0
%345 = load i32, i32* @F_OK
%346 = call i32 @access_test(i8* %344, i32 %345)
%347 = call i32 @expect_zng(i32 -1, i32 %346)
store i32 %347, i32* %7
%348 = load i32, i32* %7
%349 = icmp ne i32 %348, 0
br i1 %349, label %350, label %353
350: ; preds = %343
%351 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%352 = call i32 @fflush(i32* null)
store i32 -1, i32* %8
br label %353
353: ; preds = %350, %343
%354 = getelementptr inbounds [8192 x i8], [8192 x i8]* %4, i64 0, i64 0
%355 = load i32, i32* @F_OK
%356 = call i32 @access_test(i8* %354, i32 %355)
%357 = call i32 @expect_zng(i32 0, i32 %356)
store i32 %357, i32* %7
%358 = load i32, i32* %7
%359 = icmp ne i32 %358, 0
br i1 %359, label %360, label %363
360: ; preds = %353
%361 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%362 = call i32 @fflush(i32* null)
store i32 -1, i32* %8
br label %363
363: ; preds = %360, %353
%364 = getelementptr inbounds [8192 x i8], [8192 x i8]* %4, i64 0, i64 0
%365 = call i32 @stat_test(i8* %364, %struct.stat* %10)
%366 = call i32 @expect_zng(i32 0, i32 %365)
store i32 %366, i32* %7
%367 = load i32, i32* %7
%368 = icmp ne i32 %367, 0
br i1 %368, label %369, label %372
369: ; preds = %363
%370 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%371 = call i32 @fflush(i32* null)
store i32 -1, i32* %8
br label %372
372: ; preds = %369, %363
%373 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 3
%374 = load i32, i32* %373
%375 = getelementptr inbounds %struct.stat, %struct.stat* %9, i32 0, i32 3
%376 = load i32, i32* %375
%377 = call i32 @expect_val(i32 %374, i32 %376)
store i32 %377, i32* %7
%378 = load i32, i32* %7
%379 = icmp ne i32 %378, 0
br i1 %379, label %380, label %383
380: ; preds = %372
%381 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%382 = call i32 @fflush(i32* null)
store i32 -1, i32* %8
br label %383
383: ; preds = %380, %372
%384 = getelementptr inbounds [8192 x i8], [8192 x i8]* %4, i64 0, i64 0
%385 = call i32 @unlink_test(i8* %384)
%386 = call i32 @expect_zng(i32 0, i32 %385)
store i32 %386, i32* %7
%387 = load i32, i32* %7
%388 = icmp ne i32 %387, 0
br i1 %388, label %389, label %392
389: ; preds = %383
%390 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%391 = call i32 @fflush(i32* null)
store i32 -1, i32* %8
br label %392
392: ; preds = %389, %383
%393 = getelementptr inbounds [8192 x i8], [8192 x i8]* %4, i64 0, i64 0
%394 = load i32, i32* @F_OK
%395 = call i32 @access_test(i8* %393, i32 %394)
%396 = call i32 @expect_zng(i32 -1, i32 %395)
store i32 %396, i32* %7
%397 = load i32, i32* %7
%398 = icmp ne i32 %397, 0
br i1 %398, label %399, label %402
399: ; preds = %392
%400 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%401 = call i32 @fflush(i32* null)
store i32 -1, i32* %8
br label %402
402: ; preds = %399, %392
%403 = call i32 (...) @testbreak()
%404 = load i32, i32* %8
store i32 %404, i32* %1
br label %405
405: ; preds = %402, %290, %264, %68, %42
%406 = load i32, i32* %1
ret i32 %406
}

LLVM IR (-O2):
%struct.stat = type { i32, i32, i32, i32 }
@O_RDWR = global i32 0
@O_TRUNC = global i32 0
@O_CREAT = global i32 0
@S_IRWXU = global i32 0
@F_OK = global i32 0
@str.38 = [61 x i8] c"\09Fail Phase 2: Aborting test because of catastrophic failure\00"
@str.39 = [53 x i8] c"\09Failed Phase 2: This call did something unexpected.\00"
define i32 @BasicLink() {
%1 = alloca [8192 x i8]
%2 = alloca [8192 x i8]
%3 = alloca [8192 x i8]
%4 = alloca [8192 x i8]
%5 = alloca %struct.stat
%6 = alloca %struct.stat
%7 = getelementptr inbounds [8192 x i8], [8192 x i8]* %1, i64 0, i64 0
%8 = getelementptr inbounds [8192 x i8], [8192 x i8]* %2, i64 0, i64 0
%9 = getelementptr inbounds [8192 x i8], [8192 x i8]* %3, i64 0, i64 0
%10 = getelementptr inbounds [8192 x i8], [8192 x i8]* %4, i64 0, i64 0
%11 = bitcast %struct.stat* %5 to i8*
%12 = bitcast %struct.stat* %6 to i8*
%13 = call i32 @xtmpnam(i8* %7)
%14 = call i32 @xtmpnam(i8* %8)
%15 = call i32 @xtmpnam(i8* %9)
%16 = call i32 (...) @testbreak()
%17 = load i32, i32* @O_RDWR
%18 = load i32, i32* @O_TRUNC
%19 = or i32 %18, %17
%20 = load i32, i32* @O_CREAT
%21 = or i32 %19, %20
%22 = load i32, i32* @S_IRWXU
%23 = call i32 @open_test(i8* %7, i32 %21, i32 %22)
%24 = call i32 @expect_gez(i32 0, i32 %23)
%25 = icmp eq i32 %24, 0
br i1 %25, label %33, label %26
26: ; preds = %0
%27 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.39, i64 0, i64 0))
%28 = call i32 @fflush(i32* null)
%29 = icmp eq i32 %24, -1
br i1 %29, label %30, label %33
30: ; preds = %26
%31 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.38, i64 0, i64 0))
%32 = call i32 @fflush(i32* null)
br label %344
33: ; preds = %0, %26
%34 = phi i32 [ -1, %26 ], [ 0, %0 ]
%35 = call i32 @close_test(i32 %23)
%36 = call i32 @expect_zng(i32 0, i32 %35)
%37 = icmp eq i32 %36, 0
br i1 %37, label %41, label %38
38: ; preds = %33
%39 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.39, i64 0, i64 0))
%40 = call i32 @fflush(i32* null)
br label %41
41: ; preds = %38, %33
%42 = phi i32 [ -1, %38 ], [ %34, %33 ]
%43 = call i32 @symlink_test(i8* %7, i8* %8)
%44 = call i32 @expect_zng(i32 0, i32 %43)
%45 = icmp eq i32 %44, 0
br i1 %45, label %53, label %46
46: ; preds = %41
%47 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.39, i64 0, i64 0))
%48 = call i32 @fflush(i32* null)
%49 = icmp eq i32 %44, -1
br i1 %49, label %50, label %53
50: ; preds = %46
%51 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.38, i64 0, i64 0))
%52 = call i32 @fflush(i32* null)
br label %344
53: ; preds = %41, %46
%54 = phi i32 [ -1, %46 ], [ %42, %41 ]
%55 = call i32 @readlink_test(i8* %8, i8* %10, i32 8192)
%56 = call i32 @expect_gez(i32 0, i32 %55)
%57 = icmp eq i32 %56, 0
br i1 %57, label %61, label %58
58: ; preds = %53
%59 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.39, i64 0, i64 0))
%60 = call i32 @fflush(i32* null)
br label %61
61: ; preds = %58, %53
%62 = phi i32 [ -1, %58 ], [ %54, %53 ]
%63 = call i32 @lstat_test(i8* %8, %struct.stat* %5)
%64 = call i32 @expect_zng(i32 0, i32 %63)
%65 = icmp eq i32 %64, 0
br i1 %65, label %69, label %66
66: ; preds = %61
%67 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.39, i64 0, i64 0))
%68 = call i32 @fflush(i32* null)
br label %69
69: ; preds = %66, %61
%70 = phi i32 [ -1, %66 ], [ %62, %61 ]
%71 = getelementptr inbounds %struct.stat, %struct.stat* %5, i64 0, i32 0
%72 = load i32, i32* %71
%73 = call i32 @expect_val(i32 %55, i32 %72)
%74 = icmp eq i32 %73, 0
br i1 %74, label %78, label %75
75: ; preds = %69
%76 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.39, i64 0, i64 0))
%77 = call i32 @fflush(i32* null)
br label %78
78: ; preds = %75, %69
%79 = phi i32 [ -1, %75 ], [ %70, %69 ]
%80 = call i32 (...) @getuid_test()
%81 = call i32 @expect_uid(i32 0, i32 %80)
%82 = icmp eq i32 %81, 0
br i1 %82, label %86, label %83
83: ; preds = %78
%84 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.39, i64 0, i64 0))
%85 = call i32 @fflush(i32* null)
br label %86
86: ; preds = %83, %78
%87 = phi i32 [ -1, %83 ], [ %79, %78 ]
%88 = call i32 (...) @getgid_test()
%89 = call i32 @expect_gid(i32 0, i32 %88)
%90 = icmp eq i32 %89, 0
br i1 %90, label %94, label %91
91: ; preds = %86
%92 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.39, i64 0, i64 0))
%93 = call i32 @fflush(i32* null)
br label %94
94: ; preds = %91, %86
%95 = phi i32 [ -1, %91 ], [ %87, %86 ]
%96 = call i32 @lchown_test(i8* %8, i32 %80, i32 %88)
%97 = call i32 @expect_zng(i32 0, i32 %96)
%98 = icmp eq i32 %97, 0
br i1 %98, label %102, label %99
99: ; preds = %94
%100 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.39, i64 0, i64 0))
%101 = call i32 @fflush(i32* null)
br label %102
102: ; preds = %99, %94
%103 = phi i32 [ -1, %99 ], [ %95, %94 ]
%104 = call i32 @lstat_test(i8* %8, %struct.stat* %6)
%105 = call i32 @expect_zng(i32 0, i32 %104)
%106 = icmp eq i32 %105, 0
br i1 %106, label %110, label %107
107: ; preds = %102
%108 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.39, i64 0, i64 0))
%109 = call i32 @fflush(i32* null)
br label %110
110: ; preds = %107, %102
%111 = phi i32 [ -1, %107 ], [ %103, %102 ]
%112 = getelementptr inbounds %struct.stat, %struct.stat* %6, i64 0, i32 1
%113 = load i32, i32* %112
%114 = call i32 @expect_val(i32 %80, i32 %113)
%115 = icmp eq i32 %114, 0
br i1 %115, label %119, label %116
116: ; preds = %110
%117 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.39, i64 0, i64 0))
%118 = call i32 @fflush(i32* null)
br label %119
119: ; preds = %116, %110
%120 = phi i32 [ -1, %116 ], [ %111, %110 ]
%121 = getelementptr inbounds %struct.stat, %struct.stat* %6, i64 0, i32 2
%122 = load i32, i32* %121
%123 = call i32 @expect_val(i32 %88, i32 %122)
%124 = icmp eq i32 %123, 0
br i1 %124, label %128, label %125
125: ; preds = %119
%126 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.39, i64 0, i64 0))
%127 = call i32 @fflush(i32* null)
br label %128
128: ; preds = %125, %119
%129 = phi i32 [ -1, %125 ], [ %120, %119 ]
%130 = load i32, i32* %71
%131 = getelementptr inbounds %struct.stat, %struct.stat* %6, i64 0, i32 0
%132 = load i32, i32* %131
%133 = call i32 @expect_val(i32 %130, i32 %132)
%134 = icmp eq i32 %133, 0
br i1 %134, label %138, label %135
135: ; preds = %128
%136 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.39, i64 0, i64 0))
%137 = call i32 @fflush(i32* null)
br label %138
138: ; preds = %135, %128
%139 = phi i32 [ -1, %135 ], [ %129, %128 ]
%140 = getelementptr inbounds %struct.stat, %struct.stat* %5, i64 0, i32 3
%141 = load i32, i32* %140
%142 = getelementptr inbounds %struct.stat, %struct.stat* %6, i64 0, i32 3
%143 = load i32, i32* %142
%144 = call i32 @expect_val(i32 %141, i32 %143)
%145 = icmp eq i32 %144, 0
br i1 %145, label %149, label %146
146: ; preds = %138
%147 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.39, i64 0, i64 0))
%148 = call i32 @fflush(i32* null)
br label %149
149: ; preds = %146, %138
%150 = phi i32 [ -1, %146 ], [ %139, %138 ]
%151 = call i32 @unlink_test(i8* %7)
%152 = call i32 @expect_zng(i32 0, i32 %151)
%153 = icmp eq i32 %152, 0
br i1 %153, label %157, label %154
154: ; preds = %149
%155 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.39, i64 0, i64 0))
%156 = call i32 @fflush(i32* null)
br label %157
157: ; preds = %154, %149
%158 = phi i32 [ -1, %154 ], [ %150, %149 ]
%159 = load i32, i32* @F_OK
%160 = call i32 @access_test(i8* %7, i32 %159)
%161 = call i32 @expect_zng(i32 -1, i32 %160)
%162 = icmp eq i32 %161, 0
br i1 %162, label %166, label %163
163: ; preds = %157
%164 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.39, i64 0, i64 0))
%165 = call i32 @fflush(i32* null)
br label %166
166: ; preds = %163, %157
%167 = phi i32 [ -1, %163 ], [ %158, %157 ]
%168 = load i32, i32* @F_OK
%169 = call i32 @access_test(i8* %8, i32 %168)
%170 = call i32 @expect_zng(i32 -1, i32 %169)
%171 = icmp eq i32 %170, 0
br i1 %171, label %175, label %172
172: ; preds = %166
%173 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.39, i64 0, i64 0))
%174 = call i32 @fflush(i32* null)
br label %175
175: ; preds = %172, %166
%176 = phi i32 [ -1, %172 ], [ %167, %166 ]
%177 = call i32 @lstat_test(i8* %8, %struct.stat* %5)
%178 = call i32 @expect_zng(i32 0, i32 %177)
%179 = icmp eq i32 %178, 0
br i1 %179, label %183, label %180
180: ; preds = %175
%181 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.39, i64 0, i64 0))
%182 = call i32 @fflush(i32* null)
br label %183
183: ; preds = %180, %175
%184 = phi i32 [ -1, %180 ], [ %176, %175 ]
%185 = call i32 @unlink_test(i8* %8)
%186 = call i32 @expect_zng(i32 0, i32 %185)
%187 = icmp eq i32 %186, 0
br i1 %187, label %191, label %188
188: ; preds = %183
%189 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.39, i64 0, i64 0))
%190 = call i32 @fflush(i32* null)
br label %191
191: ; preds = %188, %183
%192 = phi i32 [ -1, %188 ], [ %184, %183 ]
%193 = load i32, i32* @F_OK
%194 = call i32 @access_test(i8* %8, i32 %193)
%195 = call i32 @expect_zng(i32 -1, i32 %194)
%196 = icmp eq i32 %195, 0
br i1 %196, label %200, label %197
197: ; preds = %191
%198 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.39, i64 0, i64 0))
%199 = call i32 @fflush(i32* null)
br label %200
200: ; preds = %197, %191
%201 = phi i32 [ -1, %197 ], [ %192, %191 ]
%202 = call i32 @lstat_test(i8* %8, %struct.stat* %5)
%203 = call i32 @expect_zng(i32 -1, i32 %202)
%204 = icmp eq i32 %203, 0
br i1 %204, label %208, label %205
205: ; preds = %200
%206 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.39, i64 0, i64 0))
%207 = call i32 @fflush(i32* null)
br label %208
208: ; preds = %205, %200
%209 = phi i32 [ -1, %205 ], [ %201, %200 ]
%210 = call i32 (...) @testbreak()
%211 = load i32, i32* @O_RDWR
%212 = load i32, i32* @O_TRUNC
%213 = or i32 %212, %211
%214 = load i32, i32* @O_CREAT
%215 = or i32 %213, %214
%216 = load i32, i32* @S_IRWXU
%217 = call i32 @open_test(i8* %7, i32 %215, i32 %216)
%218 = call i32 @expect_gez(i32 0, i32 %217)
%219 = icmp eq i32 %218, 0
br i1 %219, label %227, label %220
220: ; preds = %208
%221 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.39, i64 0, i64 0))
%222 = call i32 @fflush(i32* null)
%223 = icmp eq i32 %218, -1
br i1 %223, label %224, label %227
224: ; preds = %220
%225 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.38, i64 0, i64 0))
%226 = call i32 @fflush(i32* null)
br label %344
227: ; preds = %208, %220
%228 = phi i32 [ -1, %220 ], [ %209, %208 ]
%229 = call i32 @close_test(i32 %217)
%230 = call i32 @expect_zng(i32 0, i32 %229)
%231 = icmp eq i32 %230, 0
br i1 %231, label %235, label %232
232: ; preds = %227
%233 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.39, i64 0, i64 0))
%234 = call i32 @fflush(i32* null)
br label %235
235: ; preds = %232, %227
%236 = phi i32 [ -1, %232 ], [ %228, %227 ]
%237 = call i32 @link_test(i8* %7, i8* %9)
%238 = call i32 @expect_zng(i32 0, i32 %237)
%239 = icmp eq i32 %238, 0
br i1 %239, label %247, label %240
240: ; preds = %235
%241 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.39, i64 0, i64 0))
%242 = call i32 @fflush(i32* null)
%243 = icmp eq i32 %238, -1
br i1 %243, label %244, label %247
244: ; preds = %240
%245 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.38, i64 0, i64 0))
%246 = call i32 @fflush(i32* null)
br label %344
247: ; preds = %235, %240
%248 = phi i32 [ -1, %240 ], [ %236, %235 ]
%249 = call i32 @stat_test(i8* %7, %struct.stat* %5)
%250 = call i32 @expect_zng(i32 0, i32 %249)
%251 = icmp eq i32 %250, 0
br i1 %251, label %255, label %252
252: ; preds = %247
%253 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.39, i64 0, i64 0))
%254 = call i32 @fflush(i32* null)
br label %255
255: ; preds = %252, %247
%256 = phi i32 [ -1, %252 ], [ %248, %247 ]
%257 = call i32 @lstat_test(i8* %9, %struct.stat* %6)
%258 = call i32 @expect_zng(i32 0, i32 %257)
%259 = icmp eq i32 %258, 0
br i1 %259, label %263, label %260
260: ; preds = %255
%261 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.39, i64 0, i64 0))
%262 = call i32 @fflush(i32* null)
br label %263
263: ; preds = %260, %255
%264 = phi i32 [ -1, %260 ], [ %256, %255 ]
%265 = load i32, i32* %71
%266 = load i32, i32* %131
%267 = call i32 @expect_val(i32 %265, i32 %266)
%268 = icmp eq i32 %267, 0
br i1 %268, label %272, label %269
269: ; preds = %263
%270 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.39, i64 0, i64 0))
%271 = call i32 @fflush(i32* null)
br label %272
272: ; preds = %269, %263
%273 = phi i32 [ -1, %269 ], [ %264, %263 ]
%274 = load i32, i32* %140
%275 = load i32, i32* %142
%276 = call i32 @expect_val(i32 %274, i32 %275)
%277 = icmp eq i32 %276, 0
br i1 %277, label %281, label %278
278: ; preds = %272
%279 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.39, i64 0, i64 0))
%280 = call i32 @fflush(i32* null)
br label %281
281: ; preds = %278, %272
%282 = phi i32 [ -1, %278 ], [ %273, %272 ]
%283 = call i32 @unlink_test(i8* %7)
%284 = call i32 @expect_zng(i32 0, i32 %283)
%285 = icmp eq i32 %284, 0
br i1 %285, label %289, label %286
286: ; preds = %281
%287 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.39, i64 0, i64 0))
%288 = call i32 @fflush(i32* null)
br label %289
289: ; preds = %286, %281
%290 = phi i32 [ -1, %286 ], [ %282, %281 ]
%291 = load i32, i32* @F_OK
%292 = call i32 @access_test(i8* %7, i32 %291)
%293 = call i32 @expect_zng(i32 -1, i32 %292)
%294 = icmp eq i32 %293, 0
br i1 %294, label %298, label %295
295: ; preds = %289
%296 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.39, i64 0, i64 0))
%297 = call i32 @fflush(i32* null)
br label %298
298: ; preds = %295, %289
%299 = phi i32 [ -1, %295 ], [ %290, %289 ]
%300 = load i32, i32* @F_OK
%301 = call i32 @access_test(i8* %9, i32 %300)
%302 = call i32 @expect_zng(i32 0, i32 %301)
%303 = icmp eq i32 %302, 0
br i1 %303, label %307, label %304
304: ; preds = %298
%305 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.39, i64 0, i64 0))
%306 = call i32 @fflush(i32* null)
br label %307
307: ; preds = %304, %298
%308 = phi i32 [ -1, %304 ], [ %299, %298 ]
%309 = call i32 @stat_test(i8* %9, %struct.stat* %6)
%310 = call i32 @expect_zng(i32 0, i32 %309)
%311 = icmp eq i32 %310, 0
br i1 %311, label %315, label %312
312: ; preds = %307
%313 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.39, i64 0, i64 0))
%314 = call i32 @fflush(i32* null)
br label %315
315: ; preds = %312, %307
%316 = phi i32 [ -1, %312 ], [ %308, %307 ]
%317 = load i32, i32* %142
%318 = load i32, i32* %140
%319 = call i32 @expect_val(i32 %317, i32 %318)
%320 = icmp eq i32 %319, 0
br i1 %320, label %324, label %321
321: ; preds = %315
%322 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.39, i64 0, i64 0))
%323 = call i32 @fflush(i32* null)
br label %324
324: ; preds = %321, %315
%325 = phi i32 [ -1, %321 ], [ %316, %315 ]
%326 = call i32 @unlink_test(i8* %9)
%327 = call i32 @expect_zng(i32 0, i32 %326)
%328 = icmp eq i32 %327, 0
br i1 %328, label %332, label %329
329: ; preds = %324
%330 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.39, i64 0, i64 0))
%331 = call i32 @fflush(i32* null)
br label %332
332: ; preds = %329, %324
%333 = phi i32 [ -1, %329 ], [ %325, %324 ]
%334 = load i32, i32* @F_OK
%335 = call i32 @access_test(i8* %9, i32 %334)
%336 = call i32 @expect_zng(i32 -1, i32 %335)
%337 = icmp eq i32 %336, 0
br i1 %337, label %341, label %338
338: ; preds = %332
%339 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.39, i64 0, i64 0))
%340 = call i32 @fflush(i32* null)
br label %341
341: ; preds = %338, %332
%342 = phi i32 [ -1, %338 ], [ %333, %332 ]
%343 = call i32 (...) @testbreak()
br label %344
344: ; preds = %341, %244, %224, %50, %30
%345 = phi i32 [ -1, %30 ], [ -1, %50 ], [ -1, %224 ], [ -1, %244 ], [ %342, %341 ]
ret i32 %345
}