// File: /workspace/github_c_makefile_star2_O0/videolan[P]bitstream/examples/dvb_print_si.c
// Function: iconv_wrapper
static char *iconv_wrapper(void *_unused, const char *psz_encoding,
                           char *p_string, size_t i_length)
{
    char *psz_string, *p;
    size_t i_out_length;

    if (!strcmp(psz_encoding, psz_native_encoding))
        return iconv_append_null(p_string, i_length);

    if (iconv_handle != (iconv_t)-1 &&
        strcmp(psz_encoding, psz_current_encoding)) {
        iconv_close(iconv_handle);
        iconv_handle = (iconv_t)-1;
    }

    if (iconv_handle == (iconv_t)-1)
        iconv_handle = iconv_open(psz_native_encoding, psz_encoding);
    if (iconv_handle == (iconv_t)-1) {
        fprintf(stderr, "couldn't initiate conversion from %s to %s (%m)\n",
                psz_encoding, psz_native_encoding);
        return iconv_append_null(p_string, i_length);
    }
    psz_current_encoding = psz_encoding;

    /* converted strings can be up to six times larger */
    i_out_length = i_length * 6;
    p = psz_string = malloc(i_out_length);
    if (iconv(iconv_handle, &p_string, &i_length, &p, &i_out_length) == -1) {
        fprintf(stderr, "couldn't convert from %s to %s (%m)\n", psz_encoding,
                psz_native_encoding);
        free(psz_string);
        return iconv_append_null(p_string, i_length);
    }
    if (i_length)
        fprintf(stderr, "partial conversion from %s to %s\n", psz_encoding,
                psz_native_encoding);

    *p = '\0';
    return psz_string;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x18(%rbp), %rdi
movq 0x1b605(%rip), %rsi     # 0x382c8
callq 0x2110
cmpl $0x0, %eax
jne 0x1cce3
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x1d1b0
movq %rax, -0x8(%rbp)
jmp 0x1ce51
movq $-0x1, %rax
cmpq %rax, 0x1b42f(%rip)     # 0x38120
je 0x1cd22
movq -0x18(%rbp), %rdi
movq 0x1b5d2(%rip), %rsi     # 0x382d0
callq 0x2110
cmpl $0x0, %eax
je 0x1cd22
movq 0x1b411(%rip), %rdi     # 0x38120
callq 0x2190
movq $-0x1, %rax
movq %rax, 0x1b3fe(%rip)     # 0x38120
movq $-0x1, %rax
cmpq %rax, 0x1b3f0(%rip)     # 0x38120
jne 0x1cd49
movq 0x1b58f(%rip), %rdi     # 0x382c8
movq -0x18(%rbp), %rsi
callq 0x2210
movq %rax, 0x1b3d7(%rip)     # 0x38120
movq $-0x1, %rax
cmpq %rax, 0x1b3c9(%rip)     # 0x38120
jne 0x1cd92
movq 0x1b290(%rip), %rax     # 0x37ff0
movq (%rax), %rdi
movq -0x18(%rbp), %rdx
movq 0x1b55a(%rip), %rcx     # 0x382c8
leaq 0xe31a(%rip), %rsi      # 0x2b08f
movb $0x0, %al
callq 0x2120
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x1d1b0
movq %rax, -0x8(%rbp)
jmp 0x1ce51
movq -0x18(%rbp), %rax
movq %rax, 0x1b533(%rip)     # 0x382d0
imulq $0x6, -0x28(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
callq 0x2150
movq %rax, -0x30(%rbp)
movq %rax, -0x38(%rbp)
movq 0x1b362(%rip), %rdi     # 0x38120
leaq -0x20(%rbp), %rsi
leaq -0x28(%rbp), %rdx
leaq -0x38(%rbp), %rcx
leaq -0x40(%rbp), %r8
callq 0x2060
cmpq $-0x1, %rax
jne 0x1ce18
movq 0x1b210(%rip), %rax     # 0x37ff0
movq (%rax), %rdi
movq -0x18(%rbp), %rdx
movq 0x1b4da(%rip), %rcx     # 0x382c8
leaq 0xe2cb(%rip), %rsi      # 0x2b0c0
movb $0x0, %al
callq 0x2120
movq -0x30(%rbp), %rdi
callq 0x2030
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x1d1b0
movq %rax, -0x8(%rbp)
jmp 0x1ce51
cmpq $0x0, -0x28(%rbp)
je 0x1ce42
movq 0x1b1ca(%rip), %rax     # 0x37ff0
movq (%rax), %rdi
movq -0x18(%rbp), %rdx
movq 0x1b494(%rip), %rcx     # 0x382c8
leaq 0xe2aa(%rip), %rsi      # 0x2b0e5
movb $0x0, %al
callq 0x2120
movq -0x38(%rbp), %rax
movb $0x0, (%rax)
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)