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

/* Variables and functions */
int mgetv(int);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ seof();
int ReadHeaderHeader() {
  static char RoutineName[] = "ReadHeaderHeader";
  int input;
  if ((input = mgetv(16)) != 1) {
    if (seof() == 0) {
      printf(
          "F>%s:R>%s:L>%d: ",
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/maikmerten/p64/refs/heads/master/marker.c",
          RoutineName, 240);
      printf("Illegal GOB Start Code. Read: %d\n", input);
    }
    return (-1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<ReadHeaderHeader>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x10,%edi
call   1030 <mgetv@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x1,%eax
je     119d <ReadHeaderHeader+0x6d>
mov    $0x0,%al
call   1050 <seof@plt>
cmp    $0x0,%rax
jne    1191 <ReadHeaderHeader+0x61>
lea    0xe9a(%rip),%rdi
lea    0xea4(%rip),%rsi
lea    0x2ecc(%rip),%rdx
mov    $0xf0,%ecx
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xf0b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    11a4 <ReadHeaderHeader+0x74>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadHeaderHeader>:
push   %rbp
push   %rbx
push   %rax
mov    $0x10,%edi
call   1030 <mgetv@plt>
xor    %ebx,%ebx
cmp    $0x1,%eax
je     1188 <ReadHeaderHeader+0x58>
mov    %eax,%ebp
xor    %eax,%eax
call   1050 <seof@plt>
mov    $0xffffffff,%ebx
test   %rax,%rax
jne    1188 <ReadHeaderHeader+0x58>
lea    0xea2(%rip),%rdi
lea    0xeac(%rip),%rsi
lea    0x2ed4(%rip),%rdx
mov    $0xf0,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf16(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@ReadHeaderHeader.RoutineName = internal global [17 x i8] c"ReadHeaderHeader\00"
@.str = [17 x i8] c"F>%s:R>%s:L>%d: \00"
@.str.1 = [132 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/maikmerten/p64/refs/heads/master/marker.c\00"
@.str.2 = [34 x i8] c"Illegal GOB Start Code. Read: %d\0A\00"
define i32 @ReadHeaderHeader() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @mgetv(i32 16)
store i32 %3, i32* %2
%4 = icmp ne i32 %3, 1
br i1 %4, label %5, label %13
5: ; preds = %0
%6 = call i64 (...) @seof()
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([132 x i8], [132 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @ReadHeaderHeader.RoutineName, i64 0, i64 0), i32 240)
%10 = load i32, i32* %2
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %8, %5
store i32 -1, i32* %1
br label %14
13: ; preds = %0
store i32 0, i32* %1
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@ReadHeaderHeader.RoutineName = internal global [17 x i8] c"ReadHeaderHeader\00"
@.str = [17 x i8] c"F>%s:R>%s:L>%d: \00"
@.str.1 = [132 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/maikmerten/p64/refs/heads/master/marker.c\00"
@.str.2 = [34 x i8] c"Illegal GOB Start Code. Read: %d\0A\00"
define i32 @ReadHeaderHeader() {
%1 = tail call i32 @mgetv(i32 16)
%2 = icmp eq i32 %1, 1
br i1 %2, label %9, label %3
3: ; preds = %0
%4 = tail call i64 (...) @seof()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([132 x i8], [132 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @ReadHeaderHeader.RoutineName, i64 0, i64 0), i32 240)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i32 %1)
br label %9
9: ; preds = %0, %3, %6
%10 = phi i32 [ -1, %6 ], [ -1, %3 ], [ 0, %0 ]
ret i32 %10
}