#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 flock {
  int l_start;
  int l_len;
  void *l_whence;
  void *l_type;
};
typedef int off_t;

/* Variables and functions */
void *F_RDLCK;
int /*<<< orphan*/ F_SETLK;
void *F_WRLCK;
int /*<<< orphan*/ O_RDWR;
void *SEEK_SET;
int atoi(char *);
int /*<<< orphan*/ dump_lock(char *, struct flock *);
int /*<<< orphan*/ err_sys(char *, char *);
char *errno;
int fcntl(int, int /*<<< orphan*/, struct flock *);
int /*<<< orphan*/ getpid();
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ usage();
int main(int argc, char *argv[]) {
  if (argc != 3)
    usage();
  off_t len = atoi(argv[2]);
  int fd = open(argv[1], O_RDWR);
  if (fd == -1)
    err_sys("open %s failed", argv[1]);
  struct flock lock;
  lock.l_type = F_RDLCK;
  lock.l_start = 0;
  lock.l_whence = SEEK_SET;
  lock.l_len = len;
  dump_lock("LOCK", &lock);
  int ret = fcntl(fd, F_SETLK, &lock);
  if (ret == -1)
    err_sys("fcntl failed, errno %d", errno);
  printf("[%lu] got read lock\n", getpid());
  sleep(2);
  lock.l_type = F_WRLCK;
  lock.l_start = len / 4;
  lock.l_whence = SEEK_SET;
  lock.l_len = len / 2;
  dump_lock("LOCK", &lock);
  ret = fcntl(fd, F_SETLK, &lock);
  if (ret == -1)
    err_sys("fcntl failed, errno %d", errno);
  printf("[%lu] got write lock\n", getpid());
  sleep(2);
  lock.l_type = F_RDLCK;
  lock.l_start = len / 2;
  lock.l_whence = SEEK_SET;
  lock.l_len = 1;
  dump_lock("LOCK", &lock);
  ret = fcntl(fd, F_SETLK, &lock);
  if (ret == -1)
    err_sys("fcntl failed, errno %d", errno);
  printf("[%lu] got read lock again\n", getpid());
  sleep(2);
  printf("%lu exit\n", getpid());
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     11b7 <main+0x27>
mov    $0x0,%al
call   1070 <usage@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1090 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2e12(%rip),%rax
mov    (%rax),%esi
call   1080 <open@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
jne    11fe <main+0x6e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe07(%rip),%rdi
call   1030 <err_sys@plt>
mov    0x2dab(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x30(%rbp)
mov    0x2dae(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x2c(%rbp)
lea    0xde1(%rip),%rdi
lea    -0x30(%rbp),%rsi
call   10b0 <dump_lock@plt>
mov    -0x18(%rbp),%edi
mov    0x2d9f(%rip),%rax
mov    (%rax),%esi
lea    -0x30(%rbp),%rdx
call   1040 <fcntl@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0xffffffff,-0x34(%rbp)
jne    126f <main+0xdf>
mov    0x2d70(%rip),%rax
mov    (%rax),%rsi
lea    0xdaa(%rip),%rdi
call   1030 <err_sys@plt>
mov    $0x0,%al
call   1050 <getpid@plt>
mov    %eax,%esi
lea    0xdac(%rip),%rdi
call   1060 <printf@plt>
mov    $0x2,%edi
call   10a0 <sleep@plt>
mov    0x2d2b(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,-0x30(%rbp)
mov    0x2d17(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x2c(%rbp)
lea    0xd42(%rip),%rdi
lea    -0x30(%rbp),%rsi
call   10b0 <dump_lock@plt>
mov    -0x18(%rbp),%edi
mov    0x2d00(%rip),%rax
mov    (%rax),%esi
lea    -0x30(%rbp),%rdx
call   1040 <fcntl@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0xffffffff,-0x34(%rbp)
jne    130e <main+0x17e>
mov    0x2cd1(%rip),%rax
mov    (%rax),%rsi
lea    0xd0b(%rip),%rdi
call   1030 <err_sys@plt>
mov    $0x0,%al
call   1050 <getpid@plt>
mov    %eax,%esi
lea    0xd22(%rip),%rdi
call   1060 <printf@plt>
mov    $0x2,%edi
call   10a0 <sleep@plt>
mov    0x2c7c(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x30(%rbp)
mov    0x2c78(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
movl   $0x1,-0x2c(%rbp)
lea    0xcaa(%rip),%rdi
lea    -0x30(%rbp),%rsi
call   10b0 <dump_lock@plt>
mov    -0x18(%rbp),%edi
mov    0x2c68(%rip),%rax
mov    (%rax),%esi
lea    -0x30(%rbp),%rdx
call   1040 <fcntl@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0xffffffff,-0x34(%rbp)
jne    13a6 <main+0x216>
mov    0x2c39(%rip),%rax
mov    (%rax),%rsi
lea    0xc73(%rip),%rdi
call   1030 <err_sys@plt>
mov    $0x0,%al
call   1050 <getpid@plt>
mov    %eax,%esi
lea    0xca0(%rip),%rdi
call   1060 <printf@plt>
mov    $0x2,%edi
call   10a0 <sleep@plt>
mov    $0x0,%al
call   1050 <getpid@plt>
mov    %eax,%esi
lea    0xc9c(%rip),%rdi
call   1060 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbp
cmp    $0x3,%edi
je     11ad <main+0x1d>
xor    %eax,%eax
call   1070 <usage@plt>
mov    0x10(%rbp),%rdi
call   1090 <atoi@plt>
mov    %eax,%ebx
mov    0x8(%rbp),%rdi
mov    0x2e25(%rip),%rax
mov    (%rax),%esi
call   1080 <open@plt>
mov    %eax,%r14d
cmp    $0xffffffff,%eax
jne    11e2 <main+0x52>
mov    0x8(%rbp),%rsi
lea    0xe23(%rip),%rdi
call   1030 <err_sys@plt>
mov    0x2dc7(%rip),%r15
mov    (%r15),%rax
mov    %rax,0x10(%rsp)
movl   $0x0,(%rsp)
mov    0x2dc9(%rip),%r12
mov    (%r12),%rax
mov    %rax,0x8(%rsp)
mov    %ebx,0x4(%rsp)
lea    0xdfc(%rip),%rdi
mov    %rsp,%rbp
mov    %rbp,%rsi
call   10b0 <dump_lock@plt>
mov    0x2dbb(%rip),%r13
mov    0x0(%r13),%esi
mov    %r14d,%edi
mov    %rbp,%rdx
call   1040 <fcntl@plt>
cmp    $0xffffffff,%eax
jne    124f <main+0xbf>
mov    0x2d90(%rip),%rax
mov    (%rax),%rsi
lea    0xdca(%rip),%rdi
call   1030 <err_sys@plt>
xor    %eax,%eax
call   1050 <getpid@plt>
lea    0xdce(%rip),%rdi
mov    %eax,%esi
call   1060 <printf@plt>
mov    $0x2,%edi
call   10a0 <sleep@plt>
mov    0x2d4b(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x10(%rsp)
lea    0x3(%rbx),%eax
test   %ebx,%ebx
cmovns %ebx,%eax
sar    $0x2,%eax
mov    %eax,(%rsp)
mov    (%r12),%rax
mov    %rax,0x8(%rsp)
mov    %ebx,%ebp
shr    $0x1f,%ebp
add    %ebx,%ebp
sar    %ebp
mov    %ebp,0x4(%rsp)
lea    0xd67(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   10b0 <dump_lock@plt>
mov    0x0(%r13),%esi
mov    %r14d,%edi
mov    %rbx,%rdx
call   1040 <fcntl@plt>
cmp    $0xffffffff,%eax
jne    12dd <main+0x14d>
mov    0x2d02(%rip),%rax
mov    (%rax),%rsi
lea    0xd3c(%rip),%rdi
call   1030 <err_sys@plt>
xor    %eax,%eax
call   1050 <getpid@plt>
lea    0xd55(%rip),%rdi
mov    %eax,%esi
call   1060 <printf@plt>
mov    $0x2,%edi
call   10a0 <sleep@plt>
mov    (%r15),%rax
mov    %rax,0x10(%rsp)
mov    %ebp,(%rsp)
mov    (%r12),%rax
mov    %rax,0x8(%rsp)
movl   $0x1,0x4(%rsp)
lea    0xcf0(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   10b0 <dump_lock@plt>
mov    0x0(%r13),%esi
mov    %r14d,%edi
mov    %rbx,%rdx
call   1040 <fcntl@plt>
cmp    $0xffffffff,%eax
jne    1354 <main+0x1c4>
mov    0x2c8b(%rip),%rax
mov    (%rax),%rsi
lea    0xcc5(%rip),%rdi
call   1030 <err_sys@plt>
xor    %eax,%eax
call   1050 <getpid@plt>
lea    0xcf4(%rip),%rdi
mov    %eax,%esi
call   1060 <printf@plt>
mov    $0x2,%edi
call   10a0 <sleep@plt>
xor    %eax,%eax
call   1050 <getpid@plt>
lea    0xcf0(%rip),%rdi
mov    %eax,%esi
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.flock = type { i32, i32, i8*, i8* }
@O_RDWR = global i32 0
@.str = [15 x i8] c"open %s failed\00"
@F_RDLCK = global i8* null
@SEEK_SET = global i8* null
@.str.1 = [5 x i8] c"LOCK\00"
@F_SETLK = global i32 0
@.str.2 = [23 x i8] c"fcntl failed, errno %d\00"
@errno = global i8* null
@.str.3 = [21 x i8] c"[%lu] got read lock\0A\00"
@F_WRLCK = global i8* null
@.str.4 = [22 x i8] c"[%lu] got write lock\0A\00"
@.str.5 = [27 x i8] c"[%lu] got read lock again\0A\00"
@.str.6 = [10 x i8] c"%lu exit\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.flock
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 3
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @usage()
br label %14
14: ; preds = %12, %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 2
%17 = load i8*, i8** %16
%18 = call i32 @atoi(i8* %17)
store i32 %18, i32* %6
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = load i32, i32* @O_RDWR
%23 = call i32 @open(i8* %21, i32 %22)
store i32 %23, i32* %7
%24 = load i32, i32* %7
%25 = icmp eq i32 %24, -1
br i1 %25, label %26, label %31
26: ; preds = %14
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 1
%29 = load i8*, i8** %28
%30 = call i32 @err_sys(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %29)
br label %31
31: ; preds = %26, %14
%32 = load i8*, i8** @F_RDLCK
%33 = getelementptr inbounds %struct.flock, %struct.flock* %8, i32 0, i32 3
store i8* %32, i8** %33
%34 = getelementptr inbounds %struct.flock, %struct.flock* %8, i32 0, i32 0
store i32 0, i32* %34
%35 = load i8*, i8** @SEEK_SET
%36 = getelementptr inbounds %struct.flock, %struct.flock* %8, i32 0, i32 2
store i8* %35, i8** %36
%37 = load i32, i32* %6
%38 = getelementptr inbounds %struct.flock, %struct.flock* %8, i32 0, i32 1
store i32 %37, i32* %38
%39 = call i32 @dump_lock(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %struct.flock* %8)
%40 = load i32, i32* %7
%41 = load i32, i32* @F_SETLK
%42 = call i32 @fcntl(i32 %40, i32 %41, %struct.flock* %8)
store i32 %42, i32* %9
%43 = load i32, i32* %9
%44 = icmp eq i32 %43, -1
br i1 %44, label %45, label %48
45: ; preds = %31
%46 = load i8*, i8** @errno
%47 = call i32 @err_sys(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* %46)
br label %48
48: ; preds = %45, %31
%49 = call i32 (...) @getpid()
%50 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 %49)
%51 = call i32 @sleep(i32 2)
%52 = load i8*, i8** @F_WRLCK
%53 = getelementptr inbounds %struct.flock, %struct.flock* %8, i32 0, i32 3
store i8* %52, i8** %53
%54 = load i32, i32* %6
%55 = sdiv i32 %54, 4
%56 = getelementptr inbounds %struct.flock, %struct.flock* %8, i32 0, i32 0
store i32 %55, i32* %56
%57 = load i8*, i8** @SEEK_SET
%58 = getelementptr inbounds %struct.flock, %struct.flock* %8, i32 0, i32 2
store i8* %57, i8** %58
%59 = load i32, i32* %6
%60 = sdiv i32 %59, 2
%61 = getelementptr inbounds %struct.flock, %struct.flock* %8, i32 0, i32 1
store i32 %60, i32* %61
%62 = call i32 @dump_lock(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %struct.flock* %8)
%63 = load i32, i32* %7
%64 = load i32, i32* @F_SETLK
%65 = call i32 @fcntl(i32 %63, i32 %64, %struct.flock* %8)
store i32 %65, i32* %9
%66 = load i32, i32* %9
%67 = icmp eq i32 %66, -1
br i1 %67, label %68, label %71
68: ; preds = %48
%69 = load i8*, i8** @errno
%70 = call i32 @err_sys(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* %69)
br label %71
71: ; preds = %68, %48
%72 = call i32 (...) @getpid()
%73 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 %72)
%74 = call i32 @sleep(i32 2)
%75 = load i8*, i8** @F_RDLCK
%76 = getelementptr inbounds %struct.flock, %struct.flock* %8, i32 0, i32 3
store i8* %75, i8** %76
%77 = load i32, i32* %6
%78 = sdiv i32 %77, 2
%79 = getelementptr inbounds %struct.flock, %struct.flock* %8, i32 0, i32 0
store i32 %78, i32* %79
%80 = load i8*, i8** @SEEK_SET
%81 = getelementptr inbounds %struct.flock, %struct.flock* %8, i32 0, i32 2
store i8* %80, i8** %81
%82 = getelementptr inbounds %struct.flock, %struct.flock* %8, i32 0, i32 1
store i32 1, i32* %82
%83 = call i32 @dump_lock(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %struct.flock* %8)
%84 = load i32, i32* %7
%85 = load i32, i32* @F_SETLK
%86 = call i32 @fcntl(i32 %84, i32 %85, %struct.flock* %8)
store i32 %86, i32* %9
%87 = load i32, i32* %9
%88 = icmp eq i32 %87, -1
br i1 %88, label %89, label %92
89: ; preds = %71
%90 = load i8*, i8** @errno
%91 = call i32 @err_sys(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* %90)
br label %92
92: ; preds = %89, %71
%93 = call i32 (...) @getpid()
%94 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i32 %93)
%95 = call i32 @sleep(i32 2)
%96 = call i32 (...) @getpid()
%97 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i32 %96)
%98 = load i32, i32* %3
ret i32 %98
}

LLVM IR (-O2):
%struct.flock = type { i32, i32, i8*, i8* }
@O_RDWR = global i32 0
@.str = [15 x i8] c"open %s failed\00"
@F_RDLCK = global i8* null
@SEEK_SET = global i8* null
@.str.1 = [5 x i8] c"LOCK\00"
@F_SETLK = global i32 0
@.str.2 = [23 x i8] c"fcntl failed, errno %d\00"
@errno = global i8* null
@.str.3 = [21 x i8] c"[%lu] got read lock\0A\00"
@F_WRLCK = global i8* null
@.str.4 = [22 x i8] c"[%lu] got write lock\0A\00"
@.str.5 = [27 x i8] c"[%lu] got read lock again\0A\00"
@.str.6 = [10 x i8] c"%lu exit\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.flock
%4 = icmp eq i32 %0, 3
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 (...) @usage()
br label %7
7: ; preds = %5, %2
%8 = getelementptr inbounds i8*, i8** %1, i64 2
%9 = load i8*, i8** %8
%10 = tail call i32 @atoi(i8* %9)
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = load i32, i32* @O_RDWR
%14 = tail call i32 @open(i8* %12, i32 %13)
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %19
16: ; preds = %7
%17 = load i8*, i8** %11
%18 = tail call i32 @err_sys(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %17)
br label %19
19: ; preds = %16, %7
%20 = bitcast %struct.flock* %3 to i8*
%21 = load i8*, i8** @F_RDLCK
%22 = getelementptr inbounds %struct.flock, %struct.flock* %3, i64 0, i32 3
store i8* %21, i8** %22
%23 = getelementptr inbounds %struct.flock, %struct.flock* %3, i64 0, i32 0
store i32 0, i32* %23
%24 = load i8*, i8** @SEEK_SET
%25 = getelementptr inbounds %struct.flock, %struct.flock* %3, i64 0, i32 2
store i8* %24, i8** %25
%26 = getelementptr inbounds %struct.flock, %struct.flock* %3, i64 0, i32 1
store i32 %10, i32* %26
%27 = call i32 @dump_lock(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %struct.flock* %3)
%28 = load i32, i32* @F_SETLK
%29 = call i32 @fcntl(i32 %14, i32 %28, %struct.flock* %3)
%30 = icmp eq i32 %29, -1
br i1 %30, label %31, label %34
31: ; preds = %19
%32 = load i8*, i8** @errno
%33 = call i32 @err_sys(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* %32)
br label %34
34: ; preds = %31, %19
%35 = call i32 (...) @getpid()
%36 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 %35)
%37 = call i32 @sleep(i32 2)
%38 = load i8*, i8** @F_WRLCK
store i8* %38, i8** %22
%39 = sdiv i32 %10, 4
store i32 %39, i32* %23
%40 = load i8*, i8** @SEEK_SET
store i8* %40, i8** %25
%41 = sdiv i32 %10, 2
store i32 %41, i32* %26
%42 = call i32 @dump_lock(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %struct.flock* %3)
%43 = load i32, i32* @F_SETLK
%44 = call i32 @fcntl(i32 %14, i32 %43, %struct.flock* %3)
%45 = icmp eq i32 %44, -1
br i1 %45, label %46, label %49
46: ; preds = %34
%47 = load i8*, i8** @errno
%48 = call i32 @err_sys(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* %47)
br label %49
49: ; preds = %46, %34
%50 = call i32 (...) @getpid()
%51 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 %50)
%52 = call i32 @sleep(i32 2)
%53 = load i8*, i8** @F_RDLCK
store i8* %53, i8** %22
store i32 %41, i32* %23
%54 = load i8*, i8** @SEEK_SET
store i8* %54, i8** %25
store i32 1, i32* %26
%55 = call i32 @dump_lock(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %struct.flock* %3)
%56 = load i32, i32* @F_SETLK
%57 = call i32 @fcntl(i32 %14, i32 %56, %struct.flock* %3)
%58 = icmp eq i32 %57, -1
br i1 %58, label %59, label %62
59: ; preds = %49
%60 = load i8*, i8** @errno
%61 = call i32 @err_sys(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* %60)
br label %62
62: ; preds = %59, %49
%63 = call i32 (...) @getpid()
%64 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i32 %63)
%65 = call i32 @sleep(i32 2)
%66 = call i32 (...) @getpid()
%67 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i32 %66)
ret i32 0
}