#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 {
  int /*<<< orphan*/ f_frsize;
  int /*<<< orphan*/ f_bsize;
  int /*<<< orphan*/ f_bfree;
  int /*<<< orphan*/ f_blocks;
};

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *, char *);
int /*<<< orphan*/ printf(char *, char *, ...);
scalar_t__ statvfs(char *, struct statvfs *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  struct statvfs s;
  int i;
  for (i = 1; i < argc; i++) {
    if (statvfs(argv[i], &s) != 0) {
      fprintf(stderr, "%s: %s: statvfs failed. %s\n", *argv, argv[i],
              strerror(errno));
      exit(EXIT_FAILURE);
    }
    printf("statvfs %s:\n\tblocks=%lld\n\tblkfree=%lld\n\tbsize=%d\n", argv[i],
           s.f_blocks, s.f_bfree, s.f_bsize);
    printf("\tfrsize=%lld\n", s.f_frsize);
  }
  exit(EXIT_SUCCESS);
}


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)
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1239 <main+0xe9>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    -0x20(%rbp),%rsi
call   1050 <statvfs@plt>
cmp    $0x0,%rax
je     11f5 <main+0xa5>
mov    0x2e41(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x30(%rbp)
mov    0x2e12(%rip),%rax
mov    (%rax),%edi
call   1070 <strerror@plt>
mov    -0x3c(%rbp),%edi
mov    -0x38(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    %rax,%r8
lea    0xe1e(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2de2(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
lea    0xe0a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x20(%rbp),%rsi
lea    0xe2a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    116d <main+0x1d>
mov    0x2d88(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
cmp    $0x2,%edi
jl     11d4 <main+0x84>
mov    %rsi,%rbx
mov    %edi,%r13d
mov    $0x1,%ebp
lea    0x8(%rsp),%r14
lea    0xea2(%rip),%r15
lea    0xecd(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%rbx,%rbp,8),%rdi
mov    %r14,%rsi
call   1050 <statvfs@plt>
test   %rax,%rax
jne    11e2 <main+0x92>
mov    (%rbx,%rbp,8),%rsi
mov    0x14(%rsp),%edx
mov    0xc(%rsp),%r8d
mov    0x10(%rsp),%ecx
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movslq 0x8(%rsp),%rsi
mov    %r12,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%r13
jne    1190 <main+0x40>
mov    0x2ded(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
mov    0x2df7(%rip),%rax
mov    (%rax),%r15d
mov    (%rbx),%r14
mov    (%rbx,%rbp,8),%rbx
mov    0x2dde(%rip),%rax
mov    (%rax),%edi
call   1070 <strerror@plt>
lea    0xdf8(%rip),%rsi
mov    %r15d,%edi
mov    %r14,%rdx
mov    %rbx,%rcx
mov    %rax,%r8
call   1040 <fprintf@plt>
mov    0x2db0(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
%struct.statvfs = type { i32, i32, i32, i32 }
@stderr = global i32 0
@.str = [28 x i8] c"%s: %s: statvfs failed. %s\0A\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
@.str.1 = [50 x i8] c"statvfs %s:\0A\09blocks=%lld\0A\09blkfree=%lld\0A\09bsize=%d\0A\00"
@.str.2 = [14 x i8] c"\09frsize=%lld\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
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %7
br label %8
8: ; preds = %52, %2
%9 = load i32, i32* %7
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %55
12: ; preds = %8
%13 = load i8**, i8*** %5
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = call i64 @statvfs(i8* %17, %struct.statvfs* %6)
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %34
20: ; preds = %12
%21 = load i32, i32* @stderr
%22 = load i8**, i8*** %5
%23 = load i8*, i8** %22
%24 = load i8**, i8*** %5
%25 = load i32, i32* %7
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8*, i8** %24, i64 %26
%28 = load i8*, i8** %27
%29 = load i32, i32* @errno
%30 = call i8* @strerror(i32 %29)
%31 = call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %23, i8* %28, i8* %30)
%32 = load i32, i32* @EXIT_FAILURE
%33 = call i32 @exit(i32 %32)
unreachable
34: ; preds = %12
%35 = load i8**, i8*** %5
%36 = load i32, i32* %7
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i8*, i8** %35, i64 %37
%39 = load i8*, i8** %38
%40 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %6, i32 0, i32 3
%41 = load i32, i32* %40
%42 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %6, i32 0, i32 2
%43 = load i32, i32* %42
%44 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %6, i32 0, i32 1
%45 = load i32, i32* %44
%46 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), i8* %39, i32 %41, i32 %43, i32 %45)
%47 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %6, i32 0, i32 0
%48 = load i32, i32* %47
%49 = sext i32 %48 to i64
%50 = inttoptr i64 %49 to i8*
%51 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* %50)
br label %52
52: ; preds = %34
%53 = load i32, i32* %7
%54 = add nsw i32 %53, 1
store i32 %54, i32* %7
br label %8
55: ; preds = %8
%56 = load i32, i32* @EXIT_SUCCESS
%57 = call i32 @exit(i32 %56)
unreachable
}

LLVM IR (-O2):
%struct.statvfs = type { i32, i32, i32, i32 }
@stderr = global i32 0
@.str = [28 x i8] c"%s: %s: statvfs failed. %s\0A\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
@.str.1 = [50 x i8] c"statvfs %s:\0A\09blocks=%lld\0A\09blkfree=%lld\0A\09bsize=%d\0A\00"
@.str.2 = [14 x i8] c"\09frsize=%lld\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 sgt i32 %0, 1
br i1 %5, label %6, label %39
6: ; preds = %2
%7 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %3, i64 0, i32 3
%8 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %3, i64 0, i32 2
%9 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %3, i64 0, i32 1
%10 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %3, i64 0, i32 0
%11 = zext i32 %0 to i64
br label %12
12: ; preds = %6, %27
%13 = phi i64 [ 1, %6 ], [ %37, %27 ]
%14 = getelementptr inbounds i8*, i8** %1, i64 %13
%15 = load i8*, i8** %14
%16 = call i64 @statvfs(i8* %15, %struct.statvfs* %3)
%17 = icmp eq i64 %16, 0
br i1 %17, label %27, label %18
18: ; preds = %12
%19 = load i32, i32* @stderr
%20 = load i8*, i8** %1
%21 = load i8*, i8** %14
%22 = load i32, i32* @errno
%23 = call i8* @strerror(i32 %22)
%24 = call i32 @fprintf(i32 %19, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %20, i8* %21, i8* %23)
%25 = load i32, i32* @EXIT_FAILURE
%26 = call i32 @exit(i32 %25)
unreachable
27: ; preds = %12
%28 = load i8*, i8** %14
%29 = load i32, i32* %7
%30 = load i32, i32* %8
%31 = load i32, i32* %9
%32 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), i8* %28, i32 %29, i32 %30, i32 %31)
%33 = load i32, i32* %10
%34 = sext i32 %33 to i64
%35 = inttoptr i64 %34 to i8*
%36 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* %35)
%37 = add nuw nsw i64 %13, 1
%38 = icmp eq i64 %37, %11
br i1 %38, label %39, label %12
39: ; preds = %27, %2
%40 = load i32, i32* @EXIT_SUCCESS
%41 = call i32 @exit(i32 %40)
unreachable
}