#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 uint32_t;
struct stat {
  int st_mode;
  int st_uid;
  int st_gid;
  int st_atime;
  int st_mtime;
  int st_ctime;
  int /*<<< orphan*/ st_blocks;
  int /*<<< orphan*/ st_blksize;
  int /*<<< orphan*/ st_size;
  scalar_t__ st_rdev;
  scalar_t__ st_nlink;
  int /*<<< orphan*/ st_ino;
  scalar_t__ st_dev;
};

/* Variables and functions */
int fmt_time(int);
int /*<<< orphan*/ printf(char *, int, ...);
void dump_stat_info(const struct stat *info) {
  printf("device:\t\t0x%04x (%d)\n", (uint32_t)info->st_dev,
         (uint32_t)info->st_dev);
  printf("inode:\t\t%lu\n", info->st_ino);
  printf("mode:\t\t0%o\n", info->st_mode);
  printf("nlink:\t\t%d\n", (uint32_t)info->st_nlink);
  printf("uid:\t\t%d\n", info->st_uid);
  printf("gid:\t\t%d\n", info->st_gid);
  printf("rdev:\t\t0x%04x (%d)\n", (uint32_t)info->st_rdev,
         (uint32_t)info->st_rdev);
  printf("size:\t\t%lu\n", info->st_size);
  printf("blksize:\t%lu\n", info->st_blksize);
  printf("blocks:\t\t%lu\n", info->st_blocks);
  printf("atime:\t\t%lu (%s)\n", info->st_atime, fmt_time(info->st_atime));
  printf("mtime:\t\t%lu (%s)\n", info->st_mtime, fmt_time(info->st_mtime));
  printf("ctime:\t\t%lu (%s)\n", info->st_ctime, fmt_time(info->st_ctime));
}


