#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 */
float checkPDFFileByFile(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
void _file(FILE *file) {
  printf(" -- API Test (FILE*-based) --\n");
  float score = checkPDFFileByFile(file);
  if (score < 0) {
    fprintf(stderr, "An error occured in _file()!\n");
    return;
  }
  printf("API call (file): %.2f of %.2f points\n", score, 7.5f);
}


x86 assembly (clang, -O0):
<_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <checkPDFFileByFile@plt>
movss  %xmm0,-0xc(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    117f <_file+0x4f>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
lea    0xeb2(%rip),%rsi
call   1050 <fprintf@plt>
jmp    119e <_file+0x6e>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb6(%rip),%rdi
movsd  0xe69(%rip),%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_file>:
push   %rbx
mov    %rdi,%rbx
lea    0xf01(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1030 <checkPDFFileByFile@plt>
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
jbe    1176 <_file+0x36>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
lea    0xe98(%rip),%rsi
pop    %rbx
jmp    1060 <fprintf@plt>
cvtss2sd %xmm0,%xmm0
lea    0xea5(%rip),%rdi
movsd  0xe77(%rip),%xmm1
mov    $0x2,%al
pop    %rbx
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [31 x i8] c" -- API Test (FILE*-based) --\0A\00"
@stderr = global i32 0
@.str.1 = [30 x i8] c"An error occured in _file()!\0A\00"
@.str.2 = [38 x i8] c"API call (file): %.2f of %.2f points\0A\00"
define void @_file(i32* %0) {
%2 = alloca i32*
%3 = alloca float
store i32* %0, i32** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%5 = load i32*, i32** %2
%6 = call float @checkPDFFileByFile(i32* %5)
store float %6, float* %3
%7 = load float, float* %3
%8 = fcmp olt float %7, 0.000000e+00
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
br label %16
12: ; preds = %1
%13 = load float, float* %3
%14 = fpext float %13 to double
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), double %14, double 7.500000e+00)
br label %16
16: ; preds = %12, %9
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str.1 = [30 x i8] c"An error occured in _file()!\0A\00"
@.str.2 = [38 x i8] c"API call (file): %.2f of %.2f points\0A\00"
@str = [30 x i8] c" -- API Test (FILE*-based) --\00"
define void @_file(i32* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%3 = tail call float @checkPDFFileByFile(i32* %0)
%4 = fcmp olt float %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
br label %11
8: ; preds = %1
%9 = fpext float %3 to double
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), double %9, double 7.500000e+00)
br label %11
11: ; preds = %8, %5
ret void
}