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

/* Type definitions */
struct TYPE_3__ {
  int flags;
  int /*<<< orphan*/ item;
};
typedef int /*<<< orphan*/ ASN1_VALUE;
typedef TYPE_1__ ASN1_TEMPLATE;

/* Variables and functions */
int ASN1_TFLG_ADB_MASK;
int ASN1_TFLG_SK_MASK;
int /*<<< orphan*/ asn1_item_clear(int /*<<< orphan*/ **, int /*<<< orphan*/);
void asn1_template_clear(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt) {
  if (tt->flags & (ASN1_TFLG_ADB_MASK | ASN1_TFLG_SK_MASK))
    *pval = NULL;
  else
    asn1_item_clear(pval, tt->item);
}


x86 assembly (clang, -O0):
<asn1_template_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    0x2ea3(%rip),%rcx
mov    (%rcx),%ecx
mov    0x2eaa(%rip),%rdx
or     (%rdx),%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1153 <asn1_template_clear+0x43>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
jmp    1163 <asn1_template_clear+0x53>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%esi
call   1030 <asn1_item_clear@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asn1_template_clear>:
mov    0x2eb9(%rip),%rax
mov    0x2ec2(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
test   %ecx,(%rsi)
je     112e <asn1_template_clear+0x1e>
movq   $0x0,(%rdi)
ret
mov    0x4(%rsi),%esi
jmp    1030 <asn1_item_clear@plt>

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32 }
@ASN1_TFLG_ADB_MASK = global i32 0
@ASN1_TFLG_SK_MASK = global i32 0
define void @asn1_template_clear(i32** %0, %struct.TYPE_3__* %1) {
%3 = alloca i32**
%4 = alloca %struct.TYPE_3__*
store i32** %0, i32*** %3
store %struct.TYPE_3__* %1, %struct.TYPE_3__** %4
%5 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = load i32, i32* @ASN1_TFLG_ADB_MASK
%9 = load i32, i32* @ASN1_TFLG_SK_MASK
%10 = or i32 %8, %9
%11 = and i32 %7, %10
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = load i32**, i32*** %3
store i32* null, i32** %14
br label %21
15: ; preds = %2
%16 = load i32**, i32*** %3
%17 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%18 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %17, i32 0, i32 1
%19 = load i32, i32* %18
%20 = call i32 @asn1_item_clear(i32** %16, i32 %19)
br label %21
21: ; preds = %15, %13
ret void
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32, i32 }
@ASN1_TFLG_ADB_MASK = global i32 0
@ASN1_TFLG_SK_MASK = global i32 0
define void @asn1_template_clear(i32** %0, %struct.TYPE_3__* nocapture %1) {
%3 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 0
%4 = load i32, i32* %3
%5 = load i32, i32* @ASN1_TFLG_ADB_MASK
%6 = load i32, i32* @ASN1_TFLG_SK_MASK
%7 = or i32 %6, %5
%8 = and i32 %7, %4
%9 = icmp eq i32 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %2
store i32* null, i32** %0
br label %15
11: ; preds = %2
%12 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 1
%13 = load i32, i32* %12
%14 = tail call i32 @asn1_item_clear(i32** %0, i32 %13)
br label %15
15: ; preds = %11, %10
ret void
}