// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/tests/mux/main.c
// Function: createmany
static int
createmany(struct wire_requestqueue * Q, size_t N, char * prefix)
{
	size_t i;
	struct kvldskey * key;
	struct kvldskey * key2;
	struct kvldskey ** values;
	size_t plen = strlen(prefix);
	uint8_t * keybuf = malloc(plen + 8);
	char valbuf[20];

	/* Copy prefix in. */
	memcpy(keybuf, prefix, plen);

	/* Allocate values structures. */
	values = malloc(N * sizeof(struct kvldskey *));
	for (i = 0; i < N; i++) {
		sprintf(valbuf, "%zu", i);
		values[i] = kvldskey_create((uint8_t *)valbuf, strlen(valbuf));
	}

	/* Store N key-value pairs. */
	op_done = 0;
	op_count = N;
	for (i = 0; i < N; i++) {
		be64enc(&keybuf[plen], i);
		key = kvldskey_create(keybuf, plen + 8);
		if (proto_kvlds_request_set(Q, key, values[i],
		    callback_done, NULL))
			return (-1);
		kvldskey_free(key);
	}

	/* Wait for SETs to complete. */
	if (events_spin(&op_done) || op_failed) {
		warnp("SET request failed");
		return (-1);
	}

	/* Read the values back and check that they are correct. */
	op_done = 0;
	op_failed = 0;
	op_count = N;
	for (i = 0; i < N; i++) {
		be64enc(&keybuf[plen], i);
		key = kvldskey_create(keybuf, plen + 8);
		if (proto_kvlds_request_get(Q, key, callback_get,
		    (void *)(uintptr_t)values[i])) {
			warnp("Error sending GET request");
			return (-1);
		}
		kvldskey_free(key);
	}
	if (events_spin(&op_done) || op_failed) {
		warnp("GET request failed");
		return (-1);
	}
	if (op_badval) {
		warnp("Bad value returned by GET!");
		return (-1);
	}

	/* Free values. */
	for (i = 0; i < N; i++)
		kvldskey_free(values[i]);
	free(values);

	/* Delete all the values. */
	be64enc(&keybuf[plen], 0);
	key = kvldskey_create(keybuf, plen + 8);
	be64enc(&keybuf[plen], N);
	key2 = kvldskey_create(keybuf, plen + 8);
	op_done = 0;
	op_count = 1;
	if (proto_kvlds_request_range2(Q, key, key2, callback_range,
	    callback_done, Q))
		return (-1);
	kvldskey_free(key2);
	kvldskey_free(key);

	/* Wait for RANGEs and DELETEs to complete. */
	if (events_spin(&op_done) || op_failed) {
		warnp("RANGE or DELETE request failed");
		return (-1);
	}

	/* Success! */
	return (0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0x2100
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
addq $0x8, %rdi
callq 0x2200
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x48(%rbp), %rdx
callq 0x21e0
movq -0x18(%rbp), %rdi
shlq $0x3, %rdi
callq 0x2200
movq %rax, -0x40(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x2879
leaq -0x70(%rbp), %rdi
movq -0x28(%rbp), %rdx
leaq 0xc8c5(%rip), %rsi      # 0xf0fd
movb $0x0, %al
callq 0x22c0
leaq -0x70(%rbp), %rax
movq %rax, -0x78(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x2100
movq -0x78(%rbp), %rdi
movq %rax, %rsi
callq 0x5940
movq %rax, %rdx
movq -0x40(%rbp), %rax
movq -0x28(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x281f
movl $0x0, 0x12da9(%rip)     # 0x1562c
movq -0x18(%rbp), %rax
movq %rax, 0x12da2(%rip)     # 0x15630
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x2913
movq -0x50(%rbp), %rdi
addq -0x48(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x2fc0
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rsi
addq $0x8, %rsi
callq 0x5940
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x40(%rbp), %rax
movq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0x64f(%rip), %rcx       # 0x2f30
xorl %eax, %eax
movl %eax, %r8d
callq 0x5d90
cmpl $0x0, %eax
je 0x28fc
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2c35
movq -0x30(%rbp), %rdi
callq 0x2040
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x2896
leaq 0x12d12(%rip), %rdi     # 0x1562c
callq 0x34f0
cmpl $0x0, %eax
jne 0x292d
cmpl $0x0, 0x12d0d(%rip)     # 0x15638
je 0x2970
jmp 0x292f
callq 0x20a0
cmpl $0x0, (%rax)
je 0x2954
leaq 0xc750(%rip), %rdi      # 0xf090
movb $0x0, %al
callq 0x54b0
callq 0x20a0
movl $0x0, (%rax)
jmp 0x2962
leaq 0xc735(%rip), %rdi      # 0xf090
movb $0x0, %al
callq 0x5700
jmp 0x2964
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2c35
movl $0x0, 0x12cb2(%rip)     # 0x1562c
movl $0x0, 0x12cb4(%rip)     # 0x15638
movq -0x18(%rbp), %rax
movq %rax, 0x12ca1(%rip)     # 0x15630
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x2a4d
movq -0x50(%rbp), %rdi
addq -0x48(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x2fc0
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rsi
addq $0x8, %rsi
callq 0x5940
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x40(%rbp), %rax
movq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
leaq 0x6aa(%rip), %rdx       # 0x3090
callq 0x6900
cmpl $0x0, %eax
je 0x2a33
jmp 0x29f2
callq 0x20a0
cmpl $0x0, (%rax)
je 0x2a17
leaq 0xc6fe(%rip), %rdi      # 0xf101
movb $0x0, %al
callq 0x54b0
callq 0x20a0
movl $0x0, (%rax)
jmp 0x2a25
leaq 0xc6e3(%rip), %rdi      # 0xf101
movb $0x0, %al
callq 0x5700
jmp 0x2a27
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2c35
movq -0x30(%rbp), %rdi
callq 0x2040
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x2997
leaq 0x12bd8(%rip), %rdi     # 0x1562c
callq 0x34f0
cmpl $0x0, %eax
jne 0x2a67
cmpl $0x0, 0x12bd3(%rip)     # 0x15638
je 0x2aaa
jmp 0x2a69
callq 0x20a0
cmpl $0x0, (%rax)
je 0x2a8e
leaq 0xc6a1(%rip), %rdi      # 0xf11b
movb $0x0, %al
callq 0x54b0
callq 0x20a0
movl $0x0, (%rax)
jmp 0x2a9c
leaq 0xc686(%rip), %rdi      # 0xf11b
movb $0x0, %al
callq 0x5700
jmp 0x2a9e
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2c35
cmpl $0x0, 0x12b8b(%rip)     # 0x1563c
je 0x2af6
jmp 0x2ab5
callq 0x20a0
cmpl $0x0, (%rax)
je 0x2ada
leaq 0xc668(%rip), %rdi      # 0xf12e
movb $0x0, %al
callq 0x54b0
callq 0x20a0
movl $0x0, (%rax)
jmp 0x2ae8
leaq 0xc64d(%rip), %rdi      # 0xf12e
movb $0x0, %al
callq 0x5700
jmp 0x2aea
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2c35
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x2b27
movq -0x40(%rbp), %rax
movq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2040
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x2afe
movq -0x40(%rbp), %rdi
callq 0x2040
movq -0x50(%rbp), %rdi
addq -0x48(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2fc0
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rsi
addq $0x8, %rsi
callq 0x5940
movq %rax, -0x30(%rbp)
movq -0x50(%rbp), %rdi
addq -0x48(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x2fc0
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rsi
addq $0x8, %rsi
callq 0x5940
movq %rax, -0x38(%rbp)
movl $0x0, 0x12aa6(%rip)     # 0x1562c
movq $0x1, 0x12a9f(%rip) # 0x15630
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq -0x10(%rbp), %r9
leaq 0x5f8(%rip), %rcx       # 0x31a0
leaq 0x381(%rip), %r8        # 0x2f30
callq 0x7290
cmpl $0x0, %eax
je 0x2bc2
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2c35
movq -0x38(%rbp), %rdi
callq 0x2040
movq -0x30(%rbp), %rdi
callq 0x2040
leaq 0x12a51(%rip), %rdi     # 0x1562c
callq 0x34f0
cmpl $0x0, %eax
jne 0x2bee
cmpl $0x0, 0x12a4c(%rip)     # 0x15638
je 0x2c2e
jmp 0x2bf0
callq 0x20a0
cmpl $0x0, (%rax)
je 0x2c15
leaq 0xc548(%rip), %rdi      # 0xf149
movb $0x0, %al
callq 0x54b0
callq 0x20a0
movl $0x0, (%rax)
jmp 0x2c23
leaq 0xc52d(%rip), %rdi      # 0xf149
movb $0x0, %al
callq 0x5700
jmp 0x2c25
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2c35
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)