#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 */
typedef int /*<<< orphan*/ time_t;
struct statvfs {
  int f_bsize;
  int f_blocks;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ F_OK;
int /*<<< orphan*/ R_OK;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ W_OK;
int access(char *, int /*<<< orphan*/);
unsigned long bigrand(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
char fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(struct statvfs *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, unsigned long,
                         int /*<<< orphan*/);
scalar_t__ malloc(int);
int /*<<< orphan*/ perror(char *);
int rand();
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ statvfs(char *, struct statvfs *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
scalar_t__ time(int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  if (argc != 2) {
    fprintf(stderr, "Please provide a device to damage\n");
    exit(1);
  }
  if (access(argv[1], F_OK) == -1) {
    fprintf(stderr, "%s does not exist\n", argv[1]);
    exit(1);
  }
  if (access(argv[1], R_OK) == -1) {
    fprintf(stderr, "Need read access to %s\n", argv[1]);
    exit(1);
  }
  if (access(argv[1], W_OK) == -1) {
    fprintf(stderr, "Need write acces to %s\n", argv[1]);
    exit(1);
  }
  struct statvfs *buff;
  extern int errno;
  if (!(buff = (struct statvfs *)malloc(sizeof(struct statvfs)))) {
    perror("Failed to allocate memory to buffer.");
    exit(1);
  }
  if (statvfs(argv[1], buff) < 0) {
    perror("statvfs() has failed.");
    exit(1);
  } else {
    time_t t;
    srand((unsigned)time(&t));
    unsigned long bytetorot = bigrand(buff->f_bsize * buff->f_blocks);
    int bittorot = rand() % 8;
    FILE *fp;
    fp = fopen(argv[1], "rb");
    fseek(fp, bytetorot, SEEK_SET);
    char c = fgetc(fp);
    fclose(fp);
    char cp = c;
    cp ^= 1 << bittorot;
    fp = fopen(argv[1], "wb");
    fseek(fp, bytetorot, SEEK_SET);
    fputc(cp, fp);
    fclose(fp);
    fprintf(stdout, "Changed byte %lu\n", bytetorot);
  }
  free(buff);
  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)
cmpl   $0x2,-0x8(%rbp)
je     1241 <main+0x41>
mov    0x2db1(%rip),%rax
mov    (%rax),%edi
lea    0xdd0(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2d58(%rip),%rax
mov    (%rax),%esi
call   10e0 <access@plt>
cmp    $0xffffffff,%eax
jne    1289 <main+0x89>
mov    0x2d71(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xdab(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2d28(%rip),%rax
mov    (%rax),%esi
call   10e0 <access@plt>
cmp    $0xffffffff,%eax
jne    12d1 <main+0xd1>
mov    0x2d29(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xd76(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2d08(%rip),%rax
mov    (%rax),%esi
call   10e0 <access@plt>
cmp    $0xffffffff,%eax
jne    1319 <main+0x119>
mov    0x2ce1(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xd46(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
mov    $0x8,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1347 <main+0x147>
lea    0xd2e(%rip),%rdi
call   1100 <perror@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x18(%rbp),%rsi
call   10c0 <statvfs@plt>
cmp    $0x0,%rax
jge    1378 <main+0x178>
lea    0xd22(%rip),%rdi
call   1100 <perror@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
lea    -0x1c(%rbp),%rdi
call   1090 <time@plt>
mov    %eax,%edi
call   1070 <srand@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rax
imul   0x4(%rax),%edi
call   10d0 <bigrand@plt>
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1120 <rand@plt>
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xce1(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    0x2bf8(%rip),%rax
mov    (%rax),%edx
call   10b0 <fseek@plt>
mov    -0x38(%rbp),%rdi
call   1050 <fgetc@plt>
mov    %al,-0x39(%rbp)
mov    -0x38(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x39(%rbp),%al
mov    %al,-0x3a(%rbp)
mov    -0x2c(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
movsbl -0x3a(%rbp),%eax
xor    %ecx,%eax
mov    %al,-0x3a(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xc86(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    0x2b9a(%rip),%rax
mov    (%rax),%edx
call   10b0 <fseek@plt>
mov    -0x3a(%rbp),%al
mov    -0x38(%rbp),%rsi
movsbl %al,%edi
call   1060 <fputc@plt>
mov    -0x38(%rbp),%rdi
call   1040 <fclose@plt>
mov    0x2b6c(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%rdx
lea    0xc3e(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    0x2b38(%rip),%rax
mov    (%rax),%edi
call   1110 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jne    1240 <main+0x40>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
mov    0x2d8a(%rip),%rax
mov    (%rax),%esi
call   10e0 <access@plt>
cmp    $0xffffffff,%eax
jne    1261 <main+0x61>
mov    0x2da7(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rbx),%rdx
lea    0xde5(%rip),%rsi
jmp    12b9 <main+0xb9>
mov    0x2d91(%rip),%rax
mov    (%rax),%edi
lea    0xdb0(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
mov    0x8(%rbx),%rdi
mov    0x2d54(%rip),%rax
mov    (%rax),%esi
call   10e0 <access@plt>
cmp    $0xffffffff,%eax
jne    128e <main+0x8e>
mov    0x2d59(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rbx),%rdx
lea    0xdaa(%rip),%rsi
jmp    12b9 <main+0xb9>
mov    0x8(%rbx),%rdi
mov    0x2d4f(%rip),%rax
mov    (%rax),%esi
call   10e0 <access@plt>
cmp    $0xffffffff,%eax
jne    12ca <main+0xca>
mov    0x2d2c(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rbx),%rdx
lea    0xd95(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
mov    $0x8,%edi
call   10a0 <malloc@plt>
test   %rax,%rax
jne    12e2 <main+0xe2>
lea    0xd86(%rip),%rdi
jmp    12fd <main+0xfd>
mov    %rax,%r14
mov    0x8(%rbx),%rdi
mov    %rax,%rsi
call   10c0 <statvfs@plt>
test   %rax,%rax
jns    130c <main+0x10c>
lea    0xd8e(%rip),%rdi
call   1100 <perror@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
lea    0x4(%rsp),%rdi
call   1090 <time@plt>
mov    %eax,%edi
call   1070 <srand@plt>
mov    0x4(%r14),%edi
imul   (%r14),%edi
call   10d0 <bigrand@plt>
mov    %rax,%r15
xor    %eax,%eax
call   1120 <rand@plt>
mov    %eax,%r12d
mov    0x8(%rbx),%rdi
lea    0xd5f(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,%rbp
mov    0x2c7f(%rip),%rax
mov    (%rax),%edx
mov    %rbp,%rdi
mov    %r15,%rsi
call   10b0 <fseek@plt>
mov    %rbp,%rdi
call   1050 <fgetc@plt>
mov    %eax,%r13d
mov    %rbp,%rdi
call   1040 <fclose@plt>
and    $0x7,%r12b
mov    $0x1,%ebp
mov    %r12d,%ecx
shl    %cl,%ebp
xor    %r13b,%bpl
mov    0x8(%rbx),%rdi
lea    0xd17(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,%rbx
mov    0x2c34(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %r15,%rsi
call   10b0 <fseek@plt>
movsbl %bpl,%edi
mov    %rbx,%rsi
call   1060 <fputc@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    0x2c04(%rip),%rax
mov    (%rax),%edi
lea    0xcda(%rip),%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    0x2bd2(%rip),%rax
mov    (%rax),%edi
call   1110 <exit@plt>

LLVM IR (-O0):
%struct.statvfs = type { i32, i32 }
@stderr = global i32 0
@.str = [35 x i8] c"Please provide a device to damage\0A\00"
@F_OK = global i32 0
@.str.1 = [19 x i8] c"%s does not exist\0A\00"
@R_OK = global i32 0
@.str.2 = [24 x i8] c"Need read access to %s\0A\00"
@W_OK = global i32 0
@.str.3 = [24 x i8] c"Need write acces to %s\0A\00"
@.str.4 = [37 x i8] c"Failed to allocate memory to buffer.\00"
@.str.5 = [22 x i8] c"statvfs() has failed.\00"
@.str.6 = [3 x i8] c"rb\00"
@SEEK_SET = global i32 0
@.str.7 = [3 x i8] c"wb\00"
@stdout = global i32 0
@.str.8 = [18 x i8] c"Changed byte %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*
%7 = alloca i32
%8 = alloca i64
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i8
%12 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = load i32, i32* %4
%14 = icmp ne i32 %13, 2
br i1 %14, label %15, label %19
15: ; preds = %2
%16 = load i32, i32* @stderr
%17 = call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%18 = call i32 @exit(i32 1)
unreachable
19: ; preds = %2
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = load i32, i32* @F_OK
%24 = call i32 @access(i8* %22, i32 %23)
%25 = icmp eq i32 %24, -1
br i1 %25, label %26, label %33
26: ; preds = %19
%27 = load i32, i32* @stderr
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 1
%30 = load i8*, i8** %29
%31 = call i32 (i32, i8*, ...) @fprintf(i32 %27, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %30)
%32 = call i32 @exit(i32 1)
unreachable
33: ; preds = %19
%34 = load i8**, i8*** %5
%35 = getelementptr inbounds i8*, i8** %34, i64 1
%36 = load i8*, i8** %35
%37 = load i32, i32* @R_OK
%38 = call i32 @access(i8* %36, i32 %37)
%39 = icmp eq i32 %38, -1
br i1 %39, label %40, label %47
40: ; preds = %33
%41 = load i32, i32* @stderr
%42 = load i8**, i8*** %5
%43 = getelementptr inbounds i8*, i8** %42, i64 1
%44 = load i8*, i8** %43
%45 = call i32 (i32, i8*, ...) @fprintf(i32 %41, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %44)
%46 = call i32 @exit(i32 1)
unreachable
47: ; preds = %33
%48 = load i8**, i8*** %5
%49 = getelementptr inbounds i8*, i8** %48, i64 1
%50 = load i8*, i8** %49
%51 = load i32, i32* @W_OK
%52 = call i32 @access(i8* %50, i32 %51)
%53 = icmp eq i32 %52, -1
br i1 %53, label %54, label %61
54: ; preds = %47
%55 = load i32, i32* @stderr
%56 = load i8**, i8*** %5
%57 = getelementptr inbounds i8*, i8** %56, i64 1
%58 = load i8*, i8** %57
%59 = call i32 (i32, i8*, ...) @fprintf(i32 %55, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i8* %58)
%60 = call i32 @exit(i32 1)
unreachable
61: ; preds = %47
%62 = call i64 @malloc(i32 8)
%63 = inttoptr i64 %62 to %struct.statvfs*
store %struct.statvfs* %63, %struct.statvfs** %6
%64 = icmp ne %struct.statvfs* %63, null
br i1 %64, label %68, label %65
65: ; preds = %61
%66 = call i32 @perror(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0))
%67 = call i32 @exit(i32 1)
unreachable
68: ; preds = %61
%69 = load i8**, i8*** %5
%70 = getelementptr inbounds i8*, i8** %69, i64 1
%71 = load i8*, i8** %70
%72 = load %struct.statvfs*, %struct.statvfs** %6
%73 = call i64 @statvfs(i8* %71, %struct.statvfs* %72)
%74 = icmp slt i64 %73, 0
br i1 %74, label %75, label %78
75: ; preds = %68
%76 = call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
%77 = call i32 @exit(i32 1)
unreachable
78: ; preds = %68
%79 = call i64 @time(i32* %7)
%80 = trunc i64 %79 to i32
%81 = call i32 @srand(i32 %80)
%82 = load %struct.statvfs*, %struct.statvfs** %6
%83 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %82, i32 0, i32 0
%84 = load i32, i32* %83
%85 = load %struct.statvfs*, %struct.statvfs** %6
%86 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %85, i32 0, i32 1
%87 = load i32, i32* %86
%88 = mul nsw i32 %84, %87
%89 = call i64 @bigrand(i32 %88)
store i64 %89, i64* %8
%90 = call i32 (...) @rand()
%91 = srem i32 %90, 8
store i32 %91, i32* %9
%92 = load i8**, i8*** %5
%93 = getelementptr inbounds i8*, i8** %92, i64 1
%94 = load i8*, i8** %93
%95 = call i32* @fopen(i8* %94, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
store i32* %95, i32** %10
%96 = load i32*, i32** %10
%97 = load i64, i64* %8
%98 = load i32, i32* @SEEK_SET
%99 = call i32 @fseek(i32* %96, i64 %97, i32 %98)
%100 = load i32*, i32** %10
%101 = call signext i8 @fgetc(i32* %100)
store i8 %101, i8* %11
%102 = load i32*, i32** %10
%103 = call i32 @fclose(i32* %102)
%104 = load i8, i8* %11
store i8 %104, i8* %12
%105 = load i32, i32* %9
%106 = shl i32 1, %105
%107 = load i8, i8* %12
%108 = sext i8 %107 to i32
%109 = xor i32 %108, %106
%110 = trunc i32 %109 to i8
store i8 %110, i8* %12
%111 = load i8**, i8*** %5
%112 = getelementptr inbounds i8*, i8** %111, i64 1
%113 = load i8*, i8** %112
%114 = call i32* @fopen(i8* %113, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
store i32* %114, i32** %10
%115 = load i32*, i32** %10
%116 = load i64, i64* %8
%117 = load i32, i32* @SEEK_SET
%118 = call i32 @fseek(i32* %115, i64 %116, i32 %117)
%119 = load i8, i8* %12
%120 = load i32*, i32** %10
%121 = call i32 @fputc(i8 signext %119, i32* %120)
%122 = load i32*, i32** %10
%123 = call i32 @fclose(i32* %122)
%124 = load i32, i32* @stdout
%125 = load i64, i64* %8
%126 = call i32 (i32, i8*, ...) @fprintf(i32 %124, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), i64 %125)
br label %127
127: ; preds = %78
%128 = load %struct.statvfs*, %struct.statvfs** %6
%129 = call i32 @free(%struct.statvfs* %128)
%130 = load i32, i32* @EXIT_SUCCESS
%131 = call i32 @exit(i32 %130)
unreachable
}

LLVM IR (-O2):
%struct.statvfs = type { i32, i32 }
@stderr = global i32 0
@.str = [35 x i8] c"Please provide a device to damage\0A\00"
@F_OK = global i32 0
@.str.1 = [19 x i8] c"%s does not exist\0A\00"
@R_OK = global i32 0
@.str.2 = [24 x i8] c"Need read access to %s\0A\00"
@W_OK = global i32 0
@.str.3 = [24 x i8] c"Need write acces to %s\0A\00"
@.str.4 = [37 x i8] c"Failed to allocate memory to buffer.\00"
@.str.5 = [22 x i8] c"statvfs() has failed.\00"
@.str.6 = [3 x i8] c"rb\00"
@SEEK_SET = global i32 0
@.str.7 = [3 x i8] c"wb\00"
@stdout = global i32 0
@.str.8 = [18 x i8] c"Changed byte %lu\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = icmp eq i32 %0, 2
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = load i32, i32* @F_OK
%13 = tail call i32 @access(i8* %11, i32 %12)
%14 = icmp eq i32 %13, -1
br i1 %14, label %15, label %20
15: ; preds = %9
%16 = load i32, i32* @stderr
%17 = load i8*, i8** %10
%18 = tail call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %17)
%19 = tail call i32 @exit(i32 1)
unreachable
20: ; preds = %9
%21 = load i8*, i8** %10
%22 = load i32, i32* @R_OK
%23 = tail call i32 @access(i8* %21, i32 %22)
%24 = icmp eq i32 %23, -1
br i1 %24, label %25, label %30
25: ; preds = %20
%26 = load i32, i32* @stderr
%27 = load i8*, i8** %10
%28 = tail call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %27)
%29 = tail call i32 @exit(i32 1)
unreachable
30: ; preds = %20
%31 = load i8*, i8** %10
%32 = load i32, i32* @W_OK
%33 = tail call i32 @access(i8* %31, i32 %32)
%34 = icmp eq i32 %33, -1
br i1 %34, label %35, label %40
35: ; preds = %30
%36 = load i32, i32* @stderr
%37 = load i8*, i8** %10
%38 = tail call i32 (i32, i8*, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i8* %37)
%39 = tail call i32 @exit(i32 1)
unreachable
40: ; preds = %30
%41 = tail call i64 @malloc(i32 8)
%42 = inttoptr i64 %41 to %struct.statvfs*
%43 = icmp eq i64 %41, 0
br i1 %43, label %44, label %47
44: ; preds = %40
%45 = tail call i32 @perror(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0))
%46 = tail call i32 @exit(i32 1)
unreachable
47: ; preds = %40
%48 = load i8*, i8** %10
%49 = tail call i64 @statvfs(i8* %48, %struct.statvfs* %42)
%50 = icmp slt i64 %49, 0
br i1 %50, label %51, label %54
51: ; preds = %47
%52 = tail call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
%53 = tail call i32 @exit(i32 1)
unreachable
54: ; preds = %47
%55 = bitcast i32* %3 to i8*
%56 = call i64 @time(i32* %3)
%57 = trunc i64 %56 to i32
%58 = call i32 @srand(i32 %57)
%59 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %42, i64 0, i32 0
%60 = load i32, i32* %59
%61 = getelementptr inbounds %struct.statvfs, %struct.statvfs* %42, i64 0, i32 1
%62 = load i32, i32* %61
%63 = mul nsw i32 %62, %60
%64 = call i64 @bigrand(i32 %63)
%65 = call i32 (...) @rand()
%66 = load i8*, i8** %10
%67 = call i32* @fopen(i8* %66, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%68 = load i32, i32* @SEEK_SET
%69 = call i32 @fseek(i32* %67, i64 %64, i32 %68)
%70 = call signext i8 @fgetc(i32* %67)
%71 = call i32 @fclose(i32* %67)
%72 = and i32 %65, 7
%73 = shl nuw nsw i32 1, %72
%74 = trunc i32 %73 to i8
%75 = xor i8 %70, %74
%76 = load i8*, i8** %10
%77 = call i32* @fopen(i8* %76, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%78 = load i32, i32* @SEEK_SET
%79 = call i32 @fseek(i32* %77, i64 %64, i32 %78)
%80 = call i32 @fputc(i8 signext %75, i32* %77)
%81 = call i32 @fclose(i32* %77)
%82 = load i32, i32* @stdout
%83 = call i32 (i32, i8*, ...) @fprintf(i32 %82, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), i64 %64)
%84 = call i32 @free(%struct.statvfs* %42)
%85 = load i32, i32* @EXIT_SUCCESS
%86 = call i32 @exit(i32 %85)
unreachable
}