// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../lib/proto_s3/proto_s3_client.c
// Function: callback_range
static int
callback_range(void * cookie, uint8_t * buf, size_t buflen)
{
	struct get_cookie * C = cookie;
	int failed = 1;
	uint32_t status;
	uint32_t len;
	size_t lens = (size_t)(-1);
	uint8_t * dbuf = NULL;
	int rc;

	/* If we have a packet, parse it. */
	if (buf != NULL) {
		/* Do we have the right packet length? */
		if (buflen < 8)
			BAD("RANGE", "bogus length");

		/* Parse the packet. */
		status = be32dec(&buf[0]);
		len = be32dec(&buf[4]);

		/* Check status. */
		if ((status != 0) && ((status < 100) || (status > 599)))
			BAD("RANGE", "Invalid HTTP status");

		/* Do we have the right packet length? */
		if (len != (uint32_t)(-1)) {
			if (buflen != 8 + len)
				BAD("RANGE", "bogus length");
		} else {
			if (buflen != 8)
				BAD("RANGE", "bogus length");
		}

		/* Warn about HTTP 200 responses. */
		if (status == 200)
			BAD("RANGE", "HTTP 200 response");

		/* Did the operation succeed? */
		if (status == 206)
			failed = 0;

		/* Do we have data? */
		if ((failed == 0) && (len != (uint32_t)(-1))) {
			lens = len;
			dbuf = &buf[8];
		}
	}

failed:
	/* Invoke the upstream callback. */
	rc = (C->callback)(C->cookie, failed, lens, dbuf);

	/* Free the cookie. */
	free(C);

	/* Return status from callback. */
	return (rc);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movl $0x1, -0x24(%rbp)
movq $-0x1, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x77dc
cmpq $0x8, -0x18(%rbp)
jae 0x7695
jmp 0x7667
jmp 0x7669
leaq 0x7271(%rip), %rdi      # 0xe8e1
leaq 0x72b0(%rip), %rsi      # 0xe927
leaq 0x7284(%rip), %rdx      # 0xe902
movb $0x0, %al
callq 0x6a00
callq 0x20a0
movl $0x0, (%rax)
jmp 0x77de
movq -0x10(%rbp), %rdi
callq 0x7dd0
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
addq $0x4, %rdi
callq 0x7dd0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x28(%rbp)
je 0x76f6
cmpl $0x64, -0x28(%rbp)
jb 0x76c6
cmpl $0x257, -0x28(%rbp)     # imm = 0x257
jbe 0x76f6
jmp 0x76c8
jmp 0x76ca
leaq 0x7210(%rip), %rdi      # 0xe8e1
leaq 0x724f(%rip), %rsi      # 0xe927
leaq 0x7230(%rip), %rdx      # 0xe90f
movb $0x0, %al
callq 0x6a00
callq 0x20a0
movl $0x0, (%rax)
jmp 0x77de
cmpl $-0x1, -0x2c(%rbp)
je 0x773f
movq -0x18(%rbp), %rax
movl -0x2c(%rbp), %ecx
addl $0x8, %ecx
movl %ecx, %ecx
cmpq %rcx, %rax
je 0x773d
jmp 0x770f
jmp 0x7711
leaq 0x71c9(%rip), %rdi      # 0xe8e1
leaq 0x7208(%rip), %rsi      # 0xe927
leaq 0x71dc(%rip), %rdx      # 0xe902
movb $0x0, %al
callq 0x6a00
callq 0x20a0
movl $0x0, (%rax)
jmp 0x77de
jmp 0x7775
cmpq $0x8, -0x18(%rbp)
je 0x7773
jmp 0x7748
jmp 0x774a
leaq 0x7190(%rip), %rdi      # 0xe8e1
leaq 0x71cf(%rip), %rsi      # 0xe927
leaq 0x71a3(%rip), %rdx      # 0xe902
movb $0x0, %al
callq 0x6a00
callq 0x20a0
movl $0x0, (%rax)
jmp 0x77de
jmp 0x7775
cmpl $0xc8, -0x28(%rbp)
jne 0x77ab
jmp 0x7780
jmp 0x7782
leaq 0x7158(%rip), %rdi      # 0xe8e1
leaq 0x7197(%rip), %rsi      # 0xe927
leaq 0x7196(%rip), %rdx      # 0xe92d
movb $0x0, %al
callq 0x6a00
callq 0x20a0
movl $0x0, (%rax)
jmp 0x77de
cmpl $0xce, -0x28(%rbp)
jne 0x77bb
movl $0x0, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0x77da
cmpl $-0x1, -0x2c(%rbp)
je 0x77da
movl -0x2c(%rbp), %eax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x40(%rbp)
jmp 0x77dc
jmp 0x77de
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rcx
movq 0x8(%rcx), %rdi
movl -0x24(%rbp), %esi
movq -0x38(%rbp), %rdx
movq -0x40(%rbp), %rcx
callq *%rax
movl %eax, -0x44(%rbp)
movq -0x20(%rbp), %rdi
callq 0x2040
movl -0x44(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nop