// File: /workspace/github_c_makefile_star2_O1/starius[P]dna-complement/dna-complement.c
// Function: main
int main(int argc, char** argv) {
    initializeTranslate();
    if (argc < 1 + 2) {
        fprintf(stderr, "Usage: %s input output\n", argv[0]);
        return 1;
    }
    const char* input_fname = argv[1];
    const char* output_fname = argv[2];
    FILE* input = fopen(input_fname, "rb");
    if (!input) {
        fprintf(stderr, "Can't open %s: %s\n",
                input_fname, strerror(errno));
        return 1;
    }
    FILE* output = fopen(output_fname, "wb");
    if (!output) {
        fprintf(stderr, "Can't open %s: %s\n",
                output_fname, strerror(errno));
        return 1;
    }
    char input_buffer[BUFSIZE];
#ifdef SAME_BUFFER
# define output_buffer input_buffer
#else
    char output_buffer[BUFSIZE];
#endif
#if USE_SHORT
    short* input_buffer_end = (short*)(input_buffer + BUFSIZE);
#else
    char* input_buffer_end = input_buffer + BUFSIZE;
#endif
    size_t nread;
    while (nread = fread(input_buffer, 1, BUFSIZE, input)) {
#if USE_SHORT
        short* input_it;
# define table short_translate
# define input_buffer1 (short*)input_buffer
# define output_buffer1 (short*)output_buffer
# ifndef SAME_BUFFER
        short* output_it;
# endif
#else
        char* input_it;
# define table translate
# define input_buffer1 input_buffer
# define output_buffer1 output_buffer
# ifndef SAME_BUFFER
        char* output_it;
# endif
#endif
#ifdef SAME_BUFFER
# define output_it input_it
#endif
        for (input_it = input_buffer1
#ifndef SAME_BUFFER
             , output_it = output_buffer1
#endif
             ; input_it < input_buffer_end; input_it++
#ifndef SAME_BUFFER
             , output_it++
#endif
             )
        {
            *output_it = table[*input_it];
        }
        fwrite(output_buffer, 1, nread, output);
    }
    fclose(input);
    fclose(output);
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x100000, %rsp         # imm = 0x100000
movq %rsi, %rbx
movl %edi, %ebp
callq 0x123c
cmpl $0x2, %ebp
jle 0x13f4
movq 0x8(%rbx), %r14
movq 0x10(%rbx), %r15
leaq 0xd1a(%rip), %rsi       # 0x2048
movq %r14, %rdi
callq 0x1070
testq %rax, %rax
je 0x13fe
movq %rax, %rbx
leaq 0xd15(%rip), %rsi       # 0x205e
movq %r15, %rdi
callq 0x1070
testq %rax, %rax
je 0x1408
movq %rax, %r14
movq %rsp, %rdi
movl $0x1, %esi
movl $0x100000, %edx         # imm = 0x100000
movq %rbx, %rcx
callq 0x1040
testq %rax, %rax
je 0x13d2
leaq 0x2df2(%rip), %r12      # 0x4170
movq %rsp, %r15
movq $-0x2, %rcx
movswq 0x2(%rsp,%rcx), %rdx
movzwl (%r12,%rdx,2), %edx
movw %dx, 0x2(%rsp,%rcx)
addq $0x2, %rcx
cmpq $0xffffe, %rcx          # imm = 0xFFFFE
jb 0x1388
movl $0x1, %esi
movq %r15, %rdi
movq %rax, %rdx
movq %r14, %rcx
callq 0x1080
movl $0x1, %esi
movl $0x100000, %edx         # imm = 0x100000
movq %r15, %rdi
movq %rbx, %rcx
callq 0x1040
testq %rax, %rax
jne 0x1381
movq %rbx, %rdi
callq 0x1050
movq %r14, %rdi
callq 0x1050
xorl %eax, %eax
addq $0x100000, %rsp         # imm = 0x100000
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x1126
jmp 0x1410
movq %r14, %rdi
callq 0x10eb
jmp 0x1410
movq %r15, %rdi
callq 0x10b0
movl $0x1, %eax
jmp 0x13e4