#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*/ time_t;
typedef int /*<<< orphan*/ ASN1_TIME;

/* Variables and functions */
int /*<<< orphan*/ *ASN1_TIME_adj(int /*<<< orphan*/ *, int /*<<< orphan*/, int,
                                  int /*<<< orphan*/);
int /*<<< orphan*/ ASN1_TIME_free(int /*<<< orphan*/ *);
int X509_cmp_time(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ test_int_eq(char *, int, char *, char *, int, int);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int test_x509_cmp_time_current(void) {
  time_t now = time(NULL);
  ASN1_TIME *asn1_before = NULL, *asn1_after = NULL;
  int cmp_result, failed = 0;
  asn1_before = ASN1_TIME_adj(NULL, now, -1, 0);
  asn1_after = ASN1_TIME_adj(NULL, now, 1, 0);
  cmp_result = X509_cmp_time(asn1_before, NULL);
  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/x509_time_test.c",
          286, "cmp_result", "-1", cmp_result, -1))
    failed = 1;
  cmp_result = X509_cmp_time(asn1_after, NULL);
  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/x509_time_test.c",
          290, "cmp_result", "1", cmp_result, 1))
    failed = 1;
  ASN1_TIME_free(asn1_before);
  ASN1_TIME_free(asn1_after);
  return failed == 0;
}


x86 assembly (clang, -O0):
<test_x509_cmp_time_current>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x4(%rbp),%esi
xor    %eax,%eax
mov    %eax,%edi
mov    $0xffffffff,%edx
xor    %ecx,%ecx
call   1050 <ASN1_TIME_adj@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%esi
xor    %eax,%eax
mov    %eax,%edi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1050 <ASN1_TIME_adj@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <X509_cmp_time@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%r8d
lea    0xe3c(%rip),%rdi
mov    $0x11e,%esi
lea    0xee2(%rip),%rdx
lea    0xee6(%rip),%rcx
mov    $0xffffffff,%r9d
call   1040 <test_int_eq@plt>
cmp    $0x0,%eax
jne    11f2 <test_x509_cmp_time_current+0xa2>
movl   $0x1,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <X509_cmp_time@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%r8d
lea    0xdf3(%rip),%rdi
mov    $0x122,%esi
lea    0xe99(%rip),%rdx
lea    0xe9e(%rip),%rcx
mov    $0x1,%r9d
call   1040 <test_int_eq@plt>
cmp    $0x0,%eax
jne    123b <test_x509_cmp_time_current+0xeb>
movl   $0x1,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1070 <ASN1_TIME_free@plt>
mov    -0x18(%rbp),%rdi
call   1070 <ASN1_TIME_free@plt>
cmpl   $0x0,-0x20(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_x509_cmp_time_current>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%ebx
xor    %edi,%edi
mov    %eax,%esi
mov    $0xffffffff,%edx
xor    %ecx,%ecx
call   1050 <ASN1_TIME_adj@plt>
mov    %rax,%r14
xor    %edi,%edi
mov    %ebx,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1050 <ASN1_TIME_adj@plt>
mov    %rax,%r13
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <X509_cmp_time@plt>
lea    0xe65(%rip),%r15
lea    0xf10(%rip),%r12
lea    0xf14(%rip),%rcx
mov    %r15,%rdi
mov    $0x11e,%esi
mov    %r12,%rdx
mov    %eax,%r8d
mov    $0xffffffff,%r9d
call   1040 <test_int_eq@plt>
test   %eax,%eax
setne  %bpl
mov    %r13,%rdi
xor    %esi,%esi
call   1030 <X509_cmp_time@plt>
lea    0xee5(%rip),%rcx
mov    %r15,%rdi
mov    $0x122,%esi
mov    %r12,%rdx
mov    %eax,%r8d
mov    $0x1,%r9d
call   1040 <test_int_eq@plt>
test   %eax,%eax
setne  %bl
and    %bpl,%bl
mov    %r14,%rdi
call   1070 <ASN1_TIME_free@plt>
mov    %r13,%rdi
call   1070 <ASN1_TIME_free@plt>
movzbl %bl,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [178 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/x509_time_test.c\00"
@.str.1 = [11 x i8] c"cmp_result\00"
@.str.2 = [3 x i8] c"-1\00"
@.str.3 = [2 x i8] c"1\00"
define i32 @test_x509_cmp_time_current() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = call i32 @time(i32* null)
store i32 %6, i32* %1
store i32* null, i32** %2
store i32* null, i32** %3
store i32 0, i32* %5
%7 = load i32, i32* %1
%8 = call i32* @ASN1_TIME_adj(i32* null, i32 %7, i32 -1, i32 0)
store i32* %8, i32** %2
%9 = load i32, i32* %1
%10 = call i32* @ASN1_TIME_adj(i32* null, i32 %9, i32 1, i32 0)
store i32* %10, i32** %3
%11 = load i32*, i32** %2
%12 = call i32 @X509_cmp_time(i32* %11, i32* null)
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = call i32 @test_int_eq(i8* getelementptr inbounds ([178 x i8], [178 x i8]* @.str, i64 0, i64 0), i32 286, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %13, i32 -1)
%15 = icmp ne i32 %14, 0
br i1 %15, label %17, label %16
16: ; preds = %0
store i32 1, i32* %5
br label %17
17: ; preds = %16, %0
%18 = load i32*, i32** %3
%19 = call i32 @X509_cmp_time(i32* %18, i32* null)
store i32 %19, i32* %4
%20 = load i32, i32* %4
%21 = call i32 @test_int_eq(i8* getelementptr inbounds ([178 x i8], [178 x i8]* @.str, i64 0, i64 0), i32 290, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 %20, i32 1)
%22 = icmp ne i32 %21, 0
br i1 %22, label %24, label %23
23: ; preds = %17
store i32 1, i32* %5
br label %24
24: ; preds = %23, %17
%25 = load i32*, i32** %2
%26 = call i32 @ASN1_TIME_free(i32* %25)
%27 = load i32*, i32** %3
%28 = call i32 @ASN1_TIME_free(i32* %27)
%29 = load i32, i32* %5
%30 = icmp eq i32 %29, 0
%31 = zext i1 %30 to i32
ret i32 %31
}

LLVM IR (-O2):
@.str = [178 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/x509_time_test.c\00"
@.str.1 = [11 x i8] c"cmp_result\00"
@.str.2 = [3 x i8] c"-1\00"
@.str.3 = [2 x i8] c"1\00"
define i32 @test_x509_cmp_time_current() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32* @ASN1_TIME_adj(i32* null, i32 %1, i32 -1, i32 0)
%3 = tail call i32* @ASN1_TIME_adj(i32* null, i32 %1, i32 1, i32 0)
%4 = tail call i32 @X509_cmp_time(i32* %2, i32* null)
%5 = tail call i32 @test_int_eq(i8* getelementptr inbounds ([178 x i8], [178 x i8]* @.str, i64 0, i64 0), i32 286, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %4, i32 -1)
%6 = icmp ne i32 %5, 0
%7 = tail call i32 @X509_cmp_time(i32* %3, i32* null)
%8 = tail call i32 @test_int_eq(i8* getelementptr inbounds ([178 x i8], [178 x i8]* @.str, i64 0, i64 0), i32 290, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 %7, i32 1)
%9 = icmp ne i32 %8, 0
%10 = select i1 %9, i1 %6, i1 false
%11 = tail call i32 @ASN1_TIME_free(i32* %2)
%12 = tail call i32 @ASN1_TIME_free(i32* %3)
%13 = zext i1 %10 to i32
ret i32 %13
}