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

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ pthread_rwlock_t;

/* Variables and functions */
scalar_t__ pthread_rwlock_destroy(int /*<<< orphan*/ *);
scalar_t__ pthread_rwlock_init(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
scalar_t__ pthread_rwlock_rdlock(int /*<<< orphan*/ *);
scalar_t__ pthread_rwlock_unlock(int /*<<< orphan*/ *);
scalar_t__ pthread_rwlock_wrlock(int /*<<< orphan*/ *);
int /*<<< orphan*/ puts(char *);
int do_test(void) {
  pthread_rwlock_t r;
  if (pthread_rwlock_init(&r, NULL) != 0) {
    puts("rwlock_init failed");
    return 1;
  }
  puts("rwlock_init succeeded");
  if (pthread_rwlock_rdlock(&r) != 0) {
    puts("1st rwlock_rdlock failed");
    return 1;
  }
  puts("1st rwlock_rdlock succeeded");
  if (pthread_rwlock_rdlock(&r) != 0) {
    puts("2nd rwlock_rdlock failed");
    return 1;
  }
  puts("2nd rwlock_rdlock succeeded");
  if (pthread_rwlock_unlock(&r) != 0) {
    puts("1st rwlock_unlock failed");
    return 1;
  }
  puts("1st rwlock_unlock succeeded");
  if (pthread_rwlock_unlock(&r) != 0) {
    puts("2nd rwlock_unlock failed");
    return 1;
  }
  puts("2nd rwlock_unlock succeeded");
  if (pthread_rwlock_wrlock(&r) != 0) {
    puts("1st rwlock_wrlock failed");
    return 1;
  }
  puts("1st rwlock_wrlock succeeded");
  if (pthread_rwlock_unlock(&r) != 0) {
    puts("3rd rwlock_unlock failed");
    return 1;
  }
  puts("3rd rwlock_unlock succeeded");
  if (pthread_rwlock_wrlock(&r) != 0) {
    puts("2nd rwlock_wrlock failed");
    return 1;
  }
  puts("2nd rwlock_wrlock succeeded");
  if (pthread_rwlock_unlock(&r) != 0) {
    puts("4th rwlock_unlock failed");
    return 1;
  }
  puts("4th rwlock_unlock succeeded");
  if (pthread_rwlock_rdlock(&r) != 0) {
    puts("3rd rwlock_rdlock failed");
    return 1;
  }
  puts("3rd rwlock_rdlock succeeded");
  if (pthread_rwlock_unlock(&r) != 0) {
    puts("5th rwlock_unlock failed");
    return 1;
  }
  puts("5th rwlock_unlock succeeded");
  if (pthread_rwlock_destroy(&r) != 0) {
    puts("rwlock_destroy failed");
    return 1;
  }
  puts("rwlock_destroy succeeded");
  return 0;
}


x86 assembly (clang, -O0):
<do_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <pthread_rwlock_init@plt>
cmp    $0x0,%rax
je     1197 <do_test+0x37>
lea    0xe7a(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    1407 <do_test+0x2a7>
lea    0xe75(%rip),%rdi
call   1030 <puts@plt>
lea    -0x8(%rbp),%rdi
call   1060 <pthread_rwlock_rdlock@plt>
cmp    $0x0,%rax
je     11ce <do_test+0x6e>
lea    0xe6c(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    1407 <do_test+0x2a7>
lea    0xe6d(%rip),%rdi
call   1030 <puts@plt>
lea    -0x8(%rbp),%rdi
call   1060 <pthread_rwlock_rdlock@plt>
cmp    $0x0,%rax
je     1205 <do_test+0xa5>
lea    0xe6a(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    1407 <do_test+0x2a7>
lea    0xe6b(%rip),%rdi
call   1030 <puts@plt>
lea    -0x8(%rbp),%rdi
call   1080 <pthread_rwlock_unlock@plt>
cmp    $0x0,%rax
je     123c <do_test+0xdc>
lea    0xe68(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    1407 <do_test+0x2a7>
lea    0xe69(%rip),%rdi
call   1030 <puts@plt>
lea    -0x8(%rbp),%rdi
call   1080 <pthread_rwlock_unlock@plt>
cmp    $0x0,%rax
je     1273 <do_test+0x113>
lea    0xe66(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    1407 <do_test+0x2a7>
lea    0xe67(%rip),%rdi
call   1030 <puts@plt>
lea    -0x8(%rbp),%rdi
call   1040 <pthread_rwlock_wrlock@plt>
cmp    $0x0,%rax
je     12aa <do_test+0x14a>
lea    0xe64(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    1407 <do_test+0x2a7>
lea    0xe65(%rip),%rdi
call   1030 <puts@plt>
lea    -0x8(%rbp),%rdi
call   1080 <pthread_rwlock_unlock@plt>
cmp    $0x0,%rax
je     12e1 <do_test+0x181>
lea    0xe62(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    1407 <do_test+0x2a7>
lea    0xe63(%rip),%rdi
call   1030 <puts@plt>
lea    -0x8(%rbp),%rdi
call   1040 <pthread_rwlock_wrlock@plt>
cmp    $0x0,%rax
je     1318 <do_test+0x1b8>
lea    0xe60(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    1407 <do_test+0x2a7>
lea    0xe61(%rip),%rdi
call   1030 <puts@plt>
lea    -0x8(%rbp),%rdi
call   1080 <pthread_rwlock_unlock@plt>
cmp    $0x0,%rax
je     134f <do_test+0x1ef>
lea    0xe5e(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    1407 <do_test+0x2a7>
lea    0xe5f(%rip),%rdi
call   1030 <puts@plt>
lea    -0x8(%rbp),%rdi
call   1060 <pthread_rwlock_rdlock@plt>
cmp    $0x0,%rax
je     1386 <do_test+0x226>
lea    0xe5c(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    1407 <do_test+0x2a7>
lea    0xe5d(%rip),%rdi
call   1030 <puts@plt>
lea    -0x8(%rbp),%rdi
call   1080 <pthread_rwlock_unlock@plt>
cmp    $0x0,%rax
je     13bd <do_test+0x25d>
lea    0xe5a(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    1407 <do_test+0x2a7>
lea    0xe5b(%rip),%rdi
call   1030 <puts@plt>
lea    -0x8(%rbp),%rdi
call   1050 <pthread_rwlock_destroy@plt>
cmp    $0x0,%rax
je     13f4 <do_test+0x294>
lea    0xe58(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    1407 <do_test+0x2a7>
lea    0xe56(%rip),%rdi
call   1030 <puts@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_test>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rdi
xor    %esi,%esi
call   1070 <pthread_rwlock_init@plt>
mov    $0x1,%ebx
test   %rax,%rax
je     1187 <do_test+0x27>
lea    0xe7e(%rip),%rdi
jmp    1334 <do_test+0x1d4>
lea    0xe85(%rip),%rdi
call   1030 <puts@plt>
lea    0xc(%rsp),%rdi
call   1060 <pthread_rwlock_rdlock@plt>
test   %rax,%rax
je     11ae <do_test+0x4e>
lea    0xe80(%rip),%rdi
jmp    1334 <do_test+0x1d4>
lea    0xe8d(%rip),%rdi
call   1030 <puts@plt>
lea    0xc(%rsp),%rdi
call   1060 <pthread_rwlock_rdlock@plt>
test   %rax,%rax
je     11d5 <do_test+0x75>
lea    0xe8e(%rip),%rdi
jmp    1334 <do_test+0x1d4>
lea    0xe9b(%rip),%rdi
call   1030 <puts@plt>
lea    0xc(%rsp),%rdi
call   1080 <pthread_rwlock_unlock@plt>
test   %rax,%rax
je     11fc <do_test+0x9c>
lea    0xe9c(%rip),%rdi
jmp    1334 <do_test+0x1d4>
lea    0xea9(%rip),%rdi
call   1030 <puts@plt>
lea    0xc(%rsp),%rdi
call   1080 <pthread_rwlock_unlock@plt>
test   %rax,%rax
je     1223 <do_test+0xc3>
lea    0xeaa(%rip),%rdi
jmp    1334 <do_test+0x1d4>
lea    0xeb7(%rip),%rdi
call   1030 <puts@plt>
lea    0xc(%rsp),%rdi
call   1040 <pthread_rwlock_wrlock@plt>
test   %rax,%rax
je     124a <do_test+0xea>
lea    0xeb8(%rip),%rdi
jmp    1334 <do_test+0x1d4>
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
lea    0xc(%rsp),%rdi
call   1080 <pthread_rwlock_unlock@plt>
test   %rax,%rax
je     1271 <do_test+0x111>
lea    0xec6(%rip),%rdi
jmp    1334 <do_test+0x1d4>
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
lea    0xc(%rsp),%rdi
call   1040 <pthread_rwlock_wrlock@plt>
test   %rax,%rax
je     1298 <do_test+0x138>
lea    0xed4(%rip),%rdi
jmp    1334 <do_test+0x1d4>
lea    0xee1(%rip),%rdi
call   1030 <puts@plt>
lea    0xc(%rsp),%rdi
call   1080 <pthread_rwlock_unlock@plt>
test   %rax,%rax
je     12bc <do_test+0x15c>
lea    0xee2(%rip),%rdi
jmp    1334 <do_test+0x1d4>
lea    0xef2(%rip),%rdi
call   1030 <puts@plt>
lea    0xc(%rsp),%rdi
call   1060 <pthread_rwlock_rdlock@plt>
test   %rax,%rax
je     12e0 <do_test+0x180>
lea    0xef3(%rip),%rdi
jmp    1334 <do_test+0x1d4>
lea    0xf03(%rip),%rdi
call   1030 <puts@plt>
lea    0xc(%rsp),%rdi
call   1080 <pthread_rwlock_unlock@plt>
test   %rax,%rax
je     1304 <do_test+0x1a4>
lea    0xf04(%rip),%rdi
jmp    1334 <do_test+0x1d4>
lea    0xf14(%rip),%rdi
call   1030 <puts@plt>
lea    0xc(%rsp),%rdi
call   1050 <pthread_rwlock_destroy@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
lea    0xf28(%rip),%rax
lea    0xf0b(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"rwlock_init failed\00"
@.str.1 = [22 x i8] c"rwlock_init succeeded\00"
@.str.2 = [25 x i8] c"1st rwlock_rdlock failed\00"
@.str.3 = [28 x i8] c"1st rwlock_rdlock succeeded\00"
@.str.4 = [25 x i8] c"2nd rwlock_rdlock failed\00"
@.str.5 = [28 x i8] c"2nd rwlock_rdlock succeeded\00"
@.str.6 = [25 x i8] c"1st rwlock_unlock failed\00"
@.str.7 = [28 x i8] c"1st rwlock_unlock succeeded\00"
@.str.8 = [25 x i8] c"2nd rwlock_unlock failed\00"
@.str.9 = [28 x i8] c"2nd rwlock_unlock succeeded\00"
@.str.10 = [25 x i8] c"1st rwlock_wrlock failed\00"
@.str.11 = [28 x i8] c"1st rwlock_wrlock succeeded\00"
@.str.12 = [25 x i8] c"3rd rwlock_unlock failed\00"
@.str.13 = [28 x i8] c"3rd rwlock_unlock succeeded\00"
@.str.14 = [25 x i8] c"2nd rwlock_wrlock failed\00"
@.str.15 = [28 x i8] c"2nd rwlock_wrlock succeeded\00"
@.str.16 = [25 x i8] c"4th rwlock_unlock failed\00"
@.str.17 = [28 x i8] c"4th rwlock_unlock succeeded\00"
@.str.18 = [25 x i8] c"3rd rwlock_rdlock failed\00"
@.str.19 = [28 x i8] c"3rd rwlock_rdlock succeeded\00"
@.str.20 = [25 x i8] c"5th rwlock_unlock failed\00"
@.str.21 = [28 x i8] c"5th rwlock_unlock succeeded\00"
@.str.22 = [22 x i8] c"rwlock_destroy failed\00"
@.str.23 = [25 x i8] c"rwlock_destroy succeeded\00"
define i32 @do_test() {
%1 = alloca i32
%2 = alloca i32
%3 = call i64 @pthread_rwlock_init(i32* %2, i32* null)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
br label %75
7: ; preds = %0
%8 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%9 = call i64 @pthread_rwlock_rdlock(i32* %2)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = call i32 @puts(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %1
br label %75
13: ; preds = %7
%14 = call i32 @puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%15 = call i64 @pthread_rwlock_rdlock(i32* %2)
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = call i32 @puts(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %1
br label %75
19: ; preds = %13
%20 = call i32 @puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0))
%21 = call i64 @pthread_rwlock_unlock(i32* %2)
%22 = icmp ne i64 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %19
%24 = call i32 @puts(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0))
store i32 1, i32* %1
br label %75
25: ; preds = %19
%26 = call i32 @puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0))
%27 = call i64 @pthread_rwlock_unlock(i32* %2)
%28 = icmp ne i64 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %25
%30 = call i32 @puts(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0))
store i32 1, i32* %1
br label %75
31: ; preds = %25
%32 = call i32 @puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.9, i64 0, i64 0))
%33 = call i64 @pthread_rwlock_wrlock(i32* %2)
%34 = icmp ne i64 %33, 0
br i1 %34, label %35, label %37
35: ; preds = %31
%36 = call i32 @puts(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.10, i64 0, i64 0))
store i32 1, i32* %1
br label %75
37: ; preds = %31
%38 = call i32 @puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.11, i64 0, i64 0))
%39 = call i64 @pthread_rwlock_unlock(i32* %2)
%40 = icmp ne i64 %39, 0
br i1 %40, label %41, label %43
41: ; preds = %37
%42 = call i32 @puts(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.12, i64 0, i64 0))
store i32 1, i32* %1
br label %75
43: ; preds = %37
%44 = call i32 @puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.13, i64 0, i64 0))
%45 = call i64 @pthread_rwlock_wrlock(i32* %2)
%46 = icmp ne i64 %45, 0
br i1 %46, label %47, label %49
47: ; preds = %43
%48 = call i32 @puts(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.14, i64 0, i64 0))
store i32 1, i32* %1
br label %75
49: ; preds = %43
%50 = call i32 @puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.15, i64 0, i64 0))
%51 = call i64 @pthread_rwlock_unlock(i32* %2)
%52 = icmp ne i64 %51, 0
br i1 %52, label %53, label %55
53: ; preds = %49
%54 = call i32 @puts(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.16, i64 0, i64 0))
store i32 1, i32* %1
br label %75
55: ; preds = %49
%56 = call i32 @puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.17, i64 0, i64 0))
%57 = call i64 @pthread_rwlock_rdlock(i32* %2)
%58 = icmp ne i64 %57, 0
br i1 %58, label %59, label %61
59: ; preds = %55
%60 = call i32 @puts(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.18, i64 0, i64 0))
store i32 1, i32* %1
br label %75
61: ; preds = %55
%62 = call i32 @puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.19, i64 0, i64 0))
%63 = call i64 @pthread_rwlock_unlock(i32* %2)
%64 = icmp ne i64 %63, 0
br i1 %64, label %65, label %67
65: ; preds = %61
%66 = call i32 @puts(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.20, i64 0, i64 0))
store i32 1, i32* %1
br label %75
67: ; preds = %61
%68 = call i32 @puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.21, i64 0, i64 0))
%69 = call i64 @pthread_rwlock_destroy(i32* %2)
%70 = icmp ne i64 %69, 0
br i1 %70, label %71, label %73
71: ; preds = %67
%72 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.22, i64 0, i64 0))
store i32 1, i32* %1
br label %75
73: ; preds = %67
%74 = call i32 @puts(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.23, i64 0, i64 0))
store i32 0, i32* %1
br label %75
75: ; preds = %73, %71, %65, %59, %53, %47, %41, %35, %29, %23, %17, %11, %5
%76 = load i32, i32* %1
ret i32 %76
}

