#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_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
int /*<<< orphan*/ *malloc(int);
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 /*<<< orphan*/ stderr;
int main(void) {
  int r;
  pthread_mutex_t *mx1, *mx2;
  assert(sizeof(pthread_mutex_t) <= 120);
  mx1 = malloc(120 + sizeof(pthread_mutex_t) - sizeof(pthread_mutex_t));
  mx2 = malloc(120 + sizeof(pthread_mutex_t) - sizeof(pthread_mutex_t));
  assert(mx1);
  assert(mx2);
  r = pthread_mutex_init(mx1, NULL);
  assert(r == 0);
  r = pthread_mutex_init(mx2, NULL);
  assert(r == 0);
  fprintf(stderr, "Establish order 1 -> 2\n");
  r = pthread_mutex_lock(mx1);
  assert(r == 0);
  r = pthread_mutex_lock(mx2);
  assert(r == 0);
  r = pthread_mutex_unlock(mx1);
  assert(r == 0);
  r = pthread_mutex_unlock(mx2);
  assert(r == 0);
  fprintf(stderr, "Try order 2 -> 1.  This gives an error.\n");
  r = pthread_mutex_lock(mx2);
  assert(r == 0);
  r = pthread_mutex_lock(mx1);
  assert(r == 0);
  r = pthread_mutex_unlock(mx1);
  assert(r == 0);
  r = pthread_mutex_unlock(mx2);
  assert(r == 0);
  fprintf(stderr,
          "Free 2 and re-allocate it.  This gives it a new identity,\n");
  fprintf(stderr, "so a second locking sequence 2 -> 1 should now be OK.\n");
  pthread_mutex_destroy(mx2);
  r = pthread_mutex_init(mx2, NULL);
  assert(r == 0);
  r = pthread_mutex_lock(mx2);
  assert(r == 0);
  r = pthread_mutex_lock(mx1);
  assert(r == 0);
  r = pthread_mutex_unlock(mx1);
  assert(r == 0);
  r = pthread_mutex_unlock(mx2);
  assert(r == 0);
  fprintf(stderr, "done\n");
  r = pthread_mutex_destroy(mx1);
  r = pthread_mutex_destroy(mx2);
  free(mx1);
  free(mx2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1050 <assert@plt>
mov    $0x78,%edi
call   1080 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x78,%edi
call   1080 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%edi
call   1050 <assert@plt>
mov    -0x18(%rbp),%rax
mov    %eax,%edi
call   1050 <assert@plt>
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1090 <pthread_mutex_init@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1090 <pthread_mutex_init@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    0x2dcc(%rip),%rax
mov    (%rax),%edi
lea    0xde3(%rip),%rsi
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   10a0 <pthread_mutex_lock@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x18(%rbp),%rdi
call   10a0 <pthread_mutex_lock@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1070 <pthread_mutex_unlock@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x18(%rbp),%rdi
call   1070 <pthread_mutex_unlock@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    0x2d43(%rip),%rax
mov    (%rax),%edi
lea    0xd72(%rip),%rsi
call   1060 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   10a0 <pthread_mutex_lock@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x10(%rbp),%rdi
call   10a0 <pthread_mutex_lock@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1070 <pthread_mutex_unlock@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x18(%rbp),%rdi
call   1070 <pthread_mutex_unlock@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    0x2cba(%rip),%rax
mov    (%rax),%edi
lea    0xd12(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2ca5(%rip),%rax
mov    (%rax),%edi
lea    0xd38(%rip),%rsi
call   1060 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1040 <pthread_mutex_destroy@plt>
mov    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1090 <pthread_mutex_init@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x18(%rbp),%rdi
call   10a0 <pthread_mutex_lock@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x10(%rbp),%rdi
call   10a0 <pthread_mutex_lock@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1070 <pthread_mutex_unlock@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x18(%rbp),%rdi
call   1070 <pthread_mutex_unlock@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    0x2bf2(%rip),%rax
mov    (%rax),%edi
lea    0xcbc(%rip),%rsi
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <pthread_mutex_destroy@plt>
mov    %eax,-0x8(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <pthread_mutex_destroy@plt>
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0x1,%edi
call   1050 <assert@plt>
mov    $0x78,%edi
call   1080 <malloc@plt>
mov    %rax,%r14
mov    $0x78,%edi
call   1080 <malloc@plt>
mov    %rax,%rbx
mov    %r14d,%edi
call   1050 <assert@plt>
mov    %ebx,%edi
call   1050 <assert@plt>
mov    %r14,%rdi
xor    %esi,%esi
call   1090 <pthread_mutex_init@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1090 <pthread_mutex_init@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
mov    0x2df3(%rip),%r15
mov    (%r15),%edi
lea    0xe09(%rip),%rsi
call   1060 <fprintf@plt>
mov    %r14,%rdi
call   10a0 <pthread_mutex_lock@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
call   10a0 <pthread_mutex_lock@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
mov    %r14,%rdi
call   1070 <pthread_mutex_unlock@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
call   1070 <pthread_mutex_unlock@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
mov    (%r15),%edi
lea    0xdbe(%rip),%rsi
call   1060 <fprintf@plt>
mov    %rbx,%rdi
call   10a0 <pthread_mutex_lock@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
mov    %r14,%rdi
call   10a0 <pthread_mutex_lock@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
mov    %r14,%rdi
call   1070 <pthread_mutex_unlock@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
call   1070 <pthread_mutex_unlock@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
mov    (%r15),%edi
lea    0xd84(%rip),%rsi
call   1060 <fprintf@plt>
mov    (%r15),%edi
lea    0xdb0(%rip),%rsi
call   1060 <fprintf@plt>
mov    %rbx,%rdi
call   1040 <pthread_mutex_destroy@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1090 <pthread_mutex_init@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
call   10a0 <pthread_mutex_lock@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
mov    %r14,%rdi
call   10a0 <pthread_mutex_lock@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
mov    %r14,%rdi
call   1070 <pthread_mutex_unlock@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
call   1070 <pthread_mutex_unlock@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
mov    (%r15),%edi
lea    0xd65(%rip),%rsi
call   1060 <fprintf@plt>
mov    %r14,%rdi
call   1040 <pthread_mutex_destroy@plt>
mov    %rbx,%rdi
call   1040 <pthread_mutex_destroy@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Establish order 1 -> 2\0A\00"
@.str.1 = [41 x i8] c"Try order 2 -> 1. This gives an error.\0A\00"
@.str.2 = [59 x i8] c"Free 2 and re-allocate it. This gives it a new identity,\0A\00"
@.str.3 = [55 x i8] c"so a second locking sequence 2 -> 1 should now be OK.\0A\00"
@.str.4 = [6 x i8] c"done\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32*
store i32 0, i32* %1
%5 = call i32 @assert(i32 1)
%6 = call i32* @malloc(i32 120)
store i32* %6, i32** %3
%7 = call i32* @malloc(i32 120)
store i32* %7, i32** %4
%8 = load i32*, i32** %3
%9 = ptrtoint i32* %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i32*, i32** %4
%12 = ptrtoint i32* %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i32*, i32** %3
%15 = call i32 @pthread_mutex_init(i32* %14, i32* null)
store i32 %15, i32* %2
%16 = load i32, i32* %2
%17 = icmp eq i32 %16, 0
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
%20 = load i32*, i32** %4
%21 = call i32 @pthread_mutex_init(i32* %20, i32* null)
store i32 %21, i32* %2
%22 = load i32, i32* %2
%23 = icmp eq i32 %22, 0
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
%26 = load i32, i32* @stderr
%27 = call i32 @fprintf(i32 %26, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%28 = load i32*, i32** %3
%29 = call i32 @pthread_mutex_lock(i32* %28)
store i32 %29, i32* %2
%30 = load i32, i32* %2
%31 = icmp eq i32 %30, 0
%32 = zext i1 %31 to i32
%33 = call i32 @assert(i32 %32)
%34 = load i32*, i32** %4
%35 = call i32 @pthread_mutex_lock(i32* %34)
store i32 %35, i32* %2
%36 = load i32, i32* %2
%37 = icmp eq i32 %36, 0
%38 = zext i1 %37 to i32
%39 = call i32 @assert(i32 %38)
%40 = load i32*, i32** %3
%41 = call i32 @pthread_mutex_unlock(i32* %40)
store i32 %41, i32* %2
%42 = load i32, i32* %2
%43 = icmp eq i32 %42, 0
%44 = zext i1 %43 to i32
%45 = call i32 @assert(i32 %44)
%46 = load i32*, i32** %4
%47 = call i32 @pthread_mutex_unlock(i32* %46)
store i32 %47, i32* %2
%48 = load i32, i32* %2
%49 = icmp eq i32 %48, 0
%50 = zext i1 %49 to i32
%51 = call i32 @assert(i32 %50)
%52 = load i32, i32* @stderr
%53 = call i32 @fprintf(i32 %52, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%54 = load i32*, i32** %4
%55 = call i32 @pthread_mutex_lock(i32* %54)
store i32 %55, i32* %2
%56 = load i32, i32* %2
%57 = icmp eq i32 %56, 0
%58 = zext i1 %57 to i32
%59 = call i32 @assert(i32 %58)
%60 = load i32*, i32** %3
%61 = call i32 @pthread_mutex_lock(i32* %60)
store i32 %61, i32* %2
%62 = load i32, i32* %2
%63 = icmp eq i32 %62, 0
%64 = zext i1 %63 to i32
%65 = call i32 @assert(i32 %64)
%66 = load i32*, i32** %3
%67 = call i32 @pthread_mutex_unlock(i32* %66)
store i32 %67, i32* %2
%68 = load i32, i32* %2
%69 = icmp eq i32 %68, 0
%70 = zext i1 %69 to i32
%71 = call i32 @assert(i32 %70)
%72 = load i32*, i32** %4
%73 = call i32 @pthread_mutex_unlock(i32* %72)
store i32 %73, i32* %2
%74 = load i32, i32* %2
%75 = icmp eq i32 %74, 0
%76 = zext i1 %75 to i32
%77 = call i32 @assert(i32 %76)
%78 = load i32, i32* @stderr
%79 = call i32 @fprintf(i32 %78, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.2, i64 0, i64 0))
%80 = load i32, i32* @stderr
%81 = call i32 @fprintf(i32 %80, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.3, i64 0, i64 0))
%82 = load i32*, i32** %4
%83 = call i32 @pthread_mutex_destroy(i32* %82)
%84 = load i32*, i32** %4
%85 = call i32 @pthread_mutex_init(i32* %84, i32* null)
store i32 %85, i32* %2
%86 = load i32, i32* %2
%87 = icmp eq i32 %86, 0
%88 = zext i1 %87 to i32
%89 = call i32 @assert(i32 %88)
%90 = load i32*, i32** %4
%91 = call i32 @pthread_mutex_lock(i32* %90)
store i32 %91, i32* %2
%92 = load i32, i32* %2
%93 = icmp eq i32 %92, 0
%94 = zext i1 %93 to i32
%95 = call i32 @assert(i32 %94)
%96 = load i32*, i32** %3
%97 = call i32 @pthread_mutex_lock(i32* %96)
store i32 %97, i32* %2
%98 = load i32, i32* %2
%99 = icmp eq i32 %98, 0
%100 = zext i1 %99 to i32
%101 = call i32 @assert(i32 %100)
%102 = load i32*, i32** %3
%103 = call i32 @pthread_mutex_unlock(i32* %102)
store i32 %103, i32* %2
%104 = load i32, i32* %2
%105 = icmp eq i32 %104, 0
%106 = zext i1 %105 to i32
%107 = call i32 @assert(i32 %106)
%108 = load i32*, i32** %4
%109 = call i32 @pthread_mutex_unlock(i32* %108)
store i32 %109, i32* %2
%110 = load i32, i32* %2
%111 = icmp eq i32 %110, 0
%112 = zext i1 %111 to i32
%113 = call i32 @assert(i32 %112)
%114 = load i32, i32* @stderr
%115 = call i32 @fprintf(i32 %114, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%116 = load i32*, i32** %3
%117 = call i32 @pthread_mutex_destroy(i32* %116)
store i32 %117, i32* %2
%118 = load i32*, i32** %4
%119 = call i32 @pthread_mutex_destroy(i32* %118)
store i32 %119, i32* %2
%120 = load i32*, i32** %3
%121 = call i32 @free(i32* %120)
%122 = load i32*, i32** %4
%123 = call i32 @free(i32* %122)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Establish order 1 -> 2\0A\00"
@.str.1 = [41 x i8] c"Try order 2 -> 1. This gives an error.\0A\00"
@.str.2 = [59 x i8] c"Free 2 and re-allocate it. This gives it a new identity,\0A\00"
@.str.3 = [55 x i8] c"so a second locking sequence 2 -> 1 should now be OK.\0A\00"
@.str.4 = [6 x i8] c"done\0A\00"
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32* @malloc(i32 120)
%3 = tail call i32* @malloc(i32 120)
%4 = ptrtoint i32* %2 to i64
%5 = trunc i64 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = ptrtoint i32* %3 to i64
%8 = trunc i64 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = tail call i32 @pthread_mutex_init(i32* %2, i32* null)
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
%13 = tail call i32 @assert(i32 %12)
%14 = tail call i32 @pthread_mutex_init(i32* %3, i32* null)
%15 = icmp eq i32 %14, 0
%16 = zext i1 %15 to i32
%17 = tail call i32 @assert(i32 %16)
%18 = load i32, i32* @stderr
%19 = tail call i32 @fprintf(i32 %18, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%20 = tail call i32 @pthread_mutex_lock(i32* %2)
%21 = icmp eq i32 %20, 0
%22 = zext i1 %21 to i32
%23 = tail call i32 @assert(i32 %22)
%24 = tail call i32 @pthread_mutex_lock(i32* %3)
%25 = icmp eq i32 %24, 0
%26 = zext i1 %25 to i32
%27 = tail call i32 @assert(i32 %26)
%28 = tail call i32 @pthread_mutex_unlock(i32* %2)
%29 = icmp eq i32 %28, 0
%30 = zext i1 %29 to i32
%31 = tail call i32 @assert(i32 %30)
%32 = tail call i32 @pthread_mutex_unlock(i32* %3)
%33 = icmp eq i32 %32, 0
%34 = zext i1 %33 to i32
%35 = tail call i32 @assert(i32 %34)
%36 = load i32, i32* @stderr
%37 = tail call i32 @fprintf(i32 %36, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%38 = tail call i32 @pthread_mutex_lock(i32* %3)
%39 = icmp eq i32 %38, 0
%40 = zext i1 %39 to i32
%41 = tail call i32 @assert(i32 %40)
%42 = tail call i32 @pthread_mutex_lock(i32* %2)
%43 = icmp eq i32 %42, 0
%44 = zext i1 %43 to i32
%45 = tail call i32 @assert(i32 %44)
%46 = tail call i32 @pthread_mutex_unlock(i32* %2)
%47 = icmp eq i32 %46, 0
%48 = zext i1 %47 to i32
%49 = tail call i32 @assert(i32 %48)
%50 = tail call i32 @pthread_mutex_unlock(i32* %3)
%51 = icmp eq i32 %50, 0
%52 = zext i1 %51 to i32
%53 = tail call i32 @assert(i32 %52)
%54 = load i32, i32* @stderr
%55 = tail call i32 @fprintf(i32 %54, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.2, i64 0, i64 0))
%56 = load i32, i32* @stderr
%57 = tail call i32 @fprintf(i32 %56, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.3, i64 0, i64 0))
%58 = tail call i32 @pthread_mutex_destroy(i32* %3)
%59 = tail call i32 @pthread_mutex_init(i32* %3, i32* null)
%60 = icmp eq i32 %59, 0
%61 = zext i1 %60 to i32
%62 = tail call i32 @assert(i32 %61)
%63 = tail call i32 @pthread_mutex_lock(i32* %3)
%64 = icmp eq i32 %63, 0
%65 = zext i1 %64 to i32
%66 = tail call i32 @assert(i32 %65)
%67 = tail call i32 @pthread_mutex_lock(i32* %2)
%68 = icmp eq i32 %67, 0
%69 = zext i1 %68 to i32
%70 = tail call i32 @assert(i32 %69)
%71 = tail call i32 @pthread_mutex_unlock(i32* %2)
%72 = icmp eq i32 %71, 0
%73 = zext i1 %72 to i32
%74 = tail call i32 @assert(i32 %73)
%75 = tail call i32 @pthread_mutex_unlock(i32* %3)
%76 = icmp eq i32 %75, 0
%77 = zext i1 %76 to i32
%78 = tail call i32 @assert(i32 %77)
%79 = load i32, i32* @stderr
%80 = tail call i32 @fprintf(i32 %79, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%81 = tail call i32 @pthread_mutex_destroy(i32* %2)
%82 = tail call i32 @pthread_mutex_destroy(i32* %3)
%83 = tail call i32 @free(i32* %2)
%84 = tail call i32 @free(i32* %3)
ret i32 0
}