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

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, unsigned long);
int statvfs(char *, struct statvfs *);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  struct statvfs sb;
  if (argc != 2 || strcmp(argv[1], "--help") == 0) {
    fprintf(stderr, "%s path\n", argv[0]);
    exit(1);
  }
  if (statvfs(argv[1], &sb) == -1) {
    perror("statvfs");
    exit(1);
  }
  printf("Block size                       %lu\n", sb.f_bsize);
  printf("Fundamental block size           %lu\n", sb.f_frsize);
  printf("Total blocks (in above units)    %lu\n", (unsigned long)sb.f_blocks);
  printf("Free blocks for priv. proc.      %lu\n", (unsigned long)sb.f_bfree);
  printf("Free blocks for unpriv. proc.    %lu\n", (unsigned long)sb.f_bavail);
  printf("Total number of i-nodes          %lu\n", (unsigned long)sb.f_files);
  printf("Free i-nodes for priv. proc.     %lu\n", (unsigned long)sb.f_ffree);
  printf("Free i-nodes for nonpriv. proc.  %lu\n", (unsigned long)sb.f_favail);
  printf("File system ID                   %#lx\n", sb.f_fsid);
  printf("Flags                            %#lx\n", sb.f_flag);
  printf("Maximum filename length          %lu\n", sb.f_namemax);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    119e <main+0x3e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe71(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11c4 <main+0x64>
mov    0x2e3b(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe52(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x68(%rbp),%rsi
call   1060 <statvfs@plt>
cmp    $0xffffffff,%eax
jne    11f4 <main+0x94>
lea    0xe2b(%rip),%rdi
call   1070 <perror@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    -0x68(%rbp),%rsi
lea    0xe19(%rip),%rdi
call   1030 <printf@plt>
mov    -0x60(%rbp),%rsi
lea    0xe2f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xe45(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rsi
lea    0xe5b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%rsi
lea    0xe71(%rip),%rdi
call   1030 <printf@plt>
mov    -0x30(%rbp),%rsi
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
mov    -0x38(%rbp),%rsi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x40(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x58(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x50(%rbp),%rsi
lea    0xee0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x48(%rbp),%rsi
lea    0xef7(%rip),%rdi
call   1030 <printf@plt>
mov    0x2d2d(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x60,%rsp
mov    %rsi,%rbx
cmp    $0x2,%edi
jne    1182 <main+0x22>
mov    0x8(%rbx),%rdi
lea    0xe88(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    11a4 <main+0x44>
mov    0x2e57(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xe72(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    0x8(%rbx),%rdi
lea    0x8(%rsp),%rsi
call   1060 <statvfs@plt>
cmp    $0xffffffff,%eax
jne    11cd <main+0x6d>
lea    0xe52(%rip),%rdi
call   1070 <perror@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    0x8(%rsp),%rsi
lea    0xe3f(%rip),%rdi
call   1030 <printf@plt>
mov    0x10(%rsp),%rsi
lea    0xe54(%rip),%rdi
call   1030 <printf@plt>
mov    0x58(%rsp),%rsi
lea    0xe69(%rip),%rdi
call   1030 <printf@plt>
mov    0x50(%rsp),%rsi
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
mov    0x48(%rsp),%rsi
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
mov    0x40(%rsp),%rsi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
mov    0x38(%rsp),%rsi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    0x30(%rsp),%rsi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
mov    0x18(%rsp),%rsi
lea    0xee7(%rip),%rdi
call   1030 <printf@plt>
mov    0x20(%rsp),%rsi
lea    0xefd(%rip),%rdi
call   1030 <printf@plt>
mov    0x28(%rsp),%rsi
lea    0xf13(%rip),%rdi
call   1030 <printf@plt>
mov    0x2d49(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>

LLVM IR (-O0):
%struct.statvfs = type { i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64 }
@.str = [7 x i8] c"--help\00"
@stderr = global i32 0
@.str.1 = [9 x i8] c"%s path\0A\00"
@.str.2 = [8 x i8] c"statvfs\00"
@.str.3 = [38 x i8] c"Block size %lu\0A\00"
@.str.4 = [38 x i8] c"Fundamental block size %lu\0A\00"
@.str.5 = [38 x i8] c"Total blocks (in above units) %lu\0A\00"
@.str.6 = [38 x i8] c"Free blocks for priv. proc. %lu\0A\00"
@.str.7 = [38 x i8] c"Free blocks for unpriv. proc. %lu\0A\00"
@.str.8 = [38 x i8] c"Total number of i-nodes %lu\0A\00"
@.str.9 = [38 x i8] c"Free i-nodes for priv. proc. %lu\0A\00"
@.str.10 = [38 x i8] c"Free i-nodes for nonpriv. proc. %lu\0A\00"
@.str.11 = [39 x i8] c"File system ID %#lx\0A\00"
@.str.12 = [39 x i8] c"Flags %#lx\0A\00"
@.str.13 = [38 x i8] c"Maximum filename length %lu\0A\00"
@EXIT_SUCCESS = global i32 0
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 = load i32, i32* %4
%8 = icmp ne i32 %7, 2
br i1 %8, label %15, label %9
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %22
15: ; preds = %9, %2
%16 = load i32, i32* @stderr
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 0
%19 = load i8*, i8** %18
%20 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %19)
%21 = call i32 @exit(i32 1)
unreachable
22: ; preds = %9
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 1
%25 = load i8*, i8** %24
%26 = call i32 @statvfs(i8* %25, %struct.statvfs* %6)
%27 = icmp eq i32 %26, -1
br i1 %27, label %28, label %31
28: ; preds = %22
%29 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%30 = call i32 @exit(i32 1)
unreachable
31: ; preds = %22
%32 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %6, i32 0, i32 0
%33 = load i64, i64* %32
%34 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i64 %33)
%35 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %6, i32 0, i32 1
%36 = load i64, i64* %35
%37 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), i64 %36)
%38 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %6, i32 0, i32 10
%39 = load i64, i64* %38
%40 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0), i64 %39)
%41 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %6, i32 0, i32 9
%42 = load i64, i64* %41
%43 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.6, i64 0, i64 0), i64 %42)
%44 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %6, i32 0, i32 8
%45 = load i64, i64* %44
%46 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.7, i64 0, i64 0), i64 %45)
%47 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %6, i32 0, i32 7
%48 = load i64, i64* %47
%49 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.8, i64 0, i64 0), i64 %48)
%50 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %6, i32 0, i32 6
%51 = load i64, i64* %50
%52 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.9, i64 0, i64 0), i64 %51)
%53 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %6, i32 0, i32 5
%54 = load i64, i64* %53
%55 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.10, i64 0, i64 0), i64 %54)
%56 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %6, i32 0, i32 2
%57 = load i64, i64* %56
%58 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.11, i64 0, i64 0), i64 %57)
%59 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %6, i32 0, i32 3
%60 = load i64, i64* %59
%61 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.12, i64 0, i64 0), i64 %60)
%62 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %6, i32 0, i32 4
%63 = load i64, i64* %62
%64 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.13, i64 0, i64 0), i64 %63)
%65 = load i32, i32* @EXIT_SUCCESS
%66 = call i32 @exit(i32 %65)
unreachable
}

