// File: /workspace/github_c_makefile_star2_O0/janet-lang[P]janet/src/core/net.c
// Function: janet_so_getname
static Janet janet_so_getname(const void *sa_any) {
    const struct sockaddr *sa = sa_any;
    char buffer[SA_ADDRSTRLEN];
    switch (sa->sa_family) {
        default:
            janet_panic("unknown address family");
        case AF_INET: {
            const struct sockaddr_in *sai = sa_any;
            if (!inet_ntop(AF_INET, &(sai->sin_addr), buffer, sizeof(buffer))) {
                janet_panic("unable to decode ipv4 host address");
            }
            Janet pair[2] = {janet_cstringv(buffer), janet_wrap_integer(ntohs(sai->sin_port))};
            return janet_wrap_tuple(janet_tuple_n(pair, 2));
        }
#ifndef JANET_NO_IPV6
        case AF_INET6: {
            const struct sockaddr_in6 *sai6 = sa_any;
            if (!inet_ntop(AF_INET6, &(sai6->sin6_addr), buffer, sizeof(buffer))) {
                janet_panic("unable to decode ipv4 host address");
            }
            Janet pair[2] = {janet_cstringv(buffer), janet_wrap_integer(ntohs(sai6->sin6_port))};
            return janet_wrap_tuple(janet_tuple_n(pair, 2));
        }
#endif
#ifndef JANET_WINDOWS
        case AF_UNIX: {
            const struct sockaddr_un *sun = sa_any;
            Janet pathname;
            if (sun->sun_path[0] == '\0') {
                memcpy(buffer, sun->sun_path, sizeof(sun->sun_path));
                buffer[0] = '@';
                pathname = janet_cstringv(buffer);
            } else {
                pathname = janet_cstringv(sun->sun_path);
            }
            return janet_wrap_tuple(janet_tuple_n(&pathname, 1));
        }
#endif
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movzwl (%rax), %eax
movl %eax, -0xf4(%rbp)
subl $0x1, %eax
je 0x490ed
jmp 0x48f5f
movl -0xf4(%rbp), %eax
subl $0x2, %eax
je 0x48f89
jmp 0x48f6c
movl -0xf4(%rbp), %eax
subl $0xa, %eax
je 0x4903b
jmp 0x48f7d
leaq 0x4692c(%rip), %rdi     # 0x8f8b0
callq 0x1ad60
movq -0x10(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rsi
addq $0x4, %rsi
leaq -0x90(%rbp), %rdx
movl $0x2, %edi
movl $0x6d, %ecx
callq 0x12030
cmpq $0x0, %rax
jne 0x48fc7
leaq 0x46905(%rip), %rdi     # 0x8f8c7
callq 0x1ad60
leaq -0x90(%rbp), %rdi
callq 0x64a70
movq %rax, %rdi
movabsq $-0x6000000000000, %rsi # imm = 0xFFFA000000000000
callq 0x7b550
movq %rax, -0xb0(%rbp)
movq -0x98(%rbp), %rax
movzwl 0x2(%rax), %edi
callq 0x12880
movzwl %ax, %eax
cvtsi2sd %eax, %xmm0
callq 0x7b820
movq %rax, -0xa8(%rbp)
leaq -0xb0(%rbp), %rdi
movl $0x2, %esi
callq 0x6a7d0
movq %rax, %rdi
movabsq $-0x4000000000000, %rsi # imm = 0xFFFC000000000000
callq 0x7b550
movq %rax, -0x8(%rbp)
jmp 0x491be
movq -0x10(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rsi
addq $0x8, %rsi
leaq -0x90(%rbp), %rdx
movl $0xa, %edi
movl $0x6d, %ecx
callq 0x12030
cmpq $0x0, %rax
jne 0x49079
leaq 0x46853(%rip), %rdi     # 0x8f8c7
callq 0x1ad60
leaq -0x90(%rbp), %rdi
callq 0x64a70
movq %rax, %rdi
movabsq $-0x6000000000000, %rsi # imm = 0xFFFA000000000000
callq 0x7b550
movq %rax, -0xd0(%rbp)
movq -0xb8(%rbp), %rax
movzwl 0x2(%rax), %edi
callq 0x12880
movzwl %ax, %eax
cvtsi2sd %eax, %xmm0
callq 0x7b820
movq %rax, -0xc8(%rbp)
leaq -0xd0(%rbp), %rdi
movl $0x2, %esi
callq 0x6a7d0
movq %rax, %rdi
movabsq $-0x4000000000000, %rsi # imm = 0xFFFC000000000000
callq 0x7b550
movq %rax, -0x8(%rbp)
jmp 0x491be
movq -0x10(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0xd8(%rbp), %rax
movsbl 0x2(%rax), %eax
cmpl $0x0, %eax
jne 0x49160
leaq -0x90(%rbp), %rdi
movq -0xd8(%rbp), %rsi
addq $0x2, %rsi
movl $0x6c, %edx
callq 0x12680
movb $0x40, -0x90(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x64a70
movq %rax, %rdi
movabsq $-0x6000000000000, %rsi # imm = 0xFFFA000000000000
callq 0x7b550
movq %rax, -0xe8(%rbp)
movq -0xe8(%rbp), %rax
movq %rax, -0xe0(%rbp)
jmp 0x49197
movq -0xd8(%rbp), %rdi
addq $0x2, %rdi
callq 0x64a70
movq %rax, %rdi
movabsq $-0x6000000000000, %rsi # imm = 0xFFFA000000000000
callq 0x7b550
movq %rax, -0xf0(%rbp)
movq -0xf0(%rbp), %rax
movq %rax, -0xe0(%rbp)
leaq -0xe0(%rbp), %rdi
movl $0x1, %esi
callq 0x6a7d0
movq %rax, %rdi
movabsq $-0x4000000000000, %rsi # imm = 0xFFFC000000000000
callq 0x7b550
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
nopl (%rax,%rax)