#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*/ *);
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 (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    119e <CMS_data_create+0x6e>
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     118d <CMS_data_create+0x5d>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    119e <CMS_data_create+0x6e>
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,%r14d
mov    %rdi,%rbp
xor    %eax,%eax
call   1030 <cms_Data_create@plt>
test   %rax,%rax
je     1166 <CMS_data_create+0x36>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %rbp,%rsi
xor    %edx,%edx
mov    %r14d,%ecx
call   1040 <CMS_final@plt>
test   %rax,%rax
jne    1168 <CMS_data_create+0x38>
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):
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 %22
11: ; preds = %2
%12 = load i32*, i32** %6
%13 = load i32*, i32** %4
%14 = load i32, i32* %5
%15 = call i64 @CMS_final(i32* %12, i32* %13, i32* null, i32 %14)
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %11
%18 = load i32*, i32** %6
store i32* %18, i32** %3
br label %22
19: ; preds = %11
%20 = load i32*, i32** %6
%21 = call i32 @CMS_ContentInfo_free(i32* %20)
store i32* null, i32** %3
br label %22
22: ; preds = %19, %17, %10
%23 = load i32*, i32** %3
ret i32* %23
}

LLVM IR (-O2):
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 %10, label %5
5: ; preds = %2
%6 = tail call i64 @CMS_final(i32* %3, i32* %0, i32* null, i32 %1)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @CMS_ContentInfo_free(i32* %3)
br label %10
10: ; preds = %5, %2, %8
%11 = phi i32* [ null, %8 ], [ null, %2 ], [ %3, %5 ]
ret i32* %11
}