#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 */
typedef int /*<<< orphan*/ uid_t;
typedef int /*<<< orphan*/ time_t;
struct stat {
  int /*<<< orphan*/ st_ctime;
  int /*<<< orphan*/ st_mtime;
  int /*<<< orphan*/ st_atime;
  int /*<<< orphan*/ st_size;
  int /*<<< orphan*/ st_gid;
  int /*<<< orphan*/ st_uid;
  int /*<<< orphan*/ st_nlink;
  scalar_t__ st_dev;
  int /*<<< orphan*/ st_ino;
  int /*<<< orphan*/ st_mode;
};
typedef int /*<<< orphan*/ off_t;
typedef int /*<<< orphan*/ nlink_t;
typedef int /*<<< orphan*/ mode_t;
typedef int /*<<< orphan*/ ino_t;
typedef int /*<<< orphan*/ gid_t;
typedef scalar_t__ dev_t;

/* Variables and functions */
void assign_stat_fields(struct stat *buf, mode_t *mode, ino_t *ino, dev_t *dev,
                        nlink_t *nlink, uid_t *uid, gid_t *gid, off_t *size,
                        time_t *atime, time_t *mtime, time_t *ctime,
                        dev_t *rdev, long *blksize, long *blocks) {
  *mode = buf->st_mode;
  *ino = buf->st_ino;
  *dev = buf->st_dev;
  *nlink = buf->st_nlink;
  *uid = buf->st_uid;
  *gid = buf->st_gid;
  *size = buf->st_size;
  *atime = buf->st_atime;
  *mtime = buf->st_mtime;
  *ctime = buf->st_ctime;
  *rdev = 0;
}


