#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*/ X509_EXTENSION;
typedef int /*<<< orphan*/ ASN1_GENERALIZEDTIME;

/* Variables and functions */
int /*<<< orphan*/ ASN1_GENERALIZEDTIME_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ *ASN1_GENERALIZEDTIME_new();
int /*<<< orphan*/ ASN1_GENERALIZEDTIME_set_string(int /*<<< orphan*/ *,
                                                   char *);
int /*<<< orphan*/ NID_id_pkix_OCSP_archiveCutoff;
int /*<<< orphan*/ *X509V3_EXT_i2d(int /*<<< orphan*/, int /*<<< orphan*/,
                                   int /*<<< orphan*/ *);
X509_EXTENSION *OCSP_archive_cutoff_new(char *tim) {
  X509_EXTENSION *x = NULL;
  ASN1_GENERALIZEDTIME *gt = NULL;
  if (!(gt = ASN1_GENERALIZEDTIME_new()))
    return NULL;
  if (!(ASN1_GENERALIZEDTIME_set_string(gt, tim)))
    goto err;
  x = X509V3_EXT_i2d(NID_id_pkix_OCSP_archiveCutoff, 0, gt);
err:
  if (gt)
    ASN1_GENERALIZEDTIME_free(gt);
  return x;
}


x86 assembly (clang, -O0):
<OCSP_archive_cutoff_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    $0x0,%al
call   1060 <ASN1_GENERALIZEDTIME_new@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    117e <OCSP_archive_cutoff_new+0x3e>
movq   $0x0,-0x8(%rbp)
jmp    11cd <OCSP_archive_cutoff_new+0x8d>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <ASN1_GENERALIZEDTIME_set_string@plt>
cmp    $0x0,%eax
jne    1199 <OCSP_archive_cutoff_new+0x59>
jmp    11b1 <OCSP_archive_cutoff_new+0x71>
mov    0x2e40(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rdx
xor    %esi,%esi
call   1030 <X509V3_EXT_i2d@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     11c5 <OCSP_archive_cutoff_new+0x85>
mov    -0x20(%rbp),%rdi
call   1040 <ASN1_GENERALIZEDTIME_free@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OCSP_archive_cutoff_new>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
xor    %r14d,%r14d
xor    %eax,%eax
call   1060 <ASN1_GENERALIZEDTIME_new@plt>
test   %rax,%rax
je     118c <OCSP_archive_cutoff_new+0x4c>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
call   1050 <ASN1_GENERALIZEDTIME_set_string@plt>
test   %eax,%eax
je     1181 <OCSP_archive_cutoff_new+0x41>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <X509V3_EXT_i2d@plt>
mov    %rax,%r14
jmp    1184 <OCSP_archive_cutoff_new+0x44>
xor    %r14d,%r14d
mov    %rbx,%rdi
call   1040 <ASN1_GENERALIZEDTIME_free@plt>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@NID_id_pkix_OCSP_archiveCutoff = global i32 0
define i32* @OCSP_archive_cutoff_new(i8* %0) {
%2 = alloca i32*
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32*
store i8* %0, i8** %3
store i32* null, i32** %4
store i32* null, i32** %5
%6 = call i32* (...) @ASN1_GENERALIZEDTIME_new()
store i32* %6, i32** %5
%7 = icmp ne i32* %6, null
br i1 %7, label %9, label %8
8: ; preds = %1
store i32* null, i32** %2
br label %27
9: ; preds = %1
%10 = load i32*, i32** %5
%11 = load i8*, i8** %3
%12 = call i32 @ASN1_GENERALIZEDTIME_set_string(i32* %10, i8* %11)
%13 = icmp ne i32 %12, 0
br i1 %13, label %15, label %14
14: ; preds = %9
br label %19
15: ; preds = %9
%16 = load i32, i32* @NID_id_pkix_OCSP_archiveCutoff
%17 = load i32*, i32** %5
%18 = call i32* @X509V3_EXT_i2d(i32 %16, i32 0, i32* %17)
store i32* %18, i32** %4
br label %19
19: ; preds = %15, %14
%20 = load i32*, i32** %5
%21 = icmp ne i32* %20, null
br i1 %21, label %22, label %25
22: ; preds = %19
%23 = load i32*, i32** %5
%24 = call i32 @ASN1_GENERALIZEDTIME_free(i32* %23)
br label %25
25: ; preds = %22, %19
%26 = load i32*, i32** %4
store i32* %26, i32** %2
br label %27
27: ; preds = %25, %8
%28 = load i32*, i32** %2
ret i32* %28
}

LLVM IR (-O2):
@NID_id_pkix_OCSP_archiveCutoff = global i32 0
define i32* @OCSP_archive_cutoff_new(i8* %0) {
%2 = tail call i32* (...) @ASN1_GENERALIZEDTIME_new()
%3 = icmp eq i32* %2, null
br i1 %3, label %13, label %4
4: ; preds = %1
%5 = tail call i32 @ASN1_GENERALIZEDTIME_set_string(i32* %2, i8* %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = load i32, i32* @NID_id_pkix_OCSP_archiveCutoff
%9 = tail call i32* @X509V3_EXT_i2d(i32 %8, i32 0, i32* %2)
br label %10
10: ; preds = %7, %4
%11 = phi i32* [ %9, %7 ], [ null, %4 ]
%12 = tail call i32 @ASN1_GENERALIZEDTIME_free(i32* %2)
br label %13
13: ; preds = %1, %10
%14 = phi i32* [ %11, %10 ], [ null, %1 ]
ret i32* %14
}