// File: /workspace/github_c_makefile_star2_O0/BernardTatin[P]s7sh/s7.c
// Function: g_write_byte
static s7_pointer g_write_byte(s7_scheme *sc, s7_pointer args)
    {
#define H_write_byte "(write-byte byte (port (current-output-port))): writes byte to the output port"
#define Q_write_byte s7_make_signature(sc, 3, sc->is_byte_symbol, sc->is_byte_symbol, s7_make_signature(sc, 2, sc->is_output_port_symbol, sc->not_symbol))
        s7_pointer port, b;
        s7_int val;

        b = car(args);
        if (!s7_is_integer(b))
            return(method_or_bust(sc, car(args), sc->write_byte_symbol, args, T_INTEGER, 1));

        val = s7_integer(b);
        if ((val < 0) || (val > 255)) /* need to check this before port==#f, else (write-byte most-positive-fixnum #f) is not an error */
            return(wrong_type_argument_with_type(sc, sc->write_byte_symbol, 1, b, an_unsigned_byte_string));

        if (is_pair(cdr(args)))
            port = cadr(args);
        else port = sc->output_port;

        if (!is_output_port(port))
        {
            if (port == sc->F) return(car(args));
            return(method_or_bust_with_type_one_arg(sc, port, sc->write_byte_symbol, args, an_output_port_string));
        }

        port_write_character(port)(sc, (uint8_t)val, port);
        return(b);
    }

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x58(%rsp)
movq %rsi, 0x50(%rsp)
movq 0x50(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rdi
callq 0x11340
testb $0x1, %al
jne 0x6ce64
movq 0x58(%rsp), %rdi
movq 0x50(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x58(%rsp), %rax
movq 0x16a0(%rax), %rdx
movq 0x50(%rsp), %rcx
movl $0xb, %r8d
movl $0x1, %r9d
callq 0x13c50
movq %rax, 0x60(%rsp)
jmp 0x6d051
movq 0x40(%rsp), %rdi
callq 0x10790
movq %rax, 0x38(%rsp)
cmpq $0x0, 0x38(%rsp)
jl 0x6ce8a
cmpq $0xff, 0x38(%rsp)
jle 0x6cf8e
movq 0x58(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x58(%rsp), %rax
movq 0x16a0(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x10(%rsp)
movq $0x1, 0x30(%rsp)
movq 0x30(%rsp), %rax
andq $-0x800, %rax           # imm = 0xF800
cmpq $0x0, %rax
jne 0x6ced9
movq 0x30(%rsp), %rcx
leaq 0x1a95b1(%rip), %rax    # 0x216480
movq (%rax,%rcx,8), %rax
movq %rax, (%rsp)
jmp 0x6cf4f
jmp 0x6cedb
movq 0x58(%rsp), %rax
movq 0x90(%rax), %rax
movq 0x58(%rsp), %rcx
cmpq 0x98(%rcx), %rax
ja 0x6ceff
movq 0x58(%rsp), %rdi
callq 0xc670
movq 0x58(%rsp), %rcx
movq 0x90(%rcx), %rax
movq %rax, %rdx
addq $-0x8, %rdx
movq %rdx, 0x90(%rcx)
movq -0x8(%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq $0xb, (%rax)
movq 0x30(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x20(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
movq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdi
movq (%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rdx
movq 0x40(%rsp), %rcx
movq 0x58(%rsp), %rax
movq 0x140(%rax), %r8
movq 0x1b5c31(%rip), %r9     # 0x222bb0
callq 0xc560
movq %rax, 0x60(%rsp)
jmp 0x6d051
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rax
movzbl (%rax), %eax
cmpl $0x1, %eax
jne 0x6cfb3
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x48(%rsp)
jmp 0x6cfc4
movq 0x58(%rsp), %rax
movq 0x188(%rax), %rax
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x22, %eax
je 0x6d022
movq 0x48(%rsp), %rax
movq 0x58(%rsp), %rcx
cmpq 0x120(%rcx), %rax
jne 0x6cff4
movq 0x50(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x60(%rsp)
jmp 0x6d051
movq 0x58(%rsp), %rdi
movq 0x48(%rsp), %rsi
movq 0x58(%rsp), %rax
movq 0x16a0(%rax), %rdx
movq 0x50(%rsp), %rcx
movq 0x1b4df2(%rip), %r8     # 0x221e08
callq 0x1ba7e0
movq %rax, 0x60(%rsp)
jmp 0x6d051
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq 0x58(%rsp), %rdi
movq 0x38(%rsp), %rcx
movq 0x48(%rsp), %rdx
movzbl %cl, %esi
callq *%rax
movq 0x40(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x60(%rsp), %rax
addq $0x68, %rsp
retq
nopl (%rax,%rax)