#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_mutexattr_t;
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int PTHREAD_MUTEX_RECURSIVE;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char *);
int pthread_mutex_destroy(int /*<<< orphan*/ *);
int pthread_mutex_init(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int pthread_mutex_lock(int /*<<< orphan*/ *);
int pthread_mutex_unlock(int /*<<< orphan*/ *);
int pthread_mutexattr_destroy(int /*<<< orphan*/ *);
int pthread_mutexattr_init(int /*<<< orphan*/ *);
int pthread_mutexattr_settype(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ stderr;
int test_recursive_mutex(void) {
  pthread_mutexattr_t attr;
  pthread_mutex_t mutex;
  int ty = PTHREAD_MUTEX_RECURSIVE;
  do {
    int __my_ret__ = pthread_mutexattr_init(&attr);
    if (__my_ret__) {
      fprintf(stderr, "failed on line %d: %s\n", 109,
              "pthread_mutexattr_init(&attr)");
      return __my_ret__;
    }
  } while (0);
  ;
  do {
    int __my_ret__ = pthread_mutexattr_settype(&attr, ty);
    if (__my_ret__) {
      fprintf(stderr, "failed on line %d: %s\n", 110,
              "pthread_mutexattr_settype(&attr, ty)");
      return __my_ret__;
    }
  } while (0);
  ;
  do {
    int __my_ret__ = pthread_mutex_init(&mutex, &attr);
    if (__my_ret__) {
      fprintf(stderr, "failed on line %d: %s\n", 111,
              "pthread_mutex_init(&mutex, &attr)");
      return __my_ret__;
    }
  } while (0);
  ;
  do {
    int __my_ret__ = pthread_mutex_lock(&mutex);
    if (__my_ret__) {
      fprintf(stderr, "failed on line %d: %s\n", 112,
              "pthread_mutex_lock(&mutex)");
      return __my_ret__;
    }
  } while (0);
  ;
  do {
    int __my_ret__ = pthread_mutex_lock(&mutex);
    if (__my_ret__) {
      fprintf(stderr, "failed on line %d: %s\n", 113,
              "pthread_mutex_lock(&mutex)");
      return __my_ret__;
    }
  } while (0);
  ;
  do {
    int __my_ret__ = pthread_mutex_unlock(&mutex);
    if (__my_ret__) {
      fprintf(stderr, "failed on line %d: %s\n", 114,
              "pthread_mutex_unlock(&mutex)");
      return __my_ret__;
    }
  } while (0);
  ;
  do {
    int __my_ret__ = pthread_mutex_unlock(&mutex);
    if (__my_ret__) {
      fprintf(stderr, "failed on line %d: %s\n", 115,
              "pthread_mutex_unlock(&mutex)");
      return __my_ret__;
    }
  } while (0);
  ;
  do {
    int __my_ret__ = pthread_mutexattr_destroy(&attr);
    if (__my_ret__) {
      fprintf(stderr, "failed on line %d: %s\n", 116,
              "pthread_mutexattr_destroy(&attr)");
      return __my_ret__;
    }
  } while (0);
  ;
  do {
    int __my_ret__ = pthread_mutex_destroy(&mutex);
    if (__my_ret__) {
      fprintf(stderr, "failed on line %d: %s\n", 117,
              "pthread_mutex_destroy(&mutex)");
      return __my_ret__;
    }
  } while (0);
  ;
  return 0;
}


x86 assembly (clang, -O0):
<test_recursive_mutex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x2e69(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
lea    -0x8(%rbp),%rdi
call   1070 <pthread_mutexattr_init@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     11d6 <test_recursive_mutex+0x56>
mov    0x2e27(%rip),%rax
mov    (%rax),%edi
lea    0xe46(%rip),%rsi
mov    $0x6d,%edx
lea    0xe51(%rip),%rcx
call   1050 <fprintf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1449 <test_recursive_mutex+0x2c9>
jmp    11db <test_recursive_mutex+0x5b>
jmp    11e0 <test_recursive_mutex+0x60>
mov    -0x10(%rbp),%esi
lea    -0x8(%rbp),%rdi
call   1040 <pthread_mutexattr_settype@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     1225 <test_recursive_mutex+0xa5>
mov    0x2dd8(%rip),%rax
mov    (%rax),%edi
lea    0xdf7(%rip),%rsi
mov    $0x6e,%edx
lea    0xe20(%rip),%rcx
call   1050 <fprintf@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1449 <test_recursive_mutex+0x2c9>
jmp    122a <test_recursive_mutex+0xaa>
jmp    122f <test_recursive_mutex+0xaf>
lea    -0xc(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1080 <pthread_mutex_init@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1275 <test_recursive_mutex+0xf5>
mov    0x2d88(%rip),%rax
mov    (%rax),%edi
lea    0xda7(%rip),%rsi
mov    $0x6f,%edx
lea    0xdf5(%rip),%rcx
call   1050 <fprintf@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1449 <test_recursive_mutex+0x2c9>
jmp    127a <test_recursive_mutex+0xfa>
jmp    127f <test_recursive_mutex+0xff>
lea    -0xc(%rbp),%rdi
call   10a0 <pthread_mutex_lock@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     12c1 <test_recursive_mutex+0x141>
mov    0x2d3c(%rip),%rax
mov    (%rax),%edi
lea    0xd5b(%rip),%rsi
mov    $0x70,%edx
lea    0xdcb(%rip),%rcx
call   1050 <fprintf@plt>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1449 <test_recursive_mutex+0x2c9>
jmp    12c6 <test_recursive_mutex+0x146>
jmp    12cb <test_recursive_mutex+0x14b>
lea    -0xc(%rbp),%rdi
call   10a0 <pthread_mutex_lock@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     130d <test_recursive_mutex+0x18d>
mov    0x2cf0(%rip),%rax
mov    (%rax),%edi
lea    0xd0f(%rip),%rsi
mov    $0x71,%edx
lea    0xd7f(%rip),%rcx
call   1050 <fprintf@plt>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1449 <test_recursive_mutex+0x2c9>
jmp    1312 <test_recursive_mutex+0x192>
jmp    1317 <test_recursive_mutex+0x197>
lea    -0xc(%rbp),%rdi
call   1060 <pthread_mutex_unlock@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
je     1359 <test_recursive_mutex+0x1d9>
mov    0x2ca4(%rip),%rax
mov    (%rax),%edi
lea    0xcc3(%rip),%rsi
mov    $0x72,%edx
lea    0xd4e(%rip),%rcx
call   1050 <fprintf@plt>
mov    -0x28(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1449 <test_recursive_mutex+0x2c9>
jmp    135e <test_recursive_mutex+0x1de>
jmp    1363 <test_recursive_mutex+0x1e3>
lea    -0xc(%rbp),%rdi
call   1060 <pthread_mutex_unlock@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
je     13a5 <test_recursive_mutex+0x225>
mov    0x2c58(%rip),%rax
mov    (%rax),%edi
lea    0xc77(%rip),%rsi
mov    $0x73,%edx
lea    0xd02(%rip),%rcx
call   1050 <fprintf@plt>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1449 <test_recursive_mutex+0x2c9>
jmp    13aa <test_recursive_mutex+0x22a>
jmp    13af <test_recursive_mutex+0x22f>
lea    -0x8(%rbp),%rdi
call   1090 <pthread_mutexattr_destroy@plt>
mov    %eax,-0x30(%rbp)
cmpl   $0x0,-0x30(%rbp)
je     13f1 <test_recursive_mutex+0x271>
mov    0x2c0c(%rip),%rax
mov    (%rax),%edi
lea    0xc2b(%rip),%rsi
mov    $0x74,%edx
lea    0xcd3(%rip),%rcx
call   1050 <fprintf@plt>
mov    -0x30(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1449 <test_recursive_mutex+0x2c9>
jmp    13f6 <test_recursive_mutex+0x276>
jmp    13fb <test_recursive_mutex+0x27b>
lea    -0xc(%rbp),%rdi
call   1030 <pthread_mutex_destroy@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
je     143d <test_recursive_mutex+0x2bd>
mov    0x2bc0(%rip),%rax
mov    (%rax),%edi
lea    0xbdf(%rip),%rsi
mov    $0x75,%edx
lea    0xca8(%rip),%rcx
call   1050 <fprintf@plt>
mov    -0x34(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1449 <test_recursive_mutex+0x2c9>
jmp    1442 <test_recursive_mutex+0x2c2>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_recursive_mutex>:
push   %rbp
push   %rbx
push   %rax
mov    0x2e6e(%rip),%rax
mov    (%rax),%ebp
lea    0x4(%rsp),%rdi
call   1070 <pthread_mutexattr_init@plt>
test   %eax,%eax
je     11bd <test_recursive_mutex+0x3d>
mov    %eax,%ebx
mov    0x2e35(%rip),%rax
mov    (%rax),%edi
lea    0xe54(%rip),%rsi
lea    0xe64(%rip),%rcx
mov    $0x6d,%edx
jmp    1335 <test_recursive_mutex+0x1b5>
lea    0x4(%rsp),%rdi
mov    %ebp,%esi
call   1040 <pthread_mutexattr_settype@plt>
test   %eax,%eax
je     11f0 <test_recursive_mutex+0x70>
mov    %eax,%ebx
mov    0x2e02(%rip),%rax
mov    (%rax),%edi
lea    0xe21(%rip),%rsi
lea    0xe4f(%rip),%rcx
mov    $0x6e,%edx
jmp    1335 <test_recursive_mutex+0x1b5>
mov    %rsp,%rdi
lea    0x4(%rsp),%rsi
call   1080 <pthread_mutex_init@plt>
test   %eax,%eax
je     1224 <test_recursive_mutex+0xa4>
mov    %eax,%ebx
mov    0x2dce(%rip),%rax
mov    (%rax),%edi
lea    0xded(%rip),%rsi
lea    0xe40(%rip),%rcx
mov    $0x6f,%edx
jmp    1335 <test_recursive_mutex+0x1b5>
mov    %rsp,%rdi
call   10a0 <pthread_mutex_lock@plt>
test   %eax,%eax
je     1253 <test_recursive_mutex+0xd3>
mov    %eax,%ebx
mov    0x2d9f(%rip),%rax
mov    (%rax),%edi
lea    0xdbe(%rip),%rsi
lea    0xe33(%rip),%rcx
mov    $0x70,%edx
jmp    1335 <test_recursive_mutex+0x1b5>
mov    %rsp,%rdi
call   10a0 <pthread_mutex_lock@plt>
test   %eax,%eax
je     1282 <test_recursive_mutex+0x102>
mov    %eax,%ebx
mov    0x2d70(%rip),%rax
mov    (%rax),%edi
lea    0xd8f(%rip),%rsi
lea    0xe04(%rip),%rcx
mov    $0x71,%edx
jmp    1335 <test_recursive_mutex+0x1b5>
mov    %rsp,%rdi
call   1060 <pthread_mutex_unlock@plt>
test   %eax,%eax
je     12b1 <test_recursive_mutex+0x131>
mov    %eax,%ebx
mov    0x2d41(%rip),%rax
mov    (%rax),%edi
lea    0xd60(%rip),%rsi
lea    0xdf0(%rip),%rcx
mov    $0x72,%edx
jmp    1335 <test_recursive_mutex+0x1b5>
mov    %rsp,%rdi
call   1060 <pthread_mutex_unlock@plt>
test   %eax,%eax
je     12dd <test_recursive_mutex+0x15d>
mov    %eax,%ebx
mov    0x2d12(%rip),%rax
mov    (%rax),%edi
lea    0xd31(%rip),%rsi
lea    0xdc1(%rip),%rcx
mov    $0x73,%edx
jmp    1335 <test_recursive_mutex+0x1b5>
lea    0x4(%rsp),%rdi
call   1090 <pthread_mutexattr_destroy@plt>
test   %eax,%eax
je     130b <test_recursive_mutex+0x18b>
mov    %eax,%ebx
mov    0x2ce4(%rip),%rax
mov    (%rax),%edi
lea    0xd03(%rip),%rsi
lea    0xdb0(%rip),%rcx
mov    $0x74,%edx
jmp    1335 <test_recursive_mutex+0x1b5>
mov    %rsp,%rdi
call   1030 <pthread_mutex_destroy@plt>
test   %eax,%eax
je     1343 <test_recursive_mutex+0x1c3>
mov    %eax,%ebx
mov    0x2cb8(%rip),%rax
mov    (%rax),%edi
lea    0xcd7(%rip),%rsi
lea    0xda5(%rip),%rcx
mov    $0x75,%edx
call   1050 <fprintf@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
xor    %ebx,%ebx
jmp    133a <test_recursive_mutex+0x1ba>

LLVM IR (-O0):
@PTHREAD_MUTEX_RECURSIVE = global i32 0
@stderr = global i32 0
@.str = [23 x i8] c"failed on line %d: %s\0A\00"
@.str.1 = [30 x i8] c"pthread_mutexattr_init(&attr)\00"
@.str.2 = [37 x i8] c"pthread_mutexattr_settype(&attr, ty)\00"
@.str.3 = [34 x i8] c"pthread_mutex_init(&mutex, &attr)\00"
@.str.4 = [27 x i8] c"pthread_mutex_lock(&mutex)\00"
@.str.5 = [29 x i8] c"pthread_mutex_unlock(&mutex)\00"
@.str.6 = [33 x i8] c"pthread_mutexattr_destroy(&attr)\00"
@.str.7 = [30 x i8] c"pthread_mutex_destroy(&mutex)\00"
define i32 @test_recursive_mutex() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = load i32, i32* @PTHREAD_MUTEX_RECURSIVE
store i32 %14, i32* %4
br label %15
15: ; preds = %0
%16 = call i32 @pthread_mutexattr_init(i32* %2)
store i32 %16, i32* %5
%17 = load i32, i32* %5
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %23
19: ; preds = %15
%20 = load i32, i32* @stderr
%21 = call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 109, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%22 = load i32, i32* %5
store i32 %22, i32* %1
br label %106
23: ; preds = %15
br label %24
24: ; preds = %23
br label %25
25: ; preds = %24
%26 = load i32, i32* %4
%27 = call i32 @pthread_mutexattr_settype(i32* %2, i32 %26)
store i32 %27, i32* %6
%28 = load i32, i32* %6
%29 = icmp ne i32 %28, 0
br i1 %29, label %30, label %34
30: ; preds = %25
%31 = load i32, i32* @stderr
%32 = call i32 @fprintf(i32 %31, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 110, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
%33 = load i32, i32* %6
store i32 %33, i32* %1
br label %106
34: ; preds = %25
br label %35
35: ; preds = %34
br label %36
36: ; preds = %35
%37 = call i32 @pthread_mutex_init(i32* %3, i32* %2)
store i32 %37, i32* %7
%38 = load i32, i32* %7
%39 = icmp ne i32 %38, 0
br i1 %39, label %40, label %44
40: ; preds = %36
%41 = load i32, i32* @stderr
%42 = call i32 @fprintf(i32 %41, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 111, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
%43 = load i32, i32* %7
store i32 %43, i32* %1
br label %106
44: ; preds = %36
br label %45
45: ; preds = %44
br label %46
46: ; preds = %45
%47 = call i32 @pthread_mutex_lock(i32* %3)
store i32 %47, i32* %8
%48 = load i32, i32* %8
%49 = icmp ne i32 %48, 0
br i1 %49, label %50, label %54
50: ; preds = %46
%51 = load i32, i32* @stderr
%52 = call i32 @fprintf(i32 %51, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 112, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
%53 = load i32, i32* %8
store i32 %53, i32* %1
br label %106
54: ; preds = %46
br label %55
55: ; preds = %54
br label %56
56: ; preds = %55
%57 = call i32 @pthread_mutex_lock(i32* %3)
store i32 %57, i32* %9
%58 = load i32, i32* %9
%59 = icmp ne i32 %58, 0
br i1 %59, label %60, label %64
60: ; preds = %56
%61 = load i32, i32* @stderr
%62 = call i32 @fprintf(i32 %61, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 113, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
%63 = load i32, i32* %9
store i32 %63, i32* %1
br label %106
64: ; preds = %56
br label %65
65: ; preds = %64
br label %66
66: ; preds = %65
%67 = call i32 @pthread_mutex_unlock(i32* %3)
store i32 %67, i32* %10
%68 = load i32, i32* %10
%69 = icmp ne i32 %68, 0
br i1 %69, label %70, label %74
70: ; preds = %66
%71 = load i32, i32* @stderr
%72 = call i32 @fprintf(i32 %71, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 114, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0))
%73 = load i32, i32* %10
store i32 %73, i32* %1
br label %106
74: ; preds = %66
br label %75
75: ; preds = %74
br label %76
76: ; preds = %75
%77 = call i32 @pthread_mutex_unlock(i32* %3)
store i32 %77, i32* %11
%78 = load i32, i32* %11
%79 = icmp ne i32 %78, 0
br i1 %79, label %80, label %84
80: ; preds = %76
%81 = load i32, i32* @stderr
%82 = call i32 @fprintf(i32 %81, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 115, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0))
%83 = load i32, i32* %11
store i32 %83, i32* %1
br label %106
84: ; preds = %76
br label %85
85: ; preds = %84
br label %86
86: ; preds = %85
%87 = call i32 @pthread_mutexattr_destroy(i32* %2)
store i32 %87, i32* %12
%88 = load i32, i32* %12
%89 = icmp ne i32 %88, 0
br i1 %89, label %90, label %94
90: ; preds = %86
%91 = load i32, i32* @stderr
%92 = call i32 @fprintf(i32 %91, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 116, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0))
%93 = load i32, i32* %12
store i32 %93, i32* %1
br label %106
94: ; preds = %86
br label %95
95: ; preds = %94
br label %96
96: ; preds = %95
%97 = call i32 @pthread_mutex_destroy(i32* %3)
store i32 %97, i32* %13
%98 = load i32, i32* %13
%99 = icmp ne i32 %98, 0
br i1 %99, label %100, label %104
100: ; preds = %96
%101 = load i32, i32* @stderr
%102 = call i32 @fprintf(i32 %101, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 117, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0))
%103 = load i32, i32* %13
store i32 %103, i32* %1
br label %106
104: ; preds = %96
br label %105
105: ; preds = %104
store i32 0, i32* %1
br label %106
106: ; preds = %105, %100, %90, %80, %70, %60, %50, %40, %30, %19
%107 = load i32, i32* %1
ret i32 %107
}

LLVM IR (-O2):
@PTHREAD_MUTEX_RECURSIVE = global i32 0
@stderr = global i32 0
@.str = [23 x i8] c"failed on line %d: %s\0A\00"
@.str.1 = [30 x i8] c"pthread_mutexattr_init(&attr)\00"
@.str.2 = [37 x i8] c"pthread_mutexattr_settype(&attr, ty)\00"
@.str.3 = [34 x i8] c"pthread_mutex_init(&mutex, &attr)\00"
@.str.4 = [27 x i8] c"pthread_mutex_lock(&mutex)\00"
@.str.5 = [29 x i8] c"pthread_mutex_unlock(&mutex)\00"
@.str.6 = [33 x i8] c"pthread_mutexattr_destroy(&attr)\00"
@.str.7 = [30 x i8] c"pthread_mutex_destroy(&mutex)\00"
define i32 @test_recursive_mutex() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = load i32, i32* @PTHREAD_MUTEX_RECURSIVE
%6 = call i32 @pthread_mutexattr_init(i32* %1)
%7 = icmp eq i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %0
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 109, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
br label %59
11: ; preds = %0
%12 = call i32 @pthread_mutexattr_settype(i32* %1, i32 %5)
%13 = icmp eq i32 %12, 0
br i1 %13, label %17, label %14
14: ; preds = %11
%15 = load i32, i32* @stderr
%16 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 110, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
br label %59
17: ; preds = %11
%18 = call i32 @pthread_mutex_init(i32* %2, i32* %1)
%19 = icmp eq i32 %18, 0
br i1 %19, label %23, label %20
20: ; preds = %17
%21 = load i32, i32* @stderr
%22 = call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 111, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
br label %59
23: ; preds = %17
%24 = call i32 @pthread_mutex_lock(i32* %2)
%25 = icmp eq i32 %24, 0
br i1 %25, label %29, label %26
26: ; preds = %23
%27 = load i32, i32* @stderr
%28 = call i32 @fprintf(i32 %27, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 112, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
br label %59
29: ; preds = %23
%30 = call i32 @pthread_mutex_lock(i32* %2)
%31 = icmp eq i32 %30, 0
br i1 %31, label %35, label %32
32: ; preds = %29
%33 = load i32, i32* @stderr
%34 = call i32 @fprintf(i32 %33, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 113, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
br label %59
35: ; preds = %29
%36 = call i32 @pthread_mutex_unlock(i32* %2)
%37 = icmp eq i32 %36, 0
br i1 %37, label %41, label %38
38: ; preds = %35
%39 = load i32, i32* @stderr
%40 = call i32 @fprintf(i32 %39, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 114, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0))
br label %59
41: ; preds = %35
%42 = call i32 @pthread_mutex_unlock(i32* %2)
%43 = icmp eq i32 %42, 0
br i1 %43, label %47, label %44
44: ; preds = %41
%45 = load i32, i32* @stderr
%46 = call i32 @fprintf(i32 %45, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 115, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0))
br label %59
47: ; preds = %41
%48 = call i32 @pthread_mutexattr_destroy(i32* %1)
%49 = icmp eq i32 %48, 0
br i1 %49, label %53, label %50
50: ; preds = %47
%51 = load i32, i32* @stderr
%52 = call i32 @fprintf(i32 %51, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 116, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0))
br label %59
53: ; preds = %47
%54 = call i32 @pthread_mutex_destroy(i32* %2)
%55 = icmp eq i32 %54, 0
br i1 %55, label %59, label %56
56: ; preds = %53
%57 = load i32, i32* @stderr
%58 = call i32 @fprintf(i32 %57, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 117, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0))
br label %59
59: ; preds = %56, %53, %50, %44, %38, %32, %26, %20, %14, %8
%60 = phi i32 [ %48, %50 ], [ %42, %44 ], [ %36, %38 ], [ %30, %32 ], [ %24, %26 ], [ %18, %20 ], [ %12, %14 ], [ %6, %8 ], [ 0, %53 ], [ %54, %56 ]
ret i32 %60
}