#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 */
int EOF;
int getc(int /*<<< orphan*/ *);
long getpfblong(FILE *f) {
  int ch1 = getc(f);
  int ch2 = getc(f);
  int ch3 = getc(f);
  int ch4 = getc(f);
  if (ch4 == EOF)
    return (EOF);
  return (ch4 | (ch3 << 8) | (ch2 << 16) | (ch1 << 24));
}


x86 assembly (clang, -O0):
<getpfblong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    0x2e92(%rip),%rcx
cmp    (%rcx),%eax
jne    1171 <getpfblong+0x61>
mov    0x2e83(%rip),%rax
movslq (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1192 <getpfblong+0x82>
mov    -0x20(%rbp),%eax
mov    -0x1c(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x18(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x14(%rbp),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpfblong>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbp
call   1030 <getc@plt>
mov    %eax,%ebx
mov    %rbp,%rdi
call   1030 <getc@plt>
mov    %eax,%r14d
mov    %rbp,%rdi
call   1030 <getc@plt>
mov    %eax,%r15d
mov    %rbp,%rdi
call   1030 <getc@plt>
mov    0x2ea2(%rip),%rcx
cmp    (%rcx),%eax
je     115d <getpfblong+0x4d>
shl    $0x8,%r15d
shl    $0x10,%r14d
shl    $0x18,%ebx
or     %r14d,%ebx
or     %r15d,%ebx
or     %ebx,%eax
cltq
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i32 0
define i64 @getpfblong(i32* %0) {
%2 = alloca i64
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %3
%8 = load i32*, i32** %3
%9 = call i32 @getc(i32* %8)
store i32 %9, i32* %4
%10 = load i32*, i32** %3
%11 = call i32 @getc(i32* %10)
store i32 %11, i32* %5
%12 = load i32*, i32** %3
%13 = call i32 @getc(i32* %12)
store i32 %13, i32* %6
%14 = load i32*, i32** %3
%15 = call i32 @getc(i32* %14)
store i32 %15, i32* %7
%16 = load i32, i32* %7
%17 = load i32, i32* @EOF
%18 = icmp eq i32 %16, %17
br i1 %18, label %19, label %22
19: ; preds = %1
%20 = load i32, i32* @EOF
%21 = sext i32 %20 to i64
store i64 %21, i64* %2
br label %34
22: ; preds = %1
%23 = load i32, i32* %7
%24 = load i32, i32* %6
%25 = shl i32 %24, 8
%26 = or i32 %23, %25
%27 = load i32, i32* %5
%28 = shl i32 %27, 16
%29 = or i32 %26, %28
%30 = load i32, i32* %4
%31 = shl i32 %30, 24
%32 = or i32 %29, %31
%33 = sext i32 %32 to i64
store i64 %33, i64* %2
br label %34
34: ; preds = %22, %19
%35 = load i64, i64* %2
ret i64 %35
}

LLVM IR (-O2):
@EOF = global i32 0
define i64 @getpfblong(i32* nocapture %0) {
%2 = tail call i32 @getc(i32* %0)
%3 = tail call i32 @getc(i32* %0)
%4 = tail call i32 @getc(i32* %0)
%5 = tail call i32 @getc(i32* %0)
%6 = load i32, i32* @EOF
%7 = icmp eq i32 %5, %6
br i1 %7, label %15, label %8
8: ; preds = %1
%9 = shl i32 %4, 8
%10 = shl i32 %3, 16
%11 = shl i32 %2, 24
%12 = or i32 %10, %11
%13 = or i32 %12, %9
%14 = or i32 %13, %5
br label %15
15: ; preds = %1, %8
%16 = phi i32 [ %14, %8 ], [ %5, %1 ]
%17 = sext i32 %16 to i64
ret i64 %17
}