#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 statvfs {
  unsigned int f_bsize;
  unsigned int f_frsize;
  unsigned int f_fsid;
  unsigned int f_flag;
  unsigned int f_namemax;
  scalar_t__ f_favail;
  scalar_t__ f_ffree;
  scalar_t__ f_files;
  scalar_t__ f_bfree;
  scalar_t__ f_bavail;
  scalar_t__ f_blocks;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
int statvfs(char *, struct statvfs *);
int main(int argc, char *argv[]) {
  struct statvfs statvfsbuf;
  if (statvfs("/", &statvfsbuf) != -1) {
    printf("File system block size: %lu bytes\n", statvfsbuf.f_bsize);
    printf("File system fundamental block size: %lu bytes\n",
           statvfsbuf.f_frsize);
    printf("Total number of blocks in file system: %u\n",
           (unsigned int)statvfsbuf.f_blocks);
    printf("Total number of available blocks: %u\n",
           (unsigned int)statvfsbuf.f_bavail);
    printf("Total number of free blocks: %u\n",
           (unsigned int)statvfsbuf.f_bfree);
    printf("Total number of i-nodes: %u\n", (unsigned int)statvfsbuf.f_files);
    printf("Total number of free i-nodes: %u\n",
           (unsigned int)statvfsbuf.f_ffree);
    printf("i-nodes available to unprivileged process: %u\n",
           (unsigned int)statvfsbuf.f_favail);
    printf("File system id: %lu\n", statvfsbuf.f_fsid);
    printf("Mount flags: %lu\n", statvfsbuf.f_flag);
    printf("Maximum length of file names on this file system : %lu\n",
           statvfsbuf.f_namemax);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x58(%rbp),%rsi
call   1040 <statvfs@plt>
cmp    $0xffffffff,%eax
je     1206 <main+0xe6>
mov    -0x58(%rbp),%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x54(%rbp),%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    %eax,%esi
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
mov    %eax,%esi
lea    0xef3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
mov    %eax,%esi
lea    0xf07(%rip),%rdi
call   1030 <printf@plt>
mov    -0x30(%rbp),%rax
mov    %eax,%esi
lea    0xf16(%rip),%rdi
call   1030 <printf@plt>
mov    -0x38(%rbp),%rax
mov    %eax,%esi
lea    0xf21(%rip),%rdi
call   1030 <printf@plt>
mov    -0x40(%rbp),%rax
mov    %eax,%esi
lea    0xf31(%rip),%rdi
call   1030 <printf@plt>
mov    -0x50(%rbp),%esi
lea    0xf51(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4c(%rbp),%esi
lea    0xf57(%rip),%rdi
call   1030 <printf@plt>
mov    -0x48(%rbp),%esi
lea    0xf5a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
lea    0xed5(%rip),%rdi
mov    %rsp,%rsi
call   1040 <statvfs@plt>
cmp    $0xffffffff,%eax
je     11eb <main+0xcb>
mov    (%rsp),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    0x4(%rsp),%esi
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
mov    0x40(%rsp),%esi
lea    0xeee(%rip),%rdi
call   1030 <printf@plt>
mov    0x38(%rsp),%esi
lea    0xf09(%rip),%rdi
call   1030 <printf@plt>
mov    0x30(%rsp),%esi
lea    0xf1f(%rip),%rdi
call   1030 <printf@plt>
mov    0x28(%rsp),%esi
lea    0xf30(%rip),%rdi
call   1030 <printf@plt>
mov    0x20(%rsp),%esi
lea    0xf3d(%rip),%rdi
call   1030 <printf@plt>
mov    0x18(%rsp),%esi
lea    0xf4f(%rip),%rdi
call   1030 <printf@plt>
mov    0x8(%rsp),%esi
lea    0xf6e(%rip),%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
lea    0xf73(%rip),%rdi
call   1030 <printf@plt>
mov    0x10(%rsp),%esi
lea    0xf75(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
%struct.statvfs = type { i32, i32, i32, i32, i32, i64, i64, i64, i64, i64, i64 }
@.str = [2 x i8] c"/\00"
@.str.1 = [35 x i8] c"File system block size: %lu bytes\0A\00"
@.str.2 = [47 x i8] c"File system fundamental block size: %lu bytes\0A\00"
@.str.3 = [43 x i8] c"Total number of blocks in file system: %u\0A\00"
@.str.4 = [38 x i8] c"Total number of available blocks: %u\0A\00"
@.str.5 = [33 x i8] c"Total number of free blocks: %u\0A\00"
@.str.6 = [29 x i8] c"Total number of i-nodes: %u\0A\00"
@.str.7 = [34 x i8] c"Total number of free i-nodes: %u\0A\00"
@.str.8 = [47 x i8] c"i-nodes available to unprivileged process: %u\0A\00"
@.str.9 = [21 x i8] c"File system id: %lu\0A\00"
@.str.10 = [18 x i8] c"Mount flags: %lu\0A\00"
@.str.11 = [56 x i8] c"Maximum length of file names on this file system : %lu\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.statvfs
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @statvfs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %struct.statvfs* %6)
%8 = icmp ne i32 %7, -1
br i1 %8, label %9, label %49
9: ; preds = %2
%10 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %6, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %6, i32 0, i32 1
%14 = load i32, i32* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), i32 %14)
%16 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %6, i32 0, i32 10
%17 = load i64, i64* %16
%18 = trunc i64 %17 to i32
%19 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), i32 %18)
%20 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %6, i32 0, i32 9
%21 = load i64, i64* %20
%22 = trunc i64 %21 to i32
%23 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), i32 %22)
%24 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %6, i32 0, i32 8
%25 = load i64, i64* %24
%26 = trunc i64 %25 to i32
%27 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i32 %26)
%28 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %6, i32 0, i32 7
%29 = load i64, i64* %28
%30 = trunc i64 %29 to i32
%31 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0), i32 %30)
%32 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %6, i32 0, i32 6
%33 = load i64, i64* %32
%34 = trunc i64 %33 to i32
%35 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0), i32 %34)
%36 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %6, i32 0, i32 5
%37 = load i64, i64* %36
%38 = trunc i64 %37 to i32
%39 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.8, i64 0, i64 0), i32 %38)
%40 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %6, i32 0, i32 2
%41 = load i32, i32* %40
%42 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), i32 %41)
%43 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %6, i32 0, i32 3
%44 = load i32, i32* %43
%45 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0), i32 %44)
%46 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %6, i32 0, i32 4
%47 = load i32, i32* %46
%48 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.11, i64 0, i64 0), i32 %47)
br label %49
49: ; preds = %9, %2
ret i32 0
}

