#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 /*<<< orphan*/ ok(char *);
int ok_count();
int /*<<< orphan*/ ok_done();
int /*<<< orphan*/ ok_expect(int);
int ok_expected();
int main(void) {
  (void)(0);
  ;
  ok_expect(4);
  assert(4 == ok_expected());
  ok("beep");
  assert(1 == ok_count());
  ok("boop");
  assert(2 == ok_count());
  ok("biz");
  assert(3 == ok_count());
  ok("baz");
  assert(4 == ok_count());
  ok_done();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1030 <ok_expect@plt>
mov    $0x0,%al
call   1070 <ok_expected@plt>
mov    %eax,%ecx
mov    $0x4,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xe63(%rip),%rdi
call   1040 <ok@plt>
mov    $0x0,%al
call   1080 <ok_count@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xe3f(%rip),%rdi
call   1040 <ok@plt>
mov    $0x0,%al
call   1080 <ok_count@plt>
mov    %eax,%ecx
mov    $0x2,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xe1b(%rip),%rdi
call   1040 <ok@plt>
mov    $0x0,%al
call   1080 <ok_count@plt>
mov    %eax,%ecx
mov    $0x3,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xdf6(%rip),%rdi
call   1040 <ok@plt>
mov    $0x0,%al
call   1080 <ok_count@plt>
mov    %eax,%ecx
mov    $0x4,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    $0x0,%al
call   1060 <ok_done@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1030 <ok_expect@plt>
xor    %eax,%eax
call   1070 <ok_expected@plt>
xor    %edi,%edi
cmp    $0x4,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xe79(%rip),%rdi
call   1040 <ok@plt>
xor    %eax,%eax
call   1080 <ok_count@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xe5d(%rip),%rdi
call   1040 <ok@plt>
xor    %eax,%eax
call   1080 <ok_count@plt>
xor    %edi,%edi
cmp    $0x2,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xe41(%rip),%rdi
call   1040 <ok@plt>
xor    %eax,%eax
call   1080 <ok_count@plt>
xor    %edi,%edi
cmp    $0x3,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xe24(%rip),%rdi
call   1040 <ok@plt>
xor    %eax,%eax
call   1080 <ok_count@plt>
xor    %edi,%edi
cmp    $0x4,%eax
sete   %dil
call   1050 <assert@plt>
xor    %eax,%eax
call   1060 <ok_done@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"beep\00"
@.str.1 = [5 x i8] c"boop\00"
@.str.2 = [4 x i8] c"biz\00"
@.str.3 = [4 x i8] c"baz\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @ok_expect(i32 4)
%3 = call i32 (...) @ok_expected()
%4 = icmp eq i32 4, %3
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = call i32 @ok(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (...) @ok_count()
%9 = icmp eq i32 1, %8
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = call i32 @ok(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 (...) @ok_count()
%14 = icmp eq i32 2, %13
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = call i32 @ok(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%18 = call i32 (...) @ok_count()
%19 = icmp eq i32 3, %18
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
%22 = call i32 @ok(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%23 = call i32 (...) @ok_count()
%24 = icmp eq i32 4, %23
%25 = zext i1 %24 to i32
%26 = call i32 @assert(i32 %25)
%27 = call i32 (...) @ok_done()
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"beep\00"
@.str.1 = [5 x i8] c"boop\00"
@.str.2 = [4 x i8] c"biz\00"
@.str.3 = [4 x i8] c"baz\00"
define i32 @main() {
%1 = tail call i32 @ok_expect(i32 4)
%2 = tail call i32 (...) @ok_expected()
%3 = icmp eq i32 %2, 4
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @ok(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 (...) @ok_count()
%8 = icmp eq i32 %7, 1
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = tail call i32 @ok(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%12 = tail call i32 (...) @ok_count()
%13 = icmp eq i32 %12, 2
%14 = zext i1 %13 to i32
%15 = tail call i32 @assert(i32 %14)
%16 = tail call i32 @ok(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%17 = tail call i32 (...) @ok_count()
%18 = icmp eq i32 %17, 3
%19 = zext i1 %18 to i32
%20 = tail call i32 @assert(i32 %19)
%21 = tail call i32 @ok(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%22 = tail call i32 (...) @ok_count()
%23 = icmp eq i32 %22, 4
%24 = zext i1 %23 to i32
%25 = tail call i32 @assert(i32 %24)
%26 = tail call i32 (...) @ok_done()
ret i32 0
}