// File: /workspace/github_c_makefile_star2_O0/dpw[P]skinny-mutex/test.c
// Function: do_test_cond_wait
static void do_test_cond_wait(void (*f)(skinny_mutex_t *m))
{
	struct do_test_cond dt;
	pthread_t thread;

	assert(!skinny_mutex_init(&dt.mutex));
	assert(!pthread_cond_init(&dt.cond, NULL));
	dt.phase = 0;
	assert(!pthread_create(&thread, NULL, do_test_cond_thread, &dt));

	assert(!skinny_mutex_lock(&dt.mutex));
	while (dt.phase != 1) {
		assert(!skinny_mutex_cond_wait(&dt.cond, &dt.mutex));
	};
	assert(!skinny_mutex_unlock(&dt.mutex));

	f(&dt.mutex);

	assert(!skinny_mutex_lock(&dt.mutex));
	dt.phase = 2;
	assert(!pthread_cond_signal(&dt.cond));
	assert(!skinny_mutex_unlock(&dt.mutex));

	assert(!pthread_join(thread, NULL));
	assert(!skinny_mutex_destroy(&dt.mutex));
	assert(!pthread_cond_destroy(&dt.cond));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x2f20
cmpl $0x0, %eax
jne 0x2afc
jmp 0x2b1b
leaq 0x1729(%rip), %rdi      # 0x422c
leaq 0x164c(%rip), %rsi      # 0x4156
movl $0x111, %edx            # imm = 0x111
leaq 0x1734(%rip), %rcx      # 0x424a
callq 0x10b0
leaq -0x48(%rbp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x10f0
cmpl $0x0, %eax
jne 0x2b33
jmp 0x2b52
leaq 0x1743(%rip), %rdi      # 0x427d
leaq 0x1615(%rip), %rsi      # 0x4156
movl $0x112, %edx            # imm = 0x112
leaq 0x16fd(%rip), %rcx      # 0x424a
callq 0x10b0
movl $0x0, -0x10(%rbp)
leaq -0x50(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0x3d8(%rip), %rdx       # 0x2f40
leaq -0x48(%rbp), %rcx
callq 0x1130
cmpl $0x0, %eax
jne 0x2b78
jmp 0x2b97
leaq 0x1721(%rip), %rdi      # 0x42a0
leaq 0x15d0(%rip), %rsi      # 0x4156
movl $0x114, %edx            # imm = 0x114
leaq 0x16b8(%rip), %rcx      # 0x424a
callq 0x10b0
leaq -0x48(%rbp), %rdi
callq 0x2990
cmpl $0x0, %eax
jne 0x2ba7
jmp 0x2bc6
leaq 0x172b(%rip), %rdi      # 0x42d9
leaq 0x15a1(%rip), %rsi      # 0x4156
movl $0x116, %edx            # imm = 0x116
leaq 0x1689(%rip), %rcx      # 0x424a
callq 0x10b0
jmp 0x2bc8
cmpl $0x1, -0x10(%rbp)
je 0x2c07
leaq -0x48(%rbp), %rdi
addq $0x8, %rdi
leaq -0x48(%rbp), %rsi
callq 0x1c10
cmpl $0x0, %eax
jne 0x2be6
jmp 0x2c05
leaq 0x170a(%rip), %rdi      # 0x42f7
leaq 0x1562(%rip), %rsi      # 0x4156
movl $0x118, %edx            # imm = 0x118
leaq 0x164a(%rip), %rcx      # 0x424a
callq 0x10b0
jmp 0x2bc8
leaq -0x48(%rbp), %rdi
callq 0x29e0
cmpl $0x0, %eax
jne 0x2c17
jmp 0x2c36
leaq 0x1706(%rip), %rdi      # 0x4324
leaq 0x1531(%rip), %rsi      # 0x4156
movl $0x11a, %edx            # imm = 0x11A
leaq 0x1619(%rip), %rcx      # 0x424a
callq 0x10b0
movq -0x8(%rbp), %rax
leaq -0x48(%rbp), %rdi
callq *%rax
leaq -0x48(%rbp), %rdi
callq 0x2990
cmpl $0x0, %eax
jne 0x2c50
jmp 0x2c6f
leaq 0x1682(%rip), %rdi      # 0x42d9
leaq 0x14f8(%rip), %rsi      # 0x4156
movl $0x11e, %edx            # imm = 0x11E
leaq 0x15e0(%rip), %rcx      # 0x424a
callq 0x10b0
movl $0x2, -0x10(%rbp)
leaq -0x48(%rbp), %rdi
addq $0x8, %rdi
callq 0x10c0
cmpl $0x0, %eax
jne 0x2c8a
jmp 0x2ca9
leaq 0x16b3(%rip), %rdi      # 0x4344
leaq 0x14be(%rip), %rsi      # 0x4156
movl $0x120, %edx            # imm = 0x120
leaq 0x15a6(%rip), %rcx      # 0x424a
callq 0x10b0
leaq -0x48(%rbp), %rdi
callq 0x29e0
cmpl $0x0, %eax
jne 0x2cb9
jmp 0x2cd8
leaq 0x1664(%rip), %rdi      # 0x4324
leaq 0x148f(%rip), %rsi      # 0x4156
movl $0x121, %edx            # imm = 0x121
leaq 0x1577(%rip), %rcx      # 0x424a
callq 0x10b0
movq -0x50(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1170
cmpl $0x0, %eax
jne 0x2cec
jmp 0x2d0b
leaq 0x1670(%rip), %rdi      # 0x4363
leaq 0x145c(%rip), %rsi      # 0x4156
movl $0x123, %edx            # imm = 0x123
leaq 0x1544(%rip), %rcx      # 0x424a
callq 0x10b0
leaq -0x48(%rbp), %rdi
callq 0x2a30
cmpl $0x0, %eax
jne 0x2d1b
jmp 0x2d3a
leaq 0x165d(%rip), %rdi      # 0x437f
leaq 0x142d(%rip), %rsi      # 0x4156
movl $0x124, %edx            # imm = 0x124
leaq 0x1515(%rip), %rcx      # 0x424a
callq 0x10b0
leaq -0x48(%rbp), %rdi
addq $0x8, %rdi
callq 0x1150
cmpl $0x0, %eax
jne 0x2d4e
jmp 0x2d6d
leaq 0x164b(%rip), %rdi      # 0x43a0
leaq 0x13fa(%rip), %rsi      # 0x4156
movl $0x125, %edx            # imm = 0x125
leaq 0x14e2(%rip), %rcx      # 0x424a
callq 0x10b0
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)