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

/* Variables and functions */
int major(int /*<<< orphan*/);
int minor(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void show_stat_terse(const char *file, struct stat *st) {
  printf("%s ", file);
  printf("%lu %lu ", (unsigned long)st->st_size, (unsigned long)st->st_blocks);
  printf("%04o %u %u ", st->st_mode & 0777, st->st_uid, st->st_gid);
  printf("%llx ", (unsigned long long)st->st_dev);
  printf("%lu %lu ", (unsigned long)st->st_ino, (unsigned long)st->st_nlink);
  printf("%d %d ", major(st->st_rdev), minor(st->st_rdev));
  printf("%ld %ld %ld ", st->st_atime, st->st_mtime, st->st_ctime);
  printf("%lu\n", (unsigned long)st->st_blksize);
}


x86 assembly (clang, -O0):
<show_stat_terse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x48(%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x40(%rax),%rdx
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
and    $0x1ff,%esi
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%edx
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%ecx
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x38(%rax),%rsi
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x30(%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdx
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x24(%rax),%edi
call   1050 <major@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x24(%rax),%edi
call   1030 <minor@plt>
mov    -0x14(%rbp),%esi
mov    %eax,%edx
lea    0xe2c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%esi
mov    -0x10(%rbp),%rax
mov    0x1c(%rax),%edx
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%ecx
lea    0xe10(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
lea    0xe07(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_stat_terse>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0xebf(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x40(%rbx),%rdx
mov    0x48(%rbx),%rsi
lea    0xead(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1ff,%esi
and    (%rbx),%esi
mov    0x4(%rbx),%edx
mov    0x8(%rbx),%ecx
lea    0xe98(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x38(%rbx),%rsi
lea    0xe92(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x28(%rbx),%rdx
mov    0x30(%rbx),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x24(%rbx),%edi
call   1050 <major@plt>
mov    %eax,%ebp
mov    0x24(%rbx),%edi
call   1030 <minor@plt>
lea    0xe66(%rip),%rdi
mov    %ebp,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x20(%rbx),%esi
mov    0x18(%rbx),%ecx
mov    0x1c(%rbx),%edx
lea    0xe52(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rbx),%rsi
lea    0xe4d(%rip),%rdi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
%struct.stat = type { i32, i32, i32, i64, i32, i32, i32, i32, i64, i64, i64, i64, i64 }
@.str = [4 x i8] c"%s \00"
@.str.1 = [9 x i8] c"%lu %lu \00"
@.str.2 = [12 x i8] c"%04o %u %u \00"
@.str.3 = [6 x i8] c"%llx \00"
@.str.4 = [7 x i8] c"%d %d \00"
@.str.5 = [13 x i8] c"%ld %ld %ld \00"
@.str.6 = [5 x i8] c"%lu\0A\00"
define void @show_stat_terse(i8* %0, %struct.stat* %1) {
%3 = alloca i8*
%4 = alloca %struct.stat*
store i8* %0, i8** %3
store %struct.stat* %1, %struct.stat** %4
%5 = load i8*, i8** %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load %struct.stat*, %struct.stat** %4
%8 = getelementptr inbounds %struct.stat, %struct.stat* %7, i32 0, i32 12
%9 = load i64, i64* %8
%10 = load %struct.stat*, %struct.stat** %4
%11 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 11
%12 = load i64, i64* %11
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i64 %9, i64 %12)
%14 = load %struct.stat*, %struct.stat** %4
%15 = getelementptr inbounds %struct.stat, %struct.stat* %14, i32 0, i32 0
%16 = load i32, i32* %15
%17 = and i32 %16, 511
%18 = load %struct.stat*, %struct.stat** %4
%19 = getelementptr inbounds %struct.stat, %struct.stat* %18, i32 0, i32 1
%20 = load i32, i32* %19
%21 = load %struct.stat*, %struct.stat** %4
%22 = getelementptr inbounds %struct.stat, %struct.stat* %21, i32 0, i32 2
%23 = load i32, i32* %22
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %17, i32 %20, i32 %23)
%25 = load %struct.stat*, %struct.stat** %4
%26 = getelementptr inbounds %struct.stat, %struct.stat* %25, i32 0, i32 10
%27 = load i64, i64* %26
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i64 %27)
%29 = load %struct.stat*, %struct.stat** %4
%30 = getelementptr inbounds %struct.stat, %struct.stat* %29, i32 0, i32 9
%31 = load i64, i64* %30
%32 = load %struct.stat*, %struct.stat** %4
%33 = getelementptr inbounds %struct.stat, %struct.stat* %32, i32 0, i32 8
%34 = load i64, i64* %33
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i64 %31, i64 %34)
%36 = load %struct.stat*, %struct.stat** %4
%37 = getelementptr inbounds %struct.stat, %struct.stat* %36, i32 0, i32 7
%38 = load i32, i32* %37
%39 = call i32 @major(i32 %38)
%40 = load %struct.stat*, %struct.stat** %4
%41 = getelementptr inbounds %struct.stat, %struct.stat* %40, i32 0, i32 7
%42 = load i32, i32* %41
%43 = call i32 @minor(i32 %42)
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 %39, i32 %43)
%45 = load %struct.stat*, %struct.stat** %4
%46 = getelementptr inbounds %struct.stat, %struct.stat* %45, i32 0, i32 6
%47 = load i32, i32* %46
%48 = load %struct.stat*, %struct.stat** %4
%49 = getelementptr inbounds %struct.stat, %struct.stat* %48, i32 0, i32 5
%50 = load i32, i32* %49
%51 = load %struct.stat*, %struct.stat** %4
%52 = getelementptr inbounds %struct.stat, %struct.stat* %51, i32 0, i32 4
%53 = load i32, i32* %52
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32 %47, i32 %50, i32 %53)
%55 = load %struct.stat*, %struct.stat** %4
%56 = getelementptr inbounds %struct.stat, %struct.stat* %55, i32 0, i32 3
%57 = load i64, i64* %56
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i64 %57)
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32, i32, i32, i64, i32, i32, i32, i32, i64, i64, i64, i64, i64 }
@.str = [4 x i8] c"%s \00"
@.str.1 = [9 x i8] c"%lu %lu \00"
@.str.2 = [12 x i8] c"%04o %u %u \00"
@.str.3 = [6 x i8] c"%llx \00"
@.str.4 = [7 x i8] c"%d %d \00"
@.str.5 = [13 x i8] c"%ld %ld %ld \00"
@.str.6 = [5 x i8] c"%lu\0A\00"
define void @show_stat_terse(i8* %0, %struct.stat* nocapture %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 12
%5 = load i64, i64* %4
%6 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 11
%7 = load i64, i64* %6
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i64 %5, i64 %7)
%9 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 0
%10 = load i32, i32* %9
%11 = and i32 %10, 511
%12 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 1
%13 = load i32, i32* %12
%14 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 2
%15 = load i32, i32* %14
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %11, i32 %13, i32 %15)
%17 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 10
%18 = load i64, i64* %17
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i64 %18)
%20 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 9
%21 = load i64, i64* %20
%22 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 8
%23 = load i64, i64* %22
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i64 %21, i64 %23)
%25 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 7
%26 = load i32, i32* %25
%27 = tail call i32 @major(i32 %26)
%28 = load i32, i32* %25
%29 = tail call i32 @minor(i32 %28)
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 %27, i32 %29)
%31 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 6
%32 = load i32, i32* %31
%33 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 5
%34 = load i32, i32* %33
%35 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 4
%36 = load i32, i32* %35
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32 %32, i32 %34, i32 %36)
%38 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 3
%39 = load i64, i64* %38
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i64 %39)
ret void
}