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

/* Variables and functions */
int /*<<< orphan*/ AnnotateCondVarSignal(char *, int, int **);
int /*<<< orphan*/ AnnotateCondVarWait(char *, int, int **,
                                       int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ pthread_cond_init(int **, int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutex_init(int **, int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ vgDrdCl_annotate_happens_after(int **);
int /*<<< orphan*/ vgDrdCl_annotate_happens_before(int **);
int /*<<< orphan*/ vgDrdCl_clean_memory(int **, int);
int main(int argc, char **argv) {
  pthread_mutex_t m;
  pthread_cond_t cv;
  int i[64];
  pthread_mutex_init(&m, NULL);
  pthread_cond_init(&cv, NULL);
  do {
    vgDrdCl_annotate_happens_after(&i);
    AnnotateCondVarWait(
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/bgianfo/dfly-valgrind/refs/heads/master/drd/"
        "tests/annotate_hb_err.c",
        20, &i, NULL);
  } while (0);
  do {
    vgDrdCl_annotate_happens_before(&m);
    AnnotateCondVarSignal(
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/bgianfo/dfly-valgrind/refs/heads/master/drd/"
        "tests/annotate_hb_err.c",
        23, &m);
  } while (0);
  do {
    vgDrdCl_annotate_happens_before(&cv);
    AnnotateCondVarSignal(
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/bgianfo/dfly-valgrind/refs/heads/master/drd/"
        "tests/annotate_hb_err.c",
        26, &cv);
  } while (0);
  do {
    vgDrdCl_annotate_happens_before(&i);
    AnnotateCondVarSignal(
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/bgianfo/dfly-valgrind/refs/heads/master/drd/"
        "tests/annotate_hb_err.c",
        29, &i);
  } while (0);
  pthread_cond_init((pthread_cond_t *)&i, NULL);
  vgDrdCl_clean_memory(&i, sizeof(i));
  do {
    vgDrdCl_annotate_happens_before(&i);
    AnnotateCondVarSignal(
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/bgianfo/dfly-valgrind/refs/heads/master/drd/"
        "tests/annotate_hb_err.c",
        34, &i);
  } while (0);
  do {
    vgDrdCl_annotate_happens_after(&i);
    AnnotateCondVarWait(
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/bgianfo/dfly-valgrind/refs/heads/master/drd/"
        "tests/annotate_hb_err.c",
        35, &i, NULL);
  } while (0);
  vgDrdCl_clean_memory(&i, sizeof(i));
  do {
    vgDrdCl_annotate_happens_before(&i);
    AnnotateCondVarSignal(
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/bgianfo/dfly-valgrind/refs/heads/master/drd/"
        "tests/annotate_hb_err.c",
        37, &i);
  } while (0);
  vgDrdCl_clean_memory(&i, sizeof(i));
  do {
    vgDrdCl_annotate_happens_before(&i);
    AnnotateCondVarSignal(
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/bgianfo/dfly-valgrind/refs/heads/master/drd/"
        "tests/annotate_hb_err.c",
        41, &i);
  } while (0);
  do {
    vgDrdCl_annotate_happens_after(&i);
    AnnotateCondVarWait(
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/bgianfo/dfly-valgrind/refs/heads/master/drd/"
        "tests/annotate_hb_err.c",
        42, &i, NULL);
  } while (0);
  do {
    vgDrdCl_annotate_happens_before(&i);
    AnnotateCondVarSignal(
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/bgianfo/dfly-valgrind/refs/heads/master/drd/"
        "tests/annotate_hb_err.c",
        43, &i);
  } while (0);
  fprintf(stderr, "Done.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   10a0 <pthread_mutex_init@plt>
lea    -0x20(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1060 <pthread_cond_init@plt>
lea    -0x120(%rbp),%rdi
call   1030 <vgDrdCl_annotate_happens_after@plt>
lea    -0x120(%rbp),%rdx
lea    0xe33(%rip),%rdi
mov    $0x14,%esi
xor    %eax,%eax
mov    %eax,%ecx
call   1090 <AnnotateCondVarWait@plt>
jmp    11e0 <main+0x60>
lea    -0x18(%rbp),%rdi
call   1080 <vgDrdCl_annotate_happens_before@plt>
lea    0xe10(%rip),%rdi
mov    $0x17,%esi
lea    -0x18(%rbp),%rdx
call   1070 <AnnotateCondVarSignal@plt>
jmp    1203 <main+0x83>
lea    -0x20(%rbp),%rdi
call   1080 <vgDrdCl_annotate_happens_before@plt>
lea    0xded(%rip),%rdi
mov    $0x1a,%esi
lea    -0x20(%rbp),%rdx
call   1070 <AnnotateCondVarSignal@plt>
jmp    1226 <main+0xa6>
lea    -0x120(%rbp),%rdi
call   1080 <vgDrdCl_annotate_happens_before@plt>
lea    -0x120(%rbp),%rdx
lea    0xdc0(%rip),%rdi
mov    $0x1d,%esi
call   1070 <AnnotateCondVarSignal@plt>
lea    -0x120(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1060 <pthread_cond_init@plt>
lea    -0x120(%rbp),%rdi
mov    $0x100,%esi
call   1050 <vgDrdCl_clean_memory@plt>
lea    -0x120(%rbp),%rdi
call   1080 <vgDrdCl_annotate_happens_before@plt>
lea    -0x120(%rbp),%rdx
lea    0xd7b(%rip),%rdi
mov    $0x22,%esi
call   1070 <AnnotateCondVarSignal@plt>
jmp    1294 <main+0x114>
lea    -0x120(%rbp),%rdi
call   1030 <vgDrdCl_annotate_happens_after@plt>
lea    -0x120(%rbp),%rdx
lea    0xd52(%rip),%rdi
mov    $0x23,%esi
xor    %eax,%eax
mov    %eax,%ecx
call   1090 <AnnotateCondVarWait@plt>
lea    -0x120(%rbp),%rdi
mov    $0x100,%esi
call   1050 <vgDrdCl_clean_memory@plt>
lea    -0x120(%rbp),%rdi
call   1080 <vgDrdCl_annotate_happens_before@plt>
lea    -0x120(%rbp),%rdx
lea    0xd19(%rip),%rdi
mov    $0x25,%esi
call   1070 <AnnotateCondVarSignal@plt>
lea    -0x120(%rbp),%rdi
mov    $0x100,%esi
call   1050 <vgDrdCl_clean_memory@plt>
lea    -0x120(%rbp),%rdi
call   1080 <vgDrdCl_annotate_happens_before@plt>
lea    -0x120(%rbp),%rdx
lea    0xce4(%rip),%rdi
mov    $0x29,%esi
call   1070 <AnnotateCondVarSignal@plt>
jmp    132b <main+0x1ab>
lea    -0x120(%rbp),%rdi
call   1030 <vgDrdCl_annotate_happens_after@plt>
lea    -0x120(%rbp),%rdx
lea    0xcbb(%rip),%rdi
mov    $0x2a,%esi
xor    %eax,%eax
mov    %eax,%ecx
call   1090 <AnnotateCondVarWait@plt>
jmp    1358 <main+0x1d8>
lea    -0x120(%rbp),%rdi
call   1080 <vgDrdCl_annotate_happens_before@plt>
lea    -0x120(%rbp),%rdx
lea    0xc8e(%rip),%rdi
mov    $0x2b,%esi
call   1070 <AnnotateCondVarSignal@plt>
mov    0x2c5d(%rip),%rax
mov    (%rax),%edi
lea    0xd12(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x118,%rsp
lea    0x8(%rsp),%r12
mov    %r12,%rdi
xor    %esi,%esi
call   10a0 <pthread_mutex_init@plt>
mov    %rsp,%r15
mov    %r15,%rdi
xor    %esi,%esi
call   1060 <pthread_cond_init@plt>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <vgDrdCl_annotate_happens_after@plt>
lea    0xe42(%rip),%r14
mov    %r14,%rdi
mov    $0x14,%esi
mov    %rbx,%rdx
xor    %ecx,%ecx
call   1090 <AnnotateCondVarWait@plt>
mov    %r12,%rdi
call   1080 <vgDrdCl_annotate_happens_before@plt>
mov    %r14,%rdi
mov    $0x17,%esi
mov    %r12,%rdx
call   1070 <AnnotateCondVarSignal@plt>
mov    %r15,%rdi
call   1080 <vgDrdCl_annotate_happens_before@plt>
mov    %r14,%rdi
mov    $0x1a,%esi
mov    %r15,%rdx
call   1070 <AnnotateCondVarSignal@plt>
mov    %rbx,%rdi
call   1080 <vgDrdCl_annotate_happens_before@plt>
mov    %r14,%rdi
mov    $0x1d,%esi
mov    %rbx,%rdx
call   1070 <AnnotateCondVarSignal@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1060 <pthread_cond_init@plt>
mov    %rbx,%rdi
mov    $0x100,%esi
call   1050 <vgDrdCl_clean_memory@plt>
mov    %rbx,%rdi
call   1080 <vgDrdCl_annotate_happens_before@plt>
mov    %r14,%rdi
mov    $0x22,%esi
mov    %rbx,%rdx
call   1070 <AnnotateCondVarSignal@plt>
mov    %rbx,%rdi
call   1030 <vgDrdCl_annotate_happens_after@plt>
mov    %r14,%rdi
mov    $0x23,%esi
mov    %rbx,%rdx
xor    %ecx,%ecx
call   1090 <AnnotateCondVarWait@plt>
mov    %rbx,%rdi
mov    $0x100,%esi
call   1050 <vgDrdCl_clean_memory@plt>
mov    %rbx,%rdi
call   1080 <vgDrdCl_annotate_happens_before@plt>
mov    %r14,%rdi
mov    $0x25,%esi
mov    %rbx,%rdx
call   1070 <AnnotateCondVarSignal@plt>
mov    %rbx,%rdi
mov    $0x100,%esi
call   1050 <vgDrdCl_clean_memory@plt>
mov    %rbx,%rdi
call   1080 <vgDrdCl_annotate_happens_before@plt>
mov    %r14,%rdi
mov    $0x29,%esi
mov    %rbx,%rdx
call   1070 <AnnotateCondVarSignal@plt>
mov    %rbx,%rdi
call   1030 <vgDrdCl_annotate_happens_after@plt>
mov    %r14,%rdi
mov    $0x2a,%esi
mov    %rbx,%rdx
xor    %ecx,%ecx
call   1090 <AnnotateCondVarWait@plt>
mov    %rbx,%rdi
call   1080 <vgDrdCl_annotate_happens_before@plt>
mov    %r14,%rdi
mov    $0x2b,%esi
mov    %rbx,%rdx
call   1070 <AnnotateCondVarSignal@plt>
mov    0x2cfc(%rip),%rax
mov    (%rax),%edi
lea    0xdb1(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x118,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [158 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bgianfo/dfly-valgrind/refs/heads/master/drd/tests/annotate_hb_err.c\00"
@stderr = global i32 0
@.str.1 = [7 x i8] c"Done.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca [64 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 @pthread_mutex_init(i32** %6, i32* null)
%10 = call i32 @pthread_cond_init(i32** %7, i32* null)
br label %11
11: ; preds = %2
%12 = bitcast [64 x i32]* %8 to i32**
%13 = call i32 @vgDrdCl_annotate_happens_after(i32** %12)
%14 = bitcast [64 x i32]* %8 to i32**
%15 = call i32 @AnnotateCondVarWait(i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str, i64 0, i64 0), i32 20, i32** %14, i32* null)
br label %16
16: ; preds = %11
br label %17
17: ; preds = %16
%18 = call i32 @vgDrdCl_annotate_happens_before(i32** %6)
%19 = call i32 @AnnotateCondVarSignal(i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str, i64 0, i64 0), i32 23, i32** %6)
br label %20
20: ; preds = %17
br label %21
21: ; preds = %20
%22 = call i32 @vgDrdCl_annotate_happens_before(i32** %7)
%23 = call i32 @AnnotateCondVarSignal(i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str, i64 0, i64 0), i32 26, i32** %7)
br label %24
24: ; preds = %21
br label %25
25: ; preds = %24
%26 = bitcast [64 x i32]* %8 to i32**
%27 = call i32 @vgDrdCl_annotate_happens_before(i32** %26)
%28 = bitcast [64 x i32]* %8 to i32**
%29 = call i32 @AnnotateCondVarSignal(i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str, i64 0, i64 0), i32 29, i32** %28)
br label %30
30: ; preds = %25
%31 = bitcast [64 x i32]* %8 to i32**
%32 = call i32 @pthread_cond_init(i32** %31, i32* null)
%33 = bitcast [64 x i32]* %8 to i32**
%34 = call i32 @vgDrdCl_clean_memory(i32** %33, i32 256)
br label %35
35: ; preds = %30
%36 = bitcast [64 x i32]* %8 to i32**
%37 = call i32 @vgDrdCl_annotate_happens_before(i32** %36)
%38 = bitcast [64 x i32]* %8 to i32**
%39 = call i32 @AnnotateCondVarSignal(i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str, i64 0, i64 0), i32 34, i32** %38)
br label %40
40: ; preds = %35
br label %41
41: ; preds = %40
%42 = bitcast [64 x i32]* %8 to i32**
%43 = call i32 @vgDrdCl_annotate_happens_after(i32** %42)
%44 = bitcast [64 x i32]* %8 to i32**
%45 = call i32 @AnnotateCondVarWait(i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str, i64 0, i64 0), i32 35, i32** %44, i32* null)
br label %46
46: ; preds = %41
%47 = bitcast [64 x i32]* %8 to i32**
%48 = call i32 @vgDrdCl_clean_memory(i32** %47, i32 256)
br label %49
49: ; preds = %46
%50 = bitcast [64 x i32]* %8 to i32**
%51 = call i32 @vgDrdCl_annotate_happens_before(i32** %50)
%52 = bitcast [64 x i32]* %8 to i32**
%53 = call i32 @AnnotateCondVarSignal(i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str, i64 0, i64 0), i32 37, i32** %52)
br label %54
54: ; preds = %49
%55 = bitcast [64 x i32]* %8 to i32**
%56 = call i32 @vgDrdCl_clean_memory(i32** %55, i32 256)
br label %57
57: ; preds = %54
%58 = bitcast [64 x i32]* %8 to i32**
%59 = call i32 @vgDrdCl_annotate_happens_before(i32** %58)
%60 = bitcast [64 x i32]* %8 to i32**
%61 = call i32 @AnnotateCondVarSignal(i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str, i64 0, i64 0), i32 41, i32** %60)
br label %62
62: ; preds = %57
br label %63
63: ; preds = %62
%64 = bitcast [64 x i32]* %8 to i32**
%65 = call i32 @vgDrdCl_annotate_happens_after(i32** %64)
%66 = bitcast [64 x i32]* %8 to i32**
%67 = call i32 @AnnotateCondVarWait(i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str, i64 0, i64 0), i32 42, i32** %66, i32* null)
br label %68
68: ; preds = %63
br label %69
69: ; preds = %68
%70 = bitcast [64 x i32]* %8 to i32**
%71 = call i32 @vgDrdCl_annotate_happens_before(i32** %70)
%72 = bitcast [64 x i32]* %8 to i32**
%73 = call i32 @AnnotateCondVarSignal(i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str, i64 0, i64 0), i32 43, i32** %72)
br label %74
74: ; preds = %69
%75 = load i32, i32* @stderr
%76 = call i32 @fprintf(i32 %75, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [158 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bgianfo/dfly-valgrind/refs/heads/master/drd/tests/annotate_hb_err.c\00"
@stderr = global i32 0
@.str.1 = [7 x i8] c"Done.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [64 x i32]
%6 = bitcast i32** %3 to i8*
%7 = bitcast i32** %4 to i8*
%8 = bitcast [64 x i32]* %5 to i8*
%9 = call i32 @pthread_mutex_init(i32** %3, i32* null)
%10 = call i32 @pthread_cond_init(i32** %4, i32* null)
%11 = bitcast [64 x i32]* %5 to i32**
%12 = call i32 @vgDrdCl_annotate_happens_after(i32** %11)
%13 = call i32 @AnnotateCondVarWait(i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str, i64 0, i64 0), i32 20, i32** %11, i32* null)
%14 = call i32 @vgDrdCl_annotate_happens_before(i32** %3)
%15 = call i32 @AnnotateCondVarSignal(i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str, i64 0, i64 0), i32 23, i32** %3)
%16 = call i32 @vgDrdCl_annotate_happens_before(i32** %4)
%17 = call i32 @AnnotateCondVarSignal(i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str, i64 0, i64 0), i32 26, i32** %4)
%18 = call i32 @vgDrdCl_annotate_happens_before(i32** %11)
%19 = call i32 @AnnotateCondVarSignal(i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str, i64 0, i64 0), i32 29, i32** %11)
%20 = call i32 @pthread_cond_init(i32** %11, i32* null)
%21 = call i32 @vgDrdCl_clean_memory(i32** %11, i32 256)
%22 = call i32 @vgDrdCl_annotate_happens_before(i32** %11)
%23 = call i32 @AnnotateCondVarSignal(i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str, i64 0, i64 0), i32 34, i32** %11)
%24 = call i32 @vgDrdCl_annotate_happens_after(i32** %11)
%25 = call i32 @AnnotateCondVarWait(i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str, i64 0, i64 0), i32 35, i32** %11, i32* null)
%26 = call i32 @vgDrdCl_clean_memory(i32** %11, i32 256)
%27 = call i32 @vgDrdCl_annotate_happens_before(i32** %11)
%28 = call i32 @AnnotateCondVarSignal(i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str, i64 0, i64 0), i32 37, i32** %11)
%29 = call i32 @vgDrdCl_clean_memory(i32** %11, i32 256)
%30 = call i32 @vgDrdCl_annotate_happens_before(i32** %11)
%31 = call i32 @AnnotateCondVarSignal(i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str, i64 0, i64 0), i32 41, i32** %11)
%32 = call i32 @vgDrdCl_annotate_happens_after(i32** %11)
%33 = call i32 @AnnotateCondVarWait(i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str, i64 0, i64 0), i32 42, i32** %11, i32* null)
%34 = call i32 @vgDrdCl_annotate_happens_before(i32** %11)
%35 = call i32 @AnnotateCondVarSignal(i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str, i64 0, i64 0), i32 43, i32** %11)
%36 = load i32, i32* @stderr
%37 = call i32 @fprintf(i32 %36, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}