#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 aiocb {
  int aio_fildes;
  int aio_nbytes;
  char *aio_buf;
  int aio_lio_opcode;
  int /*<<< orphan*/ aio_offset;
};
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
void populate_aiocb(struct aiocb *aio, int fd, off_t offset, int bytes,
                    char *buf, int opcode) {
  aio->aio_fildes = fd;
  aio->aio_offset = offset;
  aio->aio_nbytes = bytes;
  aio->aio_buf = buf;
  aio->aio_lio_opcode = opcode;
}


x86 assembly (clang, -O0):
<populate_aiocb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x14(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x24(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<populate_aiocb>:
mov    %esi,(%rdi)
mov    %edx,0x14(%rdi)
mov    %ecx,0x4(%rdi)
mov    %r8,0x8(%rdi)
mov    %r9d,0x10(%rdi)
ret

LLVM IR (-O0):
%struct.aiocb = type { i32, i32, i8*, i32, i32 }
define void @populate_aiocb(%struct.aiocb* %0, i32 %1, i32 %2, i32 %3, i8* %4, i32 %5) {
%7 = alloca %struct.aiocb*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i32
store %struct.aiocb* %0, %struct.aiocb** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i8* %4, i8** %11
store i32 %5, i32* %12
%13 = load i32, i32* %8
%14 = load %struct.aiocb*, %struct.aiocb** %7
%15 = getelementptr inbounds %struct.aiocb, %struct.aiocb* %14, i32 0, i32 0
store i32 %13, i32* %15
%16 = load i32, i32* %9
%17 = load %struct.aiocb*, %struct.aiocb** %7
%18 = getelementptr inbounds %struct.aiocb, %struct.aiocb* %17, i32 0, i32 4
store i32 %16, i32* %18
%19 = load i32, i32* %10
%20 = load %struct.aiocb*, %struct.aiocb** %7
%21 = getelementptr inbounds %struct.aiocb, %struct.aiocb* %20, i32 0, i32 1
store i32 %19, i32* %21
%22 = load i8*, i8** %11
%23 = load %struct.aiocb*, %struct.aiocb** %7
%24 = getelementptr inbounds %struct.aiocb, %struct.aiocb* %23, i32 0, i32 2
store i8* %22, i8** %24
%25 = load i32, i32* %12
%26 = load %struct.aiocb*, %struct.aiocb** %7
%27 = getelementptr inbounds %struct.aiocb, %struct.aiocb* %26, i32 0, i32 3
store i32 %25, i32* %27
ret void
}

LLVM IR (-O2):
%struct.aiocb = type { i32, i32, i8*, i32, i32 }
define void @populate_aiocb(%struct.aiocb* nocapture writeonly %0, i32 %1, i32 %2, i32 %3, i8* %4, i32 %5) {
%7 = getelementptr inbounds %struct.aiocb, %struct.aiocb* %0, i64 0, i32 0
store i32 %1, i32* %7
%8 = getelementptr inbounds %struct.aiocb, %struct.aiocb* %0, i64 0, i32 4
store i32 %2, i32* %8
%9 = getelementptr inbounds %struct.aiocb, %struct.aiocb* %0, i64 0, i32 1
store i32 %3, i32* %9
%10 = getelementptr inbounds %struct.aiocb, %struct.aiocb* %0, i64 0, i32 2
store i8* %4, i8** %10
%11 = getelementptr inbounds %struct.aiocb, %struct.aiocb* %0, i64 0, i32 3
store i32 %5, i32* %11
ret void
}