// File: /workspace/github_c_makefile_star2_O0/negge[P]xlink/src/xlink.c
// Function: xlink_bitstream_from_segments
void xlink_bitstream_from_segments(xlink_bitstream *bs, xlink_ec_segment *code,
 xlink_ec_segment *data, int capacity, int fast, int clamp) {
  xlink_encoder enc;
  xlink_decoder dec;
  xlink_context ctx;
  int i;
  xlink_bitstream_init(bs);
  /* Create a context from code models */
  xlink_context_init(&ctx, &code->models, capacity, fast, clamp);
  /* Create an encoder from the context */
  xlink_encoder_init(&enc, &ctx);
  /* Encode the code bytes */
  xlink_encoder_write_bytes(&enc, &code->bytes);
  /* If the data segment has any bytes */
  if (xlink_list_length(&data->bytes) > 0) {
    /* Reset the context with the data models */
    ctx.models = &data->models;
    xlink_set_reset(&ctx.matches);
    /* Encode the code bytes */
    xlink_encoder_write_bytes(&enc, &data->bytes);
  }
  /* Finalize the bitstream */
  xlink_encoder_finalize(&enc, bs);
  xlink_encoder_clear(&enc);
  xlink_context_clear(&ctx);
  /* Create a context from code models */
  xlink_context_init(&ctx, &code->models, capacity, fast, clamp);
  /* Initialize the decoder with the context and bitstream */
  xlink_decoder_init(&dec, &ctx, bs);
  /* Test that decoded code bytes match original input */
  xlink_decoder_test_bytes(&dec, &code->bytes);
  /* If the data segment has any bytes */
  if (xlink_list_length(&data->bytes) > 0) {
    /* Reset the context with the data models */
    ctx.models = &data->models;
    xlink_set_reset(&ctx.matches);
    /* Test that decoded data bytes match original input */
    xlink_decoder_test_bytes(&dec, &data->bytes);
  }
  xlink_decoder_clear(&dec);
  xlink_context_clear(&ctx);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
movl %r9d, -0x24(%rbp)
movq -0x8(%rbp), %rdi
callq 0xa180
movq -0x10(%rbp), %rsi
addq $0x18, %rsi
movl -0x1c(%rbp), %edx
movl -0x20(%rbp), %ecx
movl -0x24(%rbp), %r8d
leaq -0xf8(%rbp), %rdi
callq 0xb850
leaq -0x60(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0xa2d0
movq -0x10(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0xa4c0
movq -0x18(%rbp), %rdi
callq 0xc6a0
cmpl $0x0, %eax
jle 0x8250
movq -0x18(%rbp), %rax
addq $0x18, %rax
movq %rax, -0xf0(%rbp)
leaq -0xf8(%rbp), %rdi
addq $0x10, %rdi
callq 0xce80
movq -0x18(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0xa4c0
movq -0x8(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0xa630
leaq -0x60(%rbp), %rdi
callq 0xa4a0
leaq -0xf8(%rbp), %rdi
callq 0xb970
movq -0x10(%rbp), %rsi
addq $0x18, %rsi
movl -0x1c(%rbp), %edx
movl -0x20(%rbp), %ecx
movl -0x24(%rbp), %r8d
leaq -0xf8(%rbp), %rdi
callq 0xb850
movq -0x8(%rbp), %rdx
leaq -0x88(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0xaa70
movq -0x10(%rbp), %rsi
leaq -0x88(%rbp), %rdi
callq 0x8080
movq -0x18(%rbp), %rdi
callq 0xc6a0
cmpl $0x0, %eax
jle 0x82f4
movq -0x18(%rbp), %rax
addq $0x18, %rax
movq %rax, -0xf0(%rbp)
leaq -0xf8(%rbp), %rdi
addq $0x10, %rdi
callq 0xce80
movq -0x18(%rbp), %rsi
leaq -0x88(%rbp), %rdi
callq 0x8080
leaq -0x88(%rbp), %rdi
callq 0xacb0
leaq -0xf8(%rbp), %rdi
callq 0xb970
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
nopw %cs:(%rax,%rax)