#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_GENERALIZEDTIME;

/* Variables and functions */
int /*<<< orphan*/ *ASN1_GENERALIZEDTIME_adj_internal(int /*<<< orphan*/ *,
                                                      int /*<<< orphan*/, int,
                                                      long);
int /*<<< orphan*/ M_ASN1_GENERALIZEDTIME_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ *M_ASN1_GENERALIZEDTIME_new();
ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s,
                                               time_t t, int offset_day,
                                               long offset_sec) {
  ASN1_GENERALIZEDTIME *tmp = NULL, *ret;
  if (s == NULL) {
    tmp = M_ASN1_GENERALIZEDTIME_new();
    if (tmp == NULL)
      return NULL;
    s = tmp;
  }
  ret = ASN1_GENERALIZEDTIME_adj_internal(s, t, offset_day, offset_sec);
  if (ret == NULL && tmp != NULL)
    M_ASN1_GENERALIZEDTIME_free(tmp);
  return ret;
}


x86 assembly (clang, -O0):
<ASN1_GENERALIZEDTIME_adj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1184 <ASN1_GENERALIZEDTIME_adj+0x54>
mov    $0x0,%al
call   1050 <M_ASN1_GENERALIZEDTIME_new@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    117c <ASN1_GENERALIZEDTIME_adj+0x4c>
movq   $0x0,-0x8(%rbp)
jmp    11c2 <ASN1_GENERALIZEDTIME_adj+0x92>
mov    -0x28(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x20(%rbp),%rcx
call   1030 <ASN1_GENERALIZEDTIME_adj_internal@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    11ba <ASN1_GENERALIZEDTIME_adj+0x8a>
cmpq   $0x0,-0x28(%rbp)
je     11ba <ASN1_GENERALIZEDTIME_adj+0x8a>
mov    -0x28(%rbp),%rdi
call   1040 <M_ASN1_GENERALIZEDTIME_free@plt>
mov    -0x30(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ASN1_GENERALIZEDTIME_adj>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rcx,%r14
mov    %edx,%r15d
mov    %esi,%r12d
test   %rdi,%rdi
je     114a <ASN1_GENERALIZEDTIME_adj+0x1a>
xor    %ebp,%ebp
jmp    115e <ASN1_GENERALIZEDTIME_adj+0x2e>
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <M_ASN1_GENERALIZEDTIME_new@plt>
mov    %rax,%rdi
mov    %rax,%rbp
test   %rax,%rax
je     1183 <ASN1_GENERALIZEDTIME_adj+0x53>
mov    %r12d,%esi
mov    %r15d,%edx
mov    %r14,%rcx
call   1030 <ASN1_GENERALIZEDTIME_adj_internal@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1183 <ASN1_GENERALIZEDTIME_adj+0x53>
test   %rbp,%rbp
je     1183 <ASN1_GENERALIZEDTIME_adj+0x53>
mov    %rbp,%rdi
call   1040 <M_ASN1_GENERALIZEDTIME_free@plt>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32* @ASN1_GENERALIZEDTIME_adj(i32* %0, i32 %1, i32 %2, i64 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i64
%10 = alloca i32*
%11 = alloca i32*
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i64 %3, i64* %9
store i32* null, i32** %10
%12 = load i32*, i32** %6
%13 = icmp eq i32* %12, null
br i1 %13, label %14, label %21
14: ; preds = %4
%15 = call i32* (...) @M_ASN1_GENERALIZEDTIME_new()
store i32* %15, i32** %10
%16 = load i32*, i32** %10
%17 = icmp eq i32* %16, null
br i1 %17, label %18, label %19
18: ; preds = %14
store i32* null, i32** %5
br label %37
19: ; preds = %14
%20 = load i32*, i32** %10
store i32* %20, i32** %6
br label %21
21: ; preds = %19, %4
%22 = load i32*, i32** %6
%23 = load i32, i32* %7
%24 = load i32, i32* %8
%25 = load i64, i64* %9
%26 = call i32* @ASN1_GENERALIZEDTIME_adj_internal(i32* %22, i32 %23, i32 %24, i64 %25)
store i32* %26, i32** %11
%27 = load i32*, i32** %11
%28 = icmp eq i32* %27, null
br i1 %28, label %29, label %35
29: ; preds = %21
%30 = load i32*, i32** %10
%31 = icmp ne i32* %30, null
br i1 %31, label %32, label %35
32: ; preds = %29
%33 = load i32*, i32** %10
%34 = call i32 @M_ASN1_GENERALIZEDTIME_free(i32* %33)
br label %35
35: ; preds = %32, %29, %21
%36 = load i32*, i32** %11
store i32* %36, i32** %5
br label %37
37: ; preds = %35, %18
%38 = load i32*, i32** %5
ret i32* %38
}

LLVM IR (-O2):
define i32* @ASN1_GENERALIZEDTIME_adj(i32* %0, i32 %1, i32 %2, i64 %3) {
%5 = icmp eq i32* %0, null
br i1 %5, label %6, label %9
6: ; preds = %4
%7 = tail call i32* (...) @M_ASN1_GENERALIZEDTIME_new()
%8 = icmp eq i32* %7, null
br i1 %8, label %18, label %9
9: ; preds = %6, %4
%10 = phi i32* [ %0, %4 ], [ %7, %6 ]
%11 = phi i32* [ null, %4 ], [ %7, %6 ]
%12 = tail call i32* @ASN1_GENERALIZEDTIME_adj_internal(i32* %10, i32 %1, i32 %2, i64 %3)
%13 = icmp eq i32* %12, null
%14 = icmp ne i32* %11, null
%15 = select i1 %13, i1 %14, i1 false
br i1 %15, label %16, label %18
16: ; preds = %9
%17 = tail call i32 @M_ASN1_GENERALIZEDTIME_free(i32* %11)
br label %18
18: ; preds = %9, %16, %6
%19 = phi i32* [ null, %6 ], [ null, %16 ], [ %12, %9 ]
ret i32* %19
}