// File: /workspace/github_c_makefile_star2_O0/mikecat[P]x86_interpreter/dynamic_memory.c
// Function: dmemory_allocate
void dmemory_allocate(uint32_t addr, uint32_t size) {
	int fidx_s, sidx_s, fidx_e, sidx_e;
	if (!get_idxs(&fidx_s, &sidx_s, &fidx_e, &sidx_e, addr, size)) return;
	int i, j;
	for (i = fidx_s; i <= fidx_e; i++) {
		int jmin = (i == fidx_s ? sidx_s : 0);
		int jmax = (i == fidx_e ? sidx_e : SECOND_TABLE_SIZE - 1);
		if (aut_table[i] == NULL) {
			aut_table[i] = malloc(sizeof(*aut_table[i]));
			if (aut_table[i] == NULL) {
				perror("malloc");
				exit(1);
			}
			for (j = 0; j < SECOND_TABLE_SIZE; j++) (*aut_table[i])[j] = NULL;
		}
		for (j = jmin; j <= jmax; j++) {
			if ((*aut_table[i])[j] == NULL) {
				(*aut_table[i])[j] = calloc(1, sizeof(*(*aut_table[i])[j]));
				if ((*aut_table[i])[j] == NULL) {
					perror("calloc");
					exit(1);
				}
			}
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl -0x4(%rbp), %r8d
movl -0x8(%rbp), %r9d
leaq -0xc(%rbp), %rdi
leaq -0x10(%rbp), %rsi
leaq -0x14(%rbp), %rdx
leaq -0x18(%rbp), %rcx
callq 0x7a20
cmpl $0x0, %eax
jne 0x7c95
jmp 0x7e19
movl -0xc(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jg 0x7e19
movl -0x1c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jne 0x7cb7
movl -0x10(%rbp), %eax
movl %eax, -0x2c(%rbp)
jmp 0x7cbe
xorl %eax, %eax
movl %eax, -0x2c(%rbp)
jmp 0x7cbe
movl -0x2c(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jne 0x7cd4
movl -0x18(%rbp), %eax
movl %eax, -0x30(%rbp)
jmp 0x7cde
movl $0x3ff, %eax            # imm = 0x3FF
movl %eax, -0x30(%rbp)
jmp 0x7cde
movl -0x30(%rbp), %eax
movl %eax, -0x28(%rbp)
movslq -0x1c(%rbp), %rcx
leaq 0xd541(%rip), %rax      # 0x15230
cmpq $0x0, (%rax,%rcx,8)
jne 0x7d72
movl $0x2000, %edi           # imm = 0x2000
callq 0x1110
movq %rax, %rdx
movslq -0x1c(%rbp), %rcx
leaq 0xd522(%rip), %rax      # 0x15230
movq %rdx, (%rax,%rcx,8)
movslq -0x1c(%rbp), %rcx
leaq 0xd513(%rip), %rax      # 0x15230
cmpq $0x0, (%rax,%rcx,8)
jne 0x7d3a
leaq 0x9e86(%rip), %rdi      # 0x11bb1
callq 0x1170
movl $0x1, %edi
callq 0x1190
movl $0x0, -0x20(%rbp)
cmpl $0x400, -0x20(%rbp)     # imm = 0x400
jge 0x7d70
movslq -0x1c(%rbp), %rcx
leaq 0xd4db(%rip), %rax      # 0x15230
movq (%rax,%rcx,8), %rax
movslq -0x20(%rbp), %rcx
movq $0x0, (%rax,%rcx,8)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x7d41
jmp 0x7d72
movl -0x24(%rbp), %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x28(%rbp), %eax
jg 0x7e09
movslq -0x1c(%rbp), %rcx
leaq 0xd4a1(%rip), %rax      # 0x15230
movq (%rax,%rcx,8), %rax
movslq -0x20(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
jne 0x7df9
movl $0x1, %edi
movl $0x1000, %esi           # imm = 0x1000
callq 0x10b0
movq %rax, %rdx
movslq -0x1c(%rbp), %rcx
leaq 0xd475(%rip), %rax      # 0x15230
movq (%rax,%rcx,8), %rax
movslq -0x20(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movslq -0x1c(%rbp), %rcx
leaq 0xd45e(%rip), %rax      # 0x15230
movq (%rax,%rcx,8), %rax
movslq -0x20(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
jne 0x7df7
leaq 0x9dd0(%rip), %rdi      # 0x11bb8
callq 0x1170
movl $0x1, %edi
callq 0x1190
jmp 0x7df9
jmp 0x7dfb
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x7d78
jmp 0x7e0b
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x7c9b
addq $0x30, %rsp
popq %rbp
retq
nop