#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 */
unsigned char fgetc(int /*<<< orphan*/ *);
unsigned int getCount4(FILE *infile) {
  unsigned char b1, b2, b3, b4;
  b1 = fgetc(infile);
  b2 = fgetc(infile);
  b3 = fgetc(infile);
  b4 = fgetc(infile);
  return ((unsigned int)b1 << 24) | ((unsigned int)b2 << 16) |
         ((unsigned int)b3 << 8) | ((unsigned int)b4 << 0);
}


x86 assembly (clang, -O0):
<getCount4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,-0xb(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
shl    $0x18,%eax
movzbl -0xa(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
movzbl -0xb(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzbl -0xc(%rbp),%ecx
shl    $0x0,%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCount4>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <fgetc@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <fgetc@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
call   1030 <fgetc@plt>
mov    %eax,%r15d
mov    %rbx,%rdi
call   1030 <fgetc@plt>
movzbl %bpl,%ecx
shl    $0x18,%ecx
movzbl %r14b,%edx
shl    $0x10,%edx
or     %ecx,%edx
movzbl %r15b,%ecx
shl    $0x8,%ecx
or     %edx,%ecx
movzbl %al,%eax
or     %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @getCount4(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i32* %0, i32** %2
%7 = load i32*, i32** %2
%8 = call zeroext i8 @fgetc(i32* %7)
store i8 %8, i8* %3
%9 = load i32*, i32** %2
%10 = call zeroext i8 @fgetc(i32* %9)
store i8 %10, i8* %4
%11 = load i32*, i32** %2
%12 = call zeroext i8 @fgetc(i32* %11)
store i8 %12, i8* %5
%13 = load i32*, i32** %2
%14 = call zeroext i8 @fgetc(i32* %13)
store i8 %14, i8* %6
%15 = load i8, i8* %3
%16 = zext i8 %15 to i32
%17 = shl i32 %16, 24
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = shl i32 %19, 16
%21 = or i32 %17, %20
%22 = load i8, i8* %5
%23 = zext i8 %22 to i32
%24 = shl i32 %23, 8
%25 = or i32 %21, %24
%26 = load i8, i8* %6
%27 = zext i8 %26 to i32
%28 = shl i32 %27, 0
%29 = or i32 %25, %28
ret i32 %29
}

LLVM IR (-O2):
define i32 @getCount4(i32* nocapture %0) {
%2 = tail call zeroext i8 @fgetc(i32* %0)
%3 = tail call zeroext i8 @fgetc(i32* %0)
%4 = tail call zeroext i8 @fgetc(i32* %0)
%5 = tail call zeroext i8 @fgetc(i32* %0)
%6 = zext i8 %2 to i32
%7 = shl nuw i32 %6, 24
%8 = zext i8 %3 to i32
%9 = shl nuw nsw i32 %8, 16
%10 = or i32 %9, %7
%11 = zext i8 %4 to i32
%12 = shl nuw nsw i32 %11, 8
%13 = or i32 %10, %12
%14 = zext i8 %5 to i32
%15 = or i32 %13, %14
ret i32 %15
}