int _m_next(int ln, const char *fn, const char *fun, int h, int *i, void *d) {
  _mlsdb_caller(__FUNCTION__, ln, fn, fun, 7, h, i ? *i : -1, d);
  return m_next(h, i, d);
}


x86 assembly (clang, -O0):
<_m_next>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x34(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1173 <_m_next+0x53>
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x50(%rbp)
jmp    1180 <_m_next+0x60>
mov    $0xffffffff,%eax
mov    %eax,-0x50(%rbp)
jmp    1180 <_m_next+0x60>
mov    -0x34(%rbp),%r9d
mov    -0x40(%rbp),%rcx
mov    -0x48(%rbp),%rdx
mov    -0x4c(%rbp),%esi
mov    -0x50(%rbp),%r10d
mov    -0x30(%rbp),%rax
lea    0xe62(%rip),%rdi
mov    $0x7,%r8d
mov    %r10d,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x0,%al
call   1030 <_mlsdb_caller@plt>
mov    -0x1c(%rbp),%edi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    $0x0,%al
call   1040 <m_next@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_m_next>:
push   %rbp
push   %r14
push   %rbx
mov    %r9,%r14
mov    %r8,%rbx
mov    %ecx,%ebp
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
test   %r8,%r8
je     113e <_m_next+0x1e>
mov    (%rbx),%r10d
jmp    1144 <_m_next+0x24>
mov    $0xffffffff,%r10d
lea    0xeb5(%rip),%rdi
mov    $0x7,%r8d
mov    %ebp,%r9d
xor    %eax,%eax
push   %r14
push   %r10
call   1030 <_mlsdb_caller@plt>
add    $0x10,%rsp
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <m_next@plt>

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

LLVM IR (-O2):
@__FUNCTION__._m_next = [8 x i8] c"_m_next\00"
define i32 @_m_next(i32 %0, i8* %1, i8* %2, i32 %3, i32* %4, i8* %5) {
%7 = icmp eq i32* %4, null
br i1 %7, label %10, label %8
8: ; preds = %6
%9 = load i32, i32* %4
br label %10
10: ; preds = %6, %8
%11 = phi i32 [ %9, %8 ], [ -1, %6 ]
%12 = tail call i32 (i8*, i32, i8*, i8*, i32, i32, i32, i8*, ...) bitcast (i32 (...)* @_mlsdb_caller to i32 (i8*, i32, i8*, i8*, i32, i32, i32, i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__FUNCTION__._m_next, i64 0, i64 0), i32 %0, i8* %1, i8* %2, i32 7, i32 %3, i32 %11, i8* %5)
%13 = tail call i32 (i32, i32*, i8*, ...) bitcast (i32 (...)* @m_next to i32 (i32, i32*, i8*, ...)*)(i32 %3, i32* %4, i8* %5)
ret i32 %13
}