int ndb_cif_remove_category_by_name(datablockName, categoryName)
char *datablockName;
char *categoryName;
{
  int datablockId, categoryId;
  datablockId = ndb_cif_get_datablock_id(datablockName);
  if (datablockId == 0)
    return 0;
  categoryId = ndb_cif_get_category_id(datablockName, categoryName);
  if (categoryId == 0)
    return 0;
  else
    return ndb_cif_remove_category_by_id(datablockId, categoryId);
}


x86 assembly (clang, -O0):
<ndb_cif_remove_category_by_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <ndb_cif_get_datablock_id@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1164 <ndb_cif_remove_category_by_name+0x34>
movl   $0x0,-0x4(%rbp)
jmp    119c <ndb_cif_remove_category_by_name+0x6c>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <ndb_cif_get_category_id@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jne    118c <ndb_cif_remove_category_by_name+0x5c>
movl   $0x0,-0x4(%rbp)
jmp    119c <ndb_cif_remove_category_by_name+0x6c>
mov    -0x1c(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    $0x0,%al
call   1050 <ndb_cif_remove_category_by_id@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ndb_cif_remove_category_by_name>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <ndb_cif_get_datablock_id@plt>
test   %eax,%eax
je     1167 <ndb_cif_remove_category_by_name+0x37>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <ndb_cif_get_category_id@plt>
test   %eax,%eax
je     1167 <ndb_cif_remove_category_by_name+0x37>
mov    %ebp,%edi
mov    %eax,%esi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <ndb_cif_remove_category_by_id@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ndb_cif_remove_category_by_name(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @ndb_cif_get_datablock_id to i32 (i8*, ...)*)(i8* %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 0, i32* %3
br label %24
13: ; preds = %2
%14 = load i8*, i8** %4
%15 = load i8*, i8** %5
%16 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @ndb_cif_get_category_id to i32 (i8*, i8*, ...)*)(i8* %14, i8* %15)
store i32 %16, i32* %7
%17 = load i32, i32* %7
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %13
store i32 0, i32* %3
br label %24
20: ; preds = %13
%21 = load i32, i32* %6
%22 = load i32, i32* %7
%23 = call i32 (i32, i32, ...) bitcast (i32 (...)* @ndb_cif_remove_category_by_id to i32 (i32, i32, ...)*)(i32 %21, i32 %22)
store i32 %23, i32* %3
br label %24
24: ; preds = %20, %19, %12
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @ndb_cif_remove_category_by_name(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ndb_cif_get_datablock_id to i32 (i8*, ...)*)(i8* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @ndb_cif_get_category_id to i32 (i8*, i8*, ...)*)(i8* %0, i8* %1)
%7 = icmp eq i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @ndb_cif_remove_category_by_id to i32 (i32, i32, ...)*)(i32 %3, i32 %6)
br label %10
10: ; preds = %5, %2, %8
%11 = phi i32 [ %9, %8 ], [ 0, %2 ], [ 0, %5 ]
ret i32 %11
}