LLVM IR (-O2):
%struct.statvfs = type { i32, i32, i32, i32, i32, i64, i64, i64, i64, i64, i64 }
@.str = [2 x i8] c"/\00"
@.str.1 = [35 x i8] c"File system block size: %lu bytes\0A\00"
@.str.2 = [47 x i8] c"File system fundamental block size: %lu bytes\0A\00"
@.str.3 = [43 x i8] c"Total number of blocks in file system: %u\0A\00"
@.str.4 = [38 x i8] c"Total number of available blocks: %u\0A\00"
@.str.5 = [33 x i8] c"Total number of free blocks: %u\0A\00"
@.str.6 = [29 x i8] c"Total number of i-nodes: %u\0A\00"
@.str.7 = [34 x i8] c"Total number of free i-nodes: %u\0A\00"
@.str.8 = [47 x i8] c"i-nodes available to unprivileged process: %u\0A\00"
@.str.9 = [21 x i8] c"File system id: %lu\0A\00"
@.str.10 = [18 x i8] c"Mount flags: %lu\0A\00"
@.str.11 = [56 x i8] c"Maximum length of file names on this file system : %lu\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.statvfs
%4 = bitcast %struct.statvfs* %3 to i8*
%5 = call i32 @statvfs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %struct.statvfs* %3)
%6 = icmp eq i32 %5, -1
br i1 %6, label %47, label %7
7: ; preds = %2
%8 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %3, i64 0, i32 0
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %3, i64 0, i32 1
%12 = load i32, i32* %11
%13 = tail call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), i32 %12)
%14 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %3, i64 0, i32 10
%15 = load i64, i64* %14
%16 = trunc i64 %15 to i32
%17 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), i32 %16)
%18 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %3, i64 0, i32 9
%19 = load i64, i64* %18
%20 = trunc i64 %19 to i32
%21 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), i32 %20)
%22 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %3, i64 0, i32 8
%23 = load i64, i64* %22
%24 = trunc i64 %23 to i32
%25 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i32 %24)
%26 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %3, i64 0, i32 7
%27 = load i64, i64* %26
%28 = trunc i64 %27 to i32
%29 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0), i32 %28)
%30 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %3, i64 0, i32 6
%31 = load i64, i64* %30
%32 = trunc i64 %31 to i32
%33 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0), i32 %32)
%34 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %3, i64 0, i32 5
%35 = load i64, i64* %34
%36 = trunc i64 %35 to i32
%37 = tail call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.8, i64 0, i64 0), i32 %36)
%38 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %3, i64 0, i32 2
%39 = load i32, i32* %38
%40 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), i32 %39)
%41 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %3, i64 0, i32 3
%42 = load i32, i32* %41
%43 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0), i32 %42)
%44 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %3, i64 0, i32 4
%45 = load i32, i32* %44
%46 = tail call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.11, i64 0, i64 0), i32 %45)
br label %47
47: ; preds = %7, %2
ret i32 0
}