#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 bitnum;
  scalar_t__ lname;
  scalar_t__ sname;
};
typedef TYPE_1__ BIT_STRING_BITNAME;

/* Variables and functions */
int /*<<< orphan*/ strcmp(scalar_t__, char const *);
int ASN1_BIT_STRING_num_asc(const char *name, BIT_STRING_BITNAME *tbl) {
  BIT_STRING_BITNAME *bnam;
  for (bnam = tbl; bnam->lname; bnam++) {
    if (!strcmp(bnam->sname, name) || !strcmp(bnam->lname, name))
      return bnam->bitnum;
  }
  return -1;
}


x86 assembly (clang, -O0):
<ASN1_BIT_STRING_num_asc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     118f <ASN1_BIT_STRING_num_asc+0x7f>
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
je     116b <ASN1_BIT_STRING_num_asc+0x5b>
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1179 <ASN1_BIT_STRING_num_asc+0x69>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1196 <ASN1_BIT_STRING_num_asc+0x86>
jmp    117e <ASN1_BIT_STRING_num_asc+0x6e>
mov    -0x20(%rbp),%rax
add    $0x18,%rax
mov    %rax,-0x20(%rbp)
jmp    1128 <ASN1_BIT_STRING_num_asc+0x18>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ASN1_BIT_STRING_num_asc>:
push   %rbp
push   %r14
push   %rbx
mov    $0xffffffff,%r14d
cmpq   $0x0,0x8(%rsi)
je     1160 <ASN1_BIT_STRING_num_asc+0x50>
mov    %rsi,%rbx
mov    %rdi,%rbp
add    $0x20,%rbx
nopl   0x0(%rax,%rax,1)
mov    -0x10(%rbx),%rdi
mov    %rbp,%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     115c <ASN1_BIT_STRING_num_asc+0x4c>
mov    -0x18(%rbx),%rdi
mov    %rbp,%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     115c <ASN1_BIT_STRING_num_asc+0x4c>
cmpq   $0x0,(%rbx)
lea    0x18(%rbx),%rbx
jne    1130 <ASN1_BIT_STRING_num_asc+0x20>
jmp    1160 <ASN1_BIT_STRING_num_asc+0x50>
mov    -0x20(%rbx),%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i64, i64 }
define i32 @ASN1_BIT_STRING_num_asc(i8* %0, %struct.TYPE_3__* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %struct.TYPE_3__*
%6 = alloca %struct.TYPE_3__*
store i8* %0, i8** %4
store %struct.TYPE_3__* %1, %struct.TYPE_3__** %5
%7 = load %struct.TYPE_3__*, %struct.TYPE_3__** %5
store %struct.TYPE_3__* %7, %struct.TYPE_3__** %6
br label %8
8: ; preds = %32, %2
%9 = load %struct.TYPE_3__*, %struct.TYPE_3__** %6
%10 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %9, i32 0, i32 1
%11 = load i64, i64* %10
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %35
13: ; preds = %8
%14 = load %struct.TYPE_3__*, %struct.TYPE_3__** %6
%15 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %14, i32 0, i32 2
%16 = load i64, i64* %15
%17 = load i8*, i8** %4
%18 = call i32 @strcmp(i64 %16, i8* %17)
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %27
20: ; preds = %13
%21 = load %struct.TYPE_3__*, %struct.TYPE_3__** %6
%22 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %21, i32 0, i32 1
%23 = load i64, i64* %22
%24 = load i8*, i8** %4
%25 = call i32 @strcmp(i64 %23, i8* %24)
%26 = icmp ne i32 %25, 0
br i1 %26, label %31, label %27
27: ; preds = %20, %13
%28 = load %struct.TYPE_3__*, %struct.TYPE_3__** %6
%29 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %28, i32 0, i32 0
%30 = load i32, i32* %29
store i32 %30, i32* %3
br label %36
31: ; preds = %20
br label %32
32: ; preds = %31
%33 = load %struct.TYPE_3__*, %struct.TYPE_3__** %6
%34 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %33, i32 1
store %struct.TYPE_3__* %34, %struct.TYPE_3__** %6
br label %8
35: ; preds = %8
store i32 -1, i32* %3
br label %36
36: ; preds = %35, %27
%37 = load i32, i32* %3
ret i32 %37
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32, i64, i64 }
define i32 @ASN1_BIT_STRING_num_asc(i8* %0, %struct.TYPE_3__* nocapture %1) {
%3 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 1
%4 = load i64, i64* %3
%5 = icmp eq i64 %4, 0
br i1 %5, label %25, label %6
6: ; preds = %2, %20
%7 = phi i64* [ %22, %20 ], [ %3, %2 ]
%8 = phi %struct.TYPE_3__* [ %21, %20 ], [ %1, %2 ]
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i64 0, i32 2
%10 = load i64, i64* %9
%11 = tail call i32 @strcmp(i64 %10, i8* %0)
%12 = icmp eq i32 %11, 0
br i1 %12, label %17, label %13
13: ; preds = %6
%14 = load i64, i64* %7
%15 = tail call i32 @strcmp(i64 %14, i8* %0)
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %13, %6
%18 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i64 0, i32 0
%19 = load i32, i32* %18
br label %25
20: ; preds = %13
%21 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i64 1
%22 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i64 1, i32 1
%23 = load i64, i64* %22
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %6
25: ; preds = %20, %2, %17
%26 = phi i32 [ %19, %17 ], [ -1, %2 ], [ -1, %20 ]
ret i32 %26
}