#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 uint32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
uint32_t get32(FILE *file) {
  uint32_t t = 0;
  for (unsigned int i = 0; i < 4; i += 1) {
    int c = getc(file);
    do {
      if (!(c != EOF)) {
        fprintf(
            stderr,
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/hcs64/vorbis_sep/refs/heads/master/ogg.c"
            " %d: "
            "c != EOF"
            " failed\n",
            63);
        exit(EXIT_FAILURE);
      }
    } while (0);
    t *= 0x100;
    t += c;
  }
  return t;
}


x86 assembly (clang, -O0):
<get32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jae    11bf <get32+0x8f>
mov    -0x8(%rbp),%rdi
call   1050 <getc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2e7e(%rip),%rcx
cmp    (%rcx),%eax
jne    119a <get32+0x6a>
mov    0x2e5f(%rip),%rax
mov    (%rax),%edi
lea    0xe7e(%rip),%rsi
mov    $0x3f,%edx
call   1030 <fprintf@plt>
mov    0x2e3d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
jmp    119f <get32+0x6f>
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    114a <get32+0x1a>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get32>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdi,%r15
call   1050 <getc@plt>
mov    0x2ea1(%rip),%r12
cmp    (%r12),%eax
je     1198 <get32+0x68>
mov    %eax,%r14d
mov    %r15,%rdi
call   1050 <getc@plt>
cmp    (%r12),%eax
je     1198 <get32+0x68>
mov    %eax,%ebp
mov    %r15,%rdi
call   1050 <getc@plt>
cmp    (%r12),%eax
je     1198 <get32+0x68>
mov    %eax,%ebx
mov    %r15,%rdi
call   1050 <getc@plt>
cmp    (%r12),%eax
je     1198 <get32+0x68>
shl    $0x8,%r14d
add    %r14d,%ebp
shl    $0x8,%ebp
add    %ebp,%ebx
shl    $0x8,%ebx
add    %ebx,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2e39(%rip),%rax
mov    (%rax),%edi
lea    0xe58(%rip),%rsi
mov    $0x3f,%edx
call   1030 <fprintf@plt>
mov    0x2e17(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EOF = global i32 0
@stderr = global i32 0
@.str = [152 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/hcs64/vorbis_sep/refs/heads/master/ogg.c %d: c != EOF failed\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @get32(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %6
6: ; preds = %28, %1
%7 = load i32, i32* %4
%8 = icmp ult i32 %7, 4
br i1 %8, label %9, label %31
9: ; preds = %6
%10 = load i32*, i32** %2
%11 = call i32 @getc(i32* %10)
store i32 %11, i32* %5
br label %12
12: ; preds = %9
%13 = load i32, i32* %5
%14 = load i32, i32* @EOF
%15 = icmp ne i32 %13, %14
br i1 %15, label %21, label %16
16: ; preds = %12
%17 = load i32, i32* @stderr
%18 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str, i64 0, i64 0), i32 63)
%19 = load i32, i32* @EXIT_FAILURE
%20 = call i32 @exit(i32 %19)
unreachable
21: ; preds = %12
br label %22
22: ; preds = %21
%23 = load i32, i32* %3
%24 = mul nsw i32 %23, 256
store i32 %24, i32* %3
%25 = load i32, i32* %5
%26 = load i32, i32* %3
%27 = add nsw i32 %26, %25
store i32 %27, i32* %3
br label %28
28: ; preds = %22
%29 = load i32, i32* %4
%30 = add i32 %29, 1
store i32 %30, i32* %4
br label %6
31: ; preds = %6
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
@EOF = global i32 0
@stderr = global i32 0
@.str = [152 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/hcs64/vorbis_sep/refs/heads/master/ogg.c %d: c != EOF failed\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @get32(i32* nocapture %0) {
%2 = tail call i32 @getc(i32* %0)
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %2, %3
br i1 %4, label %5, label %10
5: ; preds = %18, %14, %10, %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str, i64 0, i64 0), i32 63)
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
%11 = tail call i32 @getc(i32* %0)
%12 = load i32, i32* @EOF
%13 = icmp eq i32 %11, %12
br i1 %13, label %5, label %14
14: ; preds = %10
%15 = tail call i32 @getc(i32* %0)
%16 = load i32, i32* @EOF
%17 = icmp eq i32 %15, %16
br i1 %17, label %5, label %18
18: ; preds = %14
%19 = tail call i32 @getc(i32* %0)
%20 = load i32, i32* @EOF
%21 = icmp eq i32 %19, %20
br i1 %21, label %5, label %22
22: ; preds = %18
%23 = shl nsw i32 %2, 8
%24 = add nsw i32 %11, %23
%25 = shl nsw i32 %24, 8
%26 = add nsw i32 %15, %25
%27 = shl nsw i32 %26, 8
%28 = add nsw i32 %19, %27
ret i32 %28
}