#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_blocks;
  int f_bsize;
  int f_bavail;
  unsigned long long f_bfree;
};
struct mntent {
  char *mnt_dir;
  char *mnt_fsname;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ endmntent(int /*<<< orphan*/ *);
struct mntent *getmntent(int /*<<< orphan*/ *);
int getopt(int, char **, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ *setmntent(char *, char *);
int /*<<< orphan*/ statfs(char *, struct statfs *);
int strlen(char *);
int main(int argc, char *argv[]) {
  int o;
  int blocksz = 512;
  int opt[2] = {0, 0};
  while ((o = getopt(argc, argv, "kPh")) != -1)
    switch (o) {
    case 'k':
      blocksz = 1024;
      opt[1] = 1;
      break;
    case 'P':
      opt[2] = 1;
      break;
    case 'h':
      break;
    case '?':
      break;
    default:
      break;
    }
  unsigned long long size, avail, used;
  FILE *f = setmntent("/etc/mtab", "r");
  struct mntent *ent;
  struct statfs fs;
  printf("%-13s ", "Filesystem");
  if (opt[1] == 1)
    printf("%-13s ", "1024-blocks");
  else
    printf("%-13s ", "512-blocks");
  printf("%-13s ", "Used");
  printf("%-s ", "Available");
  printf("%-s ", "Capacity ");
  printf("%-s ", "Mounted on");
  printf("\n");
  while ((ent = getmntent(f))) {
    statfs(ent->mnt_dir, &fs);
    size = fs.f_blocks * fs.f_bsize / blocksz;
    avail = fs.f_bavail * fs.f_bsize / blocksz;
    used = fs.f_blocks - fs.f_bfree;
    used *= (fs.f_bsize / blocksz);
    printf("%-13s ", ent->mnt_fsname);
    if (strlen(ent->mnt_fsname) > 13)
      printf("\n%-13s ", "");
    printf("%-13llu ", size);
    printf("%-13llu ", used);
    printf("%-13llu ", avail);
    printf("%3.0f%%  ", (100 * (float)used) / (size + 1) + .5);
    printf("%-13s ", ent->mnt_dir);
    printf("\n");
  }
  endmntent(f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x200,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1060 <memset@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe4e(%rip),%rdx
call   10a0 <getopt@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
je     1249 <main+0xc9>
mov    -0x14(%rbp),%eax
mov    %eax,-0x64(%rbp)
sub    $0x3f,%eax
je     123a <main+0xba>
jmp    11e3 <main+0x63>
mov    -0x64(%rbp),%eax
sub    $0x50,%eax
je     1229 <main+0xa9>
jmp    11f4 <main+0x74>
mov    -0x64(%rbp),%eax
sub    $0x68,%eax
je     1235 <main+0xb5>
jmp    1205 <main+0x85>
mov    -0x64(%rbp),%eax
sub    $0x6b,%eax
jne    123f <main+0xbf>
jmp    1216 <main+0x96>
movl   $0x400,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
jmp    1244 <main+0xc4>
movl   $0x1,-0x18(%rbp)
jmp    1244 <main+0xc4>
jmp    1244 <main+0xc4>
jmp    1244 <main+0xc4>
jmp    1244 <main+0xc4>
jmp    11b0 <main+0x30>
lea    0xdc0(%rip),%rdi
lea    0xdc3(%rip),%rsi
call   1090 <setmntent@plt>
mov    %rax,-0x40(%rbp)
lea    0xe03(%rip),%rdi
lea    0xdae(%rip),%rsi
mov    $0x0,%al
call   1050 <printf@plt>
cmpl   $0x1,-0x1c(%rbp)
jne    1299 <main+0x119>
lea    0xde4(%rip),%rdi
lea    0xd9a(%rip),%rsi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    12ae <main+0x12e>
lea    0xdca(%rip),%rdi
lea    0xd8c(%rip),%rsi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xdb5(%rip),%rdi
lea    0xd82(%rip),%rsi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd79(%rip),%rdi
lea    0xd77(%rip),%rsi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd64(%rip),%rdi
lea    0xd6c(%rip),%rsi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd4f(%rip),%rdi
lea    0xd61(%rip),%rsi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd5e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x40(%rbp),%rdi
call   1080 <getmntent@plt>
mov    %rax,-0x48(%rbp)
cmp    $0x0,%rax
je     14df <main+0x35f>
mov    -0x48(%rbp),%rax
mov    (%rax),%rdi
lea    -0x60(%rbp),%rsi
call   1070 <statfs@plt>
mov    -0x60(%rbp),%eax
imul   -0x5c(%rbp),%eax
cltd
idivl  -0x18(%rbp)
cltq
mov    %rax,-0x28(%rbp)
mov    -0x58(%rbp),%eax
imul   -0x5c(%rbp),%eax
cltd
idivl  -0x18(%rbp)
cltq
mov    %rax,-0x30(%rbp)
movslq -0x60(%rbp),%rax
sub    -0x50(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x5c(%rbp),%eax
cltd
idivl  -0x18(%rbp)
cltq
imul   -0x38(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x48(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xce4(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x48(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <strlen@plt>
cmp    $0xd,%eax
jle    13b8 <main+0x238>
lea    0xcbf(%rip),%rdi
lea    0xcb7(%rip),%rsi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x28(%rbp),%rsi
lea    0xcae(%rip),%rdi
mov    %rdi,-0x78(%rbp)
xor    %eax,%eax
mov    %al,-0x6d(%rbp)
call   1050 <printf@plt>
mov    -0x78(%rbp),%rdi
mov    -0x6d(%rbp),%al
mov    -0x38(%rbp),%rsi
call   1050 <printf@plt>
mov    -0x78(%rbp),%rdi
mov    -0x6d(%rbp),%al
mov    -0x30(%rbp),%rsi
call   1050 <printf@plt>
mov    -0x38(%rbp),%rax
mov    %rax,%rdx
shr    %rdx
mov    %eax,%ecx
and    $0x1,%ecx
or     %rdx,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rax,%xmm1
movss  %xmm1,-0x6c(%rbp)
test   %rax,%rax
movss  %xmm0,-0x68(%rbp)
js     142e <main+0x2ae>
movss  -0x6c(%rbp),%xmm0
movss  %xmm0,-0x68(%rbp)
movss  -0x68(%rbp),%xmm0
movss  0xbcd(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x84(%rbp)
ff
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,%rdx
shr    %rdx
mov    %eax,%ecx
and    $0x1,%ecx
or     %rdx,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rax,%xmm1
movss  %xmm1,-0x80(%rbp)
test   %rax,%rax
movss  %xmm0,-0x7c(%rbp)
js     1488 <main+0x308>
movss  -0x80(%rbp),%xmm0
movss  %xmm0,-0x7c(%rbp)
movss  -0x84(%rbp),%xmm0
ff
movss  -0x7c(%rbp),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xb5b(%rip),%xmm1
addsd  %xmm1,%xmm0
lea    0xbca(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    -0x48(%rbp),%rax
mov    (%rax),%rsi
lea    0xba5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xb94(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1310 <main+0x190>
mov    -0x40(%rbp),%rdi
call   1030 <endmntent@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbp
mov    %edi,%ebx
movl   $0x200,0x4(%rsp)
lea    0xe95(%rip),%r14
lea    0xe67(%rip),%r15
lea    0xe7b(%rip),%r12
mov    %ebx,%edi
mov    %rbp,%rsi
mov    %r15,%rdx
call   10a0 <getopt@plt>
cmp    $0x6b,%eax
je     11c9 <main+0x49>
cmp    $0xffffffff,%eax
jne    11b0 <main+0x30>
jmp    11d6 <main+0x56>
movl   $0x400,0x4(%rsp)
mov    %r12,%r14
jmp    11b0 <main+0x30>
lea    0xe37(%rip),%rdi
lea    0xe3a(%rip),%rsi
call   1090 <setmntent@plt>
mov    %rax,%rbp
lea    0xe79(%rip),%rbx
lea    0xe26(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe2a(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe1e(%rip),%rbx
lea    0xe1c(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe15(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe0e(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbp,0x8(%rsp)
mov    %rbp,%rdi
call   1080 <getmntent@plt>
test   %rax,%rax
je     13e3 <main+0x263>
mov    %rax,%r13
lea    0xde6(%rip),%rbp
jmp    12e8 <main+0x168>
nopl   0x0(%rax,%rax,1)
cvtsi2ss %r12,%xmm1
lea    0xdd0(%rip),%rbp
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xd5c(%rip),%xmm0
lea    0xdc9(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    0x0(%r13),%rsi
mov    %rbp,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x8(%rsp),%rdi
call   1080 <getmntent@plt>
mov    %rax,%r13
test   %rax,%rax
je     13e3 <main+0x263>
mov    0x0(%r13),%rdi
lea    0x10(%rsp),%rsi
call   1070 <statfs@plt>
movslq 0x10(%rsp),%rsi
mov    0x14(%rsp),%ecx
mov    %ecx,%eax
imul   %esi,%eax
cltd
mov    0x4(%rsp),%edi
idiv   %edi
mov    %eax,%ebx
mov    0x18(%rsp),%eax
imul   %ecx,%eax
cltd
idiv   %edi
mov    %eax,%r15d
sub    0x20(%rsp),%rsi
mov    %ecx,%eax
cltd
idiv   %edi
movslq %eax,%r14
imul   %rsi,%r14
mov    0x8(%r13),%rsi
mov    %rbp,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x8(%r13),%rdi
call   1050 <strlen@plt>
cmp    $0xe,%eax
jl     135c <main+0x1dc>
lea    0xd1d(%rip),%rdi
lea    0xd30(%rip),%rsi
xor    %eax,%eax
call   1060 <printf@plt>
movslq %ebx,%r12
movslq %r15d,%rbx
lea    0xd0a(%rip),%rbp
mov    %rbp,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
test   %r14,%r14
js     13a0 <main+0x220>
xorps  %xmm0,%xmm0
cvtsi2ss %r14,%xmm0
jmp    13b6 <main+0x236>
nop
mov    %r14,%rax
shr    %rax
and    $0x1,%r14d
or     %rax,%r14
cvtsi2ss %r14,%xmm0
addss  %xmm0,%xmm0
mulss  0xc42(%rip),%xmm0
add    $0x1,%r12
jns    1290 <main+0x110>
mov    %r12,%rax
shr    %rax
and    $0x1,%r12d
or     %rax,%r12
cvtsi2ss %r12,%xmm1
addss  %xmm1,%xmm1
jmp    1295 <main+0x115>
mov    0x8(%rsp),%rdi
call   1040 <endmntent@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.mntent = type { i8*, i8* }
%struct.statfs = type { i32, i32, i32, i64 }
@.str = [4 x i8] c"kPh\00"
@.str.1 = [10 x i8] c"/etc/mtab\00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [7 x i8] c"%-13s \00"
@.str.4 = [11 x i8] c"Filesystem\00"
@.str.5 = [12 x i8] c"1024-blocks\00"
@.str.6 = [11 x i8] c"512-blocks\00"
@.str.7 = [5 x i8] c"Used\00"
@.str.8 = [5 x i8] c"%-s \00"
@.str.9 = [10 x i8] c"Available\00"
@.str.10 = [10 x i8] c"Capacity \00"
@.str.11 = [11 x i8] c"Mounted on\00"
@.str.12 = [2 x i8] c"\0A\00"
@.str.13 = [8 x i8] c"\0A%-13s \00"
@.str.14 = [1 x i8] zeroinitializer
@.str.15 = [9 x i8] c"%-13llu \00"
@.str.16 = [10 x i8] c"%3.0f%% \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca [2 x i32]
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i32*
%13 = alloca %struct.mntent*
%14 = alloca %struct.statfs
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 512, i32* %7
%15 = bitcast [2 x i32]* %8 to i8*
br label %16
16: ; preds = %30, %2
%17 = load i32, i32* %4
%18 = load i8**, i8*** %5
%19 = call i32 @getopt(i32 %17, i8** %18, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32 %19, i32* %6
%20 = icmp ne i32 %19, -1
br i1 %20, label %21, label %31
21: ; preds = %16
%22 = load i32, i32* %6
switch i32 %22, label %29 [
i32 107, label %23
i32 80, label %25
i32 104, label %27
i32 63, label %28
]
23: ; preds = %21
store i32 1024, i32* %7
%24 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
store i32 1, i32* %24
br label %30
25: ; preds = %21
%26 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 2
store i32 1, i32* %26
br label %30
27: ; preds = %21
br label %30
28: ; preds = %21
br label %30
29: ; preds = %21
br label %30
30: ; preds = %29, %28, %27, %25, %23
br label %16
31: ; preds = %16
%32 = call i32* @setmntent(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %32, i32** %12
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%34 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
%35 = load i32, i32* %34
%36 = icmp eq i32 %35, 1
br i1 %36, label %37, label %39
37: ; preds = %31
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
br label %41
39: ; preds = %31
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
br label %41
41: ; preds = %39, %37
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0))
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0))
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0))
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
br label %47
47: ; preds = %96, %41
%48 = load i32*, i32** %12
%49 = call %struct.mntent* @getmntent(i32* %48)
store %struct.mntent* %49, %struct.mntent** %13
%50 = icmp ne %struct.mntent* %49, null
br i1 %50, label %51, label %118
51: ; preds = %47
%52 = load %struct.mntent*, %struct.mntent** %13
%53 = getelementptr inbounds %struct.mntent, %struct.mntent* %52, i32 0, i32 0
%54 = load i8*, i8** %53
%55 = call i32 @statfs(i8* %54, %struct.statfs* %14)
%56 = getelementptr inbounds %struct.statfs, %struct.statfs* %14, i32 0, i32 0
%57 = load i32, i32* %56
%58 = getelementptr inbounds %struct.statfs, %struct.statfs* %14, i32 0, i32 1
%59 = load i32, i32* %58
%60 = mul nsw i32 %57, %59
%61 = load i32, i32* %7
%62 = sdiv i32 %60, %61
%63 = sext i32 %62 to i64
store i64 %63, i64* %9
%64 = getelementptr inbounds %struct.statfs, %struct.statfs* %14, i32 0, i32 2
%65 = load i32, i32* %64
%66 = getelementptr inbounds %struct.statfs, %struct.statfs* %14, i32 0, i32 1
%67 = load i32, i32* %66
%68 = mul nsw i32 %65, %67
%69 = load i32, i32* %7
%70 = sdiv i32 %68, %69
%71 = sext i32 %70 to i64
store i64 %71, i64* %10
%72 = getelementptr inbounds %struct.statfs, %struct.statfs* %14, i32 0, i32 0
%73 = load i32, i32* %72
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds %struct.statfs, %struct.statfs* %14, i32 0, i32 3
%76 = load i64, i64* %75
%77 = sub i64 %74, %76
store i64 %77, i64* %11
%78 = getelementptr inbounds %struct.statfs, %struct.statfs* %14, i32 0, i32 1
%79 = load i32, i32* %78
%80 = load i32, i32* %7
%81 = sdiv i32 %79, %80
%82 = sext i32 %81 to i64
%83 = load i64, i64* %11
%84 = mul i64 %83, %82
store i64 %84, i64* %11
%85 = load %struct.mntent*, %struct.mntent** %13
%86 = getelementptr inbounds %struct.mntent, %struct.mntent* %85, i32 0, i32 1
%87 = load i8*, i8** %86
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %87)
%89 = load %struct.mntent*, %struct.mntent** %13
%90 = getelementptr inbounds %struct.mntent, %struct.mntent* %89, i32 0, i32 1
%91 = load i8*, i8** %90
%92 = call i32 @strlen(i8* %91)
%93 = icmp sgt i32 %92, 13
br i1 %93, label %94, label %96
94: ; preds = %51
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.14, i64 0, i64 0))
br label %96
96: ; preds = %94, %51
%97 = load i64, i64* %9
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0), i64 %97)
%99 = load i64, i64* %11
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0), i64 %99)
%101 = load i64, i64* %10
%102 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0), i64 %101)
%103 = load i64, i64* %11
%104 = uitofp i64 %103 to float
%105 = fmul float 1.000000e+02, %104
%106 = load i64, i64* %9
%107 = add i64 %106, 1
%108 = uitofp i64 %107 to float
%109 = fdiv float %105, %108
%110 = fpext float %109 to double
%111 = fadd double %110, 5.000000e-01
%112 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.16, i64 0, i64 0), double %111)
%113 = load %struct.mntent*, %struct.mntent** %13
%114 = getelementptr inbounds %struct.mntent, %struct.mntent* %113, i32 0, i32 0
%115 = load i8*, i8** %114
%116 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %115)
%117 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
br label %47
118: ; preds = %47
%119 = load i32*, i32** %12
%120 = call i32 @endmntent(i32* %119)
ret i32 0
}

LLVM IR (-O2):
%struct.statfs = type { i32, i32, i32, i64 }
%struct.mntent = type { i8*, i8* }
@.str = [4 x i8] c"kPh\00"
@.str.1 = [10 x i8] c"/etc/mtab\00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [7 x i8] c"%-13s \00"
@.str.4 = [11 x i8] c"Filesystem\00"
@.str.5 = [12 x i8] c"1024-blocks\00"
@.str.6 = [11 x i8] c"512-blocks\00"
@.str.7 = [5 x i8] c"Used\00"
@.str.8 = [5 x i8] c"%-s \00"
@.str.9 = [10 x i8] c"Available\00"
@.str.10 = [10 x i8] c"Capacity \00"
@.str.11 = [11 x i8] c"Mounted on\00"
@.str.13 = [8 x i8] c"\0A%-13s \00"
@.str.14 = [1 x i8] zeroinitializer
@.str.15 = [9 x i8] c"%-13llu \00"
@.str.16 = [10 x i8] c"%3.0f%% \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca %struct.statfs
br label %4
4: ; preds = %7, %2
%5 = phi i8* [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), %2 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), %7 ]
%6 = phi i32 [ 512, %2 ], [ 1024, %7 ]
br label %7
7: ; preds = %4, %7
%8 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
switch i32 %8, label %7 [
i32 -1, label %9
i32 107, label %4
]
9: ; preds = %7
%10 = tail call i32* @setmntent(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%11 = bitcast %struct.statfs* %3 to i8*
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %5)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0))
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0))
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0))
%18 = tail call i32 @putchar(i32 10)
%19 = call %struct.mntent* @getmntent(i32* %10)
%20 = icmp eq %struct.mntent* %19, null
br i1 %20, label %71, label %21
21: ; preds = %9
%22 = getelementptr inbounds %struct.statfs, %struct.statfs* %3, i64 0, i32 0
%23 = getelementptr inbounds %struct.statfs, %struct.statfs* %3, i64 0, i32 1
%24 = getelementptr inbounds %struct.statfs, %struct.statfs* %3, i64 0, i32 2
%25 = getelementptr inbounds %struct.statfs, %struct.statfs* %3, i64 0, i32 3
br label %26
26: ; preds = %21, %54
%27 = phi %struct.mntent* [ %19, %21 ], [ %69, %54 ]
%28 = getelementptr inbounds %struct.mntent, %struct.mntent* %27, i64 0, i32 0
%29 = load i8*, i8** %28
%30 = call i32 @statfs(i8* %29, %struct.statfs* %3)
%31 = load i32, i32* %22
%32 = load i32, i32* %23
%33 = mul nsw i32 %32, %31
%34 = sdiv i32 %33, %6
%35 = sext i32 %34 to i64
%36 = load i32, i32* %24
%37 = mul nsw i32 %36, %32
%38 = sdiv i32 %37, %6
%39 = sext i32 %38 to i64
%40 = sext i32 %31 to i64
%41 = load i64, i64* %25
%42 = sub i64 %40, %41
%43 = sdiv i32 %32, %6
%44 = sext i32 %43 to i64
%45 = mul i64 %42, %44
%46 = getelementptr inbounds %struct.mntent, %struct.mntent* %27, i64 0, i32 1
%47 = load i8*, i8** %46
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %47)
%49 = load i8*, i8** %46
%50 = call i32 @strlen(i8* %49)
%51 = icmp sgt i32 %50, 13
br i1 %51, label %52, label %54
52: ; preds = %26
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.14, i64 0, i64 0))
br label %54
54: ; preds = %52, %26
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0), i64 %35)
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0), i64 %45)
%57 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0), i64 %39)
%58 = uitofp i64 %45 to float
%59 = fmul float %58, 1.000000e+02
%60 = add nsw i64 %35, 1
%61 = uitofp i64 %60 to float
%62 = fdiv float %59, %61
%63 = fpext float %62 to double
%64 = fadd double %63, 5.000000e-01
%65 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.16, i64 0, i64 0), double %64)
%66 = load i8*, i8** %28
%67 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %66)
%68 = call i32 @putchar(i32 10)
%69 = call %struct.mntent* @getmntent(i32* %10)
%70 = icmp eq %struct.mntent* %69, null
br i1 %70, label %71, label %26
71: ; preds = %54, %9
%72 = call i32 @endmntent(i32* %10)
ret i32 0
}