void test_wf_enq_deq() {
  if ((__builtin_expect(!!((0xffff) <= 0xffff), 0)))
    _log_write(__FUNCTION__,
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/ashish-17/wfmalloc/refs/"
               "heads/master/src/main.c",
               745, 0xffff, 0, "");
  ;
  ;
  int i;
  int j;
  int res = 0;
  unsigned no_ops[] = {10, 50000, 500000};
  for (j = 0; j < sizeof(no_ops) / sizeof(int); j++) {
    for (i = 2; i < 33; i += 5) {
      if ((__builtin_expect(!!((1) <= 0xffff), 0)))
        _log_write(__FUNCTION__,
                   "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                   "outputs/2022-01-22/02-19-57/repos/ashish-17/wfmalloc/refs/"
                   "heads/master/src/main.c",
                   754, 1, -1,
                   "starting the test with %d threads and %u operations", i,
                   no_ops[j]);
      ;
      ;
      res += simple_test(i, no_ops[j]);
    }
  }
  if ((__builtin_expect(!!((1) <= 0xffff), 0)))
    _log_write(__FUNCTION__,
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/ashish-17/wfmalloc/refs/"
               "heads/master/src/main.c",
               759, 1, -1, "no of times the tests failed = %d", res);
  ;
  ;
  if ((__builtin_expect(!!((0xffff) <= 0xffff), 0)))
    _log_write(__FUNCTION__,
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/ashish-17/wfmalloc/refs/"
               "heads/master/src/main.c",
               765, 0xffff, 1, "");
  ;
  ;
}


