#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 stat {
  int st_uid;
  int st_gid;
  int st_ino;
  int st_size;
  int st_dev;
  int st_blocks;
  int st_blksize;
  int st_mode;
  int st_nlink;
  int st_atime;
  int st_mtime;
  int st_ctime;
};
struct fd_info {
  int dummy;
};

/* Variables and functions */
int log_fstat(struct fd_info *info, struct stat *st) {
  st->st_uid = st->st_gid = 0x3e8;
  st->st_ino = 0xee6f8b;
  st->st_size = 0x995ead;
  st->st_dev = 0x806;
  st->st_blocks = 0x4cb8;
  st->st_blksize = 0x1000;
  st->st_mode = 0x81a4;
  st->st_nlink = 1;
  st->st_atime = 0x528162a1;
  st->st_mtime = 0x52a3e2b6;
  st->st_ctime = 0x52a3e2b6;
  return 0;
}


x86 assembly (clang, -O0):
<log_fstat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x3e8,0x4(%rax)
mov    -0x10(%rbp),%rax
movl   $0x3e8,(%rax)
mov    -0x10(%rbp),%rax
movl   $0xee6f8b,0x8(%rax)
mov    -0x10(%rbp),%rax
movl   $0x995ead,0xc(%rax)
mov    -0x10(%rbp),%rax
movl   $0x806,0x10(%rax)
mov    -0x10(%rbp),%rax
movl   $0x4cb8,0x14(%rax)
mov    -0x10(%rbp),%rax
movl   $0x1000,0x18(%rax)
mov    -0x10(%rbp),%rax
movl   $0x81a4,0x1c(%rax)
mov    -0x10(%rbp),%rax
movl   $0x1,0x20(%rax)
mov    -0x10(%rbp),%rax
movl   $0x528162a1,0x24(%rax)
mov    -0x10(%rbp),%rax
movl   $0x52a3e2b6,0x28(%rax)
mov    -0x10(%rbp),%rax
movl   $0x52a3e2b6,0x2c(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_fstat>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rsi)
movaps 0xeff(%rip),%xmm0
movups %xmm0,0x10(%rsi)
movaps 0xf04(%rip),%xmm0
movups %xmm0,0x20(%rsi)
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.fd_info = type { i32 }
%struct.stat = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
define i32 @log_fstat(%struct.fd_info* %0, %struct.stat* %1) {
%3 = alloca %struct.fd_info*
%4 = alloca %struct.stat*
store %struct.fd_info* %0, %struct.fd_info** %3
store %struct.stat* %1, %struct.stat** %4
%5 = load %struct.stat*, %struct.stat** %4
%6 = getelementptr inbounds %struct.stat, %struct.stat* %5, i32 0, i32 1
store i32 1000, i32* %6
%7 = load %struct.stat*, %struct.stat** %4
%8 = getelementptr inbounds %struct.stat, %struct.stat* %7, i32 0, i32 0
store i32 1000, i32* %8
%9 = load %struct.stat*, %struct.stat** %4
%10 = getelementptr inbounds %struct.stat, %struct.stat* %9, i32 0, i32 2
store i32 15626123, i32* %10
%11 = load %struct.stat*, %struct.stat** %4
%12 = getelementptr inbounds %struct.stat, %struct.stat* %11, i32 0, i32 3
store i32 10051245, i32* %12
%13 = load %struct.stat*, %struct.stat** %4
%14 = getelementptr inbounds %struct.stat, %struct.stat* %13, i32 0, i32 4
store i32 2054, i32* %14
%15 = load %struct.stat*, %struct.stat** %4
%16 = getelementptr inbounds %struct.stat, %struct.stat* %15, i32 0, i32 5
store i32 19640, i32* %16
%17 = load %struct.stat*, %struct.stat** %4
%18 = getelementptr inbounds %struct.stat, %struct.stat* %17, i32 0, i32 6
store i32 4096, i32* %18
%19 = load %struct.stat*, %struct.stat** %4
%20 = getelementptr inbounds %struct.stat, %struct.stat* %19, i32 0, i32 7
store i32 33188, i32* %20
%21 = load %struct.stat*, %struct.stat** %4
%22 = getelementptr inbounds %struct.stat, %struct.stat* %21, i32 0, i32 8
store i32 1, i32* %22
%23 = load %struct.stat*, %struct.stat** %4
%24 = getelementptr inbounds %struct.stat, %struct.stat* %23, i32 0, i32 9
store i32 1384211105, i32* %24
%25 = load %struct.stat*, %struct.stat** %4
%26 = getelementptr inbounds %struct.stat, %struct.stat* %25, i32 0, i32 10
store i32 1386472118, i32* %26
%27 = load %struct.stat*, %struct.stat** %4
%28 = getelementptr inbounds %struct.stat, %struct.stat* %27, i32 0, i32 11
store i32 1386472118, i32* %28
ret i32 0
}

LLVM IR (-O2):
%struct.fd_info = type { i32 }
%struct.stat = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
define i32 @log_fstat(%struct.fd_info* nocapture readnone %0, %struct.stat* nocapture writeonly %1) {
%3 = bitcast %struct.stat* %1 to <4 x i32>*
store <4 x i32> <i32 1000, i32 1000, i32 15626123, i32 10051245>, <4 x i32>* %3
%4 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 4
%5 = bitcast i32* %4 to <4 x i32>*
store <4 x i32> <i32 2054, i32 19640, i32 4096, i32 33188>, <4 x i32>* %5
%6 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 8
%7 = bitcast i32* %6 to <4 x i32>*
store <4 x i32> <i32 1, i32 1384211105, i32 1386472118, i32 1386472118>, <4 x i32>* %7
ret i32 0
}