#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 */
size_t fread(void *, size_t, size_t, int /*<<< orphan*/ *);
int /*<<< orphan*/ gnom_fatal(char *, int, char *);
void dcffread(void *ptr, size_t size, size_t nmemb, FILE *stream) {
  if (fread(ptr, size, nmemb, stream) != nmemb)
    gnom_fatal("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/camsci/meteor-pi/refs/heads/"
               "master/src/imageProjection/src/error.c",
               161, "file read fail");
  return;
}


x86 assembly (clang, -O0):
<dcffread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <fread@plt>
cmp    -0x18(%rbp),%rax
je     116f <dcffread+0x4f>
lea    0xea2(%rip),%rdi
mov    $0xa1,%esi
lea    0xf33(%rip),%rdx
call   1040 <gnom_fatal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcffread>:
push   %rbx
mov    %rdx,%rbx
call   1030 <fread@plt>
cmp    %rbx,%rax
jne    1130 <dcffread+0x10>
pop    %rbx
ret
lea    0xec9(%rip),%rdi
lea    0xf5f(%rip),%rdx
mov    $0xa1,%esi
pop    %rbx
jmp    1040 <gnom_fatal@plt>

LLVM IR (-O0):
@.str = [157 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/camsci/meteor-pi/refs/heads/master/src/imageProjection/src/error.c\00"
@.str.1 = [15 x i8] c"file read fail\00"
define void @dcffread(i8* %0, i64 %1, i64 %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32* %3, i32** %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = load i32*, i32** %8
%13 = call i64 @fread(i8* %9, i64 %10, i64 %11, i32* %12)
%14 = load i64, i64* %7
%15 = icmp ne i64 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %4
%17 = call i32 @gnom_fatal(i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str, i64 0, i64 0), i32 161, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %16, %4
ret void
}

LLVM IR (-O2):
@.str = [157 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/camsci/meteor-pi/refs/heads/master/src/imageProjection/src/error.c\00"
@.str.1 = [15 x i8] c"file read fail\00"
define void @dcffread(i8* nocapture %0, i64 %1, i64 %2, i32* nocapture %3) {
%5 = tail call i64 @fread(i8* %0, i64 %1, i64 %2, i32* %3)
%6 = icmp eq i64 %5, %2
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @gnom_fatal(i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str, i64 0, i64 0), i32 161, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %4
ret void
}