#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 */
struct sock_fprog {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ append_cpath_filter(unsigned int, struct sock_fprog *);
int /*<<< orphan*/ append_dns_filter(unsigned int, struct sock_fprog *);
int /*<<< orphan*/ append_dpath_filter(unsigned int, struct sock_fprog *);
int /*<<< orphan*/ append_filter_prefix(struct sock_fprog *);
int /*<<< orphan*/ append_filter_suffix(struct sock_fprog *);
int /*<<< orphan*/ append_inet_filter(unsigned int, struct sock_fprog *);
int /*<<< orphan*/ append_memory_filter(unsigned int, struct sock_fprog *);
int /*<<< orphan*/ append_open_filter(unsigned int, struct sock_fprog *);
int /*<<< orphan*/ append_rpath_filter(unsigned int, struct sock_fprog *);
int /*<<< orphan*/ append_stdio_filter(unsigned int, struct sock_fprog *);
void fill_filter(unsigned int scopes, struct sock_fprog *prog) {
  append_filter_prefix(prog);
  append_stdio_filter(scopes, prog);
  append_open_filter(scopes, prog);
  append_memory_filter(scopes, prog);
  append_rpath_filter(scopes, prog);
  append_cpath_filter(scopes, prog);
  append_dpath_filter(scopes, prog);
  append_inet_filter(scopes, prog);
  append_dns_filter(scopes, prog);
  append_filter_suffix(prog);
}


x86 assembly (clang, -O0):
<fill_filter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   10b0 <append_filter_prefix@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <append_stdio_filter@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1070 <append_open_filter@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   10c0 <append_memory_filter@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1080 <append_rpath_filter@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <append_cpath_filter@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <append_dpath_filter@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1060 <append_inet_filter@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   10a0 <append_dns_filter@plt>
mov    -0x10(%rbp),%rdi
call   1090 <append_filter_suffix@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_filter>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   10b0 <append_filter_prefix@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <append_stdio_filter@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1070 <append_open_filter@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   10c0 <append_memory_filter@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1080 <append_rpath_filter@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1050 <append_cpath_filter@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <append_dpath_filter@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1060 <append_inet_filter@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   10a0 <append_dns_filter@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1090 <append_filter_suffix@plt>

LLVM IR (-O0):
%struct.sock_fprog = type { i32 }
define void @fill_filter(i32 %0, %struct.sock_fprog* %1) {
%3 = alloca i32
%4 = alloca %struct.sock_fprog*
store i32 %0, i32* %3
store %struct.sock_fprog* %1, %struct.sock_fprog** %4
%5 = load %struct.sock_fprog*, %struct.sock_fprog** %4
%6 = call i32 @append_filter_prefix(%struct.sock_fprog* %5)
%7 = load i32, i32* %3
%8 = load %struct.sock_fprog*, %struct.sock_fprog** %4
%9 = call i32 @append_stdio_filter(i32 %7, %struct.sock_fprog* %8)
%10 = load i32, i32* %3
%11 = load %struct.sock_fprog*, %struct.sock_fprog** %4
%12 = call i32 @append_open_filter(i32 %10, %struct.sock_fprog* %11)
%13 = load i32, i32* %3
%14 = load %struct.sock_fprog*, %struct.sock_fprog** %4
%15 = call i32 @append_memory_filter(i32 %13, %struct.sock_fprog* %14)
%16 = load i32, i32* %3
%17 = load %struct.sock_fprog*, %struct.sock_fprog** %4
%18 = call i32 @append_rpath_filter(i32 %16, %struct.sock_fprog* %17)
%19 = load i32, i32* %3
%20 = load %struct.sock_fprog*, %struct.sock_fprog** %4
%21 = call i32 @append_cpath_filter(i32 %19, %struct.sock_fprog* %20)
%22 = load i32, i32* %3
%23 = load %struct.sock_fprog*, %struct.sock_fprog** %4
%24 = call i32 @append_dpath_filter(i32 %22, %struct.sock_fprog* %23)
%25 = load i32, i32* %3
%26 = load %struct.sock_fprog*, %struct.sock_fprog** %4
%27 = call i32 @append_inet_filter(i32 %25, %struct.sock_fprog* %26)
%28 = load i32, i32* %3
%29 = load %struct.sock_fprog*, %struct.sock_fprog** %4
%30 = call i32 @append_dns_filter(i32 %28, %struct.sock_fprog* %29)
%31 = load %struct.sock_fprog*, %struct.sock_fprog** %4
%32 = call i32 @append_filter_suffix(%struct.sock_fprog* %31)
ret void
}

LLVM IR (-O2):
%struct.sock_fprog = type { i32 }
define void @fill_filter(i32 %0, %struct.sock_fprog* %1) {
%3 = tail call i32 @append_filter_prefix(%struct.sock_fprog* %1)
%4 = tail call i32 @append_stdio_filter(i32 %0, %struct.sock_fprog* %1)
%5 = tail call i32 @append_open_filter(i32 %0, %struct.sock_fprog* %1)
%6 = tail call i32 @append_memory_filter(i32 %0, %struct.sock_fprog* %1)
%7 = tail call i32 @append_rpath_filter(i32 %0, %struct.sock_fprog* %1)
%8 = tail call i32 @append_cpath_filter(i32 %0, %struct.sock_fprog* %1)
%9 = tail call i32 @append_dpath_filter(i32 %0, %struct.sock_fprog* %1)
%10 = tail call i32 @append_inet_filter(i32 %0, %struct.sock_fprog* %1)
%11 = tail call i32 @append_dns_filter(i32 %0, %struct.sock_fprog* %1)
%12 = tail call i32 @append_filter_suffix(%struct.sock_fprog* %1)
ret void
}