LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/AK6DN[P]dec-utilities-for-pdp/palbart/palbart.c
// Function: printErrorMessages
void printErrorMessages()
{
  WORD16  ix;
  WORD16  iy;

  if( listfile != NULL )
  {
    /* If any errors, display them now.                                       */
    for( iy = 0; iy < save_error_count; iy++ )
    {
      printPageBreak();
      fprintf( listfile, "%-18.18s", error_list[iy].mesg );
      if( error_list[iy].col >= 0 )
      {
        for( ix = 0; ix < error_list[iy].col; ix++ )
        {
          if( line[ix] == '\t' )
          {
            putc( '\t', listfile );
          }
          else
          {
            putc( ' ', listfile );
          }
        }
        fputs( "^", listfile );
        list_lineno++;
        page_lineno++;
      }
      fputs( "\n", listfile );
    }
  }
  save_error_count = 0;
}

// Assembly:
cmpq $0x0, 0x4c44(%rip)      # 0xb540
je 0x69e0
cmpl $0x0, 0x4ae3(%rip)      # 0xb3ec
jle 0x69e0
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x6fbf(%rip), %r12      # 0xd8e0
leaq 0x6e68(%rip), %r13      # 0xd790
leaq 0xdb6(%rip), %r15       # 0x76e5
xorl %ebp, %ebp
callq 0x67af
movq 0x4c03(%rip), %rdi      # 0xb540
movswq %bp, %rbx
shlq $0x4, %rbx
leaq (%r12,%rbx), %r14
movq (%rbx,%r12), %rdx
leaq 0xffb(%rip), %rsi       # 0x794f
xorl %eax, %eax
callq 0x2120
cmpl $0x0, 0x8(%rbx,%r12)
js 0x69b2
je 0x6993
xorl %ebx, %ebx
movswq %bx, %rax
cmpb $0x9, (%rax,%r13)
movl $0x9, %edi
je 0x697c
movl $0x20, %edi
movq 0x4bbd(%rip), %rsi      # 0xb540
callq 0x2100
incl %ebx
movswl %bx, %eax
cmpl %eax, 0x8(%r14)
jg 0x6967
movq 0x4ba6(%rip), %rsi      # 0xb540
leaq 0xfb7(%rip), %rdi       # 0x7958
callq 0x20c0
incl 0x6dc8(%rip)            # 0xd774
incl 0x4a62(%rip)            # 0xb414
movq 0x4b87(%rip), %rsi      # 0xb540
movq %r15, %rdi
callq 0x20c0
incl %ebp
movswl %bp, %eax
cmpl %eax, 0x4a20(%rip)      # 0xb3ec
jg 0x6931
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
movl $0x0, 0x4a02(%rip)      # 0xb3ec
retq
// File: /workspace/github_c_makefile_star2_O3/AK6DN[P]dec-utilities-for-pdp/palbart/palbart.c
// Function: punchLocObject
void punchLocObject( WORD16 loc, WORD16 val )
{
  if( rim_mode )
  {
    punchOrigin( loc );
  }
  punchObject(( val >> 6 ) & 0077 );
  punchObject( val & 0077 );
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebx
cmpb $0x0, 0x4956(%rip)      # 0xb34d
je 0x6a13
movl %edi, %ebp
shrl $0x6, %edi
andl $0x3f, %edi
orl $0x40, %edi
callq 0x6a30
andl $0x3f, %ebp
movl %ebp, %edi
callq 0x6a30
movl %ebx, %edi
shrl $0x6, %edi
andl $0x3f, %edi
callq 0x6a30
andl $0x3f, %ebx
movl %ebx, %edi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x6a30
// File: /workspace/github_c_makefile_star2_O3/AK6DN[P]dec-utilities-for-pdp/palbart/palbart.c
// Function: punchObject
void punchObject( WORD16 val )
{
  val &= 0377;
  if( objectfile != NULL )
  {
    fputc( val, objectfile );
    checksum += val;
  }
  binary_data_output = TRUE;
}

// Assembly:
movq 0x4a79(%rip), %rsi      # 0xb4b0
testq %rsi, %rsi
je 0x6a50
pushq %rbx
movzbl %dil, %ebx
movl %ebx, %edi
callq 0x20e0
addw %bx, 0x49c1(%rip)       # 0xb410
popq %rbx
movb $0x1, 0x48f1(%rip)      # 0xb348
retq
// File: /workspace/github_c_makefile_star2_O3/AK6DN[P]dec-utilities-for-pdp/palbart/palbart.c
// Function: binarySearch
int binarySearch( char *name, int start, int symbol_count )
{
  int     lx;                   /* Left index                                 */
  int     mx;                   /* Middle index                               */
  int     rx;                   /* Right index                                */
  int     compare;              /* Results of comparison                      */

  lx = start;
  rx = symbol_count - 1;
  while( lx <= rx )
  {
    mx = ( lx + rx ) / 2;   /* Find center of search area.                    */

    compare = strcmp( name, symtab[mx].name );

    if( compare < 0 )
    {
      rx = mx - 1;
    }
    else if( compare > 0 )
    {
      lx = mx + 1;
    }
    else
    {
      return( mx );         /* Found a match in symbol table.                 */
    }
  } /* end while                                                              */
  return( ~lx );            /* Return insertion point.                        */
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
cmpl %esi, %edx
jle 0x6ab0
movl %edx, %r15d
movq %rdi, %r14
decl %r15d
movq 0x4982(%rip), %r12      # 0xb3f8
leal (%r15,%rbx), %eax
movl %eax, %ebp
shrl $0x1f, %ebp
addl %eax, %ebp
sarl %ebp
movslq %ebp, %rax
leaq (%rax,%rax,2), %rax
leaq (%r12,%rax,8), %rsi
addq $0x4, %rsi
movq %r14, %rdi
callq 0x2110
testl %eax, %eax
jns 0x6aa5
decl %ebp
movl %ebp, %r15d
jmp 0x6aab
je 0x6ab4
incl %ebp
movl %ebp, %ebx
cmpl %r15d, %ebx
jle 0x6a76
notl %ebx
movl %ebx, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/AK6DN[P]dec-utilities-for-pdp/palbart/palbart.c
// Function: conditionFalse
void conditionFalse()
{
  int     level;

  if( line[lexstart] == '<' )
  {
    /* Invariant: line[cc] is the next unexamined character.                  */
    level = 1;
    while( level > 0 )
    {
      if( isend( line[cc] ))
      {
        readLine();
      }
      else
      {
        switch( line[cc] )
        {
        case '>':
          level--;
          cc++;
          break;

        case '<':
          level++;
          cc++;
          break;

        case '$':
          level = 0;
          cc++;
          break;

        default:
          cc++;
          break;
        } /* end switch                                                       */
      } /* end if                                                             */
    } /* end while                                                            */
    nextLexeme();
  }
  else
  {
    errorMessage( &lt_expected, lexstart );
  }
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movslq 0x6d19(%rip), %rsi      # 0xd814
leaq 0x6c8e(%rip), %rbx      # 0xd790
cmpb $0x3c, (%rsi,%rbx)
jne 0x6b63
movl $0x1, %ebp
movl 0x6d19(%rip), %eax      # 0xd82c
movslq %eax, %rcx
movzbl (%rcx,%rbx), %ecx
cmpl $0x23, %ecx
jle 0x6b2d
cmpl $0x3c, %ecx
je 0x6b43
cmpl $0x3e, %ecx
jne 0x6b47
decl %ebp
jmp 0x6b4c
testl %ecx, %ecx
je 0x6b36
cmpl $0xa, %ecx
jne 0x6b4c
callq 0x3ac7
movl 0x6ceb(%rip), %eax      # 0xd82c
jmp 0x6b54
incl %ebp
jmp 0x6b4c
cmpl $0x24, %ecx
je 0x6b75
incl %eax
movl %eax, 0x6cd8(%rip)      # 0xd82c
testl %ebp, %ebp
jne 0x6b13
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x3be8
leaq 0x475e(%rip), %rdi      # 0xb2c8
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5ac8
incl %eax
movl %eax, 0x6caf(%rip)      # 0xd82c
jmp 0x6b58
// File: /workspace/github_c_makefile_star2_O3/AK6DN[P]dec-utilities-for-pdp/palbart/palbart.c
// Function: saveError
void saveError( char *mesg, int col )
{
  if( save_error_count < DIM( error_list ))
  {
    error_list[save_error_count].mesg = mesg;
    error_list[save_error_count].col = col;
    save_error_count++;
  }
  error_in_line = TRUE;

  if( listed )
  {
    printErrorMessages();
  }
}

// Assembly:
movl 0x4867(%rip), %eax      # 0xb3ec
cmpq $0x13, %rax
ja 0x6ba9
movq %rax, %rcx
shlq $0x4, %rcx
leaq 0x6d47(%rip), %rdx      # 0xd8e0
movq %rdi, (%rcx,%rdx)
movl %esi, 0x8(%rcx,%rdx)
incl %eax
movl %eax, 0x4843(%rip)      # 0xb3ec
movb $0x1, 0x6c68(%rip)      # 0xd818
cmpb $0x0, 0x6bb1(%rip)      # 0xd768
jne 0x68f4
retq
// File: /workspace/github_c_makefile_star2_O3/rouming[P]io/zmtp-test.c
// Function: on_signal
static int on_signal(void *poller, struct poller_item *item)
{
	ssize_t rd;
	struct signalfd_siginfo fdsi;

	while (1) {
		rd = read(item->fd, &fdsi, sizeof(fdsi));
		if (rd < 0 && errno == EAGAIN) {
			return 0;
		}
		else if (rd != sizeof(fdsi)) {
			/* Consider as fatal error */
			assert(0);
			return -1;
		}

		switch (fdsi.ssi_signo) {
		case SIGINT:
		case SIGTERM:
			/* Stop further processing, termination requested */
			return 1;
		default:
			assert(0);
			return -1;
		}
	}

	/* Unreachable line */
	assert(0);
	return -1;
}

// Assembly:
subq $0x88, %rsp
movl (%rsi), %edi
leaq 0x8(%rsp), %rsi
movl $0x80, %edx
callq 0x1130
testq %rax, %rax
js 0x172e
cmpq $0x80, %rax
jne 0x1745
movl $0x1, %eax
movl 0x8(%rsp), %ecx
cmpl $0x2, %ecx
je 0x173d
cmpl $0xf, %ecx
je 0x173d
leaq 0x3f15(%rip), %rdi      # 0x562b
leaq 0x3948(%rip), %rsi      # 0x5065
leaq 0x39e9(%rip), %rcx      # 0x510d
movl $0xc5, %edx
callq 0x10d0
callq 0x1050
movq %rax, %rcx
xorl %eax, %eax
cmpl $0xb, (%rcx)
jne 0x1745
addq $0x88, %rsp
retq
leaq 0x3edf(%rip), %rdi      # 0x562b
leaq 0x3912(%rip), %rsi      # 0x5065
leaq 0x39b3(%rip), %rcx      # 0x510d
movl $0xbb, %edx
callq 0x10d0
// File: /workspace/github_c_makefile_star2_O3/rouming[P]io/zmtp-test.c
// Function: on_sock_connection
static int on_sock_connection(void *poller, struct poller_item *item)
{
	int err, psock;
	struct sockaddr addr;
	socklen_t len = sizeof(addr);
	struct loop_ctx *ctx = item->data;
	struct io_req *req;
	struct peer *peer;

	psock = accept4(item->fd, &addr, &len, SOCK_CLOEXEC);
	if (psock < 0) {
		switch (errno) {
		case EWOULDBLOCK:
			break;
		default:
			err = -errno;
			assert(0);
			return err;
		}

		return 0;
	}

	peer = malloc(sizeof(*peer));
	assert(peer);
	peer->psock = psock;
	peer->ctx = ctx;
	INIT_LIST_HEAD(&peer->list);
	io_queue_init(&peer->q);
	err = io_queue_bind(&peer->q, ctx->poller, psock);
	assert(err == 0);
	err = zmtp_init(&peer->zmtp, &peer->q, ZMTP_REP);
	assert(err == 0);

	req = io_req_create(&peer->q, REQ_RD, peer, on_read);
	assert(req);
	req->buf = (struct io_buf){
		.iov_num  = 1,
		.is_vari_len = true,
	};
	err = io_queue_submit(req);
	assert(err == 0);

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
leaq 0x4(%rsp), %rdx
movl $0x10, (%rdx)
movq 0x10(%rsi), %r15
movl (%rsi), %edi
leaq 0x8(%rsp), %rsi
movl $0x80000, %ecx          # imm = 0x80000
callq 0x10b0
testl %eax, %eax
js 0x187e
movl %eax, %ebp
movl $0x1c8, %edi            # imm = 0x1C8
callq 0x1180
testq %rax, %rax
je 0x1899
movq %rax, %rbx
movl %ebp, 0x10(%rax)
movq %r15, 0x1c0(%rax)
movq %rax, (%rax)
movq %rax, 0x8(%rax)
leaq 0x18(%rax), %r14
movq %r14, %rdi
callq 0x2f4f
movq 0x8(%r15), %rsi
movq %r14, %rdi
movl %ebp, %edx
callq 0x3041
testl %eax, %eax
jne 0x18b8
movq %rbx, %rdi
addq $0x190, %rdi            # imm = 0x190
movq %r14, %rsi
xorl %edx, %edx
callq 0x1d30
testl %eax, %eax
jne 0x18d7
leaq 0x130(%rip), %rcx       # 0x1934
movq %r14, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x3be7
testq %rax, %rax
je 0x18f6
movq %rax, %rbx
movq %rax, %rdi
addq $0x28, %rdi
movl $0x120, %edx            # imm = 0x120
xorl %esi, %esi
callq 0x10e0
movq $0x1, 0x148(%rbx)
movb $0x1, 0x150(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x151(%rbx)
movups %xmm0, 0x160(%rbx)
movq %rbx, %rdi
callq 0x3902
testl %eax, %eax
je 0x188c
leaq 0x3824(%rip), %rdi      # 0x508a
leaq 0x37f8(%rip), %rsi      # 0x5065
leaq 0x38c5(%rip), %rcx      # 0x5139
movl $0xf8, %edx
callq 0x10d0
callq 0x1050
cmpl $0xb, (%rax)
jne 0x1915
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x38ce(%rip), %rdi      # 0x516e
leaq 0x37be(%rip), %rsi      # 0x5065
leaq 0x388b(%rip), %rcx      # 0x5139
movl $0xe7, %edx
callq 0x10d0
leaq 0x37cb(%rip), %rdi      # 0x508a
leaq 0x379f(%rip), %rsi      # 0x5065
leaq 0x386c(%rip), %rcx      # 0x5139
movl $0xed, %edx
callq 0x10d0
leaq 0x37ac(%rip), %rdi      # 0x508a
leaq 0x3780(%rip), %rsi      # 0x5065
leaq 0x384d(%rip), %rcx      # 0x5139
movl $0xef, %edx
callq 0x10d0
leaq 0x3973(%rip), %rdi      # 0x5270
leaq 0x3761(%rip), %rsi      # 0x5065
leaq 0x382e(%rip), %rcx      # 0x5139
movl $0xf2, %edx
callq 0x10d0
leaq 0x3d0f(%rip), %rdi      # 0x562b
leaq 0x3742(%rip), %rsi      # 0x5065
leaq 0x380f(%rip), %rcx      # 0x5139
movl $0xdf, %edx
callq 0x10d0
// File: /workspace/github_c_makefile_star2_O3/rouming[P]io/zmtp-test.c
// Function: on_read
static int on_read(struct io_req *req, int len)
{
	struct peer *peer = req->data;
	bool more;
	int err;

	if (len < 0) {
		io_req_put(req);
		list_add_tail(&peer->list, &peer->ctx->peers_to_free);

		return len;
	}

	more = req->flags & REQ_MORE;
	printf("Got: len=%d, more=%d, '%.*s'\n",
	       len, more, len, (char *)req->buf.iov[0].iov_base);
	io_req_put(req);

	if (more) {
		req = io_req_create(&peer->q, REQ_RD, peer, on_read);
		assert(req);
		req->buf = (struct io_buf){
			.iov_num  = 1,
			.is_vari_len = true,
		};
		err = io_queue_submit(req);
		assert(err == 0);

		return len;
	}

	peer->sent = 1;
	req = io_req_create(&peer->q, REQ_WR | REQ_MORE, peer, on_write);
	assert(req);
	req->buf = (struct io_buf){
		.iov[0] = {
			.iov_base = (char *)replies[0],
			.iov_len  = strlen(replies[0])
		},
		.iov_num  = 1,
	};
	err = io_queue_submit(req);
	assert(err == 0);

	return len;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r15
movq 0x18(%rdi), %r14
testl %esi, %esi
js 0x1a20
movl 0x20(%r15), %ebp
andl $0x2, %ebp
movl %ebp, %edx
shrl %edx
movq 0x28(%r15), %r8
leaq 0x3811(%rip), %rdi      # 0x5173
movl %ebx, %esi
movl %ebx, %ecx
xorl %eax, %eax
callq 0x10c0
movq %r15, %rdi
callq 0x3c7a
testl %ebp, %ebp
jne 0x1a50
movl $0x1, 0x14(%r14)
leaq 0x18(%r14), %rdi
leaq 0x18c(%rip), %rcx       # 0x1b1c
movl $0x3, %esi
movq %r14, %rdx
callq 0x3be7
testq %rax, %rax
je 0x1abf
movq %rax, %r14
movq 0x6770(%rip), %r15      # 0x8120
movq %r15, %rdi
callq 0x10a0
movq %r15, 0x28(%r14)
movq %rax, 0x30(%r14)
movq %r14, %rdi
addq $0x38, %rdi
movl $0x110, %edx            # imm = 0x110
xorl %esi, %esi
callq 0x10e0
movq $0x1, 0x148(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x150(%r14)
movups %xmm0, 0x160(%r14)
movq %r14, %rdi
callq 0x3902
testl %eax, %eax
je 0x1ab2
leaq 0x3682(%rip), %rdi      # 0x508a
leaq 0x3656(%rip), %rsi      # 0x5065
leaq 0x377b(%rip), %rcx      # 0x5191
movl $0xaa, %edx
callq 0x10d0
movq %r15, %rdi
callq 0x3c7a
movq 0x1c0(%r14), %rax
leaq 0x270(%rax), %rcx
movq 0x278(%rax), %rdx
movq %r14, 0x278(%rax)
movq %rcx, (%r14)
movq %rdx, 0x8(%r14)
movq %r14, (%rdx)
jmp 0x1ab2
leaq 0x18(%r14), %rdi
leaq -0x127(%rip), %rcx      # 0x1934
xorl %esi, %esi
movq %r14, %rdx
callq 0x3be7
testq %rax, %rax
je 0x1ade
movq %rax, %r14
movq %rax, %rdi
addq $0x28, %rdi
movl $0x120, %edx            # imm = 0x120
xorl %esi, %esi
callq 0x10e0
movq $0x1, 0x148(%r14)
movb $0x1, 0x150(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x151(%r14)
movups %xmm0, 0x160(%r14)
movq %r14, %rdi
callq 0x3902
testl %eax, %eax
jne 0x1afd
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x37aa(%rip), %rdi      # 0x5270
leaq 0x3598(%rip), %rsi      # 0x5065
leaq 0x36bd(%rip), %rcx      # 0x5191
movl $0xa1, %edx
callq 0x10d0
leaq 0x378b(%rip), %rdi      # 0x5270
leaq 0x3579(%rip), %rsi      # 0x5065
leaq 0x369e(%rip), %rcx      # 0x5191
movl $0x94, %edx
callq 0x10d0
leaq 0x3586(%rip), %rdi      # 0x508a
leaq 0x355a(%rip), %rsi      # 0x5065
leaq 0x367f(%rip), %rcx      # 0x5191
movl $0x9a, %edx
callq 0x10d0
// File: /workspace/github_c_makefile_star2_O3/rouming[P]io/zmtp.c
// Function: on_recv__REP
static int on_recv__REP(struct io_req *req, int len)
{
	struct zmtp *zmtp = req->data;
	struct io_queue *q = zmtp->io_proto.q;
	struct io_req *rd_req;
	int exp_len;
	bool more;

	if (len < 0)
		goto out;

	exp_len = zmtp_expect_msg(zmtp, req, false, &more);
	if (exp_len < 0) {
		len = exp_len;
		goto out;
	}
	if (exp_len == 0)
		/* Package is not fully received, continue */
		return 0;

	rd_req = list_first_entry_or_null(&q->queue, struct io_req, list);
	/* Should be checked by on_proto_submit_REP() */
	assert(rd_req);
	assert((rd_req->flags & REQ_RDWR_MASK) == REQ_RD);

	if (!buf_vari_len(&rd_req->buf)) {
		/* Expect exact size if request is not of a variable length */
		if (exp_len != (buf_len(&rd_req->buf) - buf_pos(&rd_req->buf))) {
			len = -EPROTO;
			goto out;
		}
	} else {
		rd_req->buf.__proto.read_hint = exp_len;
	}
	if (more)
		rd_req->flags |= REQ_MORE;

out:
	io_req_put(req);
	if (len < 0)
		zmtp->inner_state = ZMTP_REP_CLOSED;

	return len;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movq 0x18(%rdi), %r14
testl %esi, %esi
js 0x2028
movq (%r14), %r13
xorl %r12d, %r12d
leaq 0x3(%rsp), %rcx
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x20d0
movl %eax, %r15d
testl %eax, %eax
js 0x202d
je 0x2080
movq 0x138(%r13), %rax
addq $0x138, %r13            # imm = 0x138
cmpq %r13, %rax
je 0x2092
movq %rax, %r13
testq %rax, %rax
je 0x2092
testb $0x1, 0x20(%r13)
jne 0x20b1
leaq 0x28(%r13), %r12
movq %r12, %rdi
callq 0x2974
testb %al, %al
je 0x2032
movl %r15d, %eax
movq %rax, 0x158(%r13)
jmp 0x2057
movl %ebp, %r12d
jmp 0x2070
movl %r15d, %r12d
jmp 0x2070
movq %r12, %rdi
callq 0x2a38
movl %eax, 0x4(%rsp)
movq %r12, %rdi
callq 0x29af
movl 0x4(%rsp), %ecx
subl %eax, %ecx
movl $0xffffffb9, %r12d      # imm = 0xFFFFFFB9
cmpl %ecx, %r15d
jne 0x2070
cmpb $0x1, 0x3(%rsp)
jne 0x2063
orb $0x2, 0x20(%r13)
movq %rbx, %rdi
callq 0x3c7a
movl %ebp, %r12d
jmp 0x2080
movq %rbx, %rdi
callq 0x3c7a
movl $0x2, 0x28(%r14)
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x31d4(%rip), %rdi      # 0x526d
leaq 0x31d4(%rip), %rsi      # 0x5274
leaq 0x31d4(%rip), %rcx      # 0x527b
movl $0x9a, %edx
callq 0x10d0
leaq 0x31ea(%rip), %rdi      # 0x52a2
leaq 0x31b5(%rip), %rsi      # 0x5274
leaq 0x31b5(%rip), %rcx      # 0x527b
movl $0x9b, %edx
callq 0x10d0
// File: /workspace/github_c_makefile_star2_O3/rouming[P]io/zmtp.c
// Function: on_greet_1_sign_send__REP
static int on_greet_1_sign_send__REP(struct io_req *req, int len)
{
	struct zmtp *zmtp = req->data;
	struct io_req *rd_req;
	int rc;

	/*
	 * Signature is sent, recv a peer signature
	 */

	if (len < 0)
		goto out;
	rd_req = io_req_create(zmtp->io_proto.q, REQ_RD, zmtp,
			       on_greet_1_sign_recv__REP);
	if (rd_req == NULL) {
		len = -ENOMEM;
		goto out;
	}
	rd_req->buf = (struct io_buf){
		.iov[0] = {
			.iov_len  = sizeof(sign_and_maj)
		},
		.iov_num  = 1,
	};
	rc = zmtp->io_proto.submit(rd_req, TO_HEAD);
	if (rc) {
		io_req_put(rd_req);
		len = rc;
		goto out;
	}

out:
	io_req_put(req);
	if (len < 0)
		zmtp->inner_state = ZMTP_REP_CLOSED;

	return len;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
movq %rdi, %r15
movq 0x18(%rdi), %r14
testl %esi, %esi
js 0x2345
movq (%r14), %rdi
leaq 0xa7(%rip), %rcx        # 0x236a
xorl %esi, %esi
movq %r14, %rdx
callq 0x3be7
testq %rax, %rax
je 0x2340
movq %rax, %r12
movq $0x0, 0x28(%rax)
movq $0xb, 0x30(%rax)
movq %rax, %rdi
addq $0x38, %rdi
movl $0x110, %edx            # imm = 0x110
xorl %esi, %esi
callq 0x10e0
movq $0x1, 0x148(%r12)
xorps %xmm0, %xmm0
movups %xmm0, 0x150(%r12)
movups %xmm0, 0x160(%r12)
movq %r12, %rdi
xorl %esi, %esi
callq *0x8(%r14)
testl %eax, %eax
je 0x2360
movl %eax, %ebp
movq %r12, %rdi
callq 0x3c7a
movq %r15, %rdi
callq 0x3c7a
movl %ebp, %ebx
testl %ebp, %ebp
jns 0x2355
jmp 0x234d
movl $0xfffffff4, %ebx       # imm = 0xFFFFFFF4
movq %r15, %rdi
callq 0x3c7a
movl $0x2, 0x28(%r14)
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
callq 0x3c7a
jmp 0x2355
// File: /workspace/github_c_makefile_star2_O3/rouming[P]io/zmtp.c
// Function: on_greet_1_sign_recv__REP
static int on_greet_1_sign_recv__REP(struct io_req *req, int len)
{
	struct zmtp *zmtp = req->data;
	struct zmtp_header *hdr;
	int rc;

	/*
	 * Peer signature is received, validate and send the rest
	 */

	if (len < 0)
		goto out;

	/* Validate the signature */
	assert(len == sizeof(*hdr));
	hdr = req->buf.iov[0].iov_base;
	if (zmtp_signature_check(&hdr->sign, len)) {
		len = -EMSGSIZE;
		goto out;
	}

	switch (hdr->majv) {
	case 0x01:
		rc = zmtp_greet_v2_rest_send(zmtp);
		break;
	case 0x03:
		rc = zmtp_greet_v3_rest_send(zmtp);
		break;
	default:
		/* TODO: probably reply with some kind of ERROR? */
		len = -EMSGSIZE;
		goto out;
	}
	if (rc < 0)
		len = rc;

out:
	io_req_put(req);
	if (len < 0)
		zmtp->inner_state = ZMTP_REP_CLOSED;

	return len;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movq 0x18(%rdi), %r14
testl %esi, %esi
js 0x23ad
cmpl $0xb, %ebp
jne 0x24ae
movq 0x28(%rbx), %rax
movq (%rax), %rcx
xorq 0x5dbb(%rip), %rcx      # 0x8150
movzwl 0x8(%rax), %edx
xorw 0x5db8(%rip), %dx       # 0x8158
movzwl %dx, %edx
orq %rcx, %rdx
movl $0xffffffa6, %ebp       # imm = 0xFFFFFFA6
je 0x23ca
movq %rbx, %rdi
callq 0x3c7a
movl $0x2, 0x28(%r14)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movzbl 0xa(%rax), %eax
cmpl $0x3, %eax
je 0x2410
cmpl $0x1, %eax
jne 0x23ad
movq (%r14), %rdi
leaq 0xeb(%rip), %rcx        # 0x24cd
movl $0x1, %esi
movq %r14, %rdx
callq 0x3be7
testq %rax, %rax
je 0x24a4
movq %rax, %r15
leaq 0x5d65(%rip), %rax      # 0x8167
movq %rax, 0x28(%r15)
movq $0x3, 0x30(%r15)
jmp 0x2442
movq (%r14), %rdi
leaq 0x1f6(%rip), %rcx       # 0x2610
movl $0x1, %esi
movq %r14, %rdx
callq 0x3be7
testq %rax, %rax
je 0x24a4
movq %rax, %r15
leaq 0x5d37(%rip), %rax      # 0x816d
movq %rax, 0x28(%r15)
movq $0x35, 0x30(%r15)
movq %r15, %rdi
addq $0x38, %rdi
movl $0x110, %edx            # imm = 0x110
xorl %esi, %esi
callq 0x10e0
movq $0x1, 0x148(%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x150(%r15)
movups %xmm0, 0x160(%r15)
movq %r15, %rdi
xorl %esi, %esi
callq *0x8(%r14)
testl %eax, %eax
je 0x2492
movl %eax, %ebp
movq %r15, %rdi
callq 0x3c7a
testl %ebp, %ebp
js 0x23ad
movq %rbx, %rdi
callq 0x3c7a
movl $0xb, %ebp
jmp 0x23bd
movl $0xfffffff4, %ebp       # imm = 0xFFFFFFF4
jmp 0x23ad
leaq 0x2ea2(%rip), %rdi      # 0x5357
leaq 0x2db8(%rip), %rsi      # 0x5274
leaq 0x2ea8(%rip), %rcx      # 0x536b
movl $0x27e, %edx            # imm = 0x27E
callq 0x10d0
// File: /workspace/github_c_makefile_star2_O3/rouming[P]io/zmtp.c
// Function: on_greet_v2_2_rest_send__REP
static int on_greet_v2_2_rest_send__REP(struct io_req *req, int len)
{
	struct zmtp *zmtp = req->data;
	struct io_req *rd_req;
	int rc;

	/*
	 * The rest is send, read the rest from the peer
	 */

	if (len < 0)
		goto out;
	rd_req = io_req_create(zmtp->io_proto.q, REQ_RD, zmtp,
			       on_greet_v2_2_rest_recv__REP);
	if (rd_req == NULL) {
		len = -ENOMEM;
		goto out;
	}
	rd_req->buf = (struct io_buf){
		.iov[0] = {
			.iov_len = sizeof(ZMTP_V2_REQ_HS)
		},
		.iov_num = 1,
	};
	rc = zmtp->io_proto.submit(rd_req, TO_HEAD);
	if (rc) {
		io_req_put(rd_req);
		len = rc;
		goto out;
	}

out:
	io_req_put(req);
	if (len < 0)
		zmtp->inner_state = ZMTP_REP_CLOSED;

	return len;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
movq %rdi, %r15
movq 0x18(%rdi), %r14
testl %esi, %esi
js 0x2572
movq (%r14), %rdi
leaq 0xa7(%rip), %rcx        # 0x2597
xorl %esi, %esi
movq %r14, %rdx
callq 0x3be7
testq %rax, %rax
je 0x256d
movq %rax, %r12
movq $0x0, 0x28(%rax)
movq $0x3, 0x30(%rax)
movq %rax, %rdi
addq $0x38, %rdi
movl $0x110, %edx            # imm = 0x110
xorl %esi, %esi
callq 0x10e0
movq $0x1, 0x148(%r12)
xorps %xmm0, %xmm0
movups %xmm0, 0x150(%r12)
movups %xmm0, 0x160(%r12)
movq %r12, %rdi
xorl %esi, %esi
callq *0x8(%r14)
testl %eax, %eax
je 0x258d
movl %eax, %ebp
movq %r12, %rdi
callq 0x3c7a
movq %r15, %rdi
callq 0x3c7a
movl %ebp, %ebx
testl %ebp, %ebp
jns 0x2582
jmp 0x257a
movl $0xfffffff4, %ebx       # imm = 0xFFFFFFF4
movq %r15, %rdi
callq 0x3c7a
movl $0x2, 0x28(%r14)
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
callq 0x3c7a
jmp 0x2582
// File: /workspace/github_c_makefile_star2_O3/rouming[P]io/zmtp.c
// Function: on_greet_v2_2_rest_recv__REP
static int on_greet_v2_2_rest_recv__REP(struct io_req *req, int len)
{
	struct zmtp *zmtp = req->data;
	void *greet;

	/*
	 * The rest is received, validate version and recv the REQ hshake
	 */

	if (len < 0)
		goto out;

	/* Validate the rest greeting */
	assert(len == sizeof(ZMTP_V2_REQ_HS));
	greet = req->buf.iov[0].iov_base;
	if (memcmp(ZMTP_V2_REQ_HS, greet,  sizeof(ZMTP_V2_REQ_HS))) {
		len = -EMSGSIZE;
		goto out;
	}
out:
	io_req_put(req);
	if (len < 0)
		zmtp->inner_state = ZMTP_REP_CLOSED;

	return len;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq 0x18(%rdi), %r14
testl %esi, %esi
js 0x25ce
cmpl $0x3, %ebx
jne 0x25f1
movq 0x28(%rdi), %rax
movzwl 0x5bb5(%rip), %ecx      # 0x816a
xorw (%rax), %cx
movb 0x5bae(%rip), %dl       # 0x816c
xorb 0x2(%rax), %dl
movzbl %dl, %eax
orw %cx, %ax
movl $0xffffffa6, %ebx       # imm = 0xFFFFFFA6
je 0x25dd
callq 0x3c7a
movl $0x2, 0x28(%r14)
jmp 0x25e7
callq 0x3c7a
movl $0x3, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x2da7(%rip), %rdi      # 0x539f
leaq 0x2c75(%rip), %rsi      # 0x5274
leaq 0x2db7(%rip), %rcx      # 0x53bd
movl $0x220, %edx            # imm = 0x220
callq 0x10d0
// File: /workspace/github_c_makefile_star2_O3/rouming[P]io/zmtp.c
// Function: on_greet_v3_2_rest_send__REP
static int on_greet_v3_2_rest_send__REP(struct io_req *req, int len)
{
	struct zmtp *zmtp = req->data;
	struct io_req *rd_req;
	int rc;

	/*
	 * The rest is send, read the rest from the peer
	 */

	if (len < 0)
		goto out;
	rd_req = io_req_create(zmtp->io_proto.q, REQ_RD, zmtp,
			       on_greet_v3_2_rest_recv__REP);
	if (rd_req == NULL) {
		len = -ENOMEM;
		goto out;
	}
	rd_req->buf = (struct io_buf){
		.iov[0] = {
			.iov_len = sizeof(v3_greet)
		},
		.iov_num = 1,
	};
	rc = zmtp->io_proto.submit(rd_req, TO_HEAD);
	if (rc) {
		io_req_put(rd_req);
		len = rc;
		goto out;
	}

out:
	io_req_put(req);
	if (len < 0)
		zmtp->inner_state = ZMTP_REP_CLOSED;

	return len;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
movq %rdi, %r15
movq 0x18(%rdi), %r14
testl %esi, %esi
js 0x26b5
movq (%r14), %rdi
leaq 0xa7(%rip), %rcx        # 0x26da
xorl %esi, %esi
movq %r14, %rdx
callq 0x3be7
testq %rax, %rax
je 0x26b0
movq %rax, %r12
movq $0x0, 0x28(%rax)
movq $0x35, 0x30(%rax)
movq %rax, %rdi
addq $0x38, %rdi
movl $0x110, %edx            # imm = 0x110
xorl %esi, %esi
callq 0x10e0
movq $0x1, 0x148(%r12)
xorps %xmm0, %xmm0
movups %xmm0, 0x150(%r12)
movups %xmm0, 0x160(%r12)
movq %r12, %rdi
xorl %esi, %esi
callq *0x8(%r14)
testl %eax, %eax
je 0x26d0
movl %eax, %ebp
movq %r12, %rdi
callq 0x3c7a
movq %r15, %rdi
callq 0x3c7a
movl %ebp, %ebx
testl %ebp, %ebp
jns 0x26c5
jmp 0x26bd
movl $0xfffffff4, %ebx       # imm = 0xFFFFFFF4
movq %r15, %rdi
callq 0x3c7a
movl $0x2, 0x28(%r14)
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
callq 0x3c7a
jmp 0x26c5
// File: /workspace/github_c_makefile_star2_O3/rouming[P]io/zmtp.c
// Function: on_greet_v3_2_rest_recv__REP
static int on_greet_v3_2_rest_recv__REP(struct io_req *req, int len)
{
	struct zmtp *zmtp = req->data;
	struct io_req *rd_req;
	struct zmtp_greeting_v3 *greet;
	int rc;

	/*
	 * The rest is received, validate version and recv the REQ hshake
	 */

	if (len < 0)
		goto out;

	/* Validate the rest greeting */
	assert(len == sizeof(*greet));
	greet = req->buf.iov[0].iov_base;
	if (memcmp(&v3_greet, greet,  sizeof(*greet))) {
		len = -EMSGSIZE;
		goto out;
	}

	rd_req = io_req_create(zmtp->io_proto.q, REQ_RD, zmtp,
			       on_greet_v3_3_hshake_recv__REP);
	if (rd_req == NULL) {
		len = -ENOMEM;
		goto out;
	}
	/*
	 * TODO: probably we need generic function for that,
	 * TODO: like zmtp_init_rd_hdr_req() already does.
	 */
	rd_req->buf = (struct io_buf){
		.iov[0] = {
			.iov_len  = 1 /* Flag field to determin the size */
		},
		.iov_num  = 1,
	};
	rc = zmtp->io_proto.submit(rd_req, TO_HEAD);
	if (rc) {
		io_req_put(rd_req);
		len = rc;
		goto out;
	}

out:
	io_req_put(req);
	if (len < 0)
		zmtp->inner_state = ZMTP_REP_CLOSED;

	return len;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebp
movq %rdi, %r14
movq 0x18(%rdi), %rbx
testl %esi, %esi
js 0x2716
cmpl $0x35, %ebp
jne 0x27d2
movq 0x28(%r14), %rsi
leaq 0x5a6a(%rip), %rdi      # 0x816d
movl $0x35, %edx
callq 0x11a0
movl $0xffffffa6, %ebp       # imm = 0xFFFFFFA6
testl %eax, %eax
je 0x2730
movq %r14, %rdi
callq 0x3c7a
movl $0x2, 0x28(%rbx)
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq (%rbx), %rdi
leaq 0xb7(%rip), %rcx        # 0x27f1
xorl %esi, %esi
movq %rbx, %rdx
callq 0x3be7
testq %rax, %rax
je 0x27b6
movq %rax, %r15
movq $0x0, 0x28(%rax)
movl $0x1, %r12d
movq %r12, 0x30(%rax)
movq %rax, %rdi
addq $0x38, %rdi
movl $0x110, %edx            # imm = 0x110
xorl %esi, %esi
callq 0x10e0
movq %r12, 0x148(%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x150(%r15)
movups %xmm0, 0x160(%r15)
movq %r15, %rdi
xorl %esi, %esi
callq *0x8(%rbx)
testl %eax, %eax
je 0x27c0
movl %eax, %ebp
movq %r15, %rdi
callq 0x3c7a
movq %r14, %rdi
callq 0x3c7a
testl %ebp, %ebp
jns 0x2725
jmp 0x271e
movl $0xfffffff4, %ebp       # imm = 0xFFFFFFF4
jmp 0x2716
movq %r14, %rdi
callq 0x3c7a
movl $0x35, %ebp
jmp 0x2725
leaq 0x2c1b(%rip), %rdi      # 0x53f4
leaq 0x2a94(%rip), %rsi      # 0x5274
leaq 0x2c23(%rip), %rcx      # 0x540a
movl $0x1ab, %edx            # imm = 0x1AB
callq 0x10d0
// File: /workspace/github_c_makefile_star2_O3/rouming[P]io/zmtp.c
// Function: on_greet_v3_3_hshake_recv__REP
static int on_greet_v3_3_hshake_recv__REP(struct io_req *req, int len)
{
	struct zmtp *zmtp = req->data;
	struct io_req *wr_req;
	int rc;

	/*
	 * Receive full hshake, validate and send our hshake
	 */

	if (len < 0)
		goto out;

	rc = zmtp_expect_msg(zmtp, req, true, NULL);
	if (rc < 0) {
		len = rc;
		goto out;
	}
	if (rc == 0)
		/* Package is not fully received, continue */
		return 0;

	rc = zmtp_parse_hshake(req, ZMTP_REP);
	if (rc < 0) {
		/* TODO: probably respond with ERROR? */
		len = rc;
		goto out;
	}

	/*
	 * Send hshake
	 */
	wr_req = io_req_create(zmtp->io_proto.q, REQ_WR, zmtp,
			       on_greet_v3_3_hshake_send__REP);
	if (wr_req == NULL) {
		len = -ENOMEM;
		goto out;
	}
	wr_req->buf = (struct io_buf){
		.iov[0] = {
			.iov_base = ZMTP_V3_REP_HS,
			.iov_len  = sizeof(ZMTP_V3_REP_HS)
		},
		.iov_num  = 1,
	};
	rc = zmtp->io_proto.submit(wr_req, TO_HEAD);
	if (rc) {
		io_req_put(wr_req);
		len = rc;
		goto out;
	}

out:
	io_req_put(req);
	if (len < 0)
		zmtp->inner_state = ZMTP_REP_CLOSED;

	return len;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebp
movq %rdi, %r14
movq 0x18(%rdi), %rbx
testl %esi, %esi
js 0x2915
xorl %r15d, %r15d
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x20d0
testl %eax, %eax
js 0x291a
je 0x292c
movl $0xffffffea, %r15d      # imm = 0xFFFFFFEA
cmpq $0x3, 0x148(%r14)
jne 0x291d
cmpq $0x19, 0x50(%r14)
jb 0x291d
movq 0x48(%r14), %rax
movdqu (%rax), %xmm0
movdqu 0x9(%rax), %xmm1
movdqu 0x5978(%rip), %xmm2     # 0x81d9
pcmpeqb 0x5967(%rip), %xmm0     # 0x81d0
pcmpeqb %xmm1, %xmm2
pand %xmm2, %xmm0
pmovmskb %xmm0, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
jne 0x291d
movq (%rbx), %rdi
leaq 0xc3(%rip), %rcx        # 0x294d
movl $0x1, %esi
movq %rbx, %rdx
callq 0x3be7
testq %rax, %rax
je 0x2938
movq %rax, %r12
leaq 0x5906(%rip), %rax      # 0x81b0
movq %rax, 0x28(%r12)
movq $0x1b, 0x30(%r12)
movq %r12, %rdi
addq $0x38, %rdi
movl $0x110, %edx            # imm = 0x110
xorl %esi, %esi
callq 0x10e0
movq $0x1, 0x148(%r12)
pxor %xmm0, %xmm0
movdqu %xmm0, 0x150(%r12)
movdqu %xmm0, 0x160(%r12)
movq %r12, %rdi
xorl %esi, %esi
callq *0x8(%rbx)
testl %eax, %eax
je 0x2940
movl %eax, %r15d
movq %r12, %rdi
callq 0x3c7a
movq %r14, %rdi
callq 0x3c7a
testl %r15d, %r15d
jns 0x292c
jmp 0x2925
movl %ebp, %r15d
jmp 0x291d
movl %eax, %r15d
movq %r14, %rdi
callq 0x3c7a
movl $0x2, 0x28(%rbx)
movl %r15d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0xfffffff4, %r15d      # imm = 0xFFFFFFF4
jmp 0x291d
movq %r14, %rdi
callq 0x3c7a
movl %ebp, %r15d
jmp 0x292c
// File: /workspace/github_c_makefile_star2_O3/rouming[P]io/zmtp.c
// Function: on_greet_v3_3_hshake_send__REP
static int on_greet_v3_3_hshake_send__REP(struct io_req *req, int len)
{
	struct zmtp *zmtp = req->data;

	/*
	 * Our hshake is sent, ready for incoming data.
	 */
	io_req_put(req);

	if (len < 0)
		zmtp->inner_state = ZMTP_REP_CLOSED;

	return len;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq 0x18(%rdi), %r14
callq 0x3c7a
testl %ebx, %ebx
jns 0x2968
movl $0x2, 0x28(%r14)
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O3/rouming[P]io/io.c
// Function: buf_it_len
static int buf_it_len(struct io_buf *buf, struct iovec_iter *beg,
		      struct iovec_iter *end)
{
	size_t sz, nb;

	sz = 0;
	while (buf_it_cmp(beg, end) < 0) {
		nb = buf_it_iovlen(buf, beg, end);
		buf_it_advance(buf, beg, nb);
		sz += nb;
	}

	return sz;
}

// Assembly:
pushq %rbx
leaq 0x8(%rdx), %rcx
movq (%rsi), %r8
xorl %eax, %eax
movq (%rdx), %r10
cmpq %r10, %r8
jae 0x29e5
movq 0x8(%rsi), %r9
jmp 0x29f0
ja 0x2a36
movq 0x8(%rsi), %r9
cmpq (%rcx), %r9
jae 0x2a36
movq %r8, %r11
shlq $0x4, %r11
cmpq %r10, %r8
leaq 0x8(%rdi,%r11), %r10
cmoveq %rcx, %r10
movq (%r10), %r10
movq %r10, 0x8(%rsi)
movq 0x120(%rdi), %rbx
decq %rbx
cmpq %r8, %rbx
je 0x2a2e
cmpq %r10, 0x8(%rdi,%r11)
jne 0x2a2e
movq $0x0, 0x8(%rsi)
incq %r8
movq %r8, (%rsi)
subq %r9, %r10
addq %r10, %rax
jmp 0x29d7
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/rouming[P]io/io.c
// Function: buf_check
static int buf_check(struct io_buf *buf)
{
	int i;
	struct iovec *iov;

	if (buf->iov_num == 0)
		return -EINVAL;
	if (buf->iov_num >= ARRAY_SIZE(buf->iov))
		return -EINVAL;
	for (i = 0; i < buf->iov_num - 1; i++) {
		/* Only last vari length element can be zero */
		if (!buf->iov[i].iov_len)
			return -EINVAL;
	}
	iov = &buf->iov[buf->iov_num - 1];
	/* Last, not vari length iov must be with valid length */
	if (!buf_vari_len(buf) && !iov->iov_len)
		return -EINVAL;
	/* Last, vari length iov must be fully zeroed or fully alloc'ed */
	if (buf_vari_len(buf) && (!!iov->iov_len ^ !!iov->iov_base))
		return -EINVAL;
	if (buf->pos.iov_ind > buf->iov_num)
		return -EINVAL;
	iov = &buf->iov[buf->pos.iov_ind];
	if (iov->iov_base == NULL && buf->pos.iov_off)
		return -EINVAL;
	if (iov->iov_len && buf->pos.iov_off > iov->iov_len) {
		assert(0);
		return -EINVAL;
	}

	return 0;
}

// Assembly:
pushq %rax
movq 0x120(%rdi), %rcx
leaq -0x10(%rcx), %rdx
movl $0xffffffea, %eax       # imm = 0xFFFFFFEA
cmpq $-0xf, %rdx
jae 0x2ea5
popq %rcx
retq
movq %rcx, %rdx
decq %rdx
je 0x2ec3
leaq 0x8(%rdi), %rsi
movq %rdx, %r8
cmpq $0x0, (%rsi)
je 0x2ea3
addq $0x10, %rsi
decq %r8
jne 0x2eb4
shlq $0x4, %rdx
movq 0x8(%rdi,%rdx), %rsi
cmpb $0x0, 0x128(%rdi)
je 0x2eed
addq %rdi, %rdx
testq %rsi, %rsi
setne %sil
cmpq $0x0, (%rdx)
setne %dl
xorb %sil, %dl
jne 0x2ea3
jmp 0x2ef2
testq %rsi, %rsi
je 0x2ea3
movq 0x100(%rdi), %rdx
cmpq %rcx, %rdx
ja 0x2ea3
shlq $0x4, %rdx
cmpq $0x0, (%rdi,%rdx)
je 0x2f3f
addq %rdi, %rdx
movq 0x8(%rdx), %rcx
xorl %eax, %eax
testq %rcx, %rcx
je 0x2ea3
cmpq %rcx, 0x108(%rdi)
jbe 0x2ea3
leaq 0x2704(%rip), %rdi      # 0x562b
leaq 0x2544(%rip), %rsi      # 0x5472
leaq 0x266c(%rip), %rcx      # 0x55a1
movl $0x114, %edx            # imm = 0x114
callq 0x10d0
cmpq $0x0, 0x108(%rdi)
jne 0x2ea3
jmp 0x2f09
// File: /workspace/github_c_makefile_star2_O3/rouming[P]io/io.c
// Function: io_queue_deinit
void io_queue_deinit(struct io_queue *q)
{
	stash_free(q);
	assert(q->poller == NULL);
	assert(list_empty(&q->queue));
	assert(q->reqs_num[REQ_RD] == 0);
	assert(q->reqs_num[REQ_WR] == 0);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x158(%rdi), %rdi
callq 0x1040
xorps %xmm0, %xmm0
movups %xmm0, 0x158(%rbx)
movq $0x0, 0x168(%rbx)
cmpq $0x0, (%rbx)
jne 0x2fc5
leaq 0x138(%rbx), %rax
cmpq %rax, 0x138(%rbx)
jne 0x2fe4
cmpl $0x0, 0x148(%rbx)
jne 0x3003
cmpl $0x0, 0x14c(%rbx)
jne 0x3022
popq %rbx
retq
leaq 0x2494(%rip), %rdi      # 0x5460
leaq 0x249f(%rip), %rsi      # 0x5472
leaq 0x249d(%rip), %rcx      # 0x5477
movl $0x313, %edx            # imm = 0x313
callq 0x10d0
leaq 0x24b4(%rip), %rdi      # 0x549f
leaq 0x2480(%rip), %rsi      # 0x5472
leaq 0x247e(%rip), %rcx      # 0x5477
movl $0x314, %edx            # imm = 0x314
callq 0x10d0
leaq 0x24ab(%rip), %rdi      # 0x54b5
leaq 0x2461(%rip), %rsi      # 0x5472
leaq 0x245f(%rip), %rcx      # 0x5477
movl $0x315, %edx            # imm = 0x315
callq 0x10d0
leaq 0x24a5(%rip), %rdi      # 0x54ce
leaq 0x2442(%rip), %rsi      # 0x5472
leaq 0x2440(%rip), %rcx      # 0x5477
movl $0x316, %edx            # imm = 0x316
callq 0x10d0
// File: /workspace/github_c_makefile_star2_O3/rouming[P]io/io.c
// Function: io_queue_bind
int io_queue_bind(struct io_queue *q, void *poller, int fd)
{
	int err, flags;

	if (q->poller)
		return -EINVAL;
	q->refs = 1;
	q->poller = poller;
	q->item = (struct poller_item){
		.fd     = fd,
		.events = 0,
		.data   = NULL,
		.action = on_io,
	};

	flags = fcntl(fd, F_GETFL, 0);
	if  (flags < 0)
		return -errno;
	err = fcntl(fd, F_SETFL, flags | O_NONBLOCK);
	if (err < 0)
		return -errno;

	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl $0xffffffea, %ebx       # imm = 0xFFFFFFEA
cmpq $0x0, (%rdi)
jne 0x30bb
movl %edx, %ebp
movq %rdi, %r14
movl $0x1, 0x174(%rdi)
movq %rsi, (%rdi)
movl %edx, 0x8(%rdi)
addq $0xc, %rdi
xorl %ebx, %ebx
movl $0x124, %edx            # imm = 0x124
xorl %esi, %esi
callq 0x10e0
leaq 0x44(%rip), %rax        # 0x30c2
movq %rax, 0x130(%r14)
movl %ebp, %edi
movl $0x3, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x1090
testl %eax, %eax
js 0x30b2
orl $0x800, %eax            # imm = 0x800
movl %ebp, %edi
movl $0x4, %esi
movl %eax, %edx
xorl %eax, %eax
callq 0x1090
testl %eax, %eax
jns 0x30bb
callq 0x1050
xorl %ebx, %ebx
subl (%rax), %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/rouming[P]io/io.c
// Function: io_queue_unbind
int io_queue_unbind(struct io_queue *q)
{
	int err;

	if (q->poller == NULL)
		return -EINVAL;
	if (q->refs == 0)
		return -EINVAL;
	if (q->refs > 1)
		return -EBUSY;

	err = __io_queue_cancel(q, -EIO);
	q->poller = NULL;
	q->refs = 0;

	return err;
}

// Assembly:
pushq %rbx
movl $0xffffffea, %eax       # imm = 0xFFFFFFEA
cmpq $0x0, (%rdi)
je 0x3872
movq %rdi, %rbx
movl 0x174(%rdi), %ecx
testl %ecx, %ecx
je 0x3872
movl $0xfffffff0, %eax       # imm = 0xFFFFFFF0
cmpl $0x1, %ecx
jg 0x3872
movq %rbx, %rdi
movl $0xfffffffb, %esi       # imm = 0xFFFFFFFB
callq 0x3874
movq $0x0, (%rbx)
movl $0x0, 0x174(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/rouming[P]io/io.c
// Function: _io_queue_submit
static int __io_queue_submit(struct io_req *req, bool tail)
{
	struct io_queue *q = req->q;
	int rc, wr;

	if (q->poller == NULL)
		return -EINVAL;
	rc = req_check(req);
	if (rc)
		return -EINVAL;

	if (!q->in_proto && q->proto && q->proto->on_submit) {
		/* Forward request to proto if any */
		rc = q->proto->on_submit(q->proto, req);
		if (rc)
			return rc;
	}
	wr = req->flags & REQ_RDWR_MASK;
	/*
	 * Firstly add request to the list (either to the head or to the tail)
	 * to simplify __poller_update() and _poller_set_prewait() logic, which
	 * simply picks up first request from the queue and updates poller events
	 * accordingly.
	 */
	if (tail)
		list_add_tail(&req->list, &q->queue);
	else
		list_add(&req->list, &q->queue);

	if (q->refs == 1) {
		if (!wr && is_stashed(q))
			/*
			 * We do submission outside the IO loop, but read can
			 * be completed right now from a stash, thus set prewait
			 * for an event to be called just before poller wait and
			 * then return to on_io.
			 */
			rc = __poller_set_prewait(q->poller, &q->item);

		if (rc == 0)
			rc = __poller_update(q);
	}
	if (rc)
		/* Rollback in case of error */
		list_del_init(&req->list);
	else
		/* Success, account added request */
		q->reqs_num[wr]++;

	return rc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x10(%rdi), %r14
movl $0xffffffea, %r15d      # imm = 0xFFFFFFEA
cmpq $0x0, (%r14)
je 0x3a78
movl %esi, %ebp
movq %rdi, %rbx
addq $0x28, %rdi
callq 0x2e8c
testl %eax, %eax
jne 0x3a78
movl 0x20(%rbx), %r12d
testb $0x1, %r12b
je 0x397f
cmpb $0x0, 0x150(%rbx)
jne 0x3a78
cmpb $0x0, 0x170(%r14)
jne 0x39b2
movq 0x150(%r14), %rdi
testq %rdi, %rdi
je 0x39b2
movq 0x10(%rdi), %rax
testq %rax, %rax
je 0x39b2
movq %rbx, %rsi
callq *%rax
movl %eax, %r15d
testl %eax, %eax
jne 0x3a78
movl 0x20(%rbx), %r12d
leaq 0x138(%r14), %rax
testb %bpl, %bpl
je 0x39d1
leaq 0x140(%r14), %rcx
movq %rax, %rdx
movq 0x140(%r14), %rax
jmp 0x39d8
movq (%rax), %rdx
leaq 0x8(%rdx), %rcx
andl $0x1, %r12d
movq %rbx, (%rcx)
movq %rdx, (%rbx)
movq %rbx, (%rax)
movq %rax, 0x8(%rbx)
cmpl $0x1, 0x174(%r14)
jne 0x3a6a
testl %r12d, %r12d
jne 0x3a44
cmpq $0x0, 0x160(%r14)
je 0x3a44
movq 0x138(%r14), %rax
leaq 0x138(%r14), %rcx
cmpq %rcx, %rax
sete %cl
testq %rax, %rax
sete %dl
orb %cl, %dl
jne 0x3a44
testb $0x1, 0x20(%rax)
jne 0x3a44
movq (%r14), %rdi
leaq 0x8(%r14), %rsi
leaq 0x68a(%rip), %rax       # 0x40be
movq %rax, 0x128(%r14)
callq 0x423d
testl %eax, %eax
jne 0x3a50
movq %r14, %rdi
callq 0x3d46
testl %eax, %eax
je 0x3a6a
movl %eax, %r15d
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
movq %rcx, 0x8(%rax)
movq %rax, (%rcx)
movq %rbx, (%rbx)
movq %rbx, 0x8(%rbx)
jmp 0x3a78
movl %r12d, %eax
incl 0x148(%r14,%rax,4)
xorl %r15d, %r15d
movl %r15d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/rouming[P]io/io.c
// Function: io_queue_set_proto
int io_queue_set_proto(struct io_queue *q, struct io_proto *proto)
{
	if (proto) {
		if (q->proto)
			return -EINVAL;
		proto->q = q;
		proto->submit = __io_queue_submit_from_proto;
		q->proto = proto;
	} else {
		if (q->proto == NULL)
			return -EINVAL;
		q->proto->q = NULL;
		q->proto->submit = NULL;
		q->proto = NULL;
	}

	return 0;
}

// Assembly:
movq 0x150(%rdi), %rcx
testq %rsi, %rsi
je 0x3ab1
movl $0xffffffea, %eax       # imm = 0xFFFFFFEA
testq %rcx, %rcx
je 0x3ac0
retq
testq %rcx, %rcx
je 0x3ad8
xorps %xmm0, %xmm0
movups %xmm0, (%rcx)
xorl %esi, %esi
jmp 0x3ace
movq %rdi, (%rsi)
leaq 0x14(%rip), %rax        # 0x3ade
movq %rax, 0x8(%rsi)
movq %rsi, 0x150(%rdi)
xorl %eax, %eax
retq
movl $0xffffffea, %eax       # imm = 0xFFFFFFEA
retq
// File: /workspace/github_c_makefile_star2_O3/rouming[P]io/io.c
// Function: io_req_put
bool io_req_put(struct io_req *req)
{
	int refs;

	assert(req->refs > 0);
	refs = --req->refs;
	if (!refs) {
		__io_req_deinit(req);
		free(req);
	}

	return !refs;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl 0x24(%rdi), %ebp
testl %ebp, %ebp
jle 0x3caa
movq %rdi, %rbx
decl %ebp
movl %ebp, 0x24(%rdi)
jne 0x3c9e
movq %rbx, %rdi
callq 0x3b69
movq %rbx, %rdi
callq 0x1040
testl %ebp, %ebp
sete %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x18a0(%rip), %rdi      # 0x5551
leaq 0x17ba(%rip), %rsi      # 0x5472
leaq 0x18c1(%rip), %rcx      # 0x5580
movl $0x3f3, %edx            # imm = 0x3F3
callq 0x10d0
// File: /workspace/github_c_makefile_star2_O3/rouming[P]io/io.c
// Function: buf_it_realloc
static int buf_it_realloc(struct io_buf *buf, struct iovec_iter *it, size_t sz)
{
	struct iovec *iov;
	void *tmp;

	/*
	 * Here we come because of two reasons:
	 *   1. !iov_len, !iov_base,  is_vari_len
	 *   2.  iov_len, !iov_base, !is_vari_len
	 *
	 * For 1 we reallocate the iov_len + sz.
	 * For 2 we allocate what is set in iov_len.
	 */

	iov = buf_it_iov(buf, it);
	if (buf_it_vari_len_tail(buf, it))
		sz += iov->iov_len;
	else
		sz  = iov->iov_len;

	tmp = realloc(iov->iov_base, sz);
	if (tmp == NULL)
		return -ENOMEM;
	iov->iov_base = tmp;
	buf->iov_free[it->iov_ind] = true;
	iov->iov_len = sz;

	return sz;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %r14
movq (%rsi), %rax
movq %rax, %r12
shlq $0x4, %r12
addq %rdi, %r12
cmpb $0x1, 0x128(%rdi)
jne 0x3d06
movq 0x120(%r14), %rcx
decq %rcx
cmpq %rax, %rcx
jne 0x3d06
movq %rdx, %rbx
addq 0x8(%r12), %rbx
jmp 0x3d0b
movq 0x8(%r12), %rbx
movq (%r12), %rdi
movq %rbx, %rsi
callq 0x11b0
testq %rax, %rax
je 0x3d33
movq %rax, (%r12)
movq (%r15), %rax
movb $0x1, 0x110(%r14,%rax)
movq %rbx, 0x8(%r12)
jmp 0x3d38
movl $0xfffffff4, %ebx       # imm = 0xFFFFFFF4
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/rouming[P]io/io.c
// Function: buf_advance
static size_t buf_advance(struct io_buf *buf, struct iovec_iter *it,
			  size_t sz)
{
	size_t nb;
	struct iovec_iter end = END_IT(buf);

	while (buf_it_cmp(it, &end) < 0 && sz) {
		nb = min(sz, buf_it_iovlen(buf, it, &end));
		buf_it_advance(buf, it, nb);
		sz -= nb;
	}

	return sz;
}

// Assembly:
pushq %rbx
movq 0x120(%rdi), %rax
cmpb $0x0, 0x128(%rdi)
je 0x3d9d
xorl %ecx, %ecx
movq %rax, %r8
jmp 0x3dad
leaq -0x1(%rax), %r8
movq %r8, %rcx
shlq $0x4, %rcx
movq 0x8(%rdi,%rcx), %rcx
movq (%rsi), %r9
decq %rax
cmpq %r8, %r9
jae 0x3dc7
testq %rdx, %rdx
je 0x3e5c
movq 0x8(%rsi), %r10
jmp 0x3ddf
ja 0x3e5c
movq 0x8(%rsi), %r10
cmpq %rcx, %r10
jae 0x3e5c
testq %rdx, %rdx
je 0x3e5c
movq %rcx, %rbx
cmpq %r8, %r9
je 0x3df3
movq %r9, %r11
shlq $0x4, %r11
movq 0x8(%rdi,%r11), %rbx
subq %r10, %rbx
movq %rdx, %r11
cmpq %rbx, %rdx
jb 0x3e27
cmpq %r8, %r9
jb 0x3e10
ja 0x3e57
movl $0x0, %r11d
cmpq %rcx, %r10
jae 0x3e27
movq %rcx, %r11
cmpq %r8, %r9
je 0x3e24
movq %r9, %r11
shlq $0x4, %r11
movq 0x8(%rdi,%r11), %r11
subq %r10, %r11
addq %r11, %r10
movq %r10, 0x8(%rsi)
cmpq %r9, %rax
je 0x3e4f
movq %r9, %rbx
shlq $0x4, %rbx
cmpq %r10, 0x8(%rdi,%rbx)
jne 0x3e4f
movq $0x0, 0x8(%rsi)
incq %r9
movq %r9, (%rsi)
subq %r11, %rdx
jmp 0x3db3
xorl %r11d, %r11d
jmp 0x3e27
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/rouming[P]io/io.c
// Function: _poller_set
static int __poller_set(void *poller, struct poller_item *item, int new_events)
{
	int rc = 0, old_events = item->events;

	if (new_events ^ old_events) {
		item->events = new_events;
		if (old_events && new_events)
			rc = __poller_ctl(poller, P_CTL_MOD, item);
		else if (!old_events && new_events)
			rc = __poller_ctl(poller, P_CTL_ADD, item);
		else
			rc = __poller_ctl(poller, P_CTL_DEL, item);
	}

	return rc;
}

// Assembly:
movl 0x4(%rsi), %ecx
cmpl %edx, %ecx
je 0x40bb
movq %rsi, %rax
movl %edx, 0x4(%rsi)
testl %ecx, %ecx
sete %sil
testl %edx, %edx
sete %r8b
orb %sil, %r8b
jne 0x4096
movl $0x1, %esi
jmp 0x40ad
xorl %r8d, %r8d
testl %ecx, %ecx
setne %r8b
addl %r8d, %r8d
testl %edx, %edx
movl $0x2, %esi
cmovnel %r8d, %esi
cmpq $-0x1, %rdi
je 0x40bb
movq %rax, %rdx
jmp 0x4173
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/rouming[P]io/poller.c
// Function: poller_create
int poller_create(void **p)
{
	int rc;
	struct poller *poller;

	poller = malloc(sizeof(*poller));
	if (poller == NULL)
		return -ENOMEM;
	INIT_LIST_HEAD(&poller->prew_list);
	poller->epollfd = epoll_create1(0);
	if (poller->epollfd < 0) {
		rc = -errno;
		free(poller);

		return rc;
	}
	*p = poller;

	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
movl $0x18, %edi
callq 0x1180
testq %rax, %rax
je 0x4111
movq %rax, %rbx
addq $0x8, %rax
movq %rax, 0x8(%rbx)
movq %rax, 0x10(%rbx)
xorl %ebp, %ebp
xorl %edi, %edi
callq 0x11e0
movl %eax, (%rbx)
testl %eax, %eax
js 0x4118
movq %rbx, (%r14)
jmp 0x4129
movl $0xfffffff4, %ebp       # imm = 0xFFFFFFF4
jmp 0x4129
callq 0x1050
xorl %ebp, %ebp
subl (%rax), %ebp
movq %rbx, %rdi
callq 0x1040
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/rouming[P]io/poller.c
// Function: poller_destroy
void poller_destroy(void *p)
{
	struct poller *poller = p;

	if (poller) {
		del_prewaits(poller);
		close(poller->epollfd);
		free(poller);
	}
}

// Assembly:
testq %rdi, %rdi
je 0x4172
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x8(%rdi), %r14
movq 0x8(%rdi), %rdi
cmpq %r14, %rdi
je 0x415e
movq (%rdi), %r15
addq $-0x10, %rdi
callq 0x444c
movq %r15, %rdi
cmpq %r14, %r15
jne 0x414a
movl (%rbx), %edi
callq 0x1100
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x1040
retq