LLVM IR (-O2):
@.str = [19 x i8] c"rwlock_init failed\00"
@.str.1 = [22 x i8] c"rwlock_init succeeded\00"
@.str.2 = [25 x i8] c"1st rwlock_rdlock failed\00"
@.str.3 = [28 x i8] c"1st rwlock_rdlock succeeded\00"
@.str.4 = [25 x i8] c"2nd rwlock_rdlock failed\00"
@.str.5 = [28 x i8] c"2nd rwlock_rdlock succeeded\00"
@.str.6 = [25 x i8] c"1st rwlock_unlock failed\00"
@.str.7 = [28 x i8] c"1st rwlock_unlock succeeded\00"
@.str.8 = [25 x i8] c"2nd rwlock_unlock failed\00"
@.str.9 = [28 x i8] c"2nd rwlock_unlock succeeded\00"
@.str.10 = [25 x i8] c"1st rwlock_wrlock failed\00"
@.str.11 = [28 x i8] c"1st rwlock_wrlock succeeded\00"
@.str.12 = [25 x i8] c"3rd rwlock_unlock failed\00"
@.str.13 = [28 x i8] c"3rd rwlock_unlock succeeded\00"
@.str.14 = [25 x i8] c"2nd rwlock_wrlock failed\00"
@.str.15 = [28 x i8] c"2nd rwlock_wrlock succeeded\00"
@.str.16 = [25 x i8] c"4th rwlock_unlock failed\00"
@.str.17 = [28 x i8] c"4th rwlock_unlock succeeded\00"
@.str.18 = [25 x i8] c"3rd rwlock_rdlock failed\00"
@.str.19 = [28 x i8] c"3rd rwlock_rdlock succeeded\00"
@.str.20 = [25 x i8] c"5th rwlock_unlock failed\00"
@.str.21 = [28 x i8] c"5th rwlock_unlock succeeded\00"
@.str.22 = [22 x i8] c"rwlock_destroy failed\00"
@.str.23 = [25 x i8] c"rwlock_destroy succeeded\00"
define i32 @do_test() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i64 @pthread_rwlock_init(i32* %1, i32* null)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %52
5: ; preds = %0
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%7 = call i64 @pthread_rwlock_rdlock(i32* %1)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %52
9: ; preds = %5
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%11 = call i64 @pthread_rwlock_rdlock(i32* %1)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %52
13: ; preds = %9
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0))
%15 = call i64 @pthread_rwlock_unlock(i32* %1)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %52
17: ; preds = %13
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0))
%19 = call i64 @pthread_rwlock_unlock(i32* %1)
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %52
21: ; preds = %17
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.9, i64 0, i64 0))
%23 = call i64 @pthread_rwlock_wrlock(i32* %1)
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %52
25: ; preds = %21
%26 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.11, i64 0, i64 0))
%27 = call i64 @pthread_rwlock_unlock(i32* %1)
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %52
29: ; preds = %25
%30 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.13, i64 0, i64 0))
%31 = call i64 @pthread_rwlock_wrlock(i32* %1)
%32 = icmp eq i64 %31, 0
br i1 %32, label %33, label %52
33: ; preds = %29
%34 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.15, i64 0, i64 0))
%35 = call i64 @pthread_rwlock_unlock(i32* %1)
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %52
37: ; preds = %33
%38 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.17, i64 0, i64 0))
%39 = call i64 @pthread_rwlock_rdlock(i32* %1)
%40 = icmp eq i64 %39, 0
br i1 %40, label %41, label %52
41: ; preds = %37
%42 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.19, i64 0, i64 0))
%43 = call i64 @pthread_rwlock_unlock(i32* %1)
%44 = icmp eq i64 %43, 0
br i1 %44, label %45, label %52
45: ; preds = %41
%46 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.21, i64 0, i64 0))
%47 = call i64 @pthread_rwlock_destroy(i32* %1)
%48 = icmp eq i64 %47, 0
%49 = select i1 %48, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.23, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.22, i64 0, i64 0)
%50 = xor i1 %48, true
%51 = zext i1 %50 to i32
br label %52
52: ; preds = %45, %41, %37, %33, %29, %25, %21, %17, %13, %9, %5, %0
%53 = phi i8* [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), %0 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), %5 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), %9 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0), %13 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0), %17 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.10, i64 0, i64 0), %21 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.12, i64 0, i64 0), %25 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.14, i64 0, i64 0), %29 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.16, i64 0, i64 0), %33 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.18, i64 0, i64 0), %37 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.20, i64 0, i64 0), %41 ], [ %49, %45 ]
%54 = phi i32 [ 1, %0 ], [ 1, %5 ], [ 1, %9 ], [ 1, %13 ], [ 1, %17 ], [ 1, %21 ], [ 1, %25 ], [ 1, %29 ], [ 1, %33 ], [ 1, %37 ], [ 1, %41 ], [ %51, %45 ]
%55 = call i32 @puts(i8* dereferenceable(1) %53)
ret i32 %54
}