#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 */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ count_lbx_entry_delimiter_chars(char *);
int /*<<< orphan*/ count_lbx_key_chars(char *);
int /*<<< orphan*/ count_lbx_key_value_delimiter_chars(char *);
int /*<<< orphan*/ count_lbx_value_chars(char *);
char *lbx_advance_entry(char *s) {
  s += count_lbx_key_chars(s);
  s += count_lbx_key_value_delimiter_chars(s);
  s += count_lbx_value_chars(s);
  s += count_lbx_entry_delimiter_chars(s);
  return s;
}


x86 assembly (clang, -O0):
<lbx_advance_entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <count_lbx_key_chars@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <count_lbx_key_value_delimiter_chars@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <count_lbx_value_chars@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <count_lbx_entry_delimiter_chars@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lbx_advance_entry>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <count_lbx_key_chars@plt>
movslq %eax,%rbx
add    %r14,%rbx
mov    %rbx,%rdi
call   1030 <count_lbx_key_value_delimiter_chars@plt>
movslq %eax,%r14
add    %rbx,%r14
mov    %r14,%rdi
call   1040 <count_lbx_value_chars@plt>
movslq %eax,%rbx
add    %r14,%rbx
mov    %rbx,%rdi
call   1060 <count_lbx_entry_delimiter_chars@plt>
cltq
add    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @lbx_advance_entry(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @count_lbx_key_chars(i8* %3)
%5 = load i8*, i8** %2
%6 = sext i32 %4 to i64
%7 = getelementptr inbounds i8, i8* %5, i64 %6
store i8* %7, i8** %2
%8 = load i8*, i8** %2
%9 = call i32 @count_lbx_key_value_delimiter_chars(i8* %8)
%10 = load i8*, i8** %2
%11 = sext i32 %9 to i64
%12 = getelementptr inbounds i8, i8* %10, i64 %11
store i8* %12, i8** %2
%13 = load i8*, i8** %2
%14 = call i32 @count_lbx_value_chars(i8* %13)
%15 = load i8*, i8** %2
%16 = sext i32 %14 to i64
%17 = getelementptr inbounds i8, i8* %15, i64 %16
store i8* %17, i8** %2
%18 = load i8*, i8** %2
%19 = call i32 @count_lbx_entry_delimiter_chars(i8* %18)
%20 = load i8*, i8** %2
%21 = sext i32 %19 to i64
%22 = getelementptr inbounds i8, i8* %20, i64 %21
store i8* %22, i8** %2
%23 = load i8*, i8** %2
ret i8* %23
}

LLVM IR (-O2):
define i8* @lbx_advance_entry(i8* %0) {
%2 = tail call i32 @count_lbx_key_chars(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = tail call i32 @count_lbx_key_value_delimiter_chars(i8* %4)
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %4, i64 %6
%8 = tail call i32 @count_lbx_value_chars(i8* %7)
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = tail call i32 @count_lbx_entry_delimiter_chars(i8* %10)
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
ret i8* %13
}