#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 statvfs {
  int /*<<< orphan*/ f_namemax;
  int /*<<< orphan*/ f_flag;
  int /*<<< orphan*/ f_fsid;
  scalar_t__ f_favail;
  int /*<<< orphan*/ f_ffree;
  int /*<<< orphan*/ f_files;
  int /*<<< orphan*/ f_bavail;
  int /*<<< orphan*/ f_bfree;
  int /*<<< orphan*/ f_blocks;
  int /*<<< orphan*/ f_frsize;
  int /*<<< orphan*/ f_bsize;
};
struct TYPE_2__ {
  int /*<<< orphan*/ *__val;
};
struct statfs {
  int /*<<< orphan*/ f_namelen;
  int /*<<< orphan*/ f_flags;
  TYPE_1__ f_fsid;
  int /*<<< orphan*/ f_ffree;
  int /*<<< orphan*/ f_files;
  int /*<<< orphan*/ f_bavail;
  int /*<<< orphan*/ f_bfree;
  int /*<<< orphan*/ f_blocks;
  int /*<<< orphan*/ f_bsize;
};

/* Variables and functions */
void fixup(struct statvfs *out, const struct statfs *in) {
  out->f_bsize = in->f_bsize;
  out->f_frsize = in->f_bsize;
  out->f_blocks = in->f_blocks;
  out->f_bfree = in->f_bfree;
  out->f_bavail = in->f_bavail;
  out->f_files = in->f_files;
  out->f_ffree = in->f_ffree;
  out->f_favail = 0;
  out->f_fsid = in->f_fsid.__val[0];
  out->f_flag = in->f_flags;
  out->f_namemax = in->f_namelen;
}


x86 assembly (clang, -O0):
<fixup>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x24(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x30(%rax)
mov    -0x10(%rbp),%rax
mov    0x24(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x2c(%rax)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x28(%rax)
mov    -0x10(%rbp),%rax
mov    0x1c(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x24(%rax)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x20(%rax)
mov    -0x10(%rbp),%rax
mov    0x14(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x1c(%rax)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x18(%rax)
mov    -0x8(%rbp),%rax
movq   $0x0,0x10(%rax)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixup>:
mov    0x24(%rsi),%eax
mov    %eax,0x30(%rdi)
mov    %eax,0x2c(%rdi)
mov    0x20(%rsi),%eax
mov    %eax,0x28(%rdi)
movups 0x10(%rsi),%xmm0
movups %xmm0,0x18(%rdi)
movq   $0x0,0x10(%rdi)
mov    0x8(%rsi),%rax
mov    (%rax),%eax
mov    %eax,0x8(%rdi)
mov    0x4(%rsi),%eax
mov    %eax,0x4(%rdi)
mov    (%rsi),%eax
mov    %eax,(%rdi)
ret

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

LLVM IR (-O2):
%struct.statvfs = type { i32, i32, i32, i64, i32, i32, i32, i32, i32, i32, i32 }
%struct.statfs = type { i32, i32, %struct.TYPE_2__, i32, i32, i32, i32, i32, i32 }
%struct.TYPE_2__ = type { i32* }
define void @fixup(%struct.statvfs* nocapture writeonly %0, %struct.statfs* nocapture %1) {
%3 = getelementptr inbounds %struct.statfs, %struct.statfs* %1, i64 0, i32 8
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %0, i64 0, i32 10
store i32 %4, i32* %5
%6 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %0, i64 0, i32 9
store i32 %4, i32* %6
%7 = getelementptr inbounds %struct.statfs, %struct.statfs* %1, i64 0, i32 7
%8 = load i32, i32* %7
%9 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %0, i64 0, i32 8
store i32 %8, i32* %9
%10 = getelementptr inbounds %struct.statfs, %struct.statfs* %1, i64 0, i32 3
%11 = bitcast i32* %10 to <4 x i32>*
%12 = load <4 x i32>, <4 x i32>* %11
%13 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %0, i64 0, i32 4
%14 = bitcast i32* %13 to <4 x i32>*
store <4 x i32> %12, <4 x i32>* %14
%15 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %0, i64 0, i32 3
store i64 0, i64* %15
%16 = getelementptr inbounds %struct.statfs, %struct.statfs* %1, i64 0, i32 2, i32 0
%17 = load i32*, i32** %16
%18 = load i32, i32* %17
%19 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %0, i64 0, i32 2
store i32 %18, i32* %19
%20 = getelementptr inbounds %struct.statfs, %struct.statfs* %1, i64 0, i32 1
%21 = load i32, i32* %20
%22 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %0, i64 0, i32 1
store i32 %21, i32* %22
%23 = getelementptr inbounds %struct.statfs, %struct.statfs* %1, i64 0, i32 0
%24 = load i32, i32* %23
%25 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %0, i64 0, i32 0
store i32 %24, i32* %25
ret void
}