x86 assembly (clang, -O0):
<test_wf_enq_deq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xed1(%rip),%rdi
lea    0xeda(%rip),%rsi
mov    $0x2e9,%edx
mov    $0xffff,%ecx
xor    %r8d,%r8d
lea    0xf4f(%rip),%r9
mov    $0x0,%al
call   1030 <_log_write@plt>
movl   $0x0,-0xc(%rbp)
mov    0xf91(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xf8f(%rip),%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
movslq -0x8(%rbp),%rax
cmp    $0x3,%rax
jae    120b <test_wf_enq_deq+0xeb>
movl   $0x2,-0x4(%rbp)
cmpl   $0x21,-0x4(%rbp)
jge    11f8 <test_wf_enq_deq+0xd8>
mov    -0x4(%rbp),%r10d
movslq -0x8(%rbp),%rax
mov    -0x18(%rbp,%rax,4),%eax
lea    0xe5b(%rip),%rdi
lea    0xe64(%rip),%rsi
mov    $0x2f2,%edx
mov    $0x1,%ecx
mov    $0xffffffff,%r8d
lea    0xed7(%rip),%r9
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x0,%al
call   1030 <_log_write@plt>
mov    -0x4(%rbp),%edi
movslq -0x8(%rbp),%rax
mov    -0x18(%rbp,%rax,4),%esi
mov    $0x0,%al
call   1040 <simple_test@plt>
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x4(%rbp)
jmp    1188 <test_wf_enq_deq+0x68>
jmp    11fd <test_wf_enq_deq+0xdd>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1173 <test_wf_enq_deq+0x53>
mov    -0xc(%rbp),%eax
lea    0xdeb(%rip),%rdi
lea    0xdf4(%rip),%rsi
mov    $0x2f7,%edx
mov    $0x1,%ecx
mov    $0xffffffff,%r8d
lea    0xe9b(%rip),%r9
mov    %eax,(%rsp)
mov    $0x0,%al
call   1030 <_log_write@plt>
lea    0xdbc(%rip),%rdi
lea    0xdc5(%rip),%rsi
mov    $0x2fd,%edx
mov    $0xffff,%ecx
mov    $0x1,%r8d
lea    0xe37(%rip),%r9
mov    $0x0,%al
call   1030 <_log_write@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_wf_enq_deq>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xece(%rip),%rdi
lea    0xed7(%rip),%rsi
lea    0xf59(%rip),%r9
mov    $0x2e9,%edx
mov    $0xffff,%ecx
xor    %r8d,%r8d
xor    %eax,%eax
call   1030 <_log_write@plt>
xor    %r15d,%r15d
xor    %ebx,%ebx
nopl   0x0(%rax)
lea    0xf89(%rip),%rax
mov    (%r15,%rax,1),%r13d
lea    0xe8e(%rip),%rdi
lea    0xe97(%rip),%r14
mov    %r14,%rsi
mov    $0x2f2,%edx
mov    $0x1,%ecx
mov    $0xffffffff,%r8d
lea    0xf07(%rip),%r12
mov    %r12,%r9
xor    %eax,%eax
push   %r13
push   $0x2
call   1030 <_log_write@plt>
add    $0x10,%rsp
mov    $0x2,%edi
mov    %r13d,%esi
xor    %eax,%eax
call   1040 <simple_test@plt>
mov    %eax,%ebp
add    %ebx,%ebp
lea    0xe41(%rip),%rdi
mov    %r14,%rsi
mov    $0x2f2,%edx
mov    $0x1,%ecx
mov    $0xffffffff,%r8d
mov    %r12,%r9
xor    %eax,%eax
push   %r13
push   $0x7
call   1030 <_log_write@plt>
add    $0x10,%rsp
mov    $0x7,%edi
mov    %r13d,%esi
xor    %eax,%eax
call   1040 <simple_test@plt>
mov    %eax,%ebx
add    %ebp,%ebx
lea    0xe02(%rip),%rdi
mov    %r14,%rsi
mov    $0x2f2,%edx
mov    $0x1,%ecx
mov    $0xffffffff,%r8d
mov    %r12,%r9
xor    %eax,%eax
push   %r13
push   $0xc
call   1030 <_log_write@plt>
add    $0x10,%rsp
mov    $0xc,%edi
mov    %r13d,%esi
xor    %eax,%eax
call   1040 <simple_test@plt>
mov    %eax,%ebp
add    %ebx,%ebp
lea    0xdc3(%rip),%rdi
mov    %rdi,%r12
mov    %r14,%rsi
mov    $0x2f2,%edx
mov    $0x1,%ecx
mov    $0xffffffff,%r8d
lea    0xe40(%rip),%r9
xor    %eax,%eax
push   %r13
push   $0x11
call   1030 <_log_write@plt>
add    $0x10,%rsp
mov    $0x11,%edi
mov    %r13d,%esi
xor    %eax,%eax
call   1040 <simple_test@plt>
mov    %eax,%ebx
add    %ebp,%ebx
mov    %r12,%rdi
mov    %r14,%rsi
mov    $0x2f2,%edx
mov    $0x1,%ecx
mov    $0xffffffff,%r8d
lea    0xe01(%rip),%r9
xor    %eax,%eax
push   %r13
push   $0x16
call   1030 <_log_write@plt>
add    $0x10,%rsp
mov    $0x16,%edi
mov    %r13d,%esi
xor    %eax,%eax
call   1040 <simple_test@plt>
mov    %eax,%ebp
add    %ebx,%ebp
mov    %r12,%rdi
mov    %r14,%rsi
mov    $0x2f2,%edx
mov    $0x1,%ecx
mov    $0xffffffff,%r8d
lea    0xdc2(%rip),%rbx
mov    %rbx,%r9
xor    %eax,%eax
push   %r13
push   $0x1b
call   1030 <_log_write@plt>
add    $0x10,%rsp
mov    $0x1b,%edi
mov    %r13d,%esi
xor    %eax,%eax
call   1040 <simple_test@plt>
mov    %eax,%r14d
add    %ebp,%r14d
mov    %r12,%rdi
lea    0xd07(%rip),%rsi
mov    $0x2f2,%edx
mov    $0x1,%ecx
mov    $0xffffffff,%r8d
mov    %rbx,%r9
xor    %eax,%eax
push   %r13
push   $0x20
call   1030 <_log_write@plt>
add    $0x10,%rsp
mov    $0x20,%edi
mov    %r13d,%esi
xor    %eax,%eax
call   1040 <simple_test@plt>
mov    %eax,%ebx
add    %r14d,%ebx
add    $0x4,%r15
cmp    $0xc,%r15
jne    1160 <test_wf_enq_deq+0x40>
sub    $0x8,%rsp
lea    0xca8(%rip),%rbp
lea    0xcb1(%rip),%r14
lea    0xd68(%rip),%r9
mov    %rbp,%rdi
mov    %r14,%rsi
mov    $0x2f7,%edx
mov    $0x1,%ecx
mov    $0xffffffff,%r8d
xor    %eax,%eax
push   %rbx
call   1030 <_log_write@plt>
add    $0x10,%rsp
lea    0xd0a(%rip),%r9
mov    %rbp,%rdi
mov    %r14,%rsi
mov    $0x2fd,%edx
mov    $0xffff,%ecx
mov    $0x1,%r8d
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <_log_write@plt>

LLVM IR (-O0):
@__FUNCTION__.test_wf_enq_deq = [16 x i8] c"test_wf_enq_deq\00"
@.str = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ashish-17/wfmalloc/refs/heads/master/src/main.c\00"
@.str.1 = [1 x i8] zeroinitializer
@__const.test_wf_enq_deq.no_ops = [3 x i32] [i32 10, i32 50000, i32 500000]
@.str.2 = [52 x i8] c"starting the test with %d threads and %u operations\00"
@.str.3 = [34 x i8] c"no of times the tests failed = %d\00"
define void @test_wf_enq_deq() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [3 x i32]
%5 = call i32 (i8*, i8*, i32, i32, i32, i8*, ...) bitcast (i32 (...)* @_log_write to i32 (i8*, i8*, i32, i32, i32, i8*, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__FUNCTION__.test_wf_enq_deq, i64 0, i64 0), i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 745, i32 65535, i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
%6 = bitcast [3 x i32]* %4 to i8*
store i32 0, i32* %2
br label %7
7: ; preds = %34, %0
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = icmp ult i64 %9, 3
br i1 %10, label %11, label %37
11: ; preds = %7
store i32 2, i32* %1
br label %12
12: ; preds = %30, %11
%13 = load i32, i32* %1
%14 = icmp slt i32 %13, 33
br i1 %14, label %15, label %33
15: ; preds = %12
%16 = load i32, i32* %1
%17 = load i32, i32* %2
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 %18
%20 = load i32, i32* %19
%21 = call i32 (i8*, i8*, i32, i32, i32, i8*, i32, i32, ...) bitcast (i32 (...)* @_log_write to i32 (i8*, i8*, i32, i32, i32, i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__FUNCTION__.test_wf_enq_deq, i64 0, i64 0), i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 754, i32 1, i32 -1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0), i32 %16, i32 %20)
%22 = load i32, i32* %1
%23 = load i32, i32* %2
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 %24
%26 = load i32, i32* %25
%27 = call i32 (i32, i32, ...) bitcast (i32 (...)* @simple_test to i32 (i32, i32, ...)*)(i32 %22, i32 %26)
%28 = load i32, i32* %3
%29 = add nsw i32 %28, %27
store i32 %29, i32* %3
br label %30
30: ; preds = %15
%31 = load i32, i32* %1
%32 = add nsw i32 %31, 5
store i32 %32, i32* %1
br label %12
33: ; preds = %12
br label %34
34: ; preds = %33
%35 = load i32, i32* %2
%36 = add nsw i32 %35, 1
store i32 %36, i32* %2
br label %7
37: ; preds = %7
%38 = load i32, i32* %3
%39 = call i32 (i8*, i8*, i32, i32, i32, i8*, i32, ...) bitcast (i32 (...)* @_log_write to i32 (i8*, i8*, i32, i32, i32, i8*, i32, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__FUNCTION__.test_wf_enq_deq, i64 0, i64 0), i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 759, i32 1, i32 -1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i32 %38)
%40 = call i32 (i8*, i8*, i32, i32, i32, i8*, ...) bitcast (i32 (...)* @_log_write to i32 (i8*, i8*, i32, i32, i32, i8*, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__FUNCTION__.test_wf_enq_deq, i64 0, i64 0), i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 765, i32 65535, i32 1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.test_wf_enq_deq = [16 x i8] c"test_wf_enq_deq\00"
@.str = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ashish-17/wfmalloc/refs/heads/master/src/main.c\00"
@.str.1 = [1 x i8] zeroinitializer
@__const.test_wf_enq_deq.no_ops = [3 x i32] [i32 10, i32 50000, i32 500000]
@.str.2 = [52 x i8] c"starting the test with %d threads and %u operations\00"
@.str.3 = [34 x i8] c"no of times the tests failed = %d\00"
define void @test_wf_enq_deq() {
%1 = tail call i32 (i8*, i8*, i32, i32, i32, i8*, ...) bitcast (i32 (...)* @_log_write to i32 (i8*, i8*, i32, i32, i32, i8*, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__FUNCTION__.test_wf_enq_deq, i64 0, i64 0), i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 745, i32 65535, i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = phi i64 [ 0, %0 ], [ %28, %2 ]
%4 = phi i32 [ 0, %0 ], [ %27, %2 ]
%5 = getelementptr inbounds [3 x i32], [3 x i32]* @__const.test_wf_enq_deq.no_ops, i64 0, i64 %3
%6 = load i32, i32* %5
%7 = tail call i32 (i8*, i8*, i32, i32, i32, i8*, i32, i32, ...) bitcast (i32 (...)* @_log_write to i32 (i8*, i8*, i32, i32, i32, i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__FUNCTION__.test_wf_enq_deq, i64 0, i64 0), i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 754, i32 1, i32 -1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0), i32 2, i32 %6)
%8 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @simple_test to i32 (i32, i32, ...)*)(i32 2, i32 %6)
%9 = add nsw i32 %8, %4
%10 = tail call i32 (i8*, i8*, i32, i32, i32, i8*, i32, i32, ...) bitcast (i32 (...)* @_log_write to i32 (i8*, i8*, i32, i32, i32, i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__FUNCTION__.test_wf_enq_deq, i64 0, i64 0), i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 754, i32 1, i32 -1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0), i32 7, i32 %6)
%11 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @simple_test to i32 (i32, i32, ...)*)(i32 7, i32 %6)
%12 = add nsw i32 %11, %9
%13 = tail call i32 (i8*, i8*, i32, i32, i32, i8*, i32, i32, ...) bitcast (i32 (...)* @_log_write to i32 (i8*, i8*, i32, i32, i32, i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__FUNCTION__.test_wf_enq_deq, i64 0, i64 0), i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 754, i32 1, i32 -1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0), i32 12, i32 %6)
%14 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @simple_test to i32 (i32, i32, ...)*)(i32 12, i32 %6)
%15 = add nsw i32 %14, %12
%16 = tail call i32 (i8*, i8*, i32, i32, i32, i8*, i32, i32, ...) bitcast (i32 (...)* @_log_write to i32 (i8*, i8*, i32, i32, i32, i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__FUNCTION__.test_wf_enq_deq, i64 0, i64 0), i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 754, i32 1, i32 -1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0), i32 17, i32 %6)
%17 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @simple_test to i32 (i32, i32, ...)*)(i32 17, i32 %6)
%18 = add nsw i32 %17, %15
%19 = tail call i32 (i8*, i8*, i32, i32, i32, i8*, i32, i32, ...) bitcast (i32 (...)* @_log_write to i32 (i8*, i8*, i32, i32, i32, i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__FUNCTION__.test_wf_enq_deq, i64 0, i64 0), i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 754, i32 1, i32 -1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0), i32 22, i32 %6)
%20 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @simple_test to i32 (i32, i32, ...)*)(i32 22, i32 %6)
%21 = add nsw i32 %20, %18
%22 = tail call i32 (i8*, i8*, i32, i32, i32, i8*, i32, i32, ...) bitcast (i32 (...)* @_log_write to i32 (i8*, i8*, i32, i32, i32, i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__FUNCTION__.test_wf_enq_deq, i64 0, i64 0), i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 754, i32 1, i32 -1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0), i32 27, i32 %6)
%23 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @simple_test to i32 (i32, i32, ...)*)(i32 27, i32 %6)
%24 = add nsw i32 %23, %21
%25 = tail call i32 (i8*, i8*, i32, i32, i32, i8*, i32, i32, ...) bitcast (i32 (...)* @_log_write to i32 (i8*, i8*, i32, i32, i32, i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__FUNCTION__.test_wf_enq_deq, i64 0, i64 0), i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 754, i32 1, i32 -1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0), i32 32, i32 %6)
%26 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @simple_test to i32 (i32, i32, ...)*)(i32 32, i32 %6)
%27 = add nsw i32 %26, %24
%28 = add nuw nsw i64 %3, 1
%29 = icmp eq i64 %28, 3
br i1 %29, label %30, label %2
30: ; preds = %2
%31 = tail call i32 (i8*, i8*, i32, i32, i32, i8*, i32, ...) bitcast (i32 (...)* @_log_write to i32 (i8*, i8*, i32, i32, i32, i8*, i32, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__FUNCTION__.test_wf_enq_deq, i64 0, i64 0), i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 759, i32 1, i32 -1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i32 %27)
%32 = tail call i32 (i8*, i8*, i32, i32, i32, i8*, ...) bitcast (i32 (...)* @_log_write to i32 (i8*, i8*, i32, i32, i32, i8*, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__FUNCTION__.test_wf_enq_deq, i64 0, i64 0), i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 765, i32 65535, i32 1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}