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

/* Variables and functions */
int /*<<< orphan*/ BIO_snprintf(char *, int, char *, int);
scalar_t__ ULONG_MAX;
int /*<<< orphan*/ test_int_eq(char *, int, char *, char *, int /*<<< orphan*/,
                               int);
int test_big(void) {
  char buf[80];
  if (!test_int_eq(
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/papyrussolution/OpenPapyrus/refs/heads/"
          "master/Src/OSF/OpenSSL-111/test/bioprinttest.c",
          247,
          "BIO_snprintf(buf, sizeof(buf), \"%f\\n\", 2 * (double)ULONG_MAX)",
          "-1", BIO_snprintf(buf, sizeof(buf), "%f\n", 2 * (double)ULONG_MAX),
          -1))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<test_big>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    -0x60(%rbp),%rdi
mov    0x2ea5(%rip),%rax
cvtsi2sdq (%rax),%xmm1
movsd  0xec0(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
mov    $0x50,%esi
lea    0xfa5(%rip),%rdx
call   1040 <BIO_snprintf@plt>
mov    %eax,%r8d
lea    0xea5(%rip),%rdi
mov    $0xf7,%esi
lea    0xf49(%rip),%rdx
lea    0xf80(%rip),%rcx
mov    $0xffffffff,%r9d
call   1030 <test_int_eq@plt>
cmp    $0x0,%eax
jne    1196 <test_big+0x76>
movl   $0x0,-0x4(%rbp)
jmp    119d <test_big+0x7d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_big>:
sub    $0x58,%rsp
mov    0x2ead(%rip),%rax
cvtsi2sdq (%rax),%xmm0
addsd  %xmm0,%xmm0
cvttsd2si %xmm0,%ecx
lea    0xfb2(%rip),%rdx
mov    %rsp,%rdi
mov    $0x50,%esi
call   1040 <BIO_snprintf@plt>
lea    0xead(%rip),%rdi
lea    0xf56(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0xf7,%esi
mov    %eax,%r8d
mov    $0xffffffff,%r9d
call   1030 <test_int_eq@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
add    $0x58,%rsp
ret

LLVM IR (-O0):
@.str = [176 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/papyrussolution/OpenPapyrus/refs/heads/master/Src/OSF/OpenSSL-111/test/bioprinttest.c\00"
@.str.1 = [62 x i8] c"BIO_snprintf(buf, sizeof(buf), \22%f\\n\22, 2 * (double)ULONG_MAX)\00"
@.str.2 = [3 x i8] c"-1\00"
@.str.3 = [4 x i8] c"%f\0A\00"
@ULONG_MAX = global i64 0
define i32 @test_big() {
%1 = alloca i32
%2 = alloca [80 x i8]
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%4 = load i64, i64* @ULONG_MAX
%5 = sitofp i64 %4 to double
%6 = fmul double 2.000000e+00, %5
%7 = fptosi double %6 to i32
%8 = call i32 @BIO_snprintf(i8* %3, i32 80, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %7)
%9 = call i32 @test_int_eq(i8* getelementptr inbounds ([176 x i8], [176 x i8]* @.str, i64 0, i64 0), i32 247, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %8, i32 -1)
%10 = icmp ne i32 %9, 0
br i1 %10, label %12, label %11
11: ; preds = %0
store i32 0, i32* %1
br label %13
12: ; preds = %0
store i32 1, i32* %1
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@.str = [176 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/papyrussolution/OpenPapyrus/refs/heads/master/Src/OSF/OpenSSL-111/test/bioprinttest.c\00"
@.str.1 = [62 x i8] c"BIO_snprintf(buf, sizeof(buf), \22%f\\n\22, 2 * (double)ULONG_MAX)\00"
@.str.2 = [3 x i8] c"-1\00"
@.str.3 = [4 x i8] c"%f\0A\00"
@ULONG_MAX = global i64 0
define i32 @test_big() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = load i64, i64* @ULONG_MAX
%4 = sitofp i64 %3 to double
%5 = fmul double %4, 2.000000e+00
%6 = fptosi double %5 to i32
%7 = call i32 @BIO_snprintf(i8* %2, i32 80, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %6)
%8 = call i32 @test_int_eq(i8* getelementptr inbounds ([176 x i8], [176 x i8]* @.str, i64 0, i64 0), i32 247, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 -1)
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}