#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 check_bitstream(int, int);
int check_cabac(int, int);
int check_dct(int, int);
int check_deblock(int, int);
int check_intra(int, int);
int check_mc(int, int);
int check_pixel(int, int);
int check_quant(int, int);
int check_all_funcs(int cpu_ref, int cpu_new) {
  return check_pixel(cpu_ref, cpu_new) + check_dct(cpu_ref, cpu_new) +
         check_mc(cpu_ref, cpu_new) + check_intra(cpu_ref, cpu_new) +
         check_deblock(cpu_ref, cpu_new) + check_quant(cpu_ref, cpu_new) +
         check_cabac(cpu_ref, cpu_new) + check_bitstream(cpu_ref, cpu_new);
}


x86 assembly (clang, -O0):
<check_all_funcs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1090 <check_pixel@plt>
mov    %eax,-0x24(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1060 <check_dct@plt>
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <check_mc@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1080 <check_intra@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   10a0 <check_deblock@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1070 <check_quant@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <check_cabac@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <check_bitstream@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_all_funcs>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %esi,%r15d
mov    %edi,%r12d
call   1090 <check_pixel@plt>
mov    %eax,%r14d
mov    %r12d,%edi
mov    %r15d,%esi
call   1060 <check_dct@plt>
mov    %eax,%ebx
add    %r14d,%ebx
mov    %r12d,%edi
mov    %r15d,%esi
call   1030 <check_mc@plt>
mov    %eax,%ebp
add    %ebx,%ebp
mov    %r12d,%edi
mov    %r15d,%esi
call   1080 <check_intra@plt>
mov    %eax,%ebx
add    %ebp,%ebx
mov    %r12d,%edi
mov    %r15d,%esi
call   10a0 <check_deblock@plt>
mov    %eax,%ebp
add    %ebx,%ebp
mov    %r12d,%edi
mov    %r15d,%esi
call   1070 <check_quant@plt>
mov    %eax,%ebx
add    %ebp,%ebx
mov    %r12d,%edi
mov    %r15d,%esi
call   1040 <check_cabac@plt>
mov    %eax,%ebp
add    %ebx,%ebp
mov    %r12d,%edi
mov    %r15d,%esi
call   1050 <check_bitstream@plt>
add    %ebp,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @check_all_funcs(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @check_pixel(i32 %5, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @check_dct(i32 %8, i32 %9)
%11 = add nsw i32 %7, %10
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = call i32 @check_mc(i32 %12, i32 %13)
%15 = add nsw i32 %11, %14
%16 = load i32, i32* %3
%17 = load i32, i32* %4
%18 = call i32 @check_intra(i32 %16, i32 %17)
%19 = add nsw i32 %15, %18
%20 = load i32, i32* %3
%21 = load i32, i32* %4
%22 = call i32 @check_deblock(i32 %20, i32 %21)
%23 = add nsw i32 %19, %22
%24 = load i32, i32* %3
%25 = load i32, i32* %4
%26 = call i32 @check_quant(i32 %24, i32 %25)
%27 = add nsw i32 %23, %26
%28 = load i32, i32* %3
%29 = load i32, i32* %4
%30 = call i32 @check_cabac(i32 %28, i32 %29)
%31 = add nsw i32 %27, %30
%32 = load i32, i32* %3
%33 = load i32, i32* %4
%34 = call i32 @check_bitstream(i32 %32, i32 %33)
%35 = add nsw i32 %31, %34
ret i32 %35
}

LLVM IR (-O2):
define i32 @check_all_funcs(i32 %0, i32 %1) {
%3 = tail call i32 @check_pixel(i32 %0, i32 %1)
%4 = tail call i32 @check_dct(i32 %0, i32 %1)
%5 = add nsw i32 %4, %3
%6 = tail call i32 @check_mc(i32 %0, i32 %1)
%7 = add nsw i32 %5, %6
%8 = tail call i32 @check_intra(i32 %0, i32 %1)
%9 = add nsw i32 %7, %8
%10 = tail call i32 @check_deblock(i32 %0, i32 %1)
%11 = add nsw i32 %9, %10
%12 = tail call i32 @check_quant(i32 %0, i32 %1)
%13 = add nsw i32 %11, %12
%14 = tail call i32 @check_cabac(i32 %0, i32 %1)
%15 = add nsw i32 %13, %14
%16 = tail call i32 @check_bitstream(i32 %0, i32 %1)
%17 = add nsw i32 %15, %16
ret i32 %17
}