#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 */

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int input_a();
int /*<<< orphan*/ report(int);
int /*<<< orphan*/ wait_clocks(int);
void consumer() {
  wait_clocks(1000);
  assert(input_a() == 1);
  wait_clocks(1000);
  assert(input_a() == 2);
  wait_clocks(1000);
  assert(input_a() == 3);
  wait_clocks(1000);
  assert(input_a() == 4);
  wait_clocks(1000);
  assert(input_a() == 5);
  wait_clocks(1000);
  assert(input_a() == 6);
  wait_clocks(1000);
  assert(input_a() == 7);
  wait_clocks(1000);
  assert(input_a() == 8);
  wait_clocks(1000);
  assert(input_a() == 9);
  wait_clocks(1000);
  assert(input_a() == 10);
  report(1);
}


x86 assembly (clang, -O0):
<consumer>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3e8,%edi
call   1050 <wait_clocks@plt>
mov    $0x0,%al
call   1040 <input_a@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x3e8,%edi
call   1050 <wait_clocks@plt>
mov    $0x0,%al
call   1040 <input_a@plt>
cmp    $0x2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x3e8,%edi
call   1050 <wait_clocks@plt>
mov    $0x0,%al
call   1040 <input_a@plt>
cmp    $0x3,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x3e8,%edi
call   1050 <wait_clocks@plt>
mov    $0x0,%al
call   1040 <input_a@plt>
cmp    $0x4,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x3e8,%edi
call   1050 <wait_clocks@plt>
mov    $0x0,%al
call   1040 <input_a@plt>
cmp    $0x5,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x3e8,%edi
call   1050 <wait_clocks@plt>
mov    $0x0,%al
call   1040 <input_a@plt>
cmp    $0x6,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x3e8,%edi
call   1050 <wait_clocks@plt>
mov    $0x0,%al
call   1040 <input_a@plt>
cmp    $0x7,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x3e8,%edi
call   1050 <wait_clocks@plt>
mov    $0x0,%al
call   1040 <input_a@plt>
cmp    $0x8,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x3e8,%edi
call   1050 <wait_clocks@plt>
mov    $0x0,%al
call   1040 <input_a@plt>
cmp    $0x9,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x3e8,%edi
call   1050 <wait_clocks@plt>
mov    $0x0,%al
call   1040 <input_a@plt>
cmp    $0xa,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1060 <report@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<consumer>:
push   %rax
mov    $0x3e8,%edi
call   1050 <wait_clocks@plt>
xor    %eax,%eax
call   1040 <input_a@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x3e8,%edi
call   1050 <wait_clocks@plt>
xor    %eax,%eax
call   1040 <input_a@plt>
xor    %edi,%edi
cmp    $0x2,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x3e8,%edi
call   1050 <wait_clocks@plt>
xor    %eax,%eax
call   1040 <input_a@plt>
xor    %edi,%edi
cmp    $0x3,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x3e8,%edi
call   1050 <wait_clocks@plt>
xor    %eax,%eax
call   1040 <input_a@plt>
xor    %edi,%edi
cmp    $0x4,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x3e8,%edi
call   1050 <wait_clocks@plt>
xor    %eax,%eax
call   1040 <input_a@plt>
xor    %edi,%edi
cmp    $0x5,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x3e8,%edi
call   1050 <wait_clocks@plt>
xor    %eax,%eax
call   1040 <input_a@plt>
xor    %edi,%edi
cmp    $0x6,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x3e8,%edi
call   1050 <wait_clocks@plt>
xor    %eax,%eax
call   1040 <input_a@plt>
xor    %edi,%edi
cmp    $0x7,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x3e8,%edi
call   1050 <wait_clocks@plt>
xor    %eax,%eax
call   1040 <input_a@plt>
xor    %edi,%edi
cmp    $0x8,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x3e8,%edi
call   1050 <wait_clocks@plt>
xor    %eax,%eax
call   1040 <input_a@plt>
xor    %edi,%edi
cmp    $0x9,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x3e8,%edi
call   1050 <wait_clocks@plt>
xor    %eax,%eax
call   1040 <input_a@plt>
xor    %edi,%edi
cmp    $0xa,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x1,%edi
pop    %rax
jmp    1060 <report@plt>

