#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 */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  void *repeat;
  void *data_out;
  void *data_in;
  void *data_size_out;
  void *data_size_in;
  void *prog_fd;
};
union bpf_attr {
  TYPE_1__ test;
};
typedef void *__u64;
typedef void *__u32;

/* Variables and functions */
void bpf_attr_setup_prog_run(union bpf_attr *attr, __u32 prog_fd,
                             __u32 data_size_in, void *data_in,
                             __u32 data_size_out, void *data_out,
                             __u32 repeat) {
  attr->test.prog_fd = prog_fd;
  attr->test.data_size_in = data_size_in;
  attr->test.data_size_out = data_size_out;
  attr->test.data_in = (__u64)(unsigned long)data_in;
  attr->test.data_out = (__u64)(unsigned long)data_out;
  attr->test.repeat = repeat;
}


x86 assembly (clang, -O0):
<bpf_attr_setup_prog_run>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x28(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x20(%rax)
mov    -0x28(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x18(%rax)
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0x30(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_attr_setup_prog_run>:
mov    0x8(%rsp),%rax
mov    %rsi,0x28(%rdi)
mov    %rdx,0x20(%rdi)
mov    %r8,0x18(%rdi)
mov    %rcx,0x10(%rdi)
mov    %r9,0x8(%rdi)
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
%union.bpf_attr = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i8*, i8*, i8*, i8*, i8*, i8* }
define void @bpf_attr_setup_prog_run(%union.bpf_attr* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i8* %6) {
%8 = alloca %union.bpf_attr*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
store %union.bpf_attr* %0, %union.bpf_attr** %8
store i8* %1, i8** %9
store i8* %2, i8** %10
store i8* %3, i8** %11
store i8* %4, i8** %12
store i8* %5, i8** %13
store i8* %6, i8** %14
%15 = load i8*, i8** %9
%16 = load %union.bpf_attr*, %union.bpf_attr** %8
%17 = bitcast %union.bpf_attr* %16 to %struct.TYPE_2__*
%18 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %17, i32 0, i32 5
store i8* %15, i8** %18
%19 = load i8*, i8** %10
%20 = load %union.bpf_attr*, %union.bpf_attr** %8
%21 = bitcast %union.bpf_attr* %20 to %struct.TYPE_2__*
%22 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %21, i32 0, i32 4
store i8* %19, i8** %22
%23 = load i8*, i8** %12
%24 = load %union.bpf_attr*, %union.bpf_attr** %8
%25 = bitcast %union.bpf_attr* %24 to %struct.TYPE_2__*
%26 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %25, i32 0, i32 3
store i8* %23, i8** %26
%27 = load i8*, i8** %11
%28 = ptrtoint i8* %27 to i64
%29 = inttoptr i64 %28 to i8*
%30 = load %union.bpf_attr*, %union.bpf_attr** %8
%31 = bitcast %union.bpf_attr* %30 to %struct.TYPE_2__*
%32 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %31, i32 0, i32 2
store i8* %29, i8** %32
%33 = load i8*, i8** %13
%34 = ptrtoint i8* %33 to i64
%35 = inttoptr i64 %34 to i8*
%36 = load %union.bpf_attr*, %union.bpf_attr** %8
%37 = bitcast %union.bpf_attr* %36 to %struct.TYPE_2__*
%38 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %37, i32 0, i32 1
store i8* %35, i8** %38
%39 = load i8*, i8** %14
%40 = load %union.bpf_attr*, %union.bpf_attr** %8
%41 = bitcast %union.bpf_attr* %40 to %struct.TYPE_2__*
%42 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %41, i32 0, i32 0
store i8* %39, i8** %42
ret void
}

LLVM IR (-O2):
%union.bpf_attr = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i8*, i8*, i8*, i8*, i8*, i8* }
define void @bpf_attr_setup_prog_run(%union.bpf_attr* nocapture writeonly %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i8* %6) {
%8 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %0, i64 0, i32 0, i32 5
store i8* %1, i8** %8
%9 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %0, i64 0, i32 0, i32 4
store i8* %2, i8** %9
%10 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %0, i64 0, i32 0, i32 3
store i8* %4, i8** %10
%11 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %0, i64 0, i32 0, i32 2
store i8* %3, i8** %11
%12 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %0, i64 0, i32 0, i32 1
store i8* %5, i8** %12
%13 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %0, i64 0, i32 0, i32 0
store i8* %6, i8** %13
ret void
}