// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/zlib-1.3.0.1/gzwrite.c
// Function: gzputc
int ZEXPORT gzputc(gzFile file, int c) {
    unsigned have;
    unsigned char buf[1];
    gz_statep state;
    z_streamp strm;

    /* get internal structure */
    if (file == NULL)
        return -1;
    state = (gz_statep)file;
    strm = &(state->strm);

    /* check that we're writing and that there's no error */
    if (state->mode != GZ_WRITE || state->err != Z_OK)
        return -1;

    /* check for seek request */
    if (state->seek) {
        state->seek = 0;
        if (gz_zero(state, state->skip) == -1)
            return -1;
    }

    /* try writing to input buffer for speed (state->size == 0 if buffer not
       initialized) */
    if (state->size) {
        if (strm->avail_in == 0)
            strm->next_in = state->in;
        have = (unsigned)((strm->next_in + strm->avail_in) - state->in);
        if (have < state->size) {
            state->in[have] = (unsigned char)c;
            strm->avail_in++;
            state->x.pos++;
            return c & 0xff;
        }
    }

    /* no room in buffer or not initialized, use gz_write() */
    buf[0] = (unsigned char)c;
    if (gz_write(state, buf, 1) != 1)
        return -1;
    return c & 0xff;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movl %esi, 0x24(%rsp)
cmpq $0x0, 0x28(%rsp)
jne 0xcefb2
movl $0xffffffff, 0x34(%rsp) # imm = 0xFFFFFFFF
jmp 0xcf10b
movq 0x28(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
addq $0x80, %rax
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rax
cmpl $0x79b1, 0x18(%rax)     # imm = 0x79B1
jne 0xcefe5
movq 0x10(%rsp), %rax
cmpl $0x0, 0x74(%rax)
je 0xceff2
movl $0xffffffff, 0x34(%rsp) # imm = 0xFFFFFFFF
jmp 0xcf10b
movq 0x10(%rsp), %rax
cmpl $0x0, 0x70(%rax)
je 0xcf030
movq 0x10(%rsp), %rax
movl $0x0, 0x70(%rax)
movq 0x10(%rsp), %rdi
movq 0x10(%rsp), %rax
movq 0x68(%rax), %rsi
callq 0xcf120
cmpl $-0x1, %eax
jne 0xcf02e
movl $0xffffffff, 0x34(%rsp) # imm = 0xFFFFFFFF
jmp 0xcf10b
jmp 0xcf030
movq 0x10(%rsp), %rax
cmpl $0x0, 0x28(%rax)
je 0xcf0d2
movq 0x8(%rsp), %rax
cmpl $0x0, 0x8(%rax)
jne 0xcf05b
movq 0x10(%rsp), %rax
movq 0x30(%rax), %rcx
movq 0x8(%rsp), %rax
movq %rcx, (%rax)
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rsp), %rcx
movl 0x8(%rcx), %ecx
addq %rcx, %rax
movq 0x10(%rsp), %rcx
movq 0x30(%rcx), %rcx
subq %rcx, %rax
movl %eax, 0x20(%rsp)
movl 0x20(%rsp), %eax
movq 0x10(%rsp), %rcx
cmpl 0x28(%rcx), %eax
jae 0xcf0d0
movl 0x24(%rsp), %eax
movb %al, %dl
movq 0x10(%rsp), %rax
movq 0x30(%rax), %rax
movl 0x20(%rsp), %ecx
movb %dl, (%rax,%rcx)
movq 0x8(%rsp), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x10(%rax)
movl 0x24(%rsp), %eax
andl $0xff, %eax
movl %eax, 0x34(%rsp)
jmp 0xcf10b
jmp 0xcf0d2
movl 0x24(%rsp), %eax
movb %al, 0x1f(%rsp)
movq 0x10(%rsp), %rdi
leaq 0x1f(%rsp), %rsi
movl $0x1, %edx
callq 0xcebf0
cmpq $0x1, %rax
je 0xcf0fe
movl $0xffffffff, 0x34(%rsp) # imm = 0xFFFFFFFF
jmp 0xcf10b
movl 0x24(%rsp), %eax
andl $0xff, %eax
movl %eax, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)