// File: /workspace/github_c_makefile_star2_O0/Nico01[P]obj2asm/oubuff.c
// Function: empty_string
void empty_string( length )
    int     length;
{
    int     prev_mode;
    int     curr_mode;
    int     out_count;
    char    out_buff[OPSIZE+1];
    int     this_char;
    char    byte_buff[5];
    int     byte_len;
    char    *pre_text;
    int     pre_len;

    prev_mode = NOTHING;
    out_count = 0;
    out_buff[0] = '\0';
    buff_reseek();
    while ( length ) {
        this_char = buff_regetc();
        if ( this_char < ' ' || this_char > '~' ) {
            curr_mode = SPECIAL;
            sprintf( byte_buff, "0%02Xh", this_char );
            byte_len = 4;
        } else {
            curr_mode = ASCII;
            if ( this_char == '\'' ) {
                strcpy( byte_buff, "''" );  /* Two apostrophes to indicate one */
                byte_len = 2;
            } else {
                sprintf( byte_buff, "%c", this_char );
                byte_len = 1;
            }
        }
        pre_text = "";                  /* Default to no separator */
        pre_len = 0;
        if ( prev_mode == ASCII && curr_mode == SPECIAL ) {
            pre_text = "',";            /* Separator between ascii and hex */
            pre_len = 2;
        }
        if ( prev_mode == SPECIAL && curr_mode == ASCII ) {
            pre_text = ",'";            /* Separator between hex and ascii */
            pre_len = 2;
        }
        if ( prev_mode == SPECIAL && curr_mode == SPECIAL ) {
            pre_text = ",";             /* Separator between hex codes */
            pre_len = 1;
        }
        if ( out_count + pre_len + byte_len >= OPSIZE ) {
            /*
            ** Output current line and proceed to next line
            */
            if ( prev_mode == ASCII ) {
                strcat( out_buff, "'" );
            }
            if ( pass == 3 ) {
                out_directive( "db" );
                out_operand( out_buff );
                out_endline();
            }
            out_count = 0;
            out_buff[0] = '\0';
            prev_mode = NOTHING;
            pre_text = "";              /* Back to no seperator */
            pre_len = 0;
        }
        if ( prev_mode == NOTHING && curr_mode == ASCII ) {
            pre_text = "'";
            pre_len = 1;
        }
        strcat( out_buff, pre_text );
        strcat( out_buff, byte_buff );
        out_count += pre_len + byte_len;
        prev_mode = curr_mode;
        if ( this_char == '\0' || this_char == '$' ) {
            /*
            ** Output current line (with this_char) and proceed to next line
            */
            if ( prev_mode == ASCII ) {
                strcat( out_buff, "'" );
            }
            if ( pass == 3 ) {
                out_directive( "db" );
                out_operand( out_buff );
                out_endline();
            }
            out_count = 0;
            out_buff[0] = '\0';
            prev_mode = NOTHING;
            pre_text = "";              /* Back to no seperator */
            pre_len = 0;
        }
        --length;
    }
    if ( prev_mode != NOTHING ) {
        if ( prev_mode == ASCII ) {
            strcat( out_buff, "'" );
        }
        if ( pass == 3 ) {
            out_directive( "db" );
            out_operand( out_buff );
            out_endline();
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movl %edi, -0x4(%rbp)
movl $0x0, -0x8(%rbp)
movl $0x0, -0x10(%rbp)
movb $0x0, -0x50(%rbp)
callq 0x118f0
cmpl $0x0, -0x4(%rbp)
je 0x11897
callq 0x11910
movl %eax, -0x54(%rbp)
cmpl $0x20, -0x54(%rbp)
jl 0x11690
cmpl $0x7e, -0x54(%rbp)
jle 0x116b5
movl $0x2, -0xc(%rbp)
leaq -0x59(%rbp), %rdi
movl -0x54(%rbp), %edx
leaq 0x69da(%rip), %rsi      # 0x1807f
movb $0x0, %al
callq 0x9190
movl $0x4, -0x60(%rbp)
jmp 0x116f9
movl $0x1, -0xc(%rbp)
cmpl $0x27, -0x54(%rbp)
jne 0x116db
leaq -0x59(%rbp), %rdi
leaq 0x69b9(%rip), %rsi      # 0x18086
callq 0x9060
movl $0x2, -0x60(%rbp)
jmp 0x116f7
leaq -0x59(%rbp), %rdi
movl -0x54(%rbp), %edx
leaq 0x69a0(%rip), %rsi      # 0x18089
movb $0x0, %al
callq 0x9190
movl $0x1, -0x60(%rbp)
jmp 0x116f9
leaq 0x6ac0(%rip), %rax      # 0x181c0
movq %rax, -0x68(%rbp)
movl $0x0, -0x6c(%rbp)
cmpl $0x1, -0x8(%rbp)
jne 0x11729
cmpl $0x2, -0xc(%rbp)
jne 0x11729
leaq 0x696e(%rip), %rax      # 0x1808c
movq %rax, -0x68(%rbp)
movl $0x2, -0x6c(%rbp)
cmpl $0x2, -0x8(%rbp)
jne 0x11747
cmpl $0x1, -0xc(%rbp)
jne 0x11747
leaq 0x6953(%rip), %rax      # 0x1808f
movq %rax, -0x68(%rbp)
movl $0x2, -0x6c(%rbp)
cmpl $0x2, -0x8(%rbp)
jne 0x11765
cmpl $0x2, -0xc(%rbp)
jne 0x11765
leaq 0x6933(%rip), %rax      # 0x1808d
movq %rax, -0x68(%rbp)
movl $0x1, -0x6c(%rbp)
movl -0x10(%rbp), %eax
addl -0x6c(%rbp), %eax
addl -0x60(%rbp), %eax
cmpl $0x3c, %eax
jl 0x117d3
cmpl $0x1, -0x8(%rbp)
jne 0x11789
leaq -0x50(%rbp), %rdi
leaq 0x6903(%rip), %rsi      # 0x18087
callq 0x9180
leaq 0xe9a8(%rip), %rax      # 0x20138
cmpl $0x3, (%rax)
jne 0x117af
leaq 0x68f6(%rip), %rdi      # 0x18092
callq 0xe290
leaq -0x50(%rbp), %rdi
callq 0xe190
callq 0xe240
movl $0x0, -0x10(%rbp)
movb $0x0, -0x50(%rbp)
movl $0x0, -0x8(%rbp)
leaq 0x69f8(%rip), %rax      # 0x181c0
movq %rax, -0x68(%rbp)
movl $0x0, -0x6c(%rbp)
cmpl $0x0, -0x8(%rbp)
jne 0x117f1
cmpl $0x1, -0xc(%rbp)
jne 0x117f1
leaq 0x68a1(%rip), %rax      # 0x18087
movq %rax, -0x68(%rbp)
movl $0x1, -0x6c(%rbp)
leaq -0x50(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0x9180
leaq -0x50(%rbp), %rdi
leaq -0x59(%rbp), %rsi
callq 0x9180
movl -0x6c(%rbp), %eax
addl -0x60(%rbp), %eax
addl -0x10(%rbp), %eax
movl %eax, -0x10(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x8(%rbp)
cmpl $0x0, -0x54(%rbp)
je 0x11829
cmpl $0x24, -0x54(%rbp)
jne 0x11889
cmpl $0x1, -0x8(%rbp)
jne 0x1183f
leaq -0x50(%rbp), %rdi
leaq 0x684d(%rip), %rsi      # 0x18087
callq 0x9180
leaq 0xe8f2(%rip), %rax      # 0x20138
cmpl $0x3, (%rax)
jne 0x11865
leaq 0x6840(%rip), %rdi      # 0x18092
callq 0xe290
leaq -0x50(%rbp), %rdi
callq 0xe190
callq 0xe240
movl $0x0, -0x10(%rbp)
movb $0x0, -0x50(%rbp)
movl $0x0, -0x8(%rbp)
leaq 0x6942(%rip), %rax      # 0x181c0
movq %rax, -0x68(%rbp)
movl $0x0, -0x6c(%rbp)
movl -0x4(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x11672
cmpl $0x0, -0x8(%rbp)
je 0x118db
cmpl $0x1, -0x8(%rbp)
jne 0x118b3
leaq -0x50(%rbp), %rdi
leaq 0x67d9(%rip), %rsi      # 0x18087
callq 0x9180
leaq 0xe87e(%rip), %rax      # 0x20138
cmpl $0x3, (%rax)
jne 0x118d9
leaq 0x67cc(%rip), %rdi      # 0x18092
callq 0xe290
leaq -0x50(%rbp), %rdi
callq 0xe190
callq 0xe240
jmp 0x118db
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)