#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 scalar_t__ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ parse(char *, float *, scalar_t__ *);
int /*<<< orphan*/ read(int, char *, int);
void get_stats(char *filename, float *utime, uint64_t *vsize,
               uint64_t *vsize_hwm) {
  int fd = open(filename, O_RDONLY);
  char buf[4096];
  read(fd, buf, 4096);
  close(fd);
  parse(buf, utime, vsize);
  if (*vsize > *vsize_hwm) {
    *vsize_hwm = *vsize;
  }
}


x86 assembly (clang, -O0):
<get_stats>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1030,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e82(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x1030(%rbp),%rsi
mov    $0x1000,%edx
call   1040 <read@plt>
mov    -0x24(%rbp),%edi
call   1030 <close@plt>
lea    -0x1030(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1060 <parse@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%rax
jle    11c2 <get_stats+0x82>
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
add    $0x1030,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_stats>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x1000,%rsp
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %rsi,%r15
mov    0x2e89(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
mov    %eax,%ebp
mov    %rsp,%r12
mov    %eax,%edi
mov    %r12,%rsi
mov    $0x1000,%edx
call   1040 <read@plt>
mov    %ebp,%edi
call   1030 <close@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1060 <parse@plt>
mov    (%rbx),%rax
cmp    (%r14),%rax
jle    119a <get_stats+0x5a>
mov    %rax,(%r14)
add    $0x1000,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@O_RDONLY = global i32 0
define void @get_stats(i8* %0, float* %1, i64* %2, i64* %3) {
%5 = alloca i8*
%6 = alloca float*
%7 = alloca i64*
%8 = alloca i64*
%9 = alloca i32
%10 = alloca [4096 x i8]
store i8* %0, i8** %5
store float* %1, float** %6
store i64* %2, i64** %7
store i64* %3, i64** %8
%11 = load i8*, i8** %5
%12 = load i32, i32* @O_RDONLY
%13 = call i32 @open(i8* %11, i32 %12)
store i32 %13, i32* %9
%14 = load i32, i32* %9
%15 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 0
%16 = call i32 @read(i32 %14, i8* %15, i32 4096)
%17 = load i32, i32* %9
%18 = call i32 @close(i32 %17)
%19 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 0
%20 = load float*, float** %6
%21 = load i64*, i64** %7
%22 = call i32 @parse(i8* %19, float* %20, i64* %21)
%23 = load i64*, i64** %7
%24 = load i64, i64* %23
%25 = load i64*, i64** %8
%26 = load i64, i64* %25
%27 = icmp sgt i64 %24, %26
br i1 %27, label %28, label %32
28: ; preds = %4
%29 = load i64*, i64** %7
%30 = load i64, i64* %29
%31 = load i64*, i64** %8
store i64 %30, i64* %31
br label %32
32: ; preds = %28, %4
ret void
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
define void @get_stats(i8* nocapture %0, float* %1, i64* %2, i64* nocapture %3) {
%5 = alloca [4096 x i8]
%6 = load i32, i32* @O_RDONLY
%7 = tail call i32 @open(i8* %0, i32 %6)
%8 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%9 = call i32 @read(i32 %7, i8* %8, i32 4096)
%10 = tail call i32 @close(i32 %7)
%11 = call i32 @parse(i8* %8, float* %1, i64* %2)
%12 = load i64, i64* %2
%13 = load i64, i64* %3
%14 = icmp sgt i64 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %4
store i64 %12, i64* %3
br label %16
16: ; preds = %15, %4
ret void
}