#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 const f_type;
  int const f_bsize;
  int const f_blocks;
  int const f_bfree;
  int const f_bavail;
  int const f_files;
  int const f_ffree;
  int const f_namelen;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const);
int statfs(char *, struct statfs *);
int main() {
  struct statfs sfs;
  const int res = statfs("/grid2/mkasa/tgetmp", &sfs);
  if (res != 0) {
    printf("Error %d\n", res);
    return 1;
  }
  printf("f_type   = %lX\n", sfs.f_type);
  printf("f_bsize  = %ld\n", sfs.f_bsize);
  printf("f_blocks = %ld\n", sfs.f_blocks);
  printf("f_bfree  = %ld\n", sfs.f_bfree);
  printf("f_bavail = %ld\n", sfs.f_bavail);
  printf("f_files  = %ld\n", sfs.f_files);
  printf("f_ffree  = %ld\n", sfs.f_ffree);
  printf("f_namelen= %ld\n", sfs.f_namelen);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x28(%rbp),%rsi
call   1040 <statfs@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
je     1167 <main+0x47>
mov    -0x2c(%rbp),%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11e6 <main+0xc6>
mov    -0x28(%rbp),%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
mov    -0x24(%rbp),%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
lea    0xed5(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <statfs@plt>
test   %eax,%eax
je     1151 <main+0x31>
lea    0xed4(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x28,%rsp
ret
mov    0x8(%rsp),%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    0x10(%rsp),%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    0x14(%rsp),%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    0x18(%rsp),%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    0x1c(%rsp),%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    0x20(%rsp),%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    0x24(%rsp),%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.statfs = type { i32, i32, i32, i32, i32, i32, i32, i32 }
@.str = [20 x i8] c"/grid2/mkasa/tgetmp\00"
@.str.1 = [10 x i8] c"Error %d\0A\00"
@.str.2 = [16 x i8] c"f_type = %lX\0A\00"
@.str.3 = [16 x i8] c"f_bsize = %ld\0A\00"
@.str.4 = [16 x i8] c"f_blocks = %ld\0A\00"
@.str.5 = [16 x i8] c"f_bfree = %ld\0A\00"
@.str.6 = [16 x i8] c"f_bavail = %ld\0A\00"
@.str.7 = [16 x i8] c"f_files = %ld\0A\00"
@.str.8 = [16 x i8] c"f_ffree = %ld\0A\00"
@.str.9 = [16 x i8] c"f_namelen= %ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.statfs
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @statfs(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), %struct.statfs* %2)
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %8)
store i32 1, i32* %1
br label %35
10: ; preds = %0
%11 = getelementptr inbounds %struct.statfs, %struct.statfs* %2, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %12)
%14 = getelementptr inbounds %struct.statfs, %struct.statfs* %2, i32 0, i32 1
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %15)
%17 = getelementptr inbounds %struct.statfs, %struct.statfs* %2, i32 0, i32 2
%18 = load i32, i32* %17
%19 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32 %18)
%20 = getelementptr inbounds %struct.statfs, %struct.statfs* %2, i32 0, i32 3
%21 = load i32, i32* %20
%22 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32 %21)
%23 = getelementptr inbounds %struct.statfs, %struct.statfs* %2, i32 0, i32 4
%24 = load i32, i32* %23
%25 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i32 %24)
%26 = getelementptr inbounds %struct.statfs, %struct.statfs* %2, i32 0, i32 5
%27 = load i32, i32* %26
%28 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), i32 %27)
%29 = getelementptr inbounds %struct.statfs, %struct.statfs* %2, i32 0, i32 6
%30 = load i32, i32* %29
%31 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), i32 %30)
%32 = getelementptr inbounds %struct.statfs, %struct.statfs* %2, i32 0, i32 7
%33 = load i32, i32* %32
%34 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), i32 %33)
store i32 0, i32* %1
br label %35
35: ; preds = %10, %7
%36 = load i32, i32* %1
ret i32 %36
}

LLVM IR (-O2):
%struct.statfs = type { i32, i32, i32, i32, i32, i32, i32, i32 }
@.str = [20 x i8] c"/grid2/mkasa/tgetmp\00"
@.str.1 = [10 x i8] c"Error %d\0A\00"
@.str.2 = [16 x i8] c"f_type = %lX\0A\00"
@.str.3 = [16 x i8] c"f_bsize = %ld\0A\00"
@.str.4 = [16 x i8] c"f_blocks = %ld\0A\00"
@.str.5 = [16 x i8] c"f_bfree = %ld\0A\00"
@.str.6 = [16 x i8] c"f_bavail = %ld\0A\00"
@.str.7 = [16 x i8] c"f_files = %ld\0A\00"
@.str.8 = [16 x i8] c"f_ffree = %ld\0A\00"
@.str.9 = [16 x i8] c"f_namelen= %ld\0A\00"
define i32 @main() {
%1 = alloca %struct.statfs
%2 = bitcast %struct.statfs* %1 to i8*
%3 = call i32 @statfs(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), %struct.statfs* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %3)
br label %32
7: ; preds = %0
%8 = getelementptr inbounds %struct.statfs, %struct.statfs* %1, i64 0, i32 0
%9 = load i32, i32* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %9)
%11 = getelementptr inbounds %struct.statfs, %struct.statfs* %1, i64 0, i32 1
%12 = load i32, i32* %11
%13 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %12)
%14 = getelementptr inbounds %struct.statfs, %struct.statfs* %1, i64 0, i32 2
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32 %15)
%17 = getelementptr inbounds %struct.statfs, %struct.statfs* %1, i64 0, i32 3
%18 = load i32, i32* %17
%19 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32 %18)
%20 = getelementptr inbounds %struct.statfs, %struct.statfs* %1, i64 0, i32 4
%21 = load i32, i32* %20
%22 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i32 %21)
%23 = getelementptr inbounds %struct.statfs, %struct.statfs* %1, i64 0, i32 5
%24 = load i32, i32* %23
%25 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), i32 %24)
%26 = getelementptr inbounds %struct.statfs, %struct.statfs* %1, i64 0, i32 6
%27 = load i32, i32* %26
%28 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), i32 %27)
%29 = getelementptr inbounds %struct.statfs, %struct.statfs* %1, i64 0, i32 7
%30 = load i32, i32* %29
%31 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), i32 %30)
br label %32
32: ; preds = %7, %5
%33 = phi i32 [ 1, %5 ], [ 0, %7 ]
ret i32 %33
}