x86 assembly (clang, -O0):
<dump_stat_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x40(%rax),%rax
mov    %eax,%esi
mov    -0x8(%rbp),%rax
mov    0x40(%rax),%rax
mov    %eax,%edx
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x38(%rax),%esi
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x30(%rax),%rax
mov    %eax,%esi
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%esi
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%esi
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x28(%rax),%rax
mov    %eax,%esi
mov    -0x8(%rbp),%rax
mov    0x28(%rax),%rax
mov    %eax,%edx
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%esi
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%esi
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%esi
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%edi
call   1040 <fmt_time@plt>
mov    -0x14(%rbp),%esi
mov    %eax,%edx
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%edi
call   1040 <fmt_time@plt>
mov    -0x10(%rbp),%esi
mov    %eax,%edx
lea    0xe38(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%edi
call   1040 <fmt_time@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xe21(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_stat_info>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x40(%rdi),%edx
lea    0xed0(%rip),%rdi
mov    %edx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x38(%rbx),%esi
lea    0xed3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rbx),%esi
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x30(%rbx),%esi
lea    0xecb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rbx),%esi
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rbx),%esi
lea    0xebf(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x28(%rbx),%edx
lea    0xeb8(%rip),%rdi
mov    %edx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x20(%rbx),%esi
lea    0xeb9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x1c(%rbx),%esi
lea    0xeb4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x18(%rbx),%esi
lea    0xeb1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rbx),%ebp
mov    %ebp,%edi
call   1040 <fmt_time@plt>
lea    0xea7(%rip),%rdi
mov    %ebp,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x10(%rbx),%ebp
mov    %ebp,%edi
call   1040 <fmt_time@plt>
lea    0xe9d(%rip),%rdi
mov    %ebp,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x14(%rbx),%ebx
mov    %ebx,%edi
call   1040 <fmt_time@plt>
lea    0xe93(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.stat = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i64, i32, i64 }
@.str = [22 x i8] c"device:\09\090x%04x (%d)\0A\00"
@.str.1 = [13 x i8] c"inode:\09\09%lu\0A\00"
@.str.2 = [12 x i8] c"mode:\09\090%o\0A\00"
@.str.3 = [12 x i8] c"nlink:\09\09%d\0A\00"
@.str.4 = [10 x i8] c"uid:\09\09%d\0A\00"
@.str.5 = [10 x i8] c"gid:\09\09%d\0A\00"
@.str.6 = [20 x i8] c"rdev:\09\090x%04x (%d)\0A\00"
@.str.7 = [12 x i8] c"size:\09\09%lu\0A\00"
@.str.8 = [14 x i8] c"blksize:\09%lu\0A\00"
@.str.9 = [14 x i8] c"blocks:\09\09%lu\0A\00"
@.str.10 = [18 x i8] c"atime:\09\09%lu (%s)\0A\00"
@.str.11 = [18 x i8] c"mtime:\09\09%lu (%s)\0A\00"
@.str.12 = [18 x i8] c"ctime:\09\09%lu (%s)\0A\00"
define void @dump_stat_info(%struct.stat* %0) {
%2 = alloca %struct.stat*
store %struct.stat* %0, %struct.stat** %2
%3 = load %struct.stat*, %struct.stat** %2
%4 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 12
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = load %struct.stat*, %struct.stat** %2
%8 = getelementptr inbounds %struct.stat, %struct.stat* %7, i32 0, i32 12
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %10)
%12 = load %struct.stat*, %struct.stat** %2
%13 = getelementptr inbounds %struct.stat, %struct.stat* %12, i32 0, i32 11
%14 = load i32, i32* %13
%15 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = load %struct.stat*, %struct.stat** %2
%17 = getelementptr inbounds %struct.stat, %struct.stat* %16, i32 0, i32 0
%18 = load i32, i32* %17
%19 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %18)
%20 = load %struct.stat*, %struct.stat** %2
%21 = getelementptr inbounds %struct.stat, %struct.stat* %20, i32 0, i32 10
%22 = load i64, i64* %21
%23 = trunc i64 %22 to i32
%24 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %23)
%25 = load %struct.stat*, %struct.stat** %2
%26 = getelementptr inbounds %struct.stat, %struct.stat* %25, i32 0, i32 1
%27 = load i32, i32* %26
%28 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %27)
%29 = load %struct.stat*, %struct.stat** %2
%30 = getelementptr inbounds %struct.stat, %struct.stat* %29, i32 0, i32 2
%31 = load i32, i32* %30
%32 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i32 %31)
%33 = load %struct.stat*, %struct.stat** %2
%34 = getelementptr inbounds %struct.stat, %struct.stat* %33, i32 0, i32 9
%35 = load i64, i64* %34
%36 = trunc i64 %35 to i32
%37 = load %struct.stat*, %struct.stat** %2
%38 = getelementptr inbounds %struct.stat, %struct.stat* %37, i32 0, i32 9
%39 = load i64, i64* %38
%40 = trunc i64 %39 to i32
%41 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i32 %36, i32 %40)
%42 = load %struct.stat*, %struct.stat** %2
%43 = getelementptr inbounds %struct.stat, %struct.stat* %42, i32 0, i32 8
%44 = load i32, i32* %43
%45 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i32 %44)
%46 = load %struct.stat*, %struct.stat** %2
%47 = getelementptr inbounds %struct.stat, %struct.stat* %46, i32 0, i32 7
%48 = load i32, i32* %47
%49 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i32 %48)
%50 = load %struct.stat*, %struct.stat** %2
%51 = getelementptr inbounds %struct.stat, %struct.stat* %50, i32 0, i32 6
%52 = load i32, i32* %51
%53 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0), i32 %52)
%54 = load %struct.stat*, %struct.stat** %2
%55 = getelementptr inbounds %struct.stat, %struct.stat* %54, i32 0, i32 3
%56 = load i32, i32* %55
%57 = load %struct.stat*, %struct.stat** %2
%58 = getelementptr inbounds %struct.stat, %struct.stat* %57, i32 0, i32 3
%59 = load i32, i32* %58
%60 = call i32 @fmt_time(i32 %59)
%61 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0), i32 %56, i32 %60)
%62 = load %struct.stat*, %struct.stat** %2
%63 = getelementptr inbounds %struct.stat, %struct.stat* %62, i32 0, i32 4
%64 = load i32, i32* %63
%65 = load %struct.stat*, %struct.stat** %2
%66 = getelementptr inbounds %struct.stat, %struct.stat* %65, i32 0, i32 4
%67 = load i32, i32* %66
%68 = call i32 @fmt_time(i32 %67)
%69 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0), i32 %64, i32 %68)
%70 = load %struct.stat*, %struct.stat** %2
%71 = getelementptr inbounds %struct.stat, %struct.stat* %70, i32 0, i32 5
%72 = load i32, i32* %71
%73 = load %struct.stat*, %struct.stat** %2
%74 = getelementptr inbounds %struct.stat, %struct.stat* %73, i32 0, i32 5
%75 = load i32, i32* %74
%76 = call i32 @fmt_time(i32 %75)
%77 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.12, i64 0, i64 0), i32 %72, i32 %76)
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i64, i32, i64 }
@.str = [22 x i8] c"device:\09\090x%04x (%d)\0A\00"
@.str.1 = [13 x i8] c"inode:\09\09%lu\0A\00"
@.str.2 = [12 x i8] c"mode:\09\090%o\0A\00"
@.str.3 = [12 x i8] c"nlink:\09\09%d\0A\00"
@.str.4 = [10 x i8] c"uid:\09\09%d\0A\00"
@.str.5 = [10 x i8] c"gid:\09\09%d\0A\00"
@.str.6 = [20 x i8] c"rdev:\09\090x%04x (%d)\0A\00"
@.str.7 = [12 x i8] c"size:\09\09%lu\0A\00"
@.str.8 = [14 x i8] c"blksize:\09%lu\0A\00"
@.str.9 = [14 x i8] c"blocks:\09\09%lu\0A\00"
@.str.10 = [18 x i8] c"atime:\09\09%lu (%s)\0A\00"
@.str.11 = [18 x i8] c"mtime:\09\09%lu (%s)\0A\00"
@.str.12 = [18 x i8] c"ctime:\09\09%lu (%s)\0A\00"
define void @dump_stat_info(%struct.stat* nocapture %0) {
%2 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 12
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %4)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 11
%7 = load i32, i32* %6
%8 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 0
%10 = load i32, i32* %9
%11 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %10)
%12 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 10
%13 = load i64, i64* %12
%14 = trunc i64 %13 to i32
%15 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %14)
%16 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 1
%17 = load i32, i32* %16
%18 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %17)
%19 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 2
%20 = load i32, i32* %19
%21 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i32 %20)
%22 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 9
%23 = load i64, i64* %22
%24 = trunc i64 %23 to i32
%25 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i32 %24, i32 %24)
%26 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 8
%27 = load i32, i32* %26
%28 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i32 %27)
%29 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 7
%30 = load i32, i32* %29
%31 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i32 %30)
%32 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 6
%33 = load i32, i32* %32
%34 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0), i32 %33)
%35 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 3
%36 = load i32, i32* %35
%37 = tail call i32 @fmt_time(i32 %36)
%38 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0), i32 %36, i32 %37)
%39 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 4
%40 = load i32, i32* %39
%41 = tail call i32 @fmt_time(i32 %40)
%42 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0), i32 %40, i32 %41)
%43 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 5
%44 = load i32, i32* %43
%45 = tail call i32 @fmt_time(i32 %44)
%46 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.12, i64 0, i64 0), i32 %44, i32 %45)
ret void
}