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

/* Variables and functions */
int /*<<< orphan*/ pthread_cond_broadcast(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_cond_destroy(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_cond_init(int /*<<< orphan*/ *,
                                     int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutex_destroy(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutex_init(int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutex_lock(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutex_unlock(int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  pthread_mutex_t mutex;
  pthread_cond_t cond;
  pthread_mutex_init(&mutex, NULL);
  pthread_cond_init(&cond, NULL);
  pthread_mutex_lock(&mutex);
  pthread_cond_broadcast(&cond);
  pthread_mutex_unlock(&mutex);
  pthread_cond_destroy(&cond);
  pthread_mutex_destroy(&mutex);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x14(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1080 <pthread_mutex_init@plt>
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <pthread_cond_init@plt>
lea    -0x14(%rbp),%rdi
call   1090 <pthread_mutex_lock@plt>
lea    -0x18(%rbp),%rdi
call   1030 <pthread_cond_broadcast@plt>
lea    -0x14(%rbp),%rdi
call   1060 <pthread_mutex_unlock@plt>
lea    -0x18(%rbp),%rdi
call   1070 <pthread_cond_destroy@plt>
lea    -0x14(%rbp),%rdi
call   1040 <pthread_mutex_destroy@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0x4(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1080 <pthread_mutex_init@plt>
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
call   1050 <pthread_cond_init@plt>
mov    %rbx,%rdi
call   1090 <pthread_mutex_lock@plt>
mov    %r14,%rdi
call   1030 <pthread_cond_broadcast@plt>
mov    %rbx,%rdi
call   1060 <pthread_mutex_unlock@plt>
mov    %r14,%rdi
call   1070 <pthread_cond_destroy@plt>
mov    %rbx,%rdi
call   1040 <pthread_mutex_destroy@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @pthread_mutex_init(i32* %6, i32* null)
%9 = call i32 @pthread_cond_init(i32* %7, i32* null)
%10 = call i32 @pthread_mutex_lock(i32* %6)
%11 = call i32 @pthread_cond_broadcast(i32* %7)
%12 = call i32 @pthread_mutex_unlock(i32* %6)
%13 = call i32 @pthread_cond_destroy(i32* %7)
%14 = call i32 @pthread_mutex_destroy(i32* %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = call i32 @pthread_mutex_init(i32* %3, i32* null)
%8 = call i32 @pthread_cond_init(i32* %4, i32* null)
%9 = call i32 @pthread_mutex_lock(i32* %3)
%10 = call i32 @pthread_cond_broadcast(i32* %4)
%11 = call i32 @pthread_mutex_unlock(i32* %3)
%12 = call i32 @pthread_cond_destroy(i32* %4)
%13 = call i32 @pthread_mutex_destroy(i32* %3)
ret i32 0
}