// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/tests/kvlds/main.c
// Function: mutate
static int
mutate(struct wire_requestqueue * Q)
{
	struct kvldskey * key = kvldskey_create((const uint8_t *)"key", 3);
	struct kvldskey * value = kvldskey_create((const uint8_t *)"value", 5);
	struct kvldskey * value2;
	uint8_t buf[100];
	uint8_t i;

	/* Initialize value2. */
	for (i = 0; i < 100; i++)
		buf[i] = i;
	value2 = kvldskey_create(buf, 100);

	/*
	 * Test B+Tree mutation code paths, one by one:
	 * 1. SET on a key which is not present.
	 * 2. SET on a key which is present.
	 * 3. ADD on a key which is present.
	 * 4. DELETE of a key which is present.
	 * 5. DELETE of a key which is not present.
	 * 6. MODIFY of a key which is not present.
	 * 7. ADD of a key which is not present.
	 * 8. MODIFY of a key which is present.
	 * 9. CAS of a key with non-matching value.
	 * 10. CAS of a key with matching value.
	 * 11. CAD of a key with non-matching value.
	 * 12. CAD of a key with matching value.
	 * 13. CAS of a key which is not present.
	 * 14. CAD of a key which is not present.
	 */

	/* Set key = value. */
	if (set(Q, key, value) || verify(Q, key, value))
		goto err1;

	/* Set key = value2. */
	if (set(Q, key, value2) || verify(Q, key, value2))
		goto err1;

	/* Add key = value (should be a no-op). */
	if (add(Q, key, value, 1) || verify(Q, key, value2))
		goto err1;

	/* Delete key. */
	if (delete(Q, key) || verify(Q, key, NULL))
		goto err1;

	/* Delete key (even though it isn't there). */
	if (delete(Q, key) || verify(Q, key, NULL))
		goto err1;

	/* Modify key = value (should be a no-op). */
	if (modify(Q, key, value, 1) || verify(Q, key, NULL))
		goto err1;

	/* Add key = value. */
	if (add(Q, key, value, 0) || verify(Q, key, value))
		goto err1;

	/* Modify key = value2. */
	if (modify(Q, key, value, 0) || verify(Q, key, value))
		goto err1;

	/* CAS key = value2 -> value2 (should be a no-op). */
	if (cas(Q, key, value2, value2, 1) || verify(Q, key, value))
		goto err1;

	/* CAS key = value -> value2. */
	if (cas(Q, key, value, value2, 0) || verify(Q, key, value2))
		goto err1;

	/* CAD key = value -> NULL (should be a no-op). */
	if (cad(Q, key, value, 1) || verify(Q, key, value2))
		goto err1;

	/* CAD key = value2 -> NULL. */
	if (cad(Q, key, value2, 0) || verify(Q, key, NULL))
		goto err1;

	/* CAS key = value -> value2 (should be a no-op). */
	if (cas(Q, key, value, value2, 1) || verify(Q, key, NULL))
		goto err1;

	/* CAD key = value -> NULL (should be a no-op). */
	if (cad(Q, key, value, 1) || verify(Q, key, NULL))
		goto err1;

	/* Clean up. */
	kvldskey_free(value2);
	kvldskey_free(value);
	kvldskey_free(key);

	/* Success! */
	return (0);

err1:
	kvldskey_free(value2);
	kvldskey_free(value);
	kvldskey_free(key);

	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x10(%rbp)
leaq 0xe3a2(%rip), %rdi      # 0x10c98
movl $0x3, %esi
callq 0x6360
movq %rax, -0x18(%rbp)
leaq 0xe3ae(%rip), %rdi      # 0x10cb9
movl $0x5, %esi
callq 0x6360
movq %rax, -0x20(%rbp)
movb $0x0, -0x91(%rbp)
movzbl -0x91(%rbp), %eax
cmpl $0x64, %eax
jge 0x2950
movb -0x91(%rbp), %cl
movzbl -0x91(%rbp), %eax
movb %cl, -0x90(%rbp,%rax)
movb -0x91(%rbp), %al
addb $0x1, %al
movb %al, -0x91(%rbp)
jmp 0x2920
leaq -0x90(%rbp), %rdi
movl $0x64, %esi
callq 0x6360
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x3100
cmpl $0x0, %eax
jne 0x2991
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x31f0
cmpl $0x0, %eax
je 0x2996
jmp 0x2c5e
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x3100
cmpl $0x0, %eax
jne 0x29c2
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x31f0
cmpl $0x0, %eax
je 0x29c7
jmp 0x2c5e
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl $0x1, %ecx
callq 0x3310
cmpl $0x0, %eax
jne 0x29f8
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x31f0
cmpl $0x0, %eax
je 0x29fd
jmp 0x2c5e
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x3460
cmpl $0x0, %eax
jne 0x2a25
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x31f0
cmpl $0x0, %eax
je 0x2a2a
jmp 0x2c5e
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x3460
cmpl $0x0, %eax
jne 0x2a52
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x31f0
cmpl $0x0, %eax
je 0x2a57
jmp 0x2c5e
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl $0x1, %ecx
callq 0x3550
cmpl $0x0, %eax
jne 0x2a88
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x31f0
cmpl $0x0, %eax
je 0x2a8d
jmp 0x2c5e
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
xorl %ecx, %ecx
callq 0x3310
cmpl $0x0, %eax
jne 0x2abb
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x31f0
cmpl $0x0, %eax
je 0x2ac0
jmp 0x2c5e
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
xorl %ecx, %ecx
callq 0x3550
cmpl $0x0, %eax
jne 0x2aee
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x31f0
cmpl $0x0, %eax
je 0x2af3
jmp 0x2c5e
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x28(%rbp), %rcx
movl $0x1, %r8d
callq 0x36a0
cmpl $0x0, %eax
jne 0x2b29
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x31f0
cmpl $0x0, %eax
je 0x2b2e
jmp 0x2c5e
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
xorl %r8d, %r8d
callq 0x36a0
cmpl $0x0, %eax
jne 0x2b61
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x31f0
cmpl $0x0, %eax
je 0x2b66
jmp 0x2c5e
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl $0x1, %ecx
callq 0x3800
cmpl $0x0, %eax
jne 0x2b97
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x31f0
cmpl $0x0, %eax
je 0x2b9c
jmp 0x2c5e
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rdx
xorl %ecx, %ecx
callq 0x3800
cmpl $0x0, %eax
jne 0x2bca
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x31f0
cmpl $0x0, %eax
je 0x2bcf
jmp 0x2c5e
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movl $0x1, %r8d
callq 0x36a0
cmpl $0x0, %eax
jne 0x2c05
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x31f0
cmpl $0x0, %eax
je 0x2c07
jmp 0x2c5e
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl $0x1, %ecx
callq 0x3800
cmpl $0x0, %eax
jne 0x2c38
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x31f0
cmpl $0x0, %eax
je 0x2c3a
jmp 0x2c5e
movq -0x28(%rbp), %rdi
callq 0x2040
movq -0x20(%rbp), %rdi
callq 0x2040
movq -0x18(%rbp), %rdi
callq 0x2040
movl $0x0, -0x4(%rbp)
jmp 0x2c80
movq -0x28(%rbp), %rdi
callq 0x2040
movq -0x20(%rbp), %rdi
callq 0x2040
movq -0x18(%rbp), %rdi
callq 0x2040
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax)