#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 redislite_lpush_by_keyname(void *, char *, size_t, char *, size_t);
int redislite_rpop_by_keyname(void *, char *, size_t, char **, size_t *);
int redislite_rpoplpush_by_keyname(void *_cs, char *source, size_t source_len,
                                   char *destination, size_t destination_len,
                                   char **value, size_t *value_len) {
  int status =
      redislite_rpop_by_keyname(_cs, source, source_len, value, value_len);
  if (status < 0) {
    return status;
  }
  return redislite_lpush_by_keyname(_cs, destination, destination_len, *value,
                                    *value_len);
}


x86 assembly (clang, -O0):
<redislite_rpoplpush_by_keyname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    0x10(%rbp),%r8
call   1030 <redislite_rpop_by_keyname@plt>
mov    %eax,-0x3c(%rbp)
cmpl   $0x0,-0x3c(%rbp)
jge    1175 <redislite_rpoplpush_by_keyname+0x55>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1197 <redislite_rpoplpush_by_keyname+0x77>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    -0x38(%rbp),%rax
mov    (%rax),%rcx
mov    0x10(%rbp),%rax
mov    (%rax),%r8
call   1040 <redislite_lpush_by_keyname@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<redislite_rpoplpush_by_keyname>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %r9,%r12
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdi,%r13
mov    0x30(%rsp),%rbx
mov    %r9,%rcx
mov    %rbx,%r8
call   1030 <redislite_rpop_by_keyname@plt>
test   %eax,%eax
js     1167 <redislite_rpoplpush_by_keyname+0x47>
mov    (%r12),%rcx
mov    (%rbx),%r8
mov    %r13,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1040 <redislite_lpush_by_keyname@plt>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @redislite_rpoplpush_by_keyname(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4, i8** %5, i64* %6) {
%8 = tail call i32 @redislite_rpop_by_keyname(i8* %0, i8* %1, i64 %2, i8** %5, i64* %6)
%9 = icmp slt i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %7
%11 = load i8*, i8** %5
%12 = load i64, i64* %6
%13 = tail call i32 @redislite_lpush_by_keyname(i8* %0, i8* %3, i64 %4, i8* %11, i64 %12)
br label %14
14: ; preds = %7, %10
%15 = phi i32 [ %13, %10 ], [ %8, %7 ]
ret i32 %15
}