// File: /workspace/github_c_makefile_star2_O0/aquaxis[P]synverll/src/parser_ir_memory.c
// Function: parser_memory_tree
int parser_memory_tree()
{
	MEMORY_TREE		*memory_tree_current;
	PARSER_TREE_IR	*now_parser_tree_ir;
	char *line;
	char token[STR_MAX];
	char type[STR_MAX];
	char verilog_args[STR_MAX];
	char verilog_proc[STR_MAX];
	char verilog_decl[STR_MAX];
	char *str;
	int num = 0;
	int width;

    printf(" -> Parser Memory Tree\n");

	strcpy(verilog_args, "");

    now_parser_tree_ir = parser_tree_ir_top;
    while(now_parser_tree_ir != NULL){

		if( now_parser_tree_ir->stage == 0 ){
			// stage = 0のみ対象
			switch(now_parser_tree_ir->flag){
				case PARSER_IR_FLAG_ARRAY:
						memory_tree_current = alloc_memory_tree();
						
						memory_tree_current->label	= charalloc(now_parser_tree_ir->label);
						memory_tree_current->type	= charalloc(now_parser_tree_ir->array.type);
						memory_tree_current->num	= -1;
						memory_tree_current->flag	= MEMORY_FLAG_GLOBAL;
						str = charalloc(memory_tree_current->label);
						sprintf(verilog_args, "\tinput [31:0] __base_%s,", convname(sep_p(str)));
						sprintf(verilog_proc, "\t\t\t__sig_%s <= __base_%s;", convname(sep_p(str)), convname(sep_p(str)));
						sprintf(verilog_decl, "\treg [31:0] __sig_%s;", convname(sep_p(str)));
						free(str);
						memory_tree_current->verilog_args = charalloc(verilog_args);
						memory_tree_current->verilog_proc = charalloc(verilog_proc);
						memory_tree_current->verilog_decl = charalloc(verilog_decl);
					break;
				default:
					// ARRAY以外は処理の対象外
					break;
			}
		}else{
			switch(now_parser_tree_ir->flag){
				case PARSER_IR_FLAG_MODULE:
					/*
					 * 関数の引数で受け渡されているポインタのメモリタイプを抜き出す
					 */
					/*
					 * ToDo:
					 *  ここでモジュールの引数の番号の関連付けを作成しなければいけない
					 *  ここで信号定義が作成できるはず
					 */
					line = charalloc(now_parser_tree_ir->module.argument);

					// "("
					get_token_llvm(line, token);

					while(strlen(line) > 0){
						// タイプ
						get_irtype_llvm(line, token);
						if(!strcmp(token, "") || !strcmp(token, ")")) break;
						strcpy(type, token);
						if(is_pointer_type(token)){
							// ポインタの場合
							memory_tree_current = alloc_memory_tree();
							memory_tree_current->flag = MEMORY_FLAG_REGISTER;
							memory_tree_current->num = num++;

							do{
								get_token_llvm(line, token);
								if(!strcmp(token, "align")){
									get_token_llvm(line, token);
									get_token_llvm(line, token);
								}
							}while(
								!strcmp(token, "zeroext") ||
								!strcmp(token, "signext") ||
								!strcmp(token, "inreg") ||
								!strcmp(token, "byval") ||
								!strcmp(token, "sret") ||
								!strcmp(token, "align") ||
								!strcmp(token, "noalias") ||
								!strcmp(token, "nocapture") ||
								!strcmp(token, "nest") ||
								!strcmp(token, "readonly") ||
								!strcmp(token, "readnone") ||
								!strcmp(token, "returned") ||
								!strcmp(token, "dereferenceable") ||
								!strcmp(token, "dereferenceable_or_null")
							);

							memory_tree_current->label = charalloc(token);
							{
								width = get_width(type);
									str = charalloc(memory_tree_current->label);
									sprintf(verilog_args, "\tinput [%d:0] __args_%s,", (width-1), convname(sep_p(str)));
									sprintf(verilog_proc, "\t\t\t__sig_%s <= __args_%s;", convname(sep_p(str)), convname(sep_p(str)));
									sprintf(verilog_decl, "\treg [%d:0] __sig_%s;", (width-1), convname(sep_p(str)));
									free(str);
								convtype(type);
								memory_tree_current->type = charalloc(type);
								memory_tree_current->size = width/4;
							}
						}else{
							/*
							 * 変数の場合は処理をしません。
							 * タイプで入力サイズを変えなければいけないかもしれない。
							 */
							memory_tree_current = alloc_memory_tree();
							memory_tree_current->num = num++;
							memory_tree_current->flag = MEMORY_FLAG_REGISTER;

							get_irtype_llvm(line, token);
							/*
							 * zeroext
							 * signext
							 * inreg
							 * byval
							 * inalloca
							 * sret
							 * align <h>
							 * noalias
							 * nocapture
							 * nest
							 * returned
							 * nonull
							 * dereferenceable(<n>)
							 * dereferenceable_or_null(<n>)
							 */
							if(!strcmp(token, "zeroext") || !strcmp(token, "signext")){
								get_token_llvm(line, token);
							}

							memory_tree_current->label = charalloc(token);

							width = get_width(type);

							sprintf(verilog_args, "\tinput [%d:0] __args_%s,", (width-1), convname(sep_p(token)));
							sprintf(verilog_proc, "\t\t\t__sig_%s <= __args_%s;", convname(sep_p(token)), convname(sep_p(token)));
							sprintf(verilog_decl, "\treg [%d:0] __sig_%s;", (width-1), convname(sep_p(token)));

							memory_tree_current->type = charalloc(type);
							memory_tree_current->size = width/8;
						}
						memory_tree_current->verilog_args = charalloc(verilog_args);
						memory_tree_current->verilog_proc = charalloc(verilog_proc);
						memory_tree_current->verilog_decl = charalloc(verilog_decl);
						// 次の","か")"まで読み飛ばし
						do{
							get_token_llvm(line, token);
						}while(strcmp(token, ",") && strcmp(token, ")"));
					}

					free(line);

					break;

				case PARSER_IR_FLAG_ALLOCA:
					/*
					 * allocaされているメモリを登録する
					 */
					memory_tree_current = alloc_memory_tree();
					memory_tree_current->label = charalloc(now_parser_tree_ir->label);
					memory_tree_current->type = charalloc(now_parser_tree_ir->alloca.type);
					memory_tree_current->flag = MEMORY_FLAG_LOCAL;

					break;

				case PARSER_IR_FLAG_RETURN:
					memory_tree_current = alloc_memory_tree();
					memory_tree_current->flag = MEMORY_FLAG_RETURN;

					if(strcmp(now_parser_tree_ir->ret.type, "void")){
						width = get_width(now_parser_tree_ir->ret.type);
						memory_tree_current->label = charalloc(now_parser_tree_ir->ret.name);
						memory_tree_current->type = charalloc(now_parser_tree_ir->ret.type);
						memory_tree_current->size = width/8;

						sprintf(verilog_args, "\toutput reg [%d:0] __func_result\n", (width-1));
					}else{
						memory_tree_current->label = charalloc("");
						memory_tree_current->type = charalloc("void");
						memory_tree_current->size = 0;

						sprintf(verilog_args, "\toutput reg __func_result\n");
					}

					memory_tree_current->verilog_args = charalloc(verilog_args);

					break;
				default:
					// 他は何もしない
					break;
			}
		}
        now_parser_tree_ir = now_parser_tree_ir->next_ptr;
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1520, %rsp           # imm = 0x1520
movl $0x0, -0x142c(%rbp)
leaq 0xb610(%rip), %rdi      # 0x1380c
movb $0x0, %al
callq 0x1090
leaq -0xc20(%rbp), %rdi
leaq 0xcdb0(%rip), %rsi      # 0x14fc1
callq 0x1050
leaq 0xfef3(%rip), %rax      # 0x18110
movq (%rax), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x8f5a
movq -0x10(%rbp), %rax
cmpl $0x0, 0x1c(%rax)
jne 0x84bf
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
subl $0x6, %eax
jne 0x84b8
jmp 0x824f
callq 0x7b70
movq %rax, -0x8(%rbp)
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
callq 0x13b0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rdi
addq $0x3c34, %rdi           # imm = 0x3C34
callq 0x13b0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x8(%rbp), %rax
movl $0xffffffff, 0x40(%rax) # imm = 0xFFFFFFFF
movq -0x8(%rbp), %rax
movl $0x1, 0x10(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x13b0
movq %rax, -0x1428(%rbp)
leaq -0xc20(%rbp), %rax
movq %rax, -0x1438(%rbp)
movq -0x1428(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x25, %eax
je 0x82e1
movq -0x1428(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x40, %eax
jne 0x82f5
movq -0x1428(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1440(%rbp)
jmp 0x8303
movq -0x1428(%rbp), %rax
movq %rax, -0x1440(%rbp)
movq -0x1440(%rbp), %rdi
callq 0x1400
movq -0x1438(%rbp), %rdi
movq %rax, %rdx
leaq 0xb504(%rip), %rsi      # 0x13824
movb $0x0, %al
callq 0x1160
leaq -0x1020(%rbp), %rax
movq %rax, -0x1448(%rbp)
movq -0x1428(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x25, %eax
je 0x8353
movq -0x1428(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x40, %eax
jne 0x8367
movq -0x1428(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1450(%rbp)
jmp 0x8375
movq -0x1428(%rbp), %rax
movq %rax, -0x1450(%rbp)
movq -0x1450(%rbp), %rdi
callq 0x1400
movq %rax, -0x1458(%rbp)
movq -0x1428(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x25, %eax
je 0x83a6
movq -0x1428(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x40, %eax
jne 0x83ba
movq -0x1428(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1460(%rbp)
jmp 0x83c8
movq -0x1428(%rbp), %rax
movq %rax, -0x1460(%rbp)
movq -0x1460(%rbp), %rdi
callq 0x1400
movq -0x1448(%rbp), %rdi
movq -0x1458(%rbp), %rdx
movq %rax, %rcx
leaq 0xb451(%rip), %rsi      # 0x1383d
movb $0x0, %al
callq 0x1160
leaq -0x1420(%rbp), %rax
movq %rax, -0x1468(%rbp)
movq -0x1428(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x25, %eax
je 0x841f
movq -0x1428(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x40, %eax
jne 0x8433
movq -0x1428(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1470(%rbp)
jmp 0x8441
movq -0x1428(%rbp), %rax
movq %rax, -0x1470(%rbp)
movq -0x1470(%rbp), %rdi
callq 0x1400
movq -0x1468(%rbp), %rdi
movq %rax, %rdx
leaq 0xb3f9(%rip), %rsi      # 0x13857
movb $0x0, %al
callq 0x1160
movq -0x1428(%rbp), %rdi
callq 0x1030
leaq -0xc20(%rbp), %rdi
callq 0x13b0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x28(%rax)
leaq -0x1020(%rbp), %rdi
callq 0x13b0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x30(%rax)
leaq -0x1420(%rbp), %rdi
callq 0x13b0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x38(%rax)
jmp 0x84ba
jmp 0x84ba
jmp 0x8f49
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x1474(%rbp)
subl $0x9, %eax
je 0x8dd4
jmp 0x84d7
movl -0x1474(%rbp), %eax
subl $0xf, %eax
je 0x84f8
jmp 0x84e4
movl -0x1474(%rbp), %eax
subl $0x12, %eax
je 0x8e20
jmp 0x8f45
movq -0x10(%rbp), %rdi
addq $0xc30, %rdi            # imm = 0xC30
addq $0x800, %rdi            # imm = 0x800
callq 0x13b0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x420(%rbp), %rsi
callq 0x11ca0
movq -0x18(%rbp), %rdi
callq 0x1070
cmpq $0x0, %rax
jbe 0x8dc6
movq -0x18(%rbp), %rdi
leaq -0x420(%rbp), %rsi
callq 0x25b0
leaq -0x420(%rbp), %rdi
leaq 0xca6d(%rip), %rsi      # 0x14fc1
callq 0x10d0
cmpl $0x0, %eax
je 0x8576
leaq -0x420(%rbp), %rdi
leaq 0xbbad(%rip), %rsi      # 0x14119
callq 0x10d0
cmpl $0x0, %eax
jne 0x857b
jmp 0x8dc6
leaq -0x820(%rbp), %rdi
leaq -0x420(%rbp), %rsi
callq 0x1050
leaq -0x420(%rbp), %rdi
callq 0x5400
cmpl $0x0, %eax
je 0x8a8c
callq 0x7b70
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl $0x4, 0x10(%rax)
movl -0x142c(%rbp), %ecx
movl %ecx, %eax
addl $0x1, %eax
movl %eax, -0x142c(%rbp)
movq -0x8(%rbp), %rax
movl %ecx, 0x40(%rax)
movq -0x18(%rbp), %rdi
leaq -0x420(%rbp), %rsi
callq 0x11ca0
leaq -0x420(%rbp), %rdi
leaq 0xb280(%rip), %rsi      # 0x1386d
callq 0x10d0
cmpl $0x0, %eax
jne 0x8617
movq -0x18(%rbp), %rdi
leaq -0x420(%rbp), %rsi
callq 0x11ca0
movq -0x18(%rbp), %rdi
leaq -0x420(%rbp), %rsi
callq 0x11ca0
jmp 0x8619
leaq -0x420(%rbp), %rdi
leaq 0xaff2(%rip), %rsi      # 0x13619
callq 0x10d0
movl %eax, %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x1475(%rbp)
je 0x881c
leaq -0x420(%rbp), %rdi
leaq 0xb226(%rip), %rsi      # 0x13873
callq 0x10d0
movl %eax, %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x1475(%rbp)
je 0x881c
leaq -0x420(%rbp), %rdi
leaq 0xb208(%rip), %rsi      # 0x1387b
callq 0x10d0
movl %eax, %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x1475(%rbp)
je 0x881c
leaq -0x420(%rbp), %rdi
leaq 0xb1e8(%rip), %rsi      # 0x13881
callq 0x10d0
movl %eax, %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x1475(%rbp)
je 0x881c
leaq -0x420(%rbp), %rdi
leaq 0xb1c8(%rip), %rsi      # 0x13887
callq 0x10d0
movl %eax, %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x1475(%rbp)
je 0x881c
leaq -0x420(%rbp), %rdi
leaq 0xb188(%rip), %rsi      # 0x1386d
callq 0x10d0
movl %eax, %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x1475(%rbp)
je 0x881c
leaq -0x420(%rbp), %rdi
leaq 0xb181(%rip), %rsi      # 0x1388c
callq 0x10d0
movl %eax, %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x1475(%rbp)
je 0x881c
leaq -0x420(%rbp), %rdi
leaq 0xb163(%rip), %rsi      # 0x13894
callq 0x10d0
movl %eax, %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x1475(%rbp)
je 0x881c
leaq -0x420(%rbp), %rdi
leaq 0xb147(%rip), %rsi      # 0x1389e
callq 0x10d0
movl %eax, %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x1475(%rbp)
je 0x881c
leaq -0x420(%rbp), %rdi
leaq 0xb126(%rip), %rsi      # 0x138a3
callq 0x10d0
movl %eax, %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x1475(%rbp)
je 0x881c
leaq -0x420(%rbp), %rdi
leaq 0xb109(%rip), %rsi      # 0x138ac
callq 0x10d0
movl %eax, %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x1475(%rbp)
je 0x881c
leaq -0x420(%rbp), %rdi
leaq 0xb0f0(%rip), %rsi      # 0x138b5
callq 0x10d0
movl %eax, %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x1475(%rbp)
je 0x881c
leaq -0x420(%rbp), %rdi
leaq 0xb0d7(%rip), %rsi      # 0x138be
callq 0x10d0
movl %eax, %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x1475(%rbp)
je 0x881c
leaq -0x420(%rbp), %rdi
leaq 0xb0c5(%rip), %rsi      # 0x138ce
callq 0x10d0
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
movb %al, -0x1475(%rbp)
movb -0x1475(%rbp), %al
testb $0x1, %al
jne 0x85cf
leaq -0x420(%rbp), %rdi
callq 0x13b0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
leaq -0x820(%rbp), %rdi
callq 0x12a0
movl %eax, -0x1430(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x13b0
movq %rax, -0x1428(%rbp)
leaq -0xc20(%rbp), %rax
movq %rax, -0x1488(%rbp)
movl -0x1430(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x147c(%rbp)
movq -0x1428(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x25, %eax
je 0x88a2
movq -0x1428(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x40, %eax
jne 0x88b6
movq -0x1428(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1490(%rbp)
jmp 0x88c4
movq -0x1428(%rbp), %rax
movq %rax, -0x1490(%rbp)
movq -0x1490(%rbp), %rdi
callq 0x1400
movq -0x1488(%rbp), %rdi
movl -0x147c(%rbp), %edx
movq %rax, %rcx
leaq 0xafff(%rip), %rsi      # 0x138e6
movb $0x0, %al
callq 0x1160
leaq -0x1020(%rbp), %rax
movq %rax, -0x1498(%rbp)
movq -0x1428(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x25, %eax
je 0x891a
movq -0x1428(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x40, %eax
jne 0x892e
movq -0x1428(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x14a0(%rbp)
jmp 0x893c
movq -0x1428(%rbp), %rax
movq %rax, -0x14a0(%rbp)
movq -0x14a0(%rbp), %rdi
callq 0x1400
movq %rax, -0x14a8(%rbp)
movq -0x1428(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x25, %eax
je 0x896d
movq -0x1428(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x40, %eax
jne 0x8981
movq -0x1428(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x14b0(%rbp)
jmp 0x898f
movq -0x1428(%rbp), %rax
movq %rax, -0x14b0(%rbp)
movq -0x14b0(%rbp), %rdi
callq 0x1400
movq -0x1498(%rbp), %rdi
movq -0x14a8(%rbp), %rdx
movq %rax, %rcx
leaq 0xaf4c(%rip), %rsi      # 0x138ff
movb $0x0, %al
callq 0x1160
leaq -0x1420(%rbp), %rax
movq %rax, -0x14c0(%rbp)
movl -0x1430(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x14b4(%rbp)
movq -0x1428(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x25, %eax
je 0x89f5
movq -0x1428(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x40, %eax
jne 0x8a09
movq -0x1428(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x14c8(%rbp)
jmp 0x8a17
movq -0x1428(%rbp), %rax
movq %rax, -0x14c8(%rbp)
movq -0x14c8(%rbp), %rdi
callq 0x1400
movq -0x14c0(%rbp), %rdi
movl -0x14b4(%rbp), %edx
movq %rax, %rcx
leaq 0xaedf(%rip), %rsi      # 0x13919
movb $0x0, %al
callq 0x1160
movq -0x1428(%rbp), %rdi
callq 0x1030
leaq -0x820(%rbp), %rdi
callq 0x14f0
leaq -0x820(%rbp), %rdi
callq 0x13b0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x20(%rax)
movl -0x1430(%rbp), %eax
movl $0x4, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x44(%rax)
jmp 0x8d21
callq 0x7b70
movq %rax, -0x8(%rbp)
movl -0x142c(%rbp), %ecx
movl %ecx, %eax
addl $0x1, %eax
movl %eax, -0x142c(%rbp)
movq -0x8(%rbp), %rax
movl %ecx, 0x40(%rax)
movq -0x8(%rbp), %rax
movl $0x4, 0x10(%rax)
movq -0x18(%rbp), %rdi
leaq -0x420(%rbp), %rsi
callq 0x25b0
leaq -0x420(%rbp), %rdi
leaq 0xab43(%rip), %rsi      # 0x13619
callq 0x10d0
cmpl $0x0, %eax
je 0x8af8
leaq -0x420(%rbp), %rdi
leaq 0xad85(%rip), %rsi      # 0x13873
callq 0x10d0
cmpl $0x0, %eax
jne 0x8b08
movq -0x18(%rbp), %rdi
leaq -0x420(%rbp), %rsi
callq 0x11ca0
leaq -0x420(%rbp), %rdi
callq 0x13b0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
leaq -0x820(%rbp), %rdi
callq 0x12a0
movl %eax, -0x1430(%rbp)
leaq -0xc20(%rbp), %rax
movq %rax, -0x14d8(%rbp)
movl -0x1430(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x14cc(%rbp)
movsbl -0x420(%rbp), %eax
cmpl $0x25, %eax
je 0x8b66
movsbl -0x420(%rbp), %eax
cmpl $0x40, %eax
jne 0x8b7a
leaq -0x420(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x14e0(%rbp)
jmp 0x8b88
leaq -0x420(%rbp), %rax
movq %rax, -0x14e0(%rbp)
movq -0x14e0(%rbp), %rdi
callq 0x1400
movq -0x14d8(%rbp), %rdi
movl -0x14cc(%rbp), %edx
movq %rax, %rcx
leaq 0xad3b(%rip), %rsi      # 0x138e6
movb $0x0, %al
callq 0x1160
leaq -0x1020(%rbp), %rax
movq %rax, -0x14e8(%rbp)
movsbl -0x420(%rbp), %eax
cmpl $0x25, %eax
je 0x8bd8
movsbl -0x420(%rbp), %eax
cmpl $0x40, %eax
jne 0x8bec
leaq -0x420(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x14f0(%rbp)
jmp 0x8bfa
leaq -0x420(%rbp), %rax
movq %rax, -0x14f0(%rbp)
movq -0x14f0(%rbp), %rdi
callq 0x1400
movq %rax, -0x14f8(%rbp)
movsbl -0x420(%rbp), %eax
cmpl $0x25, %eax
je 0x8c25
movsbl -0x420(%rbp), %eax
cmpl $0x40, %eax
jne 0x8c39
leaq -0x420(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1500(%rbp)
jmp 0x8c47
leaq -0x420(%rbp), %rax
movq %rax, -0x1500(%rbp)
movq -0x1500(%rbp), %rdi
callq 0x1400
movq -0x14e8(%rbp), %rdi
movq -0x14f8(%rbp), %rdx
movq %rax, %rcx
leaq 0xac94(%rip), %rsi      # 0x138ff
movb $0x0, %al
callq 0x1160
leaq -0x1420(%rbp), %rax
movq %rax, -0x1510(%rbp)
movl -0x1430(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x1504(%rbp)
movsbl -0x420(%rbp), %eax
cmpl $0x25, %eax
je 0x8ca7
movsbl -0x420(%rbp), %eax
cmpl $0x40, %eax
jne 0x8cbb
leaq -0x420(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1518(%rbp)
jmp 0x8cc9
leaq -0x420(%rbp), %rax
movq %rax, -0x1518(%rbp)
movq -0x1518(%rbp), %rdi
callq 0x1400
movq -0x1510(%rbp), %rdi
movl -0x1504(%rbp), %edx
movq %rax, %rcx
leaq 0xac2d(%rip), %rsi      # 0x13919
movb $0x0, %al
callq 0x1160
leaq -0x820(%rbp), %rdi
callq 0x13b0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x20(%rax)
movl -0x1430(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x44(%rax)
leaq -0xc20(%rbp), %rdi
callq 0x13b0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x28(%rax)
leaq -0x1020(%rbp), %rdi
callq 0x13b0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x30(%rax)
leaq -0x1420(%rbp), %rdi
callq 0x13b0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x18(%rbp), %rdi
leaq -0x420(%rbp), %rsi
callq 0x11ca0
leaq -0x420(%rbp), %rdi
leaq 0xbd11(%rip), %rsi      # 0x14a95
callq 0x10d0
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x1519(%rbp)
je 0x8db7
leaq -0x420(%rbp), %rdi
leaq 0xb373(%rip), %rsi      # 0x14119
callq 0x10d0
cmpl $0x0, %eax
setne %al
movb %al, -0x1519(%rbp)
movb -0x1519(%rbp), %al
testb $0x1, %al
jne 0x8d66
jmp 0x8523
movq -0x18(%rbp), %rdi
callq 0x1030
jmp 0x8f47
callq 0x7b70
movq %rax, -0x8(%rbp)
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
callq 0x13b0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rdi
addq $0x6c34, %rdi           # imm = 0x6C34
callq 0x13b0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x8(%rbp), %rax
movl $0x2, 0x10(%rax)
jmp 0x8f47
callq 0x7b70
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl $0x5, 0x10(%rax)
movq -0x10(%rbp), %rdi
addq $0x6434, %rdi           # imm = 0x6434
leaq 0xa1be(%rip), %rsi      # 0x13004
callq 0x10d0
cmpl $0x0, %eax
je 0x8ede
movq -0x10(%rbp), %rdi
addq $0x6434, %rdi           # imm = 0x6434
callq 0x12a0
movl %eax, -0x1430(%rbp)
movq -0x10(%rbp), %rdi
addq $0x6434, %rdi           # imm = 0x6434
addq $0x400, %rdi            # imm = 0x400
callq 0x13b0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rdi
addq $0x6434, %rdi           # imm = 0x6434
callq 0x13b0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x20(%rax)
movl -0x1430(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x44(%rax)
leaq -0xc20(%rbp), %rdi
movl -0x1430(%rbp), %edx
subl $0x1, %edx
leaq 0xaa5a(%rip), %rsi      # 0x1392f
movb $0x0, %al
callq 0x1160
jmp 0x8f2c
leaq 0xc0dc(%rip), %rdi      # 0x14fc1
callq 0x13b0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
leaq 0xa108(%rip), %rdi      # 0x13004
callq 0x13b0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x44(%rax)
leaq -0xc20(%rbp), %rdi
leaq 0xaa2c(%rip), %rsi      # 0x13951
movb $0x0, %al
callq 0x1160
leaq -0xc20(%rbp), %rdi
callq 0x13b0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x28(%rax)
jmp 0x8f47
jmp 0x8f47
jmp 0x8f49
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0x8224
xorl %eax, %eax
addq $0x1520, %rsp           # imm = 0x1520
popq %rbp
retq
nopw %cs:(%rax,%rax)