// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/tests/mux/main.c
// Function: main
int
main(int argc, char * argv[])
{
	struct wire_requestqueue * Q;
	struct kivaloo_cookie * K;

	WARNP_INIT;

	/* Check number of arguments. */
	if (argc != 3) {
		fprintf(stderr, "usage: test_mux %s %s\n",
		    "<socketname>", "{ping | pong | <prefix>}");
		exit(1);
	}

	/* Open a connection to MUX. */
	if ((K = kivaloo_open(argv[1], &Q)) == NULL) {
		warnp("Could not connecto to MUX daemon.");
		exit(1);
	}

	if (strcmp(argv[2], "ping") == 0) {
		if (pingpong(Q, "pingpong", "ping", "pong", 1))
			exit(1);
	} else if (strcmp(argv[2], "pong") == 0) {
		if (pingpong(Q, "pingpong", "pong", "ping", 0))
			exit(1);
	} else if (strcmp(argv[2], "loop") == 0) {
		/* Repeatedly create/read/delete 10^4 pairs until we die. */
		do {
			if (createmany(Q, 10000, argv[2]))
				exit(1);
		} while (1);
	} else {
		/* Test creating 10000 pairs and reading them back. */
		if (createmany(Q, 10000, argv[2]))
			exit(1);
	}

	/* Free the request queue and network connection. */
	kivaloo_close(K);

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0x246c
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x53f0
jmp 0x246e
cmpl $0x3, -0x8(%rbp)
je 0x24a4
movq 0x12b7d(%rip), %rax     # 0x14ff8
movq (%rax), %rdi
leaq 0xcb7f(%rip), %rsi      # 0xf004
leaq 0xcb8f(%rip), %rdx      # 0xf01b
leaq 0xcb95(%rip), %rcx      # 0xf028
movb $0x0, %al
callq 0x21d0
movl $0x1, %edi
callq 0x22d0
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq -0x18(%rbp), %rsi
callq 0x86c0
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
jne 0x2500
jmp 0x24c1
callq 0x20a0
cmpl $0x0, (%rax)
je 0x24e6
leaq 0xcb6f(%rip), %rdi      # 0xf041
movb $0x0, %al
callq 0x54b0
callq 0x20a0
movl $0x0, (%rax)
jmp 0x24f4
leaq 0xcb54(%rip), %rdi      # 0xf041
movb $0x0, %al
callq 0x5700
jmp 0x24f6
movl $0x1, %edi
callq 0x22d0
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0xcb54(%rip), %rsi      # 0xf063
callq 0x21c0
cmpl $0x0, %eax
jne 0x2551
movq -0x18(%rbp), %rdi
leaq 0xcb44(%rip), %rsi      # 0xf068
leaq 0xcb38(%rip), %rdx      # 0xf063
leaq 0xcb3a(%rip), %rcx      # 0xf06c
movl $0x1, %r8d
callq 0x2630
cmpl $0x0, %eax
je 0x254c
movl $0x1, %edi
callq 0x22d0
jmp 0x2613
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0xcb0c(%rip), %rsi      # 0xf06c
callq 0x21c0
cmpl $0x0, %eax
jne 0x259c
movq -0x18(%rbp), %rdi
leaq 0xcaf3(%rip), %rsi      # 0xf068
leaq 0xcaf0(%rip), %rdx      # 0xf06c
leaq 0xcae0(%rip), %rcx      # 0xf063
xorl %r8d, %r8d
callq 0x2630
cmpl $0x0, %eax
je 0x259a
movl $0x1, %edi
callq 0x22d0
jmp 0x2611
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0xcac6(%rip), %rsi      # 0xf071
callq 0x21c0
cmpl $0x0, %eax
jne 0x25e8
jmp 0x25b7
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdx
movl $0x2710, %esi           # imm = 0x2710
callq 0x27c0
cmpl $0x0, %eax
je 0x25dc
movl $0x1, %edi
callq 0x22d0
jmp 0x25de
movb $0x1, %al
testb $0x1, %al
jne 0x25b7
jmp 0x25e6
jmp 0x260f
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdx
movl $0x2710, %esi           # imm = 0x2710
callq 0x27c0
cmpl $0x0, %eax
je 0x260d
movl $0x1, %edi
callq 0x22d0
jmp 0x260f
jmp 0x2611
jmp 0x2613
movq -0x20(%rbp), %rdi
callq 0x8880
xorl %edi, %edi
callq 0x22d0
nopw %cs:(%rax,%rax)