// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/tests/onlinequantile/main.c
// Function: process_test
static int
process_test(const char * filename)
{
	struct onlinequantile * oq;
	FILE * fp;
	char instr;
	double val;

	/* Open file. */
	if ((fp = fopen(filename, "r")) == NULL) {
		warnp("fopen");
		goto err0;
	}

	/* Get first line and initialize with the desired quantile. */
	if (parse_line(fp, &instr, &val)) {
		warnp("parse_line");
		goto err1;
	}
	if (instr != 'q') {
		warn0("Invalid file; first instruction must be 'q'");
		goto err1;
	}
	if ((oq = onlinequantile_init(val)) == NULL) {
		warn0("onlinequantile_init");
		goto err1;
	}

	/* The first time should return 1. */
	if (onlinequantile_get(oq, &val) != 1) {
		warn0("onlinequantile_get improper handling of empty list");
		goto err2;
	}

	/* Process lines in file. */
	while (parse_line(fp, &instr, &val) == 0) {
		/* Process data. */
		if (handle_line(oq, instr, val))
			goto err2;
	}

	/* Clean up. */
	onlinequantile_free(oq);
	if (fclose(fp)) {
		warnp("fclose");
		goto err0;
	}

	/* Success! */
	return (0);

err2:
	onlinequantile_free(oq);
err1:
	if (fclose(fp))
		warnp("fclose");
err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x2d50(%rip), %rsi      # 0x4097
callq 0x1150
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
jne 0x1392
jmp 0x1358
callq 0x1070
cmpl $0x0, (%rax)
je 0x137d
leaq 0x2d30(%rip), %rdi      # 0x4099
movb $0x0, %al
callq 0x1b60
callq 0x1070
movl $0x0, (%rax)
jmp 0x138b
leaq 0x2d15(%rip), %rdi      # 0x4099
movb $0x0, %al
callq 0x1db0
jmp 0x138d
jmp 0x1553
movq -0x20(%rbp), %rdi
leaq -0x21(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x1570
cmpl $0x0, %eax
je 0x13e4
jmp 0x13aa
callq 0x1070
cmpl $0x0, (%rax)
je 0x13cf
leaq 0x2ce4(%rip), %rdi      # 0x409f
movb $0x0, %al
callq 0x1b60
callq 0x1070
movl $0x0, (%rax)
jmp 0x13dd
leaq 0x2cc9(%rip), %rdi      # 0x409f
movb $0x0, %al
callq 0x1db0
jmp 0x13df
jmp 0x150a
movsbl -0x21(%rbp), %eax
cmpl $0x71, %eax
je 0x140d
jmp 0x13ef
leaq 0x2cb4(%rip), %rdi      # 0x40aa
movb $0x0, %al
callq 0x1db0
callq 0x1070
movl $0x0, (%rax)
jmp 0x150a
movsd -0x30(%rbp), %xmm0
callq 0x1ff0
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
jne 0x1441
jmp 0x1423
leaq 0x2cac(%rip), %rdi      # 0x40d6
movb $0x0, %al
callq 0x1db0
callq 0x1070
movl $0x0, (%rax)
jmp 0x150a
movq -0x18(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x20c0
cmpl $0x1, %eax
je 0x1473
jmp 0x1455
leaq 0x2c8e(%rip), %rdi      # 0x40ea
movb $0x0, %al
callq 0x1db0
callq 0x1070
movl $0x0, (%rax)
jmp 0x1501
jmp 0x1475
movq -0x20(%rbp), %rdi
leaq -0x21(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x1570
cmpl $0x0, %eax
jne 0x14a8
movq -0x18(%rbp), %rdi
movb -0x21(%rbp), %al
movsd -0x30(%rbp), %xmm0
movsbl %al, %esi
callq 0x1810
cmpl $0x0, %eax
je 0x14a6
jmp 0x1501
jmp 0x1475
movq -0x18(%rbp), %rdi
callq 0x2740
movq -0x20(%rbp), %rdi
callq 0x10b0
cmpl $0x0, %eax
je 0x14f8
jmp 0x14c1
callq 0x1070
cmpl $0x0, (%rax)
je 0x14e6
leaq 0x2c4b(%rip), %rdi      # 0x411d
movb $0x0, %al
callq 0x1b60
callq 0x1070
movl $0x0, (%rax)
jmp 0x14f4
leaq 0x2c30(%rip), %rdi      # 0x411d
movb $0x0, %al
callq 0x1db0
jmp 0x14f6
jmp 0x1553
movl $0x0, -0x4(%rbp)
jmp 0x155a
movq -0x18(%rbp), %rdi
callq 0x2740
movq -0x20(%rbp), %rdi
callq 0x10b0
cmpl $0x0, %eax
je 0x1551
jmp 0x151a
callq 0x1070
cmpl $0x0, (%rax)
je 0x153f
leaq 0x2bf2(%rip), %rdi      # 0x411d
movb $0x0, %al
callq 0x1b60
callq 0x1070
movl $0x0, (%rax)
jmp 0x154d
leaq 0x2bd7(%rip), %rdi      # 0x411d
movb $0x0, %al
callq 0x1db0
jmp 0x154f
jmp 0x1551
jmp 0x1553
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)