LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/Orycterope[P]corewar/libft/ft_memcpy.c
// Function: ft_memcpy
void	*ft_memcpy(void *dst, const void *src, size_t n)
{
	unsigned char	*dst2;

	if (dst == NULL || src == NULL)
		return (NULL);
	dst2 = dst;
	while (n--)
		*dst2++ = *(unsigned char *)src++;
	return (dst);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x907e
cmpq $0x0, -0x18(%rbp)
jne 0x9088
movq $0x0, -0x8(%rbp)
jmp 0x90d1
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $-0x1, %rcx
movq %rcx, -0x20(%rbp)
cmpq $0x0, %rax
je 0x90c9
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movb (%rax), %cl
movq -0x28(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x28(%rbp)
movb %cl, (%rax)
jmp 0x9090
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Orycterope[P]corewar/libft/ft_strnew.c
// Function: ft_strnew
char	*ft_strnew(size_t size)
{
	char	*str;
	size_t	c;

	str = (char*)malloc(sizeof(char) * size);
	if (str == NULL)
		return (NULL);
	c = 0;
	while (c < size)
		str[c++] = '\0';
	return (str);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
shlq $0x0, %rdi
callq 0x1060
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x910e
movq $0x0, -0x8(%rbp)
jmp 0x9141
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x10(%rbp), %rax
jae 0x9139
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x20(%rbp)
movb $0x0, (%rax,%rcx)
jmp 0x9116
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Orycterope[P]corewar/libft/ft_strrev.c
// Function: ft_strrev
char	*ft_strrev(char *str)
{
	char	*cpy;
	char	*out;
	int		len;

	out = str;
	len = ft_strlen(str);
	cpy = ft_strdup(str);
	if (cpy == NULL)
		return (NULL);
	while (len > 0)
		*str++ = cpy[--len];
	free(cpy);
	return (out);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x5b70
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rdi
callq 0x5bb0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x918e
movq $0x0, -0x8(%rbp)
jmp 0x91cd
jmp 0x9190
cmpl $0x0, -0x24(%rbp)
jle 0x91bc
movq -0x18(%rbp), %rax
movl -0x24(%rbp), %ecx
addl $-0x1, %ecx
movl %ecx, -0x24(%rbp)
movslq %ecx, %rcx
movb (%rax,%rcx), %cl
movq -0x10(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x10(%rbp)
movb %cl, (%rax)
jmp 0x9190
movq -0x18(%rbp), %rdi
callq 0x1030
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Orycterope[P]corewar/libft/printf/alias.c
// Function: resolve_alias
t_conversion	*resolve_alias(t_conversion *conv)
{
	char	*newflags;

	if (conv == NULL)
		return (NULL);
	if (ft_strchr("DOUCS", conv->conversion) != NULL)
	{
		free(conv->modifier);
		conv->modifier = ft_strdup("l");
		conv->conversion = ft_tolower(conv->conversion);
	}
	else if (conv->conversion == 'p')
	{
		newflags = ft_strjoin(conv->flags, "#");
		free(conv->flags);
		conv->flags = newflags;
		free(conv->modifier);
		conv->modifier = ft_strdup("l");
	}
	return (conv);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x9200
movq $0x0, -0x8(%rbp)
jmp 0x92bf
movq -0x10(%rbp), %rax
movsbl 0x20(%rax), %esi
leaq 0x1485(%rip), %rdi      # 0xa694
callq 0x5c60
cmpq $0x0, %rax
je 0x9256
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x1030
leaq 0xed1(%rip), %rdi       # 0xa0ff
callq 0x5bb0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
movsbl 0x20(%rax), %edi
callq 0x92d0
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, 0x20(%rax)
jmp 0x92b7
movq -0x10(%rbp), %rax
movsbl 0x20(%rax), %eax
cmpl $0x70, %eax
jne 0x92b5
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq 0x1429(%rip), %rsi      # 0xa69a
callq 0x5f80
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x1030
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x1030
leaq 0xe5a(%rip), %rdi       # 0xa0ff
callq 0x5bb0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
jmp 0x92b7
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/mjosaarinen[P]brutus/crypto_aead/pi16cipher128v2/ref2/pi-cipher.c
// Function: load_u16_little
static uint16_t load_u16_little(const void *mem)
{
	uint16_t ret;
	const uint8_t *x = (const uint8_t *)mem;
	ret =   x[0] <<  0
	      | x[1] <<  8;
	return ret;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq -0x8(%rsp), %rax
movq %rax, -0x18(%rsp)
movq -0x18(%rsp), %rax
movzbl (%rax), %eax
shll $0x0, %eax
movq -0x18(%rsp), %rcx
movzbl 0x1(%rcx), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movw %ax, -0xa(%rsp)
movw -0xa(%rsp), %ax
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/joncampbell123[P]swfhax/c4_swfjpegs.c
// Function: parse_argv
static int parse_argv(int argc,char **argv) {
	int i,swi=0;
	char *a;

	for (i=1;i < argc;) {
		a = argv[i++];

		if (*a == '-') {
			do { a++; } while (*a == '-');

			if (!strcmp(a,"h") || !strcmp(a,"help")) {
				help();
				return 1;
			}
			else {
				fprintf(stderr,"Unknown switch %s\n",a);
				return 1;
			}
		}
		else {
			switch (swi++) {
				case 0:
					swf_file = a;
					break;
				default:
					fprintf(stderr,"Unexpected non-switch %s\n",a);
					return 1;
			}
		}
	}

	if (swf_file == NULL) {
		fprintf(stderr,"You must specify a SWF file to dump\n");
		return 1;
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x18(%rbp)
movl $0x1, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x1682
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x14(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x1639
jmp 0x15c1
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
je 0x15c1
movq -0x20(%rbp), %rdi
leaq 0x5b66(%rip), %rsi      # 0x714a
callq 0x10d0
cmpl $0x0, %eax
je 0x1603
movq -0x20(%rbp), %rdi
leaq 0x5b53(%rip), %rsi      # 0x714c
callq 0x10d0
cmpl $0x0, %eax
jne 0x1614
callq 0x2210
movl $0x1, -0x4(%rbp)
jmp 0x16b4
movq 0x99dd(%rip), %rax      # 0xaff8
movq (%rax), %rdi
movq -0x20(%rbp), %rdx
leaq 0x5b28(%rip), %rsi      # 0x7151
movb $0x0, %al
callq 0x10e0
movl $0x1, -0x4(%rbp)
jmp 0x16b4
movl -0x18(%rbp), %eax
movl %eax, %ecx
incl %ecx
movl %ecx, -0x18(%rbp)
testl %eax, %eax
jne 0x1656
jmp 0x1649
movq -0x20(%rbp), %rax
movq %rax, 0x9b24(%rip)      # 0xb178
jmp 0x167b
movq 0x999b(%rip), %rax      # 0xaff8
movq (%rax), %rdi
movq -0x20(%rbp), %rdx
leaq 0x5af9(%rip), %rsi      # 0x7164
movb $0x0, %al
callq 0x10e0
movl $0x1, -0x4(%rbp)
jmp 0x16b4
jmp 0x167d
jmp 0x158d
cmpq $0x0, 0x9aee(%rip)      # 0xb178
jne 0x16ad
movq 0x9965(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x5ae1(%rip), %rsi      # 0x717e
movb $0x0, %al
callq 0x10e0
movl $0x1, -0x4(%rbp)
jmp 0x16b4
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/joncampbell123[P]swfhax/./rawint.h
// Function: _be_u16
static inline uint16_t __be_u16(const void *p) {
    const unsigned char *c = (const unsigned char *)p;

    return
        (((uint16_t)c[0]) <<  8U) |
        (((uint16_t)c[1]) <<  0U);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
movzwl %ax, %eax
shll $0x8, %eax
movq -0x10(%rbp), %rcx
movzbl 0x1(%rcx), %ecx
movzwl %cx, %ecx
shll $0x0, %ecx
orl %ecx, %eax
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/giometti[P]mastering_UNIX_programming/chapter_07/fwide.c
// Function: main
int main(void)
{
	int mode;

	errno = 0;
	mode = fwide(stdout, 0);
	if (errno) {
		perror("fwide");
		return -1;
	}
	wprintf(L"by default stdout has mode=%d\n", mode);

	errno = 0;
	mode = fwide(stdout, 0);
	if (errno) {
		perror("fwide");
		return -1;
	}
	wprintf(L"now stdout has mode=%d\n", mode);

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x0, -0x4(%rbp)
callq 0x1030
movl $0x0, (%rax)
movq 0x2e4f(%rip), %rax      # 0x3fe0
movq (%rax), %rdi
xorl %esi, %esi
callq 0x1050
movl %eax, -0x8(%rbp)
callq 0x1030
cmpl $0x0, (%rax)
je 0x11bd
leaq 0xe55(%rip), %rdi       # 0x2004
callq 0x1060
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1224
movl -0x8(%rbp), %esi
leaq 0xe45(%rip), %rdi       # 0x200c
movb $0x0, %al
callq 0x1040
callq 0x1030
movl $0x0, (%rax)
movq 0x2e00(%rip), %rax      # 0x3fe0
movq (%rax), %rdi
xorl %esi, %esi
callq 0x1050
movl %eax, -0x8(%rbp)
callq 0x1030
cmpl $0x0, (%rax)
je 0x120c
leaq 0xe06(%rip), %rdi       # 0x2004
callq 0x1060
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1224
movl -0x8(%rbp), %esi
leaq 0xe72(%rip), %rdi       # 0x2088
movb $0x0, %al
callq 0x1040
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/hiperiondev[P]hpsdrsim/src/hpsdr_debug.c
// Function: dbg_printf
void dbg_printf(int Level, const char *fmt, ...) {
    if (Level <= debug_level) {
        bool debug_id_m = false;
        va_list args;
        va_start(args, fmt);
        if (fmt[0] == '<') {
            --debug_id;
            debug_id_m = true;
            fprintf(stderr, "%*c(%d)", debug_id, ' ', debug_id);
        }
        if (fmt[0] == '>') {
            debug_id_m = true;
            fprintf(stderr, "%*c(%d)", debug_id, ' ', debug_id);
            ++debug_id;
        }
        if (!debug_id_m)
            fprintf(stderr, "%*c", debug_id, ' ');
        vfprintf(stderr, fmt, args);
        va_end(args);
        debug_id_m = false;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
testb %al, %al
je 0x13a8
movaps %xmm0, -0xb0(%rbp)
movaps %xmm1, -0xa0(%rbp)
movaps %xmm2, -0x90(%rbp)
movaps %xmm3, -0x80(%rbp)
movaps %xmm4, -0x70(%rbp)
movaps %xmm5, -0x60(%rbp)
movaps %xmm6, -0x50(%rbp)
movaps %xmm7, -0x40(%rbp)
movq %r9, -0xb8(%rbp)
movq %r8, -0xc0(%rbp)
movq %rcx, -0xc8(%rbp)
movq %rdx, -0xd0(%rbp)
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl -0x4(%rbp), %eax
cmpl 0xef10(%rip), %eax      # 0x102e4
jg 0x14dc
movb $0x0, -0x11(%rbp)
leaq -0x30(%rbp), %rax
leaq -0xe0(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x10, (%rax)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3c, %eax
jne 0x144b
movl 0xed1c(%rip), %eax      # 0x10130
addl $-0x1, %eax
movl %eax, 0xed13(%rip)      # 0x10130
movb $0x1, -0x11(%rbp)
movq 0xebd0(%rip), %rax      # 0xfff8
movq (%rax), %rdi
movl 0xecff(%rip), %edx      # 0x10130
movl 0xecf8(%rip), %r8d      # 0x10130
leaq 0xabc5(%rip), %rsi      # 0xc004
movl $0x20, %ecx
movb $0x0, %al
callq 0x1130
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3e, %eax
jne 0x1494
movb $0x1, -0x11(%rbp)
movq 0xeb96(%rip), %rax      # 0xfff8
movq (%rax), %rdi
movl 0xecc5(%rip), %edx      # 0x10130
movl 0xecbe(%rip), %r8d      # 0x10130
leaq 0xab8b(%rip), %rsi      # 0xc004
movl $0x20, %ecx
movb $0x0, %al
callq 0x1130
movl 0xeca5(%rip), %eax      # 0x10130
addl $0x1, %eax
movl %eax, 0xec9c(%rip)      # 0x10130
testb $0x1, -0x11(%rbp)
jne 0x14bd
movq 0xeb57(%rip), %rax      # 0xfff8
movq (%rax), %rdi
movl 0xec86(%rip), %edx      # 0x10130
leaq 0xab5b(%rip), %rsi      # 0xc00c
movl $0x20, %ecx
movb $0x0, %al
callq 0x1130
movq 0xeb34(%rip), %rax      # 0xfff8
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x11a0
leaq -0x30(%rbp), %rax
movb $0x0, -0x11(%rbp)
addq $0xe0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O0/hiperiondev[P]hpsdrsim/src/hpsdr_functions.c
// Function: np_discovery
void np_discovery(uint8_t *buffer, int new_protocol_running, int NEWDEVICE) {
    // prepare response
    memset(buffer, 0, 60);
    buffer[4] = 0x02 + new_protocol_running;
    buffer[5] = 0xAA;
    buffer[6] = 0xBB;
    buffer[7] = 0xCC;
    buffer[8] = 0xDD;
    buffer[9] = 0xEE;
    buffer[10] = 0xFF;
    buffer[11] = NEWDEVICE;
    buffer[12] = 38;
    buffer[13] = 19;
    buffer[20] = 2;
    buffer[21] = 1;
    buffer[22] = 3;
    // HERMES_LITE2 is a HermesLite with a new software version
    if (NEWDEVICE == NEW_DEVICE_HERMES_LITE2) {
        buffer[11] = NEW_DEVICE_HERMES_LITE;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x3c, %edx
callq 0x10f0
movl -0xc(%rbp), %eax
addl $0x2, %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0x4(%rax)
movq -0x8(%rbp), %rax
movb $-0x56, 0x5(%rax)
movq -0x8(%rbp), %rax
movb $-0x45, 0x6(%rax)
movq -0x8(%rbp), %rax
movb $-0x34, 0x7(%rax)
movq -0x8(%rbp), %rax
movb $-0x23, 0x8(%rax)
movq -0x8(%rbp), %rax
movb $-0x12, 0x9(%rax)
movq -0x8(%rbp), %rax
movb $-0x1, 0xa(%rax)
movl -0x10(%rbp), %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0xb(%rax)
movq -0x8(%rbp), %rax
movb $0x26, 0xc(%rax)
movq -0x8(%rbp), %rax
movb $0x13, 0xd(%rax)
movq -0x8(%rbp), %rax
movb $0x2, 0x14(%rax)
movq -0x8(%rbp), %rax
movb $0x1, 0x15(%rax)
movq -0x8(%rbp), %rax
movb $0x3, 0x16(%rax)
cmpl $0x3ee, -0x10(%rbp)     # imm = 0x3EE
jne 0x1596
movq -0x8(%rbp), %rax
movb $0x6, 0xb(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/hiperiondev[P]hpsdrsim/src/hpsdr_functions.c
// Function: np_erase_packet
void np_erase_packet(uint8_t *buffer, int active_thread, int NEWDEVICE) {
    memset(buffer, 0, 60);
    buffer[4] = 0x02 + active_thread;
    buffer[5] = 0xAA;
    buffer[6] = 0xBB;
    buffer[7] = 0xCC;
    buffer[8] = 0xDD;
    buffer[9] = 0xEE;
    buffer[10] = 0xFF;
    buffer[11] = NEWDEVICE;
    buffer[12] = 38;
    buffer[13] = 103;
    buffer[20] = 2;
    buffer[21] = 1;
    buffer[22] = 3;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x3c, %edx
callq 0x10f0
movl -0xc(%rbp), %eax
addl $0x2, %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0x4(%rax)
movq -0x8(%rbp), %rax
movb $-0x56, 0x5(%rax)
movq -0x8(%rbp), %rax
movb $-0x45, 0x6(%rax)
movq -0x8(%rbp), %rax
movb $-0x34, 0x7(%rax)
movq -0x8(%rbp), %rax
movb $-0x23, 0x8(%rax)
movq -0x8(%rbp), %rax
movb $-0x12, 0x9(%rax)
movq -0x8(%rbp), %rax
movb $-0x1, 0xa(%rax)
movl -0x10(%rbp), %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0xb(%rax)
movq -0x8(%rbp), %rax
movb $0x26, 0xc(%rax)
movq -0x8(%rbp), %rax
movb $0x67, 0xd(%rax)
movq -0x8(%rbp), %rax
movb $0x2, 0x14(%rax)
movq -0x8(%rbp), %rax
movb $0x1, 0x15(%rax)
movq -0x8(%rbp), %rax
movb $0x3, 0x16(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/hiperiondev[P]hpsdrsim/src/hpsdr_functions.c
// Function: np_program
void np_program(uint8_t *buffer, unsigned long checksum, int NEWDEVICE) {
    memset(buffer + 4, 0, 56); // keep seq. no
    buffer[4] = 0x04;
    buffer[5] = 0xAA;
    buffer[6] = 0xBB;
    buffer[7] = 0xCC;
    buffer[8] = 0xDD;
    buffer[9] = 0xEE;
    buffer[10] = 0xFF;
    buffer[11] = 103;
    buffer[12] = NEWDEVICE;
    buffer[13] = (checksum >> 8) & 0xFF;
    buffer[14] = (checksum) & 0xFF;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rdi
addq $0x4, %rdi
xorl %esi, %esi
movl $0x38, %edx
callq 0x10f0
movq -0x8(%rbp), %rax
movb $0x4, 0x4(%rax)
movq -0x8(%rbp), %rax
movb $-0x56, 0x5(%rax)
movq -0x8(%rbp), %rax
movb $-0x45, 0x6(%rax)
movq -0x8(%rbp), %rax
movb $-0x34, 0x7(%rax)
movq -0x8(%rbp), %rax
movb $-0x23, 0x8(%rax)
movq -0x8(%rbp), %rax
movb $-0x12, 0x9(%rax)
movq -0x8(%rbp), %rax
movb $-0x1, 0xa(%rax)
movq -0x8(%rbp), %rax
movb $0x67, 0xb(%rax)
movl -0x14(%rbp), %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0xc(%rax)
movq -0x10(%rbp), %rax
shrq $0x8, %rax
andq $0xff, %rax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0xd(%rax)
movq -0x10(%rbp), %rax
andq $0xff, %rax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0xe(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/hiperiondev[P]hpsdrsim/src/hpsdr_functions.c
// Function: op_erase_packet
void op_erase_packet(uint8_t *buffer) {
    sleep(1);
    memset(buffer, 0, 60);
    buffer[0] = 0xEF;
    buffer[1] = 0xFE;
    buffer[2] = 0x03;
    buffer[3] = 0xAA;
    buffer[4] = 0xBB;
    buffer[5] = 0xCC;
    buffer[6] = 0xDD;
    buffer[7] = 0xEE;
    buffer[8] = 0xFF;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x1, %edi
callq 0x1210
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x3c, %edx
callq 0x10f0
movq -0x8(%rbp), %rax
movb $-0x11, (%rax)
movq -0x8(%rbp), %rax
movb $-0x2, 0x1(%rax)
movq -0x8(%rbp), %rax
movb $0x3, 0x2(%rax)
movq -0x8(%rbp), %rax
movb $-0x56, 0x3(%rax)
movq -0x8(%rbp), %rax
movb $-0x45, 0x4(%rax)
movq -0x8(%rbp), %rax
movb $-0x34, 0x5(%rax)
movq -0x8(%rbp), %rax
movb $-0x23, 0x6(%rax)
movq -0x8(%rbp), %rax
movb $-0x12, 0x7(%rax)
movq -0x8(%rbp), %rax
movb $-0x1, 0x8(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/hiperiondev[P]hpsdrsim/src/hpsdr_functions.c
// Function: op_program
void op_program(uint8_t *buffer) {
    usleep(1000);
    memset(buffer, 0, 60);
    buffer[0] = 0xEF;
    buffer[1] = 0xFE;
    buffer[2] = 0x04;
    buffer[3] = 0xAA;
    buffer[4] = 0xBB;
    buffer[5] = 0xCC;
    buffer[6] = 0xDD;
    buffer[7] = 0xEE;
    buffer[8] = 0xFF;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x3e8, %edi            # imm = 0x3E8
callq 0x1220
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x3c, %edx
callq 0x10f0
movq -0x8(%rbp), %rax
movb $-0x11, (%rax)
movq -0x8(%rbp), %rax
movb $-0x2, 0x1(%rax)
movq -0x8(%rbp), %rax
movb $0x4, 0x2(%rax)
movq -0x8(%rbp), %rax
movb $-0x56, 0x3(%rax)
movq -0x8(%rbp), %rax
movb $-0x45, 0x4(%rax)
movq -0x8(%rbp), %rax
movb $-0x34, 0x5(%rax)
movq -0x8(%rbp), %rax
movb $-0x23, 0x6(%rax)
movq -0x8(%rbp), %rax
movb $-0x12, 0x7(%rax)
movq -0x8(%rbp), %rax
movb $-0x1, 0x8(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/hiperiondev[P]hpsdrsim/src/hpsdr_newprotocol.c
// Function: new_protocol_running
int new_protocol_running() {
    if (run)
        return 1;
    else
        return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpl $0x0, 0xd625(%rip)      # 0x102f0
je 0x2cd6
movl $0x1, -0x4(%rbp)
jmp 0x2cdd
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/hiperiondev[P]hpsdrsim/src/hpsdr_newprotocol.c
// Function: rx_hardware_thread
void* rx_hardware_thread(void *data) {
    int id = (int) (uintptr_t) data;
    dbg_printf(1, "-- Start rx_hardware_thread %d\n", id);

    while (1) {
        sleep(1);
    }

    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %edx
movl $0x1, %edi
leaq 0x7067(%rip), %rsi      # 0xcf29
movb $0x0, %al
callq 0x1370
movl $0x1, %edi
callq 0x1210
jmp 0x5ec9
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/hiperiondev[P]hpsdrsim/src/hpsdr_newprotocol.c
// Function: tx_hardware_thread
void* tx_hardware_thread(void *data) {
    dbg_printf(1, "-- Start tx_hardware_thread\n");

    while (1) {
        sleep(1);
    }

    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x1, %edi
leaq 0x6b44(%rip), %rsi      # 0xcf0c
movb $0x0, %al
callq 0x1370
movl $0x1, %edi
callq 0x1210
jmp 0x63cf
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaMain.cpp
// Function: LuaDump(lua_State*)
void LuaDump(lua_State* L)
{
  int i, top;

  top = lua_gettop(L);
  printf("stack top: %d\n", top);

  for (i = 1; i <= top; ++i)
  {
    printf("#%d: ", i);
    DumpValue(L, i, 2);
    puts("");
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x29910
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %esi
leaq 0x46642(%rip), %rdi     # 0x4d024
movb $0x0, %al
callq 0x6070
movl $0x1, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpl -0x10(%rbp), %eax
jg 0x6a31
movl -0xc(%rbp), %esi
leaq 0x46631(%rip), %rdi     # 0x4d033
movb $0x0, %al
callq 0x6070
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movl $0x2, %edx
callq 0x6a40
leaq 0x495a9(%rip), %rdi     # 0x4ffca
callq 0x6700
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x69f0
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaMain.cpp
// Function: DumpValue(lua_State*, int, int)
static void DumpValue(lua_State* L, int i, int max_depth)
{
	int type = lua_type(L, i);

	switch (type)
	{
		case LUA_TSTRING:
			printf("\"%s\"", lua_tostring(L, i));
			break;

		case LUA_TNUMBER:
			printf(LUA_NUMBER_FMT, lua_tonumber(L, i));
			break;

		case LUA_TTABLE:
			if (max_depth > 0)
			{
				int first = 1;
				printf("{ ");
				lua_pushnil(L);
				while (lua_next(L, i))
				{
					int top = lua_gettop(L);
					if (!first)
						printf(", ");
					DumpValue(L, top-1, max_depth-1);
					printf("=");
					DumpValue(L, top, max_depth-1);
					lua_pop(L, 1);
					first = 0;
				}
				printf("}");
			}
			else
			{
				printf("{...}");
			}
			break;

		case LUA_TUSERDATA:
			printf("<userdata>");
			break;

		case LUA_TNIL:
			printf("<nil>");
			break;

		default:
			printf("[%s]", lua_typename(L, type));
			break;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x29e70
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq %rax, -0x28(%rbp)
subq $0x7, %rax
ja 0x6bb3
movq -0x28(%rbp), %rax
leaq 0x46587(%rip), %rcx     # 0x4d004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x2a310
movq %rax, %rsi
leaq 0x47d13(%rip), %rdi     # 0x4e7b3
movb $0x0, %al
callq 0x6070
jmp 0x6bd0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x2a1e0
movq %rax, %rsi
leaq 0x46581(%rip), %rdi     # 0x4d043
movb $0x0, %al
callq 0x6070
jmp 0x6bd0
cmpl $0x0, -0x10(%rbp)
jle 0x6b83
movl $0x1, -0x18(%rbp)
leaq 0x46562(%rip), %rdi     # 0x4d048
movb $0x0, %al
callq 0x6070
movq -0x8(%rbp), %rdi
callq 0x2a670
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x2ba20
cmpl $0x0, %eax
je 0x6b73
movq -0x8(%rbp), %rdi
callq 0x29910
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x18(%rbp)
jne 0x6b27
leaq 0x4652b(%rip), %rdi     # 0x4d04b
movb $0x0, %al
callq 0x6070
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %esi
subl $0x1, %esi
movl -0x10(%rbp), %edx
subl $0x1, %edx
callq 0x6a40
leaq 0x46c59(%rip), %rdi     # 0x4d79c
movb $0x0, %al
callq 0x6070
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %esi
movl -0x10(%rbp), %edx
subl $0x1, %edx
callq 0x6a40
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x29940
movl $0x0, -0x18(%rbp)
jmp 0x6af6
leaq 0x464d8(%rip), %rdi     # 0x4d052
movb $0x0, %al
callq 0x6070
jmp 0x6b91
leaq 0x464c4(%rip), %rdi     # 0x4d04e
movb $0x0, %al
callq 0x6070
jmp 0x6bd0
leaq 0x464ba(%rip), %rdi     # 0x4d054
movb $0x0, %al
callq 0x6070
jmp 0x6bd0
leaq 0x464b5(%rip), %rdi     # 0x4d05f
movb $0x0, %al
callq 0x6070
jmp 0x6bd0
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x29ec0
movq %rax, %rsi
leaq 0x4649c(%rip), %rdi     # 0x4d065
movb $0x0, %al
callq 0x6070
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaMain.cpp
// Function: main
int main(int argc, char** argv)
{
  using namespace t2;

  InitCommon();

  MemAllocHeap heap;
  HeapInit(&heap);

  bool profile = false;

  int script_arg_start = 1;

  // Eat a secret --profile argument if it's first on the command line.
  if (argc > 1 && 0 == strcmp("--profile", argv[1]))
  {
    profile = true;
    ++script_arg_start;
  }

  lua_State* L = CreateLuaState(&heap, profile);

  bool success = RunBuildScript(L, (const char**) &argv[script_arg_start], argc - script_arg_start);

  if (profile)
    LuaProfilerReport();

  DestroyLuaState(L);

  t2::HeapDestroy(&heap);

	return success ? 0 : 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
callq 0xba50
leaq -0x11(%rbp), %rdi
callq 0xcec0
movb $0x0, -0x12(%rbp)
movl $0x1, -0x18(%rbp)
cmpl $0x1, -0x8(%rbp)
jle 0x6c3e
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
leaq 0x46415(%rip), %rdi     # 0x4d039
callq 0x68c8
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x6c3e
movb $0x1, -0x12(%rbp)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
movb -0x12(%rbp), %al
leaq -0x11(%rbp), %rdi
andb $0x1, %al
movzbl %al, %esi
callq 0x6cb0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
movslq -0x18(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movl -0x8(%rbp), %edx
subl -0x18(%rbp), %edx
callq 0x7130
andb $0x1, %al
movb %al, -0x21(%rbp)
testb $0x1, -0x12(%rbp)
je 0x6c81
callq 0xacf0
movq -0x20(%rbp), %rdi
callq 0x73e0
leaq -0x11(%rbp), %rdi
callq 0xced0
movb -0x21(%rbp), %dl
movl $0x1, %eax
xorl %ecx, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaInterface.cpp
// Function: t2::LuaAllocFunc(void*, void*, unsigned long, unsigned long)
static void* LuaAllocFunc(void* ud, void* old_ptr, size_t old_size, size_t new_size)
{
  MemAllocHeap* heap = static_cast<MemAllocHeap*>(ud);
  if (new_size && old_size)
    return HeapReallocate(heap, old_ptr, new_size);
  else if (new_size)
    return HeapAllocate(heap, new_size);
  else if (old_size)
    HeapFree(heap, old_ptr);

  return nullptr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x6ef5
cmpq $0x0, -0x20(%rbp)
je 0x6ef5
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0xcf20
movq %rax, -0x8(%rbp)
jmp 0x6f2f
cmpq $0x0, -0x28(%rbp)
je 0x6f0f
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0xcee0
movq %rax, -0x8(%rbp)
jmp 0x6f2f
cmpq $0x0, -0x20(%rbp)
je 0x6f23
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xcf00
jmp 0x6f25
jmp 0x6f27
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaInterface.cpp
// Function: t2::DestroyLuaState(lua_State*)
void DestroyLuaState(lua_State* L)
{
  if (s_IsProfiling)
  {
    LuaProfilerDestroy();
    LinearAllocDestroy(&s_ProfilerAllocator);
  }

  lua_close(L);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
testb $0x1, 0x5c24d(%rip)     # 0x63640
je 0x7406
callq 0xac90
leaq 0x5c247(%rip), %rdi     # 0x63648
callq 0xd060
movq -0x8(%rbp), %rdi
callq 0x3bc00
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaInterface.cpp
// Function: t2::LuaTundraDigestGuid(lua_State*)
static int LuaTundraDigestGuid(lua_State* L)
{
  HashDigest digest;
  DoDigest(&digest, L);
  char result[kDigestStringSize];
  DigestToString(result, digest);
  lua_pushstring(L, result);
  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rsi
leaq -0x18(%rbp), %rdi
callq 0x7d50
leaq -0x40(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0xcdf0
movq -0x8(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x2a7a0
movl $0x1, %eax
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaInterface.cpp
// Function: t2::LuaTundraGetEnv(lua_State*)
static int LuaTundraGetEnv(lua_State *L)
{
  const char* key    = luaL_checkstring(L, 1);
  const char* result = getenv(key);

  if (result)
  {
    lua_pushstring(L, result);
    return 1;
  }
  else if (lua_gettop(L) >= 2)
  {
    lua_pushvalue(L, 2);
    return 1;
  }
  else
  {
    return luaL_error(L, "key %s not present in environment (and no default given)", key);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movl $0x1, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x2c330
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x65a0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x776c
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x2a7a0
movl $0x1, -0x4(%rbp)
jmp 0x77aa
movq -0x10(%rbp), %rdi
callq 0x29910
cmpl $0x2, %eax
jl 0x7791
movq -0x10(%rbp), %rdi
movl $0x2, %esi
callq 0x29e10
movl $0x1, -0x4(%rbp)
jmp 0x77aa
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x45a77(%rip), %rsi     # 0x4d217
movb $0x0, %al
callq 0x2c000
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaInterface.cpp
// Function: t2::LuaStatFile(lua_State*)
static int LuaStatFile(lua_State* L)
{
  const char* fn = luaL_checkstring(L, 1);

  FileInfo info = GetFileInfo(fn);

  // Push dir result table on stack
  lua_newtable(L);
  lua_pushinteger(L, (lua_Integer) info.m_Size);
  lua_setfield(L, -2, "size");
  lua_pushinteger(L, (lua_Integer) info.m_Timestamp);
  lua_setfield(L, -2, "timestamp");
  lua_pushboolean(L, info.IsDirectory());
  lua_setfield(L, -2, "isdirectory");
  lua_pushboolean(L, info.Exists());
  lua_setfield(L, -2, "exists");

  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x2c330
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0xc450
movq -0x8(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x2ad70
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x2a6e0
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x45a37(%rip), %rdx     # 0x4d250
callq 0x2b030
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x2a6e0
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x45a1a(%rip), %rdx     # 0x4d255
callq 0x2b030
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x7e60
movq -0x38(%rbp), %rdi
andb $0x1, %al
movzbl %al, %esi
callq 0x2aaa0
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x459f0(%rip), %rdx     # 0x4d25f
callq 0x2b030
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x7e80
movq -0x30(%rbp), %rdi
andb $0x1, %al
movzbl %al, %esi
callq 0x2aaa0
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x459c8(%rip), %rdx     # 0x4d26b
callq 0x2b030
movl $0x1, %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaInterface.cpp
// Function: t2::LuaMakePathBuf(lua_State*)
static int LuaMakePathBuf(lua_State* L)
{
  const char* fn = luaL_checkstring(L, 1);
  PathBuffer buffer;
  PathInit(&buffer, fn);

  lua_newtable(L);
  lua_pushinteger(L, buffer.m_Type);
  lua_setfield(L, -2, "type");
  lua_pushinteger(L, buffer.m_Flags);
  lua_setfield(L, -2, "flags");
  lua_pushinteger(L, buffer.m_LeadingDotDots);
  lua_setfield(L, -2, "leading_dotdots");

  lua_newtable(L);
  for (int i = 0; i < buffer.m_SegCount; ++i)
  {
    lua_pushinteger(L, buffer.m_SegEnds[i]);
    lua_rawseti(L, -2, i + 1);
  }
  lua_setfield(L, -2, "seg_ends");

  int len = buffer.m_SegCount > 0 ? buffer.m_SegEnds[buffer.m_SegCount - 1] : 0;
  lua_pushlstring(L, buffer.m_Data, len);
  lua_setfield(L, -2, "data");

  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2b0, %rsp            # imm = 0x2B0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x2c330
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x29c(%rbp), %rdi
xorl %edx, %edx
callq 0xd180
movq -0x8(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x2ad70
movq -0x8(%rbp), %rdi
movl -0x29c(%rbp), %eax
movl %eax, %esi
callq 0x2a6e0
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x460d5(%rip), %rdx     # 0x4d9fa
callq 0x2b030
movq -0x8(%rbp), %rdi
movzwl -0x298(%rbp), %eax
movl %eax, %esi
callq 0x2a6e0
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x45926(%rip), %rdx     # 0x4d272
callq 0x2b030
movq -0x8(%rbp), %rdi
movzwl -0x294(%rbp), %eax
movl %eax, %esi
callq 0x2a6e0
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x45905(%rip), %rdx     # 0x4d278
callq 0x2b030
movq -0x8(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x2ad70
movl $0x0, -0x2a0(%rbp)
movl -0x2a0(%rbp), %eax
movzwl -0x296(%rbp), %ecx
cmpl %ecx, %eax
jge 0x79e2
movq -0x8(%rbp), %rdi
movslq -0x2a0(%rbp), %rax
movzwl -0x292(%rbp,%rax,2), %eax
movl %eax, %esi
callq 0x2a6e0
movq -0x8(%rbp), %rdi
movl -0x2a0(%rbp), %edx
addl $0x1, %edx
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x2b1a0
movl -0x2a0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2a0(%rbp)
jmp 0x798f
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x45896(%rip), %rdx     # 0x4d288
callq 0x2b030
movzwl -0x296(%rbp), %eax
cmpl $0x0, %eax
jle 0x7a1f
movzwl -0x296(%rbp), %eax
subl $0x1, %eax
cltq
movzwl -0x292(%rbp,%rax,2), %eax
movl %eax, -0x2a8(%rbp)
jmp 0x7a29
xorl %eax, %eax
movl %eax, -0x2a8(%rbp)
jmp 0x7a29
movl -0x2a8(%rbp), %eax
movl %eax, -0x2a4(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x29c(%rbp), %rsi
addq $0x8a, %rsi
movslq -0x2a4(%rbp), %rdx
callq 0x2a720
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x46dca(%rip), %rdx     # 0x4e82d
callq 0x2b030
movl $0x1, %eax
addq $0x2b0, %rsp            # imm = 0x2B0
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaInterface.cpp
// Function: t2::LuaTimeDiff(lua_State*)
static int LuaTimeDiff(lua_State* L)
{
  lua_Integer a = luaL_checkinteger(L, 1);
  lua_Integer b = luaL_checkinteger(L, 2);
  double d = t2::TimerDiffSeconds(a, b);
  char buffer[64];
  snprintf(buffer, sizeof buffer, "%.5f", d);
  lua_pushstring(L, buffer);
  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x2c680
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movl $0x2, %esi
callq 0x2c680
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xc250
movsd %xmm0, -0x20(%rbp)
leaq -0x60(%rbp), %rdi
movsd -0x20(%rbp), %xmm0
movl $0x40, %esi
leaq 0x4564d(%rip), %rdx     # 0x4d2a4
movb $0x1, %al
callq 0x6740
movq -0x8(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x2a7a0
movl $0x1, %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaInterface.cpp
// Function: t2::OnFileIter(void*, t2::FileInfo const&, char const*)
static void OnFileIter(void* user_data, const FileInfo& info, const char* name)
{
  lua_State* L = static_cast<lua_State*>(user_data);

  if (info.IsFile()) 
  {
    lua_pushstring(L, name);
    lua_rawseti(L, -2, (int) lua_objlen(L, -2) + 1);
  }
  else if (info.IsDirectory()) 
  {
    lua_pushstring(L, name);
    lua_rawseti(L, -3, (int) lua_objlen(L, -3) + 1);
  }
  else
  {
    Log(kWarning, "ignoring unsupported file type: %s\n", name);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x7e40
testb $0x1, %al
jne 0x7cab
jmp 0x7ce3
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x2a7a0
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x2a3d0
movq -0x28(%rbp), %rdi
movl %eax, %edx
addl $0x1, %edx
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x2b1a0
jmp 0x7d43
movq -0x10(%rbp), %rdi
callq 0x7e60
testb $0x1, %al
jne 0x7cf2
jmp 0x7d2a
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x2a7a0
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x2a3d0
movq -0x30(%rbp), %rdi
movl %eax, %edx
addl $0x1, %edx
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x2b1a0
jmp 0x7d41
movq -0x18(%rbp), %rdx
movl $0x2, %edi
leaq 0x454b9(%rip), %rsi     # 0x4d1f3
movb $0x0, %al
callq 0xbf20
jmp 0x7d43
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaInterface.cpp
// Function: t2::DoDigest(t2::HashDigest*, lua_State*)
static void DoDigest(HashDigest* out, lua_State* L)
{
  HashState h;
  HashInit(&h);

  int narg = lua_gettop(L);

  for (int i = 1; i <= narg; ++i)
  {
    size_t len;
    unsigned char* data = (unsigned char*) luaL_checklstring(L, i, &len);
    HashUpdate(&h, data, len);
  }

  HashFinalize(&h, out);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0xcb60
movq -0x10(%rbp), %rdi
callq 0x29910
movl %eax, -0xb4(%rbp)
movl $0x1, -0xb8(%rbp)
movl -0xb8(%rbp), %eax
cmpl -0xb4(%rbp), %eax
jg 0x7dde
movq -0x10(%rbp), %rdi
movl -0xb8(%rbp), %esi
leaq -0xc0(%rbp), %rdx
callq 0x2c330
movq %rax, -0xc8(%rbp)
movq -0xc8(%rbp), %rsi
movq -0xc0(%rbp), %rdx
leaq -0xb0(%rbp), %rdi
callq 0xc990
movl -0xb8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb8(%rbp)
jmp 0x7d88
movq -0x8(%rbp), %rsi
leaq -0xb0(%rbp), %rdi
callq 0xcbb0
addq $0xd0, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaInterpolate.cpp
// Function: t2::LuaInterpolate(lua_State*)
static int LuaInterpolate(lua_State* L)
{
  size_t input_len;
  const char* input = luaL_checklstring(L, 1, &input_len);
  luaL_checktype(L, 2, LUA_TTABLE);
  const bool has_vars = lua_type(L, 3) == LUA_TTABLE;

  MemAllocHeap* heap;
  lua_getallocf(L, (void**) &heap);

  LuaEnvLookup lookup = { L, 2, has_vars ? 3 : 0 };
  StringBuffer output(heap);

  if (DoInterpolate(output, input, input_len, lookup))
  {
    lua_pushlstring(L, output.GetBuffer(), output.GetSize());
    return 1;
  }

  return luaL_error(L, "interpolation failed: %s", input);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movl $0x1, %esi
leaq -0x18(%rbp), %rdx
callq 0x2c330
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movl $0x2, %esi
movl $0x5, %edx
callq 0x2c500
movq -0x10(%rbp), %rdi
movl $0x3, %esi
callq 0x29e70
subl $0x5, %eax
sete -0x21(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x2bb70
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movl $0x2, -0x38(%rbp)
movzbl -0x21(%rbp), %ecx
andl $0x1, %ecx
movl %ecx, %eax
leal (%rax,%rax,2), %eax
movl %eax, -0x34(%rbp)
movq -0x30(%rbp), %rsi
leaq -0xa8(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
callq 0x8b60
movq -0xc8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x40(%rbp), %rcx
callq 0x80a0
movb %al, -0xb9(%rbp)
jmp 0x7faf
movb -0xb9(%rbp), %al
testb $0x1, %al
jne 0x7fbe
jmp 0x8042
movq -0x10(%rbp), %rax
movq %rax, -0xd8(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x8ba0
movq %rax, -0xd0(%rbp)
jmp 0x7fde
leaq -0xa8(%rbp), %rdi
callq 0x8be0
movq %rax, -0xe0(%rbp)
jmp 0x7ff3
movq -0xe0(%rbp), %rdx
movq -0xd0(%rbp), %rsi
movq -0xd8(%rbp), %rdi
callq 0x2a720
jmp 0x800f
movl $0x1, -0x4(%rbp)
movl $0x1, -0xb8(%rbp)
jmp 0x8073
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x8c20
jmp 0x808b
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq 0x454a1(%rip), %rsi     # 0x4d4f2
xorl %eax, %eax
callq 0x2c000
movl %eax, -0xe4(%rbp)
jmp 0x8060
movl -0xe4(%rbp), %eax
movl %eax, -0x4(%rbp)
movl $0x1, -0xb8(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x8c20
movl -0x4(%rbp), %eax
addq $0xf0, %rsp
popq %rbp
retq
movq -0xb0(%rbp), %rdi
callq 0x67e0
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaInterpolate.cpp
// Function: t2::DoInterpolate(t2::StringBuffer&, char const*, unsigned long, t2::LuaEnvLookup&)
static bool DoInterpolate(StringBuffer& output, const char* str, size_t len, LuaEnvLookup& lookup)
{
  const char* end = str + len;

  while (str < end)
  {
    char ch = *str++;

    if ('$' == ch)
    {
      if (end != str && '(' == str[0])
      {
        // Don't interpolate $(<) or $(@) without a lookaside table.
        // We leave them in the string.
        if (lookup.m_VarIndex || (str[1] != '<' && str[1] != '@'))
        {
          ++str;
          const char* end_paren = FindEndParen(str, end - str);
          if (!end_paren)
          {
            fprintf(stderr, "unbalanced parens\n");
            return false;
          }
          if (!InterpolateVar(output, str, end_paren - str, lookup))
            return false;
          str = end_paren + 1;
          continue;
        }
      }
    }

    output.Add(&ch, 1);
  }

  return true;
}

// 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), %rax
addq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0x81e0
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movb (%rax), %al
movb %al, -0x31(%rbp)
movsbl -0x31(%rbp), %ecx
movl $0x24, %eax
cmpl %ecx, %eax
jne 0x81c9
movq -0x30(%rbp), %rax
cmpq -0x18(%rbp), %rax
je 0x81c7
movq -0x18(%rbp), %rax
movsbl (%rax), %ecx
movl $0x28, %eax
cmpl %ecx, %eax
jne 0x81c7
movq -0x28(%rbp), %rax
cmpl $0x0, 0xc(%rax)
jne 0x8145
movq -0x18(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x3c, %eax
je 0x81c5
movq -0x18(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x40, %eax
je 0x81c5
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x18(%rbp), %rax
subq %rax, %rsi
callq 0x81f0
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x818e
movq 0x5ae59(%rip), %rax     # 0x62fd0
movq (%rax), %rdi
leaq 0x4538a(%rip), %rsi     # 0x4d50b
movb $0x0, %al
callq 0x6630
movb $0x0, -0x1(%rbp)
jmp 0x81e4
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq -0x18(%rbp), %rax
subq %rax, %rdx
movq -0x28(%rbp), %rcx
callq 0x8280
testb $0x1, %al
jne 0x81b4
movb $0x0, -0x1(%rbp)
jmp 0x81e4
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x80c4
jmp 0x81c7
jmp 0x81c9
movq -0x10(%rbp), %rdi
leaq -0x31(%rbp), %rsi
movl $0x1, %edx
callq 0x8c80
jmp 0x80c4
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaInterpolate.cpp
// Function: t2::FindEndParen(char const*, unsigned long)
static const char* FindEndParen(const char* str, size_t len)
{
  int nesting = 1;
  for (size_t i = 0; i < len; ++i)
  {
    switch (str[i])
    {
      case '(':
        ++nesting;
        break;

      case ')':
        if (--nesting == 0)
          return str + i;
        break;
    }
  }
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x1, -0x1c(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x826e
movq -0x10(%rbp), %rax
movq -0x28(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x2c(%rbp)
subl $0x28, %eax
je 0x8235
jmp 0x822b
movl -0x2c(%rbp), %eax
subl $0x29, %eax
je 0x8240
jmp 0x825e
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x825e
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
cmpl $0x0, %eax
jne 0x825c
movq -0x10(%rbp), %rax
addq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x8276
jmp 0x825e
jmp 0x8260
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x820b
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaInterpolate.cpp
// Function: t2::UnescapeOption(char*)
static void UnescapeOption(char* p)
{
  int r = 0;
  int w = 0;
  while (char ch = p[r++])
  {
    if ('\\' == ch)
    {
      if (p[r] == ':')
      {
        ++r;
        p[w++] = ':';
        continue;
      }
    }
    p[w++] = ch;
  }
  p[w++] = '\0';
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0xc(%rbp)
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0x11(%rbp)
cmpb $0x0, -0x11(%rbp)
je 0x8b3f
movsbl -0x11(%rbp), %ecx
movl $0x5c, %eax
cmpl %ecx, %eax
jne 0x8b25
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x3a, %eax
jne 0x8b23
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movl -0x10(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x10(%rbp)
movslq %ecx, %rcx
movb $0x3a, (%rax,%rcx)
jmp 0x8ac6
jmp 0x8b25
movb -0x11(%rbp), %dl
movq -0x8(%rbp), %rax
movl -0x10(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x10(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
jmp 0x8ac6
movq -0x8(%rbp), %rax
movl -0x10(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x10(%rbp)
movslq %ecx, %rcx
movb $0x0, (%rax,%rcx)
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaInterpolate.cpp
// Function: t2::LuaEnvLookupScope::GetValue(unsigned long, unsigned long*)
const char* GetValue(size_t index, size_t* len_out)
  {
    lua_State* L = m_LuaState;
    CHECK(lua_type(L, -1) == LUA_TTABLE);
    lua_rawgeti(L, -1, int(index + 1));
    if (lua_type(L, -1) != LUA_TSTRING)
    {
      fprintf(stderr, "env lookup failed: elem %d is not a string: %s\n", (int) index + 1, lua_typename(L, lua_type(L, -1)));
      return nullptr;
    }
    // This is technically not allowed but we do it anyway for performance.
    // We check that the value is already a string, and we know it's being
    // kept alive by the table which is on our stack.
    const char* str = lua_tolstring(L, -1, len_out);
    lua_pop(L, 1);
    return str;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x8f81
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rax
addq $0x1, %rax
movl %eax, %edx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x2acf0
movq -0x28(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x29e70
cmpl $0x4, %eax
je 0x9007
movq 0x5a01d(%rip), %rax     # 0x62fd0
movq (%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x28(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x29e70
movq -0x48(%rbp), %rdi
movl %eax, %esi
callq 0x29ec0
movq -0x40(%rbp), %rdi
movl -0x34(%rbp), %edx
movq %rax, %rcx
leaq 0x44577(%rip), %rsi     # 0x4d56d
movb $0x0, %al
callq 0x6630
movq $0x0, -0x8(%rbp)
jmp 0x9033
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rdx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x2a310
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x29940
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)