#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_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  int flags;
  struct TYPE_4__ *data;
};
typedef TYPE_1__ ASN1_STRING;

/* Variables and functions */
int ASN1_STRING_FLAG_EMBED;
int ASN1_STRING_FLAG_NDEF;
int /*<<< orphan*/ OPENSSL_free(TYPE_1__ *);
void ASN1_STRING_free(ASN1_STRING *a) {
  if (a == NULL)
    return;
  if (!(a->flags & ASN1_STRING_FLAG_NDEF))
    OPENSSL_free(a->data);
  if (!(a->flags & ASN1_STRING_FLAG_EMBED))
    OPENSSL_free(a);
}


x86 assembly (clang, -O0):
<ASN1_STRING_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <ASN1_STRING_free+0x1c>
jmp    1172 <ASN1_STRING_free+0x62>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    0x2e9f(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
jne    1151 <ASN1_STRING_free+0x41>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <OPENSSL_free@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    0x2e8a(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
jne    1172 <ASN1_STRING_free+0x62>
mov    -0x8(%rbp),%rdi
call   1030 <OPENSSL_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ASN1_STRING_free>:
push   %rbx
test   %rdi,%rdi
je     113c <ASN1_STRING_free+0x2c>
mov    %rdi,%rbx
mov    (%rdi),%eax
mov    0x2eb6(%rip),%rcx
test   %eax,(%rcx)
jne    1131 <ASN1_STRING_free+0x21>
mov    0x8(%rbx),%rdi
call   1030 <OPENSSL_free@plt>
mov    (%rbx),%eax
mov    0x2eb0(%rip),%rcx
test   %eax,(%rcx)
je     113e <ASN1_STRING_free+0x2e>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <OPENSSL_free@plt>

LLVM IR (-O0):
%struct.TYPE_4__ = type { i32, %struct.TYPE_4__* }
@ASN1_STRING_FLAG_NDEF = global i32 0
@ASN1_STRING_FLAG_EMBED = global i32 0
define void @ASN1_STRING_free(%struct.TYPE_4__* %0) {
%2 = alloca %struct.TYPE_4__*
store %struct.TYPE_4__* %0, %struct.TYPE_4__** %2
%3 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%4 = icmp eq %struct.TYPE_4__* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %28
6: ; preds = %1
%7 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = load i32, i32* %8
%10 = load i32, i32* @ASN1_STRING_FLAG_NDEF
%11 = and i32 %9, %10
%12 = icmp ne i32 %11, 0
br i1 %12, label %18, label %13
13: ; preds = %6
%14 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%15 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %14, i32 0, i32 1
%16 = load %struct.TYPE_4__*, %struct.TYPE_4__** %15
%17 = call i32 @OPENSSL_free(%struct.TYPE_4__* %16)
br label %18
18: ; preds = %13, %6
%19 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%20 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %19, i32 0, i32 0
%21 = load i32, i32* %20
%22 = load i32, i32* @ASN1_STRING_FLAG_EMBED
%23 = and i32 %21, %22
%24 = icmp ne i32 %23, 0
br i1 %24, label %28, label %25
25: ; preds = %18
%26 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%27 = call i32 @OPENSSL_free(%struct.TYPE_4__* %26)
br label %28
28: ; preds = %5, %25, %18
ret void
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { i32, %struct.TYPE_4__* }
@ASN1_STRING_FLAG_NDEF = global i32 0
@ASN1_STRING_FLAG_EMBED = global i32 0
define void @ASN1_STRING_free(%struct.TYPE_4__* %0) {
%2 = icmp eq %struct.TYPE_4__* %0, null
br i1 %2, label %21, label %3
3: ; preds = %1
%4 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %0, i64 0, i32 0
%5 = load i32, i32* %4
%6 = load i32, i32* @ASN1_STRING_FLAG_NDEF
%7 = and i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %3
%10 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %0, i64 0, i32 1
%11 = load %struct.TYPE_4__*, %struct.TYPE_4__** %10
%12 = tail call i32 @OPENSSL_free(%struct.TYPE_4__* %11)
%13 = load i32, i32* %4
br label %14
14: ; preds = %9, %3
%15 = phi i32 [ %13, %9 ], [ %5, %3 ]
%16 = load i32, i32* @ASN1_STRING_FLAG_EMBED
%17 = and i32 %16, %15
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %14
%20 = tail call i32 @OPENSSL_free(%struct.TYPE_4__* %0)
br label %21
21: ; preds = %1, %19, %14
ret void
}