#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*/ FILE;

/* Variables and functions */
scalar_t__ feof(int /*<<< orphan*/ *);
int trace_read_int(int /*<<< orphan*/ *);
int trace_common_nocpu(FILE *f, int *type, int *time, int *task) {
  *type = trace_read_int(f);
  *time = trace_read_int(f);
  *task = trace_read_int(f);
  if (feof(f)) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<trace_common_nocpu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <trace_read_int@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <trace_read_int@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <trace_read_int@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rdi
call   1040 <feof@plt>
cmp    $0x0,%rax
je     118a <trace_common_nocpu+0x6a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1191 <trace_common_nocpu+0x71>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trace_common_nocpu>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
call   1030 <trace_read_int@plt>
mov    %eax,(%r12)
mov    %rbx,%rdi
call   1030 <trace_read_int@plt>
mov    %eax,(%r15)
mov    %rbx,%rdi
call   1030 <trace_read_int@plt>
mov    %eax,(%r14)
mov    %rbx,%rdi
call   1040 <feof@plt>
neg    %rax
sbb    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @trace_common_nocpu(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
store i32* %0, i32** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
%10 = load i32*, i32** %6
%11 = call i32 @trace_read_int(i32* %10)
%12 = load i32*, i32** %7
store i32 %11, i32* %12
%13 = load i32*, i32** %6
%14 = call i32 @trace_read_int(i32* %13)
%15 = load i32*, i32** %8
store i32 %14, i32* %15
%16 = load i32*, i32** %6
%17 = call i32 @trace_read_int(i32* %16)
%18 = load i32*, i32** %9
store i32 %17, i32* %18
%19 = load i32*, i32** %6
%20 = call i64 @feof(i32* %19)
%21 = icmp ne i64 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %4
store i32 -1, i32* %5
br label %24
23: ; preds = %4
store i32 0, i32* %5
br label %24
24: ; preds = %23, %22
%25 = load i32, i32* %5
ret i32 %25
}

LLVM IR (-O2):
define i32 @trace_common_nocpu(i32* %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = tail call i32 @trace_read_int(i32* %0)
store i32 %5, i32* %1
%6 = tail call i32 @trace_read_int(i32* %0)
store i32 %6, i32* %2
%7 = tail call i32 @trace_read_int(i32* %0)
store i32 %7, i32* %3
%8 = tail call i64 @feof(i32* %0)
%9 = icmp ne i64 %8, 0
%10 = sext i1 %9 to i32
ret i32 %10
}