x86 assembly (clang, -O0):
<assign_stat_fields>:
push   %rbp
mov    %rsp,%rbp
mov    0x48(%rbp),%rax
mov    0x40(%rbp),%rax
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
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    -0x8(%rbp),%rax
mov    0x2c(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x28(%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%ecx
mov    0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%ecx
mov    0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
mov    0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
mov    0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    0x30(%rbp),%rax
mov    %ecx,(%rax)
mov    0x38(%rbp),%rax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<assign_stat_fields>:
push   %rbp
push   %r15
push   %r14
push   %rbx
mov    0x50(%rsp),%r10
mov    0x48(%rsp),%r11
mov    0x40(%rsp),%r14
mov    0x38(%rsp),%r15
mov    0x30(%rsp),%rax
mov    0x28(%rsp),%rbx
mov    0x2c(%rdi),%ebp
mov    %ebp,(%rsi)
mov    0x28(%rdi),%esi
mov    %esi,(%rdx)
mov    0x20(%rdi),%rdx
mov    %rdx,(%rcx)
mov    0x18(%rdi),%ecx
mov    %ecx,(%r8)
mov    0x14(%rdi),%ecx
mov    %ecx,(%r9)
mov    0x10(%rdi),%ecx
mov    %ecx,(%rbx)
mov    0xc(%rdi),%ecx
mov    %ecx,(%rax)
mov    0x8(%rdi),%eax
mov    %eax,(%r15)
mov    0x4(%rdi),%eax
mov    %eax,(%r14)
mov    (%rdi),%eax
mov    %eax,(%r11)
movq   $0x0,(%r10)
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.stat = type { i32, i32, i32, i32, i32, i32, i32, i64, i32, i32 }
define void @assign_stat_fields(%struct.stat* %0, i32* %1, i32* %2, i64* %3, i32* %4, i32* %5, i32* %6, i32* %7, i32* %8, i32* %9, i32* %10, i64* %11, i64* %12, i64* %13) {
%15 = alloca %struct.stat*
%16 = alloca i32*
%17 = alloca i32*
%18 = alloca i64*
%19 = alloca i32*
%20 = alloca i32*
%21 = alloca i32*
%22 = alloca i32*
%23 = alloca i32*
%24 = alloca i32*
%25 = alloca i32*
%26 = alloca i64*
%27 = alloca i64*
%28 = alloca i64*
store %struct.stat* %0, %struct.stat** %15
store i32* %1, i32** %16
store i32* %2, i32** %17
store i64* %3, i64** %18
store i32* %4, i32** %19
store i32* %5, i32** %20
store i32* %6, i32** %21
store i32* %7, i32** %22
store i32* %8, i32** %23
store i32* %9, i32** %24
store i32* %10, i32** %25
store i64* %11, i64** %26
store i64* %12, i64** %27
store i64* %13, i64** %28
%29 = load %struct.stat*, %struct.stat** %15
%30 = getelementptr inbounds %struct.stat, %struct.stat* %29, i32 0, i32 9
%31 = load i32, i32* %30
%32 = load i32*, i32** %16
store i32 %31, i32* %32
%33 = load %struct.stat*, %struct.stat** %15
%34 = getelementptr inbounds %struct.stat, %struct.stat* %33, i32 0, i32 8
%35 = load i32, i32* %34
%36 = load i32*, i32** %17
store i32 %35, i32* %36
%37 = load %struct.stat*, %struct.stat** %15
%38 = getelementptr inbounds %struct.stat, %struct.stat* %37, i32 0, i32 7
%39 = load i64, i64* %38
%40 = load i64*, i64** %18
store i64 %39, i64* %40
%41 = load %struct.stat*, %struct.stat** %15
%42 = getelementptr inbounds %struct.stat, %struct.stat* %41, i32 0, i32 6
%43 = load i32, i32* %42
%44 = load i32*, i32** %19
store i32 %43, i32* %44
%45 = load %struct.stat*, %struct.stat** %15
%46 = getelementptr inbounds %struct.stat, %struct.stat* %45, i32 0, i32 5
%47 = load i32, i32* %46
%48 = load i32*, i32** %20
store i32 %47, i32* %48
%49 = load %struct.stat*, %struct.stat** %15
%50 = getelementptr inbounds %struct.stat, %struct.stat* %49, i32 0, i32 4
%51 = load i32, i32* %50
%52 = load i32*, i32** %21
store i32 %51, i32* %52
%53 = load %struct.stat*, %struct.stat** %15
%54 = getelementptr inbounds %struct.stat, %struct.stat* %53, i32 0, i32 3
%55 = load i32, i32* %54
%56 = load i32*, i32** %22
store i32 %55, i32* %56
%57 = load %struct.stat*, %struct.stat** %15
%58 = getelementptr inbounds %struct.stat, %struct.stat* %57, i32 0, i32 2
%59 = load i32, i32* %58
%60 = load i32*, i32** %23
store i32 %59, i32* %60
%61 = load %struct.stat*, %struct.stat** %15
%62 = getelementptr inbounds %struct.stat, %struct.stat* %61, i32 0, i32 1
%63 = load i32, i32* %62
%64 = load i32*, i32** %24
store i32 %63, i32* %64
%65 = load %struct.stat*, %struct.stat** %15
%66 = getelementptr inbounds %struct.stat, %struct.stat* %65, i32 0, i32 0
%67 = load i32, i32* %66
%68 = load i32*, i32** %25
store i32 %67, i32* %68
%69 = load i64*, i64** %26
store i64 0, i64* %69
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32, i32, i32, i32, i32, i32, i32, i64, i32, i32 }
define void @assign_stat_fields(%struct.stat* nocapture %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i64* nocapture writeonly %3, i32* nocapture writeonly %4, i32* nocapture writeonly %5, i32* nocapture writeonly %6, i32* nocapture writeonly %7, i32* nocapture writeonly %8, i32* nocapture writeonly %9, i32* nocapture writeonly %10, i64* nocapture writeonly %11, i64* nocapture readnone %12, i64* nocapture readnone %13) {
%15 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 9
%16 = load i32, i32* %15
store i32 %16, i32* %1
%17 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 8
%18 = load i32, i32* %17
store i32 %18, i32* %2
%19 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 7
%20 = load i64, i64* %19
store i64 %20, i64* %3
%21 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 6
%22 = load i32, i32* %21
store i32 %22, i32* %4
%23 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 5
%24 = load i32, i32* %23
store i32 %24, i32* %5
%25 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 4
%26 = load i32, i32* %25
store i32 %26, i32* %6
%27 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 3
%28 = load i32, i32* %27
store i32 %28, i32* %7
%29 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 2
%30 = load i32, i32* %29
store i32 %30, i32* %8
%31 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 1
%32 = load i32, i32* %31
store i32 %32, i32* %9
%33 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 0
%34 = load i32, i32* %33
store i32 %34, i32* %10
store i64 0, i64* %11
ret void
}