#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 */
scalar_t__ set_adder(int);
scalar_t__ set_balance(int);
scalar_t__ set_bits(int);
scalar_t__ set_channels(int);
scalar_t__ set_speed(int);
int check_audio_ioctls(int fd_audio) {
  int err = 0;
  err += set_bits(fd_audio);
  err += set_channels(fd_audio);
  err += set_speed(fd_audio);
  err += set_adder(fd_audio);
  err += set_balance(fd_audio);
  return err;
}


x86 assembly (clang, -O0):
<check_audio_ioctls>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <set_bits@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1060 <set_channels@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <set_speed@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <set_adder@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1070 <set_balance@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_audio_ioctls>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,%r15d
call   1040 <set_bits@plt>
mov    %rax,%r14
mov    %r15d,%edi
call   1060 <set_channels@plt>
mov    %rax,%rbx
add    %r14d,%ebx
mov    %r15d,%edi
call   1050 <set_speed@plt>
mov    %rax,%rbp
add    %ebx,%ebp
mov    %r15d,%edi
call   1030 <set_adder@plt>
mov    %rax,%rbx
add    %ebp,%ebx
mov    %r15d,%edi
call   1070 <set_balance@plt>
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @check_audio_ioctls(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = call i64 @set_bits(i32 %4)
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = add nsw i64 %7, %5
%9 = trunc i64 %8 to i32
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = call i64 @set_channels(i32 %10)
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = add nsw i64 %13, %11
%15 = trunc i64 %14 to i32
store i32 %15, i32* %3
%16 = load i32, i32* %2
%17 = call i64 @set_speed(i32 %16)
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = add nsw i64 %19, %17
%21 = trunc i64 %20 to i32
store i32 %21, i32* %3
%22 = load i32, i32* %2
%23 = call i64 @set_adder(i32 %22)
%24 = load i32, i32* %3
%25 = sext i32 %24 to i64
%26 = add nsw i64 %25, %23
%27 = trunc i64 %26 to i32
store i32 %27, i32* %3
%28 = load i32, i32* %2
%29 = call i64 @set_balance(i32 %28)
%30 = load i32, i32* %3
%31 = sext i32 %30 to i64
%32 = add nsw i64 %31, %29
%33 = trunc i64 %32 to i32
store i32 %33, i32* %3
%34 = load i32, i32* %3
ret i32 %34
}

LLVM IR (-O2):
define i32 @check_audio_ioctls(i32 %0) {
%2 = tail call i64 @set_bits(i32 %0)
%3 = tail call i64 @set_channels(i32 %0)
%4 = add i64 %3, %2
%5 = tail call i64 @set_speed(i32 %0)
%6 = add i64 %4, %5
%7 = tail call i64 @set_adder(i32 %0)
%8 = add i64 %6, %7
%9 = tail call i64 @set_balance(i32 %0)
%10 = add i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}