LLVM IR (-O2):
%struct.statvfs = type { i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64 }
@.str = [7 x i8] c"--help\00"
@stderr = global i32 0
@.str.1 = [9 x i8] c"%s path\0A\00"
@.str.2 = [8 x i8] c"statvfs\00"
@.str.3 = [38 x i8] c"Block size %lu\0A\00"
@.str.4 = [38 x i8] c"Fundamental block size %lu\0A\00"
@.str.5 = [38 x i8] c"Total blocks (in above units) %lu\0A\00"
@.str.6 = [38 x i8] c"Free blocks for priv. proc. %lu\0A\00"
@.str.7 = [38 x i8] c"Free blocks for unpriv. proc. %lu\0A\00"
@.str.8 = [38 x i8] c"Total number of i-nodes %lu\0A\00"
@.str.9 = [38 x i8] c"Free i-nodes for priv. proc. %lu\0A\00"
@.str.10 = [38 x i8] c"Free i-nodes for nonpriv. proc. %lu\0A\00"
@.str.11 = [39 x i8] c"File system ID %#lx\0A\00"
@.str.12 = [39 x i8] c"Flags %#lx\0A\00"
@.str.13 = [38 x i8] c"Maximum filename length %lu\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.statvfs
%4 = bitcast %struct.statvfs* %3 to i8*
%5 = icmp eq i32 %0, 2
br i1 %5, label %6, label %11
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %6, %2
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %1
%14 = tail call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %13)
%15 = tail call i32 @exit(i32 1)
unreachable
16: ; preds = %6
%17 = load i8*, i8** %7
%18 = call i32 @statvfs(i8* %17, %struct.statvfs* %3)
%19 = icmp eq i32 %18, -1
br i1 %19, label %20, label %23
20: ; preds = %16
%21 = tail call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%22 = tail call i32 @exit(i32 1)
unreachable
23: ; preds = %16
%24 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %3, i64 0, i32 0
%25 = load i64, i64* %24
%26 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i64 %25)
%27 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %3, i64 0, i32 1
%28 = load i64, i64* %27
%29 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), i64 %28)
%30 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %3, i64 0, i32 10
%31 = load i64, i64* %30
%32 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0), i64 %31)
%33 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %3, i64 0, i32 9
%34 = load i64, i64* %33
%35 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.6, i64 0, i64 0), i64 %34)
%36 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %3, i64 0, i32 8
%37 = load i64, i64* %36
%38 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.7, i64 0, i64 0), i64 %37)
%39 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %3, i64 0, i32 7
%40 = load i64, i64* %39
%41 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.8, i64 0, i64 0), i64 %40)
%42 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %3, i64 0, i32 6
%43 = load i64, i64* %42
%44 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.9, i64 0, i64 0), i64 %43)
%45 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %3, i64 0, i32 5
%46 = load i64, i64* %45
%47 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.10, i64 0, i64 0), i64 %46)
%48 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %3, i64 0, i32 2
%49 = load i64, i64* %48
%50 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.11, i64 0, i64 0), i64 %49)
%51 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %3, i64 0, i32 3
%52 = load i64, i64* %51
%53 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.12, i64 0, i64 0), i64 %52)
%54 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %3, i64 0, i32 4
%55 = load i64, i64* %54
%56 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.13, i64 0, i64 0), i64 %55)
%57 = load i32, i32* @EXIT_SUCCESS
%58 = tail call i32 @exit(i32 %57)
unreachable
}