#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 */
typedef struct TYPE_9__ TYPE_2__;
typedef struct TYPE_8__ TYPE_1__;

/* Type definitions */
struct TYPE_8__ {
  int /*<<< orphan*/ other;
};
struct TYPE_9__ {
  TYPE_1__ d;
  int /*<<< orphan*/ type;
};
typedef TYPE_2__ PKCS7;
typedef int /*<<< orphan*/ ASN1_OCTET_STRING;

/* Variables and functions */
int /*<<< orphan*/ ASN1_OCTET_STRING_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ *ASN1_OCTET_STRING_new();
int /*<<< orphan*/ ASN1_TYPE_new();
int /*<<< orphan*/ ASN1_TYPE_set(int /*<<< orphan*/, int /*<<< orphan*/,
                                 int /*<<< orphan*/ *);
int /*<<< orphan*/ NID_id_smime_ct_TSTInfo;
int /*<<< orphan*/ OBJ_nid2obj(int /*<<< orphan*/);
int /*<<< orphan*/ PKCS7_free(TYPE_2__ *);
TYPE_2__ *PKCS7_new();
int /*<<< orphan*/ PKCS7_set_content(TYPE_2__ *, TYPE_2__ *);
int /*<<< orphan*/ V_ASN1_OCTET_STRING;
int TS_TST_INFO_content_new(PKCS7 *p7) {
  PKCS7 *ret = NULL;
  ASN1_OCTET_STRING *octet_string = NULL;
  if (!(ret = PKCS7_new()))
    goto err;
  if (!(ret->d.other = ASN1_TYPE_new()))
    goto err;
  ret->type = OBJ_nid2obj(NID_id_smime_ct_TSTInfo);
  if (!(octet_string = ASN1_OCTET_STRING_new()))
    goto err;
  ASN1_TYPE_set(ret->d.other, V_ASN1_OCTET_STRING, octet_string);
  octet_string = NULL;
  if (!PKCS7_set_content(p7, ret))
    goto err;
  return 1;
err:
  ASN1_OCTET_STRING_free(octet_string);
  PKCS7_free(ret);
  return 0;
}


x86 assembly (clang, -O0):
<TS_TST_INFO_content_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   1040 <PKCS7_new@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    11b6 <TS_TST_INFO_content_new+0x36>
jmp    1249 <TS_TST_INFO_content_new+0xc9>
mov    $0x0,%al
call   1030 <ASN1_TYPE_new@plt>
mov    -0x18(%rbp),%rcx
mov    %eax,(%rcx)
cmp    $0x0,%eax
jne    11d1 <TS_TST_INFO_content_new+0x51>
jmp    1249 <TS_TST_INFO_content_new+0xc9>
mov    0x2e10(%rip),%rax
mov    (%rax),%edi
call   1070 <OBJ_nid2obj@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    $0x0,%al
call   1050 <ASN1_OCTET_STRING_new@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1202 <TS_TST_INFO_content_new+0x82>
jmp    1249 <TS_TST_INFO_content_new+0xc9>
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
mov    0x2dc9(%rip),%rax
mov    (%rax),%esi
mov    -0x20(%rbp),%rdx
call   10a0 <ASN1_TYPE_set@plt>
movq   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1080 <PKCS7_set_content@plt>
cmp    $0x0,%eax
jne    123d <TS_TST_INFO_content_new+0xbd>
jmp    1249 <TS_TST_INFO_content_new+0xc9>
movl   $0x1,-0x4(%rbp)
jmp    1262 <TS_TST_INFO_content_new+0xe2>
mov    -0x20(%rbp),%rdi
call   1060 <ASN1_OCTET_STRING_free@plt>
mov    -0x18(%rbp),%rdi
call   1090 <PKCS7_free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TS_TST_INFO_content_new>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1040 <PKCS7_new@plt>
mov    %rax,%rbx
test   %rax,%rax
je     11e9 <TS_TST_INFO_content_new+0x69>
xor    %eax,%eax
call   1030 <ASN1_TYPE_new@plt>
mov    %eax,(%rbx)
test   %eax,%eax
je     11e9 <TS_TST_INFO_content_new+0x69>
mov    0x2e3e(%rip),%rax
mov    (%rax),%edi
call   1070 <OBJ_nid2obj@plt>
mov    %eax,0x4(%rbx)
xor    %eax,%eax
call   1050 <ASN1_OCTET_STRING_new@plt>
test   %rax,%rax
je     11e9 <TS_TST_INFO_content_new+0x69>
mov    (%rbx),%edi
mov    0x2e0f(%rip),%rcx
mov    (%rcx),%esi
mov    %rax,%rdx
call   10a0 <ASN1_TYPE_set@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1080 <PKCS7_set_content@plt>
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
jne    11fa <TS_TST_INFO_content_new+0x7a>
xor    %edi,%edi
call   1060 <ASN1_OCTET_STRING_free@plt>
mov    %rbx,%rdi
call   1090 <PKCS7_free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.TYPE_9__ = type { %struct.TYPE_8__, i32 }
%struct.TYPE_8__ = type { i32 }
@NID_id_smime_ct_TSTInfo = global i32 0
@V_ASN1_OCTET_STRING = global i32 0
define i32 @TS_TST_INFO_content_new(%struct.TYPE_9__* %0) {
%2 = alloca i32
%3 = alloca %struct.TYPE_9__*
%4 = alloca %struct.TYPE_9__*
%5 = alloca i32*
store %struct.TYPE_9__* %0, %struct.TYPE_9__** %3
store %struct.TYPE_9__* null, %struct.TYPE_9__** %4
store i32* null, i32** %5
%6 = call %struct.TYPE_9__* (...) @PKCS7_new()
store %struct.TYPE_9__* %6, %struct.TYPE_9__** %4
%7 = icmp ne %struct.TYPE_9__* %6, null
br i1 %7, label %9, label %8
8: ; preds = %1
br label %38
9: ; preds = %1
%10 = call i32 (...) @ASN1_TYPE_new()
%11 = load %struct.TYPE_9__*, %struct.TYPE_9__** %4
%12 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %11, i32 0, i32 0
%13 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %12, i32 0, i32 0
store i32 %10, i32* %13
%14 = icmp ne i32 %10, 0
br i1 %14, label %16, label %15
15: ; preds = %9
br label %38
16: ; preds = %9
%17 = load i32, i32* @NID_id_smime_ct_TSTInfo
%18 = call i32 @OBJ_nid2obj(i32 %17)
%19 = load %struct.TYPE_9__*, %struct.TYPE_9__** %4
%20 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %19, i32 0, i32 1
store i32 %18, i32* %20
%21 = call i32* (...) @ASN1_OCTET_STRING_new()
store i32* %21, i32** %5
%22 = icmp ne i32* %21, null
br i1 %22, label %24, label %23
23: ; preds = %16
br label %38
24: ; preds = %16
%25 = load %struct.TYPE_9__*, %struct.TYPE_9__** %4
%26 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %25, i32 0, i32 0
%27 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %26, i32 0, i32 0
%28 = load i32, i32* %27
%29 = load i32, i32* @V_ASN1_OCTET_STRING
%30 = load i32*, i32** %5
%31 = call i32 @ASN1_TYPE_set(i32 %28, i32 %29, i32* %30)
store i32* null, i32** %5
%32 = load %struct.TYPE_9__*, %struct.TYPE_9__** %3
%33 = load %struct.TYPE_9__*, %struct.TYPE_9__** %4
%34 = call i32 @PKCS7_set_content(%struct.TYPE_9__* %32, %struct.TYPE_9__* %33)
%35 = icmp ne i32 %34, 0
br i1 %35, label %37, label %36
36: ; preds = %24
br label %38
37: ; preds = %24
store i32 1, i32* %2
br label %43
38: ; preds = %36, %23, %15, %8
%39 = load i32*, i32** %5
%40 = call i32 @ASN1_OCTET_STRING_free(i32* %39)
%41 = load %struct.TYPE_9__*, %struct.TYPE_9__** %4
%42 = call i32 @PKCS7_free(%struct.TYPE_9__* %41)
store i32 0, i32* %2
br label %43
43: ; preds = %38, %37
%44 = load i32, i32* %2
ret i32 %44
}

LLVM IR (-O2):
%struct.TYPE_9__ = type { %struct.TYPE_8__, i32 }
%struct.TYPE_8__ = type { i32 }
@NID_id_smime_ct_TSTInfo = global i32 0
@V_ASN1_OCTET_STRING = global i32 0
define i32 @TS_TST_INFO_content_new(%struct.TYPE_9__* %0) {
%2 = tail call %struct.TYPE_9__* (...) @PKCS7_new()
%3 = icmp eq %struct.TYPE_9__* %2, null
br i1 %3, label %20, label %4
4: ; preds = %1
%5 = tail call i32 (...) @ASN1_TYPE_new()
%6 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %2, i64 0, i32 0, i32 0
store i32 %5, i32* %6
%7 = icmp eq i32 %5, 0
br i1 %7, label %20, label %8
8: ; preds = %4
%9 = load i32, i32* @NID_id_smime_ct_TSTInfo
%10 = tail call i32 @OBJ_nid2obj(i32 %9)
%11 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %2, i64 0, i32 1
store i32 %10, i32* %11
%12 = tail call i32* (...) @ASN1_OCTET_STRING_new()
%13 = icmp eq i32* %12, null
br i1 %13, label %20, label %14
14: ; preds = %8
%15 = load i32, i32* %6
%16 = load i32, i32* @V_ASN1_OCTET_STRING
%17 = tail call i32 @ASN1_TYPE_set(i32 %15, i32 %16, i32* %12)
%18 = tail call i32 @PKCS7_set_content(%struct.TYPE_9__* %0, %struct.TYPE_9__* %2)
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %14, %8, %4, %1
%21 = tail call i32 @ASN1_OCTET_STRING_free(i32* null)
%22 = tail call i32 @PKCS7_free(%struct.TYPE_9__* %2)
br label %23
23: ; preds = %14, %20
%24 = phi i32 [ 0, %20 ], [ 1, %14 ]
ret i32 %24
}