int addrecord(fn, data, dataflds, fldnms)
char *fn, *data, *dataflds, *fldnms;
{
  if (dataflds[0]) {
    char dta[513];
    rebuilddata(data, dataflds, fldnms, "", dta);
    return mDB_add(fn, dta, 0);
  } else
    return mDB_add(fn, data, 0);
}


x86 assembly (clang, -O0):
<addrecord>:
push   %rbp
mov    %rsp,%rbp
sub    $0x230,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     1185 <addrecord+0x65>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
lea    -0x230(%rbp),%r8
lea    0xe9e(%rip),%rcx
mov    $0x0,%al
call   1030 <rebuilddata@plt>
mov    -0x10(%rbp),%rdi
lea    -0x230(%rbp),%rsi
xor    %edx,%edx
mov    $0x0,%al
call   1040 <mDB_add@plt>
mov    %eax,-0x4(%rbp)
jmp    1199 <addrecord+0x79>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
xor    %edx,%edx
mov    $0x0,%al
call   1040 <mDB_add@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x230,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addrecord>:
push   %r14
push   %rbx
sub    $0x208,%rsp
mov    %rdi,%rbx
cmpb   $0x0,(%rdx)
je     116c <addrecord+0x4c>
lea    0xec7(%rip),%rax
mov    %rsp,%r14
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %rax,%rcx
mov    %r14,%r8
xor    %eax,%eax
call   1030 <rebuilddata@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %edx,%edx
xor    %eax,%eax
call   1040 <mDB_add@plt>
add    $0x208,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rdi
xor    %edx,%edx
xor    %eax,%eax
add    $0x208,%rsp
pop    %rbx
pop    %r14
jmp    1040 <mDB_add@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @addrecord(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca [513 x i8]
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
%11 = load i8*, i8** %8
%12 = getelementptr inbounds i8, i8* %11, i64 0
%13 = load i8, i8* %12
%14 = icmp ne i8 %13, 0
br i1 %14, label %15, label %24
15: ; preds = %4
%16 = load i8*, i8** %7
%17 = load i8*, i8** %8
%18 = load i8*, i8** %9
%19 = getelementptr inbounds [513 x i8], [513 x i8]* %10, i64 0, i64 0
%20 = call i32 (i8*, i8*, i8*, i8*, i8*, ...) bitcast (i32 (...)* @rebuilddata to i32 (i8*, i8*, i8*, i8*, i8*, ...)*)(i8* %16, i8* %17, i8* %18, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %19)
%21 = load i8*, i8** %6
%22 = getelementptr inbounds [513 x i8], [513 x i8]* %10, i64 0, i64 0
%23 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @mDB_add to i32 (i8*, i8*, i32, ...)*)(i8* %21, i8* %22, i32 0)
store i32 %23, i32* %5
br label %28
24: ; preds = %4
%25 = load i8*, i8** %6
%26 = load i8*, i8** %7
%27 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @mDB_add to i32 (i8*, i8*, i32, ...)*)(i8* %25, i8* %26, i32 0)
store i32 %27, i32* %5
br label %28
28: ; preds = %24, %15
%29 = load i32, i32* %5
ret i32 %29
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @addrecord(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca [513 x i8]
%6 = load i8, i8* %2
%7 = icmp eq i8 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %4
%9 = getelementptr inbounds [513 x i8], [513 x i8]* %5, i64 0, i64 0
%10 = call i32 (i8*, i8*, i8*, i8*, i8*, ...) bitcast (i32 (...)* @rebuilddata to i32 (i8*, i8*, i8*, i8*, i8*, ...)*)(i8* %1, i8* %2, i8* %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @mDB_add to i32 (i8*, i8*, i32, ...)*)(i8* %0, i8* %9, i32 0)
br label %14
12: ; preds = %4
%13 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @mDB_add to i32 (i8*, i8*, i32, ...)*)(i8* %0, i8* %1, i32 0)
br label %14
14: ; preds = %12, %8
%15 = phi i32 [ %11, %8 ], [ %13, %12 ]
ret i32 %15
}