#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int AT_FDCWD;
int /*<<< orphan*/ AT_SYMLINK_FOLLOW;
int O_DIRECTORY;
int O_RDONLY;
int errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int linkat(int, char *, int, char const *, int /*<<< orphan*/);
int mkdirat(int, char const *, int);
int openat(int, char const *, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stderr;
scalar_t__ strlen(char const *);
int main() {
  int subd = openat(AT_FDCWD, "tmp/subdir1", O_RDONLY | O_DIRECTORY);
  fprintf(stderr, "subd is %d\n", subd);
  const char *longstr =
      "abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789_abcdef_"
      "0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789";
  int fard = subd;
  for (int i = 0; i < 3; i++) {
    fprintf(stderr, "strlen is %lu\n", (unsigned long)strlen(longstr));
    fprintf(stderr, "making the %d %s in %d\n", i, longstr, fard);
    int retval = mkdirat(fard, longstr, 0777);
    if (retval) {
      perror("mkdirat");
    }
    fard = openat(fard, longstr, O_RDONLY | O_DIRECTORY);
    if (fard < 0) {
      perror("openat");
      fprintf(stderr, "that was the error...\n");
    }
    fprintf(stderr, "fard = %d, errno = %d\n", fard, errno);
  }
  int retval = linkat(subd, "foo_symlink", fard, longstr, AT_SYMLINK_FOLLOW);
  if (retval < 0) {
    perror("trouble");
  }
  printf("retval was %d\n", retval);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e2a(%rip),%rax
mov    (%rax),%edi
mov    0x2e59(%rip),%rax
mov    (%rax),%edx
mov    0x2e38(%rip),%rax
or     (%rax),%edx
lea    0xe5f(%rip),%rsi
call   1040 <openat@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e18(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
lea    0xe50(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
lea    0xe4e(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x3,-0x18(%rbp)
jge    12d9 <main+0x169>
mov    0x2ddc(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x24(%rbp),%edi
mov    %rax,%rdx
lea    0xe81(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2db3(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
lea    0xe6e(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x1ff,%edx
call   1070 <mkdirat@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     125a <main+0xea>
lea    0xe5a(%rip),%rdi
call   1090 <perror@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    0x2d80(%rip),%rax
mov    (%rax),%edx
mov    0x2d5f(%rip),%rax
or     (%rax),%edx
call   1040 <openat@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    12a8 <main+0x138>
lea    0xe2b(%rip),%rdi
call   1090 <perror@plt>
mov    0x2d30(%rip),%rax
mov    (%rax),%edi
lea    0xe1d(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2d19(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
mov    0x2d05(%rip),%rax
mov    (%rax),%ecx
lea    0xe11(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11db <main+0x6b>
mov    -0x8(%rbp),%edi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    0x2cf6(%rip),%rax
mov    (%rax),%r8d
lea    0xdf8(%rip),%rsi
call   1080 <linkat@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    1312 <main+0x1a2>
lea    0xdeb(%rip),%rdi
call   1090 <perror@plt>
mov    -0x20(%rbp),%esi
lea    0xde4(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    0x2e3e(%rip),%rax
mov    (%rax),%edi
mov    0x2e6d(%rip),%rbx
mov    0x2e4e(%rip),%r13
mov    0x0(%r13),%edx
or     (%rbx),%edx
lea    0xe71(%rip),%rsi
call   1030 <openat@plt>
mov    %eax,%r14d
mov    0x2e2a(%rip),%r15
mov    (%r15),%edi
lea    0xe64(%rip),%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%r15),%edi
lea    0xecd(%rip),%rsi
mov    $0x6f,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%r15),%edi
lea    0xec6(%rip),%rsi
lea    0xe40(%rip),%rbp
xor    %edx,%edx
mov    %rbp,%rcx
mov    %r14d,%r8d
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    %r14d,%edi
mov    %rbp,%rsi
mov    $0x1ff,%edx
call   1060 <mkdirat@plt>
test   %eax,%eax
jne    139f <main+0x23f>
mov    0x0(%r13),%edx
or     (%rbx),%edx
lea    0xe0c(%rip),%rsi
mov    %r14d,%edi
call   1030 <openat@plt>
mov    %eax,%ebp
test   %eax,%eax
js     13b0 <main+0x250>
mov    (%r15),%edi
mov    0x2d98(%rip),%r12
mov    (%r12),%ecx
lea    0xea2(%rip),%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%r15),%edi
lea    0xe42(%rip),%rsi
mov    $0x6f,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%r15),%edi
lea    0xe3b(%rip),%rsi
lea    0xdb5(%rip),%rbx
mov    $0x1,%edx
mov    %rbx,%rcx
mov    %ebp,%r8d
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x1ff,%edx
call   1060 <mkdirat@plt>
test   %eax,%eax
jne    13d2 <main+0x272>
mov    0x0(%r13),%edx
mov    0x2d51(%rip),%rax
or     (%rax),%edx
lea    0xd78(%rip),%rsi
mov    %ebp,%edi
call   1030 <openat@plt>
mov    %eax,%ebp
test   %eax,%eax
js     13e3 <main+0x283>
mov    (%r15),%edi
mov    (%r12),%ecx
lea    0xe16(%rip),%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%r15),%edi
lea    0xdb6(%rip),%rsi
mov    $0x6f,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%r15),%edi
lea    0xdaf(%rip),%rsi
lea    0xd29(%rip),%rbx
mov    $0x2,%edx
mov    %rbx,%rcx
mov    %ebp,%r8d
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x1ff,%edx
call   1060 <mkdirat@plt>
test   %eax,%eax
jne    1405 <main+0x2a5>
mov    0x0(%r13),%edx
mov    0x2cc5(%rip),%rax
or     (%rax),%edx
lea    0xcec(%rip),%rsi
mov    %ebp,%edi
call   1030 <openat@plt>
mov    %eax,%ebp
test   %eax,%eax
js     1416 <main+0x2b6>
mov    (%r15),%edi
mov    (%r12),%ecx
lea    0xd8a(%rip),%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x2c85(%rip),%rax
mov    (%rax),%r8d
lea    0xd87(%rip),%rsi
lea    0xcac(%rip),%rcx
mov    %r14d,%edi
mov    %ebp,%edx
call   1070 <linkat@plt>
mov    %eax,%ebx
test   %eax,%eax
js     1438 <main+0x2d8>
lea    0xd79(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd09(%rip),%rdi
call   1080 <perror@plt>
jmp    11ff <main+0x9f>
lea    0xd00(%rip),%rdi
call   1080 <perror@plt>
mov    (%r15),%edi
lea    0xcf8(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
jmp    121e <main+0xbe>
lea    0xcd6(%rip),%rdi
call   1080 <perror@plt>
jmp    128c <main+0x12c>
lea    0xccd(%rip),%rdi
call   1080 <perror@plt>
mov    (%r15),%edi
lea    0xcc5(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
jmp    12b1 <main+0x151>
lea    0xca3(%rip),%rdi
call   1080 <perror@plt>
jmp    1318 <main+0x1b8>
lea    0xc9a(%rip),%rdi
call   1080 <perror@plt>
mov    (%r15),%edi
lea    0xc92(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
jmp    133d <main+0x1dd>
lea    0xcb9(%rip),%rdi
call   1080 <perror@plt>
jmp    1380 <main+0x220>

LLVM IR (-O0):
@AT_FDCWD = global i32 0
@.str = [12 x i8] c"tmp/subdir1\00"
@O_RDONLY = global i32 0
@O_DIRECTORY = global i32 0
@stderr = global i32 0
@.str.1 = [12 x i8] c"subd is %d\0A\00"
@.str.2 = [112 x i8] c"abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789_abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789\00"
@.str.3 = [15 x i8] c"strlen is %lu\0A\00"
@.str.4 = [24 x i8] c"making the %d %s in %d\0A\00"
@.str.5 = [8 x i8] c"mkdirat\00"
@.str.6 = [7 x i8] c"openat\00"
@.str.7 = [23 x i8] c"that was the error...\0A\00"
@.str.8 = [23 x i8] c"fard = %d, errno = %d\0A\00"
@errno = global i32 0
@.str.9 = [12 x i8] c"foo_symlink\00"
@AT_SYMLINK_FOLLOW = global i32 0
@.str.10 = [8 x i8] c"trouble\00"
@.str.11 = [15 x i8] c"retval was %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = load i32, i32* @AT_FDCWD
%9 = load i32, i32* @O_RDONLY
%10 = load i32, i32* @O_DIRECTORY
%11 = or i32 %9, %10
%12 = call i32 @openat(i32 %8, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %11)
store i32 %12, i32* %2
%13 = load i32, i32* @stderr
%14 = load i32, i32* %2
%15 = call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %14)
store i8* getelementptr inbounds ([112 x i8], [112 x i8]* @.str.2, i64 0, i64 0), i8** %3
%16 = load i32, i32* %2
store i32 %16, i32* %4
store i32 0, i32* %5
br label %17
17: ; preds = %55, %0
%18 = load i32, i32* %5
%19 = icmp slt i32 %18, 3
br i1 %19, label %20, label %58
20: ; preds = %17
%21 = load i32, i32* @stderr
%22 = load i8*, i8** %3
%23 = call i64 @strlen(i8* %22)
%24 = call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i64 %23)
%25 = load i32, i32* @stderr
%26 = load i32, i32* %5
%27 = load i8*, i8** %3
%28 = load i32, i32* %4
%29 = call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i32 %26, i8* %27, i32 %28)
%30 = load i32, i32* %4
%31 = load i8*, i8** %3
%32 = call i32 @mkdirat(i32 %30, i8* %31, i32 511)
store i32 %32, i32* %6
%33 = load i32, i32* %6
%34 = icmp ne i32 %33, 0
br i1 %34, label %35, label %37
35: ; preds = %20
%36 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
br label %37
37: ; preds = %35, %20
%38 = load i32, i32* %4
%39 = load i8*, i8** %3
%40 = load i32, i32* @O_RDONLY
%41 = load i32, i32* @O_DIRECTORY
%42 = or i32 %40, %41
%43 = call i32 @openat(i32 %38, i8* %39, i32 %42)
store i32 %43, i32* %4
%44 = load i32, i32* %4
%45 = icmp slt i32 %44, 0
br i1 %45, label %46, label %50
46: ; preds = %37
%47 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%48 = load i32, i32* @stderr
%49 = call i32 (i32, i8*, ...) @fprintf(i32 %48, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0))
br label %50
50: ; preds = %46, %37
%51 = load i32, i32* @stderr
%52 = load i32, i32* %4
%53 = load i32, i32* @errno
%54 = call i32 (i32, i8*, ...) @fprintf(i32 %51, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0), i32 %52, i32 %53)
br label %55
55: ; preds = %50
%56 = load i32, i32* %5
%57 = add nsw i32 %56, 1
store i32 %57, i32* %5
br label %17
58: ; preds = %17
%59 = load i32, i32* %2
%60 = load i32, i32* %4
%61 = load i8*, i8** %3
%62 = load i32, i32* @AT_SYMLINK_FOLLOW
%63 = call i32 @linkat(i32 %59, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i32 %60, i8* %61, i32 %62)
store i32 %63, i32* %7
%64 = load i32, i32* %7
%65 = icmp slt i32 %64, 0
br i1 %65, label %66, label %68
66: ; preds = %58
%67 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0))
br label %68
68: ; preds = %66, %58
%69 = load i32, i32* %7
%70 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.11, i64 0, i64 0), i32 %69)
ret i32 0
}

LLVM IR (-O2):
@AT_FDCWD = global i32 0
@.str = [12 x i8] c"tmp/subdir1\00"
@O_RDONLY = global i32 0
@O_DIRECTORY = global i32 0
@stderr = global i32 0
@.str.1 = [12 x i8] c"subd is %d\0A\00"
@.str.2 = [112 x i8] c"abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789_abcdef_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789\00"
@.str.3 = [15 x i8] c"strlen is %lu\0A\00"
@.str.4 = [24 x i8] c"making the %d %s in %d\0A\00"
@.str.5 = [8 x i8] c"mkdirat\00"
@.str.6 = [7 x i8] c"openat\00"
@.str.7 = [23 x i8] c"that was the error...\0A\00"
@.str.8 = [23 x i8] c"fard = %d, errno = %d\0A\00"
@errno = global i32 0
@.str.9 = [12 x i8] c"foo_symlink\00"
@AT_SYMLINK_FOLLOW = global i32 0
@.str.10 = [8 x i8] c"trouble\00"
@.str.11 = [15 x i8] c"retval was %d\0A\00"
define i32 @main() {
%1 = load i32, i32* @AT_FDCWD
%2 = load i32, i32* @O_RDONLY
%3 = load i32, i32* @O_DIRECTORY
%4 = or i32 %3, %2
%5 = tail call i32 @openat(i32 %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%8 = load i32, i32* @stderr
%9 = tail call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i64 111)
%10 = load i32, i32* @stderr
%11 = tail call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i32 0, i8* getelementptr inbounds ([112 x i8], [112 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%12 = tail call i32 @mkdirat(i32 %5, i8* getelementptr inbounds ([112 x i8], [112 x i8]* @.str.2, i64 0, i64 0), i32 511)
%13 = icmp eq i32 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %0
%15 = tail call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
br label %16
16: ; preds = %14, %0
%17 = load i32, i32* @O_RDONLY
%18 = load i32, i32* @O_DIRECTORY
%19 = or i32 %18, %17
%20 = tail call i32 @openat(i32 %5, i8* getelementptr inbounds ([112 x i8], [112 x i8]* @.str.2, i64 0, i64 0), i32 %19)
%21 = icmp slt i32 %20, 0
br i1 %21, label %22, label %26
22: ; preds = %16
%23 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%24 = load i32, i32* @stderr
%25 = tail call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0))
br label %26
26: ; preds = %22, %16
%27 = load i32, i32* @stderr
%28 = load i32, i32* @errno
%29 = tail call i32 (i32, i8*, ...) @fprintf(i32 %27, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0), i32 %20, i32 %28)
%30 = load i32, i32* @stderr
%31 = tail call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i64 111)
%32 = load i32, i32* @stderr
%33 = tail call i32 (i32, i8*, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([112 x i8], [112 x i8]* @.str.2, i64 0, i64 0), i32 %20)
%34 = tail call i32 @mkdirat(i32 %20, i8* getelementptr inbounds ([112 x i8], [112 x i8]* @.str.2, i64 0, i64 0), i32 511)
%35 = icmp eq i32 %34, 0
br i1 %35, label %38, label %36
36: ; preds = %26
%37 = tail call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
br label %38
38: ; preds = %36, %26
%39 = load i32, i32* @O_RDONLY
%40 = load i32, i32* @O_DIRECTORY
%41 = or i32 %40, %39
%42 = tail call i32 @openat(i32 %20, i8* getelementptr inbounds ([112 x i8], [112 x i8]* @.str.2, i64 0, i64 0), i32 %41)
%43 = icmp slt i32 %42, 0
br i1 %43, label %44, label %48
44: ; preds = %38
%45 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%46 = load i32, i32* @stderr
%47 = tail call i32 (i32, i8*, ...) @fprintf(i32 %46, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0))
br label %48
48: ; preds = %44, %38
%49 = load i32, i32* @stderr
%50 = load i32, i32* @errno
%51 = tail call i32 (i32, i8*, ...) @fprintf(i32 %49, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0), i32 %42, i32 %50)
%52 = load i32, i32* @stderr
%53 = tail call i32 (i32, i8*, ...) @fprintf(i32 %52, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i64 111)
%54 = load i32, i32* @stderr
%55 = tail call i32 (i32, i8*, ...) @fprintf(i32 %54, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i32 2, i8* getelementptr inbounds ([112 x i8], [112 x i8]* @.str.2, i64 0, i64 0), i32 %42)
%56 = tail call i32 @mkdirat(i32 %42, i8* getelementptr inbounds ([112 x i8], [112 x i8]* @.str.2, i64 0, i64 0), i32 511)
%57 = icmp eq i32 %56, 0
br i1 %57, label %60, label %58
58: ; preds = %48
%59 = tail call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
br label %60
60: ; preds = %58, %48
%61 = load i32, i32* @O_RDONLY
%62 = load i32, i32* @O_DIRECTORY
%63 = or i32 %62, %61
%64 = tail call i32 @openat(i32 %42, i8* getelementptr inbounds ([112 x i8], [112 x i8]* @.str.2, i64 0, i64 0), i32 %63)
%65 = icmp slt i32 %64, 0
br i1 %65, label %66, label %70
66: ; preds = %60
%67 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%68 = load i32, i32* @stderr
%69 = tail call i32 (i32, i8*, ...) @fprintf(i32 %68, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0))
br label %70
70: ; preds = %66, %60
%71 = load i32, i32* @stderr
%72 = load i32, i32* @errno
%73 = tail call i32 (i32, i8*, ...) @fprintf(i32 %71, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0), i32 %64, i32 %72)
%74 = load i32, i32* @AT_SYMLINK_FOLLOW
%75 = tail call i32 @linkat(i32 %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i32 %64, i8* getelementptr inbounds ([112 x i8], [112 x i8]* @.str.2, i64 0, i64 0), i32 %74)
%76 = icmp slt i32 %75, 0
br i1 %76, label %77, label %79
77: ; preds = %70
%78 = tail call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0))
br label %79
79: ; preds = %77, %70
%80 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.11, i64 0, i64 0), i32 %75)
ret i32 0
}