#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*/ ASN1_OCTET_STRING;

/* Variables and functions */
int /*<<< orphan*/ CMS_F_CHECK_CONTENT;
int /*<<< orphan*/ CMS_R_NO_CONTENT;
int /*<<< orphan*/ **CMS_get0_content(int /*<<< orphan*/ *);
int /*<<< orphan*/ CMSerr(int /*<<< orphan*/, int /*<<< orphan*/);
int check_content(CMS_ContentInfo *cms) {
  ASN1_OCTET_STRING **pos = CMS_get0_content(cms);
  if (!pos || !*pos) {
    CMSerr(CMS_F_CHECK_CONTENT, CMS_R_NO_CONTENT);
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<check_content>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <CMS_get0_content@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1152 <check_content+0x32>
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1175 <check_content+0x55>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
mov    0x2e76(%rip),%rax
mov    (%rax),%esi
call   1030 <CMSerr@plt>
movl   $0x0,-0x4(%rbp)
jmp    117c <check_content+0x5c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_content>:
push   %rax
call   1040 <CMS_get0_content@plt>
test   %rax,%rax
je     113b <check_content+0x1b>
mov    %rax,%rcx
mov    $0x1,%eax
cmpq   $0x0,(%rcx)
je     113b <check_content+0x1b>
pop    %rcx
ret
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    0x2e8d(%rip),%rax
mov    (%rax),%esi
call   1030 <CMSerr@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@CMS_F_CHECK_CONTENT = global i32 0
@CMS_R_NO_CONTENT = global i32 0
define i32 @check_content(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32**
store i32* %0, i32** %3
%5 = load i32*, i32** %3
%6 = call i32** @CMS_get0_content(i32* %5)
store i32** %6, i32*** %4
%7 = load i32**, i32*** %4
%8 = icmp ne i32** %7, null
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i32**, i32*** %4
%11 = load i32*, i32** %10
%12 = icmp ne i32* %11, null
br i1 %12, label %17, label %13
13: ; preds = %9, %1
%14 = load i32, i32* @CMS_F_CHECK_CONTENT
%15 = load i32, i32* @CMS_R_NO_CONTENT
%16 = call i32 @CMSerr(i32 %14, i32 %15)
store i32 0, i32* %2
br label %18
17: ; preds = %9
store i32 1, i32* %2
br label %18
18: ; preds = %17, %13
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@CMS_F_CHECK_CONTENT = global i32 0
@CMS_R_NO_CONTENT = global i32 0
define i32 @check_content(i32* %0) {
%2 = tail call i32** @CMS_get0_content(i32* %0)
%3 = icmp eq i32** %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = load i32*, i32** %2
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %11
7: ; preds = %4, %1
%8 = load i32, i32* @CMS_F_CHECK_CONTENT
%9 = load i32, i32* @CMS_R_NO_CONTENT
%10 = tail call i32 @CMSerr(i32 %8, i32 %9)
br label %11
11: ; preds = %4, %7
%12 = phi i32 [ 0, %7 ], [ 1, %4 ]
ret i32 %12
}