#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*/ mav(int, int);
int /*<<< orphan*/ msleep(int);
int main() {
  mav(0, 1000);
  mav(2, 1000);
  msleep(2000);
  mav(0, 500);
  mav(2, 1000);
  msleep(3000);
  mav(0, 1000);
  mav(2, 1000);
  msleep(1000);
  mav(0, 1000);
  mav(2, 1000);
  msleep(1000);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
mov    $0x3e8,%esi
call   1040 <mav@plt>
mov    $0x2,%edi
mov    $0x3e8,%esi
call   1040 <mav@plt>
mov    $0x7d0,%edi
call   1030 <msleep@plt>
xor    %edi,%edi
mov    $0x1f4,%esi
call   1040 <mav@plt>
mov    $0x2,%edi
mov    $0x3e8,%esi
call   1040 <mav@plt>
mov    $0xbb8,%edi
call   1030 <msleep@plt>
xor    %edi,%edi
mov    $0x3e8,%esi
call   1040 <mav@plt>
mov    $0x2,%edi
mov    $0x3e8,%esi
call   1040 <mav@plt>
mov    $0x3e8,%edi
call   1030 <msleep@plt>
xor    %edi,%edi
mov    $0x3e8,%esi
call   1040 <mav@plt>
mov    $0x2,%edi
mov    $0x3e8,%esi
call   1040 <mav@plt>
mov    $0x3e8,%edi
call   1030 <msleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0x3e8,%esi
call   1040 <mav@plt>
mov    $0x2,%edi
mov    $0x3e8,%esi
call   1040 <mav@plt>
mov    $0x7d0,%edi
call   1030 <msleep@plt>
xor    %edi,%edi
mov    $0x1f4,%esi
call   1040 <mav@plt>
mov    $0x2,%edi
mov    $0x3e8,%esi
call   1040 <mav@plt>
mov    $0xbb8,%edi
call   1030 <msleep@plt>
xor    %edi,%edi
mov    $0x3e8,%esi
call   1040 <mav@plt>
mov    $0x2,%edi
mov    $0x3e8,%esi
call   1040 <mav@plt>
mov    $0x3e8,%edi
call   1030 <msleep@plt>
xor    %edi,%edi
mov    $0x3e8,%esi
call   1040 <mav@plt>
mov    $0x2,%edi
mov    $0x3e8,%esi
call   1040 <mav@plt>
mov    $0x3e8,%edi
call   1030 <msleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @mav(i32 0, i32 1000)
%3 = call i32 @mav(i32 2, i32 1000)
%4 = call i32 @msleep(i32 2000)
%5 = call i32 @mav(i32 0, i32 500)
%6 = call i32 @mav(i32 2, i32 1000)
%7 = call i32 @msleep(i32 3000)
%8 = call i32 @mav(i32 0, i32 1000)
%9 = call i32 @mav(i32 2, i32 1000)
%10 = call i32 @msleep(i32 1000)
%11 = call i32 @mav(i32 0, i32 1000)
%12 = call i32 @mav(i32 2, i32 1000)
%13 = call i32 @msleep(i32 1000)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @mav(i32 0, i32 1000)
%2 = tail call i32 @mav(i32 2, i32 1000)
%3 = tail call i32 @msleep(i32 2000)
%4 = tail call i32 @mav(i32 0, i32 500)
%5 = tail call i32 @mav(i32 2, i32 1000)
%6 = tail call i32 @msleep(i32 3000)
%7 = tail call i32 @mav(i32 0, i32 1000)
%8 = tail call i32 @mav(i32 2, i32 1000)
%9 = tail call i32 @msleep(i32 1000)
%10 = tail call i32 @mav(i32 0, i32 1000)
%11 = tail call i32 @mav(i32 2, i32 1000)
%12 = tail call i32 @msleep(i32 1000)
ret i32 0
}