#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*/ output_z(int);
int /*<<< orphan*/ wait_clocks(int);
void producer() {
  wait_clocks(1000);
  output_z(1);
  wait_clocks(1000);
  output_z(2);
  wait_clocks(1000);
  output_z(3);
  wait_clocks(1000);
  output_z(4);
  wait_clocks(1000);
  output_z(5);
  wait_clocks(1000);
  output_z(6);
  wait_clocks(1000);
  output_z(7);
  wait_clocks(1000);
  output_z(8);
  wait_clocks(1000);
  output_z(9);
  wait_clocks(1000);
  output_z(10);
}


x86 assembly (clang, -O0):
<producer>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3e8,%edi
call   1040 <wait_clocks@plt>
mov    $0x1,%edi
call   1030 <output_z@plt>
mov    $0x3e8,%edi
call   1040 <wait_clocks@plt>
mov    $0x2,%edi
call   1030 <output_z@plt>
mov    $0x3e8,%edi
call   1040 <wait_clocks@plt>
mov    $0x3,%edi
call   1030 <output_z@plt>
mov    $0x3e8,%edi
call   1040 <wait_clocks@plt>
mov    $0x4,%edi
call   1030 <output_z@plt>
mov    $0x3e8,%edi
call   1040 <wait_clocks@plt>
mov    $0x5,%edi
call   1030 <output_z@plt>
mov    $0x3e8,%edi
call   1040 <wait_clocks@plt>
mov    $0x6,%edi
call   1030 <output_z@plt>
mov    $0x3e8,%edi
call   1040 <wait_clocks@plt>
mov    $0x7,%edi
call   1030 <output_z@plt>
mov    $0x3e8,%edi
call   1040 <wait_clocks@plt>
mov    $0x8,%edi
call   1030 <output_z@plt>
mov    $0x3e8,%edi
call   1040 <wait_clocks@plt>
mov    $0x9,%edi
call   1030 <output_z@plt>
mov    $0x3e8,%edi
call   1040 <wait_clocks@plt>
mov    $0xa,%edi
call   1030 <output_z@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<producer>:
push   %rax
mov    $0x3e8,%edi
call   1040 <wait_clocks@plt>
mov    $0x1,%edi
call   1030 <output_z@plt>
mov    $0x3e8,%edi
call   1040 <wait_clocks@plt>
mov    $0x2,%edi
call   1030 <output_z@plt>
mov    $0x3e8,%edi
call   1040 <wait_clocks@plt>
mov    $0x3,%edi
call   1030 <output_z@plt>
mov    $0x3e8,%edi
call   1040 <wait_clocks@plt>
mov    $0x4,%edi
call   1030 <output_z@plt>
mov    $0x3e8,%edi
call   1040 <wait_clocks@plt>
mov    $0x5,%edi
call   1030 <output_z@plt>
mov    $0x3e8,%edi
call   1040 <wait_clocks@plt>
mov    $0x6,%edi
call   1030 <output_z@plt>
mov    $0x3e8,%edi
call   1040 <wait_clocks@plt>
mov    $0x7,%edi
call   1030 <output_z@plt>
mov    $0x3e8,%edi
call   1040 <wait_clocks@plt>
mov    $0x8,%edi
call   1030 <output_z@plt>
mov    $0x3e8,%edi
call   1040 <wait_clocks@plt>
mov    $0x9,%edi
call   1030 <output_z@plt>
mov    $0x3e8,%edi
call   1040 <wait_clocks@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <output_z@plt>

LLVM IR (-O0):
define void @producer() {
%1 = call i32 @wait_clocks(i32 1000)
%2 = call i32 @output_z(i32 1)
%3 = call i32 @wait_clocks(i32 1000)
%4 = call i32 @output_z(i32 2)
%5 = call i32 @wait_clocks(i32 1000)
%6 = call i32 @output_z(i32 3)
%7 = call i32 @wait_clocks(i32 1000)
%8 = call i32 @output_z(i32 4)
%9 = call i32 @wait_clocks(i32 1000)
%10 = call i32 @output_z(i32 5)
%11 = call i32 @wait_clocks(i32 1000)
%12 = call i32 @output_z(i32 6)
%13 = call i32 @wait_clocks(i32 1000)
%14 = call i32 @output_z(i32 7)
%15 = call i32 @wait_clocks(i32 1000)
%16 = call i32 @output_z(i32 8)
%17 = call i32 @wait_clocks(i32 1000)
%18 = call i32 @output_z(i32 9)
%19 = call i32 @wait_clocks(i32 1000)
%20 = call i32 @output_z(i32 10)
ret void
}

LLVM IR (-O2):
define void @producer() {
%1 = tail call i32 @wait_clocks(i32 1000)
%2 = tail call i32 @output_z(i32 1)
%3 = tail call i32 @wait_clocks(i32 1000)
%4 = tail call i32 @output_z(i32 2)
%5 = tail call i32 @wait_clocks(i32 1000)
%6 = tail call i32 @output_z(i32 3)
%7 = tail call i32 @wait_clocks(i32 1000)
%8 = tail call i32 @output_z(i32 4)
%9 = tail call i32 @wait_clocks(i32 1000)
%10 = tail call i32 @output_z(i32 5)
%11 = tail call i32 @wait_clocks(i32 1000)
%12 = tail call i32 @output_z(i32 6)
%13 = tail call i32 @wait_clocks(i32 1000)
%14 = tail call i32 @output_z(i32 7)
%15 = tail call i32 @wait_clocks(i32 1000)
%16 = tail call i32 @output_z(i32 8)
%17 = tail call i32 @wait_clocks(i32 1000)
%18 = tail call i32 @output_z(i32 9)
%19 = tail call i32 @wait_clocks(i32 1000)
%20 = tail call i32 @output_z(i32 10)
ret void
}