LLVM IR (-O0):
define void @consumer() {
%1 = call i32 @wait_clocks(i32 1000)
%2 = call i32 (...) @input_a()
%3 = icmp eq i32 %2, 1
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
%6 = call i32 @wait_clocks(i32 1000)
%7 = call i32 (...) @input_a()
%8 = icmp eq i32 %7, 2
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = call i32 @wait_clocks(i32 1000)
%12 = call i32 (...) @input_a()
%13 = icmp eq i32 %12, 3
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = call i32 @wait_clocks(i32 1000)
%17 = call i32 (...) @input_a()
%18 = icmp eq i32 %17, 4
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
%21 = call i32 @wait_clocks(i32 1000)
%22 = call i32 (...) @input_a()
%23 = icmp eq i32 %22, 5
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
%26 = call i32 @wait_clocks(i32 1000)
%27 = call i32 (...) @input_a()
%28 = icmp eq i32 %27, 6
%29 = zext i1 %28 to i32
%30 = call i32 @assert(i32 %29)
%31 = call i32 @wait_clocks(i32 1000)
%32 = call i32 (...) @input_a()
%33 = icmp eq i32 %32, 7
%34 = zext i1 %33 to i32
%35 = call i32 @assert(i32 %34)
%36 = call i32 @wait_clocks(i32 1000)
%37 = call i32 (...) @input_a()
%38 = icmp eq i32 %37, 8
%39 = zext i1 %38 to i32
%40 = call i32 @assert(i32 %39)
%41 = call i32 @wait_clocks(i32 1000)
%42 = call i32 (...) @input_a()
%43 = icmp eq i32 %42, 9
%44 = zext i1 %43 to i32
%45 = call i32 @assert(i32 %44)
%46 = call i32 @wait_clocks(i32 1000)
%47 = call i32 (...) @input_a()
%48 = icmp eq i32 %47, 10
%49 = zext i1 %48 to i32
%50 = call i32 @assert(i32 %49)
%51 = call i32 @report(i32 1)
ret void
}

LLVM IR (-O2):
define void @consumer() {
%1 = tail call i32 @wait_clocks(i32 1000)
%2 = tail call i32 (...) @input_a()
%3 = icmp eq i32 %2, 1
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @wait_clocks(i32 1000)
%7 = tail call i32 (...) @input_a()
%8 = icmp eq i32 %7, 2
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = tail call i32 @wait_clocks(i32 1000)
%12 = tail call i32 (...) @input_a()
%13 = icmp eq i32 %12, 3
%14 = zext i1 %13 to i32
%15 = tail call i32 @assert(i32 %14)
%16 = tail call i32 @wait_clocks(i32 1000)
%17 = tail call i32 (...) @input_a()
%18 = icmp eq i32 %17, 4
%19 = zext i1 %18 to i32
%20 = tail call i32 @assert(i32 %19)
%21 = tail call i32 @wait_clocks(i32 1000)
%22 = tail call i32 (...) @input_a()
%23 = icmp eq i32 %22, 5
%24 = zext i1 %23 to i32
%25 = tail call i32 @assert(i32 %24)
%26 = tail call i32 @wait_clocks(i32 1000)
%27 = tail call i32 (...) @input_a()
%28 = icmp eq i32 %27, 6
%29 = zext i1 %28 to i32
%30 = tail call i32 @assert(i32 %29)
%31 = tail call i32 @wait_clocks(i32 1000)
%32 = tail call i32 (...) @input_a()
%33 = icmp eq i32 %32, 7
%34 = zext i1 %33 to i32
%35 = tail call i32 @assert(i32 %34)
%36 = tail call i32 @wait_clocks(i32 1000)
%37 = tail call i32 (...) @input_a()
%38 = icmp eq i32 %37, 8
%39 = zext i1 %38 to i32
%40 = tail call i32 @assert(i32 %39)
%41 = tail call i32 @wait_clocks(i32 1000)
%42 = tail call i32 (...) @input_a()
%43 = icmp eq i32 %42, 9
%44 = zext i1 %43 to i32
%45 = tail call i32 @assert(i32 %44)
%46 = tail call i32 @wait_clocks(i32 1000)
%47 = tail call i32 (...) @input_a()
%48 = icmp eq i32 %47, 10
%49 = zext i1 %48 to i32
%50 = tail call i32 @assert(i32 %49)
%51 = tail call i32 @report(i32 1)
ret void
}