#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*/ CMS_ContentInfo;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int /*<<< orphan*/ CMS_ContentInfo_free(int /*<<< orphan*/ *);
unsigned int CMS_STREAM;
scalar_t__ CMS_final(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                     int /*<<< orphan*/ *, unsigned int);
int /*<<< orphan*/ *cms_Data_create();
CMS_ContentInfo *CMS_data_create(BIO *in, unsigned int flags) {
  CMS_ContentInfo *cms;
  cms = cms_Data_create();
  if (!cms)
    return NULL;
  if ((flags & CMS_STREAM) || CMS_final(cms, in, NULL, flags))
    return cms;
  CMS_ContentInfo_free(cms);
  return NULL;
}


x86 assembly (clang, -O0):
<CMS_data_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    $0x0,%al
call   1030 <cms_Data_create@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1162 <CMS_data_create+0x32>
movq   $0x0,-0x8(%rbp)
jmp    11b3 <CMS_data_create+0x83>
mov    -0x14(%rbp),%eax
mov    0x2e7c(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
jne    1195 <CMS_data_create+0x65>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%ecx
xor    %eax,%eax
mov    %eax,%edx
call   1040 <CMS_final@plt>
cmp    $0x0,%rax
je     11a2 <CMS_data_create+0x72>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11b3 <CMS_data_create+0x83>
mov    -0x20(%rbp),%rdi
call   1050 <CMS_ContentInfo_free@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CMS_data_create>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <cms_Data_create@plt>
test   %rax,%rax
je     116f <CMS_data_create+0x3f>
mov    %rax,%rbx
mov    0x2e99(%rip),%rax
test   %ebp,(%rax)
jne    1171 <CMS_data_create+0x41>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %edx,%edx
mov    %ebp,%ecx
call   1040 <CMS_final@plt>
test   %rax,%rax
jne    1171 <CMS_data_create+0x41>
mov    %rbx,%rdi
call   1050 <CMS_ContentInfo_free@plt>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@CMS_STREAM = global i32 0
define i32* @CMS_data_create(i32* %0, i32 %1) {
%3 = tail call i32* (...) @cms_Data_create()
%4 = icmp eq i32* %3, null
br i1 %4, label %14, label %5
5: ; preds = %2
%6 = load i32, i32* @CMS_STREAM
%7 = and i32 %6, %1
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %5
%10 = tail call i64 @CMS_final(i32* %3, i32* %0, i32* null, i32 %1)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = tail call i32 @CMS_ContentInfo_free(i32* %3)
br label %14
14: ; preds = %5, %9, %2, %12
%15 = phi i32* [ null, %12 ], [ null, %2 ], [ %3, %9 ], [ %3, %5 ]
ret i32* %15
}