#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 statfs {
  int f_type;
  int f_bsize;
  int f_blocks;
  int f_bfree;
  int f_bavail;
  int f_files;
  int f_ffree;
  int f_namelen;
  int f_frsize;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, ...);
int /*<<< orphan*/ statfs(char *, struct statfs *);
int main(int argc, char *argv[]) {
  struct statfs st;
  statfs("/", &st);
  printf("Type of filesystem (see below)            : %#lX\n", st.f_type);
  printf("Optimal transfer block size               : %lu\n", st.f_bsize);
  printf("Total data blocks in filesystem           : %lu ~ %lu KB\n",
         st.f_blocks, st.f_blocks * st.f_bsize / 1024);
  printf("Free blocks in fs                         : %lu ~ %lu KB\n",
         st.f_bfree, st.f_bfree * st.f_bsize / 1024);
  printf("Free blocks available to unprivileged user: %lu ~ %lu KB\n",
         st.f_bavail, st.f_bavail * st.f_bsize / 1024);
  printf("Total file nodes in filesystem            : %lu\n", st.f_files);
  printf("Free file nodes in fs                     : %lu\n", st.f_ffree);
  printf("Maximum length of filenames               : %lu\n", st.f_namelen);
  printf("Fragment size (since Linux 2.6)           : %lu\n", st.f_frsize);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x38(%rbp),%rsi
call   1040 <statfs@plt>
mov    -0x38(%rbp),%esi
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x34(%rbp),%esi
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x30(%rbp),%esi
mov    -0x30(%rbp),%eax
imul   -0x34(%rbp),%eax
mov    $0x400,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
lea    0xee2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x2c(%rbp),%esi
mov    -0x2c(%rbp),%eax
imul   -0x34(%rbp),%eax
mov    $0x400,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%esi
mov    -0x28(%rbp),%eax
imul   -0x34(%rbp),%eax
mov    $0x400,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
lea    0xf12(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%esi
lea    0xf3b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%esi
lea    0xf5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xf7b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xf9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
lea    0xed5(%rip),%rdi
mov    %rsp,%rsi
call   1040 <statfs@plt>
mov    (%rsp),%esi
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rsp),%esi
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%eax
imul   %esi,%eax
lea    0x3ff(%rax),%edx
test   %eax,%eax
cmovns %eax,%edx
sar    $0xa,%edx
lea    0xeef(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
mov    0x4(%rsp),%eax
imul   %esi,%eax
lea    0x3ff(%rax),%edx
test   %eax,%eax
cmovns %eax,%edx
sar    $0xa,%edx
lea    0xf02(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x10(%rsp),%esi
mov    0x4(%rsp),%eax
imul   %esi,%eax
lea    0x3ff(%rax),%edx
test   %eax,%eax
cmovns %eax,%edx
sar    $0xa,%edx
lea    0xf15(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x14(%rsp),%esi
lea    0xf3d(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x18(%rsp),%esi
lea    0xf5c(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x1c(%rsp),%esi
lea    0xf7b(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x20(%rsp),%esi
lea    0xf9a(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.statfs = type { i32, i32, i32, i32, i32, i32, i32, i32, i32 }
@.str = [2 x i8] c"/\00"
@.str.1 = [50 x i8] c"Type of filesystem (see below) : %#lX\0A\00"
@.str.2 = [49 x i8] c"Optimal transfer block size : %lu\0A\00"
@.str.3 = [58 x i8] c"Total data blocks in filesystem : %lu ~ %lu KB\0A\00"
@.str.4 = [58 x i8] c"Free blocks in fs : %lu ~ %lu KB\0A\00"
@.str.5 = [58 x i8] c"Free blocks available to unprivileged user: %lu ~ %lu KB\0A\00"
@.str.6 = [49 x i8] c"Total file nodes in filesystem : %lu\0A\00"
@.str.7 = [49 x i8] c"Free file nodes in fs : %lu\0A\00"
@.str.8 = [49 x i8] c"Maximum length of filenames : %lu\0A\00"
@.str.9 = [49 x i8] c"Fragment size (since Linux 2.6) : %lu\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.statfs
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @statfs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %struct.statfs* %6)
%8 = getelementptr inbounds %struct.statfs, %struct.statfs* %6, i32 0, i32 0
%9 = load i32, i32* %8
%10 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = getelementptr inbounds %struct.statfs, %struct.statfs* %6, i32 0, i32 1
%12 = load i32, i32* %11
%13 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0), i32 %12)
%14 = getelementptr inbounds %struct.statfs, %struct.statfs* %6, i32 0, i32 2
%15 = load i32, i32* %14
%16 = getelementptr inbounds %struct.statfs, %struct.statfs* %6, i32 0, i32 2
%17 = load i32, i32* %16
%18 = getelementptr inbounds %struct.statfs, %struct.statfs* %6, i32 0, i32 1
%19 = load i32, i32* %18
%20 = mul nsw i32 %17, %19
%21 = sdiv i32 %20, 1024
%22 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.3, i64 0, i64 0), i32 %15, i32 %21)
%23 = getelementptr inbounds %struct.statfs, %struct.statfs* %6, i32 0, i32 3
%24 = load i32, i32* %23
%25 = getelementptr inbounds %struct.statfs, %struct.statfs* %6, i32 0, i32 3
%26 = load i32, i32* %25
%27 = getelementptr inbounds %struct.statfs, %struct.statfs* %6, i32 0, i32 1
%28 = load i32, i32* %27
%29 = mul nsw i32 %26, %28
%30 = sdiv i32 %29, 1024
%31 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.4, i64 0, i64 0), i32 %24, i32 %30)
%32 = getelementptr inbounds %struct.statfs, %struct.statfs* %6, i32 0, i32 4
%33 = load i32, i32* %32
%34 = getelementptr inbounds %struct.statfs, %struct.statfs* %6, i32 0, i32 4
%35 = load i32, i32* %34
%36 = getelementptr inbounds %struct.statfs, %struct.statfs* %6, i32 0, i32 1
%37 = load i32, i32* %36
%38 = mul nsw i32 %35, %37
%39 = sdiv i32 %38, 1024
%40 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.5, i64 0, i64 0), i32 %33, i32 %39)
%41 = getelementptr inbounds %struct.statfs, %struct.statfs* %6, i32 0, i32 5
%42 = load i32, i32* %41
%43 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.6, i64 0, i64 0), i32 %42)
%44 = getelementptr inbounds %struct.statfs, %struct.statfs* %6, i32 0, i32 6
%45 = load i32, i32* %44
%46 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.7, i64 0, i64 0), i32 %45)
%47 = getelementptr inbounds %struct.statfs, %struct.statfs* %6, i32 0, i32 7
%48 = load i32, i32* %47
%49 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.8, i64 0, i64 0), i32 %48)
%50 = getelementptr inbounds %struct.statfs, %struct.statfs* %6, i32 0, i32 8
%51 = load i32, i32* %50
%52 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.9, i64 0, i64 0), i32 %51)
ret i32 0
}

LLVM IR (-O2):
%struct.statfs = type { i32, i32, i32, i32, i32, i32, i32, i32, i32 }
@.str = [2 x i8] c"/\00"
@.str.1 = [50 x i8] c"Type of filesystem (see below) : %#lX\0A\00"
@.str.2 = [49 x i8] c"Optimal transfer block size : %lu\0A\00"
@.str.3 = [58 x i8] c"Total data blocks in filesystem : %lu ~ %lu KB\0A\00"
@.str.4 = [58 x i8] c"Free blocks in fs : %lu ~ %lu KB\0A\00"
@.str.5 = [58 x i8] c"Free blocks available to unprivileged user: %lu ~ %lu KB\0A\00"
@.str.6 = [49 x i8] c"Total file nodes in filesystem : %lu\0A\00"
@.str.7 = [49 x i8] c"Free file nodes in fs : %lu\0A\00"
@.str.8 = [49 x i8] c"Maximum length of filenames : %lu\0A\00"
@.str.9 = [49 x i8] c"Fragment size (since Linux 2.6) : %lu\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.statfs
%4 = bitcast %struct.statfs* %3 to i8*
%5 = call i32 @statfs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %struct.statfs* %3)
%6 = getelementptr inbounds %struct.statfs, %struct.statfs* %3, i64 0, i32 0
%7 = load i32, i32* %6
%8 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = getelementptr inbounds %struct.statfs, %struct.statfs* %3, i64 0, i32 1
%10 = load i32, i32* %9
%11 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0), i32 %10)
%12 = getelementptr inbounds %struct.statfs, %struct.statfs* %3, i64 0, i32 2
%13 = load i32, i32* %12
%14 = load i32, i32* %9
%15 = mul nsw i32 %14, %13
%16 = sdiv i32 %15, 1024
%17 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.3, i64 0, i64 0), i32 %13, i32 %16)
%18 = getelementptr inbounds %struct.statfs, %struct.statfs* %3, i64 0, i32 3
%19 = load i32, i32* %18
%20 = load i32, i32* %9
%21 = mul nsw i32 %20, %19
%22 = sdiv i32 %21, 1024
%23 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.4, i64 0, i64 0), i32 %19, i32 %22)
%24 = getelementptr inbounds %struct.statfs, %struct.statfs* %3, i64 0, i32 4
%25 = load i32, i32* %24
%26 = load i32, i32* %9
%27 = mul nsw i32 %26, %25
%28 = sdiv i32 %27, 1024
%29 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.5, i64 0, i64 0), i32 %25, i32 %28)
%30 = getelementptr inbounds %struct.statfs, %struct.statfs* %3, i64 0, i32 5
%31 = load i32, i32* %30
%32 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.6, i64 0, i64 0), i32 %31)
%33 = getelementptr inbounds %struct.statfs, %struct.statfs* %3, i64 0, i32 6
%34 = load i32, i32* %33
%35 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.7, i64 0, i64 0), i32 %34)
%36 = getelementptr inbounds %struct.statfs, %struct.statfs* %3, i64 0, i32 7
%37 = load i32, i32* %36
%38 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.8, i64 0, i64 0), i32 %37)
%39 = getelementptr inbounds %struct.statfs, %struct.statfs* %3, i64 0, i32 8
%40 = load i32, i32* %39
%41 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.9, i64 0, i64 0), i32 %40)
ret i32 0
}