#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 /*<<< orphan*/ f_ffree;
  int /*<<< orphan*/ f_files;
  int /*<<< orphan*/ f_bavail;
  int /*<<< orphan*/ f_bfree;
  int /*<<< orphan*/ f_blocks;
  int /*<<< orphan*/ f_bsize;
  int /*<<< orphan*/ f_type;
};

/* Variables and functions */
scalar_t__ fstatfs(int /*<<< orphan*/, struct statfs *);
int /*<<< orphan*/ prnum(int /*<<< orphan*/);
int /*<<< orphan*/ quit(int);
void c_df() {
  struct statfs sfsbuf;
  if (fstatfs(0, &sfsbuf))
    quit(1);
  prnum(sfsbuf.f_type);
  prnum(sfsbuf.f_bsize);
  prnum(sfsbuf.f_blocks);
  prnum(sfsbuf.f_bfree);
  prnum(sfsbuf.f_bavail);
  prnum(sfsbuf.f_files);
  prnum(sfsbuf.f_ffree);
}


x86 assembly (clang, -O0):
<c_df>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %edi,%edi
lea    -0x20(%rbp),%rsi
call   1050 <fstatfs@plt>
cmp    $0x0,%rax
je     1157 <c_df+0x27>
mov    $0x1,%edi
call   1030 <quit@plt>
mov    -0x8(%rbp),%edi
call   1040 <prnum@plt>
mov    -0xc(%rbp),%edi
call   1040 <prnum@plt>
mov    -0x10(%rbp),%edi
call   1040 <prnum@plt>
mov    -0x14(%rbp),%edi
call   1040 <prnum@plt>
mov    -0x18(%rbp),%edi
call   1040 <prnum@plt>
mov    -0x1c(%rbp),%edi
call   1040 <prnum@plt>
mov    -0x20(%rbp),%edi
call   1040 <prnum@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_df>:
sub    $0x28,%rsp
lea    0x8(%rsp),%rsi
xor    %edi,%edi
call   1050 <fstatfs@plt>
test   %rax,%rax
je     114f <c_df+0x1f>
mov    $0x1,%edi
call   1030 <quit@plt>
mov    0x20(%rsp),%edi
call   1040 <prnum@plt>
mov    0x1c(%rsp),%edi
call   1040 <prnum@plt>
mov    0x18(%rsp),%edi
call   1040 <prnum@plt>
mov    0x14(%rsp),%edi
call   1040 <prnum@plt>
mov    0x10(%rsp),%edi
call   1040 <prnum@plt>
mov    0xc(%rsp),%edi
call   1040 <prnum@plt>
mov    0x8(%rsp),%edi
call   1040 <prnum@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.statfs = type { i32, i32, i32, i32, i32, i32, i32 }
define void @c_df() {
%1 = alloca %struct.statfs
%2 = call i64 @fstatfs(i32 0, %struct.statfs* %1)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @quit(i32 1)
br label %6
6: ; preds = %4, %0
%7 = getelementptr inbounds %struct.statfs, %struct.statfs* %1, i32 0, i32 6
%8 = load i32, i32* %7
%9 = call i32 @prnum(i32 %8)
%10 = getelementptr inbounds %struct.statfs, %struct.statfs* %1, i32 0, i32 5
%11 = load i32, i32* %10
%12 = call i32 @prnum(i32 %11)
%13 = getelementptr inbounds %struct.statfs, %struct.statfs* %1, i32 0, i32 4
%14 = load i32, i32* %13
%15 = call i32 @prnum(i32 %14)
%16 = getelementptr inbounds %struct.statfs, %struct.statfs* %1, i32 0, i32 3
%17 = load i32, i32* %16
%18 = call i32 @prnum(i32 %17)
%19 = getelementptr inbounds %struct.statfs, %struct.statfs* %1, i32 0, i32 2
%20 = load i32, i32* %19
%21 = call i32 @prnum(i32 %20)
%22 = getelementptr inbounds %struct.statfs, %struct.statfs* %1, i32 0, i32 1
%23 = load i32, i32* %22
%24 = call i32 @prnum(i32 %23)
%25 = getelementptr inbounds %struct.statfs, %struct.statfs* %1, i32 0, i32 0
%26 = load i32, i32* %25
%27 = call i32 @prnum(i32 %26)
ret void
}

LLVM IR (-O2):
%struct.statfs = type { i32, i32, i32, i32, i32, i32, i32 }
define void @c_df() {
%1 = alloca %struct.statfs
%2 = bitcast %struct.statfs* %1 to i8*
%3 = call i64 @fstatfs(i32 0, %struct.statfs* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = call i32 @quit(i32 1)
br label %7
7: ; preds = %5, %0
%8 = getelementptr inbounds %struct.statfs, %struct.statfs* %1, i64 0, i32 6
%9 = load i32, i32* %8
%10 = call i32 @prnum(i32 %9)
%11 = getelementptr inbounds %struct.statfs, %struct.statfs* %1, i64 0, i32 5
%12 = load i32, i32* %11
%13 = call i32 @prnum(i32 %12)
%14 = getelementptr inbounds %struct.statfs, %struct.statfs* %1, i64 0, i32 4
%15 = load i32, i32* %14
%16 = call i32 @prnum(i32 %15)
%17 = getelementptr inbounds %struct.statfs, %struct.statfs* %1, i64 0, i32 3
%18 = load i32, i32* %17
%19 = call i32 @prnum(i32 %18)
%20 = getelementptr inbounds %struct.statfs, %struct.statfs* %1, i64 0, i32 2
%21 = load i32, i32* %20
%22 = call i32 @prnum(i32 %21)
%23 = getelementptr inbounds %struct.statfs, %struct.statfs* %1, i64 0, i32 1
%24 = load i32, i32* %23
%25 = call i32 @prnum(i32 %24)
%26 = getelementptr inbounds %struct.statfs, %struct.statfs* %1, i64 0, i32 0
%27 = load i32, i32* %26
%28 = call i32 @prnum(i32 %27)
ret void
}