#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_5__ TYPE_2__;
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  int /*<<< orphan*/ *sequence;
};
struct TYPE_5__ {
  scalar_t__ type;
  TYPE_1__ value;
};
typedef TYPE_2__ ASN1_TYPE;
typedef int /*<<< orphan*/ ASN1_ITEM;

/* Variables and functions */
void *ASN1_item_unpack(int /*<<< orphan*/ *, int /*<<< orphan*/ const *);
scalar_t__ V_ASN1_SEQUENCE;
void *ASN1_TYPE_unpack_sequence(const ASN1_ITEM *it, const ASN1_TYPE *t) {
  if (t == NULL || t->type != V_ASN1_SEQUENCE || t->value.sequence == NULL)
    return NULL;
  return ASN1_item_unpack(t->value.sequence, it);
}


x86 assembly (clang, -O0):
<ASN1_TYPE_unpack_sequence>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1151 <ASN1_TYPE_unpack_sequence+0x41>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    0x2e9f(%rip),%rcx
cmp    (%rcx),%rax
jne    1151 <ASN1_TYPE_unpack_sequence+0x41>
mov    -0x18(%rbp),%rax
cmpq   $0x0,0x8(%rax)
jne    115e <ASN1_TYPE_unpack_sequence+0x4e>
movq   $0x0,-0x8(%rbp)
jmp    1173 <ASN1_TYPE_unpack_sequence+0x63>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <ASN1_item_unpack@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ASN1_TYPE_unpack_sequence>:
test   %rsi,%rsi
je     1138 <ASN1_TYPE_unpack_sequence+0x28>
mov    (%rsi),%rcx
mov    0x2eb9(%rip),%rdx
cmp    (%rdx),%rcx
jne    1138 <ASN1_TYPE_unpack_sequence+0x28>
mov    %rdi,%rax
mov    0x8(%rsi),%rdi
test   %rdi,%rdi
je     1138 <ASN1_TYPE_unpack_sequence+0x28>
mov    %rax,%rsi
jmp    1030 <ASN1_item_unpack@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
%struct.TYPE_5__ = type { i64, %struct.TYPE_4__ }
%struct.TYPE_4__ = type { i32* }
@V_ASN1_SEQUENCE = global i64 0
define i8* @ASN1_TYPE_unpack_sequence(i32* %0, %struct.TYPE_5__* %1) {
%3 = icmp eq %struct.TYPE_5__* %1, null
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %1, i64 0, i32 0
%6 = load i64, i64* %5
%7 = load i64, i64* @V_ASN1_SEQUENCE
%8 = icmp eq i64 %6, %7
br i1 %8, label %9, label %15
9: ; preds = %4
%10 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %1, i64 0, i32 1, i32 0
%11 = load i32*, i32** %10
%12 = icmp eq i32* %11, null
br i1 %12, label %15, label %13
13: ; preds = %9
%14 = tail call i8* @ASN1_item_unpack(i32* %11, i32* %0)
br label %15
15: ; preds = %2, %4, %9, %13
%16 = phi i8* [ %14, %13 ], [ null, %9 ], [ null, %4 ], [ null, %2 ]
ret